[U-Boot] U-Boot / Coreboot integration
Graeme Russ
graeme.russ at gmail.com
Tue Oct 23 07:16:34 CEST 2012
Hi Simon,
As I've mentioned in my comments to several patches related to
coreboot support in U-Boot, I would like to discuss how to formally
support the execution of U-Boot as a coreboot payload.
Looking at the code in arch/x86/cpu/coreboot, I think the cleanest
approach will be to move the coreboot code into arch/x86/lib/. We
could either prefix coreboot related source files with cb_ or create a
coreboot directory under arch/x86/lib (there would be no reason not to
pull in the coreboot lib through the existing lib/Makefile)
Every x86 board would then have it's own board config file which
define CONFIG_X86_COREBOOT. As discussed previously
CONFIG_X86_COREBOOT should result in the exclusion of all 16-bit code
The next item to discuss is the passing of data from coreboot to
U-Boot (and ultimately to Linux) including:
- Physical memory map (E820)
- List of initialised devices
- Pointer to the coreboot filesystem (or multiple pointers if
multiple such filesystems exist)
- etc.
I know you have mentioned that coreboot has data structure used to
maintain such data and that this will be preferred in future over FTD.
Considering that U-Boot already has extensive FDT support, I'm loath
to add yet another data passing mechanism. Add to this rumours I have
heard that FDT support is 'coming to an x86 kernel near you', I think
FDT is the most appropriate way forward.
Last but not least, we need to have a closer look at how coreboot
loads and launches U-Boot. I can't say for sure, but I am assuming
U-Boot is built to some fixed RAM address (0xfc0000) and U-Boot
relocates based on memory information passed by U-Boot. What I would
like to see is one of two possible approaches implemented:
1) Have coreboot load U-Boot to the final RAM location
2) If U-Boot is stored in cbfs as a single linear chunk, execute
U-Boot in-place from cbfs
Both of these will eliminate a redundant memory copy. If option 1) is
chosen, we have two sub-options:
1) Tweak U-Boot's relocation code for x86 to allow relocation from an
arbitrary load address (al-la how the Linux kernel works)
2) Have coreboot perform the relocation adjustments
I think sub-option 1) is probably the way to go
Regards,
Graeme
More information about the U-Boot
mailing list