All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jonas Karlman <jonas@kwiboo.se>
To: Tianling Shen <cnsztl@gmail.com>, Vasily Khoruzhick <anarsoul@gmail.com>
Cc: Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Heiko Stuebner <heiko@sntech.de>,
	Jagan Teki <jagan@amarulasolutions.com>,
	Peter Geis <pgwipeout@gmail.com>, Andy Yan <andyshrk@163.com>,
	Brian Norris <briannorris@chromium.org>,
	Chris Morgan <macromorgan@hotmail.com>,
	Sebastian Reichel <sebastian.reichel@collabora.com>,
	Andrew Lunn <andrew@lunn.ch>,
	Michael Riesch <michael.riesch@wolfvision.net>,
	Maya Matuszczyk <maccraft123mc@gmail.com>,
	Andrew Powers-Holmes <aholmes@omnom.net>,
	Sascha Hauer <s.hauer@pengutronix.de>,
	devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 4/5] arm64: dts: rockchip: fix gmac support for NanoPi R5S
Date: Thu, 16 Mar 2023 07:37:18 +0000 (UTC)	[thread overview]
Message-ID: <71b16513-49b1-d9b3-b0b9-4c47e68563ba@kwiboo.se> (raw)
In-Reply-To: <CAOP2_TiU815F528jVGvDbcg3kSG+ykepU-ZYz7VWMO84GgcwMg@mail.gmail.com>

Hi Tianling,
On 2023-03-16 06:34, Tianling Shen wrote:
> Hi Vasily,
> 
> On Thu, Mar 16, 2023 at 8:16 AM Vasily Khoruzhick <anarsoul@gmail.com> wrote:
>>
>> On Wed, Mar 15, 2023 at 9:02 AM Tianling Shen <cnsztl@gmail.com> wrote:
>>>
>>> - Changed phy-mode to rgmii.
>>>
>>> - Fixed pull type in pinctrl for gmac0.
>>>
>>> - Removed duplicate properties in mdio node.
>>>   These properties are defined in the gmac0 node already.
>>>
>>> Signed-off-by: Tianling Shen <cnsztl@gmail.com>
>>> ---
>>>  arch/arm64/boot/dts/rockchip/rk3568-nanopi-r5s.dts | 7 ++-----
>>>  1 file changed, 2 insertions(+), 5 deletions(-)
>>>
>>> diff --git a/arch/arm64/boot/dts/rockchip/rk3568-nanopi-r5s.dts b/arch/arm64/boot/dts/rockchip/rk3568-nanopi-r5s.dts
>>> index e9adf5e66529..2a1118f15c29 100644
>>> --- a/arch/arm64/boot/dts/rockchip/rk3568-nanopi-r5s.dts
>>> +++ b/arch/arm64/boot/dts/rockchip/rk3568-nanopi-r5s.dts
>>> @@ -57,7 +57,7 @@
>>>         assigned-clock-rates = <0>, <125000000>;
>>>         clock_in_out = "output";
>>>         phy-handle = <&rgmii_phy0>;
>>> -       phy-mode = "rgmii-id";
>>> +       phy-mode = "rgmii";
>>>         pinctrl-names = "default";
>>>         pinctrl-0 = <&gmac0_miim
>>>                      &gmac0_tx_bus2
>>> @@ -79,9 +79,6 @@
>>>                 reg = <1>;
>>>                 pinctrl-0 = <&eth_phy0_reset_pin>;
>>>                 pinctrl-names = "default";
>>> -               reset-assert-us = <10000>;
>>> -               reset-deassert-us = <50000>;
>>> -               reset-gpios = <&gpio0 RK_PC4 GPIO_ACTIVE_LOW>;
>>
>> Hmm, I don't see RK_PC4 being used anywhere else. gmac0 has RK_PC5 as
> 
> Yes, it's a typo, it should be RK_RC5.
> 
>> snsp,reset-gpio. So it essentially drops reset for the PHY. Is it
>> expected?
> 
> snsp,reset-gpio defined reset already, so we don't need to set it here again.
> 
> ---
> 
> snsp,reset-gpio is the legacy binding, but I still have no idea why
> reset-gpios doesn't work,
> the dwmac driver will fail to lookup phy:
> 
> [   10.398514] rk_gmac-dwmac fe2a0000.ethernet eth0: no phy found
> [   10.399061] rk_gmac-dwmac fe2a0000.ethernet eth0: __stmmac_open:
> Cannot attach to PHY (error: -19)
> 
> Any ideas would be appreciated.

