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 2021/06/16 04:25:26 UTC

[incubator-nuttx] branch master updated (35a7902 -> 69fce77)

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/incubator-nuttx.git.


    from 35a7902  boards: spresense: Update elf/defconfig
     new 60fb1ad  riscv: Add inline IRQ process functions
     new 69fce77  risc-v/bl602: update firmware to fix undefined up_irq_* symbols when linking

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/risc-v/include/c906/irq.h        | 32 -------------
 arch/risc-v/include/esp32c3/irq.h     | 86 +----------------------------------
 arch/risc-v/include/irq.h             | 63 ++++++++++++++++++++++++-
 arch/risc-v/include/mpfs/irq.h        | 32 -------------
 arch/risc-v/src/bl602/Make.defs       |  6 +--
 arch/risc-v/src/bl602/bl602_irq.c     | 35 --------------
 arch/risc-v/src/c906/c906_irq.c       | 33 --------------
 arch/risc-v/src/esp32c3/esp32c3_irq.c | 25 ++++++++++
 arch/risc-v/src/fe310/fe310_irq.c     | 33 --------------
 arch/risc-v/src/k210/k210_irq.c       | 33 --------------
 arch/risc-v/src/litex/litex_irq.c     | 33 --------------
 arch/risc-v/src/mpfs/mpfs_irq.c       | 33 --------------
 arch/risc-v/src/rv32m1/rv32m1_irq.c   | 35 --------------
 13 files changed, 90 insertions(+), 389 deletions(-)

[incubator-nuttx] 02/02: risc-v/bl602: update firmware to fix undefined up_irq_* symbols when linking

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/incubator-nuttx.git

commit 69fce77718ab564c16a47f4891f0f4e814de068a
Author: Virus.V <vi...@live.com>
AuthorDate: Wed Jun 9 18:40:56 2021 +0800

    risc-v/bl602: update firmware to fix undefined up_irq_* symbols when linking
    
    Signed-off-by: Virus.V <vi...@live.com>
---
 arch/risc-v/src/bl602/Make.defs | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/risc-v/src/bl602/Make.defs b/arch/risc-v/src/bl602/Make.defs
index f0af3cb..213d960 100644
--- a/arch/risc-v/src/bl602/Make.defs
+++ b/arch/risc-v/src/bl602/Make.defs
@@ -52,11 +52,11 @@ CHIP_CSRCS += bl602_idle.c bl602_irq.c bl602_irq_dispatch.c
 CHIP_CSRCS += bl602_serial.c bl602_lowputc.c bl602_tim.c
 CHIP_CSRCS += bl602_start.c bl602_timerisr.c
 
-ifeq ($(CONFIG_I2C),y)                                                                               
+ifeq ($(CONFIG_I2C),y)
 CHIP_CSRCS += bl602_i2c.c
 endif
 
-ifeq ($(CONFIG_SPI),y)                                                                               
+ifeq ($(CONFIG_SPI),y)
 CHIP_CSRCS += bl602_spi.c
 endif
 
@@ -84,7 +84,7 @@ CHIP_CSRCS += bl602_glb.c bl602_gpio.c bl602_hbn.c bl602_systemreset.c
 ifeq ($(CONFIG_BL602_WIRELESS),y)
 WIRELESS_DRV_UNPACK  = bl_blob
 WIRELESS_DRV_VERSION = v1.6.19
-WIRELESS_DRV_ID      = main
+WIRELESS_DRV_ID      = dev_irq
 WIRELESS_DRV_ZIP     = $(WIRELESS_DRV_ID).zip
 WIRELESS_DRV_URL     = https://github.com/bouffalolab/bl_blob/archive
 

[incubator-nuttx] 01/02: riscv: Add inline IRQ process functions

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/incubator-nuttx.git

