blob: c5509bb6b0ae7c05d5050c5669f5d91a348bd898 [file] [log] [blame]
Sheetal Tigadoli13680c92019-12-13 10:39:06 +05301#
2# Copyright (c) 2019-2020, Broadcom
3#
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
Sheetal Tigadoli58a9eca2019-12-18 20:05:09 +053076# Use PAXB
77ifeq (${USE_PAXB},yes)
78$(info Using PAXB)
79$(eval $(call add_define,USE_PAXB))
80endif
81
82# Use FS4
83ifeq (${USE_FS4},yes)
84$(info Using FS4)
85$(eval $(call add_define,USE_FS4))
86endif
87
88# Use FS6
89ifeq (${USE_FS6},yes)
90$(info Using FS6)
91$(eval $(call add_define,USE_FS6))
92endif
93
94# Disable FS4 clock
95ifeq (${FS4_DISABLE_CLOCK},yes)
96$(info Using FS4_DISABLE_CLOCK)
97$(eval $(call add_define,FS4_DISABLE_CLOCK))
98endif
99
100ifneq (${NCSI_IO_DRIVE_STRENGTH_MA},)
101$(info Using NCSI_IO_DRIVE_STRENGTH_MA)
102$(eval $(call add_define,NCSI_IO_DRIVE_STRENGTH_MA))
103endif
104
Sheetal Tigadoliad0943e2019-12-18 19:44:43 +0530105# Use NAND
106ifeq (${USE_NAND},$(filter yes, ${USE_NAND}))
107$(info Using NAND)
108$(eval $(call add_define,USE_NAND))
109endif
110
111# Enable Broadcom error logging support
112ifeq (${BCM_ELOG},yes)
113$(info Using BCM_ELOG)
114$(eval $(call add_define,BCM_ELOG))
115endif
116
Sheetal Tigadoli2a96dc22019-12-18 12:01:01 +0530117# BL31 build for standalone mode
118ifeq (${STANDALONE_BL31},yes)
119RESET_TO_BL31 := 1
120$(info Using RESET_TO_BL31)
121endif
122
Sheetal Tigadoli58a9eca2019-12-18 20:05:09 +0530123# BL31 force full frequency for all CPUs
124ifeq (${BL31_FORCE_CPU_FULL_FREQ},yes)
125$(info Using BL31_FORCE_CPU_FULL_FREQ)
126$(eval $(call add_define,BL31_FORCE_CPU_FULL_FREQ))
127endif
128
129# Enable non-secure accesses to CCN registers
130ifeq (${BL31_CCN_NONSECURE},yes)
131$(info Using BL31_CCN_NONSECURE)
132$(eval $(call add_define,BL31_CCN_NONSECURE))
133endif
134
135# Use ChiMP
136ifeq (${USE_CHIMP},yes)
137$(info Using ChiMP)
138$(eval $(call add_define,USE_CHIMP))
139endif
140
141# Use PAXC
142ifeq (${USE_PAXC},yes)
143$(info Using PAXC)
144$(eval $(call add_define,USE_PAXC))
145ifeq (${CHIMPFW_USE_SIDELOAD},yes)
146$(info Using ChiMP FW sideload)
147$(eval $(call add_define,CHIMPFW_USE_SIDELOAD))
148endif
149$(eval $(call add_define,FASTBOOT_TYPE))
150$(eval $(call add_define,CHIMP_FB1_ENTRY))
151endif
152
153ifeq (${DEFAULT_SWREG_CONFIG}, 1)
154$(eval $(call add_define,DEFAULT_SWREG_CONFIG))
155endif
156
157ifeq (${CHIMP_ALWAYS_NEEDS_QSPI},yes)
158$(eval $(call add_define,CHIMP_ALWAYS_NEEDS_QSPI))
159endif
160
Sheetal Tigadoli13680c92019-12-13 10:39:06 +0530161# For testing purposes, use memsys stubs. Remove once memsys is fully tested.
162USE_MEMSYS_STUBS := yes
163
164# Default, use BL1_RW area
165ifneq (${BL2_USE_BL1_RW},no)
166$(eval $(call add_define,USE_BL1_RW))
167endif
168
169# Default soft reset is L3
170$(eval $(call add_define,CONFIG_SOFT_RESET_L3))
171
Sheetal Tigadoliad0943e2019-12-18 19:44:43 +0530172# Enable Chip OTP driver
173DRIVER_OCOTP_ENABLE := 1
174
Sheetal Tigadoli3bb1b4c2020-01-05 21:19:02 +0530175ifneq (${WARMBOOT_DDR_S3_SUPPORT},)
176DRIVER_SPI_ENABLE := 1
177endif
178
Sheetal Tigadoli13680c92019-12-13 10:39:06 +0530179include plat/brcm/board/common/board_common.mk
180
181SOC_DIR := brcm/board/stingray
182
183PLAT_INCLUDES += -Iplat/${SOC_DIR}/include/ \
184 -Iinclude/plat/brcm/common/ \
185 -Iplat/brcm/common/
186
187PLAT_BL_COMMON_SOURCES += lib/cpus/aarch64/cortex_a72.S \
188 plat/${SOC_DIR}/aarch64/plat_helpers.S \
189 drivers/ti/uart/aarch64/16550_console.S \
Sheetal Tigadoli2a96dc22019-12-18 12:01:01 +0530190 plat/${SOC_DIR}/src/tz_sec.c \
191 drivers/arm/tzc/tzc400.c \
Sheetal Tigadolib0156702020-01-05 14:59:04 +0530192 plat/${SOC_DIR}/driver/plat_emmc.c \
Sheetal Tigadoli2a96dc22019-12-18 12:01:01 +0530193 plat/${SOC_DIR}/src/topology.c
194
Sheetal Tigadoli58a9eca2019-12-18 20:05:09 +0530195ifeq (${USE_CHIMP},yes)
196PLAT_BL_COMMON_SOURCES += drivers/brcm/chimp.c
197endif
198
Sheetal Tigadoliad0943e2019-12-18 19:44:43 +0530199BL2_SOURCES += plat/${SOC_DIR}/driver/ihost_pll_config.c \
200 plat/${SOC_DIR}/src/bl2_setup.c \
201 plat/${SOC_DIR}/driver/swreg.c
202
203
204ifeq (${USE_DDR},yes)
205PLAT_INCLUDES += -Iplat/${SOC_DIR}/driver/ddr/soc/include
206else
207PLAT_INCLUDES += -Iplat/${SOC_DIR}/driver/ext_sram_init
208BL2_SOURCES += plat/${SOC_DIR}/driver/ext_sram_init/ext_sram_init.c
209endif
Sheetal Tigadoli2a96dc22019-12-18 12:01:01 +0530210
211# Include GICv3 driver files
212include drivers/arm/gic/v3/gicv3.mk
213
214BRCM_GIC_SOURCES := ${GICV3_SOURCES} \
215 plat/common/plat_gicv3.c \
216 plat/brcm/common/brcm_gicv3.c
217
218BL31_SOURCES += \
219 drivers/arm/ccn/ccn.c \
220 plat/brcm/board/common/timer_sync.c \
221 plat/brcm/common/brcm_ccn.c \
222 plat/common/plat_psci_common.c \
223 plat/${SOC_DIR}/driver/ihost_pll_config.c \
Sheetal Tigadoli58a9eca2019-12-18 20:05:09 +0530224 plat/${SOC_DIR}/src/bl31_setup.c \
225 plat/${SOC_DIR}/src/fsx.c \
226 plat/${SOC_DIR}/src/iommu.c \
227 plat/${SOC_DIR}/src/sdio.c \
Sheetal Tigadoli2a96dc22019-12-18 12:01:01 +0530228 ${BRCM_GIC_SOURCES}
229
Sheetal Tigadoli58a9eca2019-12-18 20:05:09 +0530230ifneq (${NCSI_IO_DRIVE_STRENGTH_MA},)
231BL31_SOURCES += plat/${SOC_DIR}/src/ncsi.c
232endif
233
234ifeq (${USE_PAXB},yes)
235BL31_SOURCES += plat/${SOC_DIR}/src/paxb.c
236BL31_SOURCES += plat/${SOC_DIR}/src/sr_paxb_phy.c
237endif
238
239ifeq (${USE_PAXC},yes)
240BL31_SOURCES += plat/${SOC_DIR}/src/paxc.c
241endif
242
Sheetal Tigadoli2a96dc22019-12-18 12:01:01 +0530243ifdef SCP_BL2
244PLAT_INCLUDES += -Iplat/brcm/common/
245
Sheetal Tigadoliad0943e2019-12-18 19:44:43 +0530246BL2_SOURCES += plat/brcm/common/brcm_mhu.c \
247 plat/brcm/common/brcm_scpi.c \
248 plat/${SOC_DIR}/src/scp_utils.c \
249 plat/${SOC_DIR}/src/scp_cmd.c \
250 drivers/brcm/scp.c
251
Sheetal Tigadoli2a96dc22019-12-18 12:01:01 +0530252BL31_SOURCES += plat/brcm/common/brcm_mhu.c \
253 plat/brcm/common/brcm_scpi.c \
254 plat/${SOC_DIR}/src/brcm_pm_ops.c
255else
256BL31_SOURCES += plat/${SOC_DIR}/src/ihost_pm.c \
257 plat/${SOC_DIR}/src/pm.c
258endif
259
Sheetal Tigadoliad0943e2019-12-18 19:44:43 +0530260ifeq (${ELOG_SUPPORT},1)
261ifeq (${ELOG_STORE_MEDIA},DDR)
262BL2_SOURCES += plat/brcm/board/common/bcm_elog_ddr.c
263endif
264endif
265
Sheetal Tigadoli58a9eca2019-12-18 20:05:09 +0530266ifeq (${BL31_BOOT_PRELOADED_SCP}, 1)
267ifdef SCP_BL2
268SCP_CFG_DIR=$(dir ${SCP_BL2})
269PLAT_INCLUDES += -I${SCP_CFG_DIR}
270endif
271PLAT_INCLUDES += -Iplat/brcm/common/
272
273# By default use OPTEE Assigned memory
274PRELOADED_SCP_BASE ?= 0x8E000000
275PRELOADED_SCP_SIZE ?= 0x10000
276$(eval $(call add_define,PRELOADED_SCP_BASE))
277$(eval $(call add_define,PRELOADED_SCP_SIZE))
278$(eval $(call add_define,BL31_BOOT_PRELOADED_SCP))
279BL31_SOURCES += plat/${SOC_DIR}/src/scp_utils.c \
280 plat/${SOC_DIR}/src/scp_cmd.c \
281 drivers/brcm/scp.c
282endif
283
Sheetal Tigadoli2a96dc22019-12-18 12:01:01 +0530284# Do not execute the startup code on warm reset.
285PROGRAMMABLE_RESET_ADDRESS := 1
Sheetal Tigadoliad0943e2019-12-18 19:44:43 +0530286
287# Nitro FW, config and Crash log uses secure DDR memory
288# Inaddition to above, Nitro master and slave is also secure
289ifneq ($(NITRO_SECURE_ACCESS),)
290$(eval $(call add_define,NITRO_SECURE_ACCESS))
291$(eval $(call add_define,DDR_NITRO_SECURE_REGION_START))
292$(eval $(call add_define,DDR_NITRO_SECURE_REGION_END))
293endif