aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWillem de Bruijn <willemb@google.com>2014-07-25 18:01:29 -0400
committerDavid S. Miller <davem@davemloft.net>2014-07-29 14:39:49 -0400
commitc6d5fefaa35eda3dcab5c78a16def6ed555b685c (patch)
tree8e5ffcf5ae829d1924947c2a5642ca3332552fa7
parent13e9b9972fa0f34059e737ae215a26e43966b46f (diff)
octeon: remove deprecated syststamp timestamp
Hardware timestamps can be exposed to userspace in raw hardware format (hwtstamp) as well as converted to system time (syststamp). The second variant is deprecated and only implemented by this driver. The preferred method of hardware timestamp generation is to combine hwtstamp with a device PTP clock. Octeon has its own PTP library that relies on a shared memory interface to the PTP clock device. Signed-off-by: Willem de Bruijn <willemb@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ethernet/octeon/octeon_mgmt.c25
1 files changed, 1 insertions, 24 deletions
diff --git a/drivers/net/ethernet/octeon/octeon_mgmt.c b/drivers/net/ethernet/octeon/octeon_mgmt.c
index 7dc3e9b06d75..979c6980639f 100644
--- a/drivers/net/ethernet/octeon/octeon_mgmt.c
+++ b/drivers/net/ethernet/octeon/octeon_mgmt.c
@@ -247,28 +247,6 @@ static void octeon_mgmt_rx_fill_ring(struct net_device *netdev)
247 } 247 }
248} 248}
249 249
250static ktime_t ptp_to_ktime(u64 ptptime)
251{
252 ktime_t ktimebase;
253 u64 ptpbase;
254 unsigned long flags;
255
256 local_irq_save(flags);
257 /* Fill the icache with the code */
258 ktime_get_real();
259 /* Flush all pending operations */
260 mb();
261 /* Read the time and PTP clock as close together as
262 * possible. It is important that this sequence take the same
263 * amount of time to reduce jitter
264 */
265 ktimebase = ktime_get_real();
266 ptpbase = cvmx_read_csr(CVMX_MIO_PTP_CLOCK_HI);
267 local_irq_restore(flags);
268
269 return ktime_sub_ns(ktimebase, ptpbase - ptptime);
270}
271
272static void octeon_mgmt_clean_tx_buffers(struct octeon_mgmt *p) 250static void octeon_mgmt_clean_tx_buffers(struct octeon_mgmt *p)
273{ 251{
274 union cvmx_mixx_orcnt mix_orcnt; 252 union cvmx_mixx_orcnt mix_orcnt;
@@ -312,12 +290,12 @@ static void octeon_mgmt_clean_tx_buffers(struct octeon_mgmt *p)
312 /* Read the hardware TX timestamp if one was recorded */ 290 /* Read the hardware TX timestamp if one was recorded */
313 if (unlikely(re.s.tstamp)) { 291 if (unlikely(re.s.tstamp)) {
314 struct skb_shared_hwtstamps ts; 292 struct skb_shared_hwtstamps ts;
293 memset(&ts, 0, sizeof(ts));
315 /* Read the timestamp */ 294 /* Read the timestamp */
316 u64 ns = cvmx_read_csr(CVMX_MIXX_TSTAMP(p->port)); 295 u64 ns = cvmx_read_csr(CVMX_MIXX_TSTAMP(p->port));
317 /* Remove the timestamp from the FIFO */ 296 /* Remove the timestamp from the FIFO */
318 cvmx_write_csr(CVMX_MIXX_TSCTL(p->port), 0); 297 cvmx_write_csr(CVMX_MIXX_TSCTL(p->port), 0);
319 /* Tell the kernel about the timestamp */ 298 /* Tell the kernel about the timestamp */
320 ts.syststamp = ptp_to_ktime(ns);
321 ts.hwtstamp = ns_to_ktime(ns); 299 ts.hwtstamp = ns_to_ktime(ns);
322 skb_tstamp_tx(skb, &ts); 300 skb_tstamp_tx(skb, &ts);
323 } 301 }
@@ -429,7 +407,6 @@ good:
429 struct skb_shared_hwtstamps *ts; 407 struct skb_shared_hwtstamps *ts;
430 ts = skb_hwtstamps(skb); 408 ts = skb_hwtstamps(skb);
431 ts->hwtstamp = ns_to_ktime(ns); 409 ts->hwtstamp = ns_to_ktime(ns);
432 ts->syststamp = ptp_to_ktime(ns);
433 __skb_pull(skb, 8); 410 __skb_pull(skb, 8);
434 } 411 }
435 skb->protocol = eth_type_trans(skb, netdev); 412 skb->protocol = eth_type_trans(skb, netdev);