From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on sa.local.altlinux.org X-Spam-Level: X-Spam-Status: No, score=-4.3 required=5.0 tests=ALL_TRUSTED,BAYES_00, RP_MATCHES_RCVD autolearn=unavailable autolearn_force=no version=3.4.1 From: Alexey Sheplyakov To: devel-kernel@lists.altlinux.org Date: Fri, 2 Sep 2022 11:18:55 +0400 Message-Id: <20220902071858.8021-3-asheplyakov@basealt.ru> X-Mailer: git-send-email 2.33.3 In-Reply-To: <20220902071858.8021-1-asheplyakov@basealt.ru> References: <20220902071858.8021-1-asheplyakov@basealt.ru> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 X-BeenThere: devel-kernel@lists.altlinux.org X-Mailman-Version: 2.1.12 Precedence: list Reply-To: ALT Linux kernel packages development List-Id: ALT Linux kernel packages development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Sep 2022 07:19:59 -0000 Archived-At: List-Archive: List-Post: Signed-off-by: Alexey Sheplyakov --- .../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.33.3