Merge "Update code freeze and release target date for 2.3" into integration
diff --git a/Makefile b/Makefile
index a1702be..ac461a5 100644
--- a/Makefile
+++ b/Makefile
@@ -84,26 +84,6 @@
export Q ECHO
-# Process Debug flag
-$(eval $(call add_define,DEBUG))
-ifneq (${DEBUG}, 0)
- BUILD_TYPE := debug
- TF_CFLAGS += -g
-
- ifneq ($(findstring clang,$(notdir $(CC))),)
- ASFLAGS += -g
- else
- ASFLAGS += -g -Wa,--gdwarf-2
- endif
-
- # Use LOG_LEVEL_INFO by default for debug builds
- LOG_LEVEL := 40
-else
- BUILD_TYPE := release
- # Use LOG_LEVEL_NOTICE by default for release builds
- LOG_LEVEL := 20
-endif
-
# Default build string (git branch and commit)
ifeq (${BUILD_STRING},)
BUILD_STRING := $(shell git describe --always --dirty --tags 2> /dev/null)
@@ -243,6 +223,26 @@
LD = $(LINKER)
endif
+# Process Debug flag
+$(eval $(call add_define,DEBUG))
+ifneq (${DEBUG}, 0)
+ BUILD_TYPE := debug
+ TF_CFLAGS += -g
+
+ ifneq ($(findstring clang,$(notdir $(CC))),)
+ ASFLAGS += -g
+ else
+ ASFLAGS += -g -Wa,--gdwarf-2
+ endif
+
+ # Use LOG_LEVEL_INFO by default for debug builds
+ LOG_LEVEL := 40
+else
+ BUILD_TYPE := release
+ # Use LOG_LEVEL_NOTICE by default for release builds
+ LOG_LEVEL := 20
+endif
+
ifeq (${AARCH32_INSTRUCTION_SET},A32)
TF_CFLAGS_aarch32 += -marm
else ifeq (${AARCH32_INSTRUCTION_SET},T32)
@@ -508,6 +508,18 @@
endif
endif
+ifeq (${ARCH},aarch64)
+BL1_CFLAGS += -DIMAGE_AT_EL3
+ifeq ($(BL2_AT_EL3),1)
+BL2_CFLAGS += -DIMAGE_AT_EL3
+else
+BL2_CFLAGS += -DIMAGE_AT_EL1
+endif
+BL2U_CFLAGS += -DIMAGE_AT_EL1
+BL31_CFLAGS += -DIMAGE_AT_EL3
+BL32_CFLAGS += -DIMAGE_AT_EL1
+endif
+
# Include the CPU specific operations makefile, which provides default
# values for all CPU errata workarounds and CPU specific optimisations.
# This can be overridden by the platform.
diff --git a/bl32/sp_min/sp_min.ld.S b/bl32/sp_min/sp_min.ld.S
index a90a805..66f3b11 100644
--- a/bl32/sp_min/sp_min.ld.S
+++ b/bl32/sp_min/sp_min.ld.S
@@ -56,7 +56,7 @@
KEEP(*(rt_svc_descs))
__RT_SVC_DESCS_END__ = .;
- . = ALIGN(8);
+ . = ALIGN(4);
__FCONF_POPULATOR_START__ = .;
KEEP(*(.fconf_populator))
__FCONF_POPULATOR_END__ = .;
@@ -98,7 +98,7 @@
KEEP(*(rt_svc_descs))
__RT_SVC_DESCS_END__ = .;
- . = ALIGN(8);
+ . = ALIGN(4);
__FCONF_POPULATOR_START__ = .;
KEEP(*(.fconf_populator))
__FCONF_POPULATOR_END__ = .;
diff --git a/docs/getting_started/build-options.rst b/docs/getting_started/build-options.rst
index 50cafcf..69e103d 100644
--- a/docs/getting_started/build-options.rst
+++ b/docs/getting_started/build-options.rst
@@ -667,6 +667,27 @@
cluster platforms). If this option is enabled, then warm boot path
enables D-caches immediately after enabling MMU. This option defaults to 0.
+GICv3 driver options
+--------------------
+
+GICv3 driver files are included using directive:
+
+``include drivers/arm/gic/v3/gicv3.mk``
+
+The driver can be configured with the following options set in the platform
+makefile:
+
+- ``GICV3_IMPL``: Selects between GIC-500 and GIC-600 variants of GICv3.
+ This option can take values GIC500 and GIC600 with default set to GIC500.
+
+- ``GICV3_IMPL_GIC600_MULTICHIP``: Selects GIC-600 variant with multichip
+ functionality. This option defaults to 0
+
+- ``GICV3_OVERRIDE_DISTIF_PWR_OPS``: Allows override of default implementation
+ of ``arm_gicv3_distif_pre_save`` and ``arm_gicv3_distif_post_restore``
+ functions. This is required for FVP platform which need to simulate GIC save
+ and restore during SYSTEM_SUSPEND without powering down GIC. Default is 0.
+
Debugging options
-----------------
diff --git a/drivers/arm/gic/v3/gicv3.mk b/drivers/arm/gic/v3/gicv3.mk
new file mode 100644
index 0000000..164f88e
--- /dev/null
+++ b/drivers/arm/gic/v3/gicv3.mk
@@ -0,0 +1,34 @@
+#
+# Copyright (c) 2013-2020, Arm Limited and Contributors. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
+
+# Default configuration values
+GICV3_IMPL ?= GIC500
+GICV3_IMPL_GIC600_MULTICHIP ?= 0
+GICV3_OVERRIDE_DISTIF_PWR_OPS ?= 0
+
+GICV3_SOURCES += drivers/arm/gic/common/gic_common.c \
+ drivers/arm/gic/v3/gicv3_main.c \
+ drivers/arm/gic/v3/gicv3_helpers.c \
+ drivers/arm/gic/v3/gicdv3_helpers.c \
+ drivers/arm/gic/v3/gicrv3_helpers.c
+
+ifeq (${GICV3_OVERRIDE_DISTIF_PWR_OPS}, 0)
+GICV3_SOURCES += drivers/arm/gic/v3/arm_gicv3_common.c
+endif
+
+# Either GIC-600 or GIC-500 can be selected at one time
+ifeq (${GICV3_IMPL}, GIC600)
+# GIC-600 sources
+GICV3_SOURCES += drivers/arm/gic/v3/gic600.c
+ifeq (${GICV3_IMPL_GIC600_MULTICHIP}, 1)
+GICV3_SOURCES += drivers/arm/gic/v3/gic600_multichip.c
+endif
+else ifeq (${GICV3_IMPL}, GIC500)
+# GIC-500 sources
+GICV3_SOURCES += drivers/arm/gic/v3/gic500.c
+else
+$(error "Incorrect GICV3_IMPL value ${GICV3_IMPL}")
+endif
diff --git a/include/arch/aarch64/arch_helpers.h b/include/arch/aarch64/arch_helpers.h
index 240c1fb..7c30758 100644
--- a/include/arch/aarch64/arch_helpers.h
+++ b/include/arch/aarch64/arch_helpers.h
@@ -531,6 +531,23 @@
return GET_EL(read_CurrentEl());
}
+static inline unsigned int get_current_el_maybe_constant(void)
+{
+#if defined(IMAGE_AT_EL1)
+ return 1;
+#elif defined(IMAGE_AT_EL2)
+ return 2; /* no use-case in TF-A */
+#elif defined(IMAGE_AT_EL3)
+ return 3;
+#else
+ /*
+ * If we do not know which exception level this is being built for
+ * (e.g. built for library), fall back to run-time detection.
+ */
+ return get_current_el();
+#endif
+}
+
/*
* Check if an EL is implemented from AA64PFR0 register fields.
*/
diff --git a/include/lib/xlat_tables/xlat_mmu_helpers.h b/include/lib/xlat_tables/xlat_mmu_helpers.h
index abdf1b6..269afd2 100644
--- a/include/lib/xlat_tables/xlat_mmu_helpers.h
+++ b/include/lib/xlat_tables/xlat_mmu_helpers.h
@@ -56,6 +56,8 @@
#include <stdint.h>
#include <string.h>
+#include <arch_helpers.h>
+
/*
* Return the values that the MMU configuration registers must contain for the
* specified translation context. `params` must be a pointer to array of size
@@ -70,6 +72,7 @@
void enable_mmu_el1(unsigned int flags);
void enable_mmu_el2(unsigned int flags);
void enable_mmu_el3(unsigned int flags);
+void enable_mmu(unsigned int flags);
void enable_mmu_direct_el1(unsigned int flags);
void enable_mmu_direct_el2(unsigned int flags);
diff --git a/include/plat/arm/common/arm_def.h b/include/plat/arm/common/arm_def.h
index 7df6b0d..7c852e1 100644
--- a/include/plat/arm/common/arm_def.h
+++ b/include/plat/arm/common/arm_def.h
@@ -12,6 +12,7 @@
#include <drivers/arm/gic_common.h>
#include <lib/utils_def.h>
#include <lib/xlat_tables/xlat_tables_defs.h>
+#include <plat/arm/common/smccc_def.h>
#include <plat/common/common_def.h>
/******************************************************************************
diff --git a/include/plat/arm/common/plat_arm.h b/include/plat/arm/common/plat_arm.h
index 83d4c20..1b59795 100644
--- a/include/plat/arm/common/plat_arm.h
+++ b/include/plat/arm/common/plat_arm.h
@@ -148,11 +148,6 @@
#define ARM_ROTPK_DEVEL_RSA_ID 2
#define ARM_ROTPK_DEVEL_ECDSA_ID 3
-/* Defines used to retrieve ARM SOC revision */
-#define ARM_SOC_CONTINUATION_CODE U(0x4)
-#define ARM_SOC_IDENTIFICATION_CODE U(0x3B)
-#define ARM_SOC_CONTINUATION_SHIFT U(24)
-#define ARM_SOC_IDENTIFICATION_SHIFT U(16)
/* IO storage utility functions */
int arm_io_setup(void);
diff --git a/include/plat/arm/common/smccc_def.h b/include/plat/arm/common/smccc_def.h
new file mode 100644
index 0000000..6e698e5
--- /dev/null
+++ b/include/plat/arm/common/smccc_def.h
@@ -0,0 +1,15 @@
+/*
+ * Copyright (c) 2020, ARM Limited and Contributors. All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+#ifndef SMCCC_DEF_H
+#define SMCCC_DEF_H
+
+/* Defines used to retrieve ARM SOC revision */
+#define ARM_SOC_CONTINUATION_CODE U(0x4)
+#define ARM_SOC_IDENTIFICATION_CODE U(0x3B)
+#define ARM_SOC_CONTINUATION_SHIFT U(24)
+#define ARM_SOC_IDENTIFICATION_SHIFT U(16)
+
+#endif /* SMCCC_DEF_H */
diff --git a/lib/fconf/fconf.mk b/lib/fconf/fconf.mk
index 7031969..c087102 100644
--- a/lib/fconf/fconf.mk
+++ b/lib/fconf/fconf.mk
@@ -5,8 +5,8 @@
#
# Add Firmware Configuration files
-FCONF_SOURCES := lib/fconf/fconf.c \
- lib/fconf/fconf_dyn_cfg_getter.c
+FCONF_SOURCES := lib/fconf/fconf.c
+FCONF_DYN_SOURCES := lib/fconf/fconf_dyn_cfg_getter.c
BL1_SOURCES += ${FCONF_SOURCES}
-BL2_SOURCES += ${FCONF_SOURCES}
+BL2_SOURCES += ${FCONF_SOURCES} ${FCONF_DYN_SOURCES}
diff --git a/lib/xlat_tables_v2/xlat_tables_context.c b/lib/xlat_tables_v2/xlat_tables_context.c
index a1c974e..032e142 100644
--- a/lib/xlat_tables_v2/xlat_tables_context.c
+++ b/lib/xlat_tables_v2/xlat_tables_context.c
@@ -239,6 +239,23 @@
enable_mmu_direct_el3(flags);
}
+void enable_mmu(unsigned int flags)
+{
+ switch (get_current_el_maybe_constant()) {
+ case 1:
+ enable_mmu_el1(flags);
+ break;
+ case 2:
+ enable_mmu_el2(flags);
+ break;
+ case 3:
+ enable_mmu_el3(flags);
+ break;
+ default:
+ panic();
+ }
+}
+
#else /* !__aarch64__ */
void enable_mmu_svc_mon(unsigned int flags)
diff --git a/make_helpers/build_macros.mk b/make_helpers/build_macros.mk
index 20a36fe..1c3d14d 100644
--- a/make_helpers/build_macros.mk
+++ b/make_helpers/build_macros.mk
@@ -273,12 +273,12 @@
$(eval OBJ := $(1)/$(patsubst %.c,%.o,$(notdir $(2))))
$(eval DEP := $(patsubst %.o,%.d,$(OBJ)))
-$(eval IMAGE := IMAGE_BL$(call uppercase,$(3)))
+$(eval BL_CPPFLAGS := $(BL$(call uppercase,$(3))_CPPFLAGS) -DIMAGE_BL$(call uppercase,$(3)))
$(eval BL_CFLAGS := $(BL$(call uppercase,$(3))_CFLAGS))
$(OBJ): $(2) $(filter-out %.d,$(MAKEFILE_LIST)) | bl$(3)_dirs
$$(ECHO) " CC $$<"
- $$(Q)$$(CC) $$(LTO_CFLAGS) $$(TF_CFLAGS) $$(CFLAGS) $(BL_CFLAGS) -D$(IMAGE) $(MAKE_DEP) -c $$< -o $$@
+ $$(Q)$$(CC) $$(LTO_CFLAGS) $$(TF_CFLAGS) $$(CFLAGS) $(BL_CPPFLAGS) $(BL_CFLAGS) $(MAKE_DEP) -c $$< -o $$@
-include $(DEP)
@@ -293,11 +293,12 @@
$(eval OBJ := $(1)/$(patsubst %.S,%.o,$(notdir $(2))))
$(eval DEP := $(patsubst %.o,%.d,$(OBJ)))
-$(eval IMAGE := IMAGE_BL$(call uppercase,$(3)))
+$(eval BL_CPPFLAGS := $(BL$(call uppercase,$(3))_CPPFLAGS) -DIMAGE_BL$(call uppercase,$(3)))
+$(eval BL_ASFLAGS := $(BL$(call uppercase,$(3))_ASFLAGS))
$(OBJ): $(2) $(filter-out %.d,$(MAKEFILE_LIST)) | bl$(3)_dirs
$$(ECHO) " AS $$<"
- $$(Q)$$(AS) $$(ASFLAGS) -D$(IMAGE) $(MAKE_DEP) -c $$< -o $$@
+ $$(Q)$$(AS) $$(ASFLAGS) $(BL_CPPFLAGS) $(BL_ASFLAGS) $(MAKE_DEP) -c $$< -o $$@
-include $(DEP)
@@ -311,11 +312,11 @@
define MAKE_LD
$(eval DEP := $(1).d)
-$(eval IMAGE := IMAGE_BL$(call uppercase,$(3)))
+$(eval BL_CPPFLAGS := $(BL$(call uppercase,$(3))_CPPFLAGS) -DIMAGE_BL$(call uppercase,$(3)))
$(1): $(2) $(filter-out %.d,$(MAKEFILE_LIST)) | bl$(3)_dirs
$$(ECHO) " PP $$<"
- $$(Q)$$(CPP) $$(CPPFLAGS) $(TF_CFLAGS_$(ARCH)) -P -x assembler-with-cpp -D__LINKER__ $(MAKE_DEP) -D$(IMAGE) -o $$@ $$<
+ $$(Q)$$(CPP) $$(CPPFLAGS) $(BL_CPPFLAGS) $(TF_CFLAGS_$(ARCH)) -P -x assembler-with-cpp -D__LINKER__ $(MAKE_DEP) -o $$@ $$<
-include $(DEP)
diff --git a/plat/arm/board/a5ds/include/platform_def.h b/plat/arm/board/a5ds/include/platform_def.h
index 31dfb1c..ab0ff58 100644
--- a/plat/arm/board/a5ds/include/platform_def.h
+++ b/plat/arm/board/a5ds/include/platform_def.h
@@ -11,6 +11,7 @@
#include <lib/utils_def.h>
#include <lib/xlat_tables/xlat_tables_defs.h>
#include <plat/arm/board/common/v2m_def.h>
+#include <plat/arm/common/smccc_def.h>
#include <plat/common/common_def.h>
/* Memory location options for TSP */
diff --git a/plat/arm/board/corstone700/include/platform_def.h b/plat/arm/board/corstone700/include/platform_def.h
index 0fb74e4..cc4dc3a 100644
--- a/plat/arm/board/corstone700/include/platform_def.h
+++ b/plat/arm/board/corstone700/include/platform_def.h
@@ -9,9 +9,9 @@
#include <lib/utils_def.h>
#include <lib/xlat_tables/xlat_tables_defs.h>
-
#include <plat/arm/board/common/v2m_def.h>
#include <plat/arm/common/arm_spm_def.h>
+#include <plat/arm/common/smccc_def.h>
#include <plat/common/common_def.h>
/* PL011 UART related constants */
diff --git a/plat/arm/board/fvp/platform.mk b/plat/arm/board/fvp/platform.mk
index e64c4d4..15cd691 100644
--- a/plat/arm/board/fvp/platform.mk
+++ b/plat/arm/board/fvp/platform.mk
@@ -48,21 +48,23 @@
$(eval $(call add_define,FVP_INTERCONNECT_DRIVER))
-FVP_GICV3_SOURCES := drivers/arm/gic/common/gic_common.c \
- drivers/arm/gic/v3/gicv3_main.c \
- drivers/arm/gic/v3/gicv3_helpers.c \
- drivers/arm/gic/v3/gicdv3_helpers.c \
- drivers/arm/gic/v3/gicrv3_helpers.c \
+# Choose the GIC sources depending upon the how the FVP will be invoked
+ifeq (${FVP_USE_GIC_DRIVER},$(filter ${FVP_USE_GIC_DRIVER},FVP_GICV3 FVP_GIC600))
+ ifeq (${FVP_USE_GIC_DRIVER}, FVP_GIC600)
+ GICV3_IMPL := GIC600
+ endif
+
+# GIC500 is the default option in case GICV3_IMPL is not set
+
+GICV3_OVERRIDE_DISTIF_PWR_OPS := 1
+
+# Include GICv3 driver files
+include drivers/arm/gic/v3/gicv3.mk
+
+FVP_GIC_SOURCES := ${GICV3_SOURCES} \
plat/common/plat_gicv3.c \
plat/arm/common/arm_gicv3.c
-# Choose the GIC sources depending upon the how the FVP will be invoked
-ifeq (${FVP_USE_GIC_DRIVER}, FVP_GICV3)
-FVP_GIC_SOURCES := ${FVP_GICV3_SOURCES} \
- drivers/arm/gic/v3/gic500.c
-else ifeq (${FVP_USE_GIC_DRIVER},FVP_GIC600)
-FVP_GIC_SOURCES := ${FVP_GICV3_SOURCES} \
- drivers/arm/gic/v3/gic600.c
else ifeq (${FVP_USE_GIC_DRIVER}, FVP_GICV2)
FVP_GIC_SOURCES := drivers/arm/gic/common/gic_common.c \
drivers/arm/gic/v2/gicv2_main.c \
@@ -295,30 +297,30 @@
# Enable the dynamic translation tables library.
ifeq (${ARCH},aarch32)
ifeq (${RESET_TO_SP_MIN},1)
- BL32_CFLAGS += -DPLAT_XLAT_TABLES_DYNAMIC=1
+ BL32_CPPFLAGS += -DPLAT_XLAT_TABLES_DYNAMIC=1
endif
else # AArch64
ifeq (${RESET_TO_BL31},1)
- BL31_CFLAGS += -DPLAT_XLAT_TABLES_DYNAMIC=1
+ BL31_CPPFLAGS += -DPLAT_XLAT_TABLES_DYNAMIC=1
endif
ifeq (${SPD},trusty)
- BL31_CFLAGS += -DPLAT_XLAT_TABLES_DYNAMIC=1
+ BL31_CPPFLAGS += -DPLAT_XLAT_TABLES_DYNAMIC=1
endif
endif
ifeq (${ALLOW_RO_XLAT_TABLES}, 1)
ifeq (${ARCH},aarch32)
- BL32_CFLAGS += -DPLAT_RO_XLAT_TABLES=1
+ BL32_CPPFLAGS += -DPLAT_RO_XLAT_TABLES=1
else # AArch64
- BL31_CFLAGS += -DPLAT_RO_XLAT_TABLES=1
+ BL31_CPPFLAGS += -DPLAT_RO_XLAT_TABLES=1
ifeq (${SPD},tspd)
- BL32_CFLAGS += -DPLAT_RO_XLAT_TABLES=1
+ BL32_CPPFLAGS += -DPLAT_RO_XLAT_TABLES=1
endif
endif
endif
ifeq (${USE_DEBUGFS},1)
- BL31_CFLAGS += -DPLAT_XLAT_TABLES_DYNAMIC=1
+ BL31_CPPFLAGS += -DPLAT_XLAT_TABLES_DYNAMIC=1
endif
# Add support for platform supplied linker script for BL31 build
diff --git a/plat/arm/board/fvp_ve/include/platform_def.h b/plat/arm/board/fvp_ve/include/platform_def.h
index 1b07a9b..70a12ea 100644
--- a/plat/arm/board/fvp_ve/include/platform_def.h
+++ b/plat/arm/board/fvp_ve/include/platform_def.h
@@ -11,6 +11,7 @@
#include <lib/utils_def.h>
#include <lib/xlat_tables/xlat_tables_defs.h>
#include <plat/arm/board/common/v2m_def.h>
+#include <plat/arm/common/smccc_def.h>
#include <plat/common/common_def.h>
#include "../fvp_ve_def.h"
diff --git a/plat/arm/board/juno/platform.mk b/plat/arm/board/juno/platform.mk
index f07c1b1..dfdefa1 100644
--- a/plat/arm/board/juno/platform.mk
+++ b/plat/arm/board/juno/platform.mk
@@ -147,19 +147,19 @@
# Enable the dynamic translation tables library.
ifeq (${ARCH},aarch32)
ifeq (${RESET_TO_SP_MIN},1)
- BL32_CFLAGS += -DPLAT_XLAT_TABLES_DYNAMIC=1
+ BL32_CPPFLAGS += -DPLAT_XLAT_TABLES_DYNAMIC=1
endif
else
ifeq (${RESET_TO_BL31},1)
- BL31_CFLAGS += -DPLAT_XLAT_TABLES_DYNAMIC=1
+ BL31_CPPFLAGS += -DPLAT_XLAT_TABLES_DYNAMIC=1
endif
endif
ifeq (${ALLOW_RO_XLAT_TABLES}, 1)
ifeq (${JUNO_AARCH32_EL3_RUNTIME}, 1)
- BL32_CFLAGS += -DPLAT_RO_XLAT_TABLES=1
+ BL32_CPPFLAGS += -DPLAT_RO_XLAT_TABLES=1
else
- BL31_CFLAGS += -DPLAT_RO_XLAT_TABLES=1
+ BL31_CPPFLAGS += -DPLAT_RO_XLAT_TABLES=1
endif
endif
diff --git a/plat/arm/board/n1sdp/platform.mk b/plat/arm/board/n1sdp/platform.mk
index 5856c9f..44f7b8a 100644
--- a/plat/arm/board/n1sdp/platform.mk
+++ b/plat/arm/board/n1sdp/platform.mk
@@ -14,16 +14,16 @@
N1SDP_CPU_SOURCES := lib/cpus/aarch64/neoverse_n1.S
+# GIC-600 configuration
+GICV3_IMPL := GIC600
+GICV3_IMPL_GIC600_MULTICHIP := 1
-N1SDP_GIC_SOURCES := drivers/arm/gic/common/gic_common.c \
- drivers/arm/gic/v3/gicv3_main.c \
- drivers/arm/gic/v3/gicv3_helpers.c \
- drivers/arm/gic/v3/gicdv3_helpers.c \
- drivers/arm/gic/v3/gicrv3_helpers.c \
- drivers/arm/gic/v3/gic600_multichip.c \
+# Include GICv3 driver files
+include drivers/arm/gic/v3/gicv3.mk
+
+N1SDP_GIC_SOURCES := ${GICV3_SOURCES} \
plat/common/plat_gicv3.c \
plat/arm/common/arm_gicv3.c \
- drivers/arm/gic/v3/gic600.c
PLAT_BL_COMMON_SOURCES := ${N1SDP_BASE}/n1sdp_plat.c \
${N1SDP_BASE}/aarch64/n1sdp_helper.S
diff --git a/plat/arm/board/rdn1edge/platform.mk b/plat/arm/board/rdn1edge/platform.mk
index 135676d..1daf85f 100644
--- a/plat/arm/board/rdn1edge/platform.mk
+++ b/plat/arm/board/rdn1edge/platform.mk
@@ -4,6 +4,9 @@
# SPDX-License-Identifier: BSD-3-Clause
#
+# GIC-600 configuration
+GICV3_IMPL_GIC600_MULTICHIP := 1
+
include plat/arm/css/sgi/sgi-common.mk
RDN1EDGE_BASE = plat/arm/board/rdn1edge
@@ -26,7 +29,6 @@
${RDN1EDGE_BASE}/rdn1edge_plat.c \
${RDN1EDGE_BASE}/rdn1edge_topology.c \
drivers/cfi/v2m/v2m_flash.c \
- drivers/arm/gic/v3/gic600_multichip.c \
lib/utils/mem_region.c \
plat/arm/common/arm_nor_psci_mem_protect.c
@@ -36,7 +38,7 @@
endif
# Enable dynamic addition of MMAP regions in BL31
-BL31_CFLAGS += -DPLAT_XLAT_TABLES_DYNAMIC=1
+BL31_CPPFLAGS += -DPLAT_XLAT_TABLES_DYNAMIC=1
# Add the FDT_SOURCES and options for Dynamic Config
FDT_SOURCES += ${RDN1EDGE_BASE}/fdts/${PLAT}_fw_config.dts
diff --git a/plat/arm/css/sgi/sgi-common.mk b/plat/arm/css/sgi/sgi-common.mk
index ea5a563..2504581 100644
--- a/plat/arm/css/sgi/sgi-common.mk
+++ b/plat/arm/css/sgi/sgi-common.mk
@@ -22,15 +22,15 @@
PLAT_INCLUDES += -I${CSS_ENT_BASE}/include
-ENT_GIC_SOURCES := drivers/arm/gic/common/gic_common.c \
- drivers/arm/gic/v3/gicv3_main.c \
- drivers/arm/gic/v3/gicv3_helpers.c \
- drivers/arm/gic/v3/gicdv3_helpers.c \
- drivers/arm/gic/v3/gicrv3_helpers.c \
- plat/common/plat_gicv3.c \
- plat/arm/common/arm_gicv3.c \
- drivers/arm/gic/v3/gic600.c
+# GIC-600 configuration
+GICV3_IMPL := GIC600
+
+# Include GICv3 driver files
+include drivers/arm/gic/v3/gicv3.mk
+ENT_GIC_SOURCES := ${GICV3_SOURCES} \
+ plat/common/plat_gicv3.c \
+ plat/arm/common/arm_gicv3.c
PLAT_BL_COMMON_SOURCES += ${CSS_ENT_BASE}/sgi_plat.c \
${CSS_ENT_BASE}/aarch64/sgi_helper.S
diff --git a/plat/arm/css/sgm/sgm-common.mk b/plat/arm/css/sgm/sgm-common.mk
index 49fc717..60e9fb2 100644
--- a/plat/arm/css/sgm/sgm-common.mk
+++ b/plat/arm/css/sgm/sgm-common.mk
@@ -22,15 +22,15 @@
INTERCONNECT_SOURCES := ${CSS_SGM_BASE}/sgm_interconnect.c
-SGM_GIC_SOURCES := drivers/arm/gic/common/gic_common.c \
- drivers/arm/gic/v3/gicv3_main.c \
- drivers/arm/gic/v3/gicv3_helpers.c \
- drivers/arm/gic/v3/gicdv3_helpers.c \
- drivers/arm/gic/v3/gicrv3_helpers.c \
+# GIC-600 configuration
+GICV3_IMPL := GIC600
+
+# Include GICv3 driver files
+include drivers/arm/gic/v3/gicv3.mk
+
+SGM_GIC_SOURCES := ${GICV3_SOURCES} \
plat/common/plat_gicv3.c \
- plat/arm/common/arm_gicv3.c \
- drivers/arm/gic/v3/gic600.c \
- drivers/arm/gic/v3/arm_gicv3_common.c
+ plat/arm/common/arm_gicv3.c
BL1_SOURCES += $(SGM_CPU_SOURCES) \
${INTERCONNECT_SOURCES} \
diff --git a/plat/imx/imx8m/imx8mm/platform.mk b/plat/imx/imx8m/imx8mm/platform.mk
index 5fa3003..3ead7b0 100644
--- a/plat/imx/imx8m/imx8mm/platform.mk
+++ b/plat/imx/imx8m/imx8mm/platform.mk
@@ -8,13 +8,10 @@
-Iplat/imx/imx8m/include \
-Iplat/imx/imx8m/imx8mm/include
-IMX_GIC_SOURCES := drivers/arm/gic/v3/gicv3_helpers.c \
- drivers/arm/gic/v3/gicdv3_helpers.c \
- drivers/arm/gic/v3/gicrv3_helpers.c \
- drivers/arm/gic/v3/arm_gicv3_common.c \
- drivers/arm/gic/v3/gic500.c \
- drivers/arm/gic/v3/gicv3_main.c \
- drivers/arm/gic/common/gic_common.c \
+# Include GICv3 driver files
+include drivers/arm/gic/v3/gicv3.mk
+
+IMX_GIC_SOURCES := ${GICV3_SOURCES} \
plat/common/plat_gicv3.c \
plat/common/plat_psci_common.c \
plat/imx/common/plat_imx8_gic.c
diff --git a/plat/imx/imx8m/imx8mq/platform.mk b/plat/imx/imx8m/imx8mq/platform.mk
index e419f05..5461010 100644
--- a/plat/imx/imx8m/imx8mq/platform.mk
+++ b/plat/imx/imx8m/imx8mq/platform.mk
@@ -8,13 +8,10 @@
-Iplat/imx/imx8m/include \
-Iplat/imx/imx8m/imx8mq/include
-IMX_GIC_SOURCES := drivers/arm/gic/v3/gicv3_helpers.c \
- drivers/arm/gic/v3/gicdv3_helpers.c \
- drivers/arm/gic/v3/gicrv3_helpers.c \
- drivers/arm/gic/v3/arm_gicv3_common.c \
- drivers/arm/gic/v3/gic500.c \
- drivers/arm/gic/v3/gicv3_main.c \
- drivers/arm/gic/common/gic_common.c \
+# Include GICv3 driver files
+include drivers/arm/gic/v3/gicv3.mk
+
+IMX_GIC_SOURCES := ${GICV3_SOURCES} \
plat/common/plat_gicv3.c \
plat/common/plat_psci_common.c \
plat/imx/common/plat_imx8_gic.c
diff --git a/plat/imx/imx8qm/platform.mk b/plat/imx/imx8qm/platform.mk
index 20ee05b..f35fa00 100644
--- a/plat/imx/imx8qm/platform.mk
+++ b/plat/imx/imx8qm/platform.mk
@@ -7,13 +7,10 @@
PLAT_INCLUDES := -Iplat/imx/imx8qm/include \
-Iplat/imx/common/include \
-IMX_GIC_SOURCES := drivers/arm/gic/v3/gicv3_helpers.c \
- drivers/arm/gic/v3/gicdv3_helpers.c \
- drivers/arm/gic/v3/gicrv3_helpers.c \
- drivers/arm/gic/v3/arm_gicv3_common.c \
- drivers/arm/gic/v3/gic500.c \
- drivers/arm/gic/v3/gicv3_main.c \
- drivers/arm/gic/common/gic_common.c \
+# Include GICv3 driver files
+include drivers/arm/gic/v3/gicv3.mk
+
+IMX_GIC_SOURCES := ${GICV3_SOURCES} \
plat/common/plat_gicv3.c \
plat/common/plat_psci_common.c \
plat/imx/common/plat_imx8_gic.c
diff --git a/plat/imx/imx8qx/platform.mk b/plat/imx/imx8qx/platform.mk
index 5e8ba06..f18d634 100644
--- a/plat/imx/imx8qx/platform.mk
+++ b/plat/imx/imx8qx/platform.mk
@@ -7,13 +7,10 @@
PLAT_INCLUDES := -Iplat/imx/imx8qx/include \
-Iplat/imx/common/include \
-IMX_GIC_SOURCES := drivers/arm/gic/v3/gicv3_helpers.c \
- drivers/arm/gic/v3/gicdv3_helpers.c \
- drivers/arm/gic/v3/gicrv3_helpers.c \
- drivers/arm/gic/v3/arm_gicv3_common.c \
- drivers/arm/gic/v3/gic500.c \
- drivers/arm/gic/v3/gicv3_main.c \
- drivers/arm/gic/common/gic_common.c \
+# Include GICv3 driver files
+include drivers/arm/gic/v3/gicv3.mk
+
+IMX_GIC_SOURCES := ${GICV3_SOURCES} \
plat/common/plat_gicv3.c \
plat/imx/common/plat_imx8_gic.c
diff --git a/plat/marvell/a3700/common/a3700_common.mk b/plat/marvell/a3700/common/a3700_common.mk
index fd2b7ed..76c0677 100644
--- a/plat/marvell/a3700/common/a3700_common.mk
+++ b/plat/marvell/a3700/common/a3700_common.mk
@@ -78,14 +78,11 @@
# CCI-400
$(eval $(call add_define,USE_CCI))
-MARVELL_GIC_SOURCES := drivers/arm/gic/common/gic_common.c \
- drivers/arm/gic/v3/gicv3_main.c \
- drivers/arm/gic/v3/gicv3_helpers.c \
- drivers/arm/gic/v3/gicdv3_helpers.c \
- drivers/arm/gic/v3/gicrv3_helpers.c \
- drivers/arm/gic/v3/arm_gicv3_common.c \
- plat/common/plat_gicv3.c \
- drivers/arm/gic/v3/gic500.c
+# Include GICv3 driver files
+include drivers/arm/gic/v3/gicv3.mk
+
+MARVELL_GIC_SOURCES := ${GICV3_SOURCES} \
+ plat/common/plat_gicv3.c
PLAT_INCLUDES := -I$(PLAT_FAMILY_BASE)/$(PLAT) \
-I$(PLAT_COMMON_BASE)/include \
diff --git a/plat/mediatek/mt8183/platform.mk b/plat/mediatek/mt8183/platform.mk
index 59ffe5d..3ccc928 100644
--- a/plat/mediatek/mt8183/platform.mk
+++ b/plat/mediatek/mt8183/platform.mk
@@ -26,15 +26,12 @@
plat/common/plat_psci_common.c \
plat/common/aarch64/crash_console_helpers.S
+# Include GICv3 driver files
+include drivers/arm/gic/v3/gicv3.mk
+
BL31_SOURCES += common/desc_image_load.c \
drivers/arm/cci/cci.c \
- drivers/arm/gic/common/gic_common.c \
- drivers/arm/gic/v3/arm_gicv3_common.c \
- drivers/arm/gic/v3/gicv3_helpers.c \
- drivers/arm/gic/v3/gicdv3_helpers.c \
- drivers/arm/gic/v3/gicrv3_helpers.c \
- drivers/arm/gic/v3/gic500.c \
- drivers/arm/gic/v3/gicv3_main.c \
+ ${GICV3_SOURCES} \
drivers/delay_timer/delay_timer.c \
drivers/delay_timer/generic_delay_timer.c \
drivers/gpio/gpio.c \
diff --git a/plat/nvidia/tegra/common/tegra_pm.c b/plat/nvidia/tegra/common/tegra_pm.c
index 5ec6f84..0430048 100644
--- a/plat/nvidia/tegra/common/tegra_pm.c
+++ b/plat/nvidia/tegra/common/tegra_pm.c
@@ -152,16 +152,18 @@
const plat_params_from_bl2_t *plat_params;
/*
- * Initialize the GIC cpu and distributor interfaces
- */
- tegra_gic_pcpu_init();
-
- /*
* Check if we are exiting from deep sleep.
*/
if (target_state->pwr_domain_state[PLAT_MAX_PWR_LVL] ==
PSTATE_ID_SOC_POWERDN) {
+ /*
+ * On entering System Suspend state, the GIC loses power
+ * completely. Initialize the GIC global distributor and
+ * GIC cpu interfaces.
+ */
+ tegra_gic_init();
+
/* Restart console output. */
console_switch_state(CONSOLE_FLAG_RUNTIME);
@@ -183,6 +185,11 @@
* access
*/
tegra_memctrl_tzram_setup(TEGRA_TZRAM_BASE, TEGRA_TZRAM_SIZE);
+ } else {
+ /*
+ * Initialize the GIC cpu and distributor interfaces
+ */
+ tegra_gic_pcpu_init();
}
/*
diff --git a/plat/nvidia/tegra/soc/t186/platform_t186.mk b/plat/nvidia/tegra/soc/t186/platform_t186.mk
index a534123..d320aac 100644
--- a/plat/nvidia/tegra/soc/t186/platform_t186.mk
+++ b/plat/nvidia/tegra/soc/t186/platform_t186.mk
@@ -33,7 +33,7 @@
MAX_XLAT_TABLES := 25
$(eval $(call add_define,MAX_XLAT_TABLES))
-MAX_MMAP_REGIONS := 27
+MAX_MMAP_REGIONS := 30
$(eval $(call add_define,MAX_MMAP_REGIONS))
# platform files
diff --git a/plat/qemu/qemu/platform.mk b/plat/qemu/qemu/platform.mk
index 6aa198c..1bf4e08 100644
--- a/plat/qemu/qemu/platform.mk
+++ b/plat/qemu/qemu/platform.mk
@@ -139,11 +139,10 @@
plat/common/plat_gicv2.c \
${PLAT_QEMU_COMMON_PATH}/qemu_gicv2.c
-QEMU_GICV3_SOURCES := drivers/arm/gic/v3/gicv3_helpers.c \
- drivers/arm/gic/v3/gicdv3_helpers.c \
- drivers/arm/gic/v3/gicrv3_helpers.c \
- drivers/arm/gic/v3/gicv3_main.c \
- drivers/arm/gic/common/gic_common.c \
+# Include GICv3 driver files
+include drivers/arm/gic/v3/gicv3.mk
+
+QEMU_GICV3_SOURCES := ${GICV3_SOURCES} \
plat/common/plat_gicv3.c \
${PLAT_QEMU_COMMON_PATH}/qemu_gicv3.c
diff --git a/plat/qemu/qemu_sbsa/platform.mk b/plat/qemu/qemu_sbsa/platform.mk
index 6ad3d8b..09856d6 100644
--- a/plat/qemu/qemu_sbsa/platform.mk
+++ b/plat/qemu/qemu_sbsa/platform.mk
@@ -62,11 +62,10 @@
common/desc_image_load.c
endif
-QEMU_GIC_SOURCES := drivers/arm/gic/v3/gicv3_helpers.c \
- drivers/arm/gic/v3/gicdv3_helpers.c \
- drivers/arm/gic/v3/gicrv3_helpers.c \
- drivers/arm/gic/v3/gicv3_main.c \
- drivers/arm/gic/common/gic_common.c \
+# Include GICv3 driver files
+include drivers/arm/gic/v3/gicv3.mk
+
+QEMU_GIC_SOURCES := ${GICV3_SOURCES} \
plat/common/plat_gicv3.c \
${PLAT_QEMU_COMMON_PATH}/qemu_gicv3.c
diff --git a/plat/rockchip/rk3399/platform.mk b/plat/rockchip/rk3399/platform.mk
index 0dc1840..a658fb2 100644
--- a/plat/rockchip/rk3399/platform.mk
+++ b/plat/rockchip/rk3399/platform.mk
@@ -24,13 +24,10 @@
-I${RK_PLAT_SOC}/include/ \
-I${RK_PLAT_SOC}/include/shared/ \
-RK_GIC_SOURCES := drivers/arm/gic/common/gic_common.c \
- drivers/arm/gic/v3/arm_gicv3_common.c \
- drivers/arm/gic/v3/gic500.c \
- drivers/arm/gic/v3/gicv3_main.c \
- drivers/arm/gic/v3/gicv3_helpers.c \
- drivers/arm/gic/v3/gicdv3_helpers.c \
- drivers/arm/gic/v3/gicrv3_helpers.c \
+# Include GICv3 driver files
+include drivers/arm/gic/v3/gicv3.mk
+
+RK_GIC_SOURCES := ${GICV3_SOURCES} \
plat/common/plat_gicv3.c \
${RK_PLAT}/common/rockchip_gicv3.c
diff --git a/plat/socionext/synquacer/platform.mk b/plat/socionext/synquacer/platform.mk
index 0d9071b..dcd5d31 100644
--- a/plat/socionext/synquacer/platform.mk
+++ b/plat/socionext/synquacer/platform.mk
@@ -30,12 +30,11 @@
drivers/delay_timer/generic_delay_timer.c \
${XLAT_TABLES_LIB_SRCS}
+# Include GICv3 driver files
+include drivers/arm/gic/v3/gicv3.mk
+
BL31_SOURCES += drivers/arm/ccn/ccn.c \
- drivers/arm/gic/common/gic_common.c \
- drivers/arm/gic/v3/gicv3_helpers.c \
- drivers/arm/gic/v3/gicdv3_helpers.c \
- drivers/arm/gic/v3/gicrv3_helpers.c \
- drivers/arm/gic/v3/gicv3_main.c \
+ ${GICV3_SOURCES} \
lib/cpus/aarch64/cortex_a53.S \
plat/common/plat_gicv3.c \
plat/common/plat_psci_common.c \
diff --git a/plat/socionext/uniphier/platform.mk b/plat/socionext/uniphier/platform.mk
index a014f52..0fcef1d 100644
--- a/plat/socionext/uniphier/platform.mk
+++ b/plat/socionext/uniphier/platform.mk
@@ -55,12 +55,11 @@
$(PLAT_PATH)/uniphier_scp.c \
$(PLAT_PATH)/uniphier_usb.c
+# Include GICv3 driver files
+include drivers/arm/gic/v3/gicv3.mk
+
BL31_SOURCES += drivers/arm/cci/cci.c \
- drivers/arm/gic/common/gic_common.c \
- drivers/arm/gic/v3/gicv3_helpers.c \
- drivers/arm/gic/v3/gicdv3_helpers.c \
- drivers/arm/gic/v3/gicrv3_helpers.c \
- drivers/arm/gic/v3/gicv3_main.c \
+ ${GICV3_SOURCES} \
lib/cpus/aarch64/cortex_a53.S \
lib/cpus/aarch64/cortex_a72.S \
plat/common/plat_gicv3.c \
diff --git a/plat/ti/k3/common/plat_common.mk b/plat/ti/k3/common/plat_common.mk
index 587b44b..03d39f1 100644
--- a/plat/ti/k3/common/plat_common.mk
+++ b/plat/ti/k3/common/plat_common.mk
@@ -53,12 +53,11 @@
drivers/ti/uart/aarch64/16550_console.S \
${PLAT_PATH}/common/k3_console.c \
+# Include GICv3 driver files
+include drivers/arm/gic/v3/gicv3.mk
+
K3_GIC_SOURCES += \
- drivers/arm/gic/common/gic_common.c \
- drivers/arm/gic/v3/gicv3_main.c \
- drivers/arm/gic/v3/gicv3_helpers.c \
- drivers/arm/gic/v3/gicdv3_helpers.c \
- drivers/arm/gic/v3/gicrv3_helpers.c \
+ ${GICV3_SOURCES} \
plat/common/plat_gicv3.c \
${PLAT_PATH}/common/k3_gicv3.c \
diff --git a/plat/xilinx/versal/include/versal_def.h b/plat/xilinx/versal/include/versal_def.h
index 9a9b7c0..810e5d8 100644
--- a/plat/xilinx/versal/include/versal_def.h
+++ b/plat/xilinx/versal/include/versal_def.h
@@ -7,6 +7,7 @@
#ifndef VERSAL_DEF_H
#define VERSAL_DEF_H
+#include <plat/arm/common/smccc_def.h>
#include <plat/common/common_def.h>
/* List all consoles */
diff --git a/plat/xilinx/versal/platform.mk b/plat/xilinx/versal/platform.mk
index 5d7fd69..16396dc 100644
--- a/plat/xilinx/versal/platform.mk
+++ b/plat/xilinx/versal/platform.mk
@@ -43,17 +43,14 @@
-Iplat/xilinx/versal/include/ \
-Iplat/xilinx/versal/pm_service/
+# Include GICv3 driver files
+include drivers/arm/gic/v3/gicv3.mk
+
PLAT_BL_COMMON_SOURCES := lib/xlat_tables/xlat_tables_common.c \
lib/xlat_tables/aarch64/xlat_tables.c \
drivers/delay_timer/delay_timer.c \
drivers/delay_timer/generic_delay_timer.c \
- drivers/arm/gic/common/gic_common.c \
- drivers/arm/gic/v3/arm_gicv3_common.c \
- drivers/arm/gic/v3/gic500.c \
- drivers/arm/gic/v3/gicv3_main.c \
- drivers/arm/gic/v3/gicv3_helpers.c \
- drivers/arm/gic/v3/gicdv3_helpers.c \
- drivers/arm/gic/v3/gicrv3_helpers.c \
+ ${GICV3_SOURCES} \
drivers/arm/pl011/aarch64/pl011_console.S \
plat/common/aarch64/crash_console_helpers.S \
plat/arm/common/arm_cci.c \
diff --git a/plat/xilinx/zynqmp/include/zynqmp_def.h b/plat/xilinx/zynqmp/include/zynqmp_def.h
index 5d335d9..5e7254e 100644
--- a/plat/xilinx/zynqmp/include/zynqmp_def.h
+++ b/plat/xilinx/zynqmp/include/zynqmp_def.h
@@ -7,6 +7,7 @@
#ifndef ZYNQMP_DEF_H
#define ZYNQMP_DEF_H
+#include <plat/arm/common/smccc_def.h>
#include <plat/common/common_def.h>
#define ZYNQMP_CONSOLE_ID_cadence 1