Pranav Madhu | 40ebb32 | 2021-01-27 16:17:32 +0530 | [diff] [blame] | 1 | # Copyright (c) 2020-2021, 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 | |
Aditya Angadi | d61740b | 2020-11-19 18:05:33 +0530 | [diff] [blame] | 27 | include plat/arm/css/sgi/sgi-common.mk |
| 28 | |
| 29 | RDN2_BASE = plat/arm/board/rdn2 |
| 30 | |
| 31 | PLAT_INCLUDES += -I${RDN2_BASE}/include/ |
| 32 | |
Tony K Nadackal | e23ca81 | 2021-08-19 14:44:11 +0100 | [diff] [blame] | 33 | SGI_CPU_SOURCES := lib/cpus/aarch64/neoverse_n2.S \ |
| 34 | lib/cpus/aarch64/neoverse_demeter.S |
Aditya Angadi | d61740b | 2020-11-19 18:05:33 +0530 | [diff] [blame] | 35 | |
| 36 | PLAT_BL_COMMON_SOURCES += ${CSS_ENT_BASE}/sgi_plat_v2.c |
| 37 | |
| 38 | BL1_SOURCES += ${SGI_CPU_SOURCES} \ |
| 39 | ${RDN2_BASE}/rdn2_err.c |
| 40 | |
| 41 | BL2_SOURCES += ${RDN2_BASE}/rdn2_plat.c \ |
| 42 | ${RDN2_BASE}/rdn2_security.c \ |
| 43 | ${RDN2_BASE}/rdn2_err.c \ |
| 44 | lib/utils/mem_region.c \ |
| 45 | drivers/arm/tzc/tzc400.c \ |
| 46 | plat/arm/common/arm_tzc400.c \ |
| 47 | plat/arm/common/arm_nor_psci_mem_protect.c |
| 48 | |
| 49 | BL31_SOURCES += ${SGI_CPU_SOURCES} \ |
| 50 | ${RDN2_BASE}/rdn2_plat.c \ |
| 51 | ${RDN2_BASE}/rdn2_topology.c \ |
| 52 | drivers/cfi/v2m/v2m_flash.c \ |
| 53 | lib/utils/mem_region.c \ |
| 54 | plat/arm/common/arm_nor_psci_mem_protect.c |
| 55 | |
| 56 | ifeq (${TRUSTED_BOARD_BOOT}, 1) |
| 57 | BL1_SOURCES += ${RDN2_BASE}/rdn2_trusted_boot.c |
| 58 | BL2_SOURCES += ${RDN2_BASE}/rdn2_trusted_boot.c |
| 59 | endif |
| 60 | |
Aditya Angadi | ccae8a1 | 2021-08-09 09:38:58 +0530 | [diff] [blame] | 61 | ifeq (${CSS_SGI_PLATFORM_VARIANT}, 2) |
| 62 | BL31_SOURCES += drivers/arm/gic/v3/gic600_multichip.c |
| 63 | |
| 64 | # Enable dynamic addition of MMAP regions in BL31 |
| 65 | BL31_CFLAGS += -DPLAT_XLAT_TABLES_DYNAMIC |
| 66 | endif |
| 67 | |
Aditya Angadi | d61740b | 2020-11-19 18:05:33 +0530 | [diff] [blame] | 68 | # Add the FDT_SOURCES and options for Dynamic Config |
| 69 | FDT_SOURCES += ${RDN2_BASE}/fdts/${PLAT}_fw_config.dts \ |
| 70 | ${RDN2_BASE}/fdts/${PLAT}_tb_fw_config.dts |
| 71 | FW_CONFIG := ${BUILD_PLAT}/fdts/${PLAT}_fw_config.dtb |
| 72 | TB_FW_CONFIG := ${BUILD_PLAT}/fdts/${PLAT}_tb_fw_config.dtb |
| 73 | |
| 74 | # Add the FW_CONFIG to FIP and specify the same to certtool |
| 75 | $(eval $(call TOOL_ADD_PAYLOAD,${FW_CONFIG},--fw-config,${FW_CONFIG})) |
| 76 | # Add the TB_FW_CONFIG to FIP and specify the same to certtool |
| 77 | $(eval $(call TOOL_ADD_PAYLOAD,${TB_FW_CONFIG},--tb-fw-config,${TB_FW_CONFIG})) |
| 78 | |
| 79 | FDT_SOURCES += ${RDN2_BASE}/fdts/${PLAT}_nt_fw_config.dts |
| 80 | NT_FW_CONFIG := ${BUILD_PLAT}/fdts/${PLAT}_nt_fw_config.dtb |
| 81 | |
| 82 | # Add the NT_FW_CONFIG to FIP and specify the same to certtool |
| 83 | $(eval $(call TOOL_ADD_PAYLOAD,${NT_FW_CONFIG},--nt-fw-config)) |
| 84 | |
| 85 | override CTX_INCLUDE_AARCH32_REGS := 0 |
Pranav Madhu | 40ebb32 | 2021-01-27 16:17:32 +0530 | [diff] [blame] | 86 | override ENABLE_AMU := 1 |