mirror of
https://abf.rosa.ru/djam/kernel-5.15.git
synced 2025-02-23 18:42:55 +00:00
61 lines
1.9 KiB
Diff
61 lines
1.9 KiB
Diff
![]() |
From b7110f36a3ea12867eabcd5caeb104d23e1a3f4a Mon Sep 17 00:00:00 2001
|
||
|
From: Alexey Sheplyakov <asheplyakov@altlinux.org>
|
||
|
Date: Wed, 24 Feb 2021 16:45:30 +0400
|
||
|
Subject: [PATCH 623/625] dwmac_baikal: clear PHY reset before calling generic
|
||
|
setup routine
|
||
|
|
||
|
Without this attaching to Micrel PHY fails with the following error:
|
||
|
|
||
|
[ 17.596114] Micrel KSZ9031 Gigabit PHY stmmac-2:03: phy_poll_reset failed: -110
|
||
|
[ 17.603602] baikal-dwmac 30250000.eth1 eth1: no phy at addr -1
|
||
|
[ 17.609468] baikal-dwmac 30250000.eth1 eth1: stmmac_open: Cannot attach to PHY (error: -19)
|
||
|
|
||
|
Closes: #39714
|
||
|
---
|
||
|
.../net/ethernet/stmicro/stmmac/dwmac-baikal.c | 15 +++++++++++----
|
||
|
1 file changed, 11 insertions(+), 4 deletions(-)
|
||
|
|
||
|
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-baikal.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-baikal.c
|
||
|
index 646051cd500d..e706ece9b4f5 100644
|
||
|
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-baikal.c
|
||
|
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-baikal.c
|
||
|
@@ -34,6 +34,14 @@ struct baikal_dwmac {
|
||
|
struct clk *tx2_clk;
|
||
|
};
|
||
|
|
||
|
+static void clear_phy_reset(void __iomem *ioaddr)
|
||
|
+{
|
||
|
+ u32 value;
|
||
|
+ value = readl(ioaddr + MAC_GPIO);
|
||
|
+ value |= MAC_GPIO_GPO0;
|
||
|
+ writel(value, ioaddr + MAC_GPIO);
|
||
|
+}
|
||
|
+
|
||
|
static int baikal_dwmac_dma_reset(void __iomem *ioaddr)
|
||
|
{
|
||
|
int err;
|
||
|
@@ -44,10 +52,7 @@ static int baikal_dwmac_dma_reset(void __iomem *ioaddr)
|
||
|
writel(value, ioaddr + DMA_BUS_MODE);
|
||
|
|
||
|
udelay(10);
|
||
|
- /* Clear PHY reset */
|
||
|
- value = readl(ioaddr + MAC_GPIO);
|
||
|
- value |= MAC_GPIO_GPO0;
|
||
|
- writel(value, ioaddr + MAC_GPIO);
|
||
|
+ clear_phy_reset(ioaddr);
|
||
|
pr_info("PHY re-inited for Baikal DWMAC\n");
|
||
|
|
||
|
err = readl_poll_timeout(ioaddr + DMA_BUS_MODE, value,
|
||
|
@@ -90,6 +95,8 @@ static struct mac_device_info* baikal_dwmac_setup(void *ppriv)
|
||
|
if (!mac)
|
||
|
return NULL;
|
||
|
|
||
|
+ clear_phy_reset(priv->ioaddr);
|
||
|
+
|
||
|
mac->dma = &baikal_dwmac_dma_ops;
|
||
|
old_mac = priv->hw;
|
||
|
priv->hw = mac;
|
||
|
--
|
||
|
2.31.1
|
||
|
|