Skip to content

Commit 9f1d6b0

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 0271821 commit 9f1d6b0

File tree

3 files changed

+50
-0
lines changed

3 files changed

+50
-0
lines changed

drivers/pinctrl/pinctrl_nrf.c

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,13 @@ 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].CTRLSEL = NRF_GPIO_PIN_SEL_VPR)
101+
#endif
102+
#endif
103+
97104
int pinctrl_configure_pins(const pinctrl_soc_pin_t *pins, uint8_t pin_cnt,
98105
uintptr_t reg)
99106
{
@@ -347,6 +354,25 @@ int pinctrl_configure_pins(const pinctrl_soc_pin_t *pins, uint8_t pin_cnt,
347354
input = NRF_GPIO_PIN_INPUT_CONNECT;
348355
break;
349356
#endif /* DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_can) */
357+
#if defined(CONFIG_SOC_NRF54L15_CPUAPP)
358+
#if DT_HAS_COMPAT_STATUS_OKAY(nordic_nrfe_mspi_controller)
359+
case NRF_FUN_SDP_MSPI_CSN:
360+
case NRF_FUN_SDP_MSPI_SCK:
361+
case NRF_FUN_SDP_MSPI_DQ0:
362+
case NRF_FUN_SDP_MSPI_DQ1:
363+
case NRF_FUN_SDP_MSPI_DQ2:
364+
case NRF_FUN_SDP_MSPI_DQ3:
365+
case NRF_FUN_SDP_MSPI_DQ4:
366+
case NRF_FUN_SDP_MSPI_DQ5:
367+
case NRF_FUN_SDP_MSPI_DQ6:
368+
case NRF_FUN_SDP_MSPI_DQ7:
369+
NRF_PSEL_SDP_MSPI(reg, psel);
370+
// write = 1U;
371+
// dir = NRF_GPIO_PIN_DIR_OUTPUT;
372+
// input = NRF_GPIO_PIN_INPUT_CONNECT;
373+
break;
374+
#endif /* DT_HAS_COMPAT_STATUS_OKAY(nordic_nrfe_mspi_controller) */
375+
#endif /* CONFIG_SOC_NRF54L15_CPUAPP */
350376
default:
351377
return -ENOTSUP;
352378
}

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)