Skip to content

Commit 55db18b

Browse files
peterwangszkartben
authored andcommitted
boards: frdm_mcxa166, frdm_mcxa276: add i3c support
1. enable i3c driver and sensor p3t1755 2. verified samples/sensor/thermometer Signed-off-by: Peter Wang <[email protected]>
1 parent e53ceeb commit 55db18b

File tree

5 files changed

+53
-0
lines changed

5 files changed

+53
-0
lines changed

boards/nxp/frdm_mcxa276/board.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,11 @@ void board_early_init_hook(void)
192192
CLOCK_SetClockDiv(kCLOCK_DivADC, 1u);
193193
CLOCK_AttachClk(kFRO_LF_DIV_to_ADC);
194194

195+
#if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(i3c0))
196+
CLOCK_SetClockDiv(kCLOCK_DivI3C0_FCLK, 15U);
197+
CLOCK_AttachClk(kFRO_HF_DIV_to_I3C0FCLK);
198+
#endif
199+
195200
#if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(lpadc0))
196201
CLOCK_EnableClock(kCLOCK_GateADC0);
197202
#endif

boards/nxp/frdm_mcxa276/frdm_mcxa276-pinctrl.dtsi

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,22 @@
2727
};
2828
};
2929

30+
pinmux_i3c0: pinmux_i3c0 {
31+
group0 {
32+
pinmux = <I3C0_SDA_P1_8>,
33+
<I3C0_SCL_P1_9>;
34+
slew-rate = "fast";
35+
drive-strength = "low";
36+
input-enable;
37+
bias-pull-up;
38+
};
39+
group1 {
40+
pinmux = <I3C0_PUR_P0_2>;
41+
slew-rate = "fast";
42+
drive-strength = "low";
43+
input-enable;
44+
};
45+
};
3046
pinmux_lpadc0: pinmux_lpadc0 {
3147
group0 {
3248
pinmux = <ADC0_A7_P2_7>;

boards/nxp/frdm_mcxa276/frdm_mcxa276.dts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#include <nxp/nxp_mcxa276.dtsi>
1010
#include "frdm_mcxa276-pinctrl.dtsi"
1111
#include <zephyr/dt-bindings/input/input-event-codes.h>
12+
#include <freq.h>
1213

1314
/ {
1415
model = "NXP FRDM_MCXA276 board";
@@ -21,6 +22,7 @@
2122
sw0 = &user_button_2;
2223
sw1 = &user_button_3;
2324
watchdog0 = &wwdt0;
25+
ambient-temp0 = &p3t1755;
2426
};
2527

2628
chosen {
@@ -120,6 +122,22 @@
120122
status = "okay";
121123
};
122124

125+
&i3c0 {
126+
status = "okay";
127+
pinctrl-0 = <&pinmux_i3c0>;
128+
pinctrl-names = "default";
129+
130+
i2c-scl-hz = <DT_FREQ_K(400)>;
131+
i3c-scl-hz = <DT_FREQ_M(4)>;
132+
i3c-od-scl-hz = <DT_FREQ_K(1500)>;
133+
134+
p3t1755: p3t1755@4800000236152a0090 {
135+
compatible = "nxp,p3t1755";
136+
reg = <0x48 0x0236 0x152a0090>;
137+
status = "okay";
138+
};
139+
};
140+
123141
&lpadc0 {
124142
status = "okay";
125143
pinctrl-0 = <&pinmux_lpadc0>;

boards/nxp/frdm_mcxa276/frdm_mcxa276.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,5 @@ supported:
2323
- watchdog
2424
- counter
2525
- dma
26+
- i3c
2627
vendor: nxp

dts/arm/nxp/nxp_mcxa276.dtsi

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,19 @@
292292
status = "disabled";
293293
};
294294

295+
i3c0: i3c@40002000 {
296+
compatible = "nxp,mcux-i3c";
297+
reg = <0x40002000 0x1000>;
298+
interrupts = <24 0>;
299+
clocks = <&syscon MCUX_I3C_CLK>;
300+
clk-divider = <4>;
301+
clk-divider-slow = <1>;
302+
clk-divider-tc = <1>;
303+
status = "disabled";
304+
#address-cells = <3>;
305+
#size-cells = <0>;
306+
};
307+
295308
lpadc0: lpadc@400af000 {
296309
compatible = "nxp,lpc-lpadc";
297310
reg = <0x400af000 0x1000>;

0 commit comments

Comments
 (0)