commit 60fb1adaca72c7867274a47c951197ca2f910096
Author: Dong Heng <do...@espressif.com>
AuthorDate: Fri May 21 13:38:08 2021 +0800

    riscv: Add inline IRQ process functions
    
    Remove functions from RISC-V chips.
---
 arch/risc-v/include/c906/irq.h        | 32 -------------
 arch/risc-v/include/esp32c3/irq.h     | 86 +----------------------------------
 arch/risc-v/include/irq.h             | 63 ++++++++++++++++++++++++-
 arch/risc-v/include/mpfs/irq.h        | 32 -------------
 arch/risc-v/src/bl602/bl602_irq.c     | 35 --------------
 arch/risc-v/src/c906/c906_irq.c       | 33 --------------
 arch/risc-v/src/esp32c3/esp32c3_irq.c | 25 ++++++++++
 arch/risc-v/src/fe310/fe310_irq.c     | 33 --------------
 arch/risc-v/src/k210/k210_irq.c       | 33 --------------
 arch/risc-v/src/litex/litex_irq.c     | 33 --------------
 arch/risc-v/src/mpfs/mpfs_irq.c       | 33 --------------
 arch/risc-v/src/rv32m1/rv32m1_irq.c   | 35 --------------
 12 files changed, 87 insertions(+), 386 deletions(-)

diff --git a/arch/risc-v/include/c906/irq.h b/arch/risc-v/include/c906/irq.h
index a670d7c..b6f852b 100644
--- a/arch/risc-v/include/c906/irq.h
+++ b/arch/risc-v/include/c906/irq.h
@@ -72,36 +72,4 @@
 
 #define NR_IRQS               (C906_IRQ_UART0 + 1)
 
-/****************************************************************************
- * Public Types
- ****************************************************************************/
-
-#ifndef __ASSEMBLY__
-
-/****************************************************************************
- * Public Data
- ****************************************************************************/
-
-#undef EXTERN
-#if defined(__cplusplus)
-#define EXTERN extern "C"
-extern "C"
-{
-#else
-#define EXTERN extern
-#endif
-
-/****************************************************************************
- * Public Function Prototypes
- ****************************************************************************/
-
-EXTERN irqstate_t  up_irq_save(void);
-EXTERN void up_irq_restore(irqstate_t);
-EXTERN irqstate_t up_irq_enable(void);
-
-#undef EXTERN
-#if defined(__cplusplus)
-}
-#endif
-#endif /* __ASSEMBLY__ */
 #endif /* __ARCH_RISCV_INCLUDE_C906_IRQ_H */
diff --git a/arch/risc-v/include/esp32c3/irq.h b/arch/risc-v/include/esp32c3/irq.h
index d7aff5e..89334e2 100644
--- a/arch/risc-v/include/esp32c3/irq.h
+++ b/arch/risc-v/include/esp32c3/irq.h
@@ -27,6 +27,7 @@
 
 #ifndef __ASSEMBLY__
 #  include <arch/csr.h>
+#  include <arch/irq.h>
 #endif
 
 #include <sys/types.h>
@@ -227,89 +228,4 @@
 
 #define NR_IRQS  (RISCV_NIRQ_INTERRUPTS + ESP32C3_NIRQ_PERIPH + ESP32C3_NIRQ_GPIO)
 
