Rework bootblock size handling:
- don't pretend to create a bootblock as large as the ROM in Kconfig (it's 64k at most) - don't pretend to accept a bootblocksize value in cbfstool create (it ignored it) - patch up the build systems to keep it working Signed-off-by: Patrick Georgi <patrick.georgi@coresystems.de> Acked-by: Myles Watson <mylesgw@gmail.com> Acked-by: Peter Stuge <peter@stuge.se> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@4934 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
This commit is contained in:
parent
c243639797
commit
6056b97fce
|
@ -20,12 +20,7 @@ config ARCH
|
||||||
|
|
||||||
config ROMBASE
|
config ROMBASE
|
||||||
hex
|
hex
|
||||||
default 0xffc00000 if COREBOOT_ROMSIZE_KB_4096
|
default 0xffff0000
|
||||||
default 0xffe00000 if COREBOOT_ROMSIZE_KB_2048
|
|
||||||
default 0xfff00000 if COREBOOT_ROMSIZE_KB_1024
|
|
||||||
default 0xfff80000 if COREBOOT_ROMSIZE_KB_512
|
|
||||||
default 0xfffc0000 if COREBOOT_ROMSIZE_KB_256
|
|
||||||
default 0xfffe0000 if COREBOOT_ROMSIZE_KB_128
|
|
||||||
|
|
||||||
config ROM_IMAGE_SIZE
|
config ROM_IMAGE_SIZE
|
||||||
hex
|
hex
|
||||||
|
|
|
@ -8,14 +8,13 @@ subdirs-y += smp
|
||||||
obj-$(CONFIG_HAVE_OPTION_TABLE) += ../../option_table.o
|
obj-$(CONFIG_HAVE_OPTION_TABLE) += ../../option_table.o
|
||||||
|
|
||||||
ifdef POST_EVALUATION
|
ifdef POST_EVALUATION
|
||||||
BOOTBLOCK_SIZE=65536
|
|
||||||
|
|
||||||
#######################################################################
|
#######################################################################
|
||||||
# Build the final rom image
|
# Build the final rom image
|
||||||
|
|
||||||
$(obj)/coreboot.rom: $(obj)/coreboot.bootblock $(obj)/coreboot_ram $(CBFSTOOL)
|
$(obj)/coreboot.rom: $(obj)/coreboot.bootblock $(obj)/coreboot_ram $(CBFSTOOL)
|
||||||
rm -f $@
|
rm -f $@
|
||||||
$(CBFSTOOL) $@ create $(shell expr 1024 \* $(CONFIG_COREBOOT_ROMSIZE_KB)) $(BOOTBLOCK_SIZE) $(obj)/coreboot.bootblock
|
$(CBFSTOOL) $@ create $(shell expr 1024 \* $(CONFIG_COREBOOT_ROMSIZE_KB)) $(obj)/coreboot.bootblock
|
||||||
if [ -f fallback/coreboot_apc ]; \
|
if [ -f fallback/coreboot_apc ]; \
|
||||||
then \
|
then \
|
||||||
$(CBFSTOOL) $@ add-stage fallback/coreboot_apc fallback/coreboot_apc $(CBFS_COMPRESS_FLAG); \
|
$(CBFSTOOL) $@ add-stage fallback/coreboot_apc fallback/coreboot_apc $(CBFS_COMPRESS_FLAG); \
|
||||||
|
|
|
@ -187,18 +187,17 @@ static int cbfs_create(int argc, char **argv)
|
||||||
{
|
{
|
||||||
char *romname = argv[1];
|
char *romname = argv[1];
|
||||||
char *cmd = argv[2];
|
char *cmd = argv[2];
|
||||||
if (argc < 6) {
|
if (argc < 5) {
|
||||||
printf("not enough arguments to 'create'.\n");
|
printf("not enough arguments to 'create'.\n");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t size = strtoul(argv[3], NULL, 0);
|
uint32_t size = strtoul(argv[3], NULL, 0);
|
||||||
/* ignore bootblock size. we use whatever we get and won't allocate any larger */
|
char *bootblock = argv[4];
|
||||||
char *bootblock = argv[5];
|
|
||||||
uint32_t align = 0;
|
uint32_t align = 0;
|
||||||
|
|
||||||
if (argc > 6)
|
if (argc > 5)
|
||||||
align = strtoul(argv[6], NULL, 0);
|
align = strtoul(argv[5], NULL, 0);
|
||||||
|
|
||||||
return create_cbfs_image(romname, size, bootblock, align);
|
return create_cbfs_image(romname, size, bootblock, align);
|
||||||
}
|
}
|
||||||
|
@ -255,7 +254,7 @@ void usage(void)
|
||||||
"add FILE NAME TYPE [base address] Add a component\n"
|
"add FILE NAME TYPE [base address] Add a component\n"
|
||||||
"add-payload FILE NAME [COMP] [base] Add a payload to the ROM\n"
|
"add-payload FILE NAME [COMP] [base] Add a payload to the ROM\n"
|
||||||
"add-stage FILE NAME [COMP] [base] Add a stage to the ROM\n"
|
"add-stage FILE NAME [COMP] [base] Add a stage to the ROM\n"
|
||||||
"create SIZE BSIZE BOOTBLOCK [ALIGN] Create a ROM file\n"
|
"create SIZE BOOTBLOCK [ALIGN] Create a ROM file\n"
|
||||||
"locate FILE NAME ALIGN Find a place for a file of that size\n"
|
"locate FILE NAME ALIGN Find a place for a file of that size\n"
|
||||||
"print Show the contents of the ROM\n");
|
"print Show the contents of the ROM\n");
|
||||||
}
|
}
|
||||||
|
|
|
@ -2295,8 +2295,8 @@ def writemakefile(path):
|
||||||
for j in i.roms:
|
for j in i.roms:
|
||||||
file.write(" %s/coreboot.rom " % j)
|
file.write(" %s/coreboot.rom " % j)
|
||||||
file.write("> %s.bootblock\n\n" %i.name)
|
file.write("> %s.bootblock\n\n" %i.name)
|
||||||
file.write("\t./cbfs/cbfstool %s create %s %s %s.bootblock\n"
|
file.write("\t./cbfs/cbfstool %s create %s %s.bootblock\n"
|
||||||
%(i.name, romsize, bootblocksize, i.name))
|
%(i.name, romsize, i.name))
|
||||||
for j in pciroms:
|
for j in pciroms:
|
||||||
file.write("\t./cbfs/cbfstool %s add %s pci%04x,%04x.rom optionrom\n" % (i.name, j.name, j.pci_vid, j.pci_did))
|
file.write("\t./cbfs/cbfstool %s add %s pci%04x,%04x.rom optionrom\n" % (i.name, j.name, j.pci_vid, j.pci_did))
|
||||||
for j in i.roms:
|
for j in i.roms:
|
||||||
|
|
Loading…
Reference in New Issue