drivers: clock_control: syscon: Added Clock support for IRTC.
Added Clock Support code for the MCXN947 when IRTC is enabled. Signed-off-by: Emilio Benavente <emilio.benavente@nxp.com>
This commit is contained in:
parent
ca3041f11a
commit
4d77aa1eff
1 changed files with 17 additions and 0 deletions
|
|
@ -113,6 +113,23 @@ static int mcux_lpc_syscon_clock_control_on(const struct device *dev,
|
|||
}
|
||||
#endif
|
||||
|
||||
#if DT_NODE_HAS_STATUS(DT_NODELABEL(rtc), okay)
|
||||
#if CONFIG_SOC_SERIES_IMXRT5XX
|
||||
CLOCK_EnableOsc32K(true);
|
||||
#elif CONFIG_SOC_SERIES_IMXRT6XX
|
||||
/* No configuration */
|
||||
#else /* !CONFIG_SOC_SERIES_IMXRT5XX | !CONFIG_SOC_SERIES_IMXRT6XX */
|
||||
/* 0x0 Clock Select Value Set IRTC to use FRO 16K Clk */
|
||||
#if DT_PROP(DT_NODELABEL(rtc), clock_select) == 0x0
|
||||
CLOCK_SetupClk16KClocking(kCLOCK_Clk16KToVbat | kCLOCK_Clk16KToMain);
|
||||
/* 0x1 Clock Select Value Set IRTC to use Osc 32K Clk */
|
||||
#elif DT_PROP(DT_NODELABEL(rtc), clock_select) == 0x1
|
||||
CLOCK_SetupOsc32KClocking(kCLOCK_Osc32kToVbat | kCLOCK_Osc32kToMain);
|
||||
#endif /* DT_PROP(DT_NODELABEL(rtc), clock_select) */
|
||||
CLOCK_EnableClock(kCLOCK_Rtc0);
|
||||
#endif /* CONFIG_SOC_SERIES_IMXRT5XX */
|
||||
#endif /* DT_NODE_HAS_STATUS(DT_NODELABEL(rtc), okay) */
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue