diff options
author | Yangbo Lu <yangbo.lu@freescale.com> | 2014-10-31 08:00:34 (GMT) |
---|---|---|
committer | Matthew Weigel <Matthew.Weigel@freescale.com> | 2014-12-11 18:40:16 (GMT) |
commit | 1468d507377042b2d647036ea81471e002aed61a (patch) | |
tree | 5f68eee50c8cf14948c161fd5a6fddbf768e93f1 /drivers/net/ethernet/freescale/fman/Peripherals/FM | |
parent | 3245cd9407d21247e7b0abf8a9b20b9659740dea (diff) | |
download | linux-fsl-qoriq-1468d507377042b2d647036ea81471e002aed61a.tar.xz |
dpaa_eth: add PTPd 1588 stack support
Support PTPd 1588 stack by adding PTP 1588 clock
using the dTSEC
Signed-off-by: Yangbo Lu <yangbo.lu@freescale.com>
Change-Id: I4f6fb9a721cede75c6cf23560014b55b46c84fef
Reviewed-on: http://git.am.freescale.net:8181/20295
Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com>
Reviewed-by: Xiaobo Xie <X.Xie@freescale.com>
Reviewed-by: Mandy Lavi <Mandy.Lavi@freescale.com>
Reviewed-by: Richard Schmitt <richard.schmitt@freescale.com>
Diffstat (limited to 'drivers/net/ethernet/freescale/fman/Peripherals/FM')
-rw-r--r-- | drivers/net/ethernet/freescale/fman/Peripherals/FM/Rtc/fm_rtc.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/drivers/net/ethernet/freescale/fman/Peripherals/FM/Rtc/fm_rtc.c b/drivers/net/ethernet/freescale/fman/Peripherals/FM/Rtc/fm_rtc.c index 312e5e3..2745dc4 100644 --- a/drivers/net/ethernet/freescale/fman/Peripherals/FM/Rtc/fm_rtc.c +++ b/drivers/net/ethernet/freescale/fman/Peripherals/FM/Rtc/fm_rtc.c @@ -661,6 +661,36 @@ t_Error FM_RTC_SetFreqCompensation(t_Handle h_FmRtc, uint32_t freqCompensation) return E_OK; } +#ifdef CONFIG_PTP_1588_CLOCK_DPAA +/*****************************************************************************/ +t_Error FM_RTC_EnableInterrupt(t_Handle h_FmRtc, uint32_t events) +{ + t_FmRtc *p_Rtc = (t_FmRtc *)h_FmRtc; + + SANITY_CHECK_RETURN_ERROR(p_Rtc, E_INVALID_HANDLE); + SANITY_CHECK_RETURN_ERROR(!p_Rtc->p_RtcDriverParam, E_INVALID_STATE); + + /* enable interrupt */ + fman_rtc_enable_interupt(p_Rtc->p_MemMap, events); + + return E_OK; +} + +/*****************************************************************************/ +t_Error FM_RTC_DisableInterrupt(t_Handle h_FmRtc, uint32_t events) +{ + t_FmRtc *p_Rtc = (t_FmRtc *)h_FmRtc; + + SANITY_CHECK_RETURN_ERROR(p_Rtc, E_INVALID_HANDLE); + SANITY_CHECK_RETURN_ERROR(!p_Rtc->p_RtcDriverParam, E_INVALID_STATE); + + /* disable interrupt */ + fman_rtc_disable_interupt(p_Rtc->p_MemMap, events); + + return E_OK; +} +#endif + /*****************************************************************************/ #if (defined(DEBUG_ERRORS) && (DEBUG_ERRORS > 0)) t_Error FM_RTC_DumpRegs(t_Handle h_FmRtc) |