[linux-next-v2,5/5] arm64: dts: rockchip: Add missing of ethernet-phy-id to reset the phy on Rock 3A SBC
Message ID | 20221116200150.4657-7-linux.amoon@gmail.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp38918wrr; Wed, 16 Nov 2022 12:06:58 -0800 (PST) X-Google-Smtp-Source: AA0mqf41ed3qPhI5vaJZ0vXMpfFcu7MKFUcJvB4WegWSZRF7OI7VZ6IXj3YjBQgb73DvKfE8ElBc X-Received: by 2002:a17:906:a986:b0:78c:c893:1965 with SMTP id jr6-20020a170906a98600b0078cc8931965mr18558298ejb.247.1668629218312; Wed, 16 Nov 2022 12:06:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668629218; cv=none; d=google.com; s=arc-20160816; b=qeGILbByTnTNdUemhzeDgfBVkk6tEkEftt+kBufoRL3+23lu+Ij84g3X0WBt5rWGCi 7EOQnc7VLTqAxP4svU0ymhaUXjqMEkrGVl+nkYcLqDmN1CH80lloLTuAi40EsDNeNBIg R9ZgHWFqINDzPIuxOS2q+wk7Ok2fFSF9uSXeEDIfVIclVk2Oq37tdlr37SUuQruq+HTa 5Ih0pmWvqMOSEDYnh+shyIUwp4NOQu87MZukEyCnAaEjvn1/jxDpDxBrlBgGmv8e7ZnA cpR95RAYKsd+NSuGCA6OF3gWqrKI8XhqbK2ehlGN1RIwNN2PtvBp80ar/ZcsD6nOmy8L nvDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=dU5Mwb4CLrFeMhe4gtPSXHFZzIZzSCF10R2Jay+I0+Y=; b=FJRtML3aYgSE/SJ1/jzoSTQoZ3KX7013vU2WT0xwU00Ir6ZyxCB3pguW42Aali8pTw 5Y7gsphHXW6Nk02+IpR5uBQMbq2oEuOffM1KvnNrGYDpI2fXw79TUd1e8uw+B0b+4GTf gBz1sYq0JwHGTpE2KPp2SJeVpdvCSiIVp0NLnHt7/qBNX1iC3OF7IskmiSYgJ0NC/OVT nwIMSpW+hxlSY17HMjIwKsD+H65OuljZGaMntYkrbJ/gDhMuwXjzwA3Ila4GLST3nQ6N rhwHorFlmpI+OHKgiYtr8+qg6i2ooiSO+2VaL4ZzFV769PobvbuFdto/v8pMk8KJO8wr bG+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="fZt/DptU"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c20-20020a50f614000000b004588af9ea19si15346460edn.166.2022.11.16.12.06.35; Wed, 16 Nov 2022 12:06:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="fZt/DptU"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233325AbiKPUD5 (ORCPT <rfc822;just.gull.subs@gmail.com> + 99 others); Wed, 16 Nov 2022 15:03:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34326 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238534AbiKPUDI (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 16 Nov 2022 15:03:08 -0500 Received: from mail-pf1-x42d.google.com (mail-pf1-x42d.google.com [IPv6:2607:f8b0:4864:20::42d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8AACA66C8F; Wed, 16 Nov 2022 12:02:58 -0800 (PST) Received: by mail-pf1-x42d.google.com with SMTP id y13so18511999pfp.7; Wed, 16 Nov 2022 12:02:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=dU5Mwb4CLrFeMhe4gtPSXHFZzIZzSCF10R2Jay+I0+Y=; b=fZt/DptU/WyyXomIIYhusRu/ggtb7lQmge+tN9aC26JOHUiotfJ6pNPE0sOZsXFlHA SgeDoeiwbjAZfkgqTVCECcv7sWywKNuPLRdXB2lRWWgg1k051QO2wO27w3GpXYG67DmI FBc61+kKx9u3T8aPUbm4mWTchGz3YT6lsXgp6Ikq8d/gCmzPV1sum84ZZ8KtlSWELjkp s9JSmZIn2Qu5zRciJVrRw9g0Br1hI3QpPZLRyl6iZ3/4k0Cy16ZuG9/RVTWW1T4dZMma PQENYUq9QG6GJX+VI+8yQwhjbChPWtHurVy20PsG4eSo+W5qreGGu90lFrtHhMBdfTj2 NvrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=dU5Mwb4CLrFeMhe4gtPSXHFZzIZzSCF10R2Jay+I0+Y=; b=55UlpKXrU8s5UcfxL/7xezdkkYCL50giCgRA5XsLitFXUKTQi3q6alnVv+8WLTnxLg vhDJtqFmCkju5qyu9Y17XH3L1UNwHqvog2tP/xmp/tTcpT/O4o71ctDgXCi2V3Pu8qmd GjGQ58tsMmigC9pZhKKwanR82vBkiLYTbW3nqz3o/SVjHmQ6bgeLLQA0sxqpFUCkoq/Y rqDsqnVdqiTA42/hYrnIJzlbdFTG9/x7j1TT92I04/XeMe2ku5E0jUlnJYg/GRWuEVVL XGudCLiwQBtG0Duxyu1KgHRb5lqpcgZXadNcBaHWpWsDpGOVGWKkq4ID0LCDNvIJxs8V qWpQ== X-Gm-Message-State: ANoB5plAM/M29ka4M9tdqEPEknhTasR5sUb/5eMfOJcASDaV0sDPOGN2 hM+MdYC8DYrfNFa9f/N6DNw= X-Received: by 2002:a05:6a00:3689:b0:563:3d81:7faf with SMTP id dw9-20020a056a00368900b005633d817fafmr24476557pfb.45.1668628978034; Wed, 16 Nov 2022 12:02:58 -0800 (PST) Received: from localhost.localdomain ([103.51.72.182]) by smtp.gmail.com with ESMTPSA id s18-20020a170903215200b00186a6b6350esm12423950ple.268.2022.11.16.12.02.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Nov 2022 12:02:57 -0800 (PST) From: Anand Moon <linux.amoon@gmail.com> To: Rob Herring <robh+dt@kernel.org>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>, Heiko Stuebner <heiko@sntech.de> Cc: Anand Moon <linux.amoon@gmail.com>, Chukun Pan <amadeus@jmu.edu.cn>, Michael Riesch <michael.riesch@wolfvision.net>, Peter Geis <pgwipeout@gmail.com>, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [linux-next-v2 5/5] arm64: dts: rockchip: Add missing of ethernet-phy-id to reset the phy on Rock 3A SBC Date: Wed, 16 Nov 2022 20:01:48 +0000 Message-Id: <20221116200150.4657-7-linux.amoon@gmail.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221116200150.4657-1-linux.amoon@gmail.com> References: <20221116200150.4657-1-linux.amoon@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749684551270498540?= X-GMAIL-MSGID: =?utf-8?q?1749684551270498540?= |
Series |
[linux-next-v2,1/5] arm64: dts: rockchip: Fix gmac phy mode to rgmii on Rock 3A SBC.
|
|
Commit Message
Anand Moon
Nov. 16, 2022, 8:01 p.m. UTC
Add MDIO description with ethernet-phy-id compatible string
which enable calling reset of the phy. The PHY will then be probed,
independent of if it can be found on the bus or not,
and that probing will enable the GPIO.
ethernet-phy-id is read from ethenet register dump reg2 and reg3.
Fix following warning.
[ 12.323417] rk_gmac-dwmac fe010000.ethernet eth0: Register MEM_TYPE_PAGE_POOL RxQ-0
[ 12.324078] rk_gmac-dwmac fe010000.ethernet eth0: no phy at addr -1
[ 12.324099] rk_gmac-dwmac fe010000.ethernet eth0: __stmmac_open: Cannot attach to PHY (error: -19)
Signed-off-by: Anand Moon <linux.amoon@gmail.com>
---
V2: new to the patch series.
alarm@rock-3a:~$ sudo ethtool -d eth0
[sudo] password for alarm:
ST GMAC Registers
GMAC Registers
Reg0 0x08072203
Reg1 0x00000000
Reg2 0x00000404
Reg3 0x00000000
Reg4 0x00000002
---
arch/arm64/boot/dts/rockchip/rk3568-rock-3a.dts | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On Wed, Nov 16, 2022 at 3:02 PM Anand Moon <linux.amoon@gmail.com> wrote: > > Add MDIO description with ethernet-phy-id compatible string > which enable calling reset of the phy. The PHY will then be probed, > independent of if it can be found on the bus or not, > and that probing will enable the GPIO. > > ethernet-phy-id is read from ethenet register dump reg2 and reg3. > > Fix following warning. > [ 12.323417] rk_gmac-dwmac fe010000.ethernet eth0: Register MEM_TYPE_PAGE_POOL RxQ-0 > [ 12.324078] rk_gmac-dwmac fe010000.ethernet eth0: no phy at addr -1 > [ 12.324099] rk_gmac-dwmac fe010000.ethernet eth0: __stmmac_open: Cannot attach to PHY (error: -19) > > Signed-off-by: Anand Moon <linux.amoon@gmail.com> > --- > V2: new to the patch series. > > alarm@rock-3a:~$ sudo ethtool -d eth0 > [sudo] password for alarm: > ST GMAC Registers > GMAC Registers > Reg0 0x08072203 > Reg1 0x00000000 > Reg2 0x00000404 > Reg3 0x00000000 > Reg4 0x00000002 > --- > arch/arm64/boot/dts/rockchip/rk3568-rock-3a.dts | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/arch/arm64/boot/dts/rockchip/rk3568-rock-3a.dts b/arch/arm64/boot/dts/rockchip/rk3568-rock-3a.dts > index 9f84a23a8789..fe36156a5017 100644 > --- a/arch/arm64/boot/dts/rockchip/rk3568-rock-3a.dts > +++ b/arch/arm64/boot/dts/rockchip/rk3568-rock-3a.dts > @@ -585,7 +585,7 @@ &i2s2_2ch { > > &mdio1 { > rgmii_phy1: ethernet-phy@0 { > - compatible = "ethernet-phy-ieee802.3-c22"; > + compatible = "ethernet-phy-id0000.0404", "ethernet-phy-ieee802.3-c22"; > reg = <0x0>; > pinctrl-names = "default"; > pinctrl-0 = <ð_phy_rst>, <ð_phy_int>; Have you tried instead moving the reset to the mdio bus? I've had success with this, though you'll need to change the reset assert and deassert timing handles, they are different for the bus. > -- > 2.38.1 >
Hi Peter, On Thu, 17 Nov 2022 at 02:16, Peter Geis <pgwipeout@gmail.com> wrote: > > On Wed, Nov 16, 2022 at 3:02 PM Anand Moon <linux.amoon@gmail.com> wrote: > > > > Add MDIO description with ethernet-phy-id compatible string > > which enable calling reset of the phy. The PHY will then be probed, > > independent of if it can be found on the bus or not, > > and that probing will enable the GPIO. > > > > ethernet-phy-id is read from ethenet register dump reg2 and reg3. > > > > Fix following warning. > > [ 12.323417] rk_gmac-dwmac fe010000.ethernet eth0: Register MEM_TYPE_PAGE_POOL RxQ-0 > > [ 12.324078] rk_gmac-dwmac fe010000.ethernet eth0: no phy at addr -1 > > [ 12.324099] rk_gmac-dwmac fe010000.ethernet eth0: __stmmac_open: Cannot attach to PHY (error: -19) > > > > Signed-off-by: Anand Moon <linux.amoon@gmail.com> > > --- > > V2: new to the patch series. > > > > alarm@rock-3a:~$ sudo ethtool -d eth0 > > [sudo] password for alarm: > > ST GMAC Registers > > GMAC Registers > > Reg0 0x08072203 > > Reg1 0x00000000 > > Reg2 0x00000404 > > Reg3 0x00000000 > > Reg4 0x00000002 > > --- > > arch/arm64/boot/dts/rockchip/rk3568-rock-3a.dts | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/arch/arm64/boot/dts/rockchip/rk3568-rock-3a.dts b/arch/arm64/boot/dts/rockchip/rk3568-rock-3a.dts > > index 9f84a23a8789..fe36156a5017 100644 > > --- a/arch/arm64/boot/dts/rockchip/rk3568-rock-3a.dts > > +++ b/arch/arm64/boot/dts/rockchip/rk3568-rock-3a.dts > > @@ -585,7 +585,7 @@ &i2s2_2ch { > > > > &mdio1 { > > rgmii_phy1: ethernet-phy@0 { > > - compatible = "ethernet-phy-ieee802.3-c22"; > > + compatible = "ethernet-phy-id0000.0404", "ethernet-phy-ieee802.3-c22"; > > reg = <0x0>; > > pinctrl-names = "default"; > > pinctrl-0 = <ð_phy_rst>, <ð_phy_int>; > > Have you tried instead moving the reset to the mdio bus? I've had > success with this, though you'll need to change the reset assert and > deassert timing handles, they are different for the bus. > No can you share some examples? If you got a better way to solve this issue please let me know. I will give this a try. Thanks -Anand > > -- > > 2.38.1 > >
On 2022-11-17 05:57, Anand Moon wrote: > Hi Peter, > > On Thu, 17 Nov 2022 at 02:16, Peter Geis <pgwipeout@gmail.com> wrote: >> >> On Wed, Nov 16, 2022 at 3:02 PM Anand Moon <linux.amoon@gmail.com> wrote: >>> >>> Add MDIO description with ethernet-phy-id compatible string >>> which enable calling reset of the phy. The PHY will then be probed, >>> independent of if it can be found on the bus or not, >>> and that probing will enable the GPIO. >>> >>> ethernet-phy-id is read from ethenet register dump reg2 and reg3. >>> >>> Fix following warning. >>> [ 12.323417] rk_gmac-dwmac fe010000.ethernet eth0: Register MEM_TYPE_PAGE_POOL RxQ-0 >>> [ 12.324078] rk_gmac-dwmac fe010000.ethernet eth0: no phy at addr -1 >>> [ 12.324099] rk_gmac-dwmac fe010000.ethernet eth0: __stmmac_open: Cannot attach to PHY (error: -19) >>> >>> Signed-off-by: Anand Moon <linux.amoon@gmail.com> >>> --- >>> V2: new to the patch series. >>> >>> alarm@rock-3a:~$ sudo ethtool -d eth0 >>> [sudo] password for alarm: >>> ST GMAC Registers >>> GMAC Registers >>> Reg0 0x08072203 >>> Reg1 0x00000000 >>> Reg2 0x00000404 >>> Reg3 0x00000000 >>> Reg4 0x00000002 >>> --- >>> arch/arm64/boot/dts/rockchip/rk3568-rock-3a.dts | 2 +- >>> 1 file changed, 1 insertion(+), 1 deletion(-) >>> >>> diff --git a/arch/arm64/boot/dts/rockchip/rk3568-rock-3a.dts b/arch/arm64/boot/dts/rockchip/rk3568-rock-3a.dts >>> index 9f84a23a8789..fe36156a5017 100644 >>> --- a/arch/arm64/boot/dts/rockchip/rk3568-rock-3a.dts >>> +++ b/arch/arm64/boot/dts/rockchip/rk3568-rock-3a.dts >>> @@ -585,7 +585,7 @@ &i2s2_2ch { >>> >>> &mdio1 { >>> rgmii_phy1: ethernet-phy@0 { >>> - compatible = "ethernet-phy-ieee802.3-c22"; >>> + compatible = "ethernet-phy-id0000.0404", "ethernet-phy-ieee802.3-c22"; >>> reg = <0x0>; >>> pinctrl-names = "default"; >>> pinctrl-0 = <ð_phy_rst>, <ð_phy_int>; >> >> Have you tried instead moving the reset to the mdio bus? I've had >> success with this, though you'll need to change the reset assert and >> deassert timing handles, they are different for the bus. >> > No can you share some examples? > If you got a better way to solve this issue please let me know. > I will give this a try. Note that the Rock 3A schematic says the phy is configured for address 1, not 0. From what I remember of adding the MDIO node for NanoiPi4, that didn't work if I got the address wrong, despite the fact that the auto-detection when the MDIO node is omitted claimed to find the same phy on both addresses 0 and 1. Robin. > > Thanks > -Anand >>> -- >>> 2.38.1 >>> > > _______________________________________________ > Linux-rockchip mailing list > Linux-rockchip@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-rockchip
Hi Robin On Thu, 17 Nov 2022 at 16:24, Robin Murphy <robin.murphy@arm.com> wrote: > > On 2022-11-17 05:57, Anand Moon wrote: > > Hi Peter, > > > > On Thu, 17 Nov 2022 at 02:16, Peter Geis <pgwipeout@gmail.com> wrote: > >> > >> On Wed, Nov 16, 2022 at 3:02 PM Anand Moon <linux.amoon@gmail.com> wrote: > >>> > >>> Add MDIO description with ethernet-phy-id compatible string > >>> which enable calling reset of the phy. The PHY will then be probed, > >>> independent of if it can be found on the bus or not, > >>> and that probing will enable the GPIO. > >>> > >>> ethernet-phy-id is read from ethenet register dump reg2 and reg3. > >>> > >>> Fix following warning. > >>> [ 12.323417] rk_gmac-dwmac fe010000.ethernet eth0: Register MEM_TYPE_PAGE_POOL RxQ-0 > >>> [ 12.324078] rk_gmac-dwmac fe010000.ethernet eth0: no phy at addr -1 > >>> [ 12.324099] rk_gmac-dwmac fe010000.ethernet eth0: __stmmac_open: Cannot attach to PHY (error: -19) > >>> > >>> Signed-off-by: Anand Moon <linux.amoon@gmail.com> > >>> --- > >>> V2: new to the patch series. > >>> > >>> alarm@rock-3a:~$ sudo ethtool -d eth0 > >>> [sudo] password for alarm: > >>> ST GMAC Registers > >>> GMAC Registers > >>> Reg0 0x08072203 > >>> Reg1 0x00000000 > >>> Reg2 0x00000404 > >>> Reg3 0x00000000 > >>> Reg4 0x00000002 > >>> --- > >>> arch/arm64/boot/dts/rockchip/rk3568-rock-3a.dts | 2 +- > >>> 1 file changed, 1 insertion(+), 1 deletion(-) > >>> > >>> diff --git a/arch/arm64/boot/dts/rockchip/rk3568-rock-3a.dts b/arch/arm64/boot/dts/rockchip/rk3568-rock-3a.dts > >>> index 9f84a23a8789..fe36156a5017 100644 > >>> --- a/arch/arm64/boot/dts/rockchip/rk3568-rock-3a.dts > >>> +++ b/arch/arm64/boot/dts/rockchip/rk3568-rock-3a.dts > >>> @@ -585,7 +585,7 @@ &i2s2_2ch { > >>> > >>> &mdio1 { > >>> rgmii_phy1: ethernet-phy@0 { > >>> - compatible = "ethernet-phy-ieee802.3-c22"; > >>> + compatible = "ethernet-phy-id0000.0404", "ethernet-phy-ieee802.3-c22"; > >>> reg = <0x0>; > >>> pinctrl-names = "default"; > >>> pinctrl-0 = <ð_phy_rst>, <ð_phy_int>; > >> > >> Have you tried instead moving the reset to the mdio bus? I've had > >> success with this, though you'll need to change the reset assert and > >> deassert timing handles, they are different for the bus. > >> > > No can you share some examples? > > If you got a better way to solve this issue please let me know. > > I will give this a try. > > Note that the Rock 3A schematic says the phy is configured for address > 1, not 0. From what I remember of adding the MDIO node for NanoiPi4, > that didn't work if I got the address wrong, despite the fact that the > auto-detection when the MDIO node is omitted claimed to find the same > phy on both addresses 0 and 1. > Yes, I have tested with these changes still this does not work, with out this fix as of now.. We can check this comment in the below commit id 70f04e9a3358404367030493dc36718d4495a9a5 ARM: dts: imx6ul-14x14-evk: Enable the GPIO expander maybe something is still missing to be configured. Thanks -Anand > Robin. > > > > > Thanks > > -Anand > >>> -- > >>> 2.38.1 > >>> > > > > _______________________________________________ > > Linux-rockchip mailing list > > Linux-rockchip@lists.infradead.org > > http://lists.infradead.org/mailman/listinfo/linux-rockchip
On Thu, Nov 17, 2022 at 9:56 AM Anand Moon <linux.amoon@gmail.com> wrote: > > Hi Robin > > On Thu, 17 Nov 2022 at 16:24, Robin Murphy <robin.murphy@arm.com> wrote: > > > > On 2022-11-17 05:57, Anand Moon wrote: > > > Hi Peter, > > > > > > On Thu, 17 Nov 2022 at 02:16, Peter Geis <pgwipeout@gmail.com> wrote: > > >> > > >> On Wed, Nov 16, 2022 at 3:02 PM Anand Moon <linux.amoon@gmail.com> wrote: > > >>> > > >>> Add MDIO description with ethernet-phy-id compatible string > > >>> which enable calling reset of the phy. The PHY will then be probed, > > >>> independent of if it can be found on the bus or not, > > >>> and that probing will enable the GPIO. > > >>> > > >>> ethernet-phy-id is read from ethenet register dump reg2 and reg3. > > >>> > > >>> Fix following warning. > > >>> [ 12.323417] rk_gmac-dwmac fe010000.ethernet eth0: Register MEM_TYPE_PAGE_POOL RxQ-0 > > >>> [ 12.324078] rk_gmac-dwmac fe010000.ethernet eth0: no phy at addr -1 > > >>> [ 12.324099] rk_gmac-dwmac fe010000.ethernet eth0: __stmmac_open: Cannot attach to PHY (error: -19) > > >>> > > >>> Signed-off-by: Anand Moon <linux.amoon@gmail.com> > > >>> --- > > >>> V2: new to the patch series. > > >>> > > >>> alarm@rock-3a:~$ sudo ethtool -d eth0 > > >>> [sudo] password for alarm: > > >>> ST GMAC Registers > > >>> GMAC Registers > > >>> Reg0 0x08072203 > > >>> Reg1 0x00000000 > > >>> Reg2 0x00000404 > > >>> Reg3 0x00000000 > > >>> Reg4 0x00000002 > > >>> --- > > >>> arch/arm64/boot/dts/rockchip/rk3568-rock-3a.dts | 2 +- > > >>> 1 file changed, 1 insertion(+), 1 deletion(-) > > >>> > > >>> diff --git a/arch/arm64/boot/dts/rockchip/rk3568-rock-3a.dts b/arch/arm64/boot/dts/rockchip/rk3568-rock-3a.dts > > >>> index 9f84a23a8789..fe36156a5017 100644 > > >>> --- a/arch/arm64/boot/dts/rockchip/rk3568-rock-3a.dts > > >>> +++ b/arch/arm64/boot/dts/rockchip/rk3568-rock-3a.dts > > >>> @@ -585,7 +585,7 @@ &i2s2_2ch { > > >>> > > >>> &mdio1 { > > >>> rgmii_phy1: ethernet-phy@0 { > > >>> - compatible = "ethernet-phy-ieee802.3-c22"; > > >>> + compatible = "ethernet-phy-id0000.0404", "ethernet-phy-ieee802.3-c22"; > > >>> reg = <0x0>; > > >>> pinctrl-names = "default"; > > >>> pinctrl-0 = <ð_phy_rst>, <ð_phy_int>; > > >> > > >> Have you tried instead moving the reset to the mdio bus? I've had > > >> success with this, though you'll need to change the reset assert and > > >> deassert timing handles, they are different for the bus. > > >> > > > No can you share some examples? > > > If you got a better way to solve this issue please let me know. > > > I will give this a try. > > > > Note that the Rock 3A schematic says the phy is configured for address > > 1, not 0. From what I remember of adding the MDIO node for NanoiPi4, > > that didn't work if I got the address wrong, despite the fact that the > > auto-detection when the MDIO node is omitted claimed to find the same > > phy on both addresses 0 and 1. > > From the net-dev folk, mdio address 0 is a broadcast address. All functional phys we have on the mdio bus should respond to it. The problem I've run into is with the reset on the phy node the reset triggers too late for the dwmac to detect the phy correctly. However moving it to the mdio bus node makes the reset happen at roughly the same time as the depreciated dwmac reset and the phy detects without any weird hacks. > > Yes, I have tested with these changes still this does not work, with > out this fix as of now.. > > We can check this comment in the below commit id > 70f04e9a3358404367030493dc36718d4495a9a5 ARM: dts: imx6ul-14x14-evk: > Enable the GPIO expander > > maybe something is still missing to be configured. > > Thanks > -Anand > > > > > > > Robin. > > > > > > > > Thanks > > > -Anand > > >>> -- > > >>> 2.38.1 > > >>> > > > > > > _______________________________________________ > > > Linux-rockchip mailing list > > > Linux-rockchip@lists.infradead.org > > > http://lists.infradead.org/mailman/listinfo/linux-rockchip
Hi Peter, On Fri, 18 Nov 2022 at 00:40, Peter Geis <pgwipeout@gmail.com> wrote: > > On Thu, Nov 17, 2022 at 9:56 AM Anand Moon <linux.amoon@gmail.com> wrote: > > > > Hi Robin > > > > On Thu, 17 Nov 2022 at 16:24, Robin Murphy <robin.murphy@arm.com> wrote: > > > > > > On 2022-11-17 05:57, Anand Moon wrote: > > > > Hi Peter, > > > > > > > > On Thu, 17 Nov 2022 at 02:16, Peter Geis <pgwipeout@gmail.com> wrote: > > > >> > > > >> On Wed, Nov 16, 2022 at 3:02 PM Anand Moon <linux.amoon@gmail.com> wrote: > > > >>> > > > >>> Add MDIO description with ethernet-phy-id compatible string > > > >>> which enable calling reset of the phy. The PHY will then be probed, > > > >>> independent of if it can be found on the bus or not, > > > >>> and that probing will enable the GPIO. > > > >>> > > > >>> ethernet-phy-id is read from ethenet register dump reg2 and reg3. > > > >>> > > > >>> Fix following warning. > > > >>> [ 12.323417] rk_gmac-dwmac fe010000.ethernet eth0: Register MEM_TYPE_PAGE_POOL RxQ-0 > > > >>> [ 12.324078] rk_gmac-dwmac fe010000.ethernet eth0: no phy at addr -1 > > > >>> [ 12.324099] rk_gmac-dwmac fe010000.ethernet eth0: __stmmac_open: Cannot attach to PHY (error: -19) > > > >>> > > > >>> Signed-off-by: Anand Moon <linux.amoon@gmail.com> > > > >>> --- > > > >>> V2: new to the patch series. > > > >>> > > > >>> alarm@rock-3a:~$ sudo ethtool -d eth0 > > > >>> [sudo] password for alarm: > > > >>> ST GMAC Registers > > > >>> GMAC Registers > > > >>> Reg0 0x08072203 > > > >>> Reg1 0x00000000 > > > >>> Reg2 0x00000404 > > > >>> Reg3 0x00000000 > > > >>> Reg4 0x00000002 > > > >>> --- > > > >>> arch/arm64/boot/dts/rockchip/rk3568-rock-3a.dts | 2 +- > > > >>> 1 file changed, 1 insertion(+), 1 deletion(-) > > > >>> > > > >>> diff --git a/arch/arm64/boot/dts/rockchip/rk3568-rock-3a.dts b/arch/arm64/boot/dts/rockchip/rk3568-rock-3a.dts > > > >>> index 9f84a23a8789..fe36156a5017 100644 > > > >>> --- a/arch/arm64/boot/dts/rockchip/rk3568-rock-3a.dts > > > >>> +++ b/arch/arm64/boot/dts/rockchip/rk3568-rock-3a.dts > > > >>> @@ -585,7 +585,7 @@ &i2s2_2ch { > > > >>> > > > >>> &mdio1 { > > > >>> rgmii_phy1: ethernet-phy@0 { > > > >>> - compatible = "ethernet-phy-ieee802.3-c22"; > > > >>> + compatible = "ethernet-phy-id0000.0404", "ethernet-phy-ieee802.3-c22"; > > > >>> reg = <0x0>; > > > >>> pinctrl-names = "default"; > > > >>> pinctrl-0 = <ð_phy_rst>, <ð_phy_int>; > > > >> > > > >> Have you tried instead moving the reset to the mdio bus? I've had > > > >> success with this, though you'll need to change the reset assert and > > > >> deassert timing handles, they are different for the bus. > > > >> > > > > No can you share some examples? > > > > If you got a better way to solve this issue please let me know. > > > > I will give this a try. > > > > > > Note that the Rock 3A schematic says the phy is configured for address > > > 1, not 0. From what I remember of adding the MDIO node for NanoiPi4, > > > that didn't work if I got the address wrong, despite the fact that the > > > auto-detection when the MDIO node is omitted claimed to find the same > > > phy on both addresses 0 and 1. > > > > > From the net-dev folk, mdio address 0 is a broadcast address. All > functional phys we have on the mdio bus should respond to it. The > problem I've run into is with the reset on the phy node the reset > triggers too late for the dwmac to detect the phy correctly. However > moving it to the mdio bus node makes the reset happen at roughly the > same time as the depreciated dwmac reset and the phy detects without > any weird hacks. > This is not a hack, we are already using mdio bus node. &gma1 { phy-handle=ethernet-phy } mdio1 { ethernet-phy { } } Actually, *ethernet-phy-id* is one of the binding properties (see below). we can find many examples in the device tree that used this property in the linux kernel and u-boot. [0] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/devicetree/bindings/net/ethernet-phy.yaml?h=v6.1-rc6#n31 [1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/devicetree/bindings/net/ethernet-phy.yaml?h=v6.1-rc6#n211 Please check this phy reset section below. [2] https://wiki.st.com/stm32mpu/wiki/Ethernet_device_tree_configuration#RMII_with_25MHz_on_ETH_CLK_-28no_PHY_Crystal-29-2C_REF_CLK_from_PHY_-28Reference_clock_-28standard_RMII_clock_name-29_is_provided_by_a_PHY-29 If you have some other input please share I have tried but failed. Thanks -Anand
Hi Anand, On 11/16/22 21:01, Anand Moon wrote: > Add MDIO description with ethernet-phy-id compatible string > which enable calling reset of the phy. The PHY will then be probed, > independent of if it can be found on the bus or not, > and that probing will enable the GPIO. > > ethernet-phy-id is read from ethenet register dump reg2 and reg3. > > Fix following warning. > [ 12.323417] rk_gmac-dwmac fe010000.ethernet eth0: Register MEM_TYPE_PAGE_POOL RxQ-0 > [ 12.324078] rk_gmac-dwmac fe010000.ethernet eth0: no phy at addr -1 > [ 12.324099] rk_gmac-dwmac fe010000.ethernet eth0: __stmmac_open: Cannot attach to PHY (error: -19) Without this patch, the phy on my ROCK3A is properly detected: [ 1.494963] rk_gmac-dwmac fe010000.ethernet eth0: PHY [stmmac-0:00] driver [RTL8211F Gigabit Ethernet) but with the patch applied, only a generic phy is recognized: [ 1.398674] rk_gmac-dwmac fe010000.ethernet eth0: PHY [stmmac-0:00] driver [Generic PHY] (irq=POLL) This does not seem right at all. NACK to this patch! Best regards, Michael > > Signed-off-by: Anand Moon <linux.amoon@gmail.com> > --- > V2: new to the patch series. > > alarm@rock-3a:~$ sudo ethtool -d eth0 > [sudo] password for alarm: > ST GMAC Registers > GMAC Registers > Reg0 0x08072203 > Reg1 0x00000000 > Reg2 0x00000404 > Reg3 0x00000000 > Reg4 0x00000002 > --- > arch/arm64/boot/dts/rockchip/rk3568-rock-3a.dts | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/arch/arm64/boot/dts/rockchip/rk3568-rock-3a.dts b/arch/arm64/boot/dts/rockchip/rk3568-rock-3a.dts > index 9f84a23a8789..fe36156a5017 100644 > --- a/arch/arm64/boot/dts/rockchip/rk3568-rock-3a.dts > +++ b/arch/arm64/boot/dts/rockchip/rk3568-rock-3a.dts > @@ -585,7 +585,7 @@ &i2s2_2ch { > > &mdio1 { > rgmii_phy1: ethernet-phy@0 { > - compatible = "ethernet-phy-ieee802.3-c22"; > + compatible = "ethernet-phy-id0000.0404", "ethernet-phy-ieee802.3-c22"; > reg = <0x0>; > pinctrl-names = "default"; > pinctrl-0 = <ð_phy_rst>, <ð_phy_int>;
Hi Michael On Tue, 22 Nov 2022 at 22:16, Michael Riesch <michael.riesch@wolfvision.net> wrote: > > Hi Anand, > > On 11/16/22 21:01, Anand Moon wrote: > > Add MDIO description with ethernet-phy-id compatible string > > which enable calling reset of the phy. The PHY will then be probed, > > independent of if it can be found on the bus or not, > > and that probing will enable the GPIO. > > > > ethernet-phy-id is read from ethenet register dump reg2 and reg3. > > > > Fix following warning. > > [ 12.323417] rk_gmac-dwmac fe010000.ethernet eth0: Register MEM_TYPE_PAGE_POOL RxQ-0 > > [ 12.324078] rk_gmac-dwmac fe010000.ethernet eth0: no phy at addr -1 > > [ 12.324099] rk_gmac-dwmac fe010000.ethernet eth0: __stmmac_open: Cannot attach to PHY (error: -19) > > Without this patch, the phy on my ROCK3A is properly detected: > > [ 1.494963] rk_gmac-dwmac fe010000.ethernet eth0: PHY [stmmac-0:00] > driver [RTL8211F Gigabit Ethernet) > > but with the patch applied, only a generic phy is recognized: > > [ 1.398674] rk_gmac-dwmac fe010000.ethernet eth0: PHY [stmmac-0:00] > driver [Generic PHY] (irq=POLL) > > This does not seem right at all. NACK to this patch! > Yep you are correct I found way to read the ethernet id # there is kernel module witch help read the ethernet-id using netlink socket. $ git clone https://github.com/wkz/mdio-tools $ sudo mdio fixed-0 stmmac-0 $ sudo mdio stmmac-0 DEV PHY-ID LINK 0x00 0x001cc916 up 0x01 0x001cc916 up with the above ethernet id I update the compatible string compatible = "ethernet-phy-id001c.c916", "ethernet-phy-ieee802.3-c22"; I could get the ethernet registered correctly. [ 9.865059] rk_gmac-dwmac fe010000.ethernet end0: Register MEM_TYPE_PAGE_POOL RxQ-0 [ 10.061904] rk_gmac-dwmac fe010000.ethernet end0: PHY [stmmac-0:00] driver [RTL8211F Gigabit Ethernet] (irq=POLL) Thanks -Anand
diff --git a/arch/arm64/boot/dts/rockchip/rk3568-rock-3a.dts b/arch/arm64/boot/dts/rockchip/rk3568-rock-3a.dts index 9f84a23a8789..fe36156a5017 100644 --- a/arch/arm64/boot/dts/rockchip/rk3568-rock-3a.dts +++ b/arch/arm64/boot/dts/rockchip/rk3568-rock-3a.dts @@ -585,7 +585,7 @@ &i2s2_2ch { &mdio1 { rgmii_phy1: ethernet-phy@0 { - compatible = "ethernet-phy-ieee802.3-c22"; + compatible = "ethernet-phy-id0000.0404", "ethernet-phy-ieee802.3-c22"; reg = <0x0>; pinctrl-names = "default"; pinctrl-0 = <ð_phy_rst>, <ð_phy_int>;