Generic ethernet phy driver is not resetting the phy in the same way
that snsp,reset-gpio does, please see top two commits at [1].

I have been meaning to send that out as an RFC but I got stuck in a
u-boot rabbit hole, and I also do not know what the correct way to fix
this would be, so I played with both device tree and code changes.
Will prioritize this and send out a RFC later today.

[1] https://github.com/Kwiboo/linux-rockchip/commits/rk3568-eth-phy-reset

Regards,
Jonas

> 
> Thanks,
> Tianling.
> 
>>
>>>         };
>>>  };
>>>
>>> @@ -115,7 +112,7 @@
>>>  &pinctrl {
>>>         gmac0 {
>>>                 eth_phy0_reset_pin: eth-phy0-reset-pin {
>>> -                       rockchip,pins = <0 RK_PC4 RK_FUNC_GPIO &pcfg_pull_down>;
>>> +                       rockchip,pins = <0 RK_PC4 RK_FUNC_GPIO &pcfg_pull_up>;
>>>                 };
>>>         };
>>>
>>> --
>>> 2.17.1
>>>


WARNING: multiple messages have this Message-ID (diff)
From: Jonas Karlman <jonas@kwiboo.se>
To: Tianling Shen <cnsztl@gmail.com>, Vasily Khoruzhick <anarsoul@gmail.com>
Cc: Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Heiko Stuebner <heiko@sntech.de>,
	Jagan Teki <jagan@amarulasolutions.com>,
	Peter Geis <pgwipeout@gmail.com>, Andy Yan <andyshrk@163.com>,
	Brian Norris <briannorris@chromium.org>,
	Chris Morgan <macromorgan@hotmail.com>,
	Sebastian Reichel <sebastian.reichel@collabora.com>,
	Andrew Lunn <andrew@lunn.ch>,
	Michael Riesch <michael.riesch@wolfvision.net>,
	Maya Matuszczyk <maccraft123mc@gmail.com>,
	Andrew Powers-Holmes <aholmes@omnom.net>,
	Sascha Hauer <s.hauer@pengutronix.de>,
	devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 4/5] arm64: dts: rockchip: fix gmac support for NanoPi R5S
Date: Thu, 16 Mar 2023 07:37:18 +0000 (UTC)	[thread overview]
Message-ID: <71b16513-49b1-d9b3-b0b9-4c47e68563ba@kwiboo.se> (raw)
In-Reply-To: <CAOP2_TiU815F528jVGvDbcg3kSG+ykepU-ZYz7VWMO84GgcwMg@mail.gmail.com>

