summaryrefslogtreecommitdiff
path: root/src/arch
diff options
context:
space:
mode:
authorGabe Black <gabeblack@chromium.org>2013-06-09 21:10:10 -0700
committerRonald G. Minnich <rminnich@gmail.com>2013-06-10 17:52:15 +0200
commitb7d81e05bb3e4058cbb28adcc5af0bdccfe88337 (patch)
tree5ecf309af3d06ddefaecc3c37d1ba30e4180e43e /src/arch
parent1990ab9f151ce3c2ccc2a4c84fd6cda5a5b0e2c1 (diff)
ARM: Put the ROM stage into the image before other bits.
On ARM, there's frequently some firmware built into the SOC which runs first and which loads other firmware like Coreboot from some other media. To prevent the bootblock from having to know how to find and load the ROM stage from what may be a complicated source (sd card, netbooting, etc.), we can put the ROM stage immediately after the bootblock and ensure that they're both loaded at the same time. This change adjusts the Makefile.inc for ARM so that the ROM stage is put into the image before any other files so that we know it comes first. This changes the behavior of the CONFIG_UPDATE_IMAGE config option used by abuild, although it's not entirely clear whether that's still used. Change-Id: I832386243788156db5f5abbc9760a4e2026cf2cd Signed-off-by: Gabe Black <gabeblack@chromium.org> Reviewed-on: http://review.coreboot.org/3420 Reviewed-by: Patrick Georgi <patrick@georgi-clan.de> Tested-by: build bot (Jenkins)
Diffstat (limited to 'src/arch')
-rw-r--r--src/arch/armv7/Makefile.inc21
1 files changed, 7 insertions, 14 deletions
diff --git a/src/arch/armv7/Makefile.inc b/src/arch/armv7/Makefile.inc
index 2c280f47e1..104577445c 100644
--- a/src/arch/armv7/Makefile.inc
+++ b/src/arch/armv7/Makefile.inc
@@ -46,16 +46,20 @@ prebuild-files = \
prebuilt-files = $(foreach file,$(cbfs-files), $(call extract_nth,1,$(file)))
# TODO Change -b to Kconfig variable.
-$(obj)/coreboot.pre1: $(objcbfs)/bootblock.bin $$(prebuilt-files) $(CBFSTOOL)
+$(obj)/coreboot.pre: $(objcbfs)/bootblock.bin $(objcbfs)/romstage.elf $$(prebuilt-files) $(CBFSTOOL)
$(CBFSTOOL) $@.tmp create -m armv7 -s $(CONFIG_COREBOOT_ROMSIZE_KB)K \
-B $(objcbfs)/bootblock.bin -a 64 -b 0x0000 \
-H $(CONFIG_CBFS_HEADER_ROM_OFFSET) \
-o $(CONFIG_CBFS_ROM_OFFSET)
+ @printf " CBFS $(subst $(obj)/,,$(@))\n"
+ $(CBFSTOOL) $@.tmp add-stage \
+ -f $(objcbfs)/romstage.elf -b 0 \
+ -n $(CONFIG_CBFS_PREFIX)/romstage -c none
$(prebuild-files) true
mv $@.tmp $@
else
-.PHONY: $(obj)/coreboot.pre1
-$(obj)/coreboot.pre1: $(CBFSTOOL)
+.PHONY: $(obj)/coreboot.pre
+$(obj)/coreboot.pre: $(CBFSTOOL)
mv $(obj)/coreboot.rom $@
endif
@@ -184,17 +188,6 @@ ramstage-srcs += src/mainboard/$(MAINBOARDDIR)/get_bus_conf.c
endif
################################################################################
-# Build the final rom image
-
-$(obj)/coreboot.pre: $(objcbfs)/romstage.elf $(obj)/coreboot.pre1 $(CBFSTOOL)
- @printf " CBFS $(subst $(obj)/,,$(@))\n"
- cp $(obj)/coreboot.pre1 $@.tmp
- $(CBFSTOOL) $@.tmp add-stage \
- -f $(objcbfs)/romstage.elf \
- -n $(CONFIG_CBFS_PREFIX)/romstage -c none
- mv $@.tmp $@
-
-################################################################################
# Build the bootblock
bootblock_lds = $(src)/arch/armv7/bootblock.lds