aboutsummaryrefslogtreecommitdiff
path: root/src/soc/nvidia/tegra124/Makefile.inc
diff options
context:
space:
mode:
authorGabe Black <gabeblack@google.com>2013-09-27 03:06:34 -0700
committerIsaac Christensen <isaac.christensen@se-eng.com>2014-08-12 23:18:16 +0200
commit7980b08405d8c3f2c0b3edf6af482c679f2560b2 (patch)
tree3dd98b9776709b30ef82d8ac60b7e19667ad56c1 /src/soc/nvidia/tegra124/Makefile.inc
parent06667a52474bae9f9c88ed5efa9df44cb20c9dd3 (diff)
tegra124: Add some make rules which will wrap the bootblock in the BCT.
These rules slip into the normal bootblock preperation process and use the cbootimage utility to wrap it in a BCT. Change-Id: I8cf2a3fb6e9f1d792d536c533d4813acfb550cea Signed-off-by: Gabe Black <gabeblack@google.com> Reviewed-on: https://chromium-review.googlesource.com/170924 Reviewed-by: Gabe Black <gabeblack@chromium.org> Commit-Queue: Gabe Black <gabeblack@chromium.org> Tested-by: Gabe Black <gabeblack@chromium.org> (cherry picked from commit cf4a9b0712c21b885bb59310671fb87e38abb665) Signed-off-by: Isaac Christensen <isaac.christensen@se-eng.com> Reviewed-on: http://review.coreboot.org/6618 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Diffstat (limited to 'src/soc/nvidia/tegra124/Makefile.inc')
-rw-r--r--src/soc/nvidia/tegra124/Makefile.inc31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/soc/nvidia/tegra124/Makefile.inc b/src/soc/nvidia/tegra124/Makefile.inc
index 49e2b1f31e..14707dfe77 100644
--- a/src/soc/nvidia/tegra124/Makefile.inc
+++ b/src/soc/nvidia/tegra124/Makefile.inc
@@ -1,3 +1,5 @@
+CBOOTIMAGE = cbootimage
+
bootblock-y += cbfs.c
romstage-y += cbfs.c
@@ -7,3 +9,32 @@ romstage-y += timer.c
ramstage-y += cbfs.c
ramstage-y += monotonic_timer.c
ramstage-y += timer.c
+
+# 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 tegra124 $< $@
+
+BCT_BIN = $(obj)/generated/bct.bin
+BCT_WRAPPER = $(obj)/generated/bct.wrapper
+$(objcbfs)/bootblock.bin: $(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) $@