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