summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorCsókás, Bence <csokas.bence@prolan.hu>2024-06-19 14:31:11 +0200
committerDavid S. Miller <davem@davemloft.net>2024-06-21 10:12:32 +0100
commitc32fe1986f27cac329767d3497986e306cad1d5e (patch)
treee9cec8a25c2bde39806408c64b2b6fa49a5e81c1 /drivers
parenta0c6359df6c70f0754728e5353e828967910575b (diff)
downloadlwn-c32fe1986f27cac329767d3497986e306cad1d5e.tar.gz
lwn-c32fe1986f27cac329767d3497986e306cad1d5e.zip
net: fec: Fix FEC_ECR_EN1588 being cleared on link-down
FEC_ECR_EN1588 bit gets cleared after MAC reset in `fec_stop()`, which makes all 1588 functionality shut down, and all the extended registers disappear, on link-down, making the adapter fall back to compatibility "dumb mode". However, some functionality needs to be retained (e.g. PPS) even without link. Fixes: 6605b730c061 ("FEC: Add time stamping code and a PTP hardware clock") Cc: Richard Cochran <richardcochran@gmail.com> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Link: https://lore.kernel.org/netdev/5fa9fadc-a89d-467a-aae9-c65469ff5fe1@lunn.ch/ Signed-off-by: Csókás, Bence <csokas.bence@prolan.hu> Reviewed-by: Wei Fang <wei.fang@nxp.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/ethernet/freescale/fec_main.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c
index 881ece735dcf..fb19295529a2 100644
--- a/drivers/net/ethernet/freescale/fec_main.c
+++ b/drivers/net/ethernet/freescale/fec_main.c
@@ -1361,6 +1361,12 @@ fec_stop(struct net_device *ndev)
writel(FEC_ECR_ETHEREN, fep->hwp + FEC_ECNTRL);
writel(rmii_mode, fep->hwp + FEC_R_CNTRL);
}
+
+ if (fep->bufdesc_ex) {
+ val = readl(fep->hwp + FEC_ECNTRL);
+ val |= FEC_ECR_EN1588;
+ writel(val, fep->hwp + FEC_ECNTRL);
+ }
}
static void