Hi,

attached patch cleans up the bootblock size handling:
1. cbfstool create does no longer take a value it doesn't parse anyway (bootblocksize), but creates a bootblock of the size of the file that's filled in.

2. kconfig and newconfig are adapted to not pass the value

3. CONFIG_ROMBASE in kconfig isn't set to the ROM size, but to 4GB-64KB, ie. the standard start address of the bootblock. That's how it's used anyway (which didn't show because the linker script moves into top 64K if necessary)

4. BOOTBLOCK_SIZE in src/arch/i386/Makefile.inc isn't used anymore, so it's dropped.

Change #1 requires #2, so mixing cbfstool versions must not happen (but usually won't happen)

Signed-off-by: Patrick Georgi <patrick.geo...@coresystems.de>


Patrick
Index: src/arch/i386/Kconfig
===================================================================
--- src/arch/i386/Kconfig       (revision 4930)
+++ src/arch/i386/Kconfig       (working copy)
@@ -20,12 +20,7 @@
 
 config ROMBASE
        hex
-       default 0xffc00000 if COREBOOT_ROMSIZE_KB_4096
-       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
+       default 0xffff0000
 
 config ROM_IMAGE_SIZE
        hex
Index: src/arch/i386/Makefile.inc
===================================================================
--- src/arch/i386/Makefile.inc  (revision 4930)
+++ src/arch/i386/Makefile.inc  (working copy)
@@ -8,14 +8,13 @@
 obj-$(CONFIG_HAVE_OPTION_TABLE) += ../../option_table.o
 
 ifdef POST_EVALUATION
-BOOTBLOCK_SIZE=65536
 
 #######################################################################
 # Build the final rom image
 
 $(obj)/coreboot.rom: $(obj)/coreboot.bootblock $(obj)/coreboot_ram $(CBFSTOOL)
        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 ]; \
        then \
                $(CBFSTOOL) $@ add-stage fallback/coreboot_apc 
fallback/coreboot_apc $(CBFS_COMPRESS_FLAG); \
Index: util/newconfig/config.g
===================================================================
--- util/newconfig/config.g     (revision 4930)
+++ util/newconfig/config.g     (working copy)
@@ -2295,8 +2295,8 @@
                for j in i.roms:
                        file.write(" %s/coreboot.rom " % j)
                file.write("> %s.bootblock\n\n" %i.name)
-               file.write("\t./cbfs/cbfstool %s create %s %s %s.bootblock\n"
-                          %(i.name, romsize, bootblocksize, i.name))
+               file.write("\t./cbfs/cbfstool %s create %s %s.bootblock\n"
+                          %(i.name, romsize, i.name))
                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))
                for j in i.roms:
Index: util/cbfstool/cbfstool.c
===================================================================
--- util/cbfstool/cbfstool.c    (revision 4930)
+++ util/cbfstool/cbfstool.c    (working copy)
@@ -187,18 +187,17 @@
 {
        char *romname = argv[1];
        char *cmd = argv[2];
-       if (argc < 6) {
+       if (argc < 5) {
                printf("not enough arguments to 'create'.\n");
                return 1;
        }
 
        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[5];
+       char *bootblock = argv[4];
        uint32_t align = 0;
 
-       if (argc > 6)
-               align = strtoul(argv[6], NULL, 0);
+       if (argc > 5)
+               align = strtoul(argv[5], NULL, 0);
 
        return create_cbfs_image(romname, size, bootblock, align);
 }
@@ -255,7 +254,7 @@
             "add FILE NAME TYPE [base address]    Add a component\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"
-            "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"
             "print                                Show the contents of the 
ROM\n");
 }
-- 
coreboot mailing list: coreboot@coreboot.org
http://www.coreboot.org/mailman/listinfo/coreboot

Reply via email to