Marcin Juszkiewicz | 7754e82 | 2023-07-24 20:56:29 +0200 | [diff] [blame] | 1 | # |
Jean-Philippe Brucker | 6125ee4 | 2023-09-06 16:18:02 +0100 | [diff] [blame] | 2 | # Copyright (c) 2023-2024, Linaro Limited and Contributors. All rights reserved. |
Marcin Juszkiewicz | 7754e82 | 2023-07-24 20:56:29 +0200 | [diff] [blame] | 3 | # |
| 4 | # SPDX-License-Identifier: BSD-3-Clause |
| 5 | # |
| 6 | |
| 7 | include lib/libfdt/libfdt.mk |
| 8 | include common/fdt_wrappers.mk |
| 9 | |
Marcin Juszkiewicz | a70ef5e | 2023-07-24 21:08:16 +0200 | [diff] [blame] | 10 | PLAT_INCLUDES := -Iinclude/plat/arm/common/ \ |
| 11 | -I${PLAT_QEMU_COMMON_PATH}/include \ |
| 12 | -I${PLAT_QEMU_PATH}/include \ |
| 13 | -Iinclude/common/tbbr |
| 14 | |
| 15 | ifeq (${ARCH},aarch32) |
| 16 | QEMU_CPU_LIBS := lib/cpus/${ARCH}/cortex_a15.S |
| 17 | else |
| 18 | QEMU_CPU_LIBS := lib/cpus/aarch64/aem_generic.S \ |
| 19 | lib/cpus/aarch64/cortex_a53.S \ |
developer | 618fd51 | 2023-09-13 19:50:24 +0800 | [diff] [blame] | 20 | lib/cpus/aarch64/cortex_a55.S \ |
Marcin Juszkiewicz | a70ef5e | 2023-07-24 21:08:16 +0200 | [diff] [blame] | 21 | lib/cpus/aarch64/cortex_a57.S \ |
| 22 | lib/cpus/aarch64/cortex_a72.S \ |
| 23 | lib/cpus/aarch64/cortex_a76.S \ |
Marcin Juszkiewicz | 4b5a2c2 | 2023-09-12 13:08:13 +0200 | [diff] [blame] | 24 | lib/cpus/aarch64/cortex_a710.S \ |
Marcin Juszkiewicz | a70ef5e | 2023-07-24 21:08:16 +0200 | [diff] [blame] | 25 | lib/cpus/aarch64/neoverse_n_common.S \ |
| 26 | lib/cpus/aarch64/neoverse_n1.S \ |
| 27 | lib/cpus/aarch64/neoverse_v1.S \ |
Marcin Juszkiewicz | c36f42b | 2023-09-15 22:44:04 +0200 | [diff] [blame] | 28 | lib/cpus/aarch64/neoverse_n2.S \ |
Marcin Juszkiewicz | a70ef5e | 2023-07-24 21:08:16 +0200 | [diff] [blame] | 29 | lib/cpus/aarch64/qemu_max.S |
| 30 | |
| 31 | PLAT_INCLUDES += -Iinclude/plat/arm/common/${ARCH} |
| 32 | endif |
Marcin Juszkiewicz | 424e3a8 | 2023-07-24 21:18:51 +0200 | [diff] [blame] | 33 | |
| 34 | PLAT_BL_COMMON_SOURCES := ${PLAT_QEMU_COMMON_PATH}/qemu_common.c \ |
| 35 | ${PLAT_QEMU_COMMON_PATH}/qemu_console.c \ |
| 36 | drivers/arm/pl011/${ARCH}/pl011_console.S |
| 37 | |
| 38 | include lib/xlat_tables_v2/xlat_tables.mk |
| 39 | PLAT_BL_COMMON_SOURCES += ${XLAT_TABLES_LIB_SRCS} |
| 40 | |
| 41 | ifneq ($(ENABLE_STACK_PROTECTOR), 0) |
| 42 | PLAT_BL_COMMON_SOURCES += ${PLAT_QEMU_COMMON_PATH}/qemu_stack_protector.c |
| 43 | endif |
| 44 | |
| 45 | BL1_SOURCES += drivers/io/io_semihosting.c \ |
| 46 | drivers/io/io_storage.c \ |
| 47 | drivers/io/io_fip.c \ |
| 48 | drivers/io/io_memmap.c \ |
| 49 | lib/semihosting/semihosting.c \ |
| 50 | lib/semihosting/${ARCH}/semihosting_call.S \ |
| 51 | ${PLAT_QEMU_COMMON_PATH}/qemu_io_storage.c \ |
| 52 | ${PLAT_QEMU_COMMON_PATH}/${ARCH}/plat_helpers.S \ |
| 53 | ${PLAT_QEMU_COMMON_PATH}/qemu_bl1_setup.c \ |
| 54 | ${QEMU_CPU_LIBS} |
| 55 | |
| 56 | BL2_SOURCES += drivers/io/io_semihosting.c \ |
| 57 | drivers/io/io_storage.c \ |
| 58 | drivers/io/io_fip.c \ |
| 59 | drivers/io/io_memmap.c \ |
| 60 | lib/semihosting/semihosting.c \ |
| 61 | lib/semihosting/${ARCH}/semihosting_call.S \ |
| 62 | ${PLAT_QEMU_COMMON_PATH}/qemu_io_storage.c \ |
| 63 | ${PLAT_QEMU_COMMON_PATH}/${ARCH}/plat_helpers.S \ |
| 64 | ${PLAT_QEMU_COMMON_PATH}/qemu_bl2_setup.c \ |
| 65 | ${PLAT_QEMU_COMMON_PATH}/qemu_bl2_mem_params_desc.c \ |
| 66 | ${PLAT_QEMU_COMMON_PATH}/qemu_image_load.c \ |
| 67 | common/desc_image_load.c \ |
| 68 | common/fdt_fixup.c |
Marcin Juszkiewicz | 61c9903 | 2023-07-24 21:37:00 +0200 | [diff] [blame] | 69 | |
| 70 | BL31_SOURCES += ${QEMU_CPU_LIBS} \ |
| 71 | lib/semihosting/semihosting.c \ |
| 72 | lib/semihosting/${ARCH}/semihosting_call.S \ |
| 73 | plat/common/plat_psci_common.c \ |
| 74 | ${PLAT_QEMU_COMMON_PATH}/aarch64/plat_helpers.S \ |
| 75 | ${PLAT_QEMU_COMMON_PATH}/qemu_bl31_setup.c \ |
| 76 | common/fdt_fixup.c \ |
| 77 | ${QEMU_GIC_SOURCES} |
| 78 | |
Marcin Juszkiewicz | 8acc2da | 2023-07-24 21:44:17 +0200 | [diff] [blame] | 79 | # CPU flag enablement |
Marcin Juszkiewicz | 5aece71 | 2023-07-24 22:07:49 +0200 | [diff] [blame] | 80 | ifeq (${ARCH},aarch64) |
Marcin Juszkiewicz | 8acc2da | 2023-07-24 21:44:17 +0200 | [diff] [blame] | 81 | |
Marcin Juszkiewicz | c4dae6e | 2023-11-13 16:18:49 +0100 | [diff] [blame] | 82 | # Cpu core architecture level: |
| 83 | # v8.0: a53, a57, a72 |
| 84 | # v8.2: a55, a76, n1 |
| 85 | # v8.4: v1 |
| 86 | # v9.0: a710, n2 |
| 87 | # |
| 88 | # |
| 89 | # We go v8.0 by default and will enable all features we want |
| 90 | |
| 91 | ARM_ARCH_MAJOR := 8 |
| 92 | ARM_ARCH_MINOR := 0 |
| 93 | |
| 94 | # 8.0 |
| 95 | ENABLE_FEAT_CSV2_2 := 2 |
| 96 | |
| 97 | # 8.1 |
| 98 | ENABLE_FEAT_PAN := 2 |
| 99 | ENABLE_FEAT_VHE := 2 |
| 100 | |
| 101 | # 8.2 |
| 102 | # TF-A currently does not permit dynamic detection of FEAT_RAS |
| 103 | # so this is the only safe setting |
| 104 | ENABLE_FEAT_RAS := 0 |
| 105 | |
| 106 | # 8.4 |
| 107 | ENABLE_FEAT_SEL2 := 2 |
| 108 | ENABLE_FEAT_DIT := 2 |
| 109 | |
| 110 | # 8.5 |
| 111 | ENABLE_FEAT_RNG := 2 |
Marcin Juszkiewicz | 69ae7da | 2024-02-08 12:07:45 +0100 | [diff] [blame] | 112 | # TF-A currently does not do dynamic detection of FEAT_SB. |
| 113 | # Compiler puts SB instruction when it is enabled. |
| 114 | ENABLE_FEAT_SB := 0 |
Marcin Juszkiewicz | c4dae6e | 2023-11-13 16:18:49 +0100 | [diff] [blame] | 115 | |
| 116 | # 8.6 |
| 117 | ENABLE_FEAT_FGT := 2 |
| 118 | |
| 119 | # 8.7 |
| 120 | ENABLE_FEAT_HCX := 2 |
| 121 | |
Marcin Juszkiewicz | 5aece71 | 2023-07-24 22:07:49 +0200 | [diff] [blame] | 122 | # SPM_MM is not compatible with ENABLE_SVE_FOR_NS (build breaks) |
| 123 | ifeq (${SPM_MM},1) |
| 124 | ENABLE_SVE_FOR_NS := 0 |
| 125 | ENABLE_SME_FOR_NS := 0 |
| 126 | else |
Marcin Juszkiewicz | 8acc2da | 2023-07-24 21:44:17 +0200 | [diff] [blame] | 127 | ENABLE_SVE_FOR_NS := 2 |
| 128 | ENABLE_SME_FOR_NS := 2 |
| 129 | endif |
| 130 | |
Jean-Philippe Brucker | 6125ee4 | 2023-09-06 16:18:02 +0100 | [diff] [blame] | 131 | ifeq (${ENABLE_RME},1) |
| 132 | BL31_SOURCES += plat/qemu/common/qemu_plat_attest_token.c \ |
| 133 | plat/qemu/common/qemu_realm_attest_key.c |
| 134 | endif |
| 135 | |
Marcin Juszkiewicz | 676443b | 2023-07-24 21:54:34 +0200 | [diff] [blame] | 136 | # Treating this as a memory-constrained port for now |
| 137 | USE_COHERENT_MEM := 0 |
| 138 | |
| 139 | # This can be overridden depending on CPU(s) used in the QEMU image |
| 140 | HW_ASSISTED_COHERENCY := 1 |
| 141 | |
| 142 | CTX_INCLUDE_AARCH32_REGS := 0 |
| 143 | ifeq (${CTX_INCLUDE_AARCH32_REGS}, 1) |
| 144 | $(error "This is an AArch64-only port; CTX_INCLUDE_AARCH32_REGS must be disabled") |
| 145 | endif |
Marcin Juszkiewicz | 1da28d1 | 2023-08-21 21:17:12 +0200 | [diff] [blame] | 146 | |
| 147 | # Pointer Authentication sources |
| 148 | ifeq (${ENABLE_PAUTH}, 1) |
| 149 | PLAT_BL_COMMON_SOURCES += plat/arm/common/aarch64/arm_pauth.c |
| 150 | CTX_INCLUDE_PAUTH_REGS := 1 |
| 151 | endif |
| 152 | |
Marcin Juszkiewicz | 676443b | 2023-07-24 21:54:34 +0200 | [diff] [blame] | 153 | endif |