drivers: clock_control: Support NXP_ENET

Support ENET peripheral clock in MCUX SIM and CCM_REV2 driver

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
This commit is contained in:
Declan Snyder 2023-11-30 14:43:15 -06:00 committed by Carles Cufí
parent 20af909df5
commit 3ec0f3a462
4 changed files with 17 additions and 0 deletions

View file

@ -17,6 +17,11 @@ LOG_MODULE_REGISTER(clock_control);
static int mcux_ccm_on(const struct device *dev,
clock_control_subsys_t sub_system)
{
#ifdef CONFIG_ETH_NXP_ENET
if ((uint32_t)sub_system == IMX_CCM_ENET_CLK) {
CLOCK_EnableClock(kCLOCK_Enet);
}
#endif
return 0;
}

View file

@ -20,6 +20,12 @@ static int mcux_sim_on(const struct device *dev,
{
clock_ip_name_t clock_ip_name = (clock_ip_name_t) sub_system;
#ifdef CONFIG_ETH_NXP_ENET
if ((uint32_t)sub_system == KINETIS_SIM_ENET_CLK) {
clock_ip_name = kCLOCK_Enet0;
}
#endif
CLOCK_EnableClock(clock_ip_name);
return 0;
@ -45,6 +51,9 @@ static int mcux_sim_get_subsys_rate(const struct device *dev,
case KINETIS_SIM_LPO_CLK:
clock_name = kCLOCK_LpoClk;
break;
case KINETIS_SIM_ENET_CLK:
clock_name = kCLOCK_CoreSysClk;
break;
default:
clock_name = (clock_name_t) sub_system;
break;

View file

@ -86,6 +86,7 @@
/* ENET */
#define IMX_CCM_ENET_CLK 0x3000UL
#define IMX_CCM_ENET_PLL 0x3001UL
#endif /* ZEPHYR_INCLUDE_DT_BINDINGS_CLOCK_IMX_CCM_REV2_H_ */

View file

@ -24,5 +24,7 @@
#define KINETIS_SIM_ER32KSEL_RTC 2
#define KINETIS_SIM_ER32KSEL_LPO1KHZ 3
#define KINETIS_SIM_ENET_CLK 4321
#endif /* ZEPHYR_INCLUDE_DT_BINDINGS_CLOCK_KINETIS_SIM_H_ */