From: Ye Li Date: Tue, 31 Jan 2023 08:42:34 +0000 (+0800) Subject: imx8ulp_evk: Clear data at fdt_addr_r before booting kernel X-Git-Tag: baikal/mips/sdk6.2~4^2~3^2~175^2~16^2~71 X-Git-Url: https://git.baikalelectronics.ru/sdk/?a=commitdiff_plain;h=3be42f0c7991c8d9b3332b6b7dcc95897c32af4e;p=uboot.git 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 Reviewed-by: Peng Fan --- 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; }