Loading drivers/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c +22 −0 Original line number Diff line number Diff line Loading @@ -24,6 +24,8 @@ #include "common.h" #include "stmmac_ptp.h" #define PTP_LIMIT 100000 static void stmmac_config_hw_tstamping(void __iomem *ioaddr, u32 data) { writel(data, ioaddr + PTP_TCR); Loading Loading @@ -65,6 +67,16 @@ static int stmmac_init_systime(void __iomem *ioaddr, u32 sec, u32 nsec) int limit; u32 value; /* wait for previous(if any) time initialization to complete. */ limit = PTP_LIMIT; while (limit--) { if (!(readl_relaxed(ioaddr + PTP_TCR) & PTP_TCR_TSINIT)) break; usleep_range(1000, 1500); } if (limit < 0) return -EBUSY; writel(sec, ioaddr + PTP_STSUR); writel(nsec, ioaddr + PTP_STNSUR); /* issue command to initialize the system time value */ Loading Loading @@ -115,6 +127,16 @@ static int stmmac_adjust_systime(void __iomem *ioaddr, u32 sec, u32 nsec, u32 value; int limit; /* wait for previous(if any) time adjust/update to complete. */ limit = PTP_LIMIT; while (limit--) { if (!(readl_relaxed(ioaddr + PTP_TCR) & PTP_TCR_TSUPDT)) break; usleep_range(1000, 1500); } if (limit < 0) return -EBUSY; if (add_sub) { /* If the new sec value needs to be subtracted with * the system time, then MAC_STSUR reg should be Loading drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +0 −9 Original line number Diff line number Diff line Loading @@ -562,9 +562,6 @@ static int stmmac_hwtstamp_ioctl(struct net_device *dev, struct ifreq *ifr) /* PTP v1, UDP, any kind of event packet */ config.rx_filter = HWTSTAMP_FILTER_PTP_V1_L4_EVENT; /* take time stamp for all event messages */ if (priv->plat->has_gmac4) snap_type_sel = PTP_GMAC4_TCR_SNAPTYPSEL_1; else snap_type_sel = PTP_TCR_SNAPTYPSEL_1; ptp_over_ipv4_udp = PTP_TCR_TSIPV4ENA; Loading Loading @@ -597,9 +594,6 @@ static int stmmac_hwtstamp_ioctl(struct net_device *dev, struct ifreq *ifr) config.rx_filter = HWTSTAMP_FILTER_PTP_V2_L4_EVENT; ptp_v2 = PTP_TCR_TSVER2ENA; /* take time stamp for all event messages */ if (priv->plat->has_gmac4) snap_type_sel = PTP_GMAC4_TCR_SNAPTYPSEL_1; else snap_type_sel = PTP_TCR_SNAPTYPSEL_1; ptp_over_ipv4_udp = PTP_TCR_TSIPV4ENA; Loading Loading @@ -634,9 +628,6 @@ static int stmmac_hwtstamp_ioctl(struct net_device *dev, struct ifreq *ifr) config.rx_filter = HWTSTAMP_FILTER_PTP_V2_EVENT; ptp_v2 = PTP_TCR_TSVER2ENA; /* take time stamp for all event messages */ if (priv->plat->has_gmac4) snap_type_sel = PTP_GMAC4_TCR_SNAPTYPSEL_1; else snap_type_sel = PTP_TCR_SNAPTYPSEL_1; ptp_over_ipv4_udp = PTP_TCR_TSIPV4ENA; Loading Loading
drivers/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c +22 −0 Original line number Diff line number Diff line Loading @@ -24,6 +24,8 @@ #include "common.h" #include "stmmac_ptp.h" #define PTP_LIMIT 100000 static void stmmac_config_hw_tstamping(void __iomem *ioaddr, u32 data) { writel(data, ioaddr + PTP_TCR); Loading Loading @@ -65,6 +67,16 @@ static int stmmac_init_systime(void __iomem *ioaddr, u32 sec, u32 nsec) int limit; u32 value; /* wait for previous(if any) time initialization to complete. */ limit = PTP_LIMIT; while (limit--) { if (!(readl_relaxed(ioaddr + PTP_TCR) & PTP_TCR_TSINIT)) break; usleep_range(1000, 1500); } if (limit < 0) return -EBUSY; writel(sec, ioaddr + PTP_STSUR); writel(nsec, ioaddr + PTP_STNSUR); /* issue command to initialize the system time value */ Loading Loading @@ -115,6 +127,16 @@ static int stmmac_adjust_systime(void __iomem *ioaddr, u32 sec, u32 nsec, u32 value; int limit; /* wait for previous(if any) time adjust/update to complete. */ limit = PTP_LIMIT; while (limit--) { if (!(readl_relaxed(ioaddr + PTP_TCR) & PTP_TCR_TSUPDT)) break; usleep_range(1000, 1500); } if (limit < 0) return -EBUSY; if (add_sub) { /* If the new sec value needs to be subtracted with * the system time, then MAC_STSUR reg should be Loading
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +0 −9 Original line number Diff line number Diff line Loading @@ -562,9 +562,6 @@ static int stmmac_hwtstamp_ioctl(struct net_device *dev, struct ifreq *ifr) /* PTP v1, UDP, any kind of event packet */ config.rx_filter = HWTSTAMP_FILTER_PTP_V1_L4_EVENT; /* take time stamp for all event messages */ if (priv->plat->has_gmac4) snap_type_sel = PTP_GMAC4_TCR_SNAPTYPSEL_1; else snap_type_sel = PTP_TCR_SNAPTYPSEL_1; ptp_over_ipv4_udp = PTP_TCR_TSIPV4ENA; Loading Loading @@ -597,9 +594,6 @@ static int stmmac_hwtstamp_ioctl(struct net_device *dev, struct ifreq *ifr) config.rx_filter = HWTSTAMP_FILTER_PTP_V2_L4_EVENT; ptp_v2 = PTP_TCR_TSVER2ENA; /* take time stamp for all event messages */ if (priv->plat->has_gmac4) snap_type_sel = PTP_GMAC4_TCR_SNAPTYPSEL_1; else snap_type_sel = PTP_TCR_SNAPTYPSEL_1; ptp_over_ipv4_udp = PTP_TCR_TSIPV4ENA; Loading Loading @@ -634,9 +628,6 @@ static int stmmac_hwtstamp_ioctl(struct net_device *dev, struct ifreq *ifr) config.rx_filter = HWTSTAMP_FILTER_PTP_V2_EVENT; ptp_v2 = PTP_TCR_TSVER2ENA; /* take time stamp for all event messages */ if (priv->plat->has_gmac4) snap_type_sel = PTP_GMAC4_TCR_SNAPTYPSEL_1; else snap_type_sel = PTP_TCR_SNAPTYPSEL_1; ptp_over_ipv4_udp = PTP_TCR_TSIPV4ENA; Loading