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