Martin Roth | 9231f0b | 2022-10-28 22:39:23 -0600 | [diff] [blame] | 1 | ## SPDX-License-Identifier: GPL-2.0-only |
Stefan Reinauer | aae53ab | 2015-04-27 14:03:57 -0700 | [diff] [blame] | 2 | ifeq ($(CONFIG_SOC_NVIDIA_TEGRA124),y) |
| 3 | |
Gabe Black | 8b68539 | 2013-09-29 03:02:55 -0700 | [diff] [blame] | 4 | bootblock-y += bootblock.c |
Gabe Black | 7f07475 | 2013-09-29 06:32:27 -0700 | [diff] [blame] | 5 | bootblock-y += bootblock_asm.S |
Ronald G. Minnich | 3eab7ed | 2013-10-03 17:05:55 -0700 | [diff] [blame] | 6 | bootblock-y += clock.c |
Gabe Black | d40be11 | 2013-10-09 23:45:07 -0700 | [diff] [blame] | 7 | bootblock-y += dma.c |
Gabe Black | 14eb43b | 2013-10-07 01:57:42 -0700 | [diff] [blame] | 8 | bootblock-y += i2c.c |
Gabe Black | d40be11 | 2013-10-09 23:45:07 -0700 | [diff] [blame] | 9 | bootblock-y += dma.c |
Julius Werner | edf6b57 | 2013-10-25 17:49:26 -0700 | [diff] [blame] | 10 | bootblock-y += maincpu.S |
Ronald G. Minnich | 3eab7ed | 2013-10-03 17:05:55 -0700 | [diff] [blame] | 11 | bootblock-y += monotonic_timer.c |
Gabe Black | d40be11 | 2013-10-09 23:45:07 -0700 | [diff] [blame] | 12 | bootblock-y += power.c |
| 13 | bootblock-y += spi.c |
Gabe Black | 08d5a89 | 2013-10-03 04:35:01 -0700 | [diff] [blame] | 14 | bootblock-y += ../tegra/gpio.c |
Gabe Black | 14eb43b | 2013-10-07 01:57:42 -0700 | [diff] [blame] | 15 | bootblock-y += ../tegra/i2c.c |
Julius Werner | 37d7ac8 | 2014-05-05 18:03:46 -0700 | [diff] [blame] | 16 | bootblock-$(CONFIG_SOFTWARE_I2C) += ../tegra/software_i2c.c |
Gabe Black | 08d5a89 | 2013-10-03 04:35:01 -0700 | [diff] [blame] | 17 | bootblock-y += ../tegra/pingroup.c |
| 18 | bootblock-y += ../tegra/pinmux.c |
Jimmy Zhang | bf04eda | 2014-02-11 17:21:20 -0800 | [diff] [blame] | 19 | bootblock-y += ../tegra/apbmisc.c |
Nico Huber | 755db95 | 2018-11-11 01:42:17 +0100 | [diff] [blame] | 20 | bootblock-y += uart.c |
Gabe Black | 396b072 | 2013-09-26 16:22:09 -0700 | [diff] [blame] | 21 | |
Stefan Reinauer | 77b1655 | 2015-01-14 19:51:47 +0100 | [diff] [blame] | 22 | verstage-y += verstage.c |
Daisuke Nojiri | bcc1d42 | 2014-06-19 19:16:24 -0700 | [diff] [blame] | 23 | verstage-y += dma.c |
| 24 | verstage-y += monotonic_timer.c |
| 25 | verstage-y += spi.c |
Nico Huber | 755db95 | 2018-11-11 01:42:17 +0100 | [diff] [blame] | 26 | verstage-y += uart.c |
Daisuke Nojiri | bcc1d42 | 2014-06-19 19:16:24 -0700 | [diff] [blame] | 27 | verstage-y += ../tegra/gpio.c |
Daisuke Nojiri | 5799097 | 2014-07-15 19:47:32 -0700 | [diff] [blame] | 28 | verstage-y += ../tegra/i2c.c |
Daisuke Nojiri | bcc1d42 | 2014-06-19 19:16:24 -0700 | [diff] [blame] | 29 | verstage-y += ../tegra/pinmux.c |
Daisuke Nojiri | 5799097 | 2014-07-15 19:47:32 -0700 | [diff] [blame] | 30 | verstage-y += clock.c |
| 31 | verstage-y += i2c.c |
Daisuke Nojiri | 1b05d88 | 2014-08-27 11:48:03 -0700 | [diff] [blame] | 32 | verstage-y += cache.c |
Stefan Reinauer | 77b1655 | 2015-01-14 19:51:47 +0100 | [diff] [blame] | 33 | |
Gabe Black | d40be11 | 2013-10-09 23:45:07 -0700 | [diff] [blame] | 34 | romstage-y += cbmem.c |
Andrew Bresticker | 24d4f7f | 2013-12-18 22:41:34 -0800 | [diff] [blame] | 35 | romstage-y += clock.c |
Gabe Black | d40be11 | 2013-10-09 23:45:07 -0700 | [diff] [blame] | 36 | romstage-y += dma.c |
| 37 | romstage-y += i2c.c |
Gabe Black | 396b072 | 2013-09-26 16:22:09 -0700 | [diff] [blame] | 38 | romstage-y += monotonic_timer.c |
Gabe Black | 4dc3e28 | 2014-05-06 15:33:37 -0700 | [diff] [blame] | 39 | romstage-y += power.c |
Andrew Bresticker | 24d4f7f | 2013-12-18 22:41:34 -0800 | [diff] [blame] | 40 | romstage-y += sdram.c |
Tom Warren | 64982c50 | 2014-01-23 13:37:50 -0700 | [diff] [blame] | 41 | romstage-y += sdram_lp0.c |
Gabe Black | d40be11 | 2013-10-09 23:45:07 -0700 | [diff] [blame] | 42 | romstage-y += spi.c |
| 43 | romstage-y += ../tegra/gpio.c |
| 44 | romstage-y += ../tegra/i2c.c |
Julius Werner | 37d7ac8 | 2014-05-05 18:03:46 -0700 | [diff] [blame] | 45 | romstage-$(CONFIG_SOFTWARE_I2C) += ../tegra/software_i2c.c |
Gabe Black | d40be11 | 2013-10-09 23:45:07 -0700 | [diff] [blame] | 46 | romstage-y += ../tegra/pinmux.c |
Daisuke Nojiri | 1b05d88 | 2014-08-27 11:48:03 -0700 | [diff] [blame] | 47 | romstage-y += cache.c |
Nico Huber | 755db95 | 2018-11-11 01:42:17 +0100 | [diff] [blame] | 48 | romstage-y += uart.c |
Gabe Black | 396b072 | 2013-09-26 16:22:09 -0700 | [diff] [blame] | 49 | |
Gabe Black | d40be11 | 2013-10-09 23:45:07 -0700 | [diff] [blame] | 50 | ramstage-y += clock.c |
Jimmy Zhang | bd5925a | 2014-03-10 12:42:05 -0700 | [diff] [blame] | 51 | ramstage-y += display.c |
Gabe Black | d40be11 | 2013-10-09 23:45:07 -0700 | [diff] [blame] | 52 | ramstage-y += dma.c |
| 53 | ramstage-y += i2c.c |
Julius Werner | edf6b57 | 2013-10-25 17:49:26 -0700 | [diff] [blame] | 54 | ramstage-y += maincpu.S |
Gabe Black | 396b072 | 2013-09-26 16:22:09 -0700 | [diff] [blame] | 55 | ramstage-y += monotonic_timer.c |
Tom Warren | 64982c50 | 2014-01-23 13:37:50 -0700 | [diff] [blame] | 56 | ramstage-y += sdram.c |
Gabe Black | d40be11 | 2013-10-09 23:45:07 -0700 | [diff] [blame] | 57 | ramstage-y += soc.c |
Hung-Te Lin | 2fc3b62 | 2013-10-21 21:43:03 +0800 | [diff] [blame] | 58 | ramstage-y += sor.c |
Gabe Black | d40be11 | 2013-10-09 23:45:07 -0700 | [diff] [blame] | 59 | ramstage-y += spi.c |
Julius Werner | edf6b57 | 2013-10-25 17:49:26 -0700 | [diff] [blame] | 60 | ramstage-y += dp.c |
Gabe Black | d40be11 | 2013-10-09 23:45:07 -0700 | [diff] [blame] | 61 | ramstage-y += ../tegra/gpio.c |
| 62 | ramstage-y += ../tegra/i2c.c |
Julius Werner | 37d7ac8 | 2014-05-05 18:03:46 -0700 | [diff] [blame] | 63 | ramstage-$(CONFIG_SOFTWARE_I2C) += ../tegra/software_i2c.c |
Gabe Black | d40be11 | 2013-10-09 23:45:07 -0700 | [diff] [blame] | 64 | ramstage-y += ../tegra/pinmux.c |
Hung-Te Lin | 2fc3b62 | 2013-10-21 21:43:03 +0800 | [diff] [blame] | 65 | ramstage-y += ../tegra/usb.c |
Nico Huber | 755db95 | 2018-11-11 01:42:17 +0100 | [diff] [blame] | 66 | ramstage-y += uart.c |
Gabe Black | 7980b08 | 2013-09-27 03:06:34 -0700 | [diff] [blame] | 67 | |
Furquan Shaikh | fbff908 | 2014-07-22 15:59:16 -0700 | [diff] [blame] | 68 | rmodules_$(ARCH-romstage-y)-y += monotonic_timer.c |
Aaron Durbin | b9597b0 | 2014-03-20 14:59:31 -0500 | [diff] [blame] | 69 | |
Gabe Black | e97b683 | 2013-10-06 06:13:24 -0700 | [diff] [blame] | 70 | CPPFLAGS_common += -Isrc/soc/nvidia/tegra124/include/ |
Ronald G. Minnich | 3eab7ed | 2013-10-03 17:05:55 -0700 | [diff] [blame] | 71 | |
Gabe Black | 7980b08 | 2013-09-27 03:06:34 -0700 | [diff] [blame] | 72 | # We want to grab the bootblock right before it goes into the image and wrap |
| 73 | # it inside a BCT, but ideally we would do that without making special, one |
| 74 | # use modifications to the main ARM Makefile. We do this in two ways. First, |
| 75 | # we copy bootblock.elf to bootblock.raw.elf and allow the %.bin: %.elf |
| 76 | # template rule to turn it into bootblock.raw.bin. This makes sure whatever |
| 77 | # processing is supposed to happen to turn an .elf into a .bin happens. |
| 78 | # |
| 79 | # Second, we add our own rule for creating bootblock.bin from |
| 80 | # bootblock.raw.bin which displaces the template rule. When other rules that |
| 81 | # package up the image pull in bootblock.bin, it will be this wrapped version |
| 82 | # instead of the raw bootblock. |
| 83 | |
Isaac Christensen | 3a92be7 | 2014-09-08 15:28:17 -0600 | [diff] [blame] | 84 | $(obj)/generated/bct.bin: $(obj)/generated/bct.cfg $(CBOOTIMAGE) |
Gabe Black | 7980b08 | 2013-09-27 03:06:34 -0700 | [diff] [blame] | 85 | @printf " CBOOTIMAGE $(subst $(obj)/,,$(@))\n" |
| 86 | $(CBOOTIMAGE) -gbct --soc tegra124 $< $@ |
| 87 | |
| 88 | BCT_BIN = $(obj)/generated/bct.bin |
| 89 | BCT_WRAPPER = $(obj)/generated/bct.wrapper |
Isaac Christensen | 3a92be7 | 2014-09-08 15:28:17 -0600 | [diff] [blame] | 90 | $(objcbfs)/bootblock.bin: $(objcbfs)/bootblock.raw.bin $(BCT_BIN) $(CBOOTIMAGE) |
Gabe Black | 7980b08 | 2013-09-27 03:06:34 -0700 | [diff] [blame] | 91 | echo "Version = 1;" > $(BCT_WRAPPER) |
| 92 | echo "Redundancy = 1;" >> $(BCT_WRAPPER) |
| 93 | echo "Bctfile = $(BCT_BIN);" >> $(BCT_WRAPPER) |
Julius Werner | ec5e5e0 | 2014-08-20 15:29:56 -0700 | [diff] [blame] | 94 | echo "BootLoader = $<,$(call loadaddr,bootblock),$(call loadaddr,bootblock),Complete;" >> $(BCT_WRAPPER) |
Gabe Black | 7980b08 | 2013-09-27 03:06:34 -0700 | [diff] [blame] | 95 | @printf " CBOOTIMAGE $(subst $(obj)/,,$(@))\n" |
| 96 | $(CBOOTIMAGE) $(BCT_WRAPPER) $@ |
Stefan Reinauer | aae53ab | 2015-04-27 14:03:57 -0700 | [diff] [blame] | 97 | |
| 98 | endif |