This is an automated email from the ASF dual-hosted git repository.

acassis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit a4c47746124e120e933693eb86dc1c54b499fa07
Author: raiden00pl <[email protected]>
AuthorDate: Thu Jun 11 20:14:46 2026 +0200

    arch/nrf91: grant GPIOTE1 to the non-secure domain
    
    Add CONFIG_NRF91_GPIOTE1_NS so the secure firmware can hand the non-secure
    GPIOTE instance to the application, allowing a non-secure app to use GPIO
    interrupts.
    
    Signed-off-by: raiden00pl <[email protected]>
---
 arch/arm/src/nrf91/Kconfig     | 7 +++++++
 arch/arm/src/nrf91/nrf91_spu.c | 5 +++++
 2 files changed, 12 insertions(+)

diff --git a/arch/arm/src/nrf91/Kconfig b/arch/arm/src/nrf91/Kconfig
index 5e9d77b84e9..13591ed1720 100644
--- a/arch/arm/src/nrf91/Kconfig
+++ b/arch/arm/src/nrf91/Kconfig
@@ -258,6 +258,13 @@ config NRF91_GPIO0_NS
        bool "GPIO0 non-secure"
        default n
 
+config NRF91_GPIOTE1_NS
+       bool "GPIOTE1 non-secure"
+       default n
+       ---help---
+               Grant the non-secure GPIOTE instance (GPIOTE1) to the non-secure
+               domain, so a non-secure application can use GPIO interrupts.
+
 config NRF91_NVMC_NS
        bool "NVMC non-secure"
        default n
diff --git a/arch/arm/src/nrf91/nrf91_spu.c b/arch/arm/src/nrf91/nrf91_spu.c
index 373fe8eedd8..33317de780e 100644
--- a/arch/arm/src/nrf91/nrf91_spu.c
+++ b/arch/arm/src/nrf91/nrf91_spu.c
@@ -87,6 +87,11 @@ static void nrf91_spu_periph(void)
               SPU_PERIPHID_PERM_SECATTR, 0);
 #endif
 
+#ifdef CONFIG_NRF91_GPIOTE1_NS
+  modifyreg32(NRF91_SPU_PERIPHIDPERM(NRF91_GPIOTE1_ID),
+              SPU_PERIPHID_PERM_SECATTR, 0);
+#endif
+
 #ifdef CONFIG_NRF91_NVMC_NS
   modifyreg32(NRF91_SPU_PERIPHIDPERM(NRF91_NVMC_ID),
               SPU_PERIPHID_PERM_SECATTR, 0);

Reply via email to