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