Hi Tianling,
On 2023-03-16 06:34, Tianling Shen wrote:
> Hi Vasily,
> 
> On Thu, Mar 16, 2023 at 8:16 AM Vasily Khoruzhick <anarsoul@gmail.com> wrote:
>>
>> On Wed, Mar 15, 2023 at 9:02 AM Tianling Shen <cnsztl@gmail.com> wrote:
>>>
>>> - Changed phy-mode to rgmii.
>>>
>>> - Fixed pull type in pinctrl for gmac0.
>>>
>>> - Removed duplicate properties in mdio node.
>>>   These properties are defined in the gmac0 node already.
>>>
>>> Signed-off-by: Tianling Shen <cnsztl@gmail.com>
>>> ---
>>>  arch/arm64/boot/dts/rockchip/rk3568-nanopi-r5s.dts | 7 ++-----
>>>  1 file changed, 2 insertions(+), 5 deletions(-)
>>>
>>> diff --git a/arch/arm64/boot/dts/rockchip/rk3568-nanopi-r5s.dts b/arch/arm64/boot/dts/rockchip/rk3568-nanopi-r5s.dts
>>> index e9adf5e66529..2a1118f15c29 100644
>>> --- a/arch/arm64/boot/dts/rockchip/rk3568-nanopi-r5s.dts
>>> +++ b/arch/arm64/boot/dts/rockchip/rk3568-nanopi-r5s.dts
>>> @@ -57,7 +57,7 @@
>>>         assigned-clock-rates = <0>, <125000000>;
>>>         clock_in_out = "output";
>>>         phy-handle = <&rgmii_phy0>;
>>> -       phy-mode = "rgmii-id";
>>> +       phy-mode = "rgmii";
>>>         pinctrl-names = "default";
>>>         pinctrl-0 = <&gmac0_miim
>>>                      &gmac0_tx_bus2
>>> @@ -79,9 +79,6 @@
>>>                 reg = <1>;
>>>                 pinctrl-0 = <&eth_phy0_reset_pin>;
>>>                 pinctrl-names = "default";
>>> -               reset-assert-us = <10000>;
>>> -               reset-deassert-us = <50000>;
>>> -               reset-gpios = <&gpio0 RK_PC4 GPIO_ACTIVE_LOW>;
>>
>> Hmm, I don't see RK_PC4 being used anywhere else. gmac0 has RK_PC5 as
> 
> Yes, it's a typo, it should be RK_RC5.
> 
>> snsp,reset-gpio. So it essentially drops reset for the PHY. Is it
>> expected?
> 
> snsp,reset-gpio defined reset already, so we don't need to set it here again.
> 
> ---
> 
> snsp,reset-gpio is the legacy binding, but I still have no idea why
> reset-gpios doesn't work,
> the dwmac driver will fail to lookup phy:
> 
> [   10.398514] rk_gmac-dwmac fe2a0000.ethernet eth0: no phy found
> [   10.399061] rk_gmac-dwmac fe2a0000.ethernet eth0: __stmmac_open:
> Cannot attach to PHY (error: -19)
> 
> Any ideas would be appreciated.

Generic ethernet phy driver is not resetting the phy in the same way
that snsp,reset-gpio does, please see top two commits at [1].

I have been meaning to send that out as an RFC but I got stuck in a
u-boot rabbit hole, and I also do not know what the correct way to fix
this would be, so I played with both device tree and code changes.
Will prioritize this and send out a RFC later today.

[1] https://github.com/Kwiboo/linux-rockchip/commits/rk3568-eth-phy-reset

Regards,
Jonas

> 
> Thanks,
> Tianling.
> 
>>
>>>         };
>>>  };
>>>
>>> @@ -115,7 +112,7 @@
>>>  &pinctrl {
>>>         gmac0 {
>>>                 eth_phy0_reset_pin: eth-phy0-reset-pin {
>>> -                       rockchip,pins = <0 RK_PC4 RK_FUNC_GPIO &pcfg_pull_down>;
>>> +                       rockchip,pins = <0 RK_PC4 RK_FUNC_GPIO &pcfg_pull_up>;
>>>                 };
>>>         };
>>>
>>> --
>>> 2.17.1
>>>


_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

WARNING: multiple messages have this Message-ID (diff)
From: Jonas Karlman <jonas@kwiboo.se>
To: Tianling Shen <cnsztl@gmail.com>, Vasily Khoruzhick <anarsoul@gmail.com>
Cc: Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Heiko Stuebner <heiko@sntech.de>,
	Jagan Teki <jagan@amarulasolutions.com>,
	Peter Geis <pgwipeout@gmail.com>, Andy Yan <andyshrk@163.com>,
	Brian Norris <briannorris@chromium.org>,
	Chris Morgan <macromorgan@hotmail.com>,
	Sebastian Reichel <sebastian.reichel@collabora.com>,
	Andrew Lunn <andrew@lunn.ch>,
	Michael Riesch <michael.riesch@wolfvision.net>,
	Maya Matuszczyk <maccraft123mc@gmail.com>,
	Andrew Powers-Holmes <aholmes@omnom.net>,
	Sascha Hauer <s.hauer@pengutronix.de>,
	devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 4/5] arm64: dts: rockchip: fix gmac support for NanoPi R5S
