Soby Mathew | ec8ac1c | 2016-05-05 14:32:05 +0100 | [diff] [blame] | 1 | # |
Chris Kay | 68d2836 | 2023-01-16 16:53:45 +0000 | [diff] [blame] | 2 | # Copyright (c) 2016-2023, Arm Limited and Contributors. All rights reserved. |
Soby Mathew | ec8ac1c | 2016-05-05 14:32:05 +0100 | [diff] [blame] | 3 | # |
dp-arm | fa3cf0b | 2017-05-03 09:38:09 +0100 | [diff] [blame] | 4 | # SPDX-License-Identifier: BSD-3-Clause |
Soby Mathew | ec8ac1c | 2016-05-05 14:32:05 +0100 | [diff] [blame] | 5 | # |
| 6 | |
| 7 | ifneq (${ARCH}, aarch32) |
| 8 | $(error SP_MIN is only supported on AArch32 platforms) |
| 9 | endif |
| 10 | |
Chris Kay | 1000ea8 | 2021-05-19 19:24:37 +0100 | [diff] [blame] | 11 | include lib/extensions/amu/amu.mk |
Soby Mathew | ec8ac1c | 2016-05-05 14:32:05 +0100 | [diff] [blame] | 12 | include lib/psci/psci_lib.mk |
| 13 | |
| 14 | INCLUDES += -Iinclude/bl32/sp_min |
| 15 | |
| 16 | BL32_SOURCES += bl32/sp_min/sp_min_main.c \ |
| 17 | bl32/sp_min/aarch32/entrypoint.S \ |
| 18 | common/runtime_svc.c \ |
Soby Mathew | 6d07e67 | 2018-03-01 10:53:33 +0000 | [diff] [blame] | 19 | plat/common/aarch32/plat_sp_min_common.c\ |
Soby Mathew | ec8ac1c | 2016-05-05 14:32:05 +0100 | [diff] [blame] | 20 | services/std_svc/std_svc_setup.c \ |
| 21 | ${PSCI_LIB_SOURCES} |
| 22 | |
Javier Almansa Sobrino | f3a4c54 | 2020-11-23 18:38:15 +0000 | [diff] [blame] | 23 | ifeq (${DISABLE_MTPMU},1) |
| 24 | BL32_SOURCES += lib/extensions/mtpmu/aarch32/mtpmu.S |
| 25 | endif |
| 26 | |
Soby Mathew | ec8ac1c | 2016-05-05 14:32:05 +0100 | [diff] [blame] | 27 | ifeq (${ENABLE_PMF}, 1) |
| 28 | BL32_SOURCES += lib/pmf/pmf_main.c |
| 29 | endif |
| 30 | |
Andre Przywara | 0b7f1b0 | 2023-03-21 13:53:19 +0000 | [diff] [blame] | 31 | ifneq (${ENABLE_FEAT_AMU},0) |
Chris Kay | 1000ea8 | 2021-05-19 19:24:37 +0100 | [diff] [blame] | 32 | BL32_SOURCES += ${AMU_SOURCES} |
Dimitris Papastamos | dda48b0 | 2017-10-17 14:03:14 +0100 | [diff] [blame] | 33 | endif |
| 34 | |
Dimitris Papastamos | 0a4cded | 2018-01-02 11:37:02 +0000 | [diff] [blame] | 35 | ifeq (${WORKAROUND_CVE_2017_5715},1) |
Dimitris Papastamos | 570c06a | 2018-04-06 15:29:34 +0100 | [diff] [blame] | 36 | BL32_SOURCES += bl32/sp_min/wa_cve_2017_5715_bpiall.S \ |
| 37 | bl32/sp_min/wa_cve_2017_5715_icache_inv.S |
John Powell | 7f7c6fa | 2022-04-14 19:10:17 -0500 | [diff] [blame] | 38 | else |
| 39 | ifeq (${WORKAROUND_CVE_2022_23960},1) |
| 40 | BL32_SOURCES += bl32/sp_min/wa_cve_2017_5715_icache_inv.S |
| 41 | endif |
Dimitris Papastamos | 0a4cded | 2018-01-02 11:37:02 +0000 | [diff] [blame] | 42 | endif |
| 43 | |
Andre Przywara | f91762b | 2021-02-08 18:07:23 +0000 | [diff] [blame] | 44 | ifeq (${TRNG_SUPPORT},1) |
| 45 | BL32_SOURCES += services/std_svc/trng/trng_main.c \ |
| 46 | services/std_svc/trng/trng_entropy_pool.c |
| 47 | endif |
| 48 | |
Sona Mathew | 7fe0352 | 2022-11-18 18:05:38 -0600 | [diff] [blame] | 49 | ifeq (${ERRATA_ABI_SUPPORT}, 1) |
| 50 | BL32_SOURCES += services/std_svc/errata_abi/errata_abi_main.c |
| 51 | endif |
| 52 | |
Andre Przywara | 44e33e0 | 2022-11-17 16:42:09 +0000 | [diff] [blame] | 53 | ifneq (${ENABLE_SYS_REG_TRACE_FOR_NS},0) |
Manish V Badarkhe | f356f7e | 2021-06-29 11:44:20 +0100 | [diff] [blame] | 54 | BL32_SOURCES += lib/extensions/sys_reg_trace/aarch32/sys_reg_trace.c |
| 55 | endif |
| 56 | |
Andre Przywara | 06ea44e | 2022-11-17 17:30:43 +0000 | [diff] [blame] | 57 | ifneq (${ENABLE_TRF_FOR_NS},0) |
Manish V Badarkhe | 51a9711 | 2021-07-08 09:33:18 +0100 | [diff] [blame] | 58 | BL32_SOURCES += lib/extensions/trf/aarch32/trf.c |
| 59 | endif |
| 60 | |
Chris Kay | 68d2836 | 2023-01-16 16:53:45 +0000 | [diff] [blame] | 61 | BL32_DEFAULT_LINKER_SCRIPT_SOURCE := bl32/sp_min/sp_min.ld.S |
Soby Mathew | ec8ac1c | 2016-05-05 14:32:05 +0100 | [diff] [blame] | 62 | |
Chris Kay | a5639e1 | 2023-01-26 18:31:52 +0000 | [diff] [blame] | 63 | ifneq ($(findstring gcc,$(notdir $(LD))),) |
| 64 | BL32_LDFLAGS += -Wl,--sort-section=alignment |
| 65 | else ifneq ($(findstring ld,$(notdir $(LD))),) |
| 66 | BL32_LDFLAGS += --sort-section=alignment |
| 67 | endif |
| 68 | |
Soby Mathew | ec8ac1c | 2016-05-05 14:32:05 +0100 | [diff] [blame] | 69 | # Include the platform-specific SP_MIN Makefile |
| 70 | # If no platform-specific SP_MIN Makefile exists, it means SP_MIN is not supported |
| 71 | # on this platform. |
| 72 | SP_MIN_PLAT_MAKEFILE := $(wildcard ${PLAT_DIR}/sp_min/sp_min-${PLAT}.mk) |
| 73 | ifeq (,${SP_MIN_PLAT_MAKEFILE}) |
| 74 | $(error SP_MIN is not supported on platform ${PLAT}) |
| 75 | else |
| 76 | include ${SP_MIN_PLAT_MAKEFILE} |
| 77 | endif |
| 78 | |
Yatharth Kochar | 1c16a4c | 2016-06-30 14:50:58 +0100 | [diff] [blame] | 79 | RESET_TO_SP_MIN := 0 |
Soby Mathew | ec8ac1c | 2016-05-05 14:32:05 +0100 | [diff] [blame] | 80 | $(eval $(call add_define,RESET_TO_SP_MIN)) |
| 81 | $(eval $(call assert_boolean,RESET_TO_SP_MIN)) |
Etienne Carriere | dc0fea7 | 2017-08-09 15:48:53 +0200 | [diff] [blame] | 82 | |
| 83 | # Flag to allow SP_MIN to handle FIQ interrupts in monitor mode. The platform |
| 84 | # port is free to override this value. It is default disabled. |
| 85 | SP_MIN_WITH_SECURE_FIQ ?= 0 |
| 86 | $(eval $(call add_define,SP_MIN_WITH_SECURE_FIQ)) |
| 87 | $(eval $(call assert_boolean,SP_MIN_WITH_SECURE_FIQ)) |