-/****************************************************************************
- * Inline functions
- ****************************************************************************/
-
-#ifndef __ASSEMBLY__
-
-/****************************************************************************
- * Name: up_irq_restore
- *
- * Description:
- *   Restore the value of the mstatus register
- *
- ****************************************************************************/
-
-static inline void up_irq_restore(irqstate_t flags)
-{
-  __asm__ __volatile__
-  (
-    "csrw mstatus, %0" : /* no output */ : "r" (flags)
-  );
-}
-
-/****************************************************************************
- * Name: up_irq_save
- *
- * Description:
- *   Disable interrupts and return the previous value of the mstatus register
- *
- ****************************************************************************/
-
-static inline irqstate_t up_irq_save(void)
-{
-  irqstate_t flags;
-
-  /* Read mstatus & clear machine interrupt enable (MIE) in mstatus */
-
-  __asm__ __volatile__
-  (
-    "csrrc %0, mstatus, %1" : "=r" (flags) : "r"(MSTATUS_MIE)
-  );
-
-  /* Return the previous mstatus value so that it can be restored with
-   * up_irq_restore().
-   */
-
-  return flags;
-}
-
-/****************************************************************************
- * Name: up_irq_enable
- *
- * Description:
- *   Return the current interrupt state and enable interrupts
- *
- ****************************************************************************/
-
-static inline irqstate_t up_irq_enable(void)
-{
-  uint32_t flags;
-
-  /* Read mstatus & set machine interrupt enable (MIE) in mstatus */
-
-  __asm__ __volatile__
-  (
-    "csrrs %0, mstatus, %1": "=r" (flags) : "r"(MSTATUS_MIE)
-  );
-
-  return flags;
-}
-
-/****************************************************************************
- * Name: up_irq_disable
- *
- * Description:
- *   Disable interrupts
- *
- ****************************************************************************/
-
-static inline void up_irq_disable(void)
-{
-  up_irq_save();
-}
-
-#endif /* __ASSEMBLY__ */
-
 #endif /* __ARCH_RISCV_INCLUDE_ESP32C3_IRQ_H */
diff --git a/arch/risc-v/include/irq.h b/arch/risc-v/include/irq.h
index 6622f2c..00241ad 100644
--- a/arch/risc-v/include/irq.h
+++ b/arch/risc-v/include/irq.h
@@ -33,6 +33,7 @@
 
 #include <stdint.h>
 #include <nuttx/irq.h>
+#include <arch/csr.h>
 #include <arch/chip/irq.h>
 
 /* Include RISC-V architecture-specific IRQ definitions */
@@ -65,11 +66,69 @@ extern "C"
 #endif
 
 /****************************************************************************
+ * Inline Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: up_irq_save
+ *
+ * Description:
+ *   Disable interrupts and return the previous value of the mstatus register
+ *
+ ****************************************************************************/
+
+static inline irqstate_t up_irq_save(void)
+{
+  irqstate_t flags;
+
+  /* Read mstatus & clear machine interrupt enable (MIE) in mstatus */
+
+  __asm__ __volatile__
+    (
+      "csrrc %0, mstatus, %1\n"
+      : "=r" (flags)
+      : "r"(MSTATUS_MIE)
+      : "memory"
+    );
+
+  /* Return the previous mstatus value so that it can be restored with
+   * up_irq_restore().
+   */
+
+  return flags;
+}
+
+/****************************************************************************
+ * Name: up_irq_restore
+ *
+ * Description:
+ *   Restore the value of the mstatus register
+ *
+ ****************************************************************************/
+
+static inline void up_irq_restore(irqstate_t flags)
+{
+  __asm__ __volatile__
+    (
+      "csrw mstatus, %0\n"
+      : /* no output */
+      : "r" (flags)
+      : "memory"
+    );
+}
+
+/****************************************************************************
  * Public Function Prototypes
  ****************************************************************************/
 
-EXTERN irqstate_t  up_irq_save(void);
-EXTERN void up_irq_restore(irqstate_t);
+/****************************************************************************
+ * Name: up_irq_enable
+ *
+ * Description:
+ *   Return the current interrupt state and enable interrupts
+ *
+ ****************************************************************************/
+
 EXTERN irqstate_t up_irq_enable(void);
 
 #undef EXTERN
diff --git a/arch/risc-v/include/mpfs/irq.h b/arch/risc-v/include/mpfs/irq.h
index 89c7878..4ee52ac 100755
--- a/arch/risc-v/include/mpfs/irq.h
+++ b/arch/risc-v/include/mpfs/irq.h
@@ -305,36 +305,4 @@
 
 #define NR_IRQS               (MPFS_IRQ_BUS_ERROR_UNIT_HART_4 + 1)
 
