Skip to content

Commit d14c9c4

Browse files
peterwangszkartben
authored andcommitted
boards: frdm_mcxa166, frdm_mcxa276: add watchdog support
1. enable watchdog support 2. verified tests/drivers/watchdog/wdt_basic_api Signed-off-by: Peter Wang <chaoyi.wang@nxp.com>
1 parent d34ed32 commit d14c9c4

File tree

8 files changed

+38
-0
lines changed

8 files changed

+38
-0
lines changed

boards/nxp/frdm_mcxa166/board.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,11 @@ void board_early_init_hook(void)
153153
#if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(edma0))
154154
RESET_ReleasePeripheralReset(kDMA0_RST_SHIFT_RSTn);
155155
#endif
156+
157+
#if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(wwdt0))
158+
CLOCK_SetClockDiv(kCLOCK_DivWWDT0, 1u);
159+
#endif
160+
156161
/* Set SystemCoreClock variable. */
157162
SystemCoreClock = CLOCK_INIT_CORE_CLOCK;
158163
}

boards/nxp/frdm_mcxa166/frdm_mcxa166.dts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
led2 = &red_led;
2121
sw0 = &user_button_2;
2222
sw1 = &user_button_3;
23+
watchdog0 = &wwdt0;
2324
};
2425

2526
chosen {
@@ -140,3 +141,7 @@
140141
};
141142
};
142143
};
144+
145+
&wwdt0 {
146+
status = "okay";
147+
};

boards/nxp/frdm_mcxa166/frdm_mcxa166.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,5 @@ supported:
1717
- gpio
1818
- uart
1919
- flash
20+
- watchdog
2021
vendor: nxp

boards/nxp/frdm_mcxa276/board.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,11 @@ void board_early_init_hook(void)
153153
#if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(edma0))
154154
RESET_ReleasePeripheralReset(kDMA0_RST_SHIFT_RSTn);
155155
#endif
156+
157+
#if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(wwdt0))
158+
CLOCK_SetClockDiv(kCLOCK_DivWWDT0, 1u);
159+
#endif
160+
156161
/* Set SystemCoreClock variable. */
157162
SystemCoreClock = CLOCK_INIT_CORE_CLOCK;
158163
}

boards/nxp/frdm_mcxa276/frdm_mcxa276.dts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
led2 = &red_led;
2121
sw0 = &user_button_2;
2222
sw1 = &user_button_3;
23+
watchdog0 = &wwdt0;
2324
};
2425

2526
chosen {
@@ -140,3 +141,7 @@
140141
};
141142
};
142143
};
144+
145+
&wwdt0 {
146+
status = "okay";
147+
};

boards/nxp/frdm_mcxa276/frdm_mcxa276.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,5 @@ supported:
1717
- gpio
1818
- uart
1919
- flash
20+
- watchdog
2021
vendor: nxp

dts/arm/nxp/nxp_mcxa166.dtsi

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,14 @@
214214
no-error-irq;
215215
status = "disabled";
216216
};
217+
218+
wwdt0: watchdog@4000c000 {
219+
compatible = "nxp,lpc-wwdt";
220+
reg = <0x4000c000 0x1000>;
221+
interrupts = <60 0>;
222+
status = "disabled";
223+
clk-divider = <1>;
224+
};
217225
};
218226
};
219227

dts/arm/nxp/nxp_mcxa276.dtsi

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,14 @@
214214
no-error-irq;
215215
status = "disabled";
216216
};
217+
218+
wwdt0: watchdog@4000c000 {
219+
compatible = "nxp,lpc-wwdt";
220+
reg = <0x4000c000 0x1000>;
221+
interrupts = <60 0>;
222+
status = "disabled";
223+
clk-divider = <1>;
224+
};
217225
};
218226
};
219227

0 commit comments

Comments
 (0)