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