You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by ma...@apache.org on 2020/10/08 00:29:07 UTC

[incubator-nuttx] branch master updated (6232e7f -> 605a49e)

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

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


    from 6232e7f  arch: esp32: Fix crash on startup
     new 0fdf9c7  arch/xtensa/src/esp32/esp32_psram.c: Adapt configgpio to the latest change.
     new 605a49e  arch/xtensa/src/esp/esp32/esp32_gpio.c: Fix the function's mask test condition and the functions' values.

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/xtensa/src/esp32/esp32_gpio.c  |  6 +++---
 arch/xtensa/src/esp32/esp32_gpio.h  | 12 ++++++------
 arch/xtensa/src/esp32/esp32_psram.c | 22 +++++++++++-----------
 3 files changed, 20 insertions(+), 20 deletions(-)


[incubator-nuttx] 01/02: arch/xtensa/src/esp32/esp32_psram.c: Adapt configgpio to the latest change.

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

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

commit 0fdf9c7368fc29acc672fdf70fdf5d260340d19b
Author: Abdelatif Guettouche <ab...@espressif.com>
AuthorDate: Thu Oct 8 00:47:12 2020 +0100

    arch/xtensa/src/esp32/esp32_psram.c: Adapt configgpio to the latest
    change.
    
    Signed-off-by: Abdelatif Guettouche <ab...@espressif.com>
---
 arch/xtensa/src/esp32/esp32_psram.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/arch/xtensa/src/esp32/esp32_psram.c b/arch/xtensa/src/esp32/esp32_psram.c
index 9c28c9d..d22c56f 100644
--- a/arch/xtensa/src/esp32/esp32_psram.c
+++ b/arch/xtensa/src/esp32/esp32_psram.c
@@ -1191,24 +1191,24 @@ static void IRAM_ATTR psram_gpio_config(psram_io_t *psram_io,
     {
       /* flash clock signal should come from IO MUX. */
 
-      esp32_configgpio(psram_io->flash_clk_io, OUTPUT_FUNCTION_1);
+      esp32_configgpio(psram_io->flash_clk_io, OUTPUT_FUNCTION_2);
     }
   else
     {
       /* flash clock signal should come from GPIO matrix. */
 
-      esp32_configgpio(psram_io->flash_clk_io, OUTPUT_FUNCTION_2);
+      esp32_configgpio(psram_io->flash_clk_io, OUTPUT_FUNCTION_3);
     }
 
-  esp32_configgpio(psram_io->flash_cs_io, OUTPUT | FUNCTION_2);
-  esp32_configgpio(psram_io->psram_cs_io, OUTPUT | FUNCTION_2);
-  esp32_configgpio(psram_io->psram_clk_io, OUTPUT | FUNCTION_2);
-  esp32_configgpio(psram_io->psram_spiq_sd0_io, OUTPUT | INPUT | FUNCTION_2);
-  esp32_configgpio(psram_io->psram_spid_sd1_io, OUTPUT | INPUT | FUNCTION_2);
+  esp32_configgpio(psram_io->flash_cs_io, OUTPUT | FUNCTION_3);
+  esp32_configgpio(psram_io->psram_cs_io, OUTPUT | FUNCTION_3);
+  esp32_configgpio(psram_io->psram_clk_io, OUTPUT | FUNCTION_3);
+  esp32_configgpio(psram_io->psram_spiq_sd0_io, OUTPUT | INPUT | FUNCTION_3);
+  esp32_configgpio(psram_io->psram_spid_sd1_io, OUTPUT | INPUT | FUNCTION_3);
   esp32_configgpio(psram_io->psram_spihd_sd2_io, OUTPUT | INPUT | \
-                   FUNCTION_2);
+                   FUNCTION_3);
   esp32_configgpio(psram_io->psram_spiwp_sd3_io, OUTPUT | INPUT | \
-                   FUNCTION_2);
+                   FUNCTION_3);
 
 #if 0
   uint32_t flash_id = g_rom_flashchip.device_id;


[incubator-nuttx] 02/02: arch/xtensa/src/esp/esp32/esp32_gpio.c: Fix the function's mask test condition and the functions' values.

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

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

commit 605a49e9af09ab0c0b4866aee5b4526f65b367ce
Author: Abdelatif Guettouche <ab...@espressif.com>
AuthorDate: Thu Oct 8 00:47:34 2020 +0100

    arch/xtensa/src/esp/esp32/esp32_gpio.c: Fix the function's mask test
    condition and the functions' values.
    
    Signed-off-by: Abdelatif Guettouche <ab...@espressif.com>
---
 arch/xtensa/src/esp32/esp32_gpio.c  |  6 +++---
 arch/xtensa/src/esp32/esp32_gpio.h  | 12 ++++++------
 arch/xtensa/src/esp32/esp32_psram.c |  8 ++++----
 3 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/arch/xtensa/src/esp32/esp32_gpio.c b/arch/xtensa/src/esp32/esp32_gpio.c
index 7bee9ef..09737c7 100644
--- a/arch/xtensa/src/esp32/esp32_gpio.c
+++ b/arch/xtensa/src/esp32/esp32_gpio.c
@@ -213,12 +213,12 @@ int esp32_configgpio(int pin, gpio_pinattr_t attr)
   func |= FUN_IE;
 
   /* Select the pad's function.  If no function was given, consider it a
-   * normal input or output (i.e. function2).
+   * normal input or output (i.e. function3).
    */
 
-  if ((attr & FUNCTION) != 0)
+  if ((attr & FUNCTION_MASK) != 0)
     {
-      func |= (uint32_t)((attr >> FUNCTION_SHIFT) << MCU_SEL_S);
+      func |= (uint32_t)(((attr >> FUNCTION_SHIFT) - 1) << MCU_SEL_S);
     }
   else
     {
diff --git a/arch/xtensa/src/esp32/esp32_gpio.h b/arch/xtensa/src/esp32/esp32_gpio.h
index 5a2440d..e9182df 100644
--- a/arch/xtensa/src/esp32/esp32_gpio.h
+++ b/arch/xtensa/src/esp32/esp32_gpio.h
@@ -60,12 +60,12 @@
 #define OPEN_DRAIN          (1 << 5)
 #define FUNCTION_SHIFT      6
 #define FUNCTION_MASK       (7 << FUNCTION_SHIFT)
-#  define FUNCTION_1        (0 << FUNCTION_SHIFT)
-#  define FUNCTION_2        (1 << FUNCTION_SHIFT)
-#  define FUNCTION_3        (2 << FUNCTION_SHIFT)
-#  define FUNCTION_4        (3 << FUNCTION_SHIFT)
-#  define FUNCTION_5        (4 << FUNCTION_SHIFT)
-#  define FUNCTION_6        (5 << FUNCTION_SHIFT)
+#  define FUNCTION_1        (1 << FUNCTION_SHIFT)
+#  define FUNCTION_2        (2 << FUNCTION_SHIFT)
+#  define FUNCTION_3        (3 << FUNCTION_SHIFT)
+#  define FUNCTION_4        (4 << FUNCTION_SHIFT)
+#  define FUNCTION_5        (5 << FUNCTION_SHIFT)
+#  define FUNCTION_6        (6 << FUNCTION_SHIFT)
 
 #define INPUT_PULLUP        (INPUT | PULLUP)
 #define INPUT_PULLDOWN      (INPUT | PULLDOWN)
diff --git a/arch/xtensa/src/esp32/esp32_psram.c b/arch/xtensa/src/esp32/esp32_psram.c
index d22c56f..1617bd3 100644
--- a/arch/xtensa/src/esp32/esp32_psram.c
+++ b/arch/xtensa/src/esp32/esp32_psram.c
@@ -1205,10 +1205,10 @@ static void IRAM_ATTR psram_gpio_config(psram_io_t *psram_io,
   esp32_configgpio(psram_io->psram_clk_io, OUTPUT | FUNCTION_3);
   esp32_configgpio(psram_io->psram_spiq_sd0_io, OUTPUT | INPUT | FUNCTION_3);
   esp32_configgpio(psram_io->psram_spid_sd1_io, OUTPUT | INPUT | FUNCTION_3);
-  esp32_configgpio(psram_io->psram_spihd_sd2_io, OUTPUT | INPUT | \
-                   FUNCTION_3);
-  esp32_configgpio(psram_io->psram_spiwp_sd3_io, OUTPUT | INPUT | \
-                   FUNCTION_3);
+  esp32_configgpio(psram_io->psram_spihd_sd2_io,
+                   OUTPUT | INPUT | FUNCTION_3);
+  esp32_configgpio(psram_io->psram_spiwp_sd3_io,
+                   OUTPUT | INPUT | FUNCTION_3);
 
 #if 0
   uint32_t flash_id = g_rom_flashchip.device_id;