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_SERIAL_LPUART_BASE 0x5a060000
19 #define CONFIG_MALLOC_F_ADDR 0x00120000
21 #define CONFIG_SPL_RAW_IMAGE_ARM_TRUSTED_FIRMWARE
23 #define CONFIG_SPL_ABORT_ON_RAW_IMAGE
26 #ifdef CONFIG_AHAB_BOOT
27 #define AHAB_ENV "sec_boot=yes\0"
29 #define AHAB_ENV "sec_boot=no\0"
32 /* Initial environment variables */
33 #define CONFIG_EXTRA_ENV_SETTINGS \
38 "console=ttyLP0,${baudrate} earlycon=lpuart32,0x5a060000,${baudrate}\0" \
39 "fdt_addr=0x83000000\0" \
40 "fdt_high=0xffffffffffffffff\0" \
42 "fdt_file=undefined\0" \
43 "initrd_addr=0x83800000\0" \
44 "initrd_high=0xffffffffffffffff\0" \
45 "mmcdev="__stringify(CONFIG_SYS_MMC_ENV_DEV)"\0" \
47 "mmcroot=/dev/mmcblk1p2 rootwait rw\0" \
48 "mmcautodetect=yes\0" \
49 "mmcargs=setenv bootargs console=${console} root=${mmcroot}\0 " \
50 "loadbootscript=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \
51 "bootscript=echo Running bootscript from mmc ...; " \
53 "loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}\0" \
54 "loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \
55 "boot_os=booti ${loadaddr} - ${fdt_addr};\0" \
56 "loadcntr=fatload mmc ${mmcdev}:${mmcpart} ${cntr_addr} ${cntr_file}\0" \
57 "auth_os=auth_cntr ${cntr_addr}\0" \
58 "mmcboot=echo Booting from mmc ...; " \
60 "if test ${sec_boot} = yes; then " \
61 "if run auth_os; then " \
64 "echo ERR: failed to authenticate; " \
67 "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
68 "if run loadfdt; then " \
71 "echo WARN: Cannot load the DT; " \
74 "echo wait for boot; " \
77 "netargs=setenv bootargs console=${console} " \
79 "ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \
80 "netboot=echo Booting from net ...; " \
82 "if test ${ip_dyn} = yes; then " \
83 "setenv get_cmd dhcp; " \
85 "setenv get_cmd tftp; " \
87 "if test ${sec_boot} = yes; then " \
88 "${get_cmd} ${cntr_addr} ${cntr_file}; " \
89 "if run auth_os; then " \
92 "echo ERR: failed to authenticate; " \
95 "${get_cmd} ${loadaddr} ${image}; " \
96 "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
97 "if ${get_cmd} ${fdt_addr} ${fdt_file}; then " \
98 "booti ${loadaddr} - ${fdt_addr}; " \
100 "echo WARN: Cannot load the DT; " \
107 /* Link Definitions */
109 /* Default environment is in SD */
111 /* On LPDDR4 board, USDHC1 is for eMMC, USDHC2 is for SD on CPU board */
113 #define CONFIG_SYS_SDRAM_BASE 0x80000000
114 #define PHYS_SDRAM_1 0x80000000
115 #define PHYS_SDRAM_2 0x880000000
116 #define PHYS_SDRAM_1_SIZE 0x80000000 /* 2 GB */
117 #define PHYS_SDRAM_2_SIZE 0x100000000 /* 4 GB */
119 #endif /* __IMX8QM_MEK_H */