blob: 67413c6aad20cb8f628361dc3a33e688306c7da9 [file] [log] [blame]
Sheetal Tigadoli13680c92019-12-13 10:39:06 +05301#
Bharat Gootyd9ff1ca2020-09-24 13:02:39 +05302# Copyright (c) 2019-2021, Broadcom
Sheetal Tigadoli13680c92019-12-13 10:39:06 +05303#
4# SPDX-License-Identifier: BSD-3-Clause
5#
6
Sheetal Tigadoliad0943e2019-12-18 19:44:43 +05307# Set the toc_flags to 1 for 100% speed operation
8# Set the toc_flags to 2 for 50% speed operation
9# Set the toc_flags to 3 for 25% speed operation
10# Set the toc_flags bit 3 to indicate ignore the fip in UEFI copy mode
11PLAT_TOC_FLAGS := 0x0
12
13# Set the IHOST_PLL_FREQ to,
14# 1 for full speed
15# 2 for 50% speed
16# 3 for 25% speed
17# 0 for bypass
18$(eval $(call add_define_val,IHOST_PLL_FREQ,1))
19
Sheetal Tigadoli13680c92019-12-13 10:39:06 +053020# Enable workaround for ERRATA_A72_859971
21ERRATA_A72_859971 := 1
22
23# Cache Coherency Interconnect Driver needed
24DRIVER_CC_ENABLE := 1
25$(eval $(call add_define,DRIVER_CC_ENABLE))
26
Sheetal Tigadolib0156702020-01-05 14:59:04 +053027# Enable to erase eMMC
28INCLUDE_EMMC_DRIVER_ERASE_CODE := 0
29
30ifeq (${INCLUDE_EMMC_DRIVER_ERASE_CODE},1)
31$(eval $(call add_define,INCLUDE_EMMC_DRIVER_ERASE_CODE))
32endif
33
Sheetal Tigadoli2a96dc22019-12-18 12:01:01 +053034# BL31 is in DRAM
35ARM_BL31_IN_DRAM := 1
36
Sheetal Tigadoli58a9eca2019-12-18 20:05:09 +053037ifneq (${USE_EMULATOR},yes)
38STINGRAY_EMULATION_SETUP := 0
39ifeq (${FASTBOOT_TYPE},)
40override FASTBOOT_TYPE := 0
41endif
42USE_PAXB := yes
43USE_PAXC := yes
44USE_CHIMP := yes
45endif
46
Sheetal Tigadoli13680c92019-12-13 10:39:06 +053047USE_CRMU_SRAM := yes
48
Sheetal Tigadoli58a9eca2019-12-18 20:05:09 +053049# Disable FS4 clocks - they can be reenabled when needed by linux
50FS4_DISABLE_CLOCK := yes
51
Sheetal Tigadoliad0943e2019-12-18 19:44:43 +053052# Enable error logging by default for Stingray
53BCM_ELOG := yes
54
55# Enable FRU support by default for Stingray
56ifeq (${USE_FRU},)
57USE_FRU := no
58endif
59
Sheetal Tigadoli13680c92019-12-13 10:39:06 +053060# Use single cluster
61ifeq (${USE_SINGLE_CLUSTER},yes)
62$(info Using Single Cluster)
63$(eval $(call add_define,USE_SINGLE_CLUSTER))
64endif
65
Sheetal Tigadoliad0943e2019-12-18 19:44:43 +053066# Use DDR
67ifeq (${USE_DDR},yes)
68$(info Using DDR)
69$(eval $(call add_define,USE_DDR))
70endif
71
Sheetal Tigadoli13680c92019-12-13 10:39:06 +053072ifeq (${BOARD_CFG},)
Max Shvetsovb247d2f2020-04-06 11:32:38 +010073BOARD_CFG := bcm958742t
Sheetal Tigadoli13680c92019-12-13 10:39:06 +053074endif
75
Bharat Gooty29e3eb92020-09-24 15:29:28 +053076# Use USB
77ifeq (${USE_USB},yes)
78$(info Using USB)
79$(eval $(call add_define,USE_USB))
80endif
81
Sheetal Tigadoli58a9eca2019-12-18 20:05:09 +053082# Use PAXB
83ifeq (${USE_PAXB},yes)
84$(info Using PAXB)
85$(eval $(call add_define,USE_PAXB))
86endif
87
88# Use FS4
89ifeq (${USE_FS4},yes)
90$(info Using FS4)
91$(eval $(call add_define,USE_FS4))
92endif
93
94# Use FS6
95ifeq (${USE_FS6},yes)
96$(info Using FS6)
97$(eval $(call add_define,USE_FS6))
98endif
99
100# Disable FS4 clock
101ifeq (${FS4_DISABLE_CLOCK},yes)
102$(info Using FS4_DISABLE_CLOCK)
103$(eval $(call add_define,FS4_DISABLE_CLOCK))
104endif
105
106ifneq (${NCSI_IO_DRIVE_STRENGTH_MA},)
107$(info Using NCSI_IO_DRIVE_STRENGTH_MA)
108$(eval $(call add_define,NCSI_IO_DRIVE_STRENGTH_MA))
109endif
110
Sheetal Tigadoliad0943e2019-12-18 19:44:43 +0530111# Use NAND
112ifeq (${USE_NAND},$(filter yes, ${USE_NAND}))
113$(info Using NAND)
114$(eval $(call add_define,USE_NAND))
115endif
116
117# Enable Broadcom error logging support
118ifeq (${BCM_ELOG},yes)
119$(info Using BCM_ELOG)
120$(eval $(call add_define,BCM_ELOG))
121endif
122
Sheetal Tigadoli2a96dc22019-12-18 12:01:01 +0530123# BL31 build for standalone mode
124ifeq (${STANDALONE_BL31},yes)
125RESET_TO_BL31 := 1
126$(info Using RESET_TO_BL31)
127endif
128
Sheetal Tigadoli58a9eca2019-12-18 20:05:09 +0530129# BL31 force full frequency for all CPUs
130ifeq (${BL31_FORCE_CPU_FULL_FREQ},yes)
131$(info Using BL31_FORCE_CPU_FULL_FREQ)
132$(eval $(call add_define,BL31_FORCE_CPU_FULL_FREQ))
133endif
134
135# Enable non-secure accesses to CCN registers
136ifeq (${BL31_CCN_NONSECURE},yes)
137$(info Using BL31_CCN_NONSECURE)
138$(eval $(call add_define,BL31_CCN_NONSECURE))
139endif
140
141# Use ChiMP
142ifeq (${USE_CHIMP},yes)
143$(info Using ChiMP)
144$(eval $(call add_define,USE_CHIMP))
145endif
146
147# Use PAXC
148ifeq (${USE_PAXC},yes)
149$(info Using PAXC)
150$(eval $(call add_define,USE_PAXC))
151ifeq (${CHIMPFW_USE_SIDELOAD},yes)
152$(info Using ChiMP FW sideload)
153$(eval $(call add_define,CHIMPFW_USE_SIDELOAD))
154endif
155$(eval $(call add_define,FASTBOOT_TYPE))
156$(eval $(call add_define,CHIMP_FB1_ENTRY))
157endif
158
159ifeq (${DEFAULT_SWREG_CONFIG}, 1)
160$(eval $(call add_define,DEFAULT_SWREG_CONFIG))
161endif
162
163ifeq (${CHIMP_ALWAYS_NEEDS_QSPI},yes)
164$(eval $(call add_define,CHIMP_ALWAYS_NEEDS_QSPI))
165endif
166
Sheetal Tigadoli13680c92019-12-13 10:39:06 +0530167# For testing purposes, use memsys stubs. Remove once memsys is fully tested.
168USE_MEMSYS_STUBS := yes
169
170# Default, use BL1_RW area
171ifneq (${BL2_USE_BL1_RW},no)
172$(eval $(call add_define,USE_BL1_RW))
173endif
174
175# Default soft reset is L3
176$(eval $(call add_define,CONFIG_SOFT_RESET_L3))
177
Sheetal Tigadoliad0943e2019-12-18 19:44:43 +0530178# Enable Chip OTP driver
179DRIVER_OCOTP_ENABLE := 1
180
Sheetal Tigadoli3bb1b4c2020-01-05 21:19:02 +0530181ifneq (${WARMBOOT_DDR_S3_SUPPORT},)
182DRIVER_SPI_ENABLE := 1
183endif
184
Sheetal Tigadoli13680c92019-12-13 10:39:06 +0530185include plat/brcm/board/common/board_common.mk
186
187SOC_DIR := brcm/board/stingray
188
189PLAT_INCLUDES += -Iplat/${SOC_DIR}/include/ \
190 -Iinclude/plat/brcm/common/ \
191 -Iplat/brcm/common/
192
193PLAT_BL_COMMON_SOURCES += lib/cpus/aarch64/cortex_a72.S \
194 plat/${SOC_DIR}/aarch64/plat_helpers.S \
195 drivers/ti/uart/aarch64/16550_console.S \
Sheetal Tigadoli2a96dc22019-12-18 12:01:01 +0530196 plat/${SOC_DIR}/src/tz_sec.c \
197 drivers/arm/tzc/tzc400.c \
Sheetal Tigadolib0156702020-01-05 14:59:04 +0530198 plat/${SOC_DIR}/driver/plat_emmc.c \
Bharat Gootyd9ff1ca2020-09-24 13:02:39 +0530199 plat/${SOC_DIR}/src/topology.c \
200 drivers/brcm/mdio/mdio.c
Sheetal Tigadoli2a96dc22019-12-18 12:01:01 +0530201
Sheetal Tigadoli58a9eca2019-12-18 20:05:09 +0530202ifeq (${USE_CHIMP},yes)
203PLAT_BL_COMMON_SOURCES += drivers/brcm/chimp.c
204endif
205
Bharat Gooty29e3eb92020-09-24 15:29:28 +0530206ifeq (${USE_USB},yes)
207PLAT_BL_COMMON_SOURCES += plat/${SOC_DIR}/driver/usb.c \
208 plat/${SOC_DIR}/driver/usb_phy.c
209endif
210
Sheetal Tigadoliad0943e2019-12-18 19:44:43 +0530211BL2_SOURCES += plat/${SOC_DIR}/driver/ihost_pll_config.c \
212 plat/${SOC_DIR}/src/bl2_setup.c \
Jayanth Dodderi Chidanand4e89de22023-06-23 23:36:01 +0100213 plat/${SOC_DIR}/driver/swreg.c \
214 lib/cpus/aarch64/cpu_helpers.S
Sheetal Tigadoliad0943e2019-12-18 19:44:43 +0530215
Sheetal Tigadoliad0943e2019-12-18 19:44:43 +0530216ifeq (${USE_DDR},yes)
217PLAT_INCLUDES += -Iplat/${SOC_DIR}/driver/ddr/soc/include
218else
219PLAT_INCLUDES += -Iplat/${SOC_DIR}/driver/ext_sram_init
220BL2_SOURCES += plat/${SOC_DIR}/driver/ext_sram_init/ext_sram_init.c
221endif
Sheetal Tigadoli2a96dc22019-12-18 12:01:01 +0530222
223# Include GICv3 driver files
224include drivers/arm/gic/v3/gicv3.mk
225
226BRCM_GIC_SOURCES := ${GICV3_SOURCES} \
227 plat/common/plat_gicv3.c \
228 plat/brcm/common/brcm_gicv3.c
229
230BL31_SOURCES += \
231 drivers/arm/ccn/ccn.c \
232 plat/brcm/board/common/timer_sync.c \
233 plat/brcm/common/brcm_ccn.c \
234 plat/common/plat_psci_common.c \
235 plat/${SOC_DIR}/driver/ihost_pll_config.c \
Sheetal Tigadoli58a9eca2019-12-18 20:05:09 +0530236 plat/${SOC_DIR}/src/bl31_setup.c \
237 plat/${SOC_DIR}/src/fsx.c \
238 plat/${SOC_DIR}/src/iommu.c \
239 plat/${SOC_DIR}/src/sdio.c \
Sheetal Tigadoli2a96dc22019-12-18 12:01:01 +0530240 ${BRCM_GIC_SOURCES}
241
Sheetal Tigadoli58a9eca2019-12-18 20:05:09 +0530242ifneq (${NCSI_IO_DRIVE_STRENGTH_MA},)
243BL31_SOURCES += plat/${SOC_DIR}/src/ncsi.c
244endif
245
246ifeq (${USE_PAXB},yes)
247BL31_SOURCES += plat/${SOC_DIR}/src/paxb.c
248BL31_SOURCES += plat/${SOC_DIR}/src/sr_paxb_phy.c
249endif
250
251ifeq (${USE_PAXC},yes)
252BL31_SOURCES += plat/${SOC_DIR}/src/paxc.c
253endif
254
Sheetal Tigadoli2a96dc22019-12-18 12:01:01 +0530255ifdef SCP_BL2
256PLAT_INCLUDES += -Iplat/brcm/common/
257
Sheetal Tigadoliad0943e2019-12-18 19:44:43 +0530258BL2_SOURCES += plat/brcm/common/brcm_mhu.c \
259 plat/brcm/common/brcm_scpi.c \
260 plat/${SOC_DIR}/src/scp_utils.c \
261 plat/${SOC_DIR}/src/scp_cmd.c \
262 drivers/brcm/scp.c
263
Sheetal Tigadoli2a96dc22019-12-18 12:01:01 +0530264BL31_SOURCES += plat/brcm/common/brcm_mhu.c \
265 plat/brcm/common/brcm_scpi.c \
266 plat/${SOC_DIR}/src/brcm_pm_ops.c
267else
268BL31_SOURCES += plat/${SOC_DIR}/src/ihost_pm.c \
269 plat/${SOC_DIR}/src/pm.c
270endif
271
Sheetal Tigadoliad0943e2019-12-18 19:44:43 +0530272ifeq (${ELOG_SUPPORT},1)
273ifeq (${ELOG_STORE_MEDIA},DDR)
274BL2_SOURCES += plat/brcm/board/common/bcm_elog_ddr.c
275endif
276endif
277
Sheetal Tigadoli58a9eca2019-12-18 20:05:09 +0530278ifeq (${BL31_BOOT_PRELOADED_SCP}, 1)
279ifdef SCP_BL2
280SCP_CFG_DIR=$(dir ${SCP_BL2})
281PLAT_INCLUDES += -I${SCP_CFG_DIR}
282endif
283PLAT_INCLUDES += -Iplat/brcm/common/
284
285# By default use OPTEE Assigned memory
286PRELOADED_SCP_BASE ?= 0x8E000000
287PRELOADED_SCP_SIZE ?= 0x10000
288$(eval $(call add_define,PRELOADED_SCP_BASE))
289$(eval $(call add_define,PRELOADED_SCP_SIZE))
290$(eval $(call add_define,BL31_BOOT_PRELOADED_SCP))
291BL31_SOURCES += plat/${SOC_DIR}/src/scp_utils.c \
292 plat/${SOC_DIR}/src/scp_cmd.c \
293 drivers/brcm/scp.c
294endif
295
Sheetal Tigadoli2a96dc22019-12-18 12:01:01 +0530296# Do not execute the startup code on warm reset.
297PROGRAMMABLE_RESET_ADDRESS := 1
Sheetal Tigadoliad0943e2019-12-18 19:44:43 +0530298
299# Nitro FW, config and Crash log uses secure DDR memory
300# Inaddition to above, Nitro master and slave is also secure
301ifneq ($(NITRO_SECURE_ACCESS),)
302$(eval $(call add_define,NITRO_SECURE_ACCESS))
303$(eval $(call add_define,DDR_NITRO_SECURE_REGION_START))
304$(eval $(call add_define,DDR_NITRO_SECURE_REGION_END))
305endif