-/****************************************************************************
- * Public Types
- ****************************************************************************/
-
-#ifndef __ASSEMBLY__
-
-/****************************************************************************
- * Public Data
- ****************************************************************************/
-
-#undef EXTERN
-#if defined(__cplusplus)
-#define EXTERN extern "C"
-extern "C"
-{
-#else
-#define EXTERN extern
-#endif
-
-/****************************************************************************
- * Public Function Prototypes
- ****************************************************************************/
-
-EXTERN irqstate_t  up_irq_save(void);
-EXTERN void up_irq_restore(irqstate_t);
-EXTERN irqstate_t up_irq_enable(void);
-
-#undef EXTERN
-#if defined(__cplusplus)
-}
-#endif
-#endif /* __ASSEMBLY__ */
 #endif /* __ARCH_RISCV_INCLUDE_MPFS_IRQ_H */
diff --git a/arch/risc-v/src/bl602/bl602_irq.c b/arch/risc-v/src/bl602/bl602_irq.c
index b5476f2..f59391c 100644
--- a/arch/risc-v/src/bl602/bl602_irq.c
+++ b/arch/risc-v/src/bl602/bl602_irq.c
@@ -204,41 +204,6 @@ void riscv_ack_irq(int irq)
 }
 
 /****************************************************************************
- * Name: up_irq_save
- *
- * Description:
- *   Return the current interrupt state and disable interrupts
- *
- ****************************************************************************/
-
-irqstate_t up_irq_save(void)
-{
-  uint32_t oldstat;
-
-  /* Read mstatus & clear machine interrupt enable (MIE) in mstatus */
-
-  asm volatile("csrrc %0, mstatus, %1" : "=r"(oldstat) : "r"(MSTATUS_MIE));
-  return oldstat;
-}
-
-/****************************************************************************
- * Name: up_irq_restore
- *
- * Description:
- *   Restore previous IRQ mask state
- *
- ****************************************************************************/
-
-void up_irq_restore(irqstate_t flags)
-{
-  /* Write flags to mstatus */
-
-  asm volatile("csrw mstatus, %0"
-               : /* no output */
-               : "r"(flags));
-}
-
-/****************************************************************************
  * Name: up_irq_enable
  *
  * Description:
diff --git a/arch/risc-v/src/c906/c906_irq.c b/arch/risc-v/src/c906/c906_irq.c
index f03d65f..8db7060 100644
--- a/arch/risc-v/src/c906/c906_irq.c
+++ b/arch/risc-v/src/c906/c906_irq.c
@@ -235,39 +235,6 @@ void riscv_ack_irq(int irq)
 }
 
 /****************************************************************************
- * Name: up_irq_save
- *
- * Description:
- *   Return the current interrupt state and disable interrupts
- *
- ****************************************************************************/
-
-irqstate_t up_irq_save(void)
-{
-  uint64_t oldstat;
-
-  /* Read mstatus & clear machine interrupt enable (MIE) in mstatus */
-
-  asm volatile ("csrrc %0, mstatus, %1": "=r" (oldstat) : "r"(MSTATUS_MIE));
-  return oldstat;
-}
-
-/****************************************************************************
- * Name: up_irq_restore
- *
- * Description:
- *   Restore previous IRQ mask state
- *
- ****************************************************************************/
-
-void up_irq_restore(irqstate_t flags)
-{
-  /* Write flags to mstatus */
-
-  asm volatile("csrw mstatus, %0" : /* no output */ : "r" (flags));
-}
-
-/****************************************************************************
  * Name: up_irq_enable
  *
  * Description:
diff --git a/arch/risc-v/src/esp32c3/esp32c3_irq.c b/arch/risc-v/src/esp32c3/esp32c3_irq.c
index 17a9681..734a74e 100644
--- a/arch/risc-v/src/esp32c3/esp32c3_irq.c
+++ b/arch/risc-v/src/esp32c3/esp32c3_irq.c
@@ -416,3 +416,28 @@ IRAM_ATTR uint32_t *esp32c3_dispatch_irq(uint32_t mcause, uint32_t *regs)
 
   return regs;
 }
+
+/****************************************************************************
+ * Name: up_irq_enable
+ *
+ * Description:
+ *   Return the current interrupt state and enable interrupts
+ *
+ ****************************************************************************/
+
+irqstate_t up_irq_enable(void)
+{
+  uint32_t flags;
+
+  /* Read mstatus & set machine interrupt enable (MIE) in mstatus */
+
+  __asm__ __volatile__
+    (
+      "csrrs %0, mstatus, %1\n"
+      : "=r" (flags)
+      : "r"(MSTATUS_MIE)
+      : "memory"
+    );
+
+  return flags;
+}
diff --git a/arch/risc-v/src/fe310/fe310_irq.c b/arch/risc-v/src/fe310/fe310_irq.c
index c27b249..258bb32 100644
--- a/arch/risc-v/src/fe310/fe310_irq.c
+++ b/arch/risc-v/src/fe310/fe310_irq.c
@@ -199,39 +199,6 @@ void riscv_ack_irq(int irq)
 }
 
 /****************************************************************************
- * Name: up_irq_save
- *
- * Description:
- *   Return the current interrupt state and disable interrupts
- *
- ****************************************************************************/
-
-irqstate_t up_irq_save(void)
-{
-  uint32_t oldstat;
-
-  /* Read mstatus & clear machine interrupt enable (MIE) in mstatus */
-
-  asm volatile ("csrrc %0, mstatus, %1": "=r" (oldstat) : "r"(MSTATUS_MIE));
-  return oldstat;
-}
-
-/****************************************************************************
- * Name: up_irq_restore
- *
- * Description:
- *   Restore previous IRQ mask state
- *
- ****************************************************************************/
-
-void up_irq_restore(irqstate_t flags)
-{
-  /* Write flags to mstatus */
-
-  asm volatile("csrw mstatus, %0" : /* no output */ : "r" (flags));
-}
-
-/****************************************************************************
  * Name: up_irq_enable
  *
  * Description:
diff --git a/arch/risc-v/src/k210/k210_irq.c b/arch/risc-v/src/k210/k210_irq.c
index 4dd0424..2ebaa5b 100644
--- a/arch/risc-v/src/k210/k210_irq.c
+++ b/arch/risc-v/src/k210/k210_irq.c
@@ -255,39 +255,6 @@ void riscv_ack_irq(int irq)
 }
 
 /****************************************************************************
- * Name: up_irq_save
- *
- * Description:
- *   Return the current interrupt state and disable interrupts
- *
- ****************************************************************************/
-
-irqstate_t up_irq_save(void)
-{
-  uint64_t oldstat;
-
-  /* Read mstatus & clear machine interrupt enable (MIE) in mstatus */
-
-  asm volatile ("csrrc %0, mstatus, %1": "=r" (oldstat) : "r"(MSTATUS_MIE));
-  return oldstat;
-}
-
-/****************************************************************************
- * Name: up_irq_restore
- *
- * Description:
- *   Restore previous IRQ mask state
- *
- ****************************************************************************/
-
-void up_irq_restore(irqstate_t flags)
-{
-  /* Write flags to mstatus */
-
-  asm volatile("csrw mstatus, %0" : /* no output */ : "r" (flags));
-}
-
-/****************************************************************************
  * Name: up_irq_enable
  *
  * Description:
diff --git a/arch/risc-v/src/litex/litex_irq.c b/arch/risc-v/src/litex/litex_irq.c
index cc9faa4..0751131 100644
--- a/arch/risc-v/src/litex/litex_irq.c
+++ b/arch/risc-v/src/litex/litex_irq.c
@@ -204,39 +204,6 @@ void riscv_ack_irq(int irq)
 }
 
 /****************************************************************************
- * Name: up_irq_save
- *
- * Description:
- *   Return the current interrupt state and disable interrupts
- *
- ****************************************************************************/
-
-irqstate_t up_irq_save(void)
-{
-  uint32_t oldstat;
-
-  /* Read mstatus & clear machine interrupt enable (MIE) in mstatus */
-
-  asm volatile ("csrrc %0, mstatus, %1": "=r" (oldstat) : "r"(MSTATUS_MIE));
-  return oldstat;
-}
-
-/****************************************************************************
- * Name: up_irq_restore
- *
- * Description:
- *   Restore previous IRQ mask state
- *
- ****************************************************************************/
-
-void up_irq_restore(irqstate_t flags)
-{
-  /* Write flags to mstatus */
-
-  asm volatile("csrw mstatus, %0" : /* no output */ : "r" (flags));
-}
-
-/****************************************************************************
  * Name: up_irq_enable
  *
  * Description:
diff --git a/arch/risc-v/src/mpfs/mpfs_irq.c b/arch/risc-v/src/mpfs/mpfs_irq.c
index 159188c..cde6115 100755
--- a/arch/risc-v/src/mpfs/mpfs_irq.c
+++ b/arch/risc-v/src/mpfs/mpfs_irq.c
@@ -262,39 +262,6 @@ void riscv_ack_irq(int irq)
 }
 
 /****************************************************************************
- * Name: up_irq_save
- *
- * Description:
- *   Return the current interrupt state and disable interrupts
- *
- ****************************************************************************/
-
-irqstate_t up_irq_save(void)
-{
-  uint64_t oldstat;
-
-  /* Read mstatus & clear machine interrupt enable (MIE) in mstatus */
-
-  asm volatile ("csrrc %0, mstatus, %1": "=r" (oldstat) : "r"(MSTATUS_MIE));
-  return oldstat;
-}
-
-/****************************************************************************
- * Name: up_irq_restore
- *
- * Description:
- *   Restore previous IRQ mask state
- *
- ****************************************************************************/
-
-void up_irq_restore(irqstate_t flags)
-{
-  /* Write flags to mstatus */
-
-  asm volatile("csrw mstatus, %0" : /* no output */ : "r" (flags));
-}
-
-/****************************************************************************
  * Name: up_irq_enable
  *
  * Description:
diff --git a/arch/risc-v/src/rv32m1/rv32m1_irq.c b/arch/risc-v/src/rv32m1/rv32m1_irq.c
index 7d71b56..b09abf4 100644
--- a/arch/risc-v/src/rv32m1/rv32m1_irq.c
+++ b/arch/risc-v/src/rv32m1/rv32m1_irq.c
@@ -245,41 +245,6 @@ void riscv_ack_irq(int irq)
 }
 
 /****************************************************************************
- * Name: up_irq_save
- *
- * Description:
- *   Return the current interrupt state and disable interrupts
- *
- ****************************************************************************/
-
-LOCATE_ITCM
-irqstate_t up_irq_save(void)
-{
-  uint32_t oldstat;
-
-  /* Read mstatus & clear machine interrupt enable (MIE) in mstatus */
-
-  asm volatile ("csrrc %0, mstatus, %1": "=r" (oldstat) : "r"(MSTATUS_MIE));
-  return oldstat;
-}
-
-/****************************************************************************
- * Name: up_irq_restore
- *
- * Description:
- *   Restore previous IRQ mask state
- *
- ****************************************************************************/
-
-LOCATE_ITCM
-void up_irq_restore(irqstate_t flags)
-{
-  /* Write flags to mstatus */
-
-  asm volatile("csrw mstatus, %0" : /* no output */ : "r" (flags));
-}
-
-/****************************************************************************
  * Name: up_irq_enable
  *
  * Description: