laurenw-arm | 03b201c | 2020-10-21 13:34:40 -0500 | [diff] [blame^] | 1 | # |
| 2 | # Copyright (c) 2021, ARM Limited and Contributors. All rights reserved. |
| 3 | # |
| 4 | # SPDX-License-Identifier: BSD-3-Clause |
| 5 | # |
| 6 | |
| 7 | # Only aarch64 ARCH supported for FVP_R |
| 8 | ARCH := aarch64 |
| 9 | |
| 10 | # Override to exclude BL2, BL2U, BL31, and BL33 for FVP_R |
| 11 | override NEED_BL2 := no |
| 12 | override NEED_BL2U := no |
| 13 | override NEED_BL31 := no |
| 14 | override NEED_BL33 := no |
| 15 | |
| 16 | # Default cluster count for FVP_R |
| 17 | FVP_R_CLUSTER_COUNT := 2 |
| 18 | |
| 19 | # Default number of CPUs per cluster on FVP_R |
| 20 | FVP_R_MAX_CPUS_PER_CLUSTER := 4 |
| 21 | |
| 22 | # Default number of threads per CPU on FVP_R |
| 23 | FVP_R_MAX_PE_PER_CPU := 1 |
| 24 | |
| 25 | # Need to revisit this for FVP_R |
| 26 | FVP_R_DT_PREFIX := fvp-base-gicv3-psci |
| 27 | |
| 28 | # Pass FVP_R_CLUSTER_COUNT to the build system. |
| 29 | $(eval $(call add_define,FVP_R_CLUSTER_COUNT)) |
| 30 | |
| 31 | # Pass FVP_R_MAX_CPUS_PER_CLUSTER to the build system. |
| 32 | $(eval $(call add_define,FVP_R_MAX_CPUS_PER_CLUSTER)) |
| 33 | |
| 34 | # Pass FVP_R_MAX_PE_PER_CPU to the build system. |
| 35 | $(eval $(call add_define,FVP_R_MAX_PE_PER_CPU)) |
| 36 | |
| 37 | # Sanity check the cluster count and if FVP_R_CLUSTER_COUNT <= 2, |
| 38 | # choose the CCI driver , else the CCN driver |
| 39 | ifeq ($(FVP_R_CLUSTER_COUNT), 0) |
| 40 | $(error "Incorrect cluster count specified for FVP_R port") |
| 41 | else ifeq ($(FVP_R_CLUSTER_COUNT),$(filter $(FVP_R_CLUSTER_COUNT),1 2)) |
| 42 | FVP_R_INTERCONNECT_DRIVER := FVP_R_CCI |
| 43 | else |
| 44 | FVP_R_INTERCONNECT_DRIVER := FVP_R_CCN |
| 45 | endif |
| 46 | |
| 47 | $(eval $(call add_define,FVP_R_INTERCONNECT_DRIVER)) |
| 48 | |
| 49 | ifeq (${FVP_R_INTERCONNECT_DRIVER}, FVP_R_CCI) |
| 50 | FVP_R_INTERCONNECT_SOURCES := drivers/arm/cci/cci.c |
| 51 | else ifeq (${FVP_R_INTERCONNECT_DRIVER}, FVP_R_CCN) |
| 52 | FVP_R_INTERCONNECT_SOURCES := drivers/arm/ccn/ccn.c \ |
| 53 | plat/arm/common/arm_ccn.c |
| 54 | else |
| 55 | $(error "Incorrect CCN driver chosen on FVP_R port") |
| 56 | endif |
| 57 | |
| 58 | PLAT_INCLUDES := -Iplat/arm/board/fvp_r/include |
| 59 | |
| 60 | PLAT_BL_COMMON_SOURCES := plat/arm/board/fvp_r/fvp_r_common.c |
| 61 | |
| 62 | FVP_R_CPU_LIBS := lib/cpus/${ARCH}/aem_generic.S |
| 63 | |
| 64 | # select a different set of CPU files, depending on whether we compile for |
| 65 | # hardware assisted coherency cores or not |
| 66 | ifeq (${HW_ASSISTED_COHERENCY}, 0) |
| 67 | # Cores used without DSU |
| 68 | # FVP_R_CPU_LIBS += lib/cpus/aarch64/fvp_r.S |
| 69 | else |
| 70 | # Cores used with DSU only |
| 71 | # FVP_R_CPU_LIBS += lib/cpus/aarch64/fvp_r.S |
| 72 | endif |
| 73 | |
| 74 | BL1_SOURCES += drivers/arm/sp805/sp805.c \ |
| 75 | drivers/delay_timer/delay_timer.c \ |
| 76 | drivers/io/io_semihosting.c \ |
| 77 | lib/semihosting/semihosting.c \ |
| 78 | lib/semihosting/${ARCH}/semihosting_call.S \ |
| 79 | plat/arm/board/fvp_r/fvp_r_helpers.S \ |
| 80 | plat/arm/board/fvp_r/fvp_r_bl1_setup.c \ |
| 81 | plat/arm/board/fvp_r/fvp_r_err.c \ |
| 82 | plat/arm/board/fvp_r/fvp_r_io_storage.c \ |
| 83 | ${FVP_R_CPU_LIBS} \ |
| 84 | ${FVP_R_INTERCONNECT_SOURCES} |
| 85 | |
| 86 | ifeq (${USE_SP804_TIMER},1) |
| 87 | BL1_SOURCES += drivers/arm/sp804/sp804_delay_timer.c |
| 88 | else |
| 89 | BL1_SOURCES += drivers/delay_timer/generic_delay_timer.c |
| 90 | endif |
| 91 | |
| 92 | # Enable Activity Monitor Unit extensions by default |
| 93 | ENABLE_AMU := 1 |
| 94 | |
| 95 | ifneq (${ENABLE_STACK_PROTECTOR},0) |
| 96 | PLAT_BL_COMMON_SOURCES += plat/arm/board/fvp_r/fvp_r_stack_protector.c |
| 97 | endif |
| 98 | |
| 99 | ifeq (${ARCH},aarch32) |
| 100 | NEED_BL32 := yes |
| 101 | endif |
| 102 | |
| 103 | ifneq (${BL2_AT_EL3}, 0) |
| 104 | override BL1_SOURCES = |
| 105 | endif |
| 106 | |
| 107 | # Add the FDT_SOURCES and options for Dynamic Config (only for Unix env) |
| 108 | ifdef UNIX_MK |
| 109 | FVP_R_HW_CONFIG_DTS := fdts/${FVP_R_DT_PREFIX}.dts |
| 110 | FDT_SOURCES += $(addprefix plat/arm/board/fvp_r/fdts/, \ |
| 111 | ${PLAT}_fw_config.dts \ |
| 112 | ${PLAT}_nt_fw_config.dts \ |
| 113 | ) |
| 114 | |
| 115 | FVP_R_FW_CONFIG := ${BUILD_PLAT}/fdts/${PLAT}_fw_config.dtb |
| 116 | FVP_R_NT_FW_CONFIG := ${BUILD_PLAT}/fdts/${PLAT}_nt_fw_config.dtb |
| 117 | |
| 118 | # Add the FW_CONFIG to FIP and specify the same to certtool |
| 119 | $(eval $(call TOOL_ADD_PAYLOAD,${FVP_R_FW_CONFIG},--fw-config,${FVP_R_FW_CONFIG})) |
| 120 | # Add the NT_FW_CONFIG to FIP and specify the same to certtool |
| 121 | $(eval $(call TOOL_ADD_PAYLOAD,${FVP_R_NT_FW_CONFIG},--nt-fw-config,${FVP_R_NT_FW_CONFIG})) |
| 122 | |
| 123 | FDT_SOURCES += ${FVP_R_HW_CONFIG_DTS} |
| 124 | $(eval FVP_R_HW_CONFIG := ${BUILD_PLAT}/$(patsubst %.dts,%.dtb,$(FVP_R_HW_CONFIG_DTS))) |
| 125 | |
| 126 | # Add the HW_CONFIG to FIP and specify the same to certtool |
| 127 | $(eval $(call TOOL_ADD_PAYLOAD,${FVP_R_HW_CONFIG},--hw-config,${FVP_R_HW_CONFIG})) |
| 128 | endif |
| 129 | |
| 130 | include plat/arm/board/common/board_common.mk |
| 131 | include plat/arm/common/arm_common.mk |