Skip to content

Commit 7cd1fbd

Browse files
rexutkartben
authored andcommitted
boards: nxp: frdm_mcxn947: add mikrobus labels
Added mikrobus_i2c, mikrobus_spi and mikrobus_header node labels to FRDM-MCXN947 device tree board definition, allowing compatible shield boards to be used. Also add new FlexComm SPI pinmux for the LPSPI6 on LPFLEXCOMM6 and enable required GPIO3 and GPIO5. Signed-off-by: Stephan Linz <[email protected]>
1 parent d66a3d6 commit 7cd1fbd

File tree

3 files changed

+92
-7
lines changed

3 files changed

+92
-7
lines changed

boards/nxp/frdm_mcxn947/frdm_mcxn947-pinctrl.dtsi

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,18 @@
1818
};
1919
};
2020

21+
pinmux_flexcomm6_lpspi: pinmux_flexcomm6_lpspi {
22+
group0 {
23+
pinmux = <FC6_P0_PIO3_20>, /* SAI1_TXD0 */
24+
<FC6_P1_PIO3_21>, /* SAI1_RXD0 */
25+
<FC6_P2_PIO3_22>,
26+
<FC6_P3_PIO3_23>;
27+
slew-rate = "fast";
28+
drive-strength = "low";
29+
input-enable;
30+
};
31+
};
32+
2133
pinmux_flexcomm2_lpi2c: pinmux_flexcomm2_lpi2c {
2234
group0 {
2335
pinmux = <FC2_P0_PIO4_0>,

boards/nxp/frdm_mcxn947/frdm_mcxn947.dtsi

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,25 @@
6161
};
6262
};
6363

64+
mikrobus_header: mikrobus-connector {
65+
compatible = "mikro-bus";
66+
#gpio-cells = <2>;
67+
gpio-map-mask = <0xffffffff 0xffffffc0>;
68+
gpio-map-pass-thru = <0 0x3f>;
69+
gpio-map = /* ANA_4/ADC1_A0 AN */
70+
<1 0 &gpio1 3 0>, /* RST */
71+
<2 0 &gpio3 23 0>, /* CS */
72+
<3 0 &gpio3 21 0>, /* SCK */
73+
<4 0 &gpio3 22 0>, /* MISO */
74+
<5 0 &gpio3 20 0>, /* MOSI */
75+
<6 0 &gpio3 19 0>, /* PWM */
76+
<7 0 &gpio5 7 0>, /* INT */
77+
<8 0 &gpio1 16 0>, /* GPIO, Not a RX */
78+
<9 0 &gpio1 17 0>, /* GPIO, Not a TX */
79+
<10 0 &gpio1 1 0>, /* SCL */
80+
<11 0 &gpio1 0 0>; /* SDA */
81+
};
82+
6483
arduino_header: arduino-connector {
6584
compatible = "arduino-header-r3";
6685
#gpio-cells = <2>;
@@ -118,6 +137,13 @@
118137

119138
arduino_spi: &flexcomm1_lpspi1 {};
120139

140+
&flexcomm6_lpspi6 {
141+
pinctrl-0 = <&pinmux_flexcomm6_lpspi>;
142+
pinctrl-names = "default";
143+
};
144+
145+
mikrobus_spi: &flexcomm6_lpspi6 {};
146+
121147
nxp_8080_touch_panel_i2c: &flexcomm2_lpi2c2 {
122148
pinctrl-0 = <&pinmux_flexcomm2_lpi2c>;
123149
pinctrl-names = "default";
@@ -126,6 +152,14 @@ nxp_8080_touch_panel_i2c: &flexcomm2_lpi2c2 {
126152

127153
arduino_i2c: &flexcomm2_lpi2c2 {};
128154

155+
&flexcomm3_lpi2c3 {
156+
pinctrl-0 = <&pinmux_flexcomm3_lpi2c>;
157+
pinctrl-names = "default";
158+
clock-frequency = <I2C_BITRATE_STANDARD>;
159+
};
160+
161+
mikrobus_i2c: &flexcomm3_lpi2c3 {};
162+
129163
&flexcomm2_lpuart2 {
130164
current-speed = <115200>;
131165
pinctrl-0 = <&pinmux_flexcomm2_lpuart>;

boards/nxp/frdm_mcxn947/frdm_mcxn947_mcxn947_cpu0.dtsi

Lines changed: 46 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,22 +56,36 @@
5656
status = "okay";
5757
};
5858

59-
&gpio4 {
59+
/* Required on MikroBus connector. */
60+
&gpio5 {
6061
status = "okay";
6162
};
6263

63-
&gpio1 {
64+
/* Required on Arduino connector. */
65+
&gpio4 {
6466
status = "okay";
6567
};
6668

67-
&gpio0 {
69+
/* Required on MikroBus connector. */
70+
&gpio3 {
6871
status = "okay";
6972
};
7073

74+
/* Required on SD card. */
7175
&gpio2 {
7276
status = "okay";
7377
};
7478

79+
/* Required on Arduino and MikroBus connector. */
80+
&gpio1 {
81+
status = "okay";
82+
};
83+
84+
/* Required on Arduino connector. */
85+
&gpio0 {
86+
status = "okay";
87+
};
88+
7589
&green_led {
7690
status = "okay";
7791
};
@@ -92,38 +106,63 @@
92106
status = "okay";
93107
};
94108

109+
/* Required on Arduino connector. */
95110
&flexcomm1_lpspi1 {
96111
status = "okay";
97112
};
98113

114+
/*
115+
* LPFLEXCOMM supports UART and I2C on the same instance, enable this for
116+
* LPLEXCOMM2 with LPUART2 and LPI2C2.
117+
*/
99118
&flexcomm2 {
100119
status = "okay";
101120
};
102121

122+
/* Required on Arduino and FlexIO LCD (touch panel) connector. */
103123
&flexcomm2_lpi2c2 {
104124
status = "okay";
105125
};
106126

107-
/*
108-
*LPFLEXCOMM supports UART and I2C on the same instance, enable this for
109-
* LFLEXCOMM2
110-
*/
127+
/* Required on Arduino connector. */
111128
&flexcomm2_lpuart2 {
112129
status = "okay";
113130
};
114131

132+
&flexcomm3 {
133+
status = "okay";
134+
};
135+
136+
/* Required on MikroBus connector. */
137+
&flexcomm3_lpi2c3 {
138+
status = "okay";
139+
};
140+
115141
&flexcomm4 {
116142
status = "okay";
117143
};
118144

145+
/* Required for serial console and on Camera connector. */
119146
&flexcomm4_lpuart4 {
120147
status = "okay";
121148
};
122149

150+
/*
151+
* LPFLEXCOMM6 supports SPI for MikroBus. Enable this for LPSPI6 but let
152+
* LPSPI6 disabled as long as it is not needed because of two shared signals
153+
* with SAI1 (P3_20 for SAI1_TXD0 and FC6_SPI_MOSI and P3_21 for SAI1_RXD0
154+
* and FC6_SPI_SCK). There is also an additional MikroBus signal shared
155+
* with SAI1 (P3_19 for SAI1_RX_FS and MikroBus:PWM).
156+
*/
157+
&flexcomm6 {
158+
status = "okay";
159+
};
160+
123161
&flexcomm7 {
124162
status = "okay";
125163
};
126164

165+
/* Required on Camera connector. */
127166
&flexcomm7_lpi2c7 {
128167
status = "okay";
129168
};

0 commit comments

Comments
 (0)