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