boards: arm: nrf5340dk_nrf5340: migrate to pinctrl

Use pinctrl instead of `-pin` properties.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
This commit is contained in:
Gerard Marull-Paretas 2022-03-16 18:37:25 +01:00 committed by Carles Cufí
parent 54baef44da
commit adc3d30e0a
9 changed files with 239 additions and 32 deletions

View file

@ -0,0 +1,115 @@
/*
* Copyright (c) 2022 Nordic Semiconductor
* SPDX-License-Identifier: Apache-2.0
*/
&pinctrl {
i2c1_default: i2c1_default {
group1 {
psels = <NRF_PSEL(TWIM_SDA, 1, 2)>,
<NRF_PSEL(TWIM_SCL, 1, 3)>;
};
};
i2c1_sleep: i2c1_sleep {
group1 {
psels = <NRF_PSEL(TWIM_SDA, 1, 2)>,
<NRF_PSEL(TWIM_SCL, 1, 3)>;
low-power-enable;
};
};
uart0_default: uart0_default {
group1 {
psels = <NRF_PSEL(UART_TX, 0, 20)>,
<NRF_PSEL(UART_RTS, 0, 19)>;
};
group2 {
psels = <NRF_PSEL(UART_RX, 0, 22)>,
<NRF_PSEL(UART_CTS, 0, 21)>;
bias-pull-up;
};
};
uart0_sleep: uart0_sleep {
group1 {
psels = <NRF_PSEL(UART_TX, 0, 20)>,
<NRF_PSEL(UART_RX, 0, 22)>,
<NRF_PSEL(UART_RTS, 0, 19)>,
<NRF_PSEL(UART_CTS, 0, 21)>;
low-power-enable;
};
};
pwm0_default: pwm0_default {
group1 {
psels = <NRF_PSEL(PWM_OUT0, 0, 28)>;
};
};
pwm0_sleep: pwm0_sleep {
group1 {
psels = <NRF_PSEL(PWM_OUT0, 0, 28)>;
low-power-enable;
};
};
qspi_default: qspi_default {
group1 {
psels = <NRF_PSEL(QSPI_SCK, 0, 17)>,
<NRF_PSEL(QSPI_IO0, 0, 13)>,
<NRF_PSEL(QSPI_IO1, 0, 14)>,
<NRF_PSEL(QSPI_IO2, 0, 15)>,
<NRF_PSEL(QSPI_IO3, 0, 16)>,
<NRF_PSEL(QSPI_CSN, 0, 18)>;
};
};
qspi_sleep: qspi_sleep {
group1 {
psels = <NRF_PSEL(QSPI_SCK, 0, 17)>,
<NRF_PSEL(QSPI_IO0, 0, 13)>,
<NRF_PSEL(QSPI_IO1, 0, 14)>,
<NRF_PSEL(QSPI_IO2, 0, 15)>,
<NRF_PSEL(QSPI_IO3, 0, 16)>,
<NRF_PSEL(QSPI_CSN, 0, 18)>;
low-power-enable;
};
};
uart1_default: uart1_default {
group1 {
psels = <NRF_PSEL(UART_TX, 1, 1)>;
};
group2 {
psels = <NRF_PSEL(UART_RX, 1, 0)>;
bias-pull-up;
};
};
uart1_sleep: uart1_sleep {
group1 {
psels = <NRF_PSEL(UART_TX, 1, 1)>,
<NRF_PSEL(UART_RX, 1, 0)>;
low-power-enable;
};
};
spi4_default: spi4_default {
group1 {
psels = <NRF_PSEL(SPIM_SCK, 1, 15)>,
<NRF_PSEL(SPIM_MISO, 1, 14)>,
<NRF_PSEL(SPIM_MOSI, 1, 13)>;
};
};
spi4_sleep: spi4_sleep {
group1 {
psels = <NRF_PSEL(SPIM_SCK, 1, 15)>,
<NRF_PSEL(SPIM_MISO, 1, 14)>,
<NRF_PSEL(SPIM_MOSI, 1, 13)>;
low-power-enable;
};
};
};

