blob: b1f59988e9a0b52174a284cd336eb00765df0a39 [file] [log] [blame]
Gabe Black8b685392013-09-29 03:02:55 -07001bootblock-y += bootblock.c
Gabe Black7f074752013-09-29 06:32:27 -07002bootblock-y += bootblock_asm.S
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 Blackca436cb2013-09-29 07:06:08 -070012bootblock-$(CONFIG_BOOTBLOCK_CONSOLE) += uart.c
Gabe Black396b0722013-09-26 16:22:09 -070013
14romstage-y += cbfs.c
15romstage-y += monotonic_timer.c
16romstage-y += timer.c
Gabe Blackca436cb2013-09-29 07:06:08 -070017romstage-y += uart.c
Gabe Black396b0722013-09-26 16:22:09 -070018
19ramstage-y += cbfs.c
20ramstage-y += monotonic_timer.c
21ramstage-y += timer.c
Gabe Blackca436cb2013-09-29 07:06:08 -070022ramstage-y += uart.c
Gabe Black7980b082013-09-27 03:06:34 -070023
Gabe Blacke97b6832013-10-06 06:13:24 -070024CPPFLAGS_common += -Isrc/soc/nvidia/tegra124/include/
Ronald G. Minnich3eab7ed2013-10-03 17:05:55 -070025
Gabe Black7980b082013-09-27 03:06:34 -070026# We want to grab the bootblock right before it goes into the image and wrap
27# it inside a BCT, but ideally we would do that without making special, one
28# use modifications to the main ARM Makefile. We do this in two ways. First,
29# we copy bootblock.elf to bootblock.raw.elf and allow the %.bin: %.elf
30# template rule to turn it into bootblock.raw.bin. This makes sure whatever
31# processing is supposed to happen to turn an .elf into a .bin happens.
32#
33# Second, we add our own rule for creating bootblock.bin from
34# bootblock.raw.bin which displaces the template rule. When other rules that
35# package up the image pull in bootblock.bin, it will be this wrapped version
36# instead of the raw bootblock.
37
38$(objcbfs)/bootblock.raw.elf: $(objcbfs)/bootblock.elf
39 cp $< $@
40
Isaac Christensen3a92be72014-09-08 15:28:17 -060041$(obj)/generated/bct.bin: $(obj)/generated/bct.cfg $(CBOOTIMAGE)
Gabe Black7980b082013-09-27 03:06:34 -070042 @printf " CBOOTIMAGE $(subst $(obj)/,,$(@))\n"
43 $(CBOOTIMAGE) -gbct --soc tegra124 $< $@
44
45BCT_BIN = $(obj)/generated/bct.bin
46BCT_WRAPPER = $(obj)/generated/bct.wrapper
Isaac Christensen3a92be72014-09-08 15:28:17 -060047$(objcbfs)/bootblock.bin: $(objcbfs)/bootblock.raw.bin $(BCT_BIN) $(CBOOTIMAGE)
Gabe Black7980b082013-09-27 03:06:34 -070048 echo "Version = 1;" > $(BCT_WRAPPER)
49 echo "Redundancy = 1;" >> $(BCT_WRAPPER)
50 echo "Bctfile = $(BCT_BIN);" >> $(BCT_WRAPPER)
51 echo "BootLoader = $<,$(CONFIG_BOOTBLOCK_BASE),$(CONFIG_BOOTBLOCK_BASE),Complete;" >> $(BCT_WRAPPER)
52 @printf " CBOOTIMAGE $(subst $(obj)/,,$(@))\n"
53 $(CBOOTIMAGE) $(BCT_WRAPPER) $@