Skip to contentSkip to conversation

rockchip: enabled LAN port on NanoPi R2S

PATCH Superseded Tianling Shen 2 participants 4 messages Apr 5, 2021

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rockchip: enabled LAN port on NanoPi R2S

From: David Bauer <[email protected]>

Enable the USB3 port on the FriendlyARM NanoPi R2S. This is required for the USB3 attached LAN port to work.

---
 .../boot/dts/rockchip/rk3328-nanopi-r2s.dts   | 23 +++++++++++++++++++
 1 file changed, 23 insertions(+)
arch/arm64/boot/dts/rockchip/rk3328-nanopi-r2s.dts +23 -0
index faf496d789cf..6ba9799a95c5 100644
@@ -37,6 +37,18 @@
 		};
 	};
 
+	vcc_rtl8153: vcc-rtl8153-regulator {
+		compatible = "regulator-fixed";
+		gpio = <&gpio2 RK_PC6 GPIO_ACTIVE_HIGH>;
+		pinctrl-names = "default";
+		pinctrl-0 = <&rtl8153_en_drv>;
+		regulator-always-on;
+		regulator-name = "vcc_rtl8153";
+		regulator-min-microvolt = <5000000>;
+		regulator-max-microvolt = <5000000>;
+		enable-active-high;
+	};
+
 	leds {
 		compatible = "gpio-leds";
 		pinctrl-0 = <&lan_led_pin>,  <&sys_led_pin>, <&wan_led_pin>;
@@ -265,6 +277,12 @@
 			};
 		};
 	};
+
+	usb {
+		rtl8153_en_drv: rtl8153-en-drv {
+			rockchip,pins = <2 RK_PC6 RK_FUNC_GPIO &pcfg_pull_none>;
+		};
+	};
 };
 
 &io_domains {
@@ -364,6 +382,11 @@
 	dr_mode = "host";
 };
 
+&usbdrd3 {
+	dr_mode = "host";
+	status = "okay";
+};
+
 &usb_host0_ehci {
 	status = "okay";
 };
Signature · 1 line
2.17.1
#1 lore raw

Hi,

Quoted 19 lines · Tianling Shen

From: David Bauer <[email protected]>

Enable the USB3 port on the FriendlyARM NanoPi R2S. This is required for the USB3 attached LAN port to work.

---
 .../boot/dts/rockchip/rk3328-nanopi-r2s.dts   | 23 +++++++++++++++++++
 1 file changed, 23 insertions(+)
arch/arm64/boot/dts/rockchip/rk3328-nanopi-r2s.dts +0 -0
index faf496d789cf..6ba9799a95c5 100644
@@ -37,6 +37,18 @@
                };
        };

arch/arm64/boot/dts/rockchip/rk3328-nanopi-r2s.dts line 48

Quoted 10 lines
arch/arm64/boot/dts/rockchip/rk3328-nanopi-r2s.dts +9 -0
 
+       vcc_rtl8153: vcc-rtl8153-regulator {
+               compatible = "regulator-fixed";
+               gpio = <&gpio2 RK_PC6 GPIO_ACTIVE_HIGH>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&rtl8153_en_drv>;
+               regulator-always-on;
+               regulator-name = "vcc_rtl8153";
+               regulator-min-microvolt = <5000000>;
+               regulator-max-microvolt = <5000000>;

This is just a simple switch, not an actual regulator. It would make more sense to drop the voltage range and instead have the implementation pass-through voltage constraints from its parent.

Quoted 20 lines
arch/arm64/boot/dts/rockchip/rk3328-nanopi-r2s.dts +9 -0
+               enable-active-high;
+       };
+
        leds {
                compatible = "gpio-leds";
                pinctrl-0 = <&lan_led_pin>,  <&sys_led_pin>, <&wan_led_pin>;
@@ -265,6 +277,12 @@
                        };
                };
        };
+
+       usb {
+               rtl8153_en_drv: rtl8153-en-drv {
+                       rockchip,pins = <2 RK_PC6 RK_FUNC_GPIO &pcfg_pull_none>;
+               };
+       };
 };
 
 &io_domains {

arch/arm64/boot/dts/rockchip/rk3328-nanopi-r2s.dts line 387

Quoted 6 lines
arch/arm64/boot/dts/rockchip/rk3328-nanopi-r2s.dts +3 -0
@@ -364,6 +382,11 @@
        dr_mode = "host";
 };
 
+&usbdrd3 {
+       dr_mode = "host";
+       status = "okay";

Please also add a device node for the actual Ethernet controller, and set up an aliases node for it, so that the bootloader has some place to fill in a MAC address.

ChenYu

Quoted 13 lines
arch/arm64/boot/dts/rockchip/rk3328-nanopi-r2s.dts +2 -1
+};
+
 &usb_host0_ehci {
        status = "okay";
 };
--

2.17.1

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

#2 lore raw

Hi Chen-Yu,

Quoted 24 lines · Chen-Yu Tsai

Hi,

Quoted 20 lines · Tianling Shen

From: David Bauer <[email protected]>

Enable the USB3 port on the FriendlyARM NanoPi R2S. This is required for the USB3 attached LAN port to work.

---
 .../boot/dts/rockchip/rk3328-nanopi-r2s.dts   | 23 +++++++++++++++++++
 1 file changed, 23 insertions(+)
arch/arm64/boot/dts/rockchip/rk3328-nanopi-r2s.dts +0 -0
index faf496d789cf..6ba9799a95c5 100644
@@ -37,6 +37,18 @@
                };
        };
 
Quoted 14 lines

arch/arm64/boot/dts/rockchip/rk3328-nanopi-r2s.dts line 48

