Skip to content

Commit d7b219c

Browse files
yvesllkartben
authored andcommitted
dts: nxp: add ewm for mcxnx4x and ke1xz
Add ewm peripheral for nxp mcxnx4x and ke1xz. Attach xtal32k to ewm for frdm_mcxn947. Signed-off-by: Yves Wang <[email protected]>
1 parent 201f70b commit d7b219c

File tree

4 files changed

+28
-3
lines changed

4 files changed

+28
-3
lines changed

boards/nxp/frdm_mcxn947/board.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2024 NXP
2+
* Copyright 2024-2025 NXP
33
* SPDX-License-Identifier: Apache-2.0
44
*/
55
#include <zephyr/init.h>
@@ -442,6 +442,12 @@ void board_early_init_hook(void)
442442
CLOCK_EnableClock(kCLOCK_Sai1);
443443
#endif
444444

445+
#if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(ewm0))
446+
CLOCK_SetupOsc32KClocking(kCLOCK_Osc32kToWake);
447+
CLOCK_AttachClk(kXTAL32K2_to_EWM0);
448+
CLOCK_EnableClock(kCLOCK_Ewm0);
449+
#endif
450+
445451
/* Set SystemCoreClock variable. */
446452
SystemCoreClock = CLOCK_INIT_CORE_CLOCK;
447453
}

dts/arm/nxp/nxp_ke1xz.dtsi

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2024 NXP
2+
* Copyright 2024-2025 NXP
33
*
44
* SPDX-License-Identifier: Apache-2.0
55
*/
@@ -152,6 +152,14 @@
152152
#io-channel-cells = <1>;
153153
};
154154

155+
ewm0: ewm@40061000 {
156+
compatible = "nxp,ewm";
157+
reg = <0x40061000 0x6>;
158+
status = "disabled";
159+
interrupts = <28 0>;
160+
clk-divider = <0x0>;
161+
};
162+
155163
lpuart0: uart@4006a000 {
156164
compatible = "nxp,lpuart";
157165
reg = <0x4006a000 0x1000>;

dts/arm/nxp/nxp_mcxnx4x_common.dtsi

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -681,6 +681,14 @@
681681
clk-divider = <1>;
682682
};
683683

684+
ewm0: ewm@c0000 {
685+
compatible = "nxp,ewm";
686+
reg = <0xc0000 0x6>;
687+
interrupts = <100 0>;
688+
status = "disabled";
689+
clk-divider = <0x0>;
690+
};
691+
684692
flexpwm0: flexpwm@ce000 {
685693
compatible = "nxp,flexpwm";
686694
reg = <0xce000 0x1000>;

soc/nxp/kinetis/ke1xz/soc.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2024 NXP
2+
* Copyright 2024-2025 NXP
33
* Copyright (c) 2019-2021 Vestas Wind Systems A/S
44
*
55
* Based on NXP k6x soc.c, which is:
@@ -142,6 +142,9 @@ __weak void clk_init(void)
142142
CLOCK_SetIpSrc(kCLOCK_Adc0,
143143
DT_CLOCKS_CELL(DT_NODELABEL(adc0), ip_source));
144144
#endif
145+
#if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(ewm0))
146+
CLOCK_EnableClock(kCLOCK_Ewm0);
147+
#endif
145148
}
146149

147150
void soc_early_init_hook(void)

0 commit comments

Comments
 (0)