Pranav Madhu | 078dc52 | 2022-07-27 14:01:24 +0530 | [diff] [blame] | 1 | # Copyright (c) 2020-2022, Arm Limited and Contributors. All rights reserved. |
Aditya Angadi | d61740b | 2020-11-19 18:05:33 +0530 | [diff] [blame] | 2 | # |
| 3 | # SPDX-License-Identifier: BSD-3-Clause |
| 4 | # |
| 5 | |
Aditya Angadi | ccae8a1 | 2021-08-09 09:38:58 +0530 | [diff] [blame] | 6 | RD_N2_VARIANTS := 0 1 2 |
| 7 | ifneq ($(CSS_SGI_PLATFORM_VARIANT),\ |
| 8 | $(filter $(CSS_SGI_PLATFORM_VARIANT),$(RD_N2_VARIANTS))) |
| 9 | $(error "CSS_SGI_PLATFORM_VARIANT for RD-N2 should be 0, 1 or 2, currently set \ |
| 10 | to ${CSS_SGI_PLATFORM_VARIANT}.") |
| 11 | endif |
| 12 | |
| 13 | $(eval $(call CREATE_SEQ,SEQ,4)) |
| 14 | ifneq ($(CSS_SGI_CHIP_COUNT),$(filter $(CSS_SGI_CHIP_COUNT),$(SEQ))) |
| 15 | $(error "Chip count for RD-N2-MC should be either $(SEQ) \ |
| 16 | currently it is set to ${CSS_SGI_CHIP_COUNT}.") |
| 17 | endif |
| 18 | |
Andre Przywara | b6c24ce | 2021-07-20 19:20:07 +0100 | [diff] [blame] | 19 | # RD-N2 platform uses GIC-700 which is based on GICv4.1 |
Aditya Angadi | d61740b | 2020-11-19 18:05:33 +0530 | [diff] [blame] | 20 | GIC_ENABLE_V4_EXTN := 1 |
| 21 | |
Aditya Angadi | ccae8a1 | 2021-08-09 09:38:58 +0530 | [diff] [blame] | 22 | #Enable GIC Multichip Extension only for Multichip Platforms |
| 23 | ifeq (${CSS_SGI_PLATFORM_VARIANT}, 2) |
| 24 | GICV3_IMPL_GIC600_MULTICHIP := 1 |
| 25 | endif |
| 26 | |
Pranav Madhu | 078dc52 | 2022-07-27 14:01:24 +0530 | [diff] [blame] | 27 | override CSS_SYSTEM_GRACEFUL_RESET := 1 |
| 28 | override EL3_EXCEPTION_HANDLING := 1 |
| 29 | |
Aditya Angadi | d61740b | 2020-11-19 18:05:33 +0530 | [diff] [blame] | 30 | include plat/arm/css/sgi/sgi-common.mk |
| 31 | |
| 32 | RDN2_BASE = plat/arm/board/rdn2 |
| 33 | |
| 34 | PLAT_INCLUDES += -I${RDN2_BASE}/include/ |
| 35 | |
Tony K Nadackal | e23ca81 | 2021-08-19 14:44:11 +0100 | [diff] [blame] | 36 | SGI_CPU_SOURCES := lib/cpus/aarch64/neoverse_n2.S \ |
Joel Goddard | a1c50ab | 2022-09-21 21:52:28 +0530 | [diff] [blame] | 37 | lib/cpus/aarch64/neoverse_v2.S |
Aditya Angadi | d61740b | 2020-11-19 18:05:33 +0530 | [diff] [blame] | 38 | |
| 39 | PLAT_BL_COMMON_SOURCES += ${CSS_ENT_BASE}/sgi_plat_v2.c |
| 40 | |
| 41 | BL1_SOURCES += ${SGI_CPU_SOURCES} \ |
| 42 | ${RDN2_BASE}/rdn2_err.c |
| 43 | |
| 44 | BL2_SOURCES += ${RDN2_BASE}/rdn2_plat.c \ |
| 45 | ${RDN2_BASE}/rdn2_security.c \ |
| 46 | ${RDN2_BASE}/rdn2_err.c \ |
| 47 | lib/utils/mem_region.c \ |
| 48 | drivers/arm/tzc/tzc400.c \ |
| 49 | plat/arm/common/arm_tzc400.c \ |
| 50 | plat/arm/common/arm_nor_psci_mem_protect.c |
| 51 | |
| 52 | BL31_SOURCES += ${SGI_CPU_SOURCES} \ |
| 53 | ${RDN2_BASE}/rdn2_plat.c \ |
| 54 | ${RDN2_BASE}/rdn2_topology.c \ |
| 55 | drivers/cfi/v2m/v2m_flash.c \ |
| 56 | lib/utils/mem_region.c \ |
| 57 | plat/arm/common/arm_nor_psci_mem_protect.c |
| 58 | |
| 59 | ifeq (${TRUSTED_BOARD_BOOT}, 1) |
| 60 | BL1_SOURCES += ${RDN2_BASE}/rdn2_trusted_boot.c |
| 61 | BL2_SOURCES += ${RDN2_BASE}/rdn2_trusted_boot.c |
| 62 | endif |
| 63 | |
Aditya Angadi | ccae8a1 | 2021-08-09 09:38:58 +0530 | [diff] [blame] | 64 | ifeq (${CSS_SGI_PLATFORM_VARIANT}, 2) |
| 65 | BL31_SOURCES += drivers/arm/gic/v3/gic600_multichip.c |
| 66 | |
| 67 | # Enable dynamic addition of MMAP regions in BL31 |
| 68 | BL31_CFLAGS += -DPLAT_XLAT_TABLES_DYNAMIC |
| 69 | endif |
| 70 | |
Aditya Angadi | d61740b | 2020-11-19 18:05:33 +0530 | [diff] [blame] | 71 | # Add the FDT_SOURCES and options for Dynamic Config |
| 72 | FDT_SOURCES += ${RDN2_BASE}/fdts/${PLAT}_fw_config.dts \ |
| 73 | ${RDN2_BASE}/fdts/${PLAT}_tb_fw_config.dts |
| 74 | FW_CONFIG := ${BUILD_PLAT}/fdts/${PLAT}_fw_config.dtb |
| 75 | TB_FW_CONFIG := ${BUILD_PLAT}/fdts/${PLAT}_tb_fw_config.dtb |
| 76 | |
| 77 | # Add the FW_CONFIG to FIP and specify the same to certtool |
| 78 | $(eval $(call TOOL_ADD_PAYLOAD,${FW_CONFIG},--fw-config,${FW_CONFIG})) |
| 79 | # Add the TB_FW_CONFIG to FIP and specify the same to certtool |
| 80 | $(eval $(call TOOL_ADD_PAYLOAD,${TB_FW_CONFIG},--tb-fw-config,${TB_FW_CONFIG})) |
| 81 | |
| 82 | FDT_SOURCES += ${RDN2_BASE}/fdts/${PLAT}_nt_fw_config.dts |
| 83 | NT_FW_CONFIG := ${BUILD_PLAT}/fdts/${PLAT}_nt_fw_config.dtb |
| 84 | |
| 85 | # Add the NT_FW_CONFIG to FIP and specify the same to certtool |
| 86 | $(eval $(call TOOL_ADD_PAYLOAD,${NT_FW_CONFIG},--nt-fw-config)) |
| 87 | |
| 88 | override CTX_INCLUDE_AARCH32_REGS := 0 |
Pranav Madhu | 40ebb32 | 2021-01-27 16:17:32 +0530 | [diff] [blame] | 89 | override ENABLE_AMU := 1 |