From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C2C4EC98304 for ; Wed, 23 Sep 2026 18:42:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To:References:To: From:Subject:Cc:Message-Id:Date:Content-Type:Content-Transfer-Encoding: Mime-Version:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=7Evj7Zo2fxX/UmQ9+DQ953T2vayoIk7bt8x9oTEtyaA=; b=ekh7B35dg8dWKe0FKHesJzTb++ Jxq0/ootdUN2Dec0CwTnePjjmneMV58rRqdD5JHMnalgl3KyUKEvD9jYpW3OfDv7x3SZOO7jpYPDf 0Ux+rt99XhdPDigduoKvFnYznYpt6ZVBjCB1fi3/NJ4os3qllAtK+TpQv7Cz9uSGhW47L/9ZsQcUJ iTKBbqMjK2nUCtZWnPZNQiSk73pKU5tj+H7vGvzQqhHYfZ6r01mwctrYeoYirBgeBt/SKhDpxNyAu nGiK9Av6MCxHvKAn9SBTWdpvXd99IOK/vEHdk2ZWeMjQ2iyYtjCMYflZQB04BrPGme1xf+KnCHIw8 irFR8gSQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1x9Rv6-00000009FY2-1h5E; Wed, 23 Sep 2026 18:42:16 +0000 Received: from out-129.mta0.migadu.com ([2001:41d0:1004:224b::81] helo=mta0.migadu.com) by bombadil.infradead.org with esmtps (Exim 4.99.1 #2 (Red Hat Linux)) id 1x9Rtv-00000009F9S-43wp for linux-arm-kernel@lists.infradead.org; Wed, 23 Sep 2026 18:41:06 +0000 X-Envelope-To: linux-arm-kernel@lists.infradead.org DKIM-Signature: a=rsa-sha256; bh=KHltIsP16/D58QoS2DV7BJ0dfwy+AgfodY00vY+4j2w=; c=simple/simple; d=cknow-tech.com; h=from:to:subject:date:message-id:mime-version:content-type; s=key1; t=1790188861; v=1; x=1790793661; b=TeeSLU4NvuC/dI9yBAt3y7YJRQJgoJiBDSsT45OfJ2+raldAQL3xacJT4VO5+WOtjrU5SKE5 uKaH1Hs7X63tyw3onkOeKCXhfvtALMBaGbmA2sx5a3Dt5d0RoNT2G5liQgThN6r+h5XBmhQfAYn dqDafJu71Gsgx9sm1Kd91aABRy7qVHmR/8e8+rW/gc47jp3HDwjCSWu+0ho1CJg3YSWdzsFPyVo ZK993pPO/yDEb3ESNzUY0u6cNL97wzCuvgg9kHDoXFECkdykhV87DDx/ktLaSz4mCsVZEs4x0Wz qxTeTUE3Qtaih8vM87HAqppV9+Hx2JHBcE5W8es2NqfMg== X-Envelope-To: linux-arm-kernel@lists.infradead.org Received: by smtp.migadu.com with ESMTPS id b3c24cb28d2361dc; Wed, 23 Sep 2026 18:40:51 +0000 X-Mizu-Trace-ID: b3c24cb28d2361dc X-Migadu-Flow: FLOW_OUT Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Wed, 23 Sep 2026 20:40:50 +0200 Message-Id: Cc: "Sebastian Reichel" , , , , , , "Jonas Karlman" Subject: Re: [PATCH v5 5/7] arm64: dts: rockchip: describe PCIe RTL8125 Ethernet on NanoPi R5S From: "Diederik de Haas" To: "Ricardo Pardini" , "Diederik de Haas" , "Heiner Kallweit" , , "Andrew Lunn" , "David S. Miller" , "Eric Dumazet" , "Jakub Kicinski" , "Paolo Abeni" , "Rob Herring" , "Krzysztof Kozlowski" , "Conor Dooley" , "Heiko Stuebner" X-Mailer: aerc 0.22.0-24-g39041fd9f179 References: <20260910-rk3588-dts-rtl-eth-describe-dt-alias-v5-0-c1b9e5f10cd6@pardini.net> <20260910-rk3588-dts-rtl-eth-describe-dt-alias-v5-5-c1b9e5f10cd6@pardini.net> <12e5e5ad-7d55-469d-a63e-d19e3279c6c1@pardini.net> In-Reply-To: <12e5e5ad-7d55-469d-a63e-d19e3279c6c1@pardini.net> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20260923_114104_267987_F448B624 X-CRM114-Status: GOOD ( 28.14 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Ricardo, On Wed Sep 23, 2026 at 8:02 PM CEST, Ricardo Pardini wrote: > On 23/09/2026 19:15, Diederik de Haas wrote: >> On Thu Sep 10, 2026 at 10:07 PM CEST, Ricardo Pardini via B4 Relay wrote= : >>> From: Ricardo Pardini >>> >>> The FriendlyElec NanoPi R5S (rk3568) carries two on-board Realtek >>> RTL8125 NICs behind pcie2x1 and pcie3x1, alongside the existing gmac0 >>> RGMII PHY. >>> >>> Describe the fixed function nodes and attach ethernet1/ethernet2 >>> aliases (ethernet0 stays mapped to gmac0), so that U-Boot's >>> fdt_fixup_ethernet() can inject mac-address properties from its >>> eth1addr/eth2addr env, for stable MACs across boots that both U-Boot >>> and the kernel agree on. >>> >>> Signed-off-by: Ricardo Pardini >>> --- >>> arch/arm64/boot/dts/rockchip/rk3568-nanopi-r5s.dts | 30 +++++++++++++= +++++++++ >>> 1 file changed, 30 insertions(+) >>> >>> diff --git a/arch/arm64/boot/dts/rockchip/rk3568-nanopi-r5s.dts b/arch/= arm64/boot/dts/rockchip/rk3568-nanopi-r5s.dts >>> index 90ce6f0e1dcff..9ed11663c31c9 100644 >>> --- a/arch/arm64/boot/dts/rockchip/rk3568-nanopi-r5s.dts >>> +++ b/arch/arm64/boot/dts/rockchip/rk3568-nanopi-r5s.dts >>> @@ -15,6 +15,8 @@ / { >>> =20 >>> aliases { >>> ethernet0 =3D &gmac0; >>> + ethernet1 =3D &rtl_eth1; >>> + ethernet2 =3D &rtl_eth2; >>> }; >>=20 >> With my NanoPi-R5S I'm still getting the following warning: >>=20 >> r8169 0001:11:00.0: can't read MAC address, setting random one >>=20 >> ``` >> root@nanopi-r5s:~# ip link >> 1: lo: mtu 65536 qdisc noqueue state UNKNOWN mode= DEFAULT group default qlen 1000 >> link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 >> 2: end1: mtu 1500 qdisc fq_codel sta= te DOWN mode DEFAULT group default qlen 1000 >> link/ether 4e:52:85:9e:22:f9 brd ff:ff:ff:ff:ff:ff >> altname enp1s0 >> altname enx4e52859e22f9 >> 3: end2: mtu 1500 qdisc fq_codel sta= te DOWN mode DEFAULT group default qlen 1000 >> link/ether 12:e5:47:9e:e2:f1 brd ff:ff:ff:ff:ff:ff >> altname enP1p17s0 >> 4: end0: mtu 1500 qdisc mq state UP mo= de DEFAULT group default qlen 1000 >> link/ether 4e:52:85:9e:22:f8 brd ff:ff:ff:ff:ff:ff >> altname enx4e52859e22f8 >> ``` >>=20 >> I did not do anything (explicitly) in U-Boot, but it seems it created a >> non-random MAC address for end0 and end1 ... and then stopped. >> AFAIK gmac0=3Dend0 already had a non-random MAC address and I hoped/expe= cted >> it would create non-random addresses for end1 and end2, which would've m= ade >> the above warning go away too. >>=20 >> Is this an issue with this patch, with U-Boot or me? > > Hi Diederik, in this case (3 ethernet's) I think it's down to U-boot. > Check the output of `printenv` in u-boot, you'll probably find it only=20 > pre-computes 2 MAC addresses, and doesn't feed the ethernet2 alias=20 > during its fdt_fixup_ethernet(). It's indeed what I suspected. I don't dabble in U-Boot very often, but I se= em to recall it has fixed room for 2 MAC addresses and that would explain the symptom/problem I described. > Try doing `setenv eth2addr xx:xx...` in u-boot before booting -- it=20 > should work. I think that's what I did when testing the R5S with this=20 > series, but it has been a very long time ago. I'm going to give it a try and see what happens. > One way around this (without u-boot) would be to use Alexey's series [1]= =20 > which could compute as many MACs as needed out of the CPU serialnum -=20 > but that also won't work as-sent vs rk356x, I believe he's checking an=20 > alternative proposed. > > [1]=20 > https://lore.kernel.org/linux-rockchip/20260902-rk3576-otp-cpuid-mac-v2-0= -e4b7fe2ab13f@flipper.net/ Haha! You linked in that thread to Heiko's RK356X OTP patch set and I teste= d that hoping/assuming that could help with generating unique MAC addresses. I see (or think I do) pieces of the puzzle, but I don't know how they all fit together. >> Full details: >> https://paste.sr.ht/~diederik/8ae7d354985afcd1c3464e3a4ad81da1b4442364 >>=20 >> Side note: >> I wonder how 'random' those addresses are as during testing ``ssh rock5b= `` >> landed me on another device (NanoPC-T6 Plus), f.e. My router has DHCP >> reservations based on MAC addresses and it looks like it got confused ;-= ) > > Interesting. I dunno what seed is used, as I've been fully set on making= =20 > it non-random, but I wouldn't discard the possibility of conflicts=20 > across different machines. One more reason to have this series ;-) They all use the RTL8125BG and I suspect that plays a role in it. > I'll soon send a v6 to linux-rockchip/dt (with small fixes Sashiko found= =20 > to DTs, and without the binding) and split a single-patch v1 to net-next= =20 > with only the binding, collecting Rob's review. If and when those land,= =20 > we'd have open road both for u-boot local-mac-address and Alexey's=20 > nvmem-cells for the RTLs. Awesome, thanks :-) Cheers, Diederik > Regards, > Ricardo > > >>=20 >> Cheers, >> Diederik >>=20 >>> gpio-keys { >>> @@ -107,6 +109,20 @@ &pcie2x1 { >>> num-lanes =3D <1>; >>> reset-gpios =3D <&gpio0 RK_PB6 GPIO_ACTIVE_HIGH>; >>> status =3D "okay"; >>> + >>> + pcie@0,0 { >>> + reg =3D <0x000000 0 0 0 0>; >>> + #address-cells =3D <3>; >>> + #size-cells =3D <2>; >>> + ranges; >>> + device_type =3D "pci"; >>> + bus-range =3D <0x00 0x0f>; >>> + >>> + rtl_eth1: ethernet@0,0 { >>> + compatible =3D "pci10ec,8125"; >>> + reg =3D <0x010000 0 0 0 0>; >>> + }; >>> + }; >>> }; >>> =20 >>> &pcie30phy { >>> @@ -119,6 +135,20 @@ &pcie3x1 { >>> reset-gpios =3D <&gpio0 RK_PA0 GPIO_ACTIVE_HIGH>; >>> vpcie3v3-supply =3D <&vcc3v3_pcie>; >>> status =3D "okay"; >>> + >>> + pcie@0,0 { >>> + reg =3D <0x100000 0 0 0 0>; >>> + #address-cells =3D <3>; >>> + #size-cells =3D <2>; >>> + ranges; >>> + device_type =3D "pci"; >>> + bus-range =3D <0x10 0x1f>; >>> + >>> + rtl_eth2: ethernet@0,0 { >>> + compatible =3D "pci10ec,8125"; >>> + reg =3D <0x110000 0 0 0 0>; >>> + }; >>> + }; >>> }; >>> =20 >>> &pcie3x2 { >>=20