clock: mcux_ccm: add gpt ipg clock

GPT IPG clock is using GPTx_CLK_ROOT.

Signed-off-by: Jiafei Pan <Jiafei.Pan@nxp.com>
This commit is contained in:
Jiafei Pan 2021-07-06 17:52:12 +08:00 committed by Carles Cufí
parent 6a9407ede4
commit 46ce8741bd
2 changed files with 13 additions and 0 deletions

View File

@ -292,6 +292,17 @@ static int mcux_ccm_get_subsys_rate(const struct device *dev,
case IMX_CCM_GPT_CLK:
*rate = CLOCK_GetFreq(kCLOCK_PerClk);
break;
#ifdef CONFIG_SOC_SERIES_IMX8M
case IMX_CCM_GPT_IPG_CLK:
{
uint32_t mux = CLOCK_GetRootMux(kCLOCK_RootGpt1);
if (mux == 0)
*rate = OSC24M_CLK_FREQ;
else
*rate = 0;
} break;
#endif
#endif
#ifdef CONFIG_COUNTER_MCUX_QTMR

View File

@ -70,4 +70,6 @@
#define IMX_CCM_ECSPI2_CLK 0x1201UL
#define IMX_CCM_ECSPI3_CLK 0x1202UL
#define IMX_CCM_GPT_IPG_CLK 0x1300UL
#endif /* ZEPHYR_INCLUDE_DT_BINDINGS_CLOCK_IMX_CCM_H_ */