From 4778ae4d08a25306407f0fd2fe47976d63463f9d Mon Sep 17 00:00:00 2001 From: Furquan Shaikh Date: Mon, 9 Jun 2014 13:26:38 -0700 Subject: [PATCH] coreboot tegra132: Add BCT support in tegra132 soc Does not compile yet because tegra132 support is not present in cbootimage BUG=None BRANCH=None TEST=Does not compile (Waiting for tegra132 support in cbootimage) Change-Id: I796f171031bacf17106878d4a554e8f1cbfe93f8 Signed-off-by: Furquan Shaikh Reviewed-on: https://chromium-review.googlesource.com/203145 Tested-by: Furquan Shaikh Reviewed-by: Aaron Durbin Commit-Queue: Aaron Durbin --- src/soc/nvidia/tegra132/Makefile.inc | 29 ++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/src/soc/nvidia/tegra132/Makefile.inc b/src/soc/nvidia/tegra132/Makefile.inc index c798012fd5..1dc573a78d 100644 --- a/src/soc/nvidia/tegra132/Makefile.inc +++ b/src/soc/nvidia/tegra132/Makefile.inc @@ -31,3 +31,32 @@ ramstage-y += ../tegra/pinmux.c ramstage-$(CONFIG_CONSOLE_SERIAL_UART) += uart.c INCLUDES += -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: $(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) $@ \ No newline at end of file