Quoted 9 lines
arch/arm64/boot/dts/rockchip/rk3328-nanopi-r2s.dts +9 -0
+       vcc_rtl8153: vcc-rtl8153-regulator {
+               compatible = "regulator-fixed";
+               gpio = <&gpio2 RK_PC6 GPIO_ACTIVE_HIGH>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&rtl8153_en_drv>;
+               regulator-always-on;
+               regulator-name = "vcc_rtl8153";
+               regulator-min-microvolt = <5000000>;
+               regulator-max-microvolt = <5000000>;

This is just a simple switch, not an actual regulator. It would make more sense to drop the voltage range and instead have the implementation pass-through voltage constraints from its parent.

Thanks, I'll remove them in v2.

Quoted 24 lines
Quoted 24 lines
arch/arm64/boot/dts/rockchip/rk3328-nanopi-r2s.dts +9 -0
+               enable-active-high;
+       };
+
        leds {
                compatible = "gpio-leds";
                pinctrl-0 = <&lan_led_pin>,  <&sys_led_pin>, <&wan_led_pin>;
@@ -265,6 +277,12 @@
                        };
                };
        };
+
+       usb {
+               rtl8153_en_drv: rtl8153-en-drv {
+                       rockchip,pins = <2 RK_PC6 RK_FUNC_GPIO &pcfg_pull_none>;
+               };
+       };
 };
 
 &io_domains {
@@ -364,6 +382,11 @@
        dr_mode = "host";
 };
 
Quoted 7 lines

arch/arm64/boot/dts/rockchip/rk3328-nanopi-r2s.dts line 387

Quoted 3 lines
arch/arm64/boot/dts/rockchip/rk3328-nanopi-r2s.dts +3 -0
+&usbdrd3 {
+       dr_mode = "host";
+       status = "okay";

Please also add a device node for the actual Ethernet controller, and set up an aliases node for it, so that the bootloader has some place to fill in a MAC address.

But there's no valid (unique) MAC address for both this or on-board ethernet... They're non-existent in design.

Thanks,
Tianling.

Quoted 17 lines

ChenYu

Quoted 13 lines
arch/arm64/boot/dts/rockchip/rk3328-nanopi-r2s.dts +2 -1
+};
+
 &usb_host0_ehci {
        status = "okay";
 };
--

2.17.1

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

#3 lore raw
Quoted 77 lines · Tianling Shen

Hi Chen-Yu,

Quoted 24 lines · Chen-Yu Tsai

Hi,

Quoted 20 lines · Tianling Shen

From: David Bauer <[email protected]>

Enable the USB3 port on the FriendlyARM NanoPi R2S. This is required for the USB3 attached LAN port to work.

---
 .../boot/dts/rockchip/rk3328-nanopi-r2s.dts   | 23 +++++++++++++++++++
 1 file changed, 23 insertions(+)
arch/arm64/boot/dts/rockchip/rk3328-nanopi-r2s.dts +0 -0
index faf496d789cf..6ba9799a95c5 100644
@@ -37,6 +37,18 @@
                };
        };
 
Quoted 14 lines

arch/arm64/boot/dts/rockchip/rk3328-nanopi-r2s.dts line 48

Quoted 9 lines
arch/arm64/boot/dts/rockchip/rk3328-nanopi-r2s.dts +9 -0
+       vcc_rtl8153: vcc-rtl8153-regulator {
+               compatible = "regulator-fixed";
+               gpio = <&gpio2 RK_PC6 GPIO_ACTIVE_HIGH>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&rtl8153_en_drv>;
+               regulator-always-on;
+               regulator-name = "vcc_rtl8153";
+               regulator-min-microvolt = <5000000>;
+               regulator-max-microvolt = <5000000>;

This is just a simple switch, not an actual regulator. It would make more sense to drop the voltage range and instead have the implementation pass-through voltage constraints from its parent.

Thanks, I'll remove them in v2.

Quoted 24 lines
Quoted 24 lines
arch/arm64/boot/dts/rockchip/rk3328-nanopi-r2s.dts +9 -0
+               enable-active-high;
+       };
+
        leds {
                compatible = "gpio-leds";
                pinctrl-0 = <&lan_led_pin>,  <&sys_led_pin>, <&wan_led_pin>;
@@ -265,6 +277,12 @@
                        };
                };
        };
+
+       usb {
+               rtl8153_en_drv: rtl8153-en-drv {
+                       rockchip,pins = <2 RK_PC6 RK_FUNC_GPIO &pcfg_pull_none>;
+               };
+       };
 };
 
 &io_domains {
@@ -364,6 +382,11 @@
        dr_mode = "host";
 };
 
Quoted 7 lines

arch/arm64/boot/dts/rockchip/rk3328-nanopi-r2s.dts line 387

Quoted 3 lines
arch/arm64/boot/dts/rockchip/rk3328-nanopi-r2s.dts +3 -0
+&usbdrd3 {
+       dr_mode = "host";
+       status = "okay";

Please also add a device node for the actual Ethernet controller, and set up an aliases node for it, so that the bootloader has some place to fill in a MAC address.

Quoted 2 lines

But there's no valid (unique) MAC address for both this or on-board ethernet... They're non-existent in design.

Correct. And thanks for confirming that it's not just me and Robin that got boards without the MAC address EEPROM...

If the user sets some MAC address in the bootloader environment by hand, the bootloader could still potentially pass that MAC address to Linux through the device tree. Whether the board has a valid address or not is beside the point.

ChenYu

Quoted 20 lines

Thanks,
Tianling.

Quoted 17 lines

ChenYu

Quoted 13 lines
arch/arm64/boot/dts/rockchip/rk3328-nanopi-r2s.dts +2 -1
+};
+
 &usb_host0_ehci {
        status = "okay";
 };
--

2.17.1

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel