You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by ja...@apache.org on 2021/07/14 11:11:56 UTC

[mynewt-core] branch master updated (d3ded77 -> 4faf524)

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

janc pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git.


    from d3ded77  baselibc: Fix build with -Werror=array-parameter enabled
     new d50d141  Revert "hw/ipc_nrf5340: Fix enabling multiple GPIOs passed to network core #2623"
     new 4faf524  hw/ipc_nrf5340: Fix enabling multiple GPIOs passed to network core #2623

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:
 hw/drivers/ipc_nrf5340/src/ipc_nrf5340.c | 20 +++++++++++---------
 hw/drivers/ipc_nrf5340/syscfg.yml        | 11 +++++------
 2 files changed, 16 insertions(+), 15 deletions(-)

[mynewt-core] 01/02: Revert "hw/ipc_nrf5340: Fix enabling multiple GPIOs passed to network core #2623"

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

janc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git

commit d50d141fd3d6cc3ed374aec9059a2e1b05923c7c
Author: Niklas Casaril <ni...@casaril.com>
AuthorDate: Wed Jun 30 07:21:14 2021 +1000

    Revert "hw/ipc_nrf5340: Fix enabling multiple GPIOs passed to network core #2623"
    
    This reverts commit 4051488297c84bf45d494ecd00275d69fe376c36.
---
 hw/drivers/ipc_nrf5340/src/ipc_nrf5340.c | 15 ++++++---------
 hw/drivers/ipc_nrf5340/syscfg.yml        | 11 +++++------
 2 files changed, 11 insertions(+), 15 deletions(-)

diff --git a/hw/drivers/ipc_nrf5340/src/ipc_nrf5340.c b/hw/drivers/ipc_nrf5340/src/ipc_nrf5340.c
index c59c187..a44f267 100644
--- a/hw/drivers/ipc_nrf5340/src/ipc_nrf5340.c
+++ b/hw/drivers/ipc_nrf5340/src/ipc_nrf5340.c
@@ -162,7 +162,7 @@ ipc_nrf5340_init(void)
 
 #if MYNEWT_VAL(MCU_APP_CORE)
 #if MYNEWT_VAL(IPC_NRF5340_NET_GPIO)
-    uint64_t gpios = MYNEWT_VAL(IPC_NRF5340_NET_GPIO);
+    unsigned int gpios[] = { MYNEWT_VAL(IPC_NRF5340_NET_GPIO) };
     NRF_GPIO_Type *nrf_gpio;
 #endif
 
@@ -183,14 +183,11 @@ ipc_nrf5340_init(void)
     memset(shms, 0, sizeof(shms));
 
 #if MYNEWT_VAL(IPC_NRF5340_NET_GPIO)
-    /* Configure GPIOs for Networking Core, nrf5340 has 48 GPIOs */
-    for (i = 0; i < 48; i++) {
-        if (gpios & 0x1) {
-            nrf_gpio = HAL_GPIO_PORT(i);
-            nrf_gpio->PIN_CNF[HAL_GPIO_INDEX(i)] =
-                GPIO_PIN_CNF_MCUSEL_NetworkMCU << GPIO_PIN_CNF_MCUSEL_Pos;
-        }
-        gpios >>= 1;
+    /* Configure GPIOs for Networking Core */
+    for (i = 0; i < ARRAY_SIZE(gpios); i++) {
+        nrf_gpio = HAL_GPIO_PORT(gpios[i]);
+        nrf_gpio->PIN_CNF[HAL_GPIO_INDEX(gpios[i])] =
+            GPIO_PIN_CNF_MCUSEL_NetworkMCU << GPIO_PIN_CNF_MCUSEL_Pos;
     }
 #endif
 #endif
diff --git a/hw/drivers/ipc_nrf5340/syscfg.yml b/hw/drivers/ipc_nrf5340/syscfg.yml
index c5acaf2..c92518a 100644
--- a/hw/drivers/ipc_nrf5340/syscfg.yml
+++ b/hw/drivers/ipc_nrf5340/syscfg.yml
@@ -43,12 +43,11 @@ syscfg.defs:
 
     IPC_NRF5340_NET_GPIO:
         description: >
-            Bitfield with 1s for each GPIO that should be configured for Network
-            Core usage. Can be defined with numeric or with constants from bsp.h
-            eg "(1ULL << LED_1 | 1ULL << LED_2)" or "(1 << 1 | 1ULL << 34)".
-            The "ULL" qualifier is needed for pins > 31.
-            Further GPIO configuration should be done by Network Core.
-        value: 0
+            List of comma separated GPIO that should be configured for Network
+            Core usage. Can be define numeric or with constants from bsp.h
+            eg "LED_1, LED_2" or "1, 2". Further GPIO configuration should be
+            done by Network Core.
+        value: ""
 
 syscfg.restrictions:
     - "!BSP_NRF5340 || BSP_NRF5340_NET_ENABLE"

[mynewt-core] 02/02: hw/ipc_nrf5340: Fix enabling multiple GPIOs passed to network core #2623

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

janc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git

commit 4faf524bb113c4738b9db30001955f69c34de102
Author: Niklas Casaril <ni...@casaril.com>
AuthorDate: Thu Jun 24 10:29:54 2021 +1000

    hw/ipc_nrf5340: Fix enabling multiple GPIOs passed to network core #2623
---
 hw/drivers/ipc_nrf5340/src/ipc_nrf5340.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/hw/drivers/ipc_nrf5340/src/ipc_nrf5340.c b/hw/drivers/ipc_nrf5340/src/ipc_nrf5340.c
index a44f267..b0d7da8 100644
--- a/hw/drivers/ipc_nrf5340/src/ipc_nrf5340.c
+++ b/hw/drivers/ipc_nrf5340/src/ipc_nrf5340.c
@@ -155,6 +155,11 @@ ipc_nrf5340_isr(void)
     os_trace_isr_exit();
 }
 
+/* Below is to unmangle comma separated GPIO pins from MYNEWT_VAL */
+#define _Args(...) __VA_ARGS__
+#define STRIP_PARENS(X) X
+#define UNMANGLE_MYNEWT_VAL(X) STRIP_PARENS(_Args X)
+
 void
 ipc_nrf5340_init(void)
 {
@@ -162,7 +167,7 @@ ipc_nrf5340_init(void)
 
 #if MYNEWT_VAL(MCU_APP_CORE)
 #if MYNEWT_VAL(IPC_NRF5340_NET_GPIO)
-    unsigned int gpios[] = { MYNEWT_VAL(IPC_NRF5340_NET_GPIO) };
+    unsigned int gpios[] = { UNMANGLE_MYNEWT_VAL(MYNEWT_VAL(IPC_NRF5340_NET_GPIO)) };
     NRF_GPIO_Type *nrf_gpio;
 #endif