Skip to content

Commit 26a2478

Browse files
EmilioCBenkartben
authored andcommitted
tests: drivers: i2s: Added I2S Testing for RW612
Added Internal pin connection for I2S Loopback testing when I2S is enabled. Added I2S testing support for RW612. Signed-off-by: Emilio Benavente <emilio.benavente@nxp.com>
1 parent 9a893c6 commit 26a2478

File tree

6 files changed

+140
-0
lines changed

6 files changed

+140
-0
lines changed

boards/nxp/frdm_rw612/init.c

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
#include <zephyr/pm/pm.h>
77
#include <fsl_power.h>
8+
#include <fsl_common.h>
89

910
static void frdm_rw612_power_init_config(void)
1011
{
@@ -42,4 +43,33 @@ void board_early_init_hook(void)
4243

4344
pm_notifier_register(&frdm_rw612_pm_notifier);
4445
#endif
46+
47+
#ifdef CONFIG_I2S_TEST_SEPARATE_DEVICES
48+
/*
49+
* Eventually this code should not be here
50+
* but should be configured by some SYSCTL node
51+
*/
52+
53+
/* Set shared signal set 0 SCK, WS from Transmit I2S - Flexcomm1 */
54+
SYSCTL1->SHAREDCTRLSET[0] = SYSCTL1_SHAREDCTRLSET_SHAREDSCKSEL(1) |
55+
SYSCTL1_SHAREDCTRLSET_SHAREDWSSEL(1);
56+
57+
/* Select Data in from Transmit I2S - Flexcomm 1 */
58+
SYSCTL1->SHAREDCTRLSET[0] |= SYSCTL1_SHAREDCTRLSET_SHAREDDATASEL(1);
59+
/* Enable Transmit I2S - Flexcomm 1 for Shared Data Out */
60+
SYSCTL1->SHAREDCTRLSET[0] |= SYSCTL1_SHAREDCTRLSET_FC1DATAOUTEN(1);
61+
62+
/* Set Receive I2S - Flexcomm 0 SCK, WS from shared signal set 0 */
63+
SYSCTL1->FCCTRLSEL[0] = SYSCTL1_FCCTRLSEL_SCKINSEL(1) |
64+
SYSCTL1_FCCTRLSEL_WSINSEL(1);
65+
66+
/* Set Transmit I2S - Flexcomm 1 SCK, WS from shared signal set 0 */
67+
SYSCTL1->FCCTRLSEL[1] = SYSCTL1_FCCTRLSEL_SCKINSEL(1) |
68+
SYSCTL1_FCCTRLSEL_WSINSEL(1);
69+
70+
/* Select Receive I2S - Flexcomm 0 Data in from shared signal set 0 */
71+
SYSCTL1->FCCTRLSEL[0] |= SYSCTL1_FCCTRLSEL_DATAINSEL(1);
72+
/* Select Transmit I2S - Flexcomm 1 Data out to shared signal set 0 */
73+
SYSCTL1->FCCTRLSEL[1] |= SYSCTL1_FCCTRLSEL_DATAOUTSEL(1);
74+
#endif /* CONFIG_I2S_TEST_SEPARATE_DEVICES */
4575
}

boards/nxp/rd_rw612_bga/init.c

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
#include <zephyr/pm/pm.h>
77
#include <fsl_power.h>
8+
#include <fsl_common.h>
89

