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