[U-Boot] [PATCH v2 1/6] spl: add Kconfig option to clear bss early
Simon Goldschmidt
simon.k.r.goldschmidt at gmail.com
Fri Mar 22 08:16:07 UTC 2019
Hi Simon,
On Fri, Mar 22, 2019 at 8:53 AM Simon Glass <sjg at chromium.org> wrote:
>
> Hi,
>
> On Sat, 16 Mar 2019 at 04:13, Simon Goldschmidt
> <simon.k.r.goldschmidt at gmail.com> wrote:
> >
> > This introduces a new Kconfig option SPL_CLEAR_BSS_F. If enabled, it clears
> > the bss before calling board_init_f() instead of clearing it before calling
> > board_init_r().
> >
> > This also ensures that variables placed in BSS can be shared between
> > board_init_f() and board_init_r() in SPL.
> >
> > Make the new option depend on ARM for now until more implementations follow.
> >
> > Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt at gmail.com>
> > ---
> >
> > Changes in v2:
> > - make CONFIG_SPL_CLEAR_BSS_F depend on ARM for now
> >
> > common/spl/Kconfig | 12 ++++++++++++
> > 1 file changed, 12 insertions(+)
>
> The current restriction is that you are not allowed to use BSS before
> board_init_r().
I understood that, but I did not understand why. This is perfectly valid for
U-Boot proper or for SPL if SPL_SEPARATE_BSS is used and bss is in
SDRAM. However, the latter seems to be seldom used and for the "default"
case where bss is in SRAM, it's available right from the start and clearing
it after board_init_f() has been run seems quite unuseful and unexpected.
>
> Can you please add a motivation to change this?
The motivation is to allow SPL to use full malloc in board_init_f()
like required
by socfpga_arria10 (see patch 5/6). Without this, the malloc pointers get
overwritten after board_init_f() and further calls to malloc() fail.
Regards,
Simon
More information about the U-Boot
mailing list