[openwrt/openwrt] sunxi: Orange Pi R1: Fix USB Ethernet and activate SPI

LEDE Commits lede-commits at lists.infradead.org
Mon Jan 22 14:08:46 PST 2018


hauke pushed a commit to openwrt/openwrt.git, branch master:
https://git.lede-project.org/40db7a9dec92d3e263bd0933b972865061419e2e

commit 40db7a9dec92d3e263bd0933b972865061419e2e
Author: Hauke Mehrtens <hauke at hauke-m.de>
AuthorDate: Thu Dec 28 19:34:47 2017 +0100

    sunxi: Orange Pi R1: Fix USB Ethernet and activate SPI
    
    The USB Ethernet is not working with the patches proposed for upstream,
    fix this and activate the SPI node as this board always has a SPI flash.
    
    Both patches are also targeted for upstream kernel 4.16 and 4.17.
    
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 ...ts-sun8i-fix-USB-Ethernet-of-Orange-Pi-R1.patch | 48 ++++++++++++++++++++++
 ...RM-dts-sun8i-activate-SPI-on-Orange-Pi-R1.patch | 29 +++++++++++++
 2 files changed, 77 insertions(+)

diff --git a/target/linux/sunxi/patches-4.14/201-ARM-dts-sun8i-fix-USB-Ethernet-of-Orange-Pi-R1.patch b/target/linux/sunxi/patches-4.14/201-ARM-dts-sun8i-fix-USB-Ethernet-of-Orange-Pi-R1.patch
new file mode 100644
index 0000000..905a705
--- /dev/null
+++ b/target/linux/sunxi/patches-4.14/201-ARM-dts-sun8i-fix-USB-Ethernet-of-Orange-Pi-R1.patch
@@ -0,0 +1,48 @@
+From b76dc5927f6442df913f03ed261c5bff18a98df6 Mon Sep 17 00:00:00 2001
+From: Icenowy Zheng <icenowy at aosc.io>
+Date: Thu, 28 Dec 2017 21:01:56 +0800
+Subject: [PATCH] ARM: dts: sun8i: fix USB Ethernet of Orange Pi R1
+
+Orange Pi R1 uses a Realtek RTL8152B USB Ethernet chip, which is easily
+seen on the board but not show in the schematics. A regulator for the
+power of the RTL8152B chip is hidden, which uses the same pin with the
+Wi-Fi regulator on the original Orange Pi Zero.
+
+Add this regulator back to the device tree, and bind it to USB1.
+
+Signed-off-by: Icenowy Zheng <icenowy at aosc.io>
+---
+ arch/arm/boot/dts/sun8i-h2-plus-orangepi-r1.dts | 18 ++++++++++++++++++
+ 1 file changed, 18 insertions(+)
+
+--- a/arch/arm/boot/dts/sun8i-h2-plus-orangepi-r1.dts
++++ b/arch/arm/boot/dts/sun8i-h2-plus-orangepi-r1.dts
+@@ -49,6 +49,20 @@
+ 
+ 	/delete-node/ reg_vcc_wifi;
+ 
++	/*
++	 * Ths pin of this regulator is the same with the Wi-Fi extra
++	 * regulator on the original Zero. However it's used for USB
++	 * Ethernet rather than the Wi-Fi now.
++	 */
++	reg_vcc_usb_eth: reg-vcc-usb-ethernet {
++		compatible = "regulator-fixed";
++		regulator-min-microvolt = <5000000>;
++		regulator-max-microvolt = <5000000>;
++		regulator-name = "vcc-usb-ethernet";
++		enable-active-high;
++		gpio = <&pio 0 20 GPIO_ACTIVE_HIGH>;
++	};
++
+ 	aliases {
+ 		ethernet1 = &rtl8189etv;
+ 	};
+@@ -71,3 +85,7 @@
+ 		reg = <1>;
+ 	};
+ };
++
++&usbphy {
++	usb1_vbus-supply = <&reg_vcc_usb_eth>;
++};
diff --git a/target/linux/sunxi/patches-4.14/202-ARM-dts-sun8i-activate-SPI-on-Orange-Pi-R1.patch b/target/linux/sunxi/patches-4.14/202-ARM-dts-sun8i-activate-SPI-on-Orange-Pi-R1.patch
new file mode 100644
index 0000000..3f03c11
--- /dev/null
+++ b/target/linux/sunxi/patches-4.14/202-ARM-dts-sun8i-activate-SPI-on-Orange-Pi-R1.patch
@@ -0,0 +1,29 @@
+From 4a36ec1f82db3fa34d766dec5062b4de06b50f7f Mon Sep 17 00:00:00 2001
+From: Hauke Mehrtens <hauke at hauke-m.de>
+Date: Thu, 28 Dec 2017 14:11:36 +0100
+Subject: [PATCH] ARM: dts: sun8i: activate SPI on Orange Pi R1
+
+This board has a SPI flash, activate it also in device tree by default.
+
+Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
+---
+ arch/arm/boot/dts/sun8i-h2-plus-orangepi-r1.dts | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+--- a/arch/arm/boot/dts/sun8i-h2-plus-orangepi-r1.dts
++++ b/arch/arm/boot/dts/sun8i-h2-plus-orangepi-r1.dts
+@@ -68,6 +68,14 @@
+ 	};
+ };
+ 
++&spi0 {
++	status = "okay";
++
++	flash at 0 {
++		compatible = "mxicy,mx25l12805d", "jedec,spi-nor";
++	};
++};
++
+ &ohci1 {
+ 	/*
+ 	 * RTL8152B USB-Ethernet adapter is connected to USB1,



More information about the lede-commits mailing list