[coreboot] [PATCH]Allow components to add files to CBFS

Patrick Georgi patrick at georgi-clan.de
Wed Dec 15 12:51:25 CET 2010


We have a couple of chipsets in the tree that require external data in CBFS, 
sometimes with placement requirements (eg. for embedded controllers), and 
there will be more of that kind to come.
Right now, we're adding Kconfig options for each and every of these new files, 
but that's not a sustainable model.

The patch provides a way for each Makefile.inc to add such files by setting up a 
couple of variables:
# -y can, as usual be used for conditional inclusion
cbfs-files-y += filename
filename-name := CBFS filename
filename-type := CBFS type
filename-position := location in CBFS (eg. 0xfff80000)

filename can either be a filename in the current directory (or a relative path 
from there) or, if that doesn't match a file, a path starting from the tree 
filename in filename-name etc. means the actual filename, for example:
cbfs-files-y += mbi.bin
mbi.bin-name := mbi.bin
mbi.bin-type := 0x80

filename-position is an optional argument. If it doesn't exist, CBFS is free in 
its placement of the file. The files are added immediately after creation of the 
CBFS image to make sure that they'll have the space. Even the romstage is 
added only afterwards.

mbi.bin-* (in the example above) are cleaned after processing to avoid option 
conflicts if two files of the same name (with different CBFS names) are added.

To avoid code duplication, I moved CBFS image creation from two locations into 
src/arch/x86/Makefile.inc. That's also part of the patch.

The patch doesn't yet rework MBI, VGABIOS and bootsplash handling into the new 
method of adding generic files. I'm reasonably sure that MBI and VGABIOS can be 
moved out of Kconfig without much effect to users (as they're pretty much a 
binary decision, if the file is used at all, but the file is the same 
everywhere), but the bootsplash is probably a more individualistic matter, so 
should be kept in Kconfig.

Anyway, the patch is
Signed-off-by: Patrick Georgi <patrick.georgi at coresystems.de>

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 20101215-01-cbfs-files-from-makefile.diff
Type: text/x-patch
Size: 3933 bytes
Desc: not available
URL: <http://www.coreboot.org/pipermail/coreboot/attachments/20101215/4cfebf59/attachment.diff>

More information about the coreboot mailing list