1 /* SPDX-License-Identifier: GPL-2.0-or-later
3 * Copyright (C) 2020 PHYTEC Messtechnik GmbH
7 #ifndef __PHYCORE_IMX8MP_H
8 #define __PHYCORE_IMX8MP_H
10 #include <linux/sizes.h>
11 #include <asm/arch/imx-regs.h>
13 #define CONFIG_SYS_BOOTM_LEN SZ_64M
15 #define CONFIG_SPL_MAX_SIZE (152 * SZ_1K)
16 #define CONFIG_SYS_MONITOR_LEN SZ_512K
17 #define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR
18 #define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR 0x300
19 #define CONFIG_SYS_UBOOT_BASE \
20 (QSPI0_AMBA_BASE + CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR * 512)
22 #ifdef CONFIG_SPL_BUILD
23 #define CONFIG_SPL_LDSCRIPT "arch/arm/cpu/armv8/u-boot-spl.lds"
24 #define CONFIG_SPL_STACK 0x960000
25 #define CONFIG_SPL_BSS_START_ADDR 0x98FC00
26 #define CONFIG_SPL_BSS_MAX_SIZE SZ_1K
27 #define CONFIG_SYS_SPL_MALLOC_START 0x42200000
28 #define CONFIG_SYS_SPL_MALLOC_SIZE SZ_512K
30 #define CONFIG_SPL_ABORT_ON_RAW_IMAGE
32 #define CONFIG_POWER_PCA9450
36 #define CONFIG_EXTRA_ENV_SETTINGS \
38 "console=ttymxc0,115200\0" \
39 "fdt_addr=0x48000000\0" \
40 "fdt_file=" CONFIG_DEFAULT_FDT_FILE "\0" \
42 "mmcdev=" __stringify(CONFIG_SYS_MMC_ENV_DEV) "\0" \
43 "mmcpart=" __stringify(CONFIG_SYS_MMC_IMG_LOAD_PART) "\0" \
45 "mmcautodetect=yes\0" \
46 "mmcargs=setenv bootargs console=${console} " \
47 "root=/dev/mmcblk${mmcdev}p${mmcroot} rootwait rw\0" \
48 "loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}\0" \
49 "loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \
50 "mmcboot=echo Booting from mmc ...; " \
52 "if run loadfdt; then " \
53 "booti ${loadaddr} - ${fdt_addr}; " \
55 "echo WARN: Cannot load the DT; " \
58 "netargs=setenv bootargs console=${console} root=/dev/nfs ip=dhcp " \
59 "nfsroot=${serverip}:${nfsroot},v3,tcp\0" \
60 "netboot=echo Booting from net ...; " \
62 "if test ${ip_dyn} = yes; then " \
63 "setenv get_cmd dhcp; " \
65 "setenv get_cmd tftp; " \
67 "${get_cmd} ${loadaddr} ${image}; " \
68 "if ${get_cmd} ${fdt_addr} ${fdt_file}; then " \
69 "booti ${loadaddr} - ${fdt_addr}; " \
71 "echo WARN: Cannot load the DT; " \
74 #define CONFIG_BOOTCOMMAND \
75 "mmc dev ${mmcdev}; if mmc rescan; then " \
76 "if run loadimage; then " \
78 "else run netboot; " \
82 /* Link Definitions */
84 #define CONFIG_SYS_INIT_RAM_ADDR 0x40000000
85 #define CONFIG_SYS_INIT_RAM_SIZE SZ_512K
86 #define CONFIG_SYS_INIT_SP_OFFSET \
87 (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
88 #define CONFIG_SYS_INIT_SP_ADDR \
89 (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
91 #define CONFIG_MMCROOT "/dev/mmcblk2p2" /* USDHC3 */
93 #define CONFIG_SYS_SDRAM_BASE 0x40000000
95 #define PHYS_SDRAM 0x40000000
96 #define PHYS_SDRAM_SIZE 0x80000000
99 #define CONFIG_MXC_UART_BASE UART1_BASE_ADDR
101 /* Monitor Command Prompt */
102 #define CONFIG_SYS_CBSIZE SZ_2K
103 #define CONFIG_SYS_MAXARGS 64
104 #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE
107 #define CONFIG_FSL_USDHC
108 #define CONFIG_SYS_FSL_USDHC_NUM 2
109 #define CONFIG_SYS_FSL_ESDHC_ADDR 0
110 #define CONFIG_SYS_MMC_IMG_LOAD_PART 1
112 #endif /* __PHYCORE_IMX8MP_H */