From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AEEEB6AC2 for ; Tue, 15 Mar 2022 22:45:53 +0000 (UTC) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 6FBB41474; Tue, 15 Mar 2022 15:45:47 -0700 (PDT) Received: from slackpad.lan (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id A52363F66F; Tue, 15 Mar 2022 15:45:45 -0700 (PDT) Date: Tue, 15 Mar 2022 22:44:44 +0000 From: Andre Przywara To: Jernej =?UTF-8?B?xaBrcmFiZWM=?= , Petr =?UTF-8?B?xaB0ZXRpYXI=?= Cc: Rob Herring , Maxime Ripard , Chen-Yu Tsai , stable@vger.kernel.org, Bastien =?UTF-8?B?Um91Y2FyacOocw==?= , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 1/3] Revert "ARM: dts: sun7i: A20-olinuxino-lime2: Fix ethernet phy-mode" Message-ID: <20220315224444.1825833e@slackpad.lan> In-Reply-To: <44524634.fMDQidcC6G@kista> References: <20220315095244.29718-1-ynezz@true.cz> <20220315095244.29718-2-ynezz@true.cz> <44524634.fMDQidcC6G@kista> Organization: Arm Ltd. X-Mailer: Claws Mail 4.0.0 (GTK+ 3.24.31; x86_64-slackware-linux-gnu) Precedence: bulk X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Tue, 15 Mar 2022 19:50:23 +0100 Jernej =C5=A0krabec wrote: > Hi Petr! >=20 > Dne torek, 15. marec 2022 ob 10:52:42 CET je Petr =C5=A0tetiar napisal(a): > > This reverts commit 55dd7e059098ce4bd0a55c251cb78e74604abb57 as it > > breaks network on my A20-olinuxino-lime2 hardware revision "K" which has > > Micrel KSZ9031RNXCC-TR Gigabit PHY. Bastien has probably some previous > > hardware revisions which were based on RTL8211E-VB-CG1 PHY and thus this > > fix was working on his board. =20 >=20 > NAK. >=20 > As Corentin mentioned in another discussion, new DT variant should be=20 > introduced for newer board model. Otherwise we can play this revert game = with=20 > each new revision which changes Ethernet PHY behaviour. It also makes mos= t=20 > sense to have naming chronologically sorted. If board name in DT file doe= sn't=20 > have any postfix, it should be compatible with earliest publicly availabl= e=20 > board. If board manufacturer releases new board variant with incompatible= =20 > changes, new DT with appropriate postfix should be introduced. >=20 > I understand that this is frustrating for you, but whole situation around= =20 > mentioned commit is unfortunate and we can't satisfy everyone. >=20 > Also good way to solve such issues is to apply DT overlay in bootloader b= ased=20 > on board revision number. I know Olimex implemented DT fixup in their=20 > downstream U-Boot fork. I agree with Jernej's here. I had a quick look into the U-Boot source, and it seem like the Micrel PHY should work there, since its phy_driver.config routine seems to ignore the phy-mode property (in contrast to its 9131 sibling in the same file). So we can go with the Realtek setting in the DT. If U-Boot's networking itself is fine, we can just try to fix up the DT. Looks like board/sunxi/board.c:ft_board_setup() is the place. The PHY is autodetected, I am pretty sure we can somehow read the PHY driver name, and depending on that just patch the phy-mode property. Does that sound like a way out? Cheers, Andre > Best regards, > Jernej >=20 > >=20 > > Cc: stable@vger.kernel.org > > Cc: Bastien Roucari=C3=A8s > > References: https://github.com/openwrt/openwrt/issues/9153 > > References: https://github.com/OLIMEX/OLINUXINO/blob/master/HARDWARE/A2= 0-OLinuXino-LIME2/hardware_revision_changes_log.txt > > Signed-off-by: Petr =C5=A0tetiar > > --- > > arch/arm/boot/dts/sun7i-a20-olinuxino-lime2.dts | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > >=20 > > diff --git a/arch/arm/boot/dts/sun7i-a20-olinuxino-lime2.dts b/arch/arm= /boot/ =20 > dts/sun7i-a20-olinuxino-lime2.dts > > index ecb91fb899ff..8077f1716fbc 100644 > > --- a/arch/arm/boot/dts/sun7i-a20-olinuxino-lime2.dts > > +++ b/arch/arm/boot/dts/sun7i-a20-olinuxino-lime2.dts > > @@ -112,7 +112,7 @@ &gmac { > > pinctrl-names =3D "default"; > > pinctrl-0 =3D <&gmac_rgmii_pins>; > > phy-handle =3D <&phy1>; > > - phy-mode =3D "rgmii-id"; > > + phy-mode =3D "rgmii"; > > status =3D "okay"; > > }; > > =20 > > =20 >=20 >=20 >=20