* [PATCH] MIPS: Loongson64: dts: fix phy-related definition of LS7A GMAC
@ 2026-01-02 15:52 Icenowy Zheng
2026-01-02 22:36 ` Jiaxun Yang
2026-01-30 14:35 ` Thomas Bogendoerfer
0 siblings, 2 replies; 4+ messages in thread
From: Icenowy Zheng @ 2026-01-02 15:52 UTC (permalink / raw)
To: Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Thomas Bogendoerfer, Huacai Chen, Jiaxun Yang
Cc: devicetree, linux-mips, linux-kernel, Icenowy Zheng
Currently the LS7A GMAC device tree node lacks a proper phy-handle
property pointing to the PHY node.
In addition, the phy-mode property specifies "rgmii" without any
internal delay information, which means the board trace needs to add 2ns
delay to the RGMII data lines; but that isn't known to happen on any
Loongson board. The ACPI-based initialization codepath, which is used on
LoongArch-based 3A5000 + 7A1000 hardwares, specifies "rgmii-id" phy
mode, which should be the one we are using.
Add the lacking phy-handle property and set proper phy-mode.
Tested on a LS3A4000_7A1000_NUC_BOARD_V2.1 board with YT8521S PHY.
Signed-off-by: Icenowy Zheng <zhengxingda@iscas.ac.cn>
---
arch/mips/boot/dts/loongson/ls7a-pch.dtsi | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/arch/mips/boot/dts/loongson/ls7a-pch.dtsi b/arch/mips/boot/dts/loongson/ls7a-pch.dtsi
index ee71045883e7e..6dee85909f5a6 100644
--- a/arch/mips/boot/dts/loongson/ls7a-pch.dtsi
+++ b/arch/mips/boot/dts/loongson/ls7a-pch.dtsi
@@ -199,7 +199,8 @@ gmac@3,0 {
<13 IRQ_TYPE_LEVEL_HIGH>;
interrupt-names = "macirq", "eth_lpi";
interrupt-parent = <&pic>;
- phy-mode = "rgmii";
+ phy-mode = "rgmii-id";
+ phy-handle = <&phy0>;
mdio {
#address-cells = <1>;
#size-cells = <0>;
@@ -222,7 +223,8 @@ gmac@3,1 {
<15 IRQ_TYPE_LEVEL_HIGH>;
interrupt-names = "macirq", "eth_lpi";
interrupt-parent = <&pic>;
- phy-mode = "rgmii";
+ phy-mode = "rgmii-id";
+ phy-handle = <&phy1>;
mdio {
#address-cells = <1>;
#size-cells = <0>;
--
2.52.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] MIPS: Loongson64: dts: fix phy-related definition of LS7A GMAC
2026-01-02 15:52 [PATCH] MIPS: Loongson64: dts: fix phy-related definition of LS7A GMAC Icenowy Zheng
@ 2026-01-02 22:36 ` Jiaxun Yang
2026-01-04 7:05 ` Icenowy Zheng
2026-01-30 14:35 ` Thomas Bogendoerfer
1 sibling, 1 reply; 4+ messages in thread
From: Jiaxun Yang @ 2026-01-02 22:36 UTC (permalink / raw)
To: Icenowy Zheng, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Thomas Bogendoerfer, Huacai Chen
Cc: devicetree, linux-mips@vger.kernel.org, linux-kernel,
stable@vger.kernel.org
On Fri, 2 Jan 2026, at 3:52 PM, Icenowy Zheng wrote:
> Currently the LS7A GMAC device tree node lacks a proper phy-handle
> property pointing to the PHY node.
>
> In addition, the phy-mode property specifies "rgmii" without any
> internal delay information, which means the board trace needs to add 2ns
> delay to the RGMII data lines; but that isn't known to happen on any
> Loongson board. The ACPI-based initialization codepath, which is used on
> LoongArch-based 3A5000 + 7A1000 hardwares, specifies "rgmii-id" phy
> mode, which should be the one we are using.
>
> Add the lacking phy-handle property and set proper phy-mode.
>
> Tested on a LS3A4000_7A1000_NUC_BOARD_V2.1 board with YT8521S PHY.
>
> Signed-off-by: Icenowy Zheng <zhengxingda@iscas.ac.cn>
Good catch! This with fine with realtek phy chips but YT8521S seems
to be picky.
Reviewed-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Also maybe:
Cc: stable@vger.kernel.org
Given those boards rely on built-in DT.
Thanks
> ---
> arch/mips/boot/dts/loongson/ls7a-pch.dtsi | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/arch/mips/boot/dts/loongson/ls7a-pch.dtsi
> b/arch/mips/boot/dts/loongson/ls7a-pch.dtsi
> index ee71045883e7e..6dee85909f5a6 100644
> --- a/arch/mips/boot/dts/loongson/ls7a-pch.dtsi
> +++ b/arch/mips/boot/dts/loongson/ls7a-pch.dtsi
> @@ -199,7 +199,8 @@ gmac@3,0 {
> <13 IRQ_TYPE_LEVEL_HIGH>;
> interrupt-names = "macirq", "eth_lpi";
> interrupt-parent = <&pic>;
> - phy-mode = "rgmii";
> + phy-mode = "rgmii-id";
> + phy-handle = <&phy0>;
> mdio {
> #address-cells = <1>;
> #size-cells = <0>;
> @@ -222,7 +223,8 @@ gmac@3,1 {
> <15 IRQ_TYPE_LEVEL_HIGH>;
> interrupt-names = "macirq", "eth_lpi";
> interrupt-parent = <&pic>;
> - phy-mode = "rgmii";
> + phy-mode = "rgmii-id";
> + phy-handle = <&phy1>;
> mdio {
> #address-cells = <1>;
> #size-cells = <0>;
> --
> 2.52.0
--
- Jiaxun
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] MIPS: Loongson64: dts: fix phy-related definition of LS7A GMAC
2026-01-02 22:36 ` Jiaxun Yang
@ 2026-01-04 7:05 ` Icenowy Zheng
0 siblings, 0 replies; 4+ messages in thread
From: Icenowy Zheng @ 2026-01-04 7:05 UTC (permalink / raw)
To: Jiaxun Yang, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Thomas Bogendoerfer, Huacai Chen
Cc: devicetree, linux-mips@vger.kernel.org, linux-kernel,
stable@vger.kernel.org
在 2026-01-02星期五的 22:36 +0000,Jiaxun Yang写道:
>
>
> On Fri, 2 Jan 2026, at 3:52 PM, Icenowy Zheng wrote:
> > Currently the LS7A GMAC device tree node lacks a proper phy-handle
> > property pointing to the PHY node.
> >
> > In addition, the phy-mode property specifies "rgmii" without any
> > internal delay information, which means the board trace needs to
> > add 2ns
> > delay to the RGMII data lines; but that isn't known to happen on
> > any
> > Loongson board. The ACPI-based initialization codepath, which is
> > used on
> > LoongArch-based 3A5000 + 7A1000 hardwares, specifies "rgmii-id" phy
> > mode, which should be the one we are using.
> >
> > Add the lacking phy-handle property and set proper phy-mode.
> >
> > Tested on a LS3A4000_7A1000_NUC_BOARD_V2.1 board with YT8521S PHY.
> >
> > Signed-off-by: Icenowy Zheng <zhengxingda@iscas.ac.cn>
>
> Good catch! This with fine with realtek phy chips but YT8521S seems
> to be picky.
I think they might not work with Realtek PHYs now either, considering
delay override code for RTL8211E/F entered mainline Realtek PHY driver.
(Previously it just ignores the phy-mode internal delay information and
rely on what its strap pin defines)
>
> Reviewed-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
>
> Also maybe:
>
> Cc: stable@vger.kernel.org
>
> Given those boards rely on built-in DT.
>
> Thanks
>
> > ---
> > arch/mips/boot/dts/loongson/ls7a-pch.dtsi | 6 ++++--
> > 1 file changed, 4 insertions(+), 2 deletions(-)
> >
> > diff --git a/arch/mips/boot/dts/loongson/ls7a-pch.dtsi
> > b/arch/mips/boot/dts/loongson/ls7a-pch.dtsi
> > index ee71045883e7e..6dee85909f5a6 100644
> > --- a/arch/mips/boot/dts/loongson/ls7a-pch.dtsi
> > +++ b/arch/mips/boot/dts/loongson/ls7a-pch.dtsi
> > @@ -199,7 +199,8 @@ gmac@3,0 {
> > <13
> > IRQ_TYPE_LEVEL_HIGH>;
> > interrupt-names = "macirq",
> > "eth_lpi";
> > interrupt-parent = <&pic>;
> > - phy-mode = "rgmii";
> > + phy-mode = "rgmii-id";
> > + phy-handle = <&phy0>;
> > mdio {
> > #address-cells = <1>;
> > #size-cells = <0>;
> > @@ -222,7 +223,8 @@ gmac@3,1 {
> > <15
> > IRQ_TYPE_LEVEL_HIGH>;
> > interrupt-names = "macirq",
> > "eth_lpi";
> > interrupt-parent = <&pic>;
> > - phy-mode = "rgmii";
> > + phy-mode = "rgmii-id";
> > + phy-handle = <&phy1>;
> > mdio {
> > #address-cells = <1>;
> > #size-cells = <0>;
> > --
> > 2.52.0
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] MIPS: Loongson64: dts: fix phy-related definition of LS7A GMAC
2026-01-02 15:52 [PATCH] MIPS: Loongson64: dts: fix phy-related definition of LS7A GMAC Icenowy Zheng
2026-01-02 22:36 ` Jiaxun Yang
@ 2026-01-30 14:35 ` Thomas Bogendoerfer
1 sibling, 0 replies; 4+ messages in thread
From: Thomas Bogendoerfer @ 2026-01-30 14:35 UTC (permalink / raw)
To: Icenowy Zheng
Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Huacai Chen,
Jiaxun Yang, devicetree, linux-mips, linux-kernel
On Fri, Jan 02, 2026 at 11:52:43PM +0800, Icenowy Zheng wrote:
> Currently the LS7A GMAC device tree node lacks a proper phy-handle
> property pointing to the PHY node.
>
> In addition, the phy-mode property specifies "rgmii" without any
> internal delay information, which means the board trace needs to add 2ns
> delay to the RGMII data lines; but that isn't known to happen on any
> Loongson board. The ACPI-based initialization codepath, which is used on
> LoongArch-based 3A5000 + 7A1000 hardwares, specifies "rgmii-id" phy
> mode, which should be the one we are using.
>
> Add the lacking phy-handle property and set proper phy-mode.
>
> Tested on a LS3A4000_7A1000_NUC_BOARD_V2.1 board with YT8521S PHY.
>
> Signed-off-by: Icenowy Zheng <zhengxingda@iscas.ac.cn>
> ---
> arch/mips/boot/dts/loongson/ls7a-pch.dtsi | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/arch/mips/boot/dts/loongson/ls7a-pch.dtsi b/arch/mips/boot/dts/loongson/ls7a-pch.dtsi
> index ee71045883e7e..6dee85909f5a6 100644
> --- a/arch/mips/boot/dts/loongson/ls7a-pch.dtsi
> +++ b/arch/mips/boot/dts/loongson/ls7a-pch.dtsi
> @@ -199,7 +199,8 @@ gmac@3,0 {
> <13 IRQ_TYPE_LEVEL_HIGH>;
> interrupt-names = "macirq", "eth_lpi";
> interrupt-parent = <&pic>;
> - phy-mode = "rgmii";
> + phy-mode = "rgmii-id";
> + phy-handle = <&phy0>;
> mdio {
> #address-cells = <1>;
> #size-cells = <0>;
> @@ -222,7 +223,8 @@ gmac@3,1 {
> <15 IRQ_TYPE_LEVEL_HIGH>;
> interrupt-names = "macirq", "eth_lpi";
> interrupt-parent = <&pic>;
> - phy-mode = "rgmii";
> + phy-mode = "rgmii-id";
> + phy-handle = <&phy1>;
> mdio {
> #address-cells = <1>;
> #size-cells = <0>;
> --
> 2.52.0
applied to mips-next
Thomas.
--
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a
good idea. [ RFC1925, 2.3 ]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-01-30 14:38 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-02 15:52 [PATCH] MIPS: Loongson64: dts: fix phy-related definition of LS7A GMAC Icenowy Zheng
2026-01-02 22:36 ` Jiaxun Yang
2026-01-04 7:05 ` Icenowy Zheng
2026-01-30 14:35 ` Thomas Bogendoerfer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox