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:57 UTC

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

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"