Skip to content

Commit f560a84

Browse files
committed
[nrf noup] drivers: pinctrl: Add SDP MSPI pin configuration
Configure SDP MSPI pins to switch their control to VPR core Signed-off-by: Jakub Zymelka <[email protected]>
1 parent aa40507 commit f560a84

File tree

3 files changed

+52
-0
lines changed

3 files changed

+52
-0
lines changed

drivers/pinctrl/pinctrl_nrf.c

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,15 @@ static const nrf_gpio_pin_drive_t drive_modes[NRF_DRIVE_COUNT] = {
9494
#define NRF_PSEL_QSPI(reg, line) ((NRF_QSPI_Type *)reg)->PSEL.line
9595
#endif
9696

97+
#if defined(CONFIG_SOC_NRF54L15_CPUAPP)
98+
#if DT_HAS_COMPAT_STATUS_OKAY(nordic_nrfe_mspi_controller) || defined(CONFIG_MSPI_NRFE)
99+
#define NRF_PSEL_SDP_MSPI(reg, pin) \
100+
((NRF_GPIO_Type *)reg)->PIN_CNF[pin] = \
101+
((((NRF_GPIO_Type *)reg)->PIN_CNF[pin] & ~GPIO_PIN_CNF_CTRLSEL_Msk) | \
102+
(NRF_GPIO_PIN_SEL_VPR << GPIO_PIN_CNF_CTRLSEL_Pos));
103+
#endif
104+
#endif
105+
97106
int pinctrl_configure_pins(const pinctrl_soc_pin_t *pins, uint8_t pin_cnt,
98107
uintptr_t reg)
99108
{
@@ -347,6 +356,25 @@ int pinctrl_configure_pins(const pinctrl_soc_pin_t *pins, uint8_t pin_cnt,
347356
input = NRF_GPIO_PIN_INPUT_CONNECT;
348357
break;
349358
#endif /* DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_can) */
359+
#if defined(CONFIG_SOC_NRF54L15_CPUAPP)
360+
#if DT_HAS_COMPAT_STATUS_OKAY(nordic_nrfe_mspi_controller)
361+
case NRF_FUN_SDP_MSPI_CS0:
362+
case NRF_FUN_SDP_MSPI_CS1:
363+
case NRF_FUN_SDP_MSPI_SCK:
364+
case NRF_FUN_SDP_MSPI_DQ0:
365+
case NRF_FUN_SDP_MSPI_DQ1:
366+
case NRF_FUN_SDP_MSPI_DQ2:
367+
case NRF_FUN_SDP_MSPI_DQ3:
368+
case NRF_FUN_SDP_MSPI_DQ4:
369+
case NRF_FUN_SDP_MSPI_DQ5:
370+
case NRF_FUN_SDP_MSPI_DQ6:
371+
case NRF_FUN_SDP_MSPI_DQ7:
372+
NRF_PSEL_SDP_MSPI(reg, psel);
373+
dir = NRF_GPIO_PIN_DIR_OUTPUT;
374+
input = NRF_GPIO_PIN_INPUT_CONNECT;
375+
break;
376+
#endif /* DT_HAS_COMPAT_STATUS_OKAY(nordic_nrfe_mspi_controller) */
377+
#endif /* CONFIG_SOC_NRF54L15_CPUAPP */
350378
default:
351379
return -ENOTSUP;
352380
}

include/zephyr/dt-bindings/pinctrl/nrf-pinctrl.h

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,28 @@
162162
#define NRF_FUN_CAN_TX 46U
163163
/** CAN RX */
164164
#define NRF_FUN_CAN_RX 47U
165+
/** SDP_MSPI CK */
166+
#define NRF_FUN_SDP_MSPI_SCK 48U
167+
/** SDP_MSPI DQ0 */
168+
#define NRF_FUN_SDP_MSPI_DQ0 49U
169+
/** SDP_MSPI DQ1 */
170+
#define NRF_FUN_SDP_MSPI_DQ1 50U
171+
/** SDP_MSPI DQ2 */
172+
#define NRF_FUN_SDP_MSPI_DQ2 51U
173+
/** SDP_MSPI DQ3 */
174+
#define NRF_FUN_SDP_MSPI_DQ3 52U
175+
/** SDP_MSPI DQ4 */
176+
#define NRF_FUN_SDP_MSPI_DQ4 53U
177+
/** SDP_MSPI DQ5 */
178+
#define NRF_FUN_SDP_MSPI_DQ5 54U
179+
/** SDP_MSPI DQ6 */
180+
#define NRF_FUN_SDP_MSPI_DQ6 55U
181+
/** SDP_MSPI DQ7 */
182+
#define NRF_FUN_SDP_MSPI_DQ7 56U
183+
/** SDP_MSPI CS0 */
184+
#define NRF_FUN_SDP_MSPI_CS0 57U
185+
/** SDP_MSPI CS1 */
186+
#define NRF_FUN_SDP_MSPI_CS1 58U
165187

166188
/** @} */
167189

modules/hal_nordic/nrfx/nrfe_config.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99

1010
#ifdef CONFIG_GPIO_NRFE
1111
#include <drivers/gpio/nrfe_gpio.h>
12+
#elif CONFIG_MSPI_NRFE
13+
#include <drivers/mspi/nrfe_mspi.h>
1214
#else
1315
#error "NRFE config header included, even though no SW-define IO device is enabled."
1416
#endif

0 commit comments

Comments
 (0)