Sheetal Tigadoli | 13680c9 | 2019-12-13 10:39:06 +0530 | [diff] [blame] | 1 | # |
| 2 | # Copyright (c) 2019-2020, Broadcom |
| 3 | # |
| 4 | # SPDX-License-Identifier: BSD-3-Clause |
| 5 | # |
| 6 | |
Sheetal Tigadoli | ad0943e | 2019-12-18 19:44:43 +0530 | [diff] [blame] | 7 | # 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 |
| 11 | PLAT_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 Tigadoli | 13680c9 | 2019-12-13 10:39:06 +0530 | [diff] [blame] | 20 | # Enable workaround for ERRATA_A72_859971 |
| 21 | ERRATA_A72_859971 := 1 |
| 22 | |
| 23 | # Cache Coherency Interconnect Driver needed |
| 24 | DRIVER_CC_ENABLE := 1 |
| 25 | $(eval $(call add_define,DRIVER_CC_ENABLE)) |
| 26 | |
Sheetal Tigadoli | b015670 | 2020-01-05 14:59:04 +0530 | [diff] [blame] | 27 | # Enable to erase eMMC |
| 28 | INCLUDE_EMMC_DRIVER_ERASE_CODE := 0 |
| 29 | |
| 30 | ifeq (${INCLUDE_EMMC_DRIVER_ERASE_CODE},1) |
| 31 | $(eval $(call add_define,INCLUDE_EMMC_DRIVER_ERASE_CODE)) |
| 32 | endif |
| 33 | |
Sheetal Tigadoli | 2a96dc2 | 2019-12-18 12:01:01 +0530 | [diff] [blame] | 34 | # BL31 is in DRAM |
| 35 | ARM_BL31_IN_DRAM := 1 |
| 36 | |
Sheetal Tigadoli | 58a9eca | 2019-12-18 20:05:09 +0530 | [diff] [blame] | 37 | ifneq (${USE_EMULATOR},yes) |
| 38 | STINGRAY_EMULATION_SETUP := 0 |
| 39 | ifeq (${FASTBOOT_TYPE},) |
| 40 | override FASTBOOT_TYPE := 0 |
| 41 | endif |
| 42 | USE_PAXB := yes |
| 43 | USE_PAXC := yes |
| 44 | USE_CHIMP := yes |
| 45 | endif |
| 46 | |
Sheetal Tigadoli | 13680c9 | 2019-12-13 10:39:06 +0530 | [diff] [blame] | 47 | USE_CRMU_SRAM := yes |
| 48 | |
Sheetal Tigadoli | 58a9eca | 2019-12-18 20:05:09 +0530 | [diff] [blame] | 49 | # Disable FS4 clocks - they can be reenabled when needed by linux |
| 50 | FS4_DISABLE_CLOCK := yes |
| 51 | |
Sheetal Tigadoli | ad0943e | 2019-12-18 19:44:43 +0530 | [diff] [blame] | 52 | # Enable error logging by default for Stingray |
| 53 | BCM_ELOG := yes |
| 54 | |
| 55 | # Enable FRU support by default for Stingray |
| 56 | ifeq (${USE_FRU},) |
| 57 | USE_FRU := no |
| 58 | endif |
| 59 | |
Sheetal Tigadoli | 13680c9 | 2019-12-13 10:39:06 +0530 | [diff] [blame] | 60 | # Use single cluster |
| 61 | ifeq (${USE_SINGLE_CLUSTER},yes) |
| 62 | $(info Using Single Cluster) |
| 63 | $(eval $(call add_define,USE_SINGLE_CLUSTER)) |
| 64 | endif |
| 65 | |
Sheetal Tigadoli | ad0943e | 2019-12-18 19:44:43 +0530 | [diff] [blame] | 66 | # Use DDR |
| 67 | ifeq (${USE_DDR},yes) |
| 68 | $(info Using DDR) |
| 69 | $(eval $(call add_define,USE_DDR)) |
| 70 | endif |
| 71 | |
Sheetal Tigadoli | 13680c9 | 2019-12-13 10:39:06 +0530 | [diff] [blame] | 72 | ifeq (${BOARD_CFG},) |
Max Shvetsov | b247d2f | 2020-04-06 11:32:38 +0100 | [diff] [blame] | 73 | BOARD_CFG := bcm958742t |
Sheetal Tigadoli | 13680c9 | 2019-12-13 10:39:06 +0530 | [diff] [blame] | 74 | endif |
| 75 | |
Sheetal Tigadoli | 58a9eca | 2019-12-18 20:05:09 +0530 | [diff] [blame] | 76 | # Use PAXB |
| 77 | ifeq (${USE_PAXB},yes) |
| 78 | $(info Using PAXB) |
| 79 | $(eval $(call add_define,USE_PAXB)) |
| 80 | endif |
| 81 | |
| 82 | # Use FS4 |
| 83 | ifeq (${USE_FS4},yes) |
| 84 | $(info Using FS4) |
| 85 | $(eval $(call add_define,USE_FS4)) |
| 86 | endif |
| 87 | |
| 88 | # Use FS6 |
| 89 | ifeq (${USE_FS6},yes) |
| 90 | $(info Using FS6) |
| 91 | $(eval $(call add_define,USE_FS6)) |
| 92 | endif |
| 93 | |
| 94 | # Disable FS4 clock |
| 95 | ifeq (${FS4_DISABLE_CLOCK},yes) |
| 96 | $(info Using FS4_DISABLE_CLOCK) |
| 97 | $(eval $(call add_define,FS4_DISABLE_CLOCK)) |
| 98 | endif |
| 99 | |
| 100 | ifneq (${NCSI_IO_DRIVE_STRENGTH_MA},) |
| 101 | $(info Using NCSI_IO_DRIVE_STRENGTH_MA) |
| 102 | $(eval $(call add_define,NCSI_IO_DRIVE_STRENGTH_MA)) |
| 103 | endif |
| 104 | |
Sheetal Tigadoli | ad0943e | 2019-12-18 19:44:43 +0530 | [diff] [blame] | 105 | # Use NAND |
| 106 | ifeq (${USE_NAND},$(filter yes, ${USE_NAND})) |
| 107 | $(info Using NAND) |
| 108 | $(eval $(call add_define,USE_NAND)) |
| 109 | endif |
| 110 | |
| 111 | # Enable Broadcom error logging support |
| 112 | ifeq (${BCM_ELOG},yes) |
| 113 | $(info Using BCM_ELOG) |
| 114 | $(eval $(call add_define,BCM_ELOG)) |
| 115 | endif |
| 116 | |
Sheetal Tigadoli | 2a96dc2 | 2019-12-18 12:01:01 +0530 | [diff] [blame] | 117 | # BL31 build for standalone mode |
| 118 | ifeq (${STANDALONE_BL31},yes) |
| 119 | RESET_TO_BL31 := 1 |
| 120 | $(info Using RESET_TO_BL31) |
| 121 | endif |
| 122 | |
Sheetal Tigadoli | 58a9eca | 2019-12-18 20:05:09 +0530 | [diff] [blame] | 123 | # BL31 force full frequency for all CPUs |
| 124 | ifeq (${BL31_FORCE_CPU_FULL_FREQ},yes) |
| 125 | $(info Using BL31_FORCE_CPU_FULL_FREQ) |
| 126 | $(eval $(call add_define,BL31_FORCE_CPU_FULL_FREQ)) |
| 127 | endif |
| 128 | |
| 129 | # Enable non-secure accesses to CCN registers |
| 130 | ifeq (${BL31_CCN_NONSECURE},yes) |
| 131 | $(info Using BL31_CCN_NONSECURE) |
| 132 | $(eval $(call add_define,BL31_CCN_NONSECURE)) |
| 133 | endif |
| 134 | |
| 135 | # Use ChiMP |
| 136 | ifeq (${USE_CHIMP},yes) |
| 137 | $(info Using ChiMP) |
| 138 | $(eval $(call add_define,USE_CHIMP)) |
| 139 | endif |
| 140 | |
| 141 | # Use PAXC |
| 142 | ifeq (${USE_PAXC},yes) |
| 143 | $(info Using PAXC) |
| 144 | $(eval $(call add_define,USE_PAXC)) |
| 145 | ifeq (${CHIMPFW_USE_SIDELOAD},yes) |
| 146 | $(info Using ChiMP FW sideload) |
| 147 | $(eval $(call add_define,CHIMPFW_USE_SIDELOAD)) |
| 148 | endif |
| 149 | $(eval $(call add_define,FASTBOOT_TYPE)) |
| 150 | $(eval $(call add_define,CHIMP_FB1_ENTRY)) |
| 151 | endif |
| 152 | |
| 153 | ifeq (${DEFAULT_SWREG_CONFIG}, 1) |
| 154 | $(eval $(call add_define,DEFAULT_SWREG_CONFIG)) |
| 155 | endif |
| 156 | |
| 157 | ifeq (${CHIMP_ALWAYS_NEEDS_QSPI},yes) |
| 158 | $(eval $(call add_define,CHIMP_ALWAYS_NEEDS_QSPI)) |
| 159 | endif |
| 160 | |
Sheetal Tigadoli | 13680c9 | 2019-12-13 10:39:06 +0530 | [diff] [blame] | 161 | # For testing purposes, use memsys stubs. Remove once memsys is fully tested. |
| 162 | USE_MEMSYS_STUBS := yes |
| 163 | |
| 164 | # Default, use BL1_RW area |
| 165 | ifneq (${BL2_USE_BL1_RW},no) |
| 166 | $(eval $(call add_define,USE_BL1_RW)) |
| 167 | endif |
| 168 | |
| 169 | # Default soft reset is L3 |
| 170 | $(eval $(call add_define,CONFIG_SOFT_RESET_L3)) |
| 171 | |
Sheetal Tigadoli | ad0943e | 2019-12-18 19:44:43 +0530 | [diff] [blame] | 172 | # Enable Chip OTP driver |
| 173 | DRIVER_OCOTP_ENABLE := 1 |
| 174 | |
Sheetal Tigadoli | 3bb1b4c | 2020-01-05 21:19:02 +0530 | [diff] [blame] | 175 | ifneq (${WARMBOOT_DDR_S3_SUPPORT},) |
| 176 | DRIVER_SPI_ENABLE := 1 |
| 177 | endif |
| 178 | |
Sheetal Tigadoli | 13680c9 | 2019-12-13 10:39:06 +0530 | [diff] [blame] | 179 | include plat/brcm/board/common/board_common.mk |
| 180 | |
| 181 | SOC_DIR := brcm/board/stingray |
| 182 | |
| 183 | PLAT_INCLUDES += -Iplat/${SOC_DIR}/include/ \ |
| 184 | -Iinclude/plat/brcm/common/ \ |
| 185 | -Iplat/brcm/common/ |
| 186 | |
| 187 | PLAT_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 Tigadoli | 2a96dc2 | 2019-12-18 12:01:01 +0530 | [diff] [blame] | 190 | plat/${SOC_DIR}/src/tz_sec.c \ |
| 191 | drivers/arm/tzc/tzc400.c \ |
Sheetal Tigadoli | b015670 | 2020-01-05 14:59:04 +0530 | [diff] [blame] | 192 | plat/${SOC_DIR}/driver/plat_emmc.c \ |
Sheetal Tigadoli | 2a96dc2 | 2019-12-18 12:01:01 +0530 | [diff] [blame] | 193 | plat/${SOC_DIR}/src/topology.c |
| 194 | |
Sheetal Tigadoli | 58a9eca | 2019-12-18 20:05:09 +0530 | [diff] [blame] | 195 | ifeq (${USE_CHIMP},yes) |
| 196 | PLAT_BL_COMMON_SOURCES += drivers/brcm/chimp.c |
| 197 | endif |
| 198 | |
Sheetal Tigadoli | ad0943e | 2019-12-18 19:44:43 +0530 | [diff] [blame] | 199 | BL2_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 | |
| 204 | ifeq (${USE_DDR},yes) |
| 205 | PLAT_INCLUDES += -Iplat/${SOC_DIR}/driver/ddr/soc/include |
| 206 | else |
| 207 | PLAT_INCLUDES += -Iplat/${SOC_DIR}/driver/ext_sram_init |
| 208 | BL2_SOURCES += plat/${SOC_DIR}/driver/ext_sram_init/ext_sram_init.c |
| 209 | endif |
Sheetal Tigadoli | 2a96dc2 | 2019-12-18 12:01:01 +0530 | [diff] [blame] | 210 | |
| 211 | # Include GICv3 driver files |
| 212 | include drivers/arm/gic/v3/gicv3.mk |
| 213 | |
| 214 | BRCM_GIC_SOURCES := ${GICV3_SOURCES} \ |
| 215 | plat/common/plat_gicv3.c \ |
| 216 | plat/brcm/common/brcm_gicv3.c |
| 217 | |
| 218 | BL31_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 Tigadoli | 58a9eca | 2019-12-18 20:05:09 +0530 | [diff] [blame] | 224 | 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 Tigadoli | 2a96dc2 | 2019-12-18 12:01:01 +0530 | [diff] [blame] | 228 | ${BRCM_GIC_SOURCES} |
| 229 | |
Sheetal Tigadoli | 58a9eca | 2019-12-18 20:05:09 +0530 | [diff] [blame] | 230 | ifneq (${NCSI_IO_DRIVE_STRENGTH_MA},) |
| 231 | BL31_SOURCES += plat/${SOC_DIR}/src/ncsi.c |
| 232 | endif |
| 233 | |
| 234 | ifeq (${USE_PAXB},yes) |
| 235 | BL31_SOURCES += plat/${SOC_DIR}/src/paxb.c |
| 236 | BL31_SOURCES += plat/${SOC_DIR}/src/sr_paxb_phy.c |
| 237 | endif |
| 238 | |
| 239 | ifeq (${USE_PAXC},yes) |
| 240 | BL31_SOURCES += plat/${SOC_DIR}/src/paxc.c |
| 241 | endif |
| 242 | |
Sheetal Tigadoli | 2a96dc2 | 2019-12-18 12:01:01 +0530 | [diff] [blame] | 243 | ifdef SCP_BL2 |
| 244 | PLAT_INCLUDES += -Iplat/brcm/common/ |
| 245 | |
Sheetal Tigadoli | ad0943e | 2019-12-18 19:44:43 +0530 | [diff] [blame] | 246 | BL2_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 Tigadoli | 2a96dc2 | 2019-12-18 12:01:01 +0530 | [diff] [blame] | 252 | BL31_SOURCES += plat/brcm/common/brcm_mhu.c \ |
| 253 | plat/brcm/common/brcm_scpi.c \ |
| 254 | plat/${SOC_DIR}/src/brcm_pm_ops.c |
| 255 | else |
| 256 | BL31_SOURCES += plat/${SOC_DIR}/src/ihost_pm.c \ |
| 257 | plat/${SOC_DIR}/src/pm.c |
| 258 | endif |
| 259 | |
Sheetal Tigadoli | ad0943e | 2019-12-18 19:44:43 +0530 | [diff] [blame] | 260 | ifeq (${ELOG_SUPPORT},1) |
| 261 | ifeq (${ELOG_STORE_MEDIA},DDR) |
| 262 | BL2_SOURCES += plat/brcm/board/common/bcm_elog_ddr.c |
| 263 | endif |
| 264 | endif |
| 265 | |
Sheetal Tigadoli | 58a9eca | 2019-12-18 20:05:09 +0530 | [diff] [blame] | 266 | ifeq (${BL31_BOOT_PRELOADED_SCP}, 1) |
| 267 | ifdef SCP_BL2 |
| 268 | SCP_CFG_DIR=$(dir ${SCP_BL2}) |
| 269 | PLAT_INCLUDES += -I${SCP_CFG_DIR} |
| 270 | endif |
| 271 | PLAT_INCLUDES += -Iplat/brcm/common/ |
| 272 | |
| 273 | # By default use OPTEE Assigned memory |
| 274 | PRELOADED_SCP_BASE ?= 0x8E000000 |
| 275 | PRELOADED_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)) |
| 279 | BL31_SOURCES += plat/${SOC_DIR}/src/scp_utils.c \ |
| 280 | plat/${SOC_DIR}/src/scp_cmd.c \ |
| 281 | drivers/brcm/scp.c |
| 282 | endif |
| 283 | |
Sheetal Tigadoli | 2a96dc2 | 2019-12-18 12:01:01 +0530 | [diff] [blame] | 284 | # Do not execute the startup code on warm reset. |
| 285 | PROGRAMMABLE_RESET_ADDRESS := 1 |
Sheetal Tigadoli | ad0943e | 2019-12-18 19:44:43 +0530 | [diff] [blame] | 286 | |
| 287 | # Nitro FW, config and Crash log uses secure DDR memory |
| 288 | # Inaddition to above, Nitro master and slave is also secure |
| 289 | ifneq ($(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)) |
| 293 | endif |