Skip to content

Commit e902a08

Browse files
decsnynashif
authored andcommitted
boards: frdm_rw612: Simple enablements collection
A collection of simple enablements to match some of the enablement done for rd_rw612_bga as closely as possible on the frdm_rw612 board. - i2c - spi - dma - mrt - ctimer - os timer - dac - adc - trng (alread was enabled but now listed support) - watchdog Signed-off-by: Declan Snyder <[email protected]>
1 parent 5c24c79 commit e902a08

File tree

10 files changed

+230
-1
lines changed

10 files changed

+230
-1
lines changed

boards/nxp/frdm_rw612/doc/index.rst

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,24 @@ Supported Features
4141
+-----------+------------+-----------------------------------+
4242
| BLE | on-chip | Bluetooth |
4343
+-----------+------------+-----------------------------------+
44+
| DMA | on-chip | dma |
45+
+-----------+------------+-----------------------------------+
46+
| SPI | on-chip | spi |
47+
+-----------+------------+-----------------------------------+
48+
| I2C | on-chip | i2c |
49+
+-----------+------------+-----------------------------------+
50+
| TRNG | on-chip | entropy |
51+
+-----------+------------+-----------------------------------+
52+
| WWDT | on-chip | watchdog |
53+
+-----------+------------+-----------------------------------+
54+
| USBOTG | on-chip | usb |
55+
+-----------+------------+-----------------------------------+
56+
| CTIMER | on-chip | counter |
57+
+-----------+------------+-----------------------------------+
58+
| MRT | on-chip | counter |
59+
+-----------+------------+-----------------------------------+
60+
| OS_TIMER | on-chip | os timer |
61+
+-----------+------------+-----------------------------------+
4462

4563
The default configuration can be found in the defconfig file:
4664

boards/nxp/frdm_rw612/frdm_rw612-pinctrl.dtsi

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,19 @@
3838
slew-rate = "fast";
3939
};
4040
};
41+
42+
pinmux_flexcomm2_i2c: pinmux_flexcomm2_i2c {
43+
group0 {
44+
pinmux = <IO_MUX_FC2_I2C_16_17>;
45+
slew-rate = "normal";
46+
bias-pull-up;
47+
};
48+
};
49+
50+
pinmux_flexcomm1_spi: pinmux_flexcomm1_spi {
51+
group0 {
52+
pinmux = <IO_MUX_FC1_SPI_SS0>;
53+
slew-rate = "ultra";
54+
};
55+
};
4156
};

boards/nxp/frdm_rw612/frdm_rw612.dts

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414

1515
aliases {
1616
led0 = &green_led;
17+
watchdog0 = &wwdt;
18+
usart-0 = &flexcomm3;
19+
i2c-0 = &flexcomm2;
1720
};
1821

1922
chosen {
@@ -92,3 +95,72 @@
9295
microchip,interface-type = "rmii";
9396
};
9497
};
98+
99+
&wwdt {
100+
status = "okay";
101+
};
102+
103+
&dma0 {
104+
status = "okay";
105+
};
106+
107+
&mrt0_channel0 {
108+
status = "okay";
109+
};
110+
111+
&ctimer0 {
112+
status = "okay";
113+
};
114+
115+
&pmu {
116+
reset-causes-en = <PMU_RESET_CM33_LOCKUP>,
117+
<PMU_RESET_ITRC>,
118+
<PMU_RESET_AP_RESET>;
119+
};
120+
121+
/* OS Timer is the wakeup source for PM mode 2 */
122+
&os_timer {
123+
status = "okay";
124+
wakeup-source;
125+
};
126+
127+
&systick {
128+
status = "disabled";
129+
};
130+
131+
&adc0 {
132+
status = "okay";
133+
};
134+
135+
&dac0 {
136+
status = "okay";
137+
};
138+
139+
zephyr_udc0: &usb_otg {
140+
status = "okay";
141+
};
142+
143+
/*
144+
* the default resistors on the board breaks out the MOSI/MISO
145+
* pins to the nets labelled "UART" which go to J1 2 and 4,
146+
* but we are using it for spi mosi and miso here.
147+
* SCK is on J2 6 as labelled.
148+
*/
149+
&flexcomm1 {
150+
compatible = "nxp,lpc-spi";
151+
pinctrl-0 = <&pinmux_flexcomm1_spi>;
152+
pinctrl-names = "default";
153+
status = "okay";
154+
#address-cells = <1>;
155+
#size-cells = <0>;
156+
};
157+
158+
arduino_i2c: &flexcomm2 {
159+
compatible = "nxp,lpc-i2c";
160+
status = "okay";
161+
clock-frequency = <I2C_BITRATE_FAST>;
162+
#address-cells = <1>;
163+
#size-cells = <0>;
164+
pinctrl-0 = <&pinmux_flexcomm2_i2c>;
165+
pinctrl-names = "default";
166+
};

