Skip to content

Commit beb1e7b

Browse files
lucien-nxpkartben
authored andcommitted
drivers: clock_control: update clock_control_mcux_ccm_rev2.c driver
Due to clock designed on RT1180 has some different with other platforms, so add macro and handle the clock difference in mcux_ccm_get_subsys_rate. TPM1 use Bus_Aon as clock root. TPM3 use Bus_Wakeup as clock root. Other instances have independent clock root. Signed-off-by: Lucien Zhao <[email protected]>
1 parent 523d684 commit beb1e7b

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

drivers/clock_control/clock_control_mcux_ccm_rev2.c

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,11 +178,29 @@ static int mcux_ccm_get_subsys_rate(const struct device *dev,
178178

179179
return 0;
180180
#endif
181-
#ifdef CONFIG_COUNTER_MCUX_TPM
181+
#if defined(CONFIG_COUNTER_MCUX_TPM) || defined(CONFIG_PWM_MCUX_TPM)
182+
#if defined(CONFIG_SOC_SERIES_IMXRT118X)
183+
case IMX_CCM_TPM_CLK:
184+
switch (instance) {
185+
case 0:
186+
clock_root = kCLOCK_Root_Bus_Aon;
187+
break;
188+
case 1:
189+
clock_root = kCLOCK_Root_Tpm2;
190+
break;
191+
case 2:
192+
clock_root = kCLOCK_Root_Bus_Wakeup;
193+
break;
194+
default:
195+
clock_root = (kCLOCK_Root_Tpm4 + instance - 3);
196+
}
197+
break;
198+
#else
182199
case IMX_CCM_TPM_CLK:
183200
clock_root = kCLOCK_Root_Tpm1 + instance;
184201
break;
185202
#endif
203+
#endif
186204

187205
#ifdef CONFIG_MCUX_FLEXIO
188206
case IMX_CCM_FLEXIO1_CLK:

0 commit comments

Comments
 (0)