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