You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2024/10/14 09:58:19 UTC

(nuttx) branch master updated (3e2e2132ca -> 7288a8d000)

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

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


    from 3e2e2132ca arch/x86_64:Adjust the position of the nm command to execute it after NuttX is generated
     new 83c483c1b4 arch/armv8-a: new config to set SPIs Configuration to edge-triggered
     new 7288a8d000 arch/arm64: add support to config SPI interrupt affinity routing to CPU0 by default

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 arch/arm64/Kconfig                  | 17 +++++++++++++++++
 arch/arm64/src/common/arm64_arch.h  |  2 +-
 arch/arm64/src/common/arm64_gicv3.c | 21 +++++++++++++++++++++
 3 files changed, 39 insertions(+), 1 deletion(-)


(nuttx) 01/02: arch/armv8-a: new config to set SPIs Configuration to edge-triggered

Posted by xi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 83c483c1b456a9a2fe62f45b972baea7f6743a3b
Author: chao an <an...@lixiang.com>
AuthorDate: Mon Oct 14 12:27:22 2024 +0800

    arch/armv8-a: new config to set SPIs Configuration to edge-triggered
    
    Configure all SPIs(Shared Peripheral Interrupts) as edge-triggered by default
    
    Signed-off-by: chao an <an...@lixiang.com>
---
 arch/arm64/Kconfig                  | 10 ++++++++++
 arch/arm64/src/common/arm64_gicv3.c |  8 ++++++++
 2 files changed, 18 insertions(+)

diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
index 3cea820589..8aa8681902 100644
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -353,6 +353,16 @@ config ARM64_GICV2_LEGACY_IRQ0
 
 endif
 
+if ARM64_GIC_VERSION = 3
+
+config ARM64_GICV3_SPI_EDGE
+	bool "Configure all SPIs(Shared Peripheral Interrupts) as edge-triggered by default"
+	default n
+	---help---
+		Configure all SPIs(Shared Peripheral Interrupts) as edge-triggered by default.
+
+endif
+
 config ARM64_SEMIHOSTING_HOSTFS
 	bool "Semihosting HostFS"
 	depends on FS_HOSTFS
diff --git a/arch/arm64/src/common/arm64_gicv3.c b/arch/arm64/src/common/arm64_gicv3.c
index 9a8b77b4c6..9b0d2985fb 100644
--- a/arch/arm64/src/common/arm64_gicv3.c
+++ b/arch/arm64/src/common/arm64_gicv3.c
@@ -607,7 +607,15 @@ static void gicv3_dist_init(void)
        intid += GIC_NUM_CFG_PER_REG)
     {
       idx = intid / GIC_NUM_CFG_PER_REG;
+#ifdef CONFIG_ARM64_GICV3_SPI_EDGE
+      /* Configure all SPIs as edge-triggered by default */
+
+      putreg32(0xaaaaaaaa, ICFGR(base, idx));
+#else
+      /* Configure all SPIs as level-sensitive by default */
+
       putreg32(0, ICFGR(base, idx));
+#endif
     }
 
   /* TODO: Some arrch64 Cortex-A core maybe without security state


(nuttx) 02/02: arch/arm64: add support to config SPI interrupt affinity routing to CPU0 by default

Posted by xi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 7288a8d0009460234e7f9166ef1a1e5509c41447
Author: chao an <an...@lixiang.com>
AuthorDate: Mon Oct 14 12:33:50 2024 +0800

    arch/arm64: add support to config SPI interrupt affinity routing to CPU0 by default
    
    Signed-off-by: chao an <an...@lixiang.com>
---
 arch/arm64/Kconfig                  |  7 +++++++
 arch/arm64/src/common/arm64_arch.h  |  2 +-
 arch/arm64/src/common/arm64_gicv3.c | 13 +++++++++++++
 3 files changed, 21 insertions(+), 1 deletion(-)

diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
index 8aa8681902..fc30a757dc 100644
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -361,6 +361,13 @@ config ARM64_GICV3_SPI_EDGE
 	---help---
 		Configure all SPIs(Shared Peripheral Interrupts) as edge-triggered by default.
 
+config ARM64_GICV3_SPI_ROUTING_CPU0
+	bool "Configure SPI interrupt affinity routing to CPU0 by default"
+	default y if SMP
+	default n
+	---help---
+		Configure SPI interrupt affinity routing to CPU0 by default.
+
 endif
 
 config ARM64_SEMIHOSTING_HOSTFS
diff --git a/arch/arm64/src/common/arm64_arch.h b/arch/arm64/src/common/arm64_arch.h
index fbd47f5437..fdbd74a55d 100644
--- a/arch/arm64/src/common/arm64_arch.h
+++ b/arch/arm64/src/common/arm64_arch.h
@@ -506,7 +506,7 @@ void arm64_cpu_enable(void);
 #ifdef CONFIG_SMP
 uint64_t arm64_get_mpid(int cpu);
 #else
-#  define arm64_get_mpid(cpu) GET_MPIDR()
+#  define arm64_get_mpid(cpu) (GET_MPIDR() & MPIDR_ID_MASK)
 #endif /* CONFIG_SMP */
 
 /****************************************************************************
diff --git a/arch/arm64/src/common/arm64_gicv3.c b/arch/arm64/src/common/arm64_gicv3.c
index 9b0d2985fb..3e52e17bfe 100644
--- a/arch/arm64/src/common/arm64_gicv3.c
+++ b/arch/arm64/src/common/arm64_gicv3.c
@@ -254,10 +254,12 @@ void arm64_gic_irq_enable(unsigned int intid)
    * SPI's affinity, now set it to be the PE on which it is enabled.
    */
 
+#ifndef CONFIG_ARM64_GICV3_SPI_ROUTING_CPU0
   if (GIC_IS_SPI(intid))
     {
       arm64_gic_write_irouter((GET_MPIDR() & MPIDR_ID_MASK), intid);
     }
+#endif
 
   putreg32(mask, ISENABLER(GET_DIST_BASE(intid), idx));
 }
@@ -618,6 +620,17 @@ static void gicv3_dist_init(void)
 #endif
     }
 
+  /* Configure SPI interrupt affinity routing to CPU0 */
+
+#ifdef CONFIG_ARM64_GICV3_SPI_ROUTING_CPU0
+  uint64_t mpid = arm64_get_mpid(0);
+
+  for (intid = GIC_SPI_INT_BASE; intid < num_ints; intid++)
+    {
+      putreg64(mpid, IROUTER(base, intid));
+    }
+#endif
+
   /* TODO: Some arrch64 Cortex-A core maybe without security state
    * it has different GIC configure with standard arrch64 A or R core
    */