linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] arm64: dts: allwinner: define USB3 Ethernet on NanoPi R1S H5
@ 2022-05-02 14:40 Chukun Pan
  2022-05-03 17:54 ` Jernej Škrabec
  0 siblings, 1 reply; 6+ messages in thread
From: Chukun Pan @ 2022-05-02 14:40 UTC (permalink / raw)
  To: Chen-Yu Tsai
  Cc: Jernej Skrabec, Samuel Holland, Rob Herring, Krzysztof Kozlowski,
	devicetree, linux-arm-kernel, linux-sunxi, linux-kernel,
	Chukun Pan

The NanoPi R1S H5 has a Realtek RTL8153B USB 3.0 Ethernet chip
connected to the USB 2.0 port of the Allwinner H5 SoC.

Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
---
 arch/arm64/boot/dts/allwinner/sun50i-h5-nanopi-r1s-h5.dts | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h5-nanopi-r1s-h5.dts b/arch/arm64/boot/dts/allwinner/sun50i-h5-nanopi-r1s-h5.dts
index 55b369534a08..dd655a491549 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-h5-nanopi-r1s-h5.dts
+++ b/arch/arm64/boot/dts/allwinner/sun50i-h5-nanopi-r1s-h5.dts
@@ -21,7 +21,8 @@ / {
 
 	aliases {
 		ethernet0 = &emac;
-		ethernet1 = &rtl8189etv;
+		ethernet1 = &rtl8153;
+		ethernet2 = &rtl8189etv;
 		serial0 = &uart0;
 	};
 
@@ -116,6 +117,11 @@ &cpu0 {
 
 &ehci1 {
 	status = "okay";
+
+	rtl8153: device@1 {
+		compatible = "usbbda,8153";
+		reg = <1>;
+	};
 };
 
 &ehci2 {
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] arm64: dts: allwinner: define USB3 Ethernet on NanoPi R1S H5
  2022-05-02 14:40 [PATCH] arm64: dts: allwinner: define USB3 Ethernet on NanoPi R1S H5 Chukun Pan
@ 2022-05-03 17:54 ` Jernej Škrabec
  2022-05-03 20:00   ` Jernej Škrabec
  2022-05-08 15:25   ` Chukun Pan
  0 siblings, 2 replies; 6+ messages in thread
From: Jernej Škrabec @ 2022-05-03 17:54 UTC (permalink / raw)
  To: Chen-Yu Tsai, Chukun Pan
  Cc: Samuel Holland, Rob Herring, Krzysztof Kozlowski, devicetree,
	linux-arm-kernel, linux-sunxi, linux-kernel, Chukun Pan

