Skip to content

Commit f3c2df0

Browse files
committed
boards: nxp: mcxn series: Enable FRO16k for LPTMR
Enabled FRO16k for LPTMR when LPTMR clock source is set to 0x1. Signed-off-by: Zhaoxiang Jin <[email protected]>
1 parent 382b13b commit f3c2df0

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

boards/nxp/frdm_mcxn236/board.c

Lines changed: 8 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>
@@ -8,6 +8,10 @@
88
#include <fsl_clock.h>
99
#include <fsl_spc.h>
1010
#include <soc.h>
11+
#if defined(CONFIG_PM) || defined(CONFIG_POWEROFF)
12+
#include <fsl_vbat.h>
13+
#endif
14+
1115
#if CONFIG_USB_DC_NXP_EHCI
1216
#include "usb_phy.h"
1317
#include "usb.h"
@@ -295,6 +299,9 @@ void board_early_init_hook(void)
295299
CLOCK_SetupClockCtrl(kCLOCK_FRO12MHZ_ENA);
296300
#elif DT_PROP(DT_NODELABEL(lptmr0), clk_source) == 0x1
297301
CLOCK_SetupClk16KClocking(kCLOCK_Clk16KToVsys);
302+
#if defined(CONFIG_PM) || defined(CONFIG_POWEROFF)
303+
VBAT_EnableFRO16k(VBAT0, true);
304+
#endif
298305
#elif DT_PROP(DT_NODELABEL(lptmr0), clk_source) == 0x2
299306
CLOCK_SetupOsc32KClocking(kCLOCK_Osc32kToVsys);
300307
#elif DT_PROP(DT_NODELABEL(lptmr0), clk_source) == 0x3

boards/nxp/frdm_mcxn947/board.c

Lines changed: 8 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>
@@ -8,6 +8,10 @@
88
#include <fsl_clock.h>
99
#include <fsl_spc.h>
1010
#include <soc.h>
11+
#if defined(CONFIG_PM) || defined(CONFIG_POWEROFF)
12+
#include <fsl_vbat.h>
13+
#endif
14+
1115
#if CONFIG_USB_DC_NXP_EHCI
1216
#include "usb_phy.h"
1317
#include "usb.h"
@@ -365,6 +369,9 @@ void board_early_init_hook(void)
365369
CLOCK_SetupClockCtrl(kCLOCK_FRO12MHZ_ENA);
366370
#elif DT_PROP(DT_NODELABEL(lptmr0), clk_source) == 0x1
367371
CLOCK_SetupClk16KClocking(kCLOCK_Clk16KToVsys);
372+
#if defined(CONFIG_PM) || defined(CONFIG_POWEROFF)
373+
VBAT_EnableFRO16k(VBAT0, true);
374+
#endif
368375
#elif DT_PROP(DT_NODELABEL(lptmr0), clk_source) == 0x2
369376
CLOCK_SetupOsc32KClocking(kCLOCK_Osc32kToVsys);
370377
#elif DT_PROP(DT_NODELABEL(lptmr0), clk_source) == 0x3

0 commit comments

Comments
 (0)