diff options
author | Ye Li <ye.li@nxp.com> | 2019-06-25 02:51:42 -0700 |
---|---|---|
committer | Ye Li <ye.li@nxp.com> | 2019-06-25 18:55:30 -0700 |
commit | c36ae6a623b075192b20d93f9e3fe966961d86f4 (patch) | |
tree | 90bf6f70c72590130b84c33fe074f8a84b3eda18 /board/freescale/imx8mq_aiy | |
parent | 53cc1a63d672882cb8c71af61321051f4dcbe091 (diff) |
MLK-22105-3 imx8/imx8m: spl: Move bss clean up before arch_cpu_init
Since rng_init is used arch_cpu_init, we have to clean up BSS section
before it.
Also remove the unnecessary memset to global data, because
board_init_f_init_reserve already memset it. If we memset it in board_init_f,
the gd->malloc_base is reset to 0 and will cause early malloc problem
when CONFIG_MALLOC_F_ADDR is not set.
Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Diffstat (limited to 'board/freescale/imx8mq_aiy')
-rw-r--r-- | board/freescale/imx8mq_aiy/spl.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/board/freescale/imx8mq_aiy/spl.c b/board/freescale/imx8mq_aiy/spl.c index 0b2c88f8e0..b299278a17 100644 --- a/board/freescale/imx8mq_aiy/spl.c +++ b/board/freescale/imx8mq_aiy/spl.c @@ -233,8 +233,8 @@ void board_init_f(ulong dummy) { int ret; - /* Clear global data */ - memset((void *)gd, 0, sizeof(gd_t)); + /* Clear the BSS. */ + memset(__bss_start, 0, __bss_end - __bss_start); arch_cpu_init(); @@ -246,9 +246,6 @@ void board_init_f(ulong dummy) preloader_console_init(); - /* Clear the BSS. */ - memset(__bss_start, 0, __bss_end - __bss_start); - ret = spl_init(); if (ret) { debug("spl_init() failed: %d\n", ret); |