[PATCH v5 1/7] treewide: move bi_dram[] from bd to gd
Ilias Apalodimas
ilias.apalodimas at linaro.org
Fri Jun 5 07:20:38 CEST 2026
Hi Marek,
On Fri, 5 Jun 2026 at 01:34, Marek Vasut <marek.vasut at mailbox.org> wrote:
>
> On 6/4/26 9:37 AM, Ilias Apalodimas wrote:
> > Currently, the bi_dram[] information is stored in the board info
> > structure (bd). Because bd is only valid after reserve_board(),
> > dram_init_banksize() must be called late in the initialization process.
> > This limitation is problematic, as it forces us to rely on a variety of
> > bespoke functions to determine board RAM, bank memory sizes, and other
> > early setup requirements.
> >
> > By moving bi_dram[] into the global data (gd), we can run it earlier.
> > This is particularly convenient since boards define their own
> > dram_init_banksize() routines, which do not always rely on parsing
> > Device Tree (DT) memory nodes.
> >
> > Additionally, U-Boot defaults to relocating to the top of the first memory
> > bank. While boards currently use custom functions to override this
> > behavior, having the DRAM bank information available earlier in gd makes
> > relocating to a different bank trivial and standardizes the process.
> Regarding the BD, this is likely really old, but it seems BD might be
> passed from U-Boot to Linux somehow ? See [1] and U-Boot
> include/asm-generic/u-boot.h :
>
> 8 * NOTE: This header file defines an interface to U-Boot. Including
> 9 * this (unmodified) header file in another file is considered normal
> 10 * use of U-Boot, and does *not* fall under the heading of "derived
> 11 * work".
>
> Are we certain we are not breaking ABI here ?
That's a good point and I did look at U-Boot briefly when I changed
the location. However, I didn't look at the kernel...
Unfortunately, I don't have a platform I can test. Let's see if Tom's CC helps.
Thanks
/Ilias
>
> [1]
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/powerpc/boot/ppcboot.h
>
More information about the U-Boot
mailing list