1# 2# Copyright (c) 2025, Arm Limited and Contributors. All rights reserved. 3# 4# SPDX-License-Identifier: BSD-3-Clause 5# 6 7GIC_REVISIONS_ := 1 2 3 5 8ifeq ($(filter $(USE_GIC_DRIVER),$(GIC_REVISIONS_)),) 9$(error USE_GIC_DRIVER can only be one of $(GIC_REVISIONS_)) 10endif 11 12ifeq (${USE_GIC_DRIVER},2) 13include drivers/arm/gic/v2/gicv2.mk 14GIC_SOURCES := ${GICV2_SOURCES} \ 15 drivers/arm/gic/v2/gicv2_base.c \ 16 plat/common/plat_gicv2.c 17else ifeq (${USE_GIC_DRIVER},3) 18include drivers/arm/gic/v3/gicv3.mk 19GIC_SOURCES := ${GICV3_SOURCES} \ 20 drivers/arm/gic/v3/gicv3_base.c \ 21 plat/common/plat_gicv3.c 22else ifeq (${USE_GIC_DRIVER},5) 23ifneq (${ENABLE_FEAT_GCIE},1) 24$(error USE_GIC_DRIVER=5 requires ENABLE_FEAT_GCIE=1) 25endif 26$(warning GICv5 support is experimental!) 27GIC_SOURCES := drivers/arm/gicv5/gicv5_iri.c \ 28 plat/common/plat_gicv5.c 29endif 30 31ifneq (${ENABLE_FEAT_GCIE},0) 32GIC_SOURCES += drivers/arm/gicv5/gicv5_cpuif.c \ 33 drivers/arm/gicv5/gicv5_main.c 34endif 35 36ifeq ($(ARCH),aarch64) 37BL31_SOURCES += ${GIC_SOURCES} 38else 39BL32_SOURCES += ${GIC_SOURCES} 40endif 41 42$(eval $(call add_defines,\ 43 USE_GIC_DRIVER \ 44)) 45