ALT Linux kernel packages development
 help / color / mirror / Atom feed
From: Alexey Sheplyakov <asheplyakov@basealt.ru>
To: devel-kernel@lists.altlinux.org
Cc: rst@basealt.ru, nir@basealt.ru, sin@basealt.ru
Subject: [d-kernel] [PATCH 2/7] net: stmmac: removed obsolete Baikal-M specific mdio reset
Date: Tue, 23 Aug 2022 14:43:15 +0400
Message-ID: <20220823104318.2338489-3-asheplyakov@basealt.ru> (raw)
In-Reply-To: <20220823104318.2338489-1-asheplyakov@basealt.ru>

Signed-off-by: Alexey Sheplyakov <asheplyakov@basealt.ru>
---
 .../devicetree/bindings/net/snps,dwmac.yaml   |  2 +-
 .../net/ethernet/stmicro/stmmac/stmmac_mdio.c | 63 -------------------
 2 files changed, 1 insertion(+), 64 deletions(-)

diff --git a/Documentation/devicetree/bindings/net/snps,dwmac.yaml b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
index 014f1e95ba0d..61bb48b8396b 100644
--- a/Documentation/devicetree/bindings/net/snps,dwmac.yaml
+++ b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
@@ -53,12 +53,12 @@ properties:
         - allwinner,sun8i-r40-emac
         - allwinner,sun8i-v3s-emac
         - allwinner,sun50i-a64-emac
-        - baikal,dwmac
         - amlogic,meson6-dwmac
         - amlogic,meson8b-dwmac
         - amlogic,meson8m2-dwmac
         - amlogic,meson-gxbb-dwmac
         - amlogic,meson-axg-dwmac
+        - baikal,dwmac
         - ingenic,jz4775-mac
         - ingenic,x1000-mac
         - ingenic,x1600-mac
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c
index 639bcc35e928..a5d150c5f3d8 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c
@@ -346,63 +346,6 @@ static int stmmac_mdio_write(struct mii_bus *bus, int phyaddr, int phyreg,
 	return ret;
 }
 
-#define MAC_GPIO 0xe0 /* GPIO register */
-#define MAC_GPIO_GPO BIT(8)  /* output port */
-
-#if IS_ENABLED(CONFIG_STMMAC_PLATFORM) && IS_ENABLED(CONFIG_OF)
-/**
- * Reset the MII bus via MAC GP_OUT pin
- */
-static int stmmac_mdio_reset_gp_out(struct stmmac_priv *priv) {
-	u32 value, high, low;
-	u32 delays[3] = { 0, 0, 0 };
-	bool active_low = false;
-	struct device_node *np = priv->device->of_node;
-
-	if (!np)
-		return -ENODEV;
-
-	if (!of_property_read_bool(np, "snps,reset-gp-out")) {
-		dev_warn(priv->device, "snps,reset-gp-out is not set\n");
-		return -ENODEV;
-	}
-
-	dev_info(priv->device, "resetting MDIO via GP_OUT\n");
-	active_low = of_property_read_bool(np, "snsps,reset-active-low");
-	of_property_read_u32_array(np, "snps,reset-delays-us", delays, 3);
-
-	value = readl(priv->ioaddr + MAC_GPIO);
-	if (active_low) {
-		high = value | MAC_GPIO_GPO;
-		low = value & ~MAC_GPIO_GPO;
-	} else {
-		high = value & ~MAC_GPIO_GPO;
-		low = value | MAC_GPIO_GPO;
-	}
-
-	writel(high, priv->ioaddr + MAC_GPIO);
-	if (delays[0])
-		msleep(DIV_ROUND_UP(delays[0], 1000));
-
-	writel(low, priv->ioaddr + MAC_GPIO);
-	if (delays[1])
-		msleep(DIV_ROUND_UP(delays[1], 1000));
-
-	writel(high, priv->ioaddr + MAC_GPIO);
-	if (delays[2])
-		msleep(DIV_ROUND_UP(delays[2], 1000));
-
-	/* Clear PHY reset */
-	udelay(10);
-	value = readl(priv->ioaddr + MAC_GPIO);
-	value |= MAC_GPIO_GPO;
-	writel(value, priv->ioaddr + MAC_GPIO);
-	msleep(1000);
-	dev_info(priv->device, "mdio reset completed\n");
-	return 0;
-}
-#endif
-
 /**
  * stmmac_mdio_reset
  * @bus: points to the mii_bus structure
@@ -418,14 +361,8 @@ int stmmac_mdio_reset(struct mii_bus *bus)
 #ifdef CONFIG_OF
 	if (priv->device->of_node) {
 		struct gpio_desc *reset_gpio;
-		bool reset_gp_out;
 		u32 delays[3] = { 0, 0, 0 };
 
-		reset_gp_out = of_property_read_bool(priv->device->of_node,
-						     "snps,reset-gp-out");
-		if (reset_gp_out)
-			return stmmac_mdio_reset_gp_out(priv);
-
 		reset_gpio = devm_gpiod_get_optional(priv->device,
 						     "snps,reset",
 						     GPIOD_OUT_LOW);
-- 
2.32.0



  parent reply	other threads:[~2022-08-23 10:43 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-23 10:43 [d-kernel] p10/un-def: поддержка ноутбука Элпитех (и SDK-M 5.5) Alexey Sheplyakov
2022-08-23 10:43 ` [d-kernel] [PATCH 1/7] arm64: dts: wiped out obsolete Baikal-M device trees Alexey Sheplyakov
2022-08-23 10:43 ` Alexey Sheplyakov [this message]
2022-08-23 10:43 ` [d-kernel] [PATCH 3/7] Added PCI-E driver for Baikal-M with SDK-M 5.5 firmware Alexey Sheplyakov
2022-08-23 10:43 ` [d-kernel] [PATCH 4/7] input: new driver - serdev-serio Alexey Sheplyakov
2022-08-23 10:43 ` [d-kernel] [PATCH 5/7] drm/bridge: dw-hdmi: refreshed hw revision 0x2a support patch Alexey Sheplyakov
2022-08-23 10:43 ` [d-kernel] [PATCH 6/7] arm64/configs: refreshed Baikal-M specific config Alexey Sheplyakov
2022-08-23 10:43 ` [d-kernel] [PATCH 7/7] config-aarch64: enabled Baikal-M specific drivers Alexey Sheplyakov
2022-08-23 15:50 ` [d-kernel] p10/un-def: поддержка ноутбука Элпитех (и SDK-M 5.5) Vitaly Chikunov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220823104318.2338489-3-asheplyakov@basealt.ru \
    --to=asheplyakov@basealt.ru \
    --cc=devel-kernel@lists.altlinux.org \
    --cc=nir@basealt.ru \
    --cc=rst@basealt.ru \
    --cc=sin@basealt.ru \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

ALT Linux kernel packages development

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/devel-kernel/0 devel-kernel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 devel-kernel devel-kernel/ http://lore.altlinux.org/devel-kernel \
		devel-kernel@altlinux.org devel-kernel@altlinux.ru devel-kernel@altlinux.com
	public-inbox-index devel-kernel

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.devel-kernel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git