View file

@ -3,6 +3,7 @@
*
* SPDX-License-Identifier: Apache-2.0
*/
#include "nrf5340_cpuapp_common-pinctrl.dtsi"
/ {
@ -143,31 +144,31 @@
&i2c1 {
compatible = "nordic,nrf-twim";
status = "okay";
sda-pin = <34>;
scl-pin = <35>;
pinctrl-0 = <&i2c1_default>;
pinctrl-1 = <&i2c1_sleep>;
pinctrl-names = "default", "sleep";
};
&uart0 {
status = "okay";
current-speed = <115200>;
tx-pin = <20>;
rx-pin = <22>;
rx-pull-up;
rts-pin = <19>;
cts-pin = <21>;
cts-pull-up;
pinctrl-0 = <&uart0_default>;
pinctrl-1 = <&uart0_sleep>;
pinctrl-names = "default", "sleep";
};
&pwm0 {
status = "okay";
ch0-pin = <28>;
pinctrl-0 = <&pwm0_default>;
pinctrl-1 = <&pwm0_sleep>;
pinctrl-names = "default", "sleep";
};
&qspi {
status = "okay";
sck-pin = <17>;
io-pins = <13>, <14>, <15>, <16>;
csn-pins = <18>;
pinctrl-0 = <&qspi_default>;
pinctrl-1 = <&qspi_sleep>;
pinctrl-names = "default", "sleep";
mx25r64: mx25r6435f@0 {
compatible = "nordic,qspi-nor";
reg = <0>;
@ -206,19 +207,19 @@
arduino_serial: &uart1 {
compatible = "nordic,nrf-uarte";
current-speed = <115200>;
tx-pin = <33>;
rx-pin = <32>;
rx-pull-up;
pinctrl-0 = <&uart1_default>;
pinctrl-1 = <&uart1_sleep>;
pinctrl-names = "default", "sleep";
};
arduino_i2c: &i2c1 {};
arduino_spi: &spi4 {
compatible = "nordic,nrf-spim";
sck-pin = <47>;
miso-pin = <46>;
mosi-pin = <45>;
cs-gpios = <&arduino_header 16 GPIO_ACTIVE_LOW>; /* D10 */
pinctrl-0 = <&spi4_default>;
pinctrl-1 = <&spi4_sleep>;
pinctrl-names = "default", "sleep";
};
&flash0 {

View file

@ -0,0 +1,24 @@
/*
* Copyright (c) 2022 Nordic Semiconductor
* SPDX-License-Identifier: Apache-2.0
*/
&pinctrl {
spi2_default: spi2_default {
group1 {
psels = <NRF_PSEL(SPIM_SCK, 1, 15)>,
<NRF_PSEL(SPIM_MISO, 1, 14)>,
<NRF_PSEL(SPIM_MOSI, 1, 13)>;
};
};
spi2_sleep: spi2_sleep {
group1 {
psels = <NRF_PSEL(SPIM_SCK, 1, 15)>,
<NRF_PSEL(SPIM_MISO, 1, 14)>,
<NRF_PSEL(SPIM_MOSI, 1, 13)>;
low-power-enable;
};
};
};

View file

@ -7,6 +7,7 @@
/dts-v1/;
#include <nordic/nrf5340_cpuapp_qkaa.dtsi>
#include "nrf5340_cpuapp_common.dts"
#include "nrf5340dk_nrf5340_cpuapp-pinctrl.dtsi"
/ {
model = "Nordic NRF5340 DK NRF5340 Application";
@ -24,9 +25,9 @@
&spi2 {
compatible = "nordic,nrf-spim";
status = "okay";
sck-pin = <47>;
miso-pin = <46>;
mosi-pin = <45>;
pinctrl-0 = <&spi2_default>;
pinctrl-1 = <&spi2_sleep>;
pinctrl-names = "default", "sleep";
};
zephyr_udc0: &usbd {

View file

@ -22,3 +22,5 @@ CONFIG_SERIAL=y
# enable console
CONFIG_CONSOLE=y
CONFIG_UART_CONSOLE=y
CONFIG_PINCTRL=y

View file

@ -25,3 +25,5 @@ CONFIG_SERIAL=y
# enable console
CONFIG_CONSOLE=y
CONFIG_UART_CONSOLE=y
CONFIG_PINCTRL=y

View file

@ -0,0 +1,61 @@
/*
* Copyright (c) 2022 Nordic Semiconductor
* SPDX-License-Identifier: Apache-2.0
*/
&pinctrl {
uart0_default: uart0_default {
group1 {
psels = <NRF_PSEL(UART_TX, 1, 1)>,
<NRF_PSEL(UART_RTS, 0, 11)>;
};
group2 {
psels = <NRF_PSEL(UART_RX, 1, 0)>,
<NRF_PSEL(UART_CTS, 0, 10)>;
bias-pull-up;
};
};
uart0_sleep: uart0_sleep {
group1 {
psels = <NRF_PSEL(UART_TX, 1, 1)>,
<NRF_PSEL(UART_RX, 1, 0)>,
<NRF_PSEL(UART_RTS, 0, 11)>,
<NRF_PSEL(UART_CTS, 0, 10)>;
low-power-enable;
};
};
i2c0_default: i2c0_default {
group1 {
psels = <NRF_PSEL(TWIM_SDA, 1, 2)>,
<NRF_PSEL(TWIM_SCL, 1, 3)>;
};
};
i2c0_sleep: i2c0_sleep {
group1 {
psels = <NRF_PSEL(TWIM_SDA, 1, 2)>,
<NRF_PSEL(TWIM_SCL, 1, 3)>;
low-power-enable;
};
};
spi0_default: spi0_default {
group1 {
psels = <NRF_PSEL(SPIM_SCK, 1, 15)>,
<NRF_PSEL(SPIM_MISO, 1, 14)>,
<NRF_PSEL(SPIM_MOSI, 1, 13)>;
};
};
spi0_sleep: spi0_sleep {
group1 {
psels = <NRF_PSEL(SPIM_SCK, 1, 15)>,
<NRF_PSEL(SPIM_MISO, 1, 14)>,
<NRF_PSEL(SPIM_MOSI, 1, 13)>;
low-power-enable;
};
};
};

View file

@ -6,6 +6,7 @@
/dts-v1/;
#include <nordic/nrf5340_cpunet_qkaa.dtsi>
#include "nrf5340dk_nrf5340_cpunet-pinctrl.dtsi"
/ {
model = "Nordic NRF5340 DK NRF5340 Network";
@ -120,12 +121,9 @@
&uart0 {
status = "okay";
current-speed = <115200>;
tx-pin = <33>;
rx-pin = <32>;
rx-pull-up;
rts-pin = <11>;
cts-pin = <10>;
cts-pull-up;
pinctrl-0 = <&uart0_default>;
pinctrl-1 = <&uart0_sleep>;
pinctrl-names = "default", "sleep";
};
arduino_serial: &uart0{};
@ -134,18 +132,19 @@ arduino_i2c: &i2c0 {
compatible = "nordic,nrf-twim";
/* Cannot be used together with uart0. */
/* status = "okay"; */
sda-pin = <34>;
scl-pin = <35>;
pinctrl-0 = <&i2c0_default>;
pinctrl-1 = <&i2c0_sleep>;
pinctrl-names = "default", "sleep";
};
arduino_spi: &spi0 {
compatible = "nordic,nrf-spim";
/* Cannot be used together with uart0. */
/* status = "okay"; */
sck-pin = <47>;
miso-pin = <46>;
mosi-pin = <45>;
cs-gpios = <&arduino_header 16 GPIO_ACTIVE_LOW>; /* D10 */
pinctrl-0 = <&spi0_default>;
pinctrl-1 = <&spi0_sleep>;
pinctrl-names = "default", "sleep";
};
&timer0 {

View file

@ -19,3 +19,5 @@ CONFIG_SERIAL=y
# enable console
CONFIG_CONSOLE=y
CONFIG_UART_CONSOLE=y
CONFIG_PINCTRL=y