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 #ifdef CONFIG_XPL_BUILD
14 #define CFG_MALLOC_F_ADDR 0x00120000
18 #ifdef CONFIG_AHAB_BOOT
19 #define AHAB_ENV "sec_boot=yes\0"
21 #define AHAB_ENV "sec_boot=no\0"
24 /* Initial environment variables */
25 #define CFG_EXTRA_ENV_SETTINGS \
30 "console=ttyLP0,${baudrate} earlycon=lpuart32,0x5a060000,${baudrate}\0" \
31 "fdt_addr=0x83000000\0" \
32 "fdt_high=0xffffffffffffffff\0" \
34 "fdt_file=undefined\0" \
35 "initrd_addr=0x83800000\0" \
36 "initrd_high=0xffffffffffffffff\0" \
37 "mmcdev="__stringify(CONFIG_SYS_MMC_ENV_DEV)"\0" \
39 "mmcroot=/dev/mmcblk1p2 rootwait rw\0" \
40 "mmcautodetect=yes\0" \
41 "mmcargs=setenv bootargs console=${console} root=${mmcroot}\0 " \
42 "loadbootscript=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \
43 "bootscript=echo Running bootscript from mmc ...; " \
45 "loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}\0" \
46 "loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \
47 "boot_os=booti ${loadaddr} - ${fdt_addr};\0" \
48 "loadcntr=fatload mmc ${mmcdev}:${mmcpart} ${cntr_addr} ${cntr_file}\0" \
49 "auth_os=auth_cntr ${cntr_addr}\0" \
50 "mmcboot=echo Booting from mmc ...; " \
52 "if test ${sec_boot} = yes; then " \
53 "if run auth_os; then " \
56 "echo ERR: failed to authenticate; " \
59 "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
60 "if run loadfdt; then " \
63 "echo WARN: Cannot load the DT; " \
66 "echo wait for boot; " \
69 "netargs=setenv bootargs console=${console} " \
71 "ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \
72 "netboot=echo Booting from net ...; " \
74 "if test ${ip_dyn} = yes; then " \
75 "setenv get_cmd dhcp; " \
77 "setenv get_cmd tftp; " \
79 "if test ${sec_boot} = yes; then " \
80 "${get_cmd} ${cntr_addr} ${cntr_file}; " \
81 "if run auth_os; then " \
84 "echo ERR: failed to authenticate; " \
87 "${get_cmd} ${loadaddr} ${image}; " \
88 "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
89 "if ${get_cmd} ${fdt_addr} ${fdt_file}; then " \
90 "booti ${loadaddr} - ${fdt_addr}; " \
92 "echo WARN: Cannot load the DT; " \
99 /* Link Definitions */
101 /* Default environment is in SD */
103 /* On LPDDR4 board, USDHC1 is for eMMC, USDHC2 is for SD on CPU board */
105 #define CFG_SYS_SDRAM_BASE 0x80000000
106 #define PHYS_SDRAM_1 0x80000000
107 #define PHYS_SDRAM_2 0x880000000
108 #define PHYS_SDRAM_1_SIZE 0x80000000 /* 2 GB */
109 #define PHYS_SDRAM_2_SIZE 0x100000000 /* 4 GB */
111 #endif /* __IMX8QM_MEK_H */