lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <29739e60-15f5-4361-a57a-2e6b93fba09c@kwiboo.se>
Date: Sat, 8 Mar 2025 17:34:29 +0100
From: Jonas Karlman <jonas@...boo.se>
To: Arturas Moskvinas <arturas.moskvinas@...il.com>
Cc: Heiko Stuebner <heiko@...ech.de>, Rob Herring <robh@...nel.org>,
 Krzysztof Kozlowski <krzk+dt@...nel.org>, Conor Dooley
 <conor+dt@...nel.org>, devicetree@...r.kernel.org,
 linux-arm-kernel@...ts.infradead.org, linux-rockchip@...ts.infradead.org,
 linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 2/2] arm64: dts: rockchip: Add Xunlong Orange Pi 3B

Hi Arturas,

On 2025-03-08 15:53, Arturas Moskvinas wrote:
> On 6/27/24 2:03 AM, Jonas Karlman wrote:
> 
>> The Xunlong Orange Pi 3B is a single-board computer based on the
>> Rockchip RK3566 SoC.
> ...> +
>> +&gmac1 {
>> +	phy-handle = <&rgmii_phy1>;
>> +	status = "okay";
>> +};
>> +
>> +&mdio1 {
>> +	rgmii_phy1: ethernet-phy@1 {
>> +		compatible = "ethernet-phy-ieee802.3-c22";
>> +		reg = <1>;
> 
> Jonas, were you able to test V1.1 board's Ethernet?

Yes, I have both a v1.1.1 and v2.1 hw revision of this board and
Ethernet should be working on both hw revisions.

> 
> Whenever I start the board - Ethernet initialization fails with:
> ```
> [   21.140055] rk_gmac-dwmac fe010000.ethernet eth0: __stmmac_open: 
> Cannot attach to PHY (error: -19)
> ```

This is because of a reset issue with Ethernet PHYs in Linux, see [1].

Two workarounds:
1. Let boot firmware reset the PHY before Linux, i.e. use U-Boot
   v2024.10 or newer.
2. Use a ethernet-phy-id compatible with correct phy-id to force Linux
   to attach the PHY.

I suggest you try to wipe U-Boot from SPI flash on your board and update
to use U-Boot v2025.01 and try again.

> 
> But if reset is performed inside gmac - initialization succeeds.

Use of deprecated snps,reset- props is not a proper fix for this issue,
instead Linux could use an improve Ethernet PHY initialization handling
and ensuring the PHY is reset before it tries to read a phy-id from it.

[1] https://lore.kernel.org/r/47d55aca-bee6-810f-379f-9431649fefa6@kwiboo.se/

Regards,
Jonas

> 
> Eg. patch:
> ```
> --- 
> linux-6.12.17.orig/arch/arm64/boot/dts/rockchip/rk3566-orangepi-3b-v1.1.dts
> +++ linux-6.12.17/arch/arm64/boot/dts/rockchip/rk3566-orangepi-3b-v1.1.dts
> @@ -16,14 +16,14 @@
>   &gmac1 {
>   	phy-handle = <&rgmii_phy1>;
>   	status = "okay";
> +	snps,reset-gpio = <&gpio3 RK_PC2 GPIO_ACTIVE_LOW>;
> +	snps,reset-active-low;
> +	snps,reset-delays-us = <0 50000 200000>;
>   };
> 
>   &mdio1 {
>   	rgmii_phy1: ethernet-phy@1 {
>   		compatible = "ethernet-phy-ieee802.3-c22";
>   		reg = <1>;
> -		reset-assert-us = <20000>;
> -		reset-deassert-us = <50000>;
> -		reset-gpios = <&gpio3 RK_PC2 GPIO_ACTIVE_LOW>;
>   	};
>   };
> ```
>> +		reset-assert-us = <20000>;
>> +		reset-deassert-us = <50000>;
>> +		reset-gpios = <&gpio3 RK_PC2 GPIO_ACTIVE_LOW>;
>> +	};
>> +};
> 
> 
> Arturas Moskvinas


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