xref: /aosp_15_r20/external/coreboot/src/soc/nvidia/tegra124/Makefile.mk (revision b9411a12aaaa7e1e6a6fb7c5e057f44ee179a49c)
1## SPDX-License-Identifier: GPL-2.0-only
2ifeq ($(CONFIG_SOC_NVIDIA_TEGRA124),y)
3
4bootblock-y += bootblock.c
5bootblock-y += bootblock_asm.S
6bootblock-y += clock.c
7bootblock-y += dma.c
8bootblock-y += i2c.c
9bootblock-y += dma.c
10bootblock-y += maincpu.S
11bootblock-y += monotonic_timer.c
12bootblock-y += power.c
13bootblock-y += spi.c
14bootblock-y += ../tegra/gpio.c
15bootblock-y += ../tegra/i2c.c
16bootblock-$(CONFIG_SOFTWARE_I2C) += ../tegra/software_i2c.c
17bootblock-y += ../tegra/pingroup.c
18bootblock-y += ../tegra/pinmux.c
19bootblock-y += ../tegra/apbmisc.c
20bootblock-y += uart.c
21
22verstage-y += verstage.c
23verstage-y += dma.c
24verstage-y += monotonic_timer.c
25verstage-y += spi.c
26verstage-y += uart.c
27verstage-y += ../tegra/gpio.c
28verstage-y += ../tegra/i2c.c
29verstage-y += ../tegra/pinmux.c
30verstage-y += clock.c
31verstage-y += i2c.c
32verstage-y += cache.c
33
34romstage-y += cbmem.c
35romstage-y += clock.c
36romstage-y += dma.c
37romstage-y += i2c.c
38romstage-y += monotonic_timer.c
39romstage-y += power.c
40romstage-y += sdram.c
41romstage-y += sdram_lp0.c
42romstage-y += spi.c
43romstage-y += ../tegra/gpio.c
44romstage-y += ../tegra/i2c.c
45romstage-$(CONFIG_SOFTWARE_I2C) += ../tegra/software_i2c.c
46romstage-y += ../tegra/pinmux.c
47romstage-y += cache.c
48romstage-y += uart.c
49
50ramstage-y += clock.c
51ramstage-y += display.c
52ramstage-y += dma.c
53ramstage-y += i2c.c
54ramstage-y += maincpu.S
55ramstage-y += monotonic_timer.c
56ramstage-y += sdram.c
57ramstage-y += soc.c
58ramstage-y += sor.c
59ramstage-y += spi.c
60ramstage-y += dp.c
61ramstage-y += ../tegra/gpio.c
62ramstage-y += ../tegra/i2c.c
63ramstage-$(CONFIG_SOFTWARE_I2C) += ../tegra/software_i2c.c
64ramstage-y += ../tegra/pinmux.c
65ramstage-y += ../tegra/usb.c
66ramstage-y += uart.c
67
68rmodules_$(ARCH-romstage-y)-y += monotonic_timer.c
69
70CPPFLAGS_common += -Isrc/soc/nvidia/tegra124/include/
71
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
84$(obj)/generated/bct.bin: $(obj)/generated/bct.cfg $(CBOOTIMAGE)
85	@printf "    CBOOTIMAGE $(subst $(obj)/,,$(@))\n"
86	$(CBOOTIMAGE) -gbct --soc tegra124 $< $@
87
88BCT_BIN = $(obj)/generated/bct.bin
89BCT_WRAPPER = $(obj)/generated/bct.wrapper
90$(objcbfs)/bootblock.bin: $(objcbfs)/bootblock.raw.bin $(BCT_BIN) $(CBOOTIMAGE)
91	echo "Version    = 1;" > $(BCT_WRAPPER)
92	echo "Redundancy = 1;" >> $(BCT_WRAPPER)
93	echo "Bctfile    = $(BCT_BIN);" >> $(BCT_WRAPPER)
94	echo "BootLoader = $<,$(call loadaddr,bootblock),$(call loadaddr,bootblock),Complete;" >> $(BCT_WRAPPER)
95	@printf "    CBOOTIMAGE $(subst $(obj)/,,$(@))\n"
96	$(CBOOTIMAGE) $(BCT_WRAPPER) $@
97
98endif
99