ARM platforms: Allow platforms to define SDEI events
authorJeenu Viswambharan <jeenu.viswambharan@arm.com>
Fri, 8 Dec 2017 10:38:24 +0000 (10:38 +0000)
committerJeenu Viswambharan <jeenu.viswambharan@arm.com>
Tue, 19 Dec 2017 08:55:12 +0000 (08:55 +0000)
With this patch, ARM platforms are expected to define the macros
PLAT_ARM_SDEI_PRIVATE_EVENTS and PLAT_ARM_SDEI_SHARED_EVENTS as a list
of private and shared events, respectively. This allows for individual
platforms to define their own events.

Change-Id: I66851fdcbff83fd9568c2777ade9eb12df284b49
Signed-off-by: Jeenu Viswambharan <jeenu.viswambharan@arm.com>
include/plat/arm/common/arm_def.h
plat/arm/board/fvp/include/platform_def.h
plat/arm/board/juno/include/platform_def.h
plat/arm/common/aarch64/arm_sdei.c

index 7887525992705e9811fe8aeda876c33a64d01d82..f38c357bc3836955f0f262f127859016057bb56c 100644 (file)
 #define ARM_SDEI_DS_EVENT_1            2001
 #define ARM_SDEI_DS_EVENT_2            2002
 
+#define ARM_SDEI_PRIVATE_EVENTS \
+       SDEI_DEFINE_EVENT_0(ARM_SDEI_SGI), \
+       SDEI_PRIVATE_EVENT(ARM_SDEI_DP_EVENT_0, SDEI_DYN_IRQ, SDEI_MAPF_DYNAMIC), \
+       SDEI_PRIVATE_EVENT(ARM_SDEI_DP_EVENT_1, SDEI_DYN_IRQ, SDEI_MAPF_DYNAMIC), \
+       SDEI_PRIVATE_EVENT(ARM_SDEI_DP_EVENT_2, SDEI_DYN_IRQ, SDEI_MAPF_DYNAMIC)
+
+#define ARM_SDEI_SHARED_EVENTS \
+       SDEI_SHARED_EVENT(ARM_SDEI_DS_EVENT_0, SDEI_DYN_IRQ, SDEI_MAPF_DYNAMIC), \
+       SDEI_SHARED_EVENT(ARM_SDEI_DS_EVENT_1, SDEI_DYN_IRQ, SDEI_MAPF_DYNAMIC), \
+       SDEI_SHARED_EVENT(ARM_SDEI_DS_EVENT_2, SDEI_DYN_IRQ, SDEI_MAPF_DYNAMIC)
+
 #endif /* __ARM_DEF_H__ */
index 7080fc302e6e72997656c7c539c64b1a29eea747..4ac08504c036b8f22ce5540170f0f1815145d06e 100644 (file)
 
 #define PLAT_ARM_G0_IRQ_PROPS(grp)     ARM_G0_IRQ_PROPS(grp)
 
+#define PLAT_ARM_PRIVATE_SDEI_EVENTS   ARM_SDEI_PRIVATE_EVENTS
+#define PLAT_ARM_SHARED_SDEI_EVENTS    ARM_SDEI_SHARED_EVENTS
+
 #endif /* __PLATFORM_DEF_H__ */
index e475ece5a4917914a6f029b1c2dabff48c04dc18..cac47f72f9b6100e478453e8aaa8daf20cd0fc73 100644 (file)
 /* CSS SoC NIC-400 Global Programmers View (GPV) */
 #define PLAT_SOC_CSS_NIC400_BASE       0x2a000000
 
+#define PLAT_ARM_PRIVATE_SDEI_EVENTS   ARM_SDEI_PRIVATE_EVENTS
+#define PLAT_ARM_SHARED_SDEI_EVENTS    ARM_SDEI_SHARED_EVENTS
+
 #endif /* __PLATFORM_DEF_H__ */
index 514800c3eedf0db0e7b2ed7a0e2a665c35a2964a..687b21d43bb3dd8a89da7a3a1cf5ae9f25fb560b 100644 (file)
 #include <sdei.h>
 
 /* Private event mappings */
-static sdei_ev_map_t arm_private_sdei[] = {
-       /* Event 0 */
-       SDEI_DEFINE_EVENT_0(ARM_SDEI_SGI),
-
-       /* Dynamic private events */
-       SDEI_PRIVATE_EVENT(ARM_SDEI_DP_EVENT_0, SDEI_DYN_IRQ, SDEI_MAPF_DYNAMIC),
-       SDEI_PRIVATE_EVENT(ARM_SDEI_DP_EVENT_1, SDEI_DYN_IRQ, SDEI_MAPF_DYNAMIC),
-       SDEI_PRIVATE_EVENT(ARM_SDEI_DP_EVENT_2, SDEI_DYN_IRQ, SDEI_MAPF_DYNAMIC),
+static sdei_ev_map_t arm_sdei_private[] = {
+       PLAT_ARM_PRIVATE_SDEI_EVENTS
 };
 
 /* Shared event mappings */
-static sdei_ev_map_t arm_shared_sdei[] = {
-       /* Dynamic shared events */
-       SDEI_SHARED_EVENT(ARM_SDEI_DS_EVENT_0, SDEI_DYN_IRQ, SDEI_MAPF_DYNAMIC),
-       SDEI_SHARED_EVENT(ARM_SDEI_DS_EVENT_1, SDEI_DYN_IRQ, SDEI_MAPF_DYNAMIC),
-       SDEI_SHARED_EVENT(ARM_SDEI_DS_EVENT_2, SDEI_DYN_IRQ, SDEI_MAPF_DYNAMIC),
+static sdei_ev_map_t arm_sdei_shared[] = {
+       PLAT_ARM_SHARED_SDEI_EVENTS
 };
 
 /* Export ARM SDEI events */
-REGISTER_SDEI_MAP(arm_private_sdei, arm_shared_sdei);
+REGISTER_SDEI_MAP(arm_sdei_private, arm_sdei_shared);