blob: 683d940eb4cf4d8c757a3164d3544d3407b87a3a [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
Gabe Black08d5a892013-10-03 04:35:01 -07006bootblock-y += ../tegra/gpio.c
7bootblock-y += ../tegra/pingroup.c
8bootblock-y += ../tegra/pinmux.c
Ronald G. Minnich3eab7ed2013-10-03 17:05:55 -07009bootblock-y += timer.c
Gabe Black396b0722013-09-26 16:22:09 -070010
11romstage-y += cbfs.c
12romstage-y += monotonic_timer.c
13romstage-y += timer.c
14
15ramstage-y += cbfs.c
16ramstage-y += monotonic_timer.c
17ramstage-y += timer.c
Gabe Black7980b082013-09-27 03:06:34 -070018
Gabe Blacke97b6832013-10-06 06:13:24 -070019CPPFLAGS_common += -Isrc/soc/nvidia/tegra124/include/
Ronald G. Minnich3eab7ed2013-10-03 17:05:55 -070020
Gabe Black7980b082013-09-27 03:06:34 -070021# We want to grab the bootblock right before it goes into the image and wrap
22# it inside a BCT, but ideally we would do that without making special, one
23# use modifications to the main ARM Makefile. We do this in two ways. First,
24# we copy bootblock.elf to bootblock.raw.elf and allow the %.bin: %.elf
25# template rule to turn it into bootblock.raw.bin. This makes sure whatever
26# processing is supposed to happen to turn an .elf into a .bin happens.
27#
28# Second, we add our own rule for creating bootblock.bin from
29# bootblock.raw.bin which displaces the template rule. When other rules that
30# package up the image pull in bootblock.bin, it will be this wrapped version
31# instead of the raw bootblock.
32
33$(objcbfs)/bootblock.raw.elf: $(objcbfs)/bootblock.elf
34 cp $< $@
35
36$(obj)/generated/bct.bin: $(obj)/generated/bct.cfg
37 @printf " CBOOTIMAGE $(subst $(obj)/,,$(@))\n"
38 $(CBOOTIMAGE) -gbct --soc tegra124 $< $@
39
40BCT_BIN = $(obj)/generated/bct.bin
41BCT_WRAPPER = $(obj)/generated/bct.wrapper
42$(objcbfs)/bootblock.bin: $(objcbfs)/bootblock.raw.bin $(BCT_BIN)
43 echo "Version = 1;" > $(BCT_WRAPPER)
44 echo "Redundancy = 1;" >> $(BCT_WRAPPER)
45 echo "Bctfile = $(BCT_BIN);" >> $(BCT_WRAPPER)
46 echo "BootLoader = $<,$(CONFIG_BOOTBLOCK_BASE),$(CONFIG_BOOTBLOCK_BASE),Complete;" >> $(BCT_WRAPPER)
47 @printf " CBOOTIMAGE $(subst $(obj)/,,$(@))\n"
48 $(CBOOTIMAGE) $(BCT_WRAPPER) $@