blob: d93f0488c5c7454ef405d8f680eb2ba931e079ca [file] [log] [blame]
Martin Roth9231f0b2022-10-28 22:39:23 -06001## SPDX-License-Identifier: GPL-2.0-only
Patrick Georgi40a3e322015-06-22 19:41:29 +02002ifeq ($(CONFIG_SOC_NVIDIA_TEGRA210),y)
3
4CBOOTIMAGE_OPTS = --soc tegra210
5
6bootblock-y += bootblock.c
7bootblock-y += bootblock_asm.S
8bootblock-y += clock.c
9bootblock-y += spi.c
10bootblock-y += i2c.c
11bootblock-y += dma.c
12bootblock-y += monotonic_timer.c
13bootblock-y += padconfig.c
14bootblock-y += power.c
15bootblock-y += funitcfg.c
Patrick Georgi40a3e322015-06-22 19:41:29 +020016bootblock-y += ../tegra/gpio.c
17bootblock-y += ../tegra/i2c.c
18bootblock-y += ../tegra/pingroup.c
19bootblock-y += ../tegra/pinmux.c
20bootblock-y += ../tegra/apbmisc.c
21bootblock-y += ../tegra/usb.c
Nico Huber755db952018-11-11 01:42:17 +010022bootblock-y += uart.c
Patrick Georgi40a3e322015-06-22 19:41:29 +020023
Patrick Georgi40a3e322015-06-22 19:41:29 +020024verstage-y += dma.c
25verstage-y += monotonic_timer.c
26verstage-y += spi.c
27verstage-y += padconfig.c
28verstage-y += funitcfg.c
Nico Huber755db952018-11-11 01:42:17 +010029verstage-y += uart.c
Patrick Georgi40a3e322015-06-22 19:41:29 +020030verstage-y += ../tegra/gpio.c
31verstage-y += ../tegra/i2c.c
32verstage-y += ../tegra/pinmux.c
33verstage-y += clock.c
34verstage-y += i2c.c
35
36romstage-y += romstage_asm.S
37romstage-y += addressmap.c
38romstage-y += cbmem.c
39romstage-y += ccplex.c
40romstage-y += clock.c
41romstage-y += cpu.c
Patrick Georgi40a3e322015-06-22 19:41:29 +020042romstage-y += spi.c
43romstage-y += i2c.c
44romstage-y += dma.c
45romstage-y += monotonic_timer.c
46romstage-y += padconfig.c
47romstage-y += funitcfg.c
48romstage-y += romstage.c
49romstage-y += power.c
50romstage-y += ram_code.c
51ifneq ($(CONFIG_BOOTROM_SDRAM_INIT),y)
52romstage-y += sdram.c
Patrick Georgi40a3e322015-06-22 19:41:29 +020053romstage-y += sdram_lp0.c
Patrick Georgi40a3e322015-06-22 19:41:29 +020054endif
55romstage-y += ../tegra/gpio.c
56romstage-y += ../tegra/i2c.c
57romstage-y += ../tegra/pinmux.c
58romstage-y += ../tegra/usb.c
Nico Huber755db952018-11-11 01:42:17 +010059romstage-y += uart.c
Patrick Georgi40a3e322015-06-22 19:41:29 +020060
61ramstage-y += addressmap.c
62ramstage-y += cbmem.c
63ramstage-y += cpu.c
Patrick Georgi40a3e322015-06-22 19:41:29 +020064ramstage-y += clock.c
65ramstage-$(CONFIG_MAINBOARD_DO_NATIVE_VGA_INIT) += dc.c
66ramstage-$(CONFIG_MAINBOARD_DO_DSI_INIT) += dsi.c
67ramstage-$(CONFIG_MAINBOARD_DO_DSI_INIT) += mipi_dsi.c
68ramstage-$(CONFIG_MAINBOARD_DO_DSI_INIT) += mipi.c
69ramstage-$(CONFIG_MAINBOARD_DO_DSI_INIT) += mipi-phy.c
70ramstage-$(CONFIG_MAINBOARD_DO_DSI_INIT) += ./jdi_25x18_display/panel-jdi-lpm102a188a.c
71ramstage-$(CONFIG_MAINBOARD_DO_SOR_INIT) += dp.c
72ramstage-$(CONFIG_MAINBOARD_DO_SOR_INIT) += sor.c
Furquan Shaikhf8142152015-08-05 17:05:26 -070073ramstage-$(CONFIG_ARM64_USE_ARM_TRUSTED_FIRMWARE) += arm_tf.c
Patrick Georgi40a3e322015-06-22 19:41:29 +020074
Yen Linae3d71a2015-06-01 15:32:09 -070075ramstage-y += sdram_lp0.c
Patrick Georgi40a3e322015-06-22 19:41:29 +020076ramstage-y += soc.c
77ramstage-y += spi.c
78ramstage-y += i2c.c
79ramstage-y += i2c6.c
80ramstage-y += ape.c
81ramstage-y += power.c
82ramstage-y += dma.c
Patrick Georgi40a3e322015-06-22 19:41:29 +020083ramstage-y += monotonic_timer.c
84ramstage-y += padconfig.c
85ramstage-y += funitcfg.c
Patrick Georgi40a3e322015-06-22 19:41:29 +020086ramstage-y += ram_code.c
87ramstage-y += ../tegra/apbmisc.c
88ramstage-y += ../tegra/gpio.c
89ramstage-y += ../tegra/i2c.c
90ramstage-y += ../tegra/pinmux.c
91ramstage-y += ramstage.c
92ramstage-y += mmu_operations.c
Nico Huber755db952018-11-11 01:42:17 +010093ramstage-y += uart.c
Patrick Georgi40a3e322015-06-22 19:41:29 +020094ramstage-y += ../tegra/usb.c
Patrick Georgi40a3e322015-06-22 19:41:29 +020095ramstage-$(CONFIG_HAVE_MTC) += mtc.c
Furquan Shaikh25fbe2a2015-07-10 15:29:13 -070096ramstage-y += stage_entry.S
Patrick Georgi40a3e322015-06-22 19:41:29 +020097
Patrick Georgi40a3e322015-06-22 19:41:29 +020098rmodules_arm-y += monotonic_timer.c
Patrick Georgi40a3e322015-06-22 19:41:29 +020099
100CPPFLAGS_common += -Isrc/soc/nvidia/tegra210/include/
101
102# We want to grab the bootblock right before it goes into the image and wrap
103# it inside a BCT, but ideally we would do that without making special, one
104# use modifications to the main ARM Makefile. We do this in two ways. First,
105# we copy bootblock.elf to bootblock.raw.elf and allow the %.bin: %.elf
106# template rule to turn it into bootblock.raw.bin. This makes sure whatever
107# processing is supposed to happen to turn an .elf into a .bin happens.
108#
109# Second, we add our own rule for creating bootblock.bin from
110# bootblock.raw.bin which displaces the template rule. When other rules that
111# package up the image pull in bootblock.bin, it will be this wrapped version
112# instead of the raw bootblock.
113
114$(objcbfs)/bootblock.raw.elf: $(objcbfs)/bootblock.elf
115 cp $< $@
116
117$(obj)/generated/bct.bin: $(obj)/generated/bct.cfg $(CBOOTIMAGE)
118 @printf " CBOOTIMAGE $(subst $(obj)/,,$(@))\n"
119 $(CBOOTIMAGE) -gbct $(CBOOTIMAGE_OPTS) $< $@
120
121BCT_BIN = $(obj)/generated/bct.bin
122BCT_WRAPPER = $(obj)/generated/bct.wrapper
123$(objcbfs)/bootblock.bin: $(objcbfs)/bootblock.raw.bin $(BCT_BIN)
124 echo "Version = 1;" > $(BCT_WRAPPER)
125 echo "Redundancy = 1;" >> $(BCT_WRAPPER)
126 echo "Bctcopy = 1;" >> $(BCT_WRAPPER)
127 echo "Bctfile = $(BCT_BIN);" >> $(BCT_WRAPPER)
128 echo "BootLoader = $<,$(call loadaddr,bootblock),$(call loadaddr,bootblock),Complete;" >> $(BCT_WRAPPER)
129 @printf " CBOOTIMAGE $(subst $(obj)/,,$(@))\n"
130 $(CBOOTIMAGE) $(CBOOTIMAGE_OPTS) $(BCT_WRAPPER) $@
131
Furquan Shaikh3ae50442015-07-07 21:35:56 -0700132# We need to ensure that TZ memory has enough space to hold TTB and resident EL3
133# components (including BL31 and Secure OS)
134ttb_size=$(shell printf "%d" $(CONFIG_TTB_SIZE_MB))
135sec_size=$(shell printf "%d" $(CONFIG_SEC_COMPONENT_SIZE_MB))
136req_tz_size=$(shell expr $(ttb_size) + $(sec_size))
137
138tz_size=$(shell printf "%d" $(CONFIG_TRUSTZONE_CARVEOUT_SIZE_MB))
139
140ifeq ($(shell test $(tz_size) -lt $(req_tz_size) && echo 1), 1)
Martin Roth26f97f92021-10-01 14:53:22 -0600141 $(error "TRUSTZONE_CARVEOUT_SIZE_MB should be at least as big as TTB_SIZE_MB + SEC_COMPONENT_SIZE_MB")
Furquan Shaikh3ae50442015-07-07 21:35:56 -0700142endif
143
144# BL31 component is placed towards the end of 32-bit address space. This assumes
145# that TrustZone memory is placed at the end of 32-bit address space. Within the
Furquan Shaikh8b385192015-08-05 17:03:34 -0700146# TZ memory, we place BL31 and BL32(if available) towards the beginning and TTB
147# towards the end. Calculate TZDRAM_BASE i.e. base of BL31 component by:
Furquan Shaikh3ae50442015-07-07 21:35:56 -0700148# 0x1000 = end of 32-bit address space in MiB
149# 0x1000 - $(CONFIG_TRUSTZONE_CARVEOUT_SIZE_MB) = start of TZ memory in MiB
Furquan Shaikh8b385192015-08-05 17:03:34 -0700150BL31_MAKEARGS += TZDRAM_BASE=$$(((0x1000 - $(CONFIG_TRUSTZONE_CARVEOUT_SIZE_MB)) << 20))
Patrick Georgi40a3e322015-06-22 19:41:29 +0200151BL31_MAKEARGS += PLAT=tegra TARGET_SOC=t210
152
153# MTC fw
154MTC_DIR = $(CONFIG_MTC_DIRECTORY)
155MTC_FILE = $(MTC_DIR)/$(CONFIG_MTC_FILE)
156MTC_FILE_CBFS = $(CONFIG_MTC_FILE)
157cbfs-files-$(CONFIG_HAVE_MTC) += $(MTC_FILE_CBFS)
158$(MTC_FILE_CBFS)-file := $(MTC_FILE)
Martin Roth8ea06512016-09-19 13:58:01 -0600159$(MTC_FILE_CBFS)-type := raw
Patrick Georgi40a3e322015-06-22 19:41:29 +0200160
161endif