Commit cc0dec3f authored by Paolo Abeni's avatar Paolo Abeni
Browse files

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/20250422-stmmac_ts-v1-0-b59c9f406041@bootlin.com



Signed-off-by: default avatarAlexis Lothoré <alexis.lothore@bootlin.com>
====================

Link: https://patch.msgid.link/20250423-stmmac_ts-v2-0-e2cf2bbd61b1@bootlin.com


Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
parents 607b310a 7b749137
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -320,8 +320,8 @@ enum rtc_control {

/* PTP and timestamping registers */

#define GMAC3_X_ATSNS       GENMASK(19, 16)
#define GMAC3_X_ATSNS_SHIFT 16
#define GMAC3_X_ATSNS       GENMASK(29, 25)
#define GMAC3_X_ATSNS_SHIFT 25

#define GMAC_PTP_TCR_ATSFC	BIT(24)
#define GMAC_PTP_TCR_ATSEN0	BIT(25)
+1 −1
Original line number Diff line number Diff line
@@ -553,7 +553,7 @@ void dwmac1000_get_ptptime(void __iomem *ptpaddr, u64 *ptp_time)
	u64 ns;

	ns = readl(ptpaddr + GMAC_PTP_ATNR);
	ns += readl(ptpaddr + GMAC_PTP_ATSR) * NSEC_PER_SEC;
	ns += (u64)readl(ptpaddr + GMAC_PTP_ATSR) * NSEC_PER_SEC;

	*ptp_time = ns;
}
+1 −1
Original line number Diff line number Diff line
@@ -222,7 +222,7 @@ static void get_ptptime(void __iomem *ptpaddr, u64 *ptp_time)
	u64 ns;

	ns = readl(ptpaddr + PTP_ATNR);
	ns += readl(ptpaddr + PTP_ATSR) * NSEC_PER_SEC;
	ns += (u64)readl(ptpaddr + PTP_ATSR) * NSEC_PER_SEC;

	*ptp_time = ns;
}