summaryrefslogtreecommitdiff
path: root/include/configs/lx2160a_common.h
diff options
context:
space:
mode:
authorPriyanka Jain <priyanka.jain@nxp.com>2019-01-24 05:22:18 +0000
committerPrabhakar Kushwaha <prabhakar.kushwaha@nxp.com>2019-02-19 10:26:44 +0530
commit3e1a9b5c772af8d80d75a80fe91d3d02c63fa173 (patch)
tree9999ab1a8f3caeb406ae6e28bb998c9f8350c33c /include/configs/lx2160a_common.h
parent938e35e58f98ff2db46b4f40964a1c3b242b1295 (diff)
board/lx2160ardb: Add distro boot support
Add u-boot enviroments to support distro boot which scan boot.scr from external storage devices (e.g. SD/USB/SCSI disk) and execute autoboot script Signed-off-by: Priyanka Jain <priyanka.jain@nxp.com> Reviewed-by: Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com>
Diffstat (limited to 'include/configs/lx2160a_common.h')
-rw-r--r--include/configs/lx2160a_common.h85
1 files changed, 75 insertions, 10 deletions
diff --git a/include/configs/lx2160a_common.h b/include/configs/lx2160a_common.h
index 41931e5b53..0e0e72d06b 100644
--- a/include/configs/lx2160a_common.h
+++ b/include/configs/lx2160a_common.h
@@ -193,16 +193,6 @@ unsigned long get_board_ddr_clk(void);
#define CONFIG_SYS_BOOTM_LEN (64 << 20) /* Increase max gunzip size */
/* Initial environment variables */
-#define XSPI_NOR_BOOTCOMMAND "fsl_mc apply dpl 0x20d00000;" \
- "sf probe 0:0;" \
- "sf read 0xa0000000 0x1000000 0x3000000;" \
- "bootm 0xa0000000"
-
-#define SD_BOOTCOMMAND "mmc read 0xa0000000 0x6800 0xA0;" \
- "fsl_mc apply dpl 0xa0000000;" \
- "mmc read 0xb0000000 0x8000 0x1d000;" \
- "bootm 0xb0000000"
-
#define XSPI_MC_INIT_CMD \
"fsl_mc start mc 0x20a00000 0x20e00000\0"
@@ -211,4 +201,79 @@ unsigned long get_board_ddr_clk(void);
"mmc read 0x80100000 0x7000 0x800;" \
"fsl_mc start mc 0x80000000 0x80100000\0"
+#define EXTRA_ENV_SETTINGS \
+ "hwconfig=fsl_ddr:bank_intlv=auto\0" \
+ "ramdisk_addr=0x800000\0" \
+ "ramdisk_size=0x2000000\0" \
+ "fdt_high=0xa0000000\0" \
+ "initrd_high=0xffffffffffffffff\0" \
+ "fdt_addr=0x64f00000\0" \
+ "kernel_start=0x1000000\0" \
+ "kernelheader_start=0x800000\0" \
+ "scriptaddr=0x80000000\0" \
+ "scripthdraddr=0x80080000\0" \
+ "fdtheader_addr_r=0x80100000\0" \
+ "kernelheader_addr_r=0x80200000\0" \
+ "kernel_addr_r=0x81000000\0" \
+ "kernelheader_size=0x40000\0" \
+ "fdt_addr_r=0x90000000\0" \
+ "load_addr=0xa0000000\0" \
+ "kernel_size=0x2800000\0" \
+ "kernel_addr_sd=0x8000\0" \
+ "kernel_size_sd=0x1d000\0" \
+ "console=ttyAMA0,38400n8\0" \
+ BOOTENV \
+ "mcmemsize=0x70000000\0" \
+ XSPI_MC_INIT_CMD \
+ "boot_scripts=lx2160ardb_boot.scr\0" \
+ "boot_script_hdr=hdr_lx2160ardb_bs.out\0" \
+ "scan_dev_for_boot_part=" \
+ "part list ${devtype} ${devnum} devplist; " \
+ "env exists devplist || setenv devplist 1; " \
+ "for distro_bootpart in ${devplist}; do " \
+ "if fstype ${devtype} " \
+ "${devnum}:${distro_bootpart} " \
+ "bootfstype; then " \
+ "run scan_dev_for_boot; " \
+ "fi; " \
+ "done\0" \
+ "scan_dev_for_boot=" \
+ "echo Scanning ${devtype} " \
+ "${devnum}:${distro_bootpart}...; " \
+ "for prefix in ${boot_prefixes}; do " \
+ "run scan_dev_for_scripts; " \
+ "done;\0" \
+ "boot_a_script=" \
+ "load ${devtype} ${devnum}:${distro_bootpart} " \
+ "${scriptaddr} ${prefix}${script}; " \
+ "env exists secureboot && load ${devtype} " \
+ "${devnum}:${distro_bootpart} " \
+ "${scripthdraddr} ${prefix}${boot_script_hdr} " \
+ "&& esbc_validate ${scripthdraddr};" \
+ "source ${scriptaddr}\0"
+
+#define XSPI_NOR_BOOTCOMMAND \
+ "env exists mcinitcmd && env exists secureboot "\
+ "&& esbc_validate 0x20780000; " \
+ "env exists mcinitcmd && " \
+ "fsl_mc lazyapply dpl 0x20d00000; " \
+ "run distro_bootcmd;run xspi_bootcmd; " \
+ "env exists secureboot && esbc_halt;"
+
+#define SD_BOOTCOMMAND \
+ "env exists mcinitcmd && mmcinfo; " \
+ "mmc read 0x80001000 0x6800 0x800; " \
+ "env exists mcinitcmd && env exists secureboot " \
+ " && mmc read 0x80780000 0x3C00 0x10 " \
+ "&& esbc_validate 0x80780000;env exists mcinitcmd " \
+ "&& fsl_mc lazyapply dpl 0x80001000;" \
+ "run distro_bootcmd;run sd_bootcmd;" \
+ "env exists secureboot && esbc_halt;"
+
+#define BOOT_TARGET_DEVICES(func) \
+ func(USB, usb, 0) \
+ func(MMC, mmc, 0) \
+ func(SCSI, scsi, 0)
+#include <config_distro_bootcmd.h>
+
#endif /* __LX2_COMMON_H */