boards/nxp/frdm_rw612/frdm_rw612.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,13 @@ ram: 960
1616
flash: 65536
1717
supported:
1818
- gpio
19+
- dma
20+
- spi
21+
- i2c
22+
- entropy
23+
- usb_device
24+
- watchdog
25+
- counter
26+
- hwinfo
27+
- adc
28+
- dac
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/*
2+
* Copyright 2022 NXP
3+
* SPDX-License-Identifier: Apache-2.0
4+
*/
5+
6+
#include <zephyr/dt-bindings/adc/nxp,gau-adc.h>
7+
8+
/ {
9+
zephyr,user {
10+
/* adjust channel number according to pinmux in board.dts */
11+
io-channels = <&adc0 0 &adc0 1>;
12+
};
13+
};
14+
15+
&adc0 {
16+
#address-cells = <1>;
17+
#size-cells = <0>;
18+
19+
channel@0 {
20+
reg = <0>;
21+
zephyr,gain = "ADC_GAIN_1";
22+
zephyr,reference = "ADC_REF_VDD_1";
23+
zephyr,vref-mv = <1800>;
24+
zephyr,acquisition-time = <ADC_ACQ_TIME_DEFAULT>;
25+
zephyr,resolution = <16>;
26+
zephyr,input-positive = <GAU_ADC_CH0>;
27+
};
28+
29+
channel@1 {
30+
reg = <1>;
31+
zephyr,gain = "ADC_GAIN_1";
32+
zephyr,reference = "ADC_REF_VDD_1";
33+
zephyr,vref-mv = <1800>;
34+
zephyr,acquisition-time = <ADC_ACQ_TIME_DEFAULT>;
35+
zephyr,resolution = <16>;
36+
zephyr,input-positive = <GAU_ADC_CH1>;
37+
};
38+
};
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/ {
2+
zephyr,user {
3+
dac = <&dac0>;
4+
dac-channel-id = <1>;
5+
dac-resolution = <10>;
6+
};
7+
};
8+
9+
&dac0 {
10+
nxp,conversion-rate = "500K";
11+
nxp,output-voltage-range = "large";
12+
};
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/*
2+
* Copyright 2023 NXP
3+
* SPDX-License-Identifier: Apache-2.0
4+
*/
5+
6+
#include <zephyr/dt-bindings/adc/nxp,gau-adc.h>
7+
8+
/ {
9+
zephyr,user {
10+
/* adjust channel number according to pinmux in board.dts */
11+
io-channels = <&adc0 0 &adc0 1>;
12+
};
13+
};
14+
15+
&adc0 {
16+
#address-cells = <1>;
17+
#size-cells = <0>;
18+
19+
channel@0 {
20+
reg = <0>;
21+
zephyr,gain = "ADC_GAIN_1";
22+
zephyr,reference = "ADC_REF_VDD_1";
23+
zephyr,vref-mv = <1800>;
24+
zephyr,acquisition-time = <ADC_ACQ_TIME_DEFAULT>;
25+
zephyr,resolution = <16>;
26+
zephyr,input-positive = <GAU_ADC_CH0>;
27+
};
28+
29+
channel@1 {
30+
reg = <1>;
31+
zephyr,gain = "ADC_GAIN_1";
32+
zephyr,reference = "ADC_REF_VDD_1";
33+
zephyr,vref-mv = <1800>;
34+
zephyr,acquisition-time = <ADC_ACQ_TIME_DEFAULT>;
35+
zephyr,resolution = <16>;
36+
zephyr,input-positive = <GAU_ADC_CH1>;
37+
};
38+
};

tests/drivers/dac/dac_api/src/test_dac.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,8 @@
8989
#define DAC_RESOLUTION 12
9090
#define DAC_CHANNEL_ID 0
9191

92-
#elif defined(CONFIG_BOARD_RD_RW612_BGA)
92+
#elif defined(CONFIG_BOARD_RD_RW612_BGA) || \
93+
defined(CONFIG_BOARD_FRDM_RW612)
9394

9495
#define DAC_DEVICE_NODE DT_NODELABEL(dac0)
9596
#define DAC_RESOLUTION 10
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/*
2+
* Copyright 2023-2024 NXP
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
tst_dma0: &dma0 { };
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/*
2+
* Copyright 2024 NXP
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
&flexcomm1 {
8+
slow@0 {
9+
compatible = "test-spi-loopback-slow";
10+
reg = <0>;
11+
spi-max-frequency = <500000>;
12+
};
13+
fast@0 {
14+
compatible = "test-spi-loopback-fast";
15+
reg = <0>;
16+
spi-max-frequency = <16000000>;
17+
};
18+
};

0 commit comments

Comments
 (0)