From e6ab316063efe269dbc459a0a7939fb55abd8c44 Mon Sep 17 00:00:00 2001
From: hc <hc@nodka.com>
Date: Wed, 15 Feb 2023 05:39:26 +0000
Subject: [PATCH] add wifi 4g uart0,3,4,5,7,9
---
kernel/drivers/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c | 17 ++++++-----------
1 files changed, 6 insertions(+), 11 deletions(-)
diff --git a/kernel/drivers/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c b/kernel/drivers/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c
index 08a058e..e1fbd7c 100644
--- a/kernel/drivers/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c
+++ b/kernel/drivers/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c
@@ -159,20 +159,15 @@
static void get_systime(void __iomem *ioaddr, u64 *systime)
{
- u64 ns, sec0, sec1;
+ u64 ns;
- /* Get the TSS value */
- sec1 = readl_relaxed(ioaddr + PTP_STSR);
- do {
- sec0 = sec1;
- /* Get the TSSS value */
- ns = readl_relaxed(ioaddr + PTP_STNSR);
- /* Get the TSS value */
- sec1 = readl_relaxed(ioaddr + PTP_STSR);
- } while (sec0 != sec1);
+ /* Get the TSSS value */
+ ns = readl(ioaddr + PTP_STNSR);
+ /* Get the TSS and convert sec time value to nanosecond */
+ ns += readl(ioaddr + PTP_STSR) * 1000000000ULL;
if (systime)
- *systime = ns + (sec1 * 1000000000ULL);
+ *systime = ns;
}
const struct stmmac_hwtimestamp stmmac_ptp = {
--
Gitblit v1.6.2