mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-03 18:12:25 -04:00
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: Alexis Lothoré <alexis.lothore@bootlin.com> ==================== Link: https://patch.msgid.link/20250423-stmmac_ts-v2-0-e2cf2bbd61b1@bootlin.com Signed-off-by: Paolo Abeni <pabeni@redhat.com>
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user