Skip to content

Commit e0ca7bf

Browse files
committed
dts: arm: nxp: Added flexio pwm to dts
Updated the nxp_mcxw7x dts to include a flexio_pwm node. Signed-off-by: Emilio Benavente <emilio.benavente@nxp.com>
1 parent d163247 commit e0ca7bf

File tree

4 files changed

+25
-0
lines changed

4 files changed

+25
-0
lines changed

drivers/clock_control/clock_control_mcux_scg_k4.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,9 @@ static int mcux_scg_k4_get_rate(const struct device *dev, clock_control_subsys_t
6464
case SCG_K4_RTCOSC_CLK:
6565
clock_name = kCLOCK_RtcOscClk;
6666
break;
67+
case SCG_K4_FLEXIO_CLK:
68+
*rate = CLOCK_GetIpFreq(kCLOCK_Flexio0);
69+
return 0;
6770
default:
6871
LOG_ERR("Unsupported clock name");
6972
return -EINVAL;

dts/arm/nxp/nxp_mcxw7x_common.dtsi

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,21 @@
351351
interrupts = <18 0>;
352352
clk-divider = <0x0>;
353353
};
354+
355+
flexio: flexio@3a000 {
356+
compatible = "nxp,flexio";
357+
reg = <0x3a000 0x920>;
358+
interrupts = <46 0>;
359+
clocks = <&scg SCG_K4_FLEXIO_CLK 0xe8>;
360+
status = "disabled";
361+
362+
flexio_pwm {
363+
compatible = "nxp,flexio-pwm";
364+
#pwm-cells = <3>;
365+
status = "disabled";
366+
};
367+
};
368+
354369
};
355370

356371
&fast_peripheral0 {

include/zephyr/dt-bindings/clock/scg_k4.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,6 @@
1414
#define SCG_K4_SIRC_CLK 6U
1515
#define SCG_K4_FIRC_CLK 7U
1616
#define SCG_K4_RTCOSC_CLK 8U
17+
#define SCG_K4_FLEXIO_CLK 9U
1718

1819
#endif /* ZEPHYR_INCLUDE_DT_BINDINGS_CLOCK_SCG_K4_H_ */

soc/nxp/mcx/mcxw/soc.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,8 @@ __weak void clock_init(void)
131131
CLOCK_SetIpSrc(kCLOCK_Lpspi1, kCLOCK_IpSrcFro192M);
132132
CLOCK_SetIpSrc(kCLOCK_Lpadc0, kCLOCK_IpSrcFro192M);
133133
CLOCK_SetIpSrcDiv(kCLOCK_Lpadc0, kSCG_SysClkDivBy10);
134+
CLOCK_SetIpSrc(kCLOCK_Flexio0, kCLOCK_IpSrcFro192M);
135+
CLOCK_SetIpSrcDiv(kCLOCK_Flexio0, kSCG_SysClkDivBy6);
134136

135137
/* Ungate clocks if the peripheral is enabled in devicetree */
136138
if (DT_NODE_HAS_COMPAT_STATUS(DT_NODELABEL(gpioa), nxp_kinetis_gpio, okay)) {
@@ -192,6 +194,10 @@ __weak void clock_init(void)
192194
if (DT_NODE_HAS_COMPAT_STATUS(DT_NODELABEL(ewm0), nxp_ewm, okay)) {
193195
CLOCK_EnableClock(kCLOCK_Ewm0);
194196
}
197+
198+
if (DT_NODE_HAS_COMPAT_STATUS(DT_NODELABEL(flexio), nxp_flexio, okay)) {
199+
CLOCK_EnableClock(kCLOCK_Flexio0);
200+
}
195201
}
196202

197203
static void vbat_init(void)

0 commit comments

Comments
 (0)