Date: Thu, 16 Mar 2023 07:37:18 +0000 (UTC)	[thread overview]
Message-ID: <71b16513-49b1-d9b3-b0b9-4c47e68563ba@kwiboo.se> (raw)
In-Reply-To: <CAOP2_TiU815F528jVGvDbcg3kSG+ykepU-ZYz7VWMO84GgcwMg@mail.gmail.com>

Hi Tianling,
On 2023-03-16 06:34, Tianling Shen wrote:
> Hi Vasily,
> 
> On Thu, Mar 16, 2023 at 8:16 AM Vasily Khoruzhick <anarsoul@gmail.com> wrote:
>>
>> On Wed, Mar 15, 2023 at 9:02 AM Tianling Shen <cnsztl@gmail.com> wrote:
>>>
>>> - Changed phy-mode to rgmii.
>>>
>>> - Fixed pull type in pinctrl for gmac0.
>>>
>>> - Removed duplicate properties in mdio node.
>>>   These properties are defined in the gmac0 node already.
>>>
>>> Signed-off-by: Tianling Shen <cnsztl@gmail.com>
>>> ---
>>>  arch/arm64/boot/dts/rockchip/rk3568-nanopi-r5s.dts | 7 ++-----
>>>  1 file changed, 2 insertions(+), 5 deletions(-)
>>>
>>> diff --git a/arch/arm64/boot/dts/rockchip/rk3568-nanopi-r5s.dts b/arch/arm64/boot/dts/rockchip/rk3568-nanopi-r5s.dts
>>> index e9adf5e66529..2a1118f15c29 100644
>>> --- a/arch/arm64/boot/dts/rockchip/rk3568-nanopi-r5s.dts
>>> +++ b/arch/arm64/boot/dts/rockchip/rk3568-nanopi-r5s.dts
>>> @@ -57,7 +57,7 @@
>>>         assigned-clock-rates = <0>, <125000000>;
>>>         clock_in_out = "output";
>>>         phy-handle = <&rgmii_phy0>;
>>> -       phy-mode = "rgmii-id";
>>> +       phy-mode = "rgmii";
>>>         pinctrl-names = "default";
>>>         pinctrl-0 = <&gmac0_miim
>>>                      &gmac0_tx_bus2
>>> @@ -79,9 +79,6 @@
>>>                 reg = <1>;
>>>                 pinctrl-0 = <&eth_phy0_reset_pin>;
>>>                 pinctrl-names = "default";
>>> -               reset-assert-us = <10000>;
>>> -               reset-deassert-us = <50000>;
>>> -               reset-gpios = <&gpio0 RK_PC4 GPIO_ACTIVE_LOW>;
>>
>> Hmm, I don't see RK_PC4 being used anywhere else. gmac0 has RK_PC5 as
> 
> Yes, it's a typo, it should be RK_RC5.
> 
>> snsp,reset-gpio. So it essentially drops reset for the PHY. Is it
>> expected?
> 
> snsp,reset-gpio defined reset already, so we don't need to set it here again.
> 
> ---
> 
> snsp,reset-gpio is the legacy binding, but I still have no idea why
> reset-gpios doesn't work,
> the dwmac driver will fail to lookup phy:
> 
> [   10.398514] rk_gmac-dwmac fe2a0000.ethernet eth0: no phy found
> [   10.399061] rk_gmac-dwmac fe2a0000.ethernet eth0: __stmmac_open:
> Cannot attach to PHY (error: -19)
> 
> Any ideas would be appreciated.

Generic ethernet phy driver is not resetting the phy in the same way
that snsp,reset-gpio does, please see top two commits at [1].

I have been meaning to send that out as an RFC but I got stuck in a
u-boot rabbit hole, and I also do not know what the correct way to fix
this would be, so I played with both device tree and code changes.
Will prioritize this and send out a RFC later today.

[1] https://github.com/Kwiboo/linux-rockchip/commits/rk3568-eth-phy-reset

Regards,
Jonas

