blob: 14707dfe77d4e9a958c4fea6f60a3d0d8ea8843f [file] [log] [blame]
Gabe Black7980b082013-09-27 03:06:34 -07001CBOOTIMAGE = cbootimage
2
Gabe Black396b0722013-09-26 16:22:09 -07003bootblock-y += cbfs.c
4
5romstage-y += cbfs.c
6romstage-y += monotonic_timer.c
7romstage-y += timer.c
8
9ramstage-y += cbfs.c
10ramstage-y += monotonic_timer.c
11ramstage-y += timer.c
Gabe Black7980b082013-09-27 03:06:34 -070012
13# We want to grab the bootblock right before it goes into the image and wrap
14# it inside a BCT, but ideally we would do that without making special, one
15# use modifications to the main ARM Makefile. We do this in two ways. First,
16# we copy bootblock.elf to bootblock.raw.elf and allow the %.bin: %.elf
17# template rule to turn it into bootblock.raw.bin. This makes sure whatever
18# processing is supposed to happen to turn an .elf into a .bin happens.
19#
20# Second, we add our own rule for creating bootblock.bin from
21# bootblock.raw.bin which displaces the template rule. When other rules that
22# package up the image pull in bootblock.bin, it will be this wrapped version
23# instead of the raw bootblock.
24
25$(objcbfs)/bootblock.raw.elf: $(objcbfs)/bootblock.elf
26 cp $< $@
27
28$(obj)/generated/bct.bin: $(obj)/generated/bct.cfg
29 @printf " CBOOTIMAGE $(subst $(obj)/,,$(@))\n"
30 $(CBOOTIMAGE) -gbct --soc tegra124 $< $@
31
32BCT_BIN = $(obj)/generated/bct.bin
33BCT_WRAPPER = $(obj)/generated/bct.wrapper
34$(objcbfs)/bootblock.bin: $(objcbfs)/bootblock.raw.bin $(BCT_BIN)
35 echo "Version = 1;" > $(BCT_WRAPPER)
36 echo "Redundancy = 1;" >> $(BCT_WRAPPER)
37 echo "Bctfile = $(BCT_BIN);" >> $(BCT_WRAPPER)
38 echo "BootLoader = $<,$(CONFIG_BOOTBLOCK_BASE),$(CONFIG_BOOTBLOCK_BASE),Complete;" >> $(BCT_WRAPPER)
39 @printf " CBOOTIMAGE $(subst $(obj)/,,$(@))\n"
40 $(CBOOTIMAGE) $(BCT_WRAPPER) $@