Radoslaw Biernacki | 1201aba | 2018-05-17 22:52:49 +0200 | [diff] [blame] | 1 | # |
Chris Kay | e927215 | 2021-09-28 15:52:14 +0100 | [diff] [blame] | 2 | # Copyright (c) 2019-2021, Linaro Limited and Contributors. All rights reserved. |
Radoslaw Biernacki | 1201aba | 2018-05-17 22:52:49 +0200 | [diff] [blame] | 3 | # |
| 4 | # SPDX-License-Identifier: BSD-3-Clause |
| 5 | # |
| 6 | |
Chris Kay | e927215 | 2021-09-28 15:52:14 +0100 | [diff] [blame] | 7 | include common/fdt_wrappers.mk |
| 8 | |
Radoslaw Biernacki | 1201aba | 2018-05-17 22:52:49 +0200 | [diff] [blame] | 9 | CRASH_REPORTING := 1 |
| 10 | |
| 11 | include lib/libfdt/libfdt.mk |
| 12 | |
Masahisa Kojima | 099064b | 2020-06-11 21:46:44 +0900 | [diff] [blame] | 13 | ifeq (${SPM_MM},1) |
| 14 | NEED_BL32 := yes |
| 15 | EL3_EXCEPTION_HANDLING := 1 |
| 16 | GICV2_G0_FOR_EL3 := 1 |
| 17 | endif |
| 18 | |
Radoslaw Biernacki | 1201aba | 2018-05-17 22:52:49 +0200 | [diff] [blame] | 19 | # Enable new version of image loading on QEMU platforms |
| 20 | LOAD_IMAGE_V2 := 1 |
| 21 | |
| 22 | ifeq ($(NEED_BL32),yes) |
| 23 | $(eval $(call add_define,QEMU_LOAD_BL32)) |
| 24 | endif |
| 25 | |
| 26 | PLAT_QEMU_PATH := plat/qemu/qemu_sbsa |
| 27 | PLAT_QEMU_COMMON_PATH := plat/qemu/common |
| 28 | PLAT_INCLUDES := -Iinclude/plat/arm/common/ \ |
| 29 | -I${PLAT_QEMU_COMMON_PATH}/include \ |
| 30 | -I${PLAT_QEMU_PATH}/include \ |
| 31 | -Iinclude/common/tbbr |
| 32 | |
| 33 | PLAT_INCLUDES += -Iinclude/plat/arm/common/${ARCH} |
| 34 | |
| 35 | PLAT_BL_COMMON_SOURCES := ${PLAT_QEMU_COMMON_PATH}/qemu_common.c \ |
| 36 | ${PLAT_QEMU_COMMON_PATH}/qemu_console.c \ |
| 37 | drivers/arm/pl011/${ARCH}/pl011_console.S |
| 38 | |
| 39 | include lib/xlat_tables_v2/xlat_tables.mk |
| 40 | PLAT_BL_COMMON_SOURCES += ${XLAT_TABLES_LIB_SRCS} |
| 41 | |
| 42 | BL1_SOURCES += drivers/io/io_semihosting.c \ |
| 43 | drivers/io/io_storage.c \ |
| 44 | drivers/io/io_fip.c \ |
| 45 | drivers/io/io_memmap.c \ |
| 46 | lib/semihosting/semihosting.c \ |
| 47 | lib/semihosting/${ARCH}/semihosting_call.S \ |
| 48 | ${PLAT_QEMU_COMMON_PATH}/qemu_io_storage.c \ |
| 49 | ${PLAT_QEMU_COMMON_PATH}/${ARCH}/plat_helpers.S \ |
| 50 | ${PLAT_QEMU_COMMON_PATH}/qemu_bl1_setup.c |
| 51 | |
Tanmay Jagdale | 8abcf34 | 2020-11-20 16:36:50 +0530 | [diff] [blame] | 52 | BL1_SOURCES += lib/cpus/aarch64/cortex_a57.S \ |
Leif Lindholm | f6ac432 | 2021-03-10 13:43:25 +0000 | [diff] [blame] | 53 | lib/cpus/aarch64/cortex_a72.S \ |
| 54 | lib/cpus/aarch64/qemu_max.S \ |
Radoslaw Biernacki | 1201aba | 2018-05-17 22:52:49 +0200 | [diff] [blame] | 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 | common/fdt_fixup.c \ |
| 66 | $(LIBFDT_SRCS) |
| 67 | ifeq (${LOAD_IMAGE_V2},1) |
| 68 | BL2_SOURCES += ${PLAT_QEMU_COMMON_PATH}/qemu_bl2_mem_params_desc.c \ |
| 69 | ${PLAT_QEMU_COMMON_PATH}/qemu_image_load.c \ |
| 70 | common/desc_image_load.c |
| 71 | endif |
| 72 | |
Alexei Fedorov | 84f1b5d | 2020-03-23 18:45:17 +0000 | [diff] [blame] | 73 | # Include GICv3 driver files |
| 74 | include drivers/arm/gic/v3/gicv3.mk |
| 75 | |
| 76 | QEMU_GIC_SOURCES := ${GICV3_SOURCES} \ |
Radoslaw Biernacki | 1201aba | 2018-05-17 22:52:49 +0200 | [diff] [blame] | 77 | plat/common/plat_gicv3.c \ |
| 78 | ${PLAT_QEMU_COMMON_PATH}/qemu_gicv3.c |
| 79 | |
Tomas Pilar | fa9f4fe | 2020-08-11 15:06:16 +0100 | [diff] [blame] | 80 | BL31_SOURCES += lib/cpus/aarch64/cortex_a57.S \ |
Tanmay Jagdale | 8abcf34 | 2020-11-20 16:36:50 +0530 | [diff] [blame] | 81 | lib/cpus/aarch64/cortex_a72.S \ |
Leif Lindholm | f6ac432 | 2021-03-10 13:43:25 +0000 | [diff] [blame] | 82 | lib/cpus/aarch64/qemu_max.S \ |
Andrew Walbran | f3a6839 | 2020-01-15 14:18:04 +0000 | [diff] [blame] | 83 | lib/semihosting/semihosting.c \ |
| 84 | lib/semihosting/${ARCH}/semihosting_call.S \ |
Radoslaw Biernacki | 1201aba | 2018-05-17 22:52:49 +0200 | [diff] [blame] | 85 | plat/common/plat_psci_common.c \ |
Graeme Gregory | 1a73223 | 2020-08-28 18:03:35 +0100 | [diff] [blame] | 86 | ${PLAT_QEMU_PATH}/sbsa_pm.c \ |
Graeme Gregory | 10e9223 | 2020-08-28 16:37:02 +0100 | [diff] [blame] | 87 | ${PLAT_QEMU_PATH}/sbsa_topology.c \ |
Radoslaw Biernacki | 1201aba | 2018-05-17 22:52:49 +0200 | [diff] [blame] | 88 | ${PLAT_QEMU_COMMON_PATH}/aarch64/plat_helpers.S \ |
| 89 | ${PLAT_QEMU_COMMON_PATH}/qemu_bl31_setup.c \ |
Masahisa Kojima | 7e917dc | 2020-09-23 16:52:59 +0900 | [diff] [blame] | 90 | common/fdt_fixup.c \ |
Radoslaw Biernacki | 1201aba | 2018-05-17 22:52:49 +0200 | [diff] [blame] | 91 | ${QEMU_GIC_SOURCES} |
Chris Kay | e927215 | 2021-09-28 15:52:14 +0100 | [diff] [blame] | 92 | |
| 93 | BL31_SOURCES += ${FDT_WRAPPERS_SOURCES} |
| 94 | |
Masahisa Kojima | 099064b | 2020-06-11 21:46:44 +0900 | [diff] [blame] | 95 | ifeq (${SPM_MM},1) |
| 96 | BL31_SOURCES += ${PLAT_QEMU_COMMON_PATH}/qemu_spm.c |
| 97 | endif |
Radoslaw Biernacki | 1201aba | 2018-05-17 22:52:49 +0200 | [diff] [blame] | 98 | |
| 99 | SEPARATE_CODE_AND_RODATA := 1 |
| 100 | ENABLE_STACK_PROTECTOR := 0 |
| 101 | ifneq ($(ENABLE_STACK_PROTECTOR), 0) |
| 102 | PLAT_BL_COMMON_SOURCES += ${PLAT_QEMU_COMMON_PATH}/qemu_stack_protector.c |
| 103 | endif |
| 104 | |
| 105 | MULTI_CONSOLE_API := 1 |
| 106 | |
| 107 | # Disable the PSCI platform compatibility layer |
| 108 | ENABLE_PLAT_COMPAT := 0 |
| 109 | |
| 110 | # Use known base for UEFI if not given from command line |
| 111 | # By default BL33 is at FLASH1 base |
| 112 | PRELOADED_BL33_BASE ?= 0x10000000 |
| 113 | |
| 114 | # Qemu SBSA plafrom only support SEC_SRAM |
| 115 | BL32_RAM_LOCATION_ID = SEC_SRAM_ID |
| 116 | $(eval $(call add_define,BL32_RAM_LOCATION_ID)) |
| 117 | |
Andrew Walbran | 9c4d069 | 2020-01-15 14:11:31 +0000 | [diff] [blame] | 118 | # Don't have the Linux kernel as a BL33 image by default |
| 119 | ARM_LINUX_KERNEL_AS_BL33 := 0 |
| 120 | $(eval $(call assert_boolean,ARM_LINUX_KERNEL_AS_BL33)) |
| 121 | $(eval $(call add_define,ARM_LINUX_KERNEL_AS_BL33)) |
| 122 | |
| 123 | ARM_PRELOADED_DTB_BASE := PLAT_QEMU_DT_BASE |
| 124 | $(eval $(call add_define,ARM_PRELOADED_DTB_BASE)) |
| 125 | |
Marcin Juszkiewicz | 6c8b65a | 2022-11-16 14:47:51 +0100 | [diff] [blame] | 126 | # Later QEMU versions support SME and SVE. |
| 127 | ENABLE_SVE_FOR_NS := 1 |
| 128 | ENABLE_SME_FOR_NS := 1 |