summaryrefslogtreecommitdiff
path: root/src/soc
diff options
context:
space:
mode:
authorFurquan Shaikh <furquan@google.com>2014-06-09 13:26:38 -0700
committerMarc Jones <marc.jones@se-eng.com>2015-02-17 05:25:59 +0100
commitf0990dac1e48bafc073c2dfa84632e057a291d40 (patch)
tree7c2752994148ca61ae3ceaeab68b2635e5d40837 /src/soc
parentd6ba1541ec516e7e541a5da69ae3f3302e5bcd00 (diff)
tegra132: Add BCT support in tegra132 soc
Builds with cbootimage. BUG=None BRANCH=None TEST=build test Original-Change-Id: I796f171031bacf17106878d4a554e8f1cbfe93f8 Original-Signed-off-by: Furquan Shaikh <furquan@google.com> Original-Reviewed-on: https://chromium-review.googlesource.com/203145 Original-Tested-by: Furquan Shaikh <furquan@chromium.org> Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org> Original-Commit-Queue: Aaron Durbin <adurbin@chromium.org> (cherry picked from commit 4778ae4d08a25306407f0fd2fe47976d63463f9d) Increase the bootblock area for the larger BCT that is generated by the coreboot version of the cbootimage tool. Change-Id: I42b8208504bf4936a9fa14f820d665590f6a3754 Signed-off-by: Marc Jones <marc.jones@se-eng.com> Reviewed-on: http://review.coreboot.org/8413 Reviewed-by: Aaron Durbin <adurbin@google.com> Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Diffstat (limited to 'src/soc')
-rw-r--r--src/soc/nvidia/tegra132/Kconfig4
-rw-r--r--src/soc/nvidia/tegra132/Makefile.inc29
2 files changed, 31 insertions, 2 deletions
diff --git a/src/soc/nvidia/tegra132/Kconfig b/src/soc/nvidia/tegra132/Kconfig
index f11e60ffec..d90b8aaa8a 100644
--- a/src/soc/nvidia/tegra132/Kconfig
+++ b/src/soc/nvidia/tegra132/Kconfig
@@ -16,10 +16,10 @@ config BOOTBLOCK_ROM_OFFSET
config CBFS_HEADER_ROM_OFFSET
hex "offset of master CBFS header in ROM"
- default 0x18000
+ default 0x40000
config CBFS_ROM_OFFSET
hex "offset of CBFS data in ROM"
- default 0x18080
+ default 0x40080
endif
diff --git a/src/soc/nvidia/tegra132/Makefile.inc b/src/soc/nvidia/tegra132/Makefile.inc
index e31bbb695b..f39dcb1e5d 100644
--- a/src/soc/nvidia/tegra132/Makefile.inc
+++ b/src/soc/nvidia/tegra132/Makefile.inc
@@ -10,3 +10,32 @@ ramstage-y += cbmem.c
ramstage-y += timer.c
CPPFLAGS_common += -Isrc/soc/nvidia/tegra132/include/
+
+# We want to grab the bootblock right before it goes into the image and wrap
+# it inside a BCT, but ideally we would do that without making special, one
+# use modifications to the main ARM Makefile. We do this in two ways. First,
+# we copy bootblock.elf to bootblock.raw.elf and allow the %.bin: %.elf
+# template rule to turn it into bootblock.raw.bin. This makes sure whatever
+# processing is supposed to happen to turn an .elf into a .bin happens.
+#
+# Second, we add our own rule for creating bootblock.bin from
+# bootblock.raw.bin which displaces the template rule. When other rules that
+# package up the image pull in bootblock.bin, it will be this wrapped version
+# instead of the raw bootblock.
+
+$(objcbfs)/bootblock.raw.elf: $(objcbfs)/bootblock.elf
+ cp $< $@
+
+$(obj)/generated/bct.bin: $(obj)/generated/bct.cfg
+ @printf " CBOOTIMAGE $(subst $(obj)/,,$(@))\n"
+ $(CBOOTIMAGE) -gbct --soc tegra132 $< $@
+
+BCT_BIN = $(obj)/generated/bct.bin
+BCT_WRAPPER = $(obj)/generated/bct.wrapper
+$(objcbfs)/bootblock.bin: $(CBOOTIMAGE) $(objcbfs)/bootblock.raw.bin $(BCT_BIN)
+ echo "Version = 1;" > $(BCT_WRAPPER)
+ echo "Redundancy = 1;" >> $(BCT_WRAPPER)
+ echo "Bctfile = $(BCT_BIN);" >> $(BCT_WRAPPER)
+ echo "BootLoader = $<,$(CONFIG_BOOTBLOCK_BASE),$(CONFIG_BOOTBLOCK_BASE),Complete;" >> $(BCT_WRAPPER)
+ @printf " CBOOTIMAGE $(subst $(obj)/,,$(@))\n"
+ $(CBOOTIMAGE) $(BCT_WRAPPER) $@