Skip to content

Commit cc0dec3

Browse files
author
Paolo Abeni
committed
Merge branch 'net-stmmac-fix-timestamp-snapshots-on-dwmac1000'
Alexis Lothore says: ==================== net: stmmac: fix timestamp snapshots on dwmac1000 this is the v2 of a small series containing two small fixes for the timestamp snapshot feature on stmmac, especially on dwmac1000 version. Those issues have been detected on a socfpga (Cyclone V) platform. They kind of follow the big rework sent by Maxime at the end of last year to properly split this feature support between different versions of the DWMAC IP. v1: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexis Lothoré <[email protected]> ==================== Link: https://patch.msgid.link/[email protected] Signed-off-by: Paolo Abeni <[email protected]>
2 parents 607b310 + 7b74913 commit cc0dec3

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

drivers/net/ethernet/stmicro/stmmac/dwmac1000.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -320,8 +320,8 @@ enum rtc_control {
320320

321321
/* PTP and timestamping registers */
322322

323-
#define GMAC3_X_ATSNS GENMASK(19, 16)
324-
#define GMAC3_X_ATSNS_SHIFT 16
323+
#define GMAC3_X_ATSNS GENMASK(29, 25)
324+
#define GMAC3_X_ATSNS_SHIFT 25
325325

326326
#define GMAC_PTP_TCR_ATSFC BIT(24)
327327
#define GMAC_PTP_TCR_ATSEN0 BIT(25)

drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -553,7 +553,7 @@ void dwmac1000_get_ptptime(void __iomem *ptpaddr, u64 *ptp_time)
553553
u64 ns;
554554

555555
ns = readl(ptpaddr + GMAC_PTP_ATNR);
556-
ns += readl(ptpaddr + GMAC_PTP_ATSR) * NSEC_PER_SEC;
556+
ns += (u64)readl(ptpaddr + GMAC_PTP_ATSR) * NSEC_PER_SEC;
557557

558558
*ptp_time = ns;
559559
}

drivers/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ static void get_ptptime(void __iomem *ptpaddr, u64 *ptp_time)
222222
u64 ns;
223223

224224
ns = readl(ptpaddr + PTP_ATNR);
225-
ns += readl(ptpaddr + PTP_ATSR) * NSEC_PER_SEC;
225+
ns += (u64)readl(ptpaddr + PTP_ATSR) * NSEC_PER_SEC;
226226

227227
*ptp_time = ns;
228228
}

0 commit comments

Comments
 (0)