1 /* SPDX-License-Identifier: GPL-2.0+ */
9 #include <linux/sizes.h>
10 #include <linux/stringify.h>
11 #include <asm/arch/imx-regs.h>
13 #define CONFIG_SYS_BOOTM_LEN (64 * SZ_1M)
15 #ifdef CONFIG_SPL_BUILD
16 #define CONFIG_SYS_MONITOR_LEN (1024 * 1024)
18 #define CONFIG_SPL_BSS_START_ADDR 0x00128000
19 #define CONFIG_SYS_SPL_MALLOC_START 0x00120000
20 #define CONFIG_SYS_SPL_MALLOC_SIZE 0x3000 /* 12 KB */
21 #define CONFIG_SERIAL_LPUART_BASE 0x5a060000
22 #define CONFIG_MALLOC_F_ADDR 0x00120000
24 #define CONFIG_SPL_RAW_IMAGE_ARM_TRUSTED_FIRMWARE
26 #define CONFIG_SPL_ABORT_ON_RAW_IMAGE
29 #ifdef CONFIG_AHAB_BOOT
30 #define AHAB_ENV "sec_boot=yes\0"
32 #define AHAB_ENV "sec_boot=no\0"
35 /* Initial environment variables */
36 #define CONFIG_EXTRA_ENV_SETTINGS \
41 "console=ttyLP0,${baudrate} earlycon=lpuart32,0x5a060000,${baudrate}\0" \
42 "fdt_addr=0x83000000\0" \
43 "fdt_high=0xffffffffffffffff\0" \
45 "fdt_file=undefined\0" \
46 "initrd_addr=0x83800000\0" \
47 "initrd_high=0xffffffffffffffff\0" \
48 "mmcdev="__stringify(CONFIG_SYS_MMC_ENV_DEV)"\0" \
50 "mmcroot=/dev/mmcblk1p2 rootwait rw\0" \
51 "mmcautodetect=yes\0" \
52 "mmcargs=setenv bootargs console=${console} root=${mmcroot}\0 " \
53 "loadbootscript=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \
54 "bootscript=echo Running bootscript from mmc ...; " \
56 "loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}\0" \
57 "loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \
58 "boot_os=booti ${loadaddr} - ${fdt_addr};\0" \
59 "loadcntr=fatload mmc ${mmcdev}:${mmcpart} ${cntr_addr} ${cntr_file}\0" \
60 "auth_os=auth_cntr ${cntr_addr}\0" \
61 "mmcboot=echo Booting from mmc ...; " \
63 "if test ${sec_boot} = yes; then " \
64 "if run auth_os; then " \
67 "echo ERR: failed to authenticate; " \
70 "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
71 "if run loadfdt; then " \
74 "echo WARN: Cannot load the DT; " \
77 "echo wait for boot; " \
80 "netargs=setenv bootargs console=${console} " \
82 "ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \
83 "netboot=echo Booting from net ...; " \
85 "if test ${ip_dyn} = yes; then " \
86 "setenv get_cmd dhcp; " \
88 "setenv get_cmd tftp; " \
90 "if test ${sec_boot} = yes; then " \
91 "${get_cmd} ${cntr_addr} ${cntr_file}; " \
92 "if run auth_os; then " \
95 "echo ERR: failed to authenticate; " \
98 "${get_cmd} ${loadaddr} ${image}; " \
99 "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
100 "if ${get_cmd} ${fdt_addr} ${fdt_file}; then " \
101 "booti ${loadaddr} - ${fdt_addr}; " \
103 "echo WARN: Cannot load the DT; " \
110 /* Link Definitions */
112 /* Default environment is in SD */
114 /* On LPDDR4 board, USDHC1 is for eMMC, USDHC2 is for SD on CPU board */
116 #define CONFIG_SYS_SDRAM_BASE 0x80000000
117 #define PHYS_SDRAM_1 0x80000000
118 #define PHYS_SDRAM_2 0x880000000
119 #define PHYS_SDRAM_1_SIZE 0x80000000 /* 2 GB */
120 #define PHYS_SDRAM_2_SIZE 0x100000000 /* 4 GB */
122 #endif /* __IMX8QM_MEK_H */