Skip to content

Commit 3f6925d

Browse files
NeilChen93kartben
authored andcommitted
boards: nxp: frdm_mcxa156: Support i3c for NXP frdm_mcxa156 board
Support i3c for NXP frdm_mcxa156 board. Test it using samples/sensor/thermometer. Signed-off-by: Neil Chen <[email protected]>
1 parent bb1036f commit 3f6925d

File tree

5 files changed

+43
-0
lines changed

5 files changed

+43
-0
lines changed

boards/nxp/frdm_mcxa156/board.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,12 @@ void board_early_init_hook(void)
165165
CLOCK_AttachClk(kFRO_HF_to_FLEXIO0);
166166
#endif
167167

168+
#if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(i3c0))
169+
/* Attach FRO_HF_DIV clock to I3C, 96MHz / 4 = 24MHz. */
170+
CLOCK_SetClockDiv(kCLOCK_DivI3C0_FCLK, 4U);
171+
CLOCK_AttachClk(kFRO_HF_DIV_to_I3C0FCLK);
172+
#endif
173+
168174
#if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(lpadc0))
169175
CLOCK_SetClockDiv(kCLOCK_DivADC0, 1u);
170176
CLOCK_AttachClk(kFRO12M_to_ADC0);

boards/nxp/frdm_mcxa156/doc/index.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ The FRDM-MCXA156 board configuration supports the following hardware features:
7171
+-----------+------------+-------------------------------------+
7272
| I2C | on-chip | i2c |
7373
+-----------+------------+-------------------------------------+
74+
| I3C | on-chip | i3c |
75+
+-----------+------------+-------------------------------------+
7476
| LPCMP | on-chip | sensor(comparator) |
7577
+-----------+------------+-------------------------------------+
7678
| LPSPI | on-chip | spi |

boards/nxp/frdm_mcxa156/frdm_mcxa156-pinctrl.dtsi

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,22 @@
8989
drive-strength = "low";
9090
};
9191
};
92+
pinmux_i3c0: pinmux_i3c0 {
93+
group0 {
94+
pinmux = <I3C0_SDA_P0_16>,
95+
<I3C0_SCL_P0_17>;
96+
slew-rate = "fast";
97+
drive-strength = "low";
98+
input-enable;
99+
bias-pull-up;
100+
};
101+
group1 {
102+
pinmux = <I3C0_PUR_P1_11>;
103+
slew-rate = "fast";
104+
drive-strength = "low";
105+
input-enable;
106+
};
107+
};
92108
pinmux_lpadc0: pinmux_lpadc0 {
93109
group0 {
94110
pinmux = <ADC0_A0_P2_0>,

boards/nxp/frdm_mcxa156/frdm_mcxa156.dts

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

1314
/ {
1415
model = "NXP FRDM_MCXA156 board";
@@ -23,6 +24,7 @@
2324
pwm-0 = &flexpwm0_pwm0;
2425
mcuboot-button0 = &user_button_2;
2526
watchdog0 = &wwdt0;
27+
ambient-temp0 = &p3t1755;
2628
};
2729

2830
chosen {
@@ -165,6 +167,22 @@ zephyr_mipi_dbi_parallel: &flexio0_lcd {
165167
pinctrl-names = "default";
166168
};
167169

170+
&i3c0 {
171+
status = "okay";
172+
pinctrl-0 = <&pinmux_i3c0>;
173+
pinctrl-names = "default";
174+
175+
i2c-scl-hz = <DT_FREQ_K(400)>;
176+
i3c-scl-hz = <DT_FREQ_M(4)>;
177+
i3c-od-scl-hz = <DT_FREQ_K(1500)>;
178+
179+
p3t1755: p3t1755@4800000236152a0090 {
180+
compatible = "nxp,p3t1755";
181+
reg = <0x48 0x0236 0x152a0090>;
182+
status = "okay";
183+
};
184+
};
185+
168186
&lpadc0 {
169187
status = "okay";
170188
pinctrl-0 = <&pinmux_lpadc0>;

boards/nxp/frdm_mcxa156/frdm_mcxa156.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ supported:
2222
- dac
2323
- dma
2424
- i2c
25+
- i3c
2526
- pwm
2627
- spi
2728
- usb_device

0 commit comments

Comments
 (0)