> 
> Thanks,
> Tianling.
> 
>>
>>>         };
>>>  };
>>>
>>> @@ -115,7 +112,7 @@
>>>  &pinctrl {
>>>         gmac0 {
>>>                 eth_phy0_reset_pin: eth-phy0-reset-pin {
>>> -                       rockchip,pins = <0 RK_PC4 RK_FUNC_GPIO &pcfg_pull_down>;
>>> +                       rockchip,pins = <0 RK_PC4 RK_FUNC_GPIO &pcfg_pull_up>;
>>>                 };
>>>         };
>>>
>>> --
>>> 2.17.1
>>>


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2023-03-16  7:42 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-15 16:02 [PATCH 0/5] arm64: dts: rockchip: improve support for NanoPi R5 series Tianling Shen
2023-03-15 16:02 ` Tianling Shen
2023-03-15 16:02 ` Tianling Shen
2023-03-15 16:02 ` [PATCH 1/5] arm64: dts: rockchip: create common dtsi " Tianling Shen
2023-03-15 16:02   ` Tianling Shen
2023-03-15 16:02   ` Tianling Shen
2023-03-15 16:02 ` [PATCH 2/5] dt-bindings: Add doc for FriendlyARM NanoPi R5C Tianling Shen
2023-03-15 16:02   ` Tianling Shen
2023-03-15 16:02   ` Tianling Shen
2023-03-16  7:28   ` Krzysztof Kozlowski
2023-03-16  7:28     ` Krzysztof Kozlowski
2023-03-16  7:28     ` Krzysztof Kozlowski
2023-03-15 16:02 ` [PATCH 3/5] arm64: dts: rockchip: Add FriendlyElec " Tianling Shen
2023-03-15 16:02   ` Tianling Shen
2023-03-15 16:02   ` Tianling Shen
2023-03-15 16:02 ` [PATCH 4/5] arm64: dts: rockchip: fix gmac support for NanoPi R5S Tianling Shen
2023-03-15 16:02   ` Tianling Shen
2023-03-15 16:02   ` Tianling Shen
2023-03-16  0:16   ` Vasily Khoruzhick
2023-03-16  0:16     ` Vasily Khoruzhick
2023-03-16  0:16     ` Vasily Khoruzhick
2023-03-16  5:34     ` Tianling Shen
2023-03-16  5:34       ` Tianling Shen
2023-03-16  5:34       ` Tianling Shen
2023-03-16  7:37       ` Jonas Karlman [this message]
2023-03-16  7:37         ` Jonas Karlman
2023-03-16  7:37         ` Jonas Karlman
2023-03-16  8:46         ` Tianling Shen
2023-03-16  8:46           ` Tianling Shen
2023-03-16  8:46           ` Tianling Shen
2023-03-16 14:47           ` Tianling Shen
2023-03-16 14:47             ` Tianling Shen
2023-03-16 14:47             ` Tianling Shen
2023-03-15 16:02 ` [PATCH 5/5] arm64: dts: rockchip: enable rk809 audio codec on the NanoPi R5 series Tianling Shen
2023-03-15 16:02   ` Tianling Shen
2023-03-15 16:02   ` Tianling Shen
2023-03-15 23:54   ` Vasily Khoruzhick
2023-03-15 23:54     ` Vasily Khoruzhick
2023-03-15 23:54     ` Vasily Khoruzhick
2023-03-16  6:25     ` Tianling Shen
2023-03-16  6:25       ` Tianling Shen
2023-03-16  6:25       ` Tianling Shen

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=71b16513-49b1-d9b3-b0b9-4c47e68563ba@kwiboo.se \
    --to=jonas@kwiboo.se \
    --cc=aholmes@omnom.net \
    --cc=anarsoul@gmail.com \
    --cc=andrew@lunn.ch \
    --cc=andyshrk@163.com \
    --cc=briannorris@chromium.org \
    --cc=cnsztl@gmail.com \
    --cc=devicetree@vger.kernel.org \
    --cc=heiko@sntech.de \
    --cc=jagan@amarulasolutions.com \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=maccraft123mc@gmail.com \
    --cc=macromorgan@hotmail.com \
    --cc=michael.riesch@wolfvision.net \
    --cc=pgwipeout@gmail.com \
    --cc=robh+dt@kernel.org \
    --cc=s.hauer@pengutronix.de \
    --cc=sebastian.reichel@collabora.com \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.