910
static void rdrw61x_power_init_config(void)
1011
{
@@ -42,4 +43,33 @@ void board_early_init_hook(void)
4243

4344
pm_notifier_register(&rdrw61x_pm_notifier);
4445
#endif
46+
47+
#ifdef CONFIG_I2S_TEST_SEPARATE_DEVICES
48+
/*
49+
* Eventually this code should not be here
50+
* but should be configured by some SYSCTL node
51+
*/
52+
53+
/* Set shared signal set 0 SCK, WS from Transmit I2S - Flexcomm1 */
54+
SYSCTL1->SHAREDCTRLSET[0] = SYSCTL1_SHAREDCTRLSET_SHAREDSCKSEL(1) |
55+
SYSCTL1_SHAREDCTRLSET_SHAREDWSSEL(1);
56+
57+
/* Select Data in from Transmit I2S - Flexcomm 1 */
58+
SYSCTL1->SHAREDCTRLSET[0] |= SYSCTL1_SHAREDCTRLSET_SHAREDDATASEL(1);
59+
/* Enable Transmit I2S - Flexcomm 1 for Shared Data Out */
60+
SYSCTL1->SHAREDCTRLSET[0] |= SYSCTL1_SHAREDCTRLSET_FC1DATAOUTEN(1);
61+
62+
/* Set Receive I2S - Flexcomm 0 SCK, WS from shared signal set 0 */
63+
SYSCTL1->FCCTRLSEL[0] = SYSCTL1_FCCTRLSEL_SCKINSEL(1) |
64+
SYSCTL1_FCCTRLSEL_WSINSEL(1);
65+
66+
/* Set Transmit I2S - Flexcomm 1 SCK, WS from shared signal set 0 */
67+
SYSCTL1->FCCTRLSEL[1] = SYSCTL1_FCCTRLSEL_SCKINSEL(1) |
68+
SYSCTL1_FCCTRLSEL_WSINSEL(1);
69+
70+
/* Select Receive I2S - Flexcomm 0 Data in from shared signal set 0 */
71+
SYSCTL1->FCCTRLSEL[0] |= SYSCTL1_FCCTRLSEL_DATAINSEL(1);
72+
/* Select Transmit I2S - Flexcomm 1 Data out to shared signal set 0 */
73+
SYSCTL1->FCCTRLSEL[1] |= SYSCTL1_FCCTRLSEL_DATAOUTSEL(1);
74+
#endif /* CONFIG_I2S_TEST_SEPARATE_DEVICES */
4575
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
CONFIG_I2S_TEST_SEPARATE_DEVICES=y
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/* Overlay for RDRW61X I2S tests */
2+
3+
/ {
4+
aliases {
5+
i2s-node0 = &flexcomm0;
6+
i2s-node1 = &flexcomm1;
7+
};
8+
};
9+
10+
/* Redefine as i2s node */
11+
&flexcomm0 {
12+
compatible = "nxp,lpc-i2s";
13+
#address-cells = <1>;
14+
#size-cells = <0>;
15+
pinctrl-0 = <&pinmux_flexcomm0_i2s>;
16+
pinctrl-names = "default";
17+
dma-names = "rx", "tx";
18+
/delete-property/ current-speed;
19+
status = "okay";
20+
};
21+
22+
&flexcomm1 {
23+
compatible = "nxp,lpc-i2s";
24+
status = "okay";
25+
#address-cells = <1>;
26+
#size-cells = <0>;
27+
pinctrl-0 = <&pinmux_flexcomm1_i2s>;
28+
pinctrl-names = "default";
29+
};
30+
31+
/* Redefine pinctrl for flexcomm0 */
32+
&pinctrl {
33+
pinmux_flexcomm0_i2s: pinmux_flexcomm0_i2s {
34+
group0 {
35+
pinmux = <IO_MUX_FC0_I2S>;
36+
slew-rate = "normal";
37+
};
38+
};
39+
};
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
CONFIG_I2S_TEST_SEPARATE_DEVICES=y
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/* Overlay for RDRW61X I2S tests */
2+
3+
/ {
4+
aliases {
5+
i2s-node0 = &flexcomm0;
6+
i2s-node1 = &flexcomm1;
7+
};
8+
};
9+
10+
/* Redefine as i2s node */
11+
&flexcomm0 {
12+
compatible = "nxp,lpc-i2s";
13+
#address-cells = <1>;
14+
#size-cells = <0>;
15+
pinctrl-0 = <&pinmux_flexcomm0_i2s>;
16+
pinctrl-names = "default";
17+
dma-names = "rx", "tx";
18+
/delete-property/ current-speed;
19+
status = "okay";
20+
};
21+
22+
&flexcomm1 {
23+
compatible = "nxp,lpc-i2s";
24+
status = "okay";
25+
#address-cells = <1>;
26+
#size-cells = <0>;
27+
pinctrl-0 = <&pinmux_flexcomm1_i2s>;
28+
pinctrl-names = "default";
29+
};
30+
31+
/* Redefine pinctrl for flexcomm0 */
32+
&pinctrl {
33+
pinmux_flexcomm0_i2s: pinmux_flexcomm0_i2s {
34+
group0 {
35+
pinmux = <IO_MUX_FC0_I2S>;
36+
slew-rate = "normal";
37+
};
38+
};
39+
};

0 commit comments

Comments
 (0)