]> git.baikalelectronics.ru Git - arm-tf.git/commitdiff
feat(spmd): introduce platform handler for Group0 interrupt
authorMadhukar Pappireddy <madhukar.pappireddy@arm.com>
Thu, 2 Mar 2023 22:33:25 +0000 (16:33 -0600)
committerMadhukar Pappireddy <madhukar.pappireddy@arm.com>
Mon, 1 May 2023 18:29:46 +0000 (13:29 -0500)
This patch introduces a handler for FVP platform to triage Group0
secure interrupts. Currently, it is empty but serves as a
placeholder for future Group0 interrupt sources.

Moreover, this patch also provides a dummy implementation of the
above mentioned platform hook for QEMU, corstone100, n1sdp and
hikey960 ports.

Change-Id: I01d3451408f47ac313b0af74046cce89f89b85bb
Signed-off-by: Madhukar Pappireddy <madhukar.pappireddy@arm.com>
plat/arm/board/corstone1000/common/corstone1000_bl31_setup.c [new file with mode: 0644]
plat/arm/board/corstone1000/platform.mk
plat/arm/board/fvp/fvp_spmd.c [new file with mode: 0644]
plat/arm/board/fvp/platform.mk
plat/arm/board/n1sdp/n1sdp_bl31_setup.c
plat/hisilicon/hikey960/hikey960_bl31_setup.c
plat/qemu/common/qemu_common.c
services/std_svc/spmd/spmd_private.h

diff --git a/plat/arm/board/corstone1000/common/corstone1000_bl31_setup.c b/plat/arm/board/corstone1000/common/corstone1000_bl31_setup.c
new file mode 100644 (file)
index 0000000..b6765a6
--- /dev/null
@@ -0,0 +1,18 @@
+/*
+ * Copyright (c) 2023, Arm Limited and Contributors. All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+#include <stdint.h>
+
+#if defined(SPD_spmd)
+/*
+ * A dummy implementation of the platform handler for Group0 secure interrupt.
+ */
+int plat_spmd_handle_group0_interrupt(uint32_t intid)
+{
+       (void)intid;
+       return -1;
+}
+#endif /*defined(SPD_spmd)*/
index d891691423cbfdb1732d17506d38be6e3aad5679..3edffe08785976b75386b6d1eb49564a0b75316f 100644 (file)
@@ -56,6 +56,7 @@ BL31_SOURCES  +=      drivers/cfi/v2m/v2m_flash.c                             \
                        plat/arm/board/corstone1000/common/corstone1000_security.c              \
                        plat/arm/board/corstone1000/common/corstone1000_plat.c          \
                        plat/arm/board/corstone1000/common/corstone1000_pm.c            \
+                       plat/arm/board/corstone1000/common/corstone1000_bl31_setup.c    \
                        ${CORSTONE1000_CPU_LIBS}                                        \
                        ${CORSTONE1000_GIC_SOURCES}
 
diff --git a/plat/arm/board/fvp/fvp_spmd.c b/plat/arm/board/fvp/fvp_spmd.c
new file mode 100644 (file)
index 0000000..8213e5e
--- /dev/null
@@ -0,0 +1,17 @@
+/*
+ * Copyright (c) 2023, Arm Limited and Contributors. All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+#include <stdint.h>
+
+int plat_spmd_handle_group0_interrupt(uint32_t intid)
+{
+       /*
+        * As of now, there are no sources of Group0 secure interrupt enabled
+        * for FVP.
+        */
+       (void)intid;
+       return -1;
+}
index af082ba0c7e6787f7273d622a51a6c938483b81a..64d5c3f646baaba176f161b9f51c2dd2fcf96610 100644 (file)
@@ -510,3 +510,7 @@ ifeq (${PLATFORM_TEST_EA_FFH}, 1)
     endif
 BL31_SOURCES   += plat/arm/board/fvp/aarch64/fvp_ea.c
 endif
+
+ifeq (${SPD},spmd)
+BL31_SOURCES   +=      plat/arm/board/fvp/fvp_spmd.c
+endif
index 4941a4bd439f1a08f98bdfdd0e76c76cdd6b80d6..6809541a6392148ee786826b5e8bc38208d1c7de 100644 (file)
@@ -159,3 +159,14 @@ void bl31_platform_setup(void)
        if ((plat_info.multichip_mode) && (plat_info.remote_ddr_size != 0))
                remote_dmc_ecc_setup(plat_info.remote_ddr_size);
 }
+
+#if defined(SPD_spmd)
+/*
+ * A dummy implementation of the platform handler for Group0 secure interrupt.
+ */
+int plat_spmd_handle_group0_interrupt(uint32_t intid)
+{
+       (void)intid;
+       return -1;
+}
+#endif /*defined(SPD_spmd)*/
index 50751ee38fcc91dd2a0482e76e28b089559bfcf8..1d7bc94a6eca35b275a7c24cca98cde2ec787507 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017-2022, ARM Limited and Contributors. All rights reserved.
+ * Copyright (c) 2017-2023, Arm Limited and Contributors. All rights reserved.
  *
  * SPDX-License-Identifier: BSD-3-Clause
  */
@@ -245,6 +245,15 @@ static uint64_t hikey_debug_fiq_handler(uint32_t id,
 
        return 0;
 }
+#elif defined(SPD_spmd) && (SPMD_SPM_AT_SEL2 == 1)
+/*
+ * A dummy implementation of the platform handler for Group0 secure interrupt.
+ */
+int plat_spmd_handle_group0_interrupt(uint32_t intid)
+{
+       (void)intid;
+       return -1;
+}
 #endif
 
 void bl31_plat_runtime_setup(void)
index 935ba7a7799259a917e61cd5d9db5b1bdaa5c2b9..9aec213d2f1760e4b43c1f152b1d8b0114b76337 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * Copyright (c) 2015-2022, ARM Limited and Contributors. All rights reserved.
+ * Copyright (c) 2015-2023, Arm Limited and Contributors. All rights reserved.
  *
  * SPDX-License-Identifier: BSD-3-Clause
  */
@@ -162,3 +162,14 @@ int plat_spmc_shmem_reclaim(struct ffa_mtd *desc)
        return 0;
 }
 #endif
+
+#if defined(SPD_spmd) && (SPMD_SPM_AT_SEL2 == 1)
+/*
+ * A dummy implementation of the platform handler for Group0 secure interrupt.
+ */
+int plat_spmd_handle_group0_interrupt(uint32_t intid)
+{
+       (void)intid;
+       return -1;
+}
+#endif /*defined(SPD_spmd) && (SPMD_SPM_AT_SEL2 == 1)*/
index d21a622fdd130c2ae2532a9d2fb39674695bf81d..ff6942e41861d6e22499ed20cbcbce98bbd703a3 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2019-2022, ARM Limited and Contributors. All rights reserved.
+ * Copyright (c) 2019-2023, Arm Limited and Contributors. All rights reserved.
  *
  * SPDX-License-Identifier: BSD-3-Clause
  */
@@ -93,6 +93,13 @@ spmd_spm_core_context_t *spmd_get_context(void);
 int spmd_pm_secondary_ep_register(uintptr_t entry_point);
 bool spmd_check_address_in_binary_image(uint64_t address);
 
+/*
+ * Platform hook in EL3 firmware to handle for Group0 secure interrupt.
+ * Return values:
+ *  0 = success
+ *  otherwise it returns a negative value
+ */
+int plat_spmd_handle_group0_interrupt(uint32_t id);
 #endif /* __ASSEMBLER__ */
 
 #endif /* SPMD_PRIVATE_H */