Skip to content

Commit 681442a

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 4ba4768 commit 681442a

File tree

3 files changed

+70
-0
lines changed

3 files changed

+70
-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(psel) \
100+
nrf_gpio_pin_control_select(psel, 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_CS0:
360+
case NRF_FUN_SDP_MSPI_CS1:
361+
case NRF_FUN_SDP_MSPI_SCK:
362+
case NRF_FUN_SDP_MSPI_DQ0:
363+
case NRF_FUN_SDP_MSPI_DQ1:
364+
case NRF_FUN_SDP_MSPI_DQ2:
365+
case NRF_FUN_SDP_MSPI_DQ3:
366+
case NRF_FUN_SDP_MSPI_DQ4:
367+
case NRF_FUN_SDP_MSPI_DQ5:
368+
case NRF_FUN_SDP_MSPI_DQ6:
369+
case NRF_FUN_SDP_MSPI_DQ7:
370+
NRF_PSEL_SDP_MSPI(psel);
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

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/*
2+
* Copyright (c) 2024, Nordic Semiconductor ASA
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#ifndef NRFE_CONFIG_H__
8+
#define NRFE_CONFIG_H__
9+
10+
#ifdef CONFIG_GPIO_NRFE
11+
#include <drivers/gpio/nrfe_gpio.h>
12+
#elif CONFIG_MSPI_NRFE
13+
#include <drivers/mspi/nrfe_mspi.h>
14+
#else
15+
#error "NRFE config header included, even though no SW-define IO device is enabled."
16+
#endif
17+
18+
#ifndef NRFE_RESERVED_PPI_CHANNELS
19+
#define NRFE_RESERVED_PPI_CHANNELS 0
20+
#endif
21+
22+
#endif /* NRFE_CONFIG_H__ */

0 commit comments

Comments
 (0)