Debian Codegraph @

plat/arm/board/neoverse_rd/platform/rdn2/platform.mk

raw
1 # Copyright (c) 2020-2024, Arm Limited and Contributors. All rights reserved.
2 #
3 # SPDX-License-Identifier: BSD-3-Clause
4 #
5
6 RD_N2_VARIANTS := 0 1 2 3
7 ifneq ($(NRD_PLATFORM_VARIANT),\
8 $(filter $(NRD_PLATFORM_VARIANT),$(RD_N2_VARIANTS)))
9 $(error "NRD_PLATFORM_VARIANT for RD-N2 should be 0, 1, 2 or 3, currently \
10 set to ${NRD_PLATFORM_VARIANT}.")
11 endif
12
13 $(eval $(call CREATE_SEQ,SEQ,4))
14 ifneq ($(NRD_CHIP_COUNT),$(filter $(NRD_CHIP_COUNT),$(SEQ)))
15 $(error "Chip count for RD-N2-MC should be either $(SEQ) \
16 currently it is set to ${NRD_CHIP_COUNT}.")
17 endif
18
19 # RD-N2 platform uses GIC-700 which is based on GICv4.1
20 GIC_ENABLE_V4_EXTN := 1
21 GIC_EXT_INTID := 1
22
23 #Enable GIC Multichip Extension only for Multichip Platforms
24 ifeq (${NRD_PLATFORM_VARIANT}, 2)
25 GICV3_IMPL_GIC600_MULTICHIP := 1
26 endif
27
28 override CSS_SYSTEM_GRACEFUL_RESET := 1
29 override EL3_EXCEPTION_HANDLING := 1
30
31 include plat/arm/board/neoverse_rd/common/nrd-common.mk
32
33 RDN2_BASE = plat/arm/board/neoverse_rd/platform/rdn2
34
35 PLAT_INCLUDES += -I${NRD_COMMON_BASE}/include/nrd2/ \
36 -I${RDN2_BASE}/include/
37
38 NRD_CPU_SOURCES := lib/cpus/aarch64/neoverse_n2.S \
39 lib/cpus/aarch64/neoverse_v2.S
40
41 PLAT_BL_COMMON_SOURCES += ${NRD_COMMON_BASE}/nrd_plat2.c
42
43 BL1_SOURCES += ${NRD_CPU_SOURCES} \
44 ${RDN2_BASE}/rdn2_err.c
45
46 BL2_SOURCES += ${RDN2_BASE}/rdn2_plat.c \
47 ${RDN2_BASE}/rdn2_security.c \
48 ${RDN2_BASE}/rdn2_err.c \
49 lib/utils/mem_region.c \
50 drivers/arm/tzc/tzc400.c \
51 plat/arm/common/arm_tzc400.c \
52 plat/arm/common/arm_nor_psci_mem_protect.c
53
54 BL31_SOURCES += ${NRD_CPU_SOURCES} \
55 ${RDN2_BASE}/rdn2_plat.c \
56 ${RDN2_BASE}/rdn2_topology.c \
57 drivers/cfi/v2m/v2m_flash.c \
58 lib/utils/mem_region.c \
59 plat/arm/common/arm_nor_psci_mem_protect.c
60
61 ifeq (${TRUSTED_BOARD_BOOT}, 1)
62 BL1_SOURCES += ${RDN2_BASE}/rdn2_trusted_boot.c
63 BL2_SOURCES += ${RDN2_BASE}/rdn2_trusted_boot.c
64 endif
65
66 ifeq (${NRD_PLATFORM_VARIANT}, 2)
67 BL31_SOURCES += drivers/arm/gic/v3/gic600_multichip.c
68
69 # Enable dynamic addition of MMAP regions in BL31
70 BL31_CFLAGS += -DPLAT_XLAT_TABLES_DYNAMIC
71 endif
72
73 ifeq (${ENABLE_FEAT_RAS}-${HANDLE_EA_EL3_FIRST_NS},1-1)
74 BL31_SOURCES += ${RDN2_BASE}/rdn2_ras.c \
75 ${NRD_COMMON_BASE}/ras/nrd_ras_common.c \
76 ${NRD_COMMON_BASE}/ras/nrd_ras_sram.c \
77 ${NRD_COMMON_BASE}/ras/nrd_ras_cpu.c
78 endif
79
80 # Add the FDT_SOURCES and options for Dynamic Config
81 FDT_SOURCES += ${RDN2_BASE}/fdts/${PLAT}_fw_config.dts \
82 ${RDN2_BASE}/fdts/${PLAT}_tb_fw_config.dts
83 FW_CONFIG := ${BUILD_PLAT}/fdts/${PLAT}_fw_config.dtb
84 TB_FW_CONFIG := ${BUILD_PLAT}/fdts/${PLAT}_tb_fw_config.dtb
85
86 # Add the FW_CONFIG to FIP and specify the same to certtool
87 $(eval $(call TOOL_ADD_PAYLOAD,${FW_CONFIG},--fw-config,${FW_CONFIG}))
88 # Add the TB_FW_CONFIG to FIP and specify the same to certtool
89 $(eval $(call TOOL_ADD_PAYLOAD,${TB_FW_CONFIG},--tb-fw-config,${TB_FW_CONFIG}))
90
91 FDT_SOURCES += ${RDN2_BASE}/fdts/${PLAT}_nt_fw_config.dts
92 NT_FW_CONFIG := ${BUILD_PLAT}/fdts/${PLAT}_nt_fw_config.dtb
93
94 # Add the NT_FW_CONFIG to FIP and specify the same to certtool
95 $(eval $(call TOOL_ADD_PAYLOAD,${NT_FW_CONFIG},--nt-fw-config))
96
97 ifeq (${SPMC_AT_EL3}, 1)
98 STMM_CONFIG_DTS := ${RDN2_BASE}/fdts/${PLAT}_stmm_sel0_manifest.dts
99 FDT_SOURCES += ${STMM_CONFIG_DTS}
100 TOS_FW_CONFIG := ${BUILD_PLAT}/fdts/$(notdir $(basename ${STMM_CONFIG_DTS})).dtb
101
102 # Add the TOS_FW_CONFIG to FIP and specify the same to certtool
103 $(eval $(call TOOL_ADD_PAYLOAD,${TOS_FW_CONFIG},--tos-fw-config,${TOS_FW_CONFIG}))
104 endif
105
106 ifneq (${RESET_TO_BL31},0)
107 $(error "Using BL31 as the reset vector is not supported on ${PLAT} platform. \
108 Please set RESET_TO_BL31 to 0.")
109 endif
110
111 override CTX_INCLUDE_AARCH32_REGS := 0
112 override ENABLE_FEAT_AMU := 2
113 override ENABLE_FEAT_MTE2 := 2
114 override SPMD_SPM_AT_SEL2 := 0
115
116 # Enable the flag since RD-N2 has a system level cache
117 NEOVERSE_Nx_EXTERNAL_LLC := 1
118
119 # Enable N2 CPU errata workarounds
120 ERRATA_N2_2002655 := 1
121 ERRATA_N2_2009478 := 1
122 ERRATA_N2_2067956 := 1
123 ERRATA_N2_2025414 := 1
124 ERRATA_N2_2189731 := 1
125 ERRATA_N2_2138956 := 1
126 ERRATA_N2_2138953 := 1
127 ERRATA_N2_2242415 := 1
128 ERRATA_N2_2138958 := 1
129 ERRATA_N2_2242400 := 1
130 ERRATA_N2_2280757 := 1
131 ERRATA_N2_2326639 := 1
132 ERRATA_N2_2340933 := 1
133 ERRATA_N2_2346952 := 1
134 ERRATA_N2_2376738 := 1
135 ERRATA_N2_2388450 := 1
136 ERRATA_N2_2743014 := 1
137 ERRATA_N2_2743089 := 1
138 ERRATA_N2_2728475 := 1
139 ERRATA_N2_2779511 := 1