From patchwork Mon Mar 21 09:56:46 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dylan Hung X-Patchwork-Id: 12788100 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 54F4EC433FE for ; Tue, 22 Mar 2022 06:11:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=K4fRAhJ9FLfsYAwAaHySJDDKvO6FZpulzd+9CgfP3Is=; b=MMbJU13fnjLxkt S+A1O5U5TqkLqXMcRHqieQHwfSU17X1R31h/7mWchc4LAGDk90txnZJqRL/Dxvn3Tm1N8YgUZtuUR QOx79hRXWt3YQ76/piL9OxUW4ojdJzz9ISfAQJzJz95APEt/tU0S/eu0ZJ2lBRekPej7y4jEAcE7W Q9zsNKqFzuJyWE6fDRB4x0JG02/NHCeqwzW8yllDZ2dG7R1CUlj88JEOlbuKESb2QH+Vmd2uJVCw5 7w0ugEQ98aaR1wriEOA1MSNkxf345u+fJwf+tfVG22dQ2+d5PCPJGHHxzIXxVbH00YnSsbNx7IgwV NK8UUrqv3SWqFgv5gIGg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nWXij-00A5wW-LS; Tue, 22 Mar 2022 06:10:17 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nWXiZ-00A5t2-At for linux-arm-kernel@bombadil.infradead.org; Tue, 22 Mar 2022 06:10:07 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Type:Content-Transfer-Encoding :MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From: Sender:Reply-To:Content-ID:Content-Description; bh=bWlG+m3AWnUXMG8ENt7T2kY2yf7i/80EB2yG8WT8Bfc=; b=YjNGmMZSmHS/xQWHeW/HkLTD2l MXGZjT34FzoYN9ezHXgbWfhp08kytNhSoTfKjwe7KIwo1fDICUfeCrqksJHQFu3SWI6zMf/98Pkdn zMwBKhUYeU+axsxmUhPG3cpZHX8+Oxh2wONbiGB/VvvNd93rwoq9vi7j9YerEoRk2/a9GfT/h9B/A xqBwI+x7Kco36Ad021nIaswLUIxOxT0dmlJMspxrDFydU9QFbwiFHhUugL3o7KxVQDhetyOu0lSNm rsSBWL84MSVs7ejmL6J56wKdVut+KMixO5jvWEc7xaU/CXnVPL2W3TQ3DsbBx21I1rrPzEsyBOvUf Z/GwdYXg==; Received: from twspam01.aspeedtech.com ([211.20.114.71]) by desiato.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nWEmy-0035PB-Qs for linux-arm-kernel@lists.infradead.org; Mon, 21 Mar 2022 09:57:27 +0000 Received: from mail.aspeedtech.com ([192.168.0.24]) by twspam01.aspeedtech.com with ESMTP id 22L9jwMZ079098; Mon, 21 Mar 2022 17:45:58 +0800 (GMT-8) (envelope-from dylan_hung@aspeedtech.com) Received: from DylanHung-PC.aspeed.com (192.168.2.216) by TWMBX02.aspeed.com (192.168.0.24) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 21 Mar 2022 17:56:23 +0800 From: Dylan Hung To: , , , , , , , , , , , , , , CC: , Subject: [PATCH v2 1/3] dt-bindings: net: add reset property for aspeed, ast2600-mdio binding Date: Mon, 21 Mar 2022 17:56:46 +0800 Message-ID: <20220321095648.4760-2-dylan_hung@aspeedtech.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220321095648.4760-1-dylan_hung@aspeedtech.com> References: <20220321095648.4760-1-dylan_hung@aspeedtech.com> MIME-Version: 1.0 X-Originating-IP: [192.168.2.216] X-ClientProxiedBy: TWMBX02.aspeed.com (192.168.0.24) To TWMBX02.aspeed.com (192.168.0.24) X-DNSRBL: X-MAIL: twspam01.aspeedtech.com 22L9jwMZ079098 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220321_095725_646645_C6702436 X-CRM114-Status: UNSURE ( 8.25 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The AST2600 MDIO bus controller has a reset control bit and must be deasserted before the manipulating the MDIO controller. Signed-off-by: Dylan Hung Cc: stable@vger.kernel.org --- .../devicetree/bindings/net/aspeed,ast2600-mdio.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Documentation/devicetree/bindings/net/aspeed,ast2600-mdio.yaml b/Documentation/devicetree/bindings/net/aspeed,ast2600-mdio.yaml index 1c88820cbcdf..8ba108e25d94 100644 --- a/Documentation/devicetree/bindings/net/aspeed,ast2600-mdio.yaml +++ b/Documentation/devicetree/bindings/net/aspeed,ast2600-mdio.yaml @@ -23,12 +23,15 @@ properties: reg: maxItems: 1 description: The register range of the MDIO controller instance + resets: + maxItems: 1 required: - compatible - reg - "#address-cells" - "#size-cells" + - resets unevaluatedProperties: false @@ -39,6 +42,7 @@ examples: reg = <0x1e650000 0x8>; #address-cells = <1>; #size-cells = <0>; + resets = <&syscon 35>; ethphy0: ethernet-phy@0 { compatible = "ethernet-phy-ieee802.3-c22"; From patchwork Mon Mar 21 09:56:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dylan Hung X-Patchwork-Id: 12788101 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 02170C433EF for ; Tue, 22 Mar 2022 06:11:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=suu/coEDIahY7eDYG/hw5wXbTrsbakC0avVj6LoK6Cc=; b=FuP+MuXFug5aXj rQBN0RcG1xjdWs8k0LEU7DMF2+mUZH6Ifx51jRVxaLyEl77gPA4Cen09snegHnMcvcwkCZ5Oc251h G4NZzoExSvxWl3p+tOqV9ZL/twh7syYwB48h7Q2wXPiyEmqX//GTBT2/TRKm/Agx+0iO8YObiyLCl ahsg5iLa135KZpvsYEE5SfdS+35NEV3qtvWh0tDfA9EVWBN0qfb/mdMNs4r88qJiFG6wXQJZbrEcQ tSGHC/zECmjyZeKDuscj3ykiapvT49oAPtA/dJVs2+iOgwjbS/ONB8AmOMEAIqS6s4iJtNXsyJY7G WdhGWs4zuJNL73PPniRA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nWXj4-00A61e-9h; Tue, 22 Mar 2022 06:10:38 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nWXic-00A5uH-A0 for linux-arm-kernel@bombadil.infradead.org; Tue, 22 Mar 2022 06:10:10 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Type:Content-Transfer-Encoding :MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From: Sender:Reply-To:Content-ID:Content-Description; bh=LuMbXbBelITZsR2Q2ibGaS+q4loqRrKNhNdOA2zt0n0=; b=Mse56SHLwcUY+jWG9dcefUBt14 U0VNHzsIdGs2HFhAdQY2qZLB+FlaaC7AnkVFZk/EMWEtGvRXVFtqq/QF/De9BmbbZ0sZVEB4AScAu BuaSg9nXm5O5Z2DUawBaZY58m7/c/3vE9j4XN8DX80mN4W1+yiKPhJZWwnzMItx5WwHDEzIhczbhn gqeoeLKVzH/vsyFCDsLMTtzt9LthMj+pu15MmVR/W3u/aENTuJYxPxTxkG/NOlNgrMWu0XHehcTfT RkMddUEPmknLtEuFQ1pFQz0JdZjrHjfl47wXJKX/WE1eXlsaLj+SFVB0yJCLSSN1UhjjgjhXuU01l MHx5otKg==; Received: from twspam01.aspeedtech.com ([211.20.114.71]) by desiato.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nWEmy-0035P5-0g for linux-arm-kernel@lists.infradead.org; Mon, 21 Mar 2022 09:57:27 +0000 Received: from mail.aspeedtech.com ([192.168.0.24]) by twspam01.aspeedtech.com with ESMTP id 22L9jwJu079099; Mon, 21 Mar 2022 17:45:58 +0800 (GMT-8) (envelope-from dylan_hung@aspeedtech.com) Received: from DylanHung-PC.aspeed.com (192.168.2.216) by TWMBX02.aspeed.com (192.168.0.24) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 21 Mar 2022 17:56:23 +0800 From: Dylan Hung To: , , , , , , , , , , , , , , CC: , Subject: [PATCH v2 2/3] net: mdio: add reset control for Aspeed MDIO Date: Mon, 21 Mar 2022 17:56:47 +0800 Message-ID: <20220321095648.4760-3-dylan_hung@aspeedtech.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220321095648.4760-1-dylan_hung@aspeedtech.com> References: <20220321095648.4760-1-dylan_hung@aspeedtech.com> MIME-Version: 1.0 X-Originating-IP: [192.168.2.216] X-ClientProxiedBy: TWMBX02.aspeed.com (192.168.0.24) To TWMBX02.aspeed.com (192.168.0.24) X-DNSRBL: X-MAIL: twspam01.aspeedtech.com 22L9jwJu079099 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220321_095724_682235_46758EBA X-CRM114-Status: GOOD ( 12.88 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Add reset assertion/deassertion for Aspeed MDIO. There are 4 MDIO controllers embedded in Aspeed AST2600 SOC and share one reset control register SCU50[3]. So devm_reset_control_get_shared is used in this change. Signed-off-by: Dylan Hung Cc: stable@vger.kernel.org --- drivers/net/mdio/mdio-aspeed.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/drivers/net/mdio/mdio-aspeed.c b/drivers/net/mdio/mdio-aspeed.c index e2273588c75b..5bda48d7071d 100644 --- a/drivers/net/mdio/mdio-aspeed.c +++ b/drivers/net/mdio/mdio-aspeed.c @@ -3,6 +3,7 @@ #include #include +#include #include #include #include @@ -37,6 +38,7 @@ struct aspeed_mdio { void __iomem *base; + struct reset_control *reset; }; static int aspeed_mdio_read(struct mii_bus *bus, int addr, int regnum) @@ -120,6 +122,12 @@ static int aspeed_mdio_probe(struct platform_device *pdev) if (IS_ERR(ctx->base)) return PTR_ERR(ctx->base); + ctx->reset = devm_reset_control_get_shared(&pdev->dev, NULL); + if (IS_ERR(ctx->reset)) + return PTR_ERR(ctx->reset); + + reset_control_deassert(ctx->reset); + bus->name = DRV_NAME; snprintf(bus->id, MII_BUS_ID_SIZE, "%s%d", pdev->name, pdev->id); bus->parent = &pdev->dev; @@ -129,6 +137,7 @@ static int aspeed_mdio_probe(struct platform_device *pdev) rc = of_mdiobus_register(bus, pdev->dev.of_node); if (rc) { dev_err(&pdev->dev, "Cannot register MDIO bus!\n"); + reset_control_assert(ctx->reset); return rc; } @@ -139,7 +148,11 @@ static int aspeed_mdio_probe(struct platform_device *pdev) static int aspeed_mdio_remove(struct platform_device *pdev) { - mdiobus_unregister(platform_get_drvdata(pdev)); + struct mii_bus *bus = (struct mii_bus *)platform_get_drvdata(pdev); + struct aspeed_mdio *ctx = bus->priv; + + reset_control_assert(ctx->reset); + mdiobus_unregister(bus); return 0; } From patchwork Mon Mar 21 09:56:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dylan Hung X-Patchwork-Id: 12788098 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 31F45C433F5 for ; Tue, 22 Mar 2022 06:11:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Li0dAEXTkGI4n9TQiMpCYg5BVJtqKy+Puv3usrLlXvE=; b=JvzrbxHdLeGS/y aWHkbQxFv7Jyq451HJyDf9GlXQQHJoej7pCymbek3C2RNcCjK3raTOQOpoj8xA+5/OXppLvSWAjio djxEmi4JGZpdveKsTUsTJiFa15M/NnlDiRSPwON0u2BToNhixw5t/0JHl5dPwuRM1iw3ZvulY2XfQ O1HS5aGdOp4c2N29+iRSb81cGl9N3J7F+rOfW9Q4UPRdJyvcWaHRW7/Y6DfTJrI8i8rjY9rw8UlXf i2kxpJEoMnymY9aPmlj4MiUZP8Vr4OU3gNogIyC5PlMFB/D+lRWRqMWywldI+IrRZqIPjj8kZFRoA cRLU9xqdXdyO0lib15jw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nWXiZ-00A5tH-Qy; Tue, 22 Mar 2022 06:10:07 +0000 Received: from desiato.infradead.org ([90.155.92.199]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nWXiX-00A5sb-Lj for linux-arm-kernel@bombadil.infradead.org; Tue, 22 Mar 2022 06:10:05 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Type:Content-Transfer-Encoding :MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From: Sender:Reply-To:Content-ID:Content-Description; bh=jltLdm7L1H5GK4FK9eeR6ui9PVDfG42N4OVNeq/+cmo=; b=ZfeQCwbpeRJEWLr2QE9NbozRWm PHHJ9bXSnpCMCixH3kuVQ7r/DB9erbbrLO5SxznaEyrTlBYc8M86C2Tu2GupAeY/a7MzDI4ENANLX JN1LD5ZttrfVrJCGFSTettSZ7DZip/DvyEF2UyD07tsQNXu9iULZZMulqqK3ecGGsciqccINZ6sMa /W/hhmOxeteoNHHluKO645A9++X/PVrj9mDffysWsihPwPaWhyyNAGXI53IYGm22LHG9tyNhHJZCP Pbjwj4azqVKfFNr1vHmjzklI7lwA7cs5nzuT3ZisC85onlkdktVj4DNIg1NtcAp6rxhZNioZAa9yk jj3cup0Q==; Received: from twspam01.aspeedtech.com ([211.20.114.71]) by desiato.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nWEmx-0035P1-Vr for linux-arm-kernel@lists.infradead.org; Mon, 21 Mar 2022 09:57:26 +0000 Received: from mail.aspeedtech.com ([192.168.0.24]) by twspam01.aspeedtech.com with ESMTP id 22L9jw6V079101; Mon, 21 Mar 2022 17:45:58 +0800 (GMT-8) (envelope-from dylan_hung@aspeedtech.com) Received: from DylanHung-PC.aspeed.com (192.168.2.216) by TWMBX02.aspeed.com (192.168.0.24) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 21 Mar 2022 17:56:24 +0800 From: Dylan Hung To: , , , , , , , , , , , , , , CC: , Subject: [PATCH v2 3/3] ARM: dts: aspeed: add reset properties into MDIO nodes Date: Mon, 21 Mar 2022 17:56:48 +0800 Message-ID: <20220321095648.4760-4-dylan_hung@aspeedtech.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220321095648.4760-1-dylan_hung@aspeedtech.com> References: <20220321095648.4760-1-dylan_hung@aspeedtech.com> MIME-Version: 1.0 X-Originating-IP: [192.168.2.216] X-ClientProxiedBy: TWMBX02.aspeed.com (192.168.0.24) To TWMBX02.aspeed.com (192.168.0.24) X-DNSRBL: X-MAIL: twspam01.aspeedtech.com 22L9jw6V079101 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220321_095724_670642_71AD76D3 X-CRM114-Status: UNSURE ( 7.77 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Add reset control properties into MDIO nodes. The 4 MDIO controllers in AST2600 SOC share one reset control bit SCU50[3]. Signed-off-by: Dylan Hung Cc: stable@vger.kernel.org --- arch/arm/boot/dts/aspeed-g6.dtsi | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/arm/boot/dts/aspeed-g6.dtsi b/arch/arm/boot/dts/aspeed-g6.dtsi index c32e87fad4dc..ab20ea8d829d 100644 --- a/arch/arm/boot/dts/aspeed-g6.dtsi +++ b/arch/arm/boot/dts/aspeed-g6.dtsi @@ -181,6 +181,7 @@ mdio0: mdio@1e650000 { status = "disabled"; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_mdio1_default>; + resets = <&syscon ASPEED_RESET_MII>; }; mdio1: mdio@1e650008 { @@ -191,6 +192,7 @@ mdio1: mdio@1e650008 { status = "disabled"; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_mdio2_default>; + resets = <&syscon ASPEED_RESET_MII>; }; mdio2: mdio@1e650010 { @@ -201,6 +203,7 @@ mdio2: mdio@1e650010 { status = "disabled"; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_mdio3_default>; + resets = <&syscon ASPEED_RESET_MII>; }; mdio3: mdio@1e650018 { @@ -211,6 +214,7 @@ mdio3: mdio@1e650018 { status = "disabled"; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_mdio4_default>; + resets = <&syscon ASPEED_RESET_MII>; }; mac0: ftgmac@1e660000 {