[PATCH] mach-k3: common: init gd->bd before dram_init_banksize

Ilias Apalodimas ilias.apalodimas at linaro.org
Thu Apr 23 10:57:03 CEST 2026


Thanks for ropping me in Anshul

On Thu, 23 Apr 2026 at 11:20, Anshul Dalal <anshuld at ti.com> wrote:
>
> On Tue Mar 10, 2026 at 2:46 PM IST, Anshul Dalal wrote:
> > The dram_init_banksize API configures the dram banks inside gd->bd, so
> > ensure bd is initialized by calling spl_set_bd as part of
> > spl_enable_cache.
> >
> > Signed-off-by: Anshul Dalal <anshuld at ti.com>
>
> This patch can be dropped in favour of "treewide: move bi_dram[] from bd
> to gd"[1]. The patch fixes the issue since dram_init_banksize only modifies
> bi_dram field of bd which now gets moved to gd.
>
> [1]: https://lore.kernel.org/u-boot/20260416055948.130041-4-ilias.apalodimas@linaro.org/

Yes please.

/Ilias
>
> CC:+ Ilias
>
> > ---
> >  arch/arm/mach-k3/common.c | 3 +++
> >  1 file changed, 3 insertions(+)
> >
> > diff --git a/arch/arm/mach-k3/common.c b/arch/arm/mach-k3/common.c
> > index 2f3df5519c5..39467c21679 100644
> > --- a/arch/arm/mach-k3/common.c
> > +++ b/arch/arm/mach-k3/common.c
> > @@ -418,6 +418,9 @@ void spl_enable_cache(void)
> >       gd->ram_top = CFG_SYS_SDRAM_BASE;
> >       int ret = 0;
> >
> > +     /* dram_init_banksize populates bd, so init it first */
> > +     spl_set_bd();
> > +
> >       dram_init();
> >       dram_init_banksize();
> >
> >
> > ---
> > base-commit: 1e240f7206fccde4ec73ea432ab8360d321c5fe5
> > change-id: 20260310-init_bd_before_dram_init-7a9c3ad0b311
> >
> > Best regards,
>


More information about the U-Boot mailing list