From nobody Mon Jun 22 15:39:32 2026 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2AA94C433F5 for ; Mon, 21 Mar 2022 09:57:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346090AbiCUJ62 (ORCPT ); Mon, 21 Mar 2022 05:58:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41738 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345999AbiCUJ6J (ORCPT ); Mon, 21 Mar 2022 05:58:09 -0400 Received: from twspam01.aspeedtech.com (twspam01.aspeedtech.com [211.20.114.71]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 399EB13700E for ; Mon, 21 Mar 2022 02:56:44 -0700 (PDT) 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 Content-Transfer-Encoding: quoted-printable 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" 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 =20 required: - compatible - reg - "#address-cells" - "#size-cells" + - resets =20 unevaluatedProperties: false =20 @@ -39,6 +42,7 @@ examples: reg =3D <0x1e650000 0x8>; #address-cells =3D <1>; #size-cells =3D <0>; + resets =3D <&syscon 35>; =20 ethphy0: ethernet-phy@0 { compatible =3D "ethernet-phy-ieee802.3-c22"; --=20 2.25.1 From nobody Mon Jun 22 15:39:32 2026 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CBE1FC433F5 for ; Mon, 21 Mar 2022 09:56:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346069AbiCUJ6Q (ORCPT ); Mon, 21 Mar 2022 05:58:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41004 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346109AbiCUJ6A (ORCPT ); Mon, 21 Mar 2022 05:58:00 -0400 Received: from twspam01.aspeedtech.com (twspam01.aspeedtech.com [211.20.114.71]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 35576137F41 for ; Mon, 21 Mar 2022 02:56:34 -0700 (PDT) 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 Content-Transfer-Encoding: quoted-printable 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" 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 Reviewed-by: Philipp Zabel --- 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 @@ =20 #include #include +#include #include #include #include @@ -37,6 +38,7 @@ =20 struct aspeed_mdio { void __iomem *base; + struct reset_control *reset; }; =20 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 *p= dev) if (IS_ERR(ctx->base)) return PTR_ERR(ctx->base); =20 + ctx->reset =3D 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 =3D DRV_NAME; snprintf(bus->id, MII_BUS_ID_SIZE, "%s%d", pdev->name, pdev->id); bus->parent =3D &pdev->dev; @@ -129,6 +137,7 @@ static int aspeed_mdio_probe(struct platform_device *pd= ev) rc =3D 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; } =20 @@ -139,7 +148,11 @@ static int aspeed_mdio_probe(struct platform_device *p= dev) =20 static int aspeed_mdio_remove(struct platform_device *pdev) { - mdiobus_unregister(platform_get_drvdata(pdev)); + struct mii_bus *bus =3D (struct mii_bus *)platform_get_drvdata(pdev); + struct aspeed_mdio *ctx =3D bus->priv; + + reset_control_assert(ctx->reset); + mdiobus_unregister(bus); =20 return 0; } --=20 2.25.1 From nobody Mon Jun 22 15:39:32 2026 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 26B85C433F5 for ; Mon, 21 Mar 2022 09:57:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346082AbiCUJ6V (ORCPT ); Mon, 21 Mar 2022 05:58:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41304 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346123AbiCUJ6E (ORCPT ); Mon, 21 Mar 2022 05:58:04 -0400 Received: from twspam01.aspeedtech.com (twspam01.aspeedtech.com [211.20.114.71]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 386D4137022 for ; Mon, 21 Mar 2022 02:56:39 -0700 (PDT) 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 Content-Transfer-Encoding: quoted-printable 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" 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 =3D "disabled"; pinctrl-names =3D "default"; pinctrl-0 =3D <&pinctrl_mdio1_default>; + resets =3D <&syscon ASPEED_RESET_MII>; }; =20 mdio1: mdio@1e650008 { @@ -191,6 +192,7 @@ mdio1: mdio@1e650008 { status =3D "disabled"; pinctrl-names =3D "default"; pinctrl-0 =3D <&pinctrl_mdio2_default>; + resets =3D <&syscon ASPEED_RESET_MII>; }; =20 mdio2: mdio@1e650010 { @@ -201,6 +203,7 @@ mdio2: mdio@1e650010 { status =3D "disabled"; pinctrl-names =3D "default"; pinctrl-0 =3D <&pinctrl_mdio3_default>; + resets =3D <&syscon ASPEED_RESET_MII>; }; =20 mdio3: mdio@1e650018 { @@ -211,6 +214,7 @@ mdio3: mdio@1e650018 { status =3D "disabled"; pinctrl-names =3D "default"; pinctrl-0 =3D <&pinctrl_mdio4_default>; + resets =3D <&syscon ASPEED_RESET_MII>; }; =20 mac0: ftgmac@1e660000 { --=20 2.25.1