Dne ponedeljek, 02. maj 2022 ob 16:40:09 CEST je Chukun Pan napisal(a):
> The NanoPi R1S H5 has a Realtek RTL8153B USB 3.0 Ethernet chip
> connected to the USB 2.0 port of the Allwinner H5 SoC.
> 
> Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
> ---
>  arch/arm64/boot/dts/allwinner/sun50i-h5-nanopi-r1s-h5.dts | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h5-nanopi-r1s-h5.dts b/
arch/arm64/boot/dts/allwinner/sun50i-h5-nanopi-r1s-h5.dts
> index 55b369534a08..dd655a491549 100644
> --- a/arch/arm64/boot/dts/allwinner/sun50i-h5-nanopi-r1s-h5.dts
> +++ b/arch/arm64/boot/dts/allwinner/sun50i-h5-nanopi-r1s-h5.dts
> @@ -21,7 +21,8 @@ / {
>  
>  	aliases {
>  		ethernet0 = &emac;
> -		ethernet1 = &rtl8189etv;
> +		ethernet1 = &rtl8153;
> +		ethernet2 = &rtl8189etv;
>  		serial0 = &uart0;
>  	};
>  
> @@ -116,6 +117,11 @@ &cpu0 {
>  
>  &ehci1 {
>  	status = "okay";

You need to add #address-cells and #size-cells properties, otherwise "make 
dtbs_check W=1" generates warnings.

Best regards,
Jernej

> +
> +	rtl8153: device@1 {
> +		compatible = "usbbda,8153";
> +		reg = <1>;
> +	};
>  };
>  
>  &ehci2 {
> -- 
> 2.25.1
> 
> 



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Re: [PATCH] arm64: dts: allwinner: define USB3 Ethernet on NanoPi R1S H5
  2022-05-03 17:54 ` Jernej Škrabec
@ 2022-05-03 20:00   ` Jernej Škrabec
  2022-05-08 15:25   ` Chukun Pan
  1 sibling, 0 replies; 6+ messages in thread
From: Jernej Škrabec @ 2022-05-03 20:00 UTC (permalink / raw)
  To: Chen-Yu Tsai, Chukun Pan
  Cc: Samuel Holland, Rob Herring, Krzysztof Kozlowski, devicetree,
	linux-arm-kernel, linux-sunxi, linux-kernel, Chukun Pan

Dne torek, 03. maj 2022 ob 19:54:34 CEST je Jernej Škrabec napisal(a):
> Dne ponedeljek, 02. maj 2022 ob 16:40:09 CEST je Chukun Pan napisal(a):
> > The NanoPi R1S H5 has a Realtek RTL8153B USB 3.0 Ethernet chip
> > connected to the USB 2.0 port of the Allwinner H5 SoC.
> > 
> > Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
> > ---
> >  arch/arm64/boot/dts/allwinner/sun50i-h5-nanopi-r1s-h5.dts | 8 +++++++-
> >  1 file changed, 7 insertions(+), 1 deletion(-)
> > 
> > diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h5-nanopi-r1s-h5.dts b/
> arch/arm64/boot/dts/allwinner/sun50i-h5-nanopi-r1s-h5.dts
> > index 55b369534a08..dd655a491549 100644
> > --- a/arch/arm64/boot/dts/allwinner/sun50i-h5-nanopi-r1s-h5.dts
> > +++ b/arch/arm64/boot/dts/allwinner/sun50i-h5-nanopi-r1s-h5.dts
> > @@ -21,7 +21,8 @@ / {
> >  
> >  	aliases {
> >  		ethernet0 = &emac;
> > -		ethernet1 = &rtl8189etv;
> > +		ethernet1 = &rtl8153;
> > +		ethernet2 = &rtl8189etv;

Additionally, it's not a good idea to change order of ethernet nodes. It can 
affect mac address assigning procedure in bootloader.

Best regards,
Jernej

> >  		serial0 = &uart0;
> >  	};
> >  
> > @@ -116,6 +117,11 @@ &cpu0 {
> >  
> >  &ehci1 {
> >  	status = "okay";
> 
> You need to add #address-cells and #size-cells properties, otherwise "make 
> dtbs_check W=1" generates warnings.
> 
> Best regards,
> Jernej
> 
> > +
> > +	rtl8153: device@1 {
> > +		compatible = "usbbda,8153";
> > +		reg = <1>;
> > +	};
> >  };
> >  
> >  &ehci2 {
> > -- 
> > 2.25.1
> > 
> > 
> 
> 
> 



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Re: [PATCH] arm64: dts: allwinner: define USB3 Ethernet on NanoPi R1S H5
  2022-05-03 17:54 ` Jernej Škrabec
  2022-05-03 20:00   ` Jernej Škrabec
@ 2022-05-08 15:25   ` Chukun Pan
  2022-05-09  8:52     ` Andre Przywara
  2022-05-09 15:00     ` Chukun Pan
  1 sibling, 2 replies; 6+ messages in thread
From: Chukun Pan @ 2022-05-08 15:25 UTC (permalink / raw)
  To: Jernej Skrabec
  Cc: devicetree, linux-arm-kernel, linux-sunxi, linux-kernel, Chukun Pan

> > --- a/arch/arm64/boot/dts/allwinner/sun50i-h5-nanopi-r1s-h5.dts
> > +++ b/arch/arm64/boot/dts/allwinner/sun50i-h5-nanopi-r1s-h5.dts
> > @@ -21,7 +21,8 @@ / {
> >  
> >  	aliases {
> >  		ethernet0 = &emac;
> > -		ethernet1 = &rtl8189etv;
> > +		ethernet1 = &rtl8153;
> > +		ethernet2 = &rtl8189etv;

> Additionally, it's not a good idea to change order of ethernet nodes. It can 
> affect mac address assigning procedure in bootloader.

There is no eth1addr in uboot, so this doesn't affect the mac address.
The network order in the kernel is eth0(emac) / eth1(rtl8153) / wlan0,
so I think it would be better to change it this way.

Thanks,
Chukun


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] arm64: dts: allwinner: define USB3 Ethernet on NanoPi R1S H5
  2022-05-08 15:25   ` Chukun Pan
@ 2022-05-09  8:52     ` Andre Przywara
  2022-05-09 15:00     ` Chukun Pan
  1 sibling, 0 replies; 6+ messages in thread
From: Andre Przywara @ 2022-05-09  8:52 UTC (permalink / raw)
  To: Chukun Pan
  Cc: Jernej Skrabec, devicetree, linux-arm-kernel, linux-sunxi, linux-kernel

On Sun,  8 May 2022 23:25:05 +0800
Chukun Pan <amadeus@jmu.edu.cn> wrote:

Hi,

> > > --- a/arch/arm64/boot/dts/allwinner/sun50i-h5-nanopi-r1s-h5.dts
> > > +++ b/arch/arm64/boot/dts/allwinner/sun50i-h5-nanopi-r1s-h5.dts
> > > @@ -21,7 +21,8 @@ / {
> > >  
> > >  	aliases {
> > >  		ethernet0 = &emac;
> > > -		ethernet1 = &rtl8189etv;
> > > +		ethernet1 = &rtl8153;
> > > +		ethernet2 = &rtl8189etv;  
> 
> > Additionally, it's not a good idea to change order of ethernet nodes. It can 
> > affect mac address assigning procedure in bootloader.  
> 
> There is no eth1addr in uboot, so this doesn't affect the mac address.

Really? I don't have a board at hand to double check, but the code I read
here says otherwise:
https://source.denx.de/u-boot/u-boot/-/blob/master/board/sunxi/board.c#L791-813
There it checks for up to four ethernet aliases and assigns MAC addresses
to them, using the index in the lowest byte.
So this would change the MAC address of the WiFi adapter.

Am I missing something?

> The network order in the kernel is eth0(emac) / eth1(rtl8153) / wlan0,

Regardless of the fact that you shouldn't rely on indexes in device names,
wouldn't that be that same, regardless of the order of USB and WiFi?

Cheers,
Andre

> so I think it would be better to change it this way.
> 
> Thanks,
> Chukun
> 
> 


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Re: [PATCH] arm64: dts: allwinner: define USB3 Ethernet on NanoPi R1S H5
  2022-05-08 15:25   ` Chukun Pan
  2022-05-09  8:52     ` Andre Przywara
@ 2022-05-09 15:00     ` Chukun Pan
  1 sibling, 0 replies; 6+ messages in thread
From: Chukun Pan @ 2022-05-09 15:00 UTC (permalink / raw)
  To: Jernej Skrabec
  Cc: devicetree, linux-arm-kernel, linux-sunxi, linux-kernel, Chukun Pan

> Really? I don't have a board at hand to double check, but the code I read
> here says otherwise:
> https://source.denx.de/u-boot/u-boot/-/blob/master/board/sunxi/board.c#L791-813
> There it checks for up to four ethernet aliases and assigns MAC addresses
> to them, using the index in the lowest byte.
> So this would change the MAC address of the WiFi adapter.
> Am I missing something?

I'm very sorry for this, the rtl8189etv driver assigns the correct
mac address to wlan0, so I didn't observe the mac address change.
Sorry for my misunderstanding.

Thanks,
Chukun


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-05-09 15:00 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-02 14:40 [PATCH] arm64: dts: allwinner: define USB3 Ethernet on NanoPi R1S H5 Chukun Pan
2022-05-03 17:54 ` Jernej Škrabec
2022-05-03 20:00   ` Jernej Škrabec
2022-05-08 15:25   ` Chukun Pan
2022-05-09  8:52     ` Andre Przywara
2022-05-09 15:00     ` Chukun Pan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).