summaryrefslogtreecommitdiff
path: root/board/freescale/imx8ulp_evk
diff options
context:
space:
mode:
authorYe Li <ye.li@nxp.com>2023-01-31 16:42:34 +0800
committerStefano Babic <sbabic@denx.de>2023-03-29 20:15:43 +0200
commit4dfb2196cdced30d9404080584746e4205f561b1 (patch)
tree6980a7262b3b8b6bd447f42653799f449130fa51 /board/freescale/imx8ulp_evk
parent9b7e39b6c1ff40a8336328708727394ae8a107e5 (diff)
downloadu-boot-4dfb2196cdced30d9404080584746e4205f561b1.tar.gz
imx8ulp_evk: Clear data at fdt_addr_r before booting kernel
When using dual boot mode, the DDR won't be reset when APD power off or reboot. It has possibility that obsolete fdt data existing on fdt_addr_r address. Then even nothing in EFI partitions, the distro boot still continue to parse fdt and get uboot crashed. Clear the data at fdt_addr_r, so the fdt header check in above case will not pass. Signed-off-by: Ye Li <ye.li@nxp.com> Reviewed-by: Peng Fan <peng.fan@nxp.com>
Diffstat (limited to 'board/freescale/imx8ulp_evk')
-rw-r--r--board/freescale/imx8ulp_evk/imx8ulp_evk.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/board/freescale/imx8ulp_evk/imx8ulp_evk.c b/board/freescale/imx8ulp_evk/imx8ulp_evk.c
index b58f143f6e..dd04d5925a 100644
--- a/board/freescale/imx8ulp_evk/imx8ulp_evk.c
+++ b/board/freescale/imx8ulp_evk/imx8ulp_evk.c
@@ -121,8 +121,16 @@ int board_early_init_f(void)
int board_late_init(void)
{
+ ulong addr;
+
#if CONFIG_IS_ENABLED(ENV_IS_IN_MMC)
board_late_mmc_env_init();
#endif
+
+ /* clear fdtaddr to avoid obsolete data */
+ addr = env_get_hex("fdt_addr_r", 0);
+ if (addr)
+ memset((void *)addr, 0, 0x400);
+
return 0;
}