[U-Boot-Users] different definition of struct bd_info between U-Boot and Linux

Stefan Roese sr at denx.de
Thu May 24 12:35:12 CEST 2007


On Wednesday 23 May 2007, Linux OneAccess wrote:
> I was figuring out how to pass board info from U-Boot to Linux and
> I saw that Linux references the bd_info structure.
>
> I'm not sure, however, which definition to use:
> In U-Boot, struct bd_info is defined in include/asm/u-boot.h
> In Linux, it's defined in include/asm-ppc/ppcboot.h.
>
> These two are somewhat different (different #ifdefs) which means
> the first few members (RAM size and such) are the same, but from
> then on it can diverge.

Yes, this is quite a mess. One of the reasons that this bd_info structure 
will "die" with the end of the arch/ppc support in the Linux kernel (I assume 
you know of the arch/ppc -> arch/powerpc merge). In arch/powerpc another 
mechanism is used to pass information from the bootloader to the linux 
kernel.

> Furthermore, in Linux there are several boards that define their
> own structure for this. Should we use the ppcboot.h definition,
> or is it there an intention to push the u-boot.h to the Linux tree one day?

This depends on the PPC platform you are using. What PPC platform are you 
talking about? MPC8xx, PPC4xx? MPC8xxx is quite dead in arch/ppc already for 
example and you should start your board port in arch/powerpc. If it's PPC4xx, 
then you should probably still use bd_info in arch/ppc, and it really doesn't 
matter how you hack the bd_info in the kernel, since it has to be moved to 
arch/powerpc in the future anyway. I would suggest to define a "own" board 
specific bd_info for now, to not pollute the asm-ppc/ppcboot.h with further 
#ifdefs.

Hope this helps.

Best regards,
Stefan

=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: office at denx.de
=====================================================================




More information about the U-Boot mailing list