[coreboot-gerrit] Patch set updated for coreboot: e5cc959 am335x: Make the iROM load only the bootblock and ROM stage.

Paul Menzel (paulepanter@users.sourceforge.net) gerrit at coreboot.org
Mon Jun 10 22:30:14 CEST 2013


Paul Menzel (paulepanter at users.sourceforge.net) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/3421

-gerrit

commit e5cc959840b4697460c614225d30ea1c0bc6ec6f
Author: Gabe Black <gabeblack at chromium.org>
Date:   Mon Jun 10 02:07:17 2013 -0400

    am335x: Make the iROM load only the bootblock and ROM stage.
    
    The bootblock and ROM stages are the only ones that are really required to be
    loaded in the quite limited on chip RAM during startup. Rather than load the
    whole image which requires everything to be small, load just the bootblock and
    the ROM stage, allowing the rest of the image to be arbitrarily large. Loading
    a minimal amount of stuff should also improve boot performance a little bit.
    
    Change-Id: I2fede63b8d3d8f0d880e4a692ae423021f8232b6
    Signed-off-by: Gabe Black <gabeblack at chromium.org>
---
 src/cpu/ti/am335x/Makefile.inc | 12 ++++++++++--
 src/cpu/ti/am335x/header.c     |  5 ++++-
 2 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/src/cpu/ti/am335x/Makefile.inc b/src/cpu/ti/am335x/Makefile.inc
index c1bbcf6..7dcdf0f 100644
--- a/src/cpu/ti/am335x/Makefile.inc
+++ b/src/cpu/ti/am335x/Makefile.inc
@@ -17,9 +17,17 @@ real-target: $(obj)/MLO
 
 header_ld = $(src)/cpu/ti/am335x/header.ld
 
-$(obj)/omap-header.bin: $$(omap-header-objs) $$(header_ld)
+get_header_size=$(shell $(CBFSTOOL) $(1) print | grep $(2) | awk '{print $$2 + $$4}')
+
+$(obj)/omap-header.bin: $$(omap-header-objs) $$(header_ld) $(obj)/coreboot.rom
 	@printf "    CC         $(subst $(obj)/,,$(@))\n"
-	$(CC) -nostdlib -nostartfiles -static -include $(obj)/config.h -o $@.tmp $< -T $(header_ld)
+	$(CC) -nostdlib -nostartfiles -static -include $(obj)/config.h \
+		-Wl,--defsym,header_load_size=$(strip \
+			$(call get_header_size,$(obj)/coreboot.rom, \
+				$(CONFIG_CBFS_PREFIX)/romstage \
+			) \
+		) \
+		-o $@.tmp $< -T $(header_ld)
 	$(OBJCOPY) --only-section=".header" -O binary $@.tmp $@
 
 $(obj)/MLO: $(obj)/coreboot.rom $(obj)/omap-header.bin
diff --git a/src/cpu/ti/am335x/header.c b/src/cpu/ti/am335x/header.c
index bd2f344..5ed943e 100644
--- a/src/cpu/ti/am335x/header.c
+++ b/src/cpu/ti/am335x/header.c
@@ -40,6 +40,9 @@ struct omap_image_headers {
 	struct gp_device_header image_header;
 };
 
+// A symbol which defines how much of the image the iROM should load.
+extern char header_load_size;
+
 struct omap_image_headers headers __attribute__((section(".header"))) = {
 	.config_headers = {
 		.toc_chsettings = {
@@ -66,7 +69,7 @@ struct omap_image_headers headers __attribute__((section(".header"))) = {
 		}
 	},
 	.image_header = {
-		.size = CONFIG_ROM_SIZE,
+		.size = (uintptr_t)&header_load_size,
 		.destination = CONFIG_BOOTBLOCK_BASE
 	}
 };



More information about the coreboot-gerrit mailing list