Gabe Black | 7980b08 | 2013-09-27 03:06:34 -0700 | [diff] [blame] | 1 | CBOOTIMAGE = cbootimage |
| 2 | |
Gabe Black | 396b072 | 2013-09-26 16:22:09 -0700 | [diff] [blame] | 3 | bootblock-y += cbfs.c |
Ronald G. Minnich | 3eab7ed | 2013-10-03 17:05:55 -0700 | [diff] [blame] | 4 | bootblock-y += clock.c |
| 5 | bootblock-y += monotonic_timer.c |
Gabe Black | 08d5a89 | 2013-10-03 04:35:01 -0700 | [diff] [blame^] | 6 | bootblock-y += ../tegra/gpio.c |
| 7 | bootblock-y += ../tegra/pingroup.c |
| 8 | bootblock-y += ../tegra/pinmux.c |
Ronald G. Minnich | 3eab7ed | 2013-10-03 17:05:55 -0700 | [diff] [blame] | 9 | bootblock-y += timer.c |
Gabe Black | 396b072 | 2013-09-26 16:22:09 -0700 | [diff] [blame] | 10 | |
| 11 | romstage-y += cbfs.c |
| 12 | romstage-y += monotonic_timer.c |
| 13 | romstage-y += timer.c |
| 14 | |
| 15 | ramstage-y += cbfs.c |
| 16 | ramstage-y += monotonic_timer.c |
| 17 | ramstage-y += timer.c |
Gabe Black | 7980b08 | 2013-09-27 03:06:34 -0700 | [diff] [blame] | 18 | |
Gabe Black | e97b683 | 2013-10-06 06:13:24 -0700 | [diff] [blame] | 19 | CPPFLAGS_common += -Isrc/soc/nvidia/tegra124/include/ |
Ronald G. Minnich | 3eab7ed | 2013-10-03 17:05:55 -0700 | [diff] [blame] | 20 | |
Gabe Black | 7980b08 | 2013-09-27 03:06:34 -0700 | [diff] [blame] | 21 | # We want to grab the bootblock right before it goes into the image and wrap |
| 22 | # it inside a BCT, but ideally we would do that without making special, one |
| 23 | # use modifications to the main ARM Makefile. We do this in two ways. First, |
| 24 | # we copy bootblock.elf to bootblock.raw.elf and allow the %.bin: %.elf |
| 25 | # template rule to turn it into bootblock.raw.bin. This makes sure whatever |
| 26 | # processing is supposed to happen to turn an .elf into a .bin happens. |
| 27 | # |
| 28 | # Second, we add our own rule for creating bootblock.bin from |
| 29 | # bootblock.raw.bin which displaces the template rule. When other rules that |
| 30 | # package up the image pull in bootblock.bin, it will be this wrapped version |
| 31 | # instead of the raw bootblock. |
| 32 | |
| 33 | $(objcbfs)/bootblock.raw.elf: $(objcbfs)/bootblock.elf |
| 34 | cp $< $@ |
| 35 | |
| 36 | $(obj)/generated/bct.bin: $(obj)/generated/bct.cfg |
| 37 | @printf " CBOOTIMAGE $(subst $(obj)/,,$(@))\n" |
| 38 | $(CBOOTIMAGE) -gbct --soc tegra124 $< $@ |
| 39 | |
| 40 | BCT_BIN = $(obj)/generated/bct.bin |
| 41 | BCT_WRAPPER = $(obj)/generated/bct.wrapper |
| 42 | $(objcbfs)/bootblock.bin: $(objcbfs)/bootblock.raw.bin $(BCT_BIN) |
| 43 | echo "Version = 1;" > $(BCT_WRAPPER) |
| 44 | echo "Redundancy = 1;" >> $(BCT_WRAPPER) |
| 45 | echo "Bctfile = $(BCT_BIN);" >> $(BCT_WRAPPER) |
| 46 | echo "BootLoader = $<,$(CONFIG_BOOTBLOCK_BASE),$(CONFIG_BOOTBLOCK_BASE),Complete;" >> $(BCT_WRAPPER) |
| 47 | @printf " CBOOTIMAGE $(subst $(obj)/,,$(@))\n" |
| 48 | $(CBOOTIMAGE) $(BCT_WRAPPER) $@ |