[PATCH v5 1/7] treewide: move bi_dram[] from bd to gd
Tom Rini
trini at konsulko.com
Tue Jun 9 17:04:29 CEST 2026
On Tue, Jun 09, 2026 at 04:23:36PM +0200, Christophe Leroy (CS GROUP) wrote:
> Le 05/06/2026 à 01:09, Tom Rini a écrit :
> > On Fri, Jun 05, 2026 at 12:31:10AM +0200, Marek Vasut 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 ?
> > >
> > > [1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/powerpc/boot/ppcboot.h
> >
> > I've added in Christophe as the maintainer of one of the active and in
> > some ways oldest (since MPC8xx is very old) PowerPC platforms we still
> > actively support. A tested-by on this series that also includes
> > verifying Linux still comes up would be much appreciated.
>
> Traveling at the moment. I will try to give it a go in a couple weeks.
>
> >
> > My suspicion is that anything DT-based shouldn't change here, and in
> > turn if you're doing modern U-Boot you're probably doing
> > not-extremely-ancient kernel and so DT based booting.
> >
>
> Linux receives a pointer to the device tree from U-boot, nothing else as far
> as I know.
Thanks. I strongly suspect everything in question applies to ancient
U-Boot and/or Kernel.
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20260609/53fd531a/attachment.sig>
More information about the U-Boot
mailing list