From 9ac2ee91f2f89869d7b6b08b0ddabe9f9e5129ed Mon Sep 17 00:00:00 2001 From: Declan Snyder Date: Fri, 15 Mar 2024 15:15:27 -0500 Subject: [PATCH] drivers: nxp_enet: Correct PTP clock dependencies The dependencies should be in a 'depends on' clause. Also, 'depends on PTP_CLOCK' is redundant because this is within 'if PTP_CLOCK' already. Additionally, conditionally include the PTP header in the mac driver. Signed-off-by: Declan Snyder --- drivers/ptp_clock/Kconfig.nxp_enet | 4 ++-- soc/nxp/imxrt/imxrt10xx/soc.c | 2 +- soc/nxp/imxrt/imxrt11xx/soc.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/ptp_clock/Kconfig.nxp_enet b/drivers/ptp_clock/Kconfig.nxp_enet index aa9c8d5e41b..36252d2f9c4 100644 --- a/drivers/ptp_clock/Kconfig.nxp_enet +++ b/drivers/ptp_clock/Kconfig.nxp_enet @@ -3,7 +3,7 @@ config PTP_CLOCK_NXP_ENET bool "NXP ENET PTP Clock driver" - default y if DT_HAS_NXP_ENET_PTP_CLOCK_ENABLED && \ - (PTP_CLOCK || NET_L2_PTP) + default y + depends on DT_HAS_NXP_ENET_PTP_CLOCK_ENABLED && NET_L2_PTP help Enable NXP ENET PTP clock support. diff --git a/soc/nxp/imxrt/imxrt10xx/soc.c b/soc/nxp/imxrt/imxrt10xx/soc.c index 0e4bae616a6..97e2eba977a 100644 --- a/soc/nxp/imxrt/imxrt10xx/soc.c +++ b/soc/nxp/imxrt/imxrt10xx/soc.c @@ -64,7 +64,7 @@ const clock_enet_pll_config_t ethPllConfig = { .enableClkOutput1 = true, #endif #endif -#if defined(CONFIG_PTP_CLOCK_MCUX) +#if defined(CONFIG_PTP_CLOCK_MCUX) || defined(CONFIG_PTP_CLOCK_NXP_ENET) .enableClkOutput25M = true, #else .enableClkOutput25M = false, diff --git a/soc/nxp/imxrt/imxrt11xx/soc.c b/soc/nxp/imxrt/imxrt11xx/soc.c index 9eee69ad66a..5da3b122e33 100644 --- a/soc/nxp/imxrt/imxrt11xx/soc.c +++ b/soc/nxp/imxrt/imxrt11xx/soc.c @@ -437,7 +437,7 @@ static ALWAYS_INLINE void clock_init(void) #endif #endif -#ifdef CONFIG_PTP_CLOCK_MCUX +#if defined(CONFIG_PTP_CLOCK_MCUX) || defined(CONFIG_PTP_CLOCK_NXP_ENET) /* 24MHz PTP clock */ rootCfg.mux = kCLOCK_ENET_TIMER1_ClockRoot_MuxOscRc48MDiv2; rootCfg.div = 1;