blob: fb8c160faeba2a237f22b6df0bea8e602546e227 [file] [log] [blame]
Martin Roth9231f0b2022-10-28 22:39:23 -06001## SPDX-License-Identifier: GPL-2.0-only
Stefan Reinaueraae53ab2015-04-27 14:03:57 -07002ifeq ($(CONFIG_SOC_NVIDIA_TEGRA124),y)
3
Gabe Black8b685392013-09-29 03:02:55 -07004bootblock-y += bootblock.c
Gabe Black7f074752013-09-29 06:32:27 -07005bootblock-y += bootblock_asm.S
Ronald G. Minnich3eab7ed2013-10-03 17:05:55 -07006bootblock-y += clock.c
Gabe Blackd40be112013-10-09 23:45:07 -07007bootblock-y += dma.c
Gabe Black14eb43b2013-10-07 01:57:42 -07008bootblock-y += i2c.c
Gabe Blackd40be112013-10-09 23:45:07 -07009bootblock-y += dma.c
Julius Werneredf6b572013-10-25 17:49:26 -070010bootblock-y += maincpu.S
Ronald G. Minnich3eab7ed2013-10-03 17:05:55 -070011bootblock-y += monotonic_timer.c
Gabe Blackd40be112013-10-09 23:45:07 -070012bootblock-y += power.c
13bootblock-y += spi.c
Gabe Black08d5a892013-10-03 04:35:01 -070014bootblock-y += ../tegra/gpio.c
Gabe Black14eb43b2013-10-07 01:57:42 -070015bootblock-y += ../tegra/i2c.c
Julius Werner37d7ac82014-05-05 18:03:46 -070016bootblock-$(CONFIG_SOFTWARE_I2C) += ../tegra/software_i2c.c
Gabe Black08d5a892013-10-03 04:35:01 -070017bootblock-y += ../tegra/pingroup.c
18bootblock-y += ../tegra/pinmux.c
Jimmy Zhangbf04eda2014-02-11 17:21:20 -080019bootblock-y += ../tegra/apbmisc.c
Nico Huber755db952018-11-11 01:42:17 +010020bootblock-y += uart.c
Gabe Black396b0722013-09-26 16:22:09 -070021
Stefan Reinauer77b16552015-01-14 19:51:47 +010022verstage-y += verstage.c
Daisuke Nojiribcc1d422014-06-19 19:16:24 -070023verstage-y += dma.c
24verstage-y += monotonic_timer.c
25verstage-y += spi.c
Nico Huber755db952018-11-11 01:42:17 +010026verstage-y += uart.c
Daisuke Nojiribcc1d422014-06-19 19:16:24 -070027verstage-y += ../tegra/gpio.c
Daisuke Nojiri57990972014-07-15 19:47:32 -070028verstage-y += ../tegra/i2c.c
Daisuke Nojiribcc1d422014-06-19 19:16:24 -070029verstage-y += ../tegra/pinmux.c
Daisuke Nojiri57990972014-07-15 19:47:32 -070030verstage-y += clock.c
31verstage-y += i2c.c
Daisuke Nojiri1b05d882014-08-27 11:48:03 -070032verstage-y += cache.c
Stefan Reinauer77b16552015-01-14 19:51:47 +010033
Gabe Blackd40be112013-10-09 23:45:07 -070034romstage-y += cbmem.c
Andrew Bresticker24d4f7f2013-12-18 22:41:34 -080035romstage-y += clock.c
Gabe Blackd40be112013-10-09 23:45:07 -070036romstage-y += dma.c
37romstage-y += i2c.c
Gabe Black396b0722013-09-26 16:22:09 -070038romstage-y += monotonic_timer.c
Gabe Black4dc3e282014-05-06 15:33:37 -070039romstage-y += power.c
Andrew Bresticker24d4f7f2013-12-18 22:41:34 -080040romstage-y += sdram.c
Tom Warren64982c502014-01-23 13:37:50 -070041romstage-y += sdram_lp0.c
Gabe Blackd40be112013-10-09 23:45:07 -070042romstage-y += spi.c
43romstage-y += ../tegra/gpio.c
44romstage-y += ../tegra/i2c.c
Julius Werner37d7ac82014-05-05 18:03:46 -070045romstage-$(CONFIG_SOFTWARE_I2C) += ../tegra/software_i2c.c
Gabe Blackd40be112013-10-09 23:45:07 -070046romstage-y += ../tegra/pinmux.c
Daisuke Nojiri1b05d882014-08-27 11:48:03 -070047romstage-y += cache.c
Nico Huber755db952018-11-11 01:42:17 +010048romstage-y += uart.c
Gabe Black396b0722013-09-26 16:22:09 -070049
Gabe Blackd40be112013-10-09 23:45:07 -070050ramstage-y += clock.c
Jimmy Zhangbd5925a2014-03-10 12:42:05 -070051ramstage-y += display.c
Gabe Blackd40be112013-10-09 23:45:07 -070052ramstage-y += dma.c
53ramstage-y += i2c.c
Julius Werneredf6b572013-10-25 17:49:26 -070054ramstage-y += maincpu.S
Gabe Black396b0722013-09-26 16:22:09 -070055ramstage-y += monotonic_timer.c
Tom Warren64982c502014-01-23 13:37:50 -070056ramstage-y += sdram.c
Gabe Blackd40be112013-10-09 23:45:07 -070057ramstage-y += soc.c
Hung-Te Lin2fc3b622013-10-21 21:43:03 +080058ramstage-y += sor.c
Gabe Blackd40be112013-10-09 23:45:07 -070059ramstage-y += spi.c
Julius Werneredf6b572013-10-25 17:49:26 -070060ramstage-y += dp.c
Gabe Blackd40be112013-10-09 23:45:07 -070061ramstage-y += ../tegra/gpio.c
62ramstage-y += ../tegra/i2c.c
Julius Werner37d7ac82014-05-05 18:03:46 -070063ramstage-$(CONFIG_SOFTWARE_I2C) += ../tegra/software_i2c.c
Gabe Blackd40be112013-10-09 23:45:07 -070064ramstage-y += ../tegra/pinmux.c
Hung-Te Lin2fc3b622013-10-21 21:43:03 +080065ramstage-y += ../tegra/usb.c
Nico Huber755db952018-11-11 01:42:17 +010066ramstage-y += uart.c
Gabe Black7980b082013-09-27 03:06:34 -070067
Furquan Shaikhfbff9082014-07-22 15:59:16 -070068rmodules_$(ARCH-romstage-y)-y += monotonic_timer.c
Aaron Durbinb9597b02014-03-20 14:59:31 -050069
Gabe Blacke97b6832013-10-06 06:13:24 -070070CPPFLAGS_common += -Isrc/soc/nvidia/tegra124/include/
Ronald G. Minnich3eab7ed2013-10-03 17:05:55 -070071
Gabe Black7980b082013-09-27 03:06:34 -070072# 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 Christensen3a92be72014-09-08 15:28:17 -060084$(obj)/generated/bct.bin: $(obj)/generated/bct.cfg $(CBOOTIMAGE)
Gabe Black7980b082013-09-27 03:06:34 -070085 @printf " CBOOTIMAGE $(subst $(obj)/,,$(@))\n"
86 $(CBOOTIMAGE) -gbct --soc tegra124 $< $@
87
88BCT_BIN = $(obj)/generated/bct.bin
89BCT_WRAPPER = $(obj)/generated/bct.wrapper
Isaac Christensen3a92be72014-09-08 15:28:17 -060090$(objcbfs)/bootblock.bin: $(objcbfs)/bootblock.raw.bin $(BCT_BIN) $(CBOOTIMAGE)
Gabe Black7980b082013-09-27 03:06:34 -070091 echo "Version = 1;" > $(BCT_WRAPPER)
92 echo "Redundancy = 1;" >> $(BCT_WRAPPER)
93 echo "Bctfile = $(BCT_BIN);" >> $(BCT_WRAPPER)
Julius Wernerec5e5e02014-08-20 15:29:56 -070094 echo "BootLoader = $<,$(call loadaddr,bootblock),$(call loadaddr,bootblock),Complete;" >> $(BCT_WRAPPER)
Gabe Black7980b082013-09-27 03:06:34 -070095 @printf " CBOOTIMAGE $(subst $(obj)/,,$(@))\n"
96 $(CBOOTIMAGE) $(BCT_WRAPPER) $@
Stefan Reinaueraae53ab2015-04-27 14:03:57 -070097
98endif