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