drivers: eth: mcux: Separate PTP clock from gPTP support

It is possible that user wants to access PTP clock but does
not need gPTP support. The networking txtime sample does exactly
this.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
This commit is contained in:
Jukka Rissanen 2020-12-02 14:51:14 +02:00 committed by Jukka Rissanen
commit 476b1885ce
2 changed files with 5 additions and 5 deletions

View file

@ -71,7 +71,7 @@ config ETH_MCUX_HW_ACCELERATION
config PTP_CLOCK_MCUX config PTP_CLOCK_MCUX
bool "MCUX PTP clock driver support" bool "MCUX PTP clock driver support"
default y default y
depends on PTP_CLOCK && NET_PKT_TIMESTAMP depends on PTP_CLOCK || (NET_PKT_TIMESTAMP && NET_GPTP)
help help
Enable MCUX PTP clock support. Enable MCUX PTP clock support.

View file

@ -833,7 +833,7 @@ error:
eth_stats_update_errors_rx(get_iface(context, vlan_tag)); eth_stats_update_errors_rx(get_iface(context, vlan_tag));
} }
#if defined(CONFIG_PTP_CLOCK_MCUX) #if defined(CONFIG_PTP_CLOCK_MCUX) && defined(CONFIG_NET_GPTP)
static inline void ts_register_tx_event(struct eth_context *context, static inline void ts_register_tx_event(struct eth_context *context,
enet_frame_info_t *frameinfo) enet_frame_info_t *frameinfo)
{ {
@ -865,7 +865,7 @@ static inline void ts_register_tx_event(struct eth_context *context,
ts_tx_rd = 0; ts_tx_rd = 0;
} }
} }
#endif /* CONFIG_PTP_CLOCK_MCUX */ #endif /* CONFIG_PTP_CLOCK_MCUX && CONFIG_NET_PKT_TIMESTAMP */
static void eth_callback(ENET_Type *base, enet_handle_t *handle, static void eth_callback(ENET_Type *base, enet_handle_t *handle,
#if FSL_FEATURE_ENET_QUEUE > 1 #if FSL_FEATURE_ENET_QUEUE > 1
@ -880,10 +880,10 @@ static void eth_callback(ENET_Type *base, enet_handle_t *handle,
eth_rx(context); eth_rx(context);
break; break;
case kENET_TxEvent: case kENET_TxEvent:
#if defined(CONFIG_PTP_CLOCK_MCUX) #if defined(CONFIG_PTP_CLOCK_MCUX) && defined(CONFIG_NET_GPTP)
/* Register event */ /* Register event */
ts_register_tx_event(context, frameinfo); ts_register_tx_event(context, frameinfo);
#endif /* CONFIG_PTP_CLOCK_MCUX */ #endif /* CONFIG_PTP_CLOCK_MCUX && CONFIG_NET_GPTP */
/* Free the TX buffer. */ /* Free the TX buffer. */
k_sem_give(&context->tx_buf_sem); k_sem_give(&context->tx_buf_sem);