Skip to contentSkip to conversation

arm64: dts: allwinner: A64 boards DT updates

PATCH Superseded Andre Przywara 5 participants 42 messages Jul 26, 2018 – Jul 27, 2018

Subsystems (2)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

v2 cover arm64: dts: allwinner: A64 boards DT updates

Hi,

compared to v1, this adds Samuel's Orange Pi Win series in a split-up form, fixes some issues with the Olinuxino and addresses the other comments on the list.
The first 12 patches should be fine. I would be grateful for Tested-by's on the other six patches.

-----------------------------------------
While starring at some DTs while copying the kernel DTs into the U-Boot tree, I realised that some boards seem to get more love than others. Fix up some issues I found by inspection on some boards:
Patch 1 adds L2 cache nodes, to avoid a message on the boot console. Patch 2 adds a separate DT file for the Pine64-LTS board, which from the software point of view is very much a SOPine + baseboard. Patch 3 till 11 fix various Orange Pi Win issues, which Samuel posted before [1]. According to Maxime's comment and with Samuel's permission, I split them up and integrated them here.
There were reports from people about the Olinuxino board having issues, so patches 12-14 attempt to fix them.
The NanoPi-A64 also hasn't been updated in a while: enable the Ethernet and the WiFi/Bluetooth chip, fix a voltage issue and add the LED in the last four patches.

I don't have the OrangePi, Olinuxino or NanoPi-A64, so can't test these boards. So even though I have carefully checked the changes against the available schematics, I would really love to see some testing and confirmation from owners of these systems.

Cheers,
Andre.

[1] http://lists.infradead.org/pipermail/linux-arm-kernel/2018-May/576897.html

Changelog v1..v2:
- add Samuel's Orange Pi Win series (split up)
- add Martin's Tested-by: for the DRAM voltage fix
- add supply property and alias for Olinuxino Ethernet
- fix Olinuxino USB supply issues (AXP VBus, id_det GPIO, bus 0/1 mix-up)
- drop NanoPi-A64 PortE voltage change (clashes with CSI pins)
- fix NanoPi-A64 WiFi node (better node name, no compatible string)

Andre Przywara (9):
arm64: dts: allwinner: a64: Add L2 cache nodes
arm64: dts: allwinner: a64: Add Pine64-LTS device tree file
arm64: dts: allwinner: a64: Olinuxino: fix DRAM voltage
arm64: dts: allwinner: a64: Olinuxino: add Ethernet nodes
arm64: dts: allwinner: a64: Olinuxino: enable USB
arm64: dts: allwinner: a64: NanoPi-A64: Fix DCDC1 voltage
arm64: dts: allwinner: a64: NanoPi-A64: Add Ethernet
arm64: dts: allwinner: a64: NanoPi-A64: Add Wifi/Bluetooth chip
arm64: dts: allwinner: a64: NanoPi-A64: Add blue status LED

Samuel Holland (9):
arm64: dts: allwinner: a64: Orange Pi Win: Fix SD card node
arm64: dts: allwinner: a64: Orange Pi Win: Fix USB
arm64: dts: allwinner: a64: Orange Pi Win: Add Ethernet node
arm64: dts: allwinner: a64: Orange Pi Win: Add UARTs
arm64: dts: allwinner: a64: Orange Pi Win: Add LED node
arm64: dts: allwinner: a64: Orange Pi Win: Add SDIO node
arm64: dts: allwinner: a64: Orange Pi Win: Add SPI flash node
arm64: dts: allwinner: a64: Orange Pi Win: Mark CPU supply regulator
arm64: dts: allwinner: a64: Orange Pi Win: Add missing power rails

 arch/arm64/boot/dts/allwinner/Makefile             |   1 +
 .../boot/dts/allwinner/sun50i-a64-nanopi-a64.dts   |  63 ++++++++-
 .../boot/dts/allwinner/sun50i-a64-olinuxino.dts    |  70 +++++++++-
 .../boot/dts/allwinner/sun50i-a64-orangepi-win.dts | 141 ++++++++++++++++++++-
 .../boot/dts/allwinner/sun50i-a64-pine64-lts.dts   |  13 ++
 arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi      |   9 ++
 6 files changed, 285 insertions(+), 12 deletions(-)
 create mode 100644 arch/arm64/boot/dts/allwinner/sun50i-a64-pine64-lts.dts
Signature · 1 line
2.14.4
#1 lore raw

PATCH v2 1/18 arm64: dts: allwinner: a64: Add L2 cache nodes

Current kernels complain when booting on an A64 Soc:
....

[    1.904297] cacheinfo: Unable to detect cache hierarchy for CPU 0

....
Not a real biggie on this flat topology, but also easy enough to fix.

Add the L2 cache node and let each CPU point to it.

---
 arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 9 +++++++++
 1 file changed, 9 insertions(+)
arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi +9 -0
index d3daf90a8715..934d7e87fa08 100644
@@ -88,6 +88,7 @@
 			device_type = "cpu";
 			reg = <0>;
 			enable-method = "psci";
+			next-level-cache = <&L2>;
 		};
 
 		cpu1: cpu at 1 {
@@ -95,6 +96,7 @@
 			device_type = "cpu";
 			reg = <1>;
 			enable-method = "psci";
+			next-level-cache = <&L2>;
 		};
 
 		cpu2: cpu at 2 {
@@ -102,6 +104,7 @@
 			device_type = "cpu";
 			reg = <2>;
 			enable-method = "psci";
+			next-level-cache = <&L2>;
 		};
 
 		cpu3: cpu at 3 {
@@ -109,6 +112,12 @@
 			device_type = "cpu";
 			reg = <3>;
 			enable-method = "psci";
+			next-level-cache = <&L2>;
+		};
+
+		L2: l2-cache {
+			compatible = "cache";
+			cache-level = <2>;
 		};
 	};
 
Signature · 1 line
2.14.4
#2 lore raw

PATCH v2 2/18 arm64: dts: allwinner: a64: Add Pine64-LTS device tree file

In reply to Andre Przywara

The Pine64-LTS is a variant of the Pine64 board, from the software visible side resembling a SoPine module on a baseboard, though the board has the SoC and DRAM integrated on one PCB.
Due to this it basically shares the DT with the SoPine baseboard, which we mimic in our DT by inclucing the boardboard .dts into the new file, just overwriting the model name.
Having a separate .dts for this seems useful, since we don't know yet if there are subtle differences between the two. Also the SoC on the LTS board is technically an "R18" instead of the original "A64", although as far as we know this is just a relabelled version of the original SoC.

---
 arch/arm64/boot/dts/allwinner/Makefile                  |  1 +
 arch/arm64/boot/dts/allwinner/sun50i-a64-pine64-lts.dts | 13 +++++++++++++
 2 files changed, 14 insertions(+)
 create mode 100644 arch/arm64/boot/dts/allwinner/sun50i-a64-pine64-lts.dts
arch/arm64/boot/dts/allwinner/Makefile +1 -0
index 9ffa7a038791..b7034327b28b 100644
@@ -4,6 +4,7 @@ dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-bananapi-m64.dtb
 dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-nanopi-a64.dtb
 dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-olinuxino.dtb
 dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-orangepi-win.dtb
+dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-pine64-lts.dtb
 dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-pine64-plus.dtb sun50i-a64-pine64.dtb
 dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-pinebook.dtb
 dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-sopine-baseboard.dtb
arch/arm64/boot/dts/allwinner/sun50i-a64-pine64-lts.dts new file +13 -0
new file mode 100644
index 000000000000..72d6961dc312
@@ -0,0 +1,13 @@
+/*
+ * SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+ *
+ * Copyright (c) 2018 ARM Ltd.
+ */
+
+#include "sun50i-a64-sopine-baseboard.dts"
+
+/ {
+	model = "Pine64 LTS";
+	compatible = "pine64,pine64-lts", "allwinner,sun50i-r18",
+		     "allwinner,sun50i-a64";
+};
Signature · 1 line
2.14.4
#3 lore raw

PATCH v2 3/18 arm64: dts: allwinner: a64: Orange Pi Win: Fix SD card node

In reply to Andre Przywara

From: Samuel Holland <[email protected]>

The Orange Pi Win has an microSD card slot, which is connected via all four SD data lines. Also microSD does not have a write protect switch, so disable this feature in the DT node.

---
 arch/arm64/boot/dts/allwinner/sun50i-a64-orangepi-win.dts | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
arch/arm64/boot/dts/allwinner/sun50i-a64-orangepi-win.dts +3 -1
index 1221764f5719..667016815cf3 100644
@@ -67,7 +67,9 @@
 	pinctrl-names = "default";
 	pinctrl-0 = <&mmc0_pins>;
 	vmmc-supply = <&reg_dcdc1>;
-	cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>;
+	cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */
+	disable-wp;
+	bus-width = <4>;
 	status = "okay";
 };
 
Signature · 1 line
2.14.4
#5 lore raw

PATCH v2 4/18 arm64: dts: allwinner: a64: Orange Pi Win: Fix USB

In reply to Andre Przywara

From: Samuel Holland <[email protected]>

The Orange Pi Win has 5 USB ports:
Four are standard A sockets, connected to an on-board HUB. The hub's and socket's power regulators are enabled by GPIO PD7.
Also it features a microB socket, connected to the SoC's USB-OTG port. It's power is supplied by the AXP PMIC, and the ID pin is connected to GPIO PH9. It can serve both as a host or a client port.

---
 .../boot/dts/allwinner/sun50i-a64-orangepi-win.dts    | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)
arch/arm64/boot/dts/allwinner/sun50i-a64-orangepi-win.dts +18 -1
index 667016815cf3..c9cabe987c19 100644
@@ -57,6 +57,17 @@
 	chosen {
 		stdout-path = "serial0:115200n8";
 	};
+
+	reg_usb1_vbus: usb1-vbus {
+		compatible = "regulator-fixed";
+		regulator-name = "usb1-vbus";
+		regulator-min-microvolt = <5000000>;
+		regulator-max-microvolt = <5000000>;
+		regulator-boot-on;
+		enable-active-high;
+		gpio = <&pio 3 7 GPIO_ACTIVE_HIGH>; /* PD7 */
+		status = "okay";
+	};
 };
 
 &ehci1 {
@@ -203,7 +214,13 @@
 	status = "okay";
 };
 
-&usbphy {
+&usb_otg {
+	dr_mode = "otg";
 	status = "okay";
 };
 
+&usbphy {
+	usb0_id_det-gpios = <&pio 7 9 GPIO_ACTIVE_HIGH>; /* PH9 */
+	usb1_vbus-supply = <&reg_usb1_vbus>;
+	status = "okay";
+};
Signature · 1 line
2.14.4
#7 lore raw

PATCH v2 5/18 arm64: dts: allwinner: a64: Orange Pi Win: Add Ethernet node

In reply to Andre Przywara

From: Samuel Holland <[email protected]>

The Orange Pi Win has the usual Gigabit PHY connected to the EMAC. Its power is controlled by GPIO PD14.

---
 .../boot/dts/allwinner/sun50i-a64-orangepi-win.dts | 29 ++++++++++++++++++++++
 1 file changed, 29 insertions(+)
arch/arm64/boot/dts/allwinner/sun50i-a64-orangepi-win.dts +29 -0
index c9cabe987c19..0cadcd59edd9 100644
@@ -1,5 +1,6 @@
 /*
  * Copyright (C) 2017 Jagan Teki <[email protected]>
+ * Copyright (C) 2017-2018 Samuel Holland <[email protected]>
  *
  * This file is dual-licensed: you can use it either under the terms
  * of the GPL or the X11 license, at your option. Note that this dual
@@ -51,6 +52,7 @@
 	compatible = "xunlong,orangepi-win", "allwinner,sun50i-a64";
 
 	aliases {
+		ethernet0 = &emac;
 		serial0 = &uart0;
 	};
 
@@ -58,6 +60,17 @@
 		stdout-path = "serial0:115200n8";
 	};
 
+	reg_gmac_3v3: gmac-3v3 {
+		compatible = "regulator-fixed";
+		regulator-name = "gmac-3v3";
+		regulator-min-microvolt = <3300000>;
+		regulator-max-microvolt = <3300000>;
+		regulator-boot-on;
+		enable-active-high;
+		gpio = <&pio 3 14 GPIO_ACTIVE_HIGH>; /* PD14 */
+		status = "okay";
+	};
+
 	reg_usb1_vbus: usb1-vbus {
 		compatible = "regulator-fixed";
 		regulator-name = "usb1-vbus";
@@ -74,6 +87,22 @@
 	status = "okay";
 };
 
+&emac {
+	pinctrl-names = "default";
+	pinctrl-0 = <&rgmii_pins>;
+	phy-mode = "rgmii";
+	phy-handle = <&ext_rgmii_phy>;
+	phy-supply = <&reg_gmac_3v3>;
+	status = "okay";
+};
+
+&mdio {
+	ext_rgmii_phy: ethernet-phy at 1 {
+		compatible = "ethernet-phy-ieee802.3-c22";
+		reg = <1>;
+	};
+};
+
 &mmc0 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&mmc0_pins>;
Signature · 1 line
2.14.4
#8 lore raw

PATCH v2 6/18 arm64: dts: allwinner: a64: Orange Pi Win: Add UARTs

In reply to Andre Przywara

From: Samuel Holland <[email protected]>

The Orange Pi Win exposes several UARTs on header pin, and connects one to the on-board WiFi/Bluetooth chip.
Add the pinmux definitions to the UART nodes, but keep them disabled.

---
 .../boot/dts/allwinner/sun50i-a64-orangepi-win.dts | 33 ++++++++++++++++++++++
 1 file changed, 33 insertions(+)
arch/arm64/boot/dts/allwinner/sun50i-a64-orangepi-win.dts +33 -0
index 0cadcd59edd9..10f63d0b99cb 100644
@@ -54,6 +54,10 @@
 	aliases {
 		ethernet0 = &emac;
 		serial0 = &uart0;
+		serial1 = &uart1;
+		serial2 = &uart2;
+		serial3 = &uart3;
+		serial4 = &uart4;
 	};
 
 	chosen {
@@ -237,12 +241,41 @@
 	vcc-hdmi-supply = <&reg_dldo1>;
 };
 
+/* On debug connector */
 &uart0 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&uart0_pins_a>;
 	status = "okay";
 };
 
+/* Wi-Fi/BT */
+&uart1 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&uart1_pins>, <&uart1_rts_cts_pins>;
+	status = "okay";
+};
+
+/* On Pi-2 connector, RTS/CTS optional */
+&uart2 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&uart2_pins>;
+	status = "disabled";
+};
+
+/* On Pi-2 connector, RTS/CTS optional */
+&uart3 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&uart3_pins>;
+	status = "disabled";
+};
+
+/* On Pi-2 connector (labeled for SPI1), RTS/CTS optional */
+&uart4 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&uart4_pins>;
+	status = "disabled";
+};
+
 &usb_otg {
 	dr_mode = "otg";
 	status = "okay";
Signature · 1 line
2.14.4
#16 lore raw

PATCH v2 7/18 arm64: dts: allwinner: a64: Orange Pi Win: Add LED node

In reply to Andre Przywara

From: Samuel Holland <[email protected]>

The Orange Pi Win has a green status LED, add the DT node for it.

---
 arch/arm64/boot/dts/allwinner/sun50i-a64-orangepi-win.dts | 9 +++++++++
 1 file changed, 9 insertions(+)
arch/arm64/boot/dts/allwinner/sun50i-a64-orangepi-win.dts +9 -0
index 10f63d0b99cb..55eea0b077d0 100644
@@ -64,6 +64,15 @@
 		stdout-path = "serial0:115200n8";
 	};
 
+	leds {
+		compatible = "gpio-leds";
+
+		status {
+			label = "orangepi:green:status";
+			gpios = <&pio 7 11 GPIO_ACTIVE_HIGH>; /* PH11 */
+		};
+	};
+
 	reg_gmac_3v3: gmac-3v3 {
 		compatible = "regulator-fixed";
 		regulator-name = "gmac-3v3";
Signature · 1 line
2.14.4
#17 lore raw

PATCH v2 8/18 arm64: dts: allwinner: a64: Orange Pi Win: Add SDIO node

In reply to Andre Przywara

From: Samuel Holland <[email protected]>

The Orange Pi Win features a soldered WiFi chip on the board, connected via the SDIO interface. Add the required DT nodes.

---
 .../arm64/boot/dts/allwinner/sun50i-a64-orangepi-win.dts | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
arch/arm64/boot/dts/allwinner/sun50i-a64-orangepi-win.dts +16 -0
index 55eea0b077d0..a368f51399e6 100644
@@ -94,6 +94,11 @@
 		gpio = <&pio 3 7 GPIO_ACTIVE_HIGH>; /* PD7 */
 		status = "okay";
 	};
+
+	wifi_pwrseq: wifi_pwrseq {
+		compatible = "mmc-pwrseq-simple";
+		reset-gpios = <&r_pio 0 8 GPIO_ACTIVE_LOW>; /* PL8 */
+	};
 };
 
 &ehci1 {
@@ -126,6 +131,17 @@
 	status = "okay";
 };
 
+&mmc1 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&mmc1_pins>;
+	vmmc-supply = <&reg_dldo2>;
+	vqmmc-supply = <&reg_dldo4>;
+	mmc-pwrseq = <&wifi_pwrseq>;
+	bus-width = <4>;
+	non-removable;
+	status = "okay";
+};
+
 &ohci1 {
 	status = "okay";
 };
Signature · 1 line
2.14.4
#18 lore raw

PATCH v2 9/18 arm64: dts: allwinner: a64: Orange Pi Win: Add SPI flash node

In reply to Andre Przywara

From: Samuel Holland <[email protected]>

The Orange Pi Win comes with 2 MB SPI flash, add the node.

---
 arch/arm64/boot/dts/allwinner/sun50i-a64-orangepi-win.dts | 12 ++++++++++++
 1 file changed, 12 insertions(+)
arch/arm64/boot/dts/allwinner/sun50i-a64-orangepi-win.dts +12 -0
index a368f51399e6..6f85a05d2f4b 100644
@@ -266,6 +266,18 @@
 	vcc-hdmi-supply = <&reg_dldo1>;
 };
 
+&spi0 {
+	status = "okay";
+
+	spi-flash at 0 {
+		compatible = "mxicy,mx25l1606e", "jedec,spi-nor";
+		reg = <0>;
+		spi-max-frequency = <80000000>;
+		m25p,fast-read;
+		status = "okay";
+	};
+};
+
 /* On debug connector */
 &uart0 {
 	pinctrl-names = "default";
Signature · 1 line
2.14.4
#19 lore raw

PATCH v2 10/18 arm64: dts: allwinner: a64: Orange Pi Win: Mark CPU supply regulator

In reply to Andre Przywara

From: Samuel Holland <[email protected]>

DCDC2 (polyphased with DCDC3) is supplying the power to the CPU. Add a property to the CPU node to mark this connection.

---
 arch/arm64/boot/dts/allwinner/sun50i-a64-orangepi-win.dts | 4 ++++
 1 file changed, 4 insertions(+)
arch/arm64/boot/dts/allwinner/sun50i-a64-orangepi-win.dts +4 -0
index 6f85a05d2f4b..ec24b7379d6d 100644
@@ -101,6 +101,10 @@
 	};
 };
 
+&cpu0 {
+	cpu-supply = <&reg_dcdc2>;
+};
+
 &ehci1 {
 	status = "okay";
 };
Signature · 1 line
2.14.4
#21 lore raw

PATCH v2 11/18 arm64: dts: allwinner: a64: Orange Pi Win: Add missing power rails

In reply to Andre Przywara

From: Samuel Holland <[email protected]>

The Orange Pi Win board has some of the AXP's power rails connected on the board. Name them and adjust the voltage ranges.

---
 arch/arm64/boot/dts/allwinner/sun50i-a64-orangepi-win.dts | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)
arch/arm64/boot/dts/allwinner/sun50i-a64-orangepi-win.dts +10 -5
index ec24b7379d6d..db4f6db9347b 100644
@@ -164,10 +164,9 @@
 #include "axp803.dtsi"
 
 &reg_aldo1 {
-	regulator-always-on;
-	regulator-min-microvolt = <1800000>;
-	regulator-max-microvolt = <3300000>;
-	regulator-name = "afvcc-csi";
+	regulator-min-microvolt = <2800000>;
+	regulator-max-microvolt = <2800000>;
+	regulator-name = "vcc-csi";
 };
 
 &reg_aldo2 {
@@ -241,7 +240,13 @@
 &reg_eldo1 {
 	regulator-min-microvolt = <1800000>;
 	regulator-max-microvolt = <1800000>;
-	regulator-name = "cpvdd";
+	regulator-name = "vcc-pc";
+};
+
+&reg_eldo3 {
+	regulator-min-microvolt = <1500000>;
+	regulator-max-microvolt = <1800000>;
+	regulator-name = "dvdd-csi";
 };
 
 &reg_fldo1 {
Signature · 1 line
2.14.4
#23 lore raw

PATCH v2 12/18 arm64: dts: allwinner: a64: Olinuxino: fix DRAM voltage

In reply to Andre Przywara

The Olinuxino board uses DDR3L chips which are supposed to be driven with 1.35V. The reset default of the AXP is properly set to 1.36V.

While technically the chips can also run at 1.5 volts, changing the voltage on the fly while booting Linux is asking for trouble. Also running at a lower voltage saves power.

So fix the DCDC5 value to match the actual board design.

---
 arch/arm64/boot/dts/allwinner/sun50i-a64-olinuxino.dts | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
arch/arm64/boot/dts/allwinner/sun50i-a64-olinuxino.dts +6 -2
index 3f531393eaee..b3f186434f36 100644
@@ -142,10 +142,14 @@
 
 /* DCDC3 is polyphased with DCDC2 */
 
+/*
+ * The board uses DDR3L DRAM chips. 1.36V is the closest to the nominal
+ * 1.35V that the PMIC can drive.
+ */
 &reg_dcdc5 {
 	regulator-always-on;
-	regulator-min-microvolt = <1500000>;
-	regulator-max-microvolt = <1500000>;
+	regulator-min-microvolt = <1360000>;
+	regulator-max-microvolt = <1360000>;
 	regulator-name = "vcc-ddr3";
 };
 
Signature · 1 line
2.14.4
#24 lore raw

PATCH v2 13/18 arm64: dts: allwinner: a64: Olinuxino: add Ethernet nodes

In reply to Andre Przywara

Add the DT nodes required to enable the Gigabit Ethernet on the board. The PHY is powered by the always-on power rail VDD_SYS_3.3V (DCDC1).

---
 arch/arm64/boot/dts/allwinner/sun50i-a64-olinuxino.dts | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
arch/arm64/boot/dts/allwinner/sun50i-a64-olinuxino.dts +17 -0
index b3f186434f36..26075b9a76e3 100644
@@ -51,6 +51,7 @@
 	compatible = "olimex,a64-olinuxino", "allwinner,sun50i-a64";
 
 	aliases {
+		ethernet0 = &emac;
 		serial0 = &uart0;
 	};
 
@@ -64,6 +65,22 @@
 	};
 };
 
+&emac {
+	pinctrl-names = "default";
+	pinctrl-0 = <&rgmii_pins>;
+	phy-mode = "rgmii";
+	phy-handle = <&ext_rgmii_phy>;
+	phy-supply = <&reg_dcdc1>;
+	status = "okay";
+};
+
+&mdio {
+	ext_rgmii_phy: ethernet-phy at 1 {
+		compatible = "ethernet-phy-ieee802.3-c22";
+		reg = <1>;
+	};
+};
+
 &mmc0 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&mmc0_pins>;
Signature · 1 line
2.14.4
#25 lore raw

PATCH v2 14/18 arm64: dts: allwinner: a64: Olinuxino: enable USB

In reply to Andre Przywara

The Olinuxino has two USB sockets:
USB0 is connected to a micro B socket. As it has the ID pin wired and the VBUS line connected to the PMIC, we describe it as a proper OTG socket, which switches between host and device automatically.
USB1 is connected to a normal USB A socket. PG9 enables the power line, so add the required regulator as well.

---
 .../boot/dts/allwinner/sun50i-a64-olinuxino.dts    | 45 ++++++++++++++++++++++
 1 file changed, 45 insertions(+)
arch/arm64/boot/dts/allwinner/sun50i-a64-olinuxino.dts +45 -0
index 26075b9a76e3..a1c2f06ed474 100644
@@ -59,12 +59,31 @@
 		stdout-path = "serial0:115200n8";
 	};
 
+	reg_usb1_vbus: usb1-vbus {
+		compatible = "regulator-fixed";
+		regulator-name = "usb1-vbus";
+		regulator-min-microvolt = <5000000>;
+		regulator-max-microvolt = <5000000>;
+		regulator-boot-on;
+		enable-active-high;
+		gpio = <&pio 6 9 GPIO_ACTIVE_HIGH>; /* PG9 */
+		status = "okay";
+	};
+
 	wifi_pwrseq: wifi_pwrseq {
 		compatible = "mmc-pwrseq-simple";
 		reset-gpios = <&r_pio 0 2 GPIO_ACTIVE_LOW>; /* PL2 */
 	};
 };
 
+&ehci0 {
+	status = "okay";
+};
+
+&ehci1 {
+	status = "okay";
+};
+
 &emac {
 	pinctrl-names = "default";
 	pinctrl-0 = <&rgmii_pins>;
@@ -109,6 +128,14 @@
 	};
 };
 
+&ohci0 {
+	status = "okay";
+};
+
+&ohci1 {
+	status = "okay";
+};
+
 &r_rsb {
 	status = "okay";
 
@@ -117,6 +144,7 @@
 		reg = <0x3a3>;
 		interrupt-parent = <&r_intc>;
 		interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
+		x-powers,drive-vbus-en;	/* set N_VBUSEN as output pin */
 	};
 };
 
@@ -201,6 +229,11 @@
 	regulator-name = "vcc-wifi-io";
 };
 
+&reg_drivevbus {
+	regulator-name = "usb0-vbus";
+	status = "okay";
+};
+
 &reg_eldo1 {
 	regulator-min-microvolt = <1800000>;
 	regulator-max-microvolt = <1800000>;
@@ -244,3 +277,15 @@
 	pinctrl-0 = <&uart0_pins_a>;
 	status = "okay";
 };
+
+&usb_otg {
+	dr_mode = "otg";
+	status = "okay";
+};
+
+&usbphy {
+	status = "okay";
+	usb0_id_det-gpios = <&pio 7 9 GPIO_ACTIVE_HIGH>; /* PH9 */
+	usb0_vbus-supply = <&reg_drivevbus>;
+	usb1_vbus-supply = <&reg_usb1_vbus>;
+};
Signature · 1 line
2.14.4
#26 lore raw

PATCH v2 15/18 arm64: dts: allwinner: a64: NanoPi-A64: Fix DCDC1 voltage

In reply to Andre Przywara

According to the NanoPi-A64 schematics, DCDC1 is connected to a voltage rail named "VDD_SYS_3.3V". All users seem to expect 3.3V here: the Ethernet PHY, the uSD card slot, the camera interface and the GPIO pins on the headers.
Fix up the voltage on the regulator to lift it up to 3.3V.

---
 arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dts | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dts +3 -3
index 98dbff19f5cc..5caba225b4f7 100644
@@ -125,9 +125,9 @@
 
 &reg_dcdc1 {
 	regulator-always-on;
-	regulator-min-microvolt = <3000000>;
-	regulator-max-microvolt = <3000000>;
-	regulator-name = "vcc-3v";
+	regulator-min-microvolt = <3300000>;
+	regulator-max-microvolt = <3300000>;
+	regulator-name = "vcc-3v3";
 };
 
 &reg_dcdc2 {
Signature · 1 line
2.14.4
#27 lore raw

PATCH v2 16/18 arm64: dts: allwinner: a64: NanoPi-A64: Add Ethernet

In reply to Andre Przywara

The NanoPi-A64 has the usual Realtek Gbit PHY connected to the EMAC, so add the respective nodes to the DT. The PHY is powered by the VDD_SYS_3.3V line, which is always on.

---
 arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dts | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dts +17 -0
index 5caba225b4f7..bd35a093e6cd 100644
@@ -51,6 +51,7 @@
 	compatible = "friendlyarm,nanopi-a64", "allwinner,sun50i-a64";
 
 	aliases {
+		ethernet0 = &emac;
 		serial0 = &uart0;
 	};
 
@@ -67,6 +68,15 @@
 	status = "okay";
 };
 
+&emac {
+	pinctrl-names = "default";
+	pinctrl-0 = <&rgmii_pins>;
+	phy-mode = "rgmii";
+	phy-handle = <&ext_rgmii_phy>;
+	phy-supply = <&reg_dcdc1>;
+	status = "okay";
+};
+
 /* i2c1 connected with gpio headers like pine64, bananapi */
 &i2c1 {
 	pinctrl-names = "default";
@@ -78,6 +88,13 @@
 	bias-pull-up;
 };
 
+&mdio {
+	ext_rgmii_phy: ethernet-phy at 1 {
+		compatible = "ethernet-phy-ieee802.3-c22";
+		reg = <1>;
+	};
+};
+
 &mmc0 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&mmc0_pins>;
Signature · 1 line
2.14.4
#37 lore raw

PATCH v2 17/18 arm64: dts: allwinner: a64: NanoPi-A64: Add Wifi/Bluetooth chip

In reply to Andre Przywara

The NanoPi-A64 has an on-board WiFi/Bluetooth combo chip, connected to the usual MMC1 and UART1. The AXP power line is the always-on VDD_SYS_3.3V, but it uses pin L2 to enable the regulator. As the actual WiFi driver is not in mainline Linux, it doesn't have a compatible string, so we omit this from the node.

Add the respective nodes to the DT to make it usable.

---
 .../boot/dts/allwinner/sun50i-a64-nanopi-a64.dts   | 31 ++++++++++++++++++++++
 1 file changed, 31 insertions(+)
arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dts +31 -0
index bd35a093e6cd..705e0b23589e 100644
@@ -53,11 +53,17 @@
 	aliases {
 		ethernet0 = &emac;
 		serial0 = &uart0;
+		serial1 = &uart1;
 	};
 
 	chosen {
 		stdout-path = "serial0:115200n8";
 	};
+
+	wifi_pwrseq: wifi_pwrseq {
+		compatible = "mmc-pwrseq-simple";
+		reset-gpios = <&r_pio 0 2 GPIO_ACTIVE_LOW>; /* PL2 */
+	};
 };
 
 &ehci0 {
@@ -105,6 +111,24 @@
 	status = "okay";
 };
 
+&mmc1 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&mmc1_pins>;
+	vmmc-supply = <&reg_dcdc1>;
+	vqmmc-supply = <&reg_dldo4>;
+	mmc-pwrseq = <&wifi_pwrseq>;
+	bus-width = <4>;
+	non-removable;
+	status = "okay";
+
+	rtl8189etv: wifi at 1 {
+		reg = <1>;
+		interrupt-parent = <&r_pio>;
+		interrupts = <0 3 IRQ_TYPE_LEVEL_LOW>; /* PL3 */
+		interrupt-names = "host-wake";
+	};
+};
+
 &ohci0 {
 	status = "okay";
 };
@@ -222,6 +246,13 @@
 	status = "okay";
 };
 
+/* Connected to the Bluetooth UART, with hardware handshake pins */
+&uart1 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&uart1_pins>, <&uart1_rts_cts_pins>;
+	status = "okay";
+};
+
 &usbphy {
 	status = "okay";
 };
Signature · 1 line
2.14.4
#41 lore raw

PATCH v2 18/18 arm64: dts: allwinner: a64: NanoPi-A64: Add blue status LED

In reply to Andre Przywara

Beside the non-controllable green power LED, the NanoPi-A64 features a blue "status" LED, connected to PD24.

Add the device tree node to make it usable.

---
 arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dts | 9 +++++++++
 1 file changed, 9 insertions(+)
arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dts +9 -0
index 705e0b23589e..d75d4d5cbf73 100644
@@ -60,6 +60,15 @@
 		stdout-path = "serial0:115200n8";
 	};
 
+	leds {
+		compatible = "gpio-leds";
+
+		blue {
+			label = "nanopi-a64:blue:status";
+			gpios = <&pio 3 24 GPIO_ACTIVE_LOW>; /* PD24 */
+		};
+	};
+
 	wifi_pwrseq: wifi_pwrseq {
 		compatible = "mmc-pwrseq-simple";
 		reset-gpios = <&r_pio 0 2 GPIO_ACTIVE_LOW>; /* PL2 */
Signature · 1 line
2.14.4
#4 lore raw

PATCH v2 3/18 arm64: dts: allwinner: a64: Orange Pi Win: Fix SD card node

In reply to Andre Przywara
Quoted 17 lines · Andre Przywara

From: Samuel Holland <[email protected]>

The Orange Pi Win has an microSD card slot, which is connected via all four SD data lines. Also microSD does not have a write protect switch, so disable this feature in the DT node.

---
 arch/arm64/boot/dts/allwinner/sun50i-a64-orangepi-win.dts | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
arch/arm64/boot/dts/allwinner/sun50i-a64-orangepi-win.dts +0 -0
index 1221764f5719..667016815cf3 100644

arch/arm64/boot/dts/allwinner/sun50i-a64-orangepi-win.dts line 72

Quoted 7 lines
arch/arm64/boot/dts/allwinner/sun50i-a64-orangepi-win.dts +3 -1
@@ -67,7 +67,9 @@
 	pinctrl-names = "default";
 	pinctrl-0 = <&mmc0_pins>;
 	vmmc-supply = <&reg_dcdc1>;
-	cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>;
+	cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */
+	disable-wp;
+	bus-width = <4>;

This patch claims that it's fixing things, but it's not said anywhere what it is fixing exactly.

Maxime

Signature · 10 lines
Maxime Ripard, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20180726/d823303d/attachment-0001.sig>
#6 lore raw

PATCH v2 4/18 arm64: dts: allwinner: a64: Orange Pi Win: Fix USB

In reply to Andre Przywara
Quoted 8 lines · Andre Przywara

From: Samuel Holland <[email protected]>

The Orange Pi Win has 5 USB ports:
Four are standard A sockets, connected to an on-board HUB. The hub's and socket's power regulators are enabled by GPIO PD7.
Also it features a microB socket, connected to the SoC's USB-OTG port. It's power is supplied by the AXP PMIC, and the ID pin is connected to GPIO PH9. It can serve both as a host or a client port.

Again, "Fix USB" is way too dramatic for something that enables the on-board hub and the USB OTG controller.

Also, two separate patches for this please.

Maxime

Signature · 10 lines
Maxime Ripard, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20180726/6f810f70/attachment.sig>
#9 lore raw

PATCH v2 6/18 arm64: dts: allwinner: a64: Orange Pi Win: Add UARTs

In reply to Andre Przywara
Quoted 34 lines · Andre Przywara

From: Samuel Holland <[email protected]>

The Orange Pi Win exposes several UARTs on header pin, and connects one to the on-board WiFi/Bluetooth chip.
Add the pinmux definitions to the UART nodes, but keep them disabled.

---
 .../boot/dts/allwinner/sun50i-a64-orangepi-win.dts | 33 ++++++++++++++++++++++
 1 file changed, 33 insertions(+)
arch/arm64/boot/dts/allwinner/sun50i-a64-orangepi-win.dts +5 -0
index 0cadcd59edd9..10f63d0b99cb 100644
@@ -54,6 +54,10 @@
 	aliases {
 		ethernet0 = &emac;
 		serial0 = &uart0;
+		serial1 = &uart1;
+		serial2 = &uart2;
+		serial3 = &uart3;
+		serial4 = &uart4;
 	};
 
 	chosen {
@@ -237,12 +241,41 @@
 	vcc-hdmi-supply = <&reg_dldo1>;
 };
 
+/* On debug connector */
 &uart0 {
 	pinctrl-names = "default";

arch/arm64/boot/dts/allwinner/sun50i-a64-orangepi-win.dts line 256

Quoted 10 lines
arch/arm64/boot/dts/allwinner/sun50i-a64-orangepi-win.dts +6 -0
 	pinctrl-0 = <&uart0_pins_a>;
 	status = "okay";
 };
 
+/* Wi-Fi/BT */
+&uart1 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&uart1_pins>, <&uart1_rts_cts_pins>;
+	status = "okay";
+};

What BT chip is there? Does it have serdev support? If so, that should be enabled here.

Maxime

Signature · 10 lines
Maxime Ripard, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20180726/8bf0de18/attachment.sig>
#20 lore raw

PATCH v2 10/18 arm64: dts: allwinner: a64: Orange Pi Win: Mark CPU supply regulator

In reply to Andre Przywara
Quoted 16 lines · Andre Przywara

From: Samuel Holland <[email protected]>

DCDC2 (polyphased with DCDC3) is supplying the power to the CPU. Add a property to the CPU node to mark this connection.

---
 arch/arm64/boot/dts/allwinner/sun50i-a64-orangepi-win.dts | 4 ++++
 1 file changed, 4 insertions(+)
arch/arm64/boot/dts/allwinner/sun50i-a64-orangepi-win.dts +0 -0
index 6f85a05d2f4b..ec24b7379d6d 100644

arch/arm64/boot/dts/allwinner/sun50i-a64-orangepi-win.dts line 107

Quoted 7 lines
arch/arm64/boot/dts/allwinner/sun50i-a64-orangepi-win.dts +4 -0
@@ -101,6 +101,10 @@
 	};
 };
 
+&cpu0 {
+	cpu-supply = <&reg_dcdc2>;
+};
+

I'd rather not do that. As soon as we'll have OPPs in the DTSI, that means that cpufreq will be enabled on that board, while no one ever tested it.

Maxime

Signature · 10 lines
Maxime Ripard, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20180726/f3a4d26f/attachment-0001.sig>
#10 lore raw

[linux-sunxi] Re: [PATCH v2 06/18] arm64: dts: allwinner: a64: Orange Pi Win: Add UARTs

In reply to Maxime Ripard

? 2018?7?26? GMT+08:00 ??3:39:11, Maxime Ripard <[email protected]> ??:

Quoted 43 lines · Andre Przywara
Quoted 3 lines

From: Samuel Holland <[email protected]>

The Orange Pi Win exposes several UARTs on header pin, and connects

one

Quoted 7 lines

to the on-board WiFi/Bluetooth chip.
Add the pinmux definitions to the UART nodes, but keep them disabled.

---
 .../boot/dts/allwinner/sun50i-a64-orangepi-win.dts | 33

++++++++++++++++++++++

Quoted 3 lines
 1 file changed, 33 insertions(+)

diff --git

a/arch/arm64/boot/dts/allwinner/sun50i-a64-orangepi-win.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-orangepi-win.dts

Quoted 25 lines

index 0cadcd59edd9..10f63d0b99cb 100644

arch/arm64/boot/dts/allwinner/sun50i-a64-orangepi-win.dts +5 -0
@@ -54,6 +54,10 @@
 	aliases {
 		ethernet0 = &emac;
 		serial0 = &uart0;
+		serial1 = &uart1;
+		serial2 = &uart2;
+		serial3 = &uart3;
+		serial4 = &uart4;
 	};
 
 	chosen {
@@ -237,12 +241,41 @@
 	vcc-hdmi-supply = <&reg_dldo1>;
 };
 
+/* On debug connector */
 &uart0 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&uart0_pins_a>;
 	status = "okay";
 };
 
Quoted 9 lines

arch/arm64/boot/dts/allwinner/sun50i-a64-orangepi-win.dts line 256

Quoted 6 lines
arch/arm64/boot/dts/allwinner/sun50i-a64-orangepi-win.dts +6 -0
+/* Wi-Fi/BT */
+&uart1 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&uart1_pins>, <&uart1_rts_cts_pins>;
+	status = "okay";
+};

What BT chip is there? Does it have serdev support? If so, that should be enabled here.

RTL8723BS, no serdev.

Quoted 2 lines

Maxime

#22 lore raw

PATCH v2 11/18 arm64: dts: allwinner: a64: Orange Pi Win: Add missing power rails

In reply to Andre Przywara
Quoted 4 lines · Andre Przywara

From: Samuel Holland <[email protected]>

The Orange Pi Win board has some of the AXP's power rails connected on the board. Name them and adjust the voltage ranges.

They are already named, so you'd need to explain why that name needs to be changed.

Same thing for the voltage range, a citation would be useful.

Maxime

Signature · 10 lines
Maxime Ripard, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20180726/3f66814b/attachment.sig>
#38 lore raw

PATCH v2 17/18 arm64: dts: allwinner: a64: NanoPi-A64: Add Wifi/Bluetooth chip

In reply to Andre Przywara
Quoted 61 lines · Andre Przywara

The NanoPi-A64 has an on-board WiFi/Bluetooth combo chip, connected to the usual MMC1 and UART1. The AXP power line is the always-on VDD_SYS_3.3V, but it uses pin L2 to enable the regulator. As the actual WiFi driver is not in mainline Linux, it doesn't have a compatible string, so we omit this from the node.

Add the respective nodes to the DT to make it usable.

---
 .../boot/dts/allwinner/sun50i-a64-nanopi-a64.dts   | 31 ++++++++++++++++++++++
 1 file changed, 31 insertions(+)
arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dts +24 -0
index bd35a093e6cd..705e0b23589e 100644
@@ -53,11 +53,17 @@
 	aliases {
 		ethernet0 = &emac;
 		serial0 = &uart0;
+		serial1 = &uart1;
 	};
 
 	chosen {
 		stdout-path = "serial0:115200n8";
 	};
+
+	wifi_pwrseq: wifi_pwrseq {
+		compatible = "mmc-pwrseq-simple";
+		reset-gpios = <&r_pio 0 2 GPIO_ACTIVE_LOW>; /* PL2 */
+	};
 };
 
 &ehci0 {
@@ -105,6 +111,24 @@
 	status = "okay";
 };
 
+&mmc1 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&mmc1_pins>;
+	vmmc-supply = <&reg_dcdc1>;
+	vqmmc-supply = <&reg_dldo4>;
+	mmc-pwrseq = <&wifi_pwrseq>;
+	bus-width = <4>;
+	non-removable;
+	status = "okay";
+
+	rtl8189etv: wifi at 1 {
+		reg = <1>;
+		interrupt-parent = <&r_pio>;
+		interrupts = <0 3 IRQ_TYPE_LEVEL_LOW>; /* PL3 */
+		interrupt-names = "host-wake";
+	};
+};
+
 &ohci0 {
 	status = "okay";
 };

arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dts line 254

Quoted 9 lines
arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dts +6 -0
@@ -222,6 +246,13 @@
 	status = "okay";
 };
 
+/* Connected to the Bluetooth UART, with hardware handshake pins */
+&uart1 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&uart1_pins>, <&uart1_rts_cts_pins>;
+	status = "okay";
+};

Same thing here, if it has serdev support, then it should have a real node here.

Maxime

Signature · 10 lines
Maxime Ripard, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20180726/78506723/attachment.sig>
#39 lore raw

PATCH v2 17/18 arm64: dts: allwinner: a64: NanoPi-A64: Add Wifi/Bluetooth chip

In reply to Andre Przywara
Quoted 1 line · Andre Przywara

The NanoPi-A64 has an on-board WiFi/Bluetooth combo chip, connected

The NanoPi A64 uses the RTL8189, which does _not_ have Bluetooth. Something is seriously wrong here.

Quoted 76 lines

to the usual MMC1 and UART1. The AXP power line is the always-on VDD_SYS_3.3V, but it uses pin L2 to enable the regulator. As the actual WiFi driver is not in mainline Linux, it doesn't have a compatible string, so we omit this from the node.

Add the respective nodes to the DT to make it usable.

---
 .../boot/dts/allwinner/sun50i-a64-nanopi-a64.dts   | 31 ++++++++++++++++++++++
 1 file changed, 31 insertions(+)
arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dts +31 -1
index bd35a093e6cd..705e0b23589e 100644
@@ -53,11 +53,17 @@
        aliases {
                ethernet0 = &emac;
                serial0 = &uart0;
+               serial1 = &uart1;
        };
 
        chosen {
                stdout-path = "serial0:115200n8";
        };
+
+       wifi_pwrseq: wifi_pwrseq {
+               compatible = "mmc-pwrseq-simple";
+               reset-gpios = <&r_pio 0 2 GPIO_ACTIVE_LOW>; /* PL2 */
+       };
 };
 
 &ehci0 {
@@ -105,6 +111,24 @@
        status = "okay";
 };
 
+&mmc1 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&mmc1_pins>;
+       vmmc-supply = <&reg_dcdc1>;
+       vqmmc-supply = <&reg_dldo4>;
+       mmc-pwrseq = <&wifi_pwrseq>;
+       bus-width = <4>;
+       non-removable;
+       status = "okay";
+
+       rtl8189etv: wifi at 1 {
+               reg = <1>;
+               interrupt-parent = <&r_pio>;
+               interrupts = <0 3 IRQ_TYPE_LEVEL_LOW>; /* PL3 */
+               interrupt-names = "host-wake";
+       };
+};
+
 &ohci0 {
        status = "okay";
 };
@@ -222,6 +246,13 @@
        status = "okay";
 };
 
+/* Connected to the Bluetooth UART, with hardware handshake pins */
+&uart1 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&uart1_pins>, <&uart1_rts_cts_pins>;
+       status = "okay";
+};
+
 &usbphy {
        status = "okay";
 };
--

2.14.4

#11 lore raw

[linux-sunxi] Re: [PATCH v2 06/18] arm64: dts: allwinner: a64: Orange Pi Win: Add UARTs

In reply to Icenowy Zheng

Hi,

Quoted 56 lines · Icenowy Zheng

? 2018?7?26? GMT+08:00 ??3:39:11, Maxime Ripard <[email protected]> ??:

Quoted 43 lines · Andre Przywara
Quoted 3 lines

From: Samuel Holland <[email protected]>

The Orange Pi Win exposes several UARTs on header pin, and connects

one

Quoted 7 lines

to the on-board WiFi/Bluetooth chip.
Add the pinmux definitions to the UART nodes, but keep them disabled.

---
 .../boot/dts/allwinner/sun50i-a64-orangepi-win.dts | 33

++++++++++++++++++++++

Quoted 3 lines
 1 file changed, 33 insertions(+)

diff --git

a/arch/arm64/boot/dts/allwinner/sun50i-a64-orangepi-win.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-orangepi-win.dts

Quoted 25 lines

index 0cadcd59edd9..10f63d0b99cb 100644

arch/arm64/boot/dts/allwinner/sun50i-a64-orangepi-win.dts +5 -0
@@ -54,6 +54,10 @@
 	aliases {
 		ethernet0 = &emac;
 		serial0 = &uart0;
+		serial1 = &uart1;
+		serial2 = &uart2;
+		serial3 = &uart3;
+		serial4 = &uart4;
 	};
 
 	chosen {
@@ -237,12 +241,41 @@
 	vcc-hdmi-supply = <&reg_dldo1>;
 };
 
+/* On debug connector */
 &uart0 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&uart0_pins_a>;
 	status = "okay";
 };
 
Quoted 9 lines

arch/arm64/boot/dts/allwinner/sun50i-a64-orangepi-win.dts line 256

Quoted 6 lines
arch/arm64/boot/dts/allwinner/sun50i-a64-orangepi-win.dts +6 -0
+/* Wi-Fi/BT */
+&uart1 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&uart1_pins>, <&uart1_rts_cts_pins>;
+	status = "okay";
+};

What BT chip is there? Does it have serdev support? If so, that should be enabled here.

Quoted 1 line

RTL8723BS, no serdev.

Yes. A while ago I managed to enable Bluetooth (on the Pine64 with the same chip), but that involved a lot of hacking with a special userland tool (not hciattach and no serdev).

What this node means to say is: The UART1 is hardwired to some on-board device and those pins are not available for GPIO, for instance.

At least that was my understanding when it comes to enabling devices in the DT. Is that correct?

Cheers,
Andre.

#40 lore raw

PATCH v2 17/18 arm64: dts: allwinner: a64: NanoPi-A64: Add Wifi/Bluetooth chip

In reply to Chen-Yu Tsai

Hi,

Quoted 5 lines · Chen-Yu Tsai
Quoted 1 line · Andre Przywara

The NanoPi-A64 has an on-board WiFi/Bluetooth combo chip, connected

The NanoPi A64 uses the RTL8189, which does _not_ have Bluetooth. Something is seriously wrong here.

Ah, interesting. You are right that the RTL8189 does not have Bluetooth. I was just looking at the schematic, which, although naming the RTL8189ETV there, shows UART1 and PCM connections. The pin numbers are definitely wrong, it smells like someone copied a RTL8723BS pinout here ;-)

So thanks for the heads up, I will drop the BT/UART part.

Cheers,
Andre.

Quoted 76 lines
Quoted 76 lines

to the usual MMC1 and UART1. The AXP power line is the always-on VDD_SYS_3.3V, but it uses pin L2 to enable the regulator. As the actual WiFi driver is not in mainline Linux, it doesn't have a compatible string, so we omit this from the node.

Add the respective nodes to the DT to make it usable.

---
 .../boot/dts/allwinner/sun50i-a64-nanopi-a64.dts   | 31 ++++++++++++++++++++++
 1 file changed, 31 insertions(+)
arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dts +31 -1
index bd35a093e6cd..705e0b23589e 100644
@@ -53,11 +53,17 @@
        aliases {
                ethernet0 = &emac;
                serial0 = &uart0;
+               serial1 = &uart1;
        };
 
        chosen {
                stdout-path = "serial0:115200n8";
        };
+
+       wifi_pwrseq: wifi_pwrseq {
+               compatible = "mmc-pwrseq-simple";
+               reset-gpios = <&r_pio 0 2 GPIO_ACTIVE_LOW>; /* PL2 */
+       };
 };
 
 &ehci0 {
@@ -105,6 +111,24 @@
        status = "okay";
 };
 
+&mmc1 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&mmc1_pins>;
+       vmmc-supply = <&reg_dcdc1>;
+       vqmmc-supply = <&reg_dldo4>;
+       mmc-pwrseq = <&wifi_pwrseq>;
+       bus-width = <4>;
+       non-removable;
+       status = "okay";
+
+       rtl8189etv: wifi at 1 {
+               reg = <1>;
+               interrupt-parent = <&r_pio>;
+               interrupts = <0 3 IRQ_TYPE_LEVEL_LOW>; /* PL3 */
+               interrupt-names = "host-wake";
+       };
+};
+
 &ohci0 {
        status = "okay";
 };
@@ -222,6 +246,13 @@
        status = "okay";
 };
 
+/* Connected to the Bluetooth UART, with hardware handshake pins */
+&uart1 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&uart1_pins>, <&uart1_rts_cts_pins>;
+       status = "okay";
+};
+
 &usbphy {
        status = "okay";
 };
--

2.14.4

#12 lore raw

[linux-sunxi] Re: [PATCH v2 06/18] arm64: dts: allwinner: a64: Orange Pi Win: Add UARTs

In reply to Andre Przywara
Quoted 60 lines · Andre Przywara

Hi,

Quoted 57 lines · Icenowy Zheng

? 2018?7?26? GMT+08:00 ??3:39:11, Maxime Ripard <[email protected]> ??:

Quoted 43 lines · Andre Przywara
Quoted 3 lines

From: Samuel Holland <[email protected]>

The Orange Pi Win exposes several UARTs on header pin, and connects

one

Quoted 7 lines

to the on-board WiFi/Bluetooth chip.
Add the pinmux definitions to the UART nodes, but keep them disabled.

---
 .../boot/dts/allwinner/sun50i-a64-orangepi-win.dts | 33

++++++++++++++++++++++

Quoted 3 lines
 1 file changed, 33 insertions(+)

diff --git

a/arch/arm64/boot/dts/allwinner/sun50i-a64-orangepi-win.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-orangepi-win.dts

Quoted 25 lines

index 0cadcd59edd9..10f63d0b99cb 100644

arch/arm64/boot/dts/allwinner/sun50i-a64-orangepi-win.dts +5 -0
@@ -54,6 +54,10 @@
 	aliases {
 		ethernet0 = &emac;
 		serial0 = &uart0;
+		serial1 = &uart1;
+		serial2 = &uart2;
+		serial3 = &uart3;
+		serial4 = &uart4;
 	};
 
 	chosen {
@@ -237,12 +241,41 @@
 	vcc-hdmi-supply = <&reg_dldo1>;
 };
 
+/* On debug connector */
 &uart0 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&uart0_pins_a>;
 	status = "okay";
 };
 
Quoted 9 lines

arch/arm64/boot/dts/allwinner/sun50i-a64-orangepi-win.dts line 256

Quoted 6 lines
arch/arm64/boot/dts/allwinner/sun50i-a64-orangepi-win.dts +6 -0
+/* Wi-Fi/BT */
+&uart1 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&uart1_pins>, <&uart1_rts_cts_pins>;
+	status = "okay";
+};

What BT chip is there? Does it have serdev support? If so, that should be enabled here.

RTL8723BS, no serdev.

https://www.spinics.net/lists/linux-bluetooth/msg76376.html

Not very far off though.

Quoted 9 lines

Yes. A while ago I managed to enable Bluetooth (on the Pine64 with the same chip), but that involved a lot of hacking with a special userland tool (not hciattach and no serdev).

What this node means to say is: The UART1 is hardwired to some on-board device and those pins are not available for GPIO, for instance.

At least that was my understanding when it comes to enabling devices in the DT. Is that correct?

Well, yes and no. Arguably, any device connected to the other side of the serial bus should have been there from the beginning. However, there wasn't any way to do that in Linux before serdev was introduced, so we weren't doing that. That resulted in hacky userspace tools to work around that, and other work arounds in the DT to for example tying BT resources (clock, regulators, resets) to the WiFi chip hoping that someone would use both all the time.

Now that it's just around the corner, we don't have any excuse to do these kind of hacks anymore.

Maxime

Signature · 10 lines
Maxime Ripard, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20180726/1af98e30/attachment.sig>
#13 lore raw

[linux-sunxi] Re: [PATCH v2 06/18] arm64: dts: allwinner: a64: Orange Pi Win: Add UARTs

Hi,

Quoted 84 lines · Maxime Ripard
Quoted 60 lines · Andre Przywara

Hi,

Quoted 57 lines · Icenowy Zheng

? 2018?7?26? GMT+08:00 ??3:39:11, Maxime Ripard <[email protected]> ??:

Quoted 43 lines · Andre Przywara
Quoted 3 lines

From: Samuel Holland <[email protected]>

The Orange Pi Win exposes several UARTs on header pin, and connects

one

Quoted 7 lines

to the on-board WiFi/Bluetooth chip.
Add the pinmux definitions to the UART nodes, but keep them disabled.

---
 .../boot/dts/allwinner/sun50i-a64-orangepi-win.dts | 33

++++++++++++++++++++++

Quoted 3 lines
 1 file changed, 33 insertions(+)

diff --git

a/arch/arm64/boot/dts/allwinner/sun50i-a64-orangepi-win.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-orangepi-win.dts

Quoted 25 lines

index 0cadcd59edd9..10f63d0b99cb 100644

arch/arm64/boot/dts/allwinner/sun50i-a64-orangepi-win.dts +5 -0
@@ -54,6 +54,10 @@
 	aliases {
 		ethernet0 = &emac;
 		serial0 = &uart0;
+		serial1 = &uart1;
+		serial2 = &uart2;
+		serial3 = &uart3;
+		serial4 = &uart4;
 	};
 
 	chosen {
@@ -237,12 +241,41 @@
 	vcc-hdmi-supply = <&reg_dldo1>;
 };
 
+/* On debug connector */
 &uart0 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&uart0_pins_a>;
 	status = "okay";
 };
 
Quoted 9 lines

arch/arm64/boot/dts/allwinner/sun50i-a64-orangepi-win.dts line 256

Quoted 6 lines
arch/arm64/boot/dts/allwinner/sun50i-a64-orangepi-win.dts +6 -0
+/* Wi-Fi/BT */
+&uart1 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&uart1_pins>, <&uart1_rts_cts_pins>;
+	status = "okay";
+};

What BT chip is there? Does it have serdev support? If so, that should be enabled here.

RTL8723BS, no serdev.

https://www.spinics.net/lists/linux-bluetooth/msg76376.html

Not very far off though.

Quoted 9 lines

Yes. A while ago I managed to enable Bluetooth (on the Pine64 with the same chip), but that involved a lot of hacking with a special userland tool (not hciattach and no serdev).

What this node means to say is: The UART1 is hardwired to some on-board device and those pins are not available for GPIO, for instance.

At least that was my understanding when it comes to enabling devices in the DT. Is that correct?

Well, yes and no. Arguably, any device connected to the other side of the serial bus should have been there from the beginning. However, there wasn't any way to do that in Linux before serdev was introduced, so we weren't doing that. That resulted in hacky userspace tools to work around that, and other work arounds in the DT to for example tying BT resources (clock, regulators, resets) to the WiFi chip hoping that someone would use both all the time.

Quoted 2 lines

Now that it's just around the corner, we don't have any excuse to do these kind of hacks anymore.

That's true. Also I see that the serdev binding itself is not serdev specific, it just puts the Bluetooth node as a child of an UART node. But we would still need a compatible string for that child, wouldn't we? I guess we can't autodetect this? From what I can see from Hans' series there is no DT compatible string defined?

So do we just put a node there, specifying the resources it needs? Like the wake-up interrupt or regulators, if any? And leave out the compatible string, at least for now?

Cheers,
Andre.

#28 lore raw

PATCH v2 16/18 arm64: dts: allwinner: a64: NanoPi-A64: Add Ethernet

In reply to Andre Przywara

Hi,

Quoted 41 lines · Andre Przywara

The NanoPi-A64 has the usual Realtek Gbit PHY connected to the EMAC, so add the respective nodes to the DT. The PHY is powered by the VDD_SYS_3.3V line, which is always on.

---
  arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dts | 17 +++++++++++++++++
  1 file changed, 17 insertions(+)
arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dts +10 -0
index 5caba225b4f7..bd35a093e6cd 100644
@@ -51,6 +51,7 @@
  	compatible = "friendlyarm,nanopi-a64", "allwinner,sun50i-a64";
 
  	aliases {
+		ethernet0 = &emac;
  		serial0 = &uart0;
  	};
 
@@ -67,6 +68,15 @@
  	status = "okay";
  };
 
+&emac {
+	pinctrl-names = "default";
+	pinctrl-0 = <&rgmii_pins>;
+	phy-mode = "rgmii";
+	phy-handle = <&ext_rgmii_phy>;
+	phy-supply = <&reg_dcdc1>;
+	status = "okay";
+};
+
  /* i2c1 connected with gpio headers like pine64, bananapi */
  &i2c1 {
  	pinctrl-names = "default";
@@ -78,6 +88,13 @@
  	bias-pull-up;
  };
 

arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dts line 100

Quoted 10 lines
arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dts +7 -0
+&mdio {
+	ext_rgmii_phy: ethernet-phy at 1 {
+		compatible = "ethernet-phy-ieee802.3-c22";
+		reg = <1>;
+	};
+};
+
  &mmc0 {
  	pinctrl-names = "default";
  	pinctrl-0 = <&mmc0_pins>;

did you test? "reg = <1>" on a real hardware ?

I have? "reg = <0>" in my dts? and? it has been working on my board for ages.

Thanks

#29 lore raw

PATCH v2 16/18 arm64: dts: allwinner: a64: NanoPi-A64: Add Ethernet

? 2018?7?26? GMT+08:00 ??9:39:56, Sergey Suloev <[email protected]> ??:

Quoted 59 lines

Hi,

Quoted 7 lines · Andre Przywara

The NanoPi-A64 has the usual Realtek Gbit PHY connected to the EMAC, so add the respective nodes to the DT. The PHY is powered by the VDD_SYS_3.3V line, which is always on.

---
  arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dts | 17

+++++++++++++++++

Review

Quoted 3 lines
  1 file changed, 17 insertions(+)
(quoted diff) +0 -0

b/arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dts

Quoted 31 lines

index 5caba225b4f7..bd35a093e6cd 100644

arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dts +10 -0
@@ -51,6 +51,7 @@
  	compatible = "friendlyarm,nanopi-a64", "allwinner,sun50i-a64";
 
  	aliases {
+		ethernet0 = &emac;
  		serial0 = &uart0;
  	};
 
@@ -67,6 +68,15 @@
  	status = "okay";
  };
 
+&emac {
+	pinctrl-names = "default";
+	pinctrl-0 = <&rgmii_pins>;
+	phy-mode = "rgmii";
+	phy-handle = <&ext_rgmii_phy>;
+	phy-supply = <&reg_dcdc1>;
+	status = "okay";
+};
+
  /* i2c1 connected with gpio headers like pine64, bananapi */
  &i2c1 {
  	pinctrl-names = "default";
@@ -78,6 +88,13 @@
  	bias-pull-up;
  };
 

arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dts line 100

Quoted 10 lines
arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dts +7 -0
+&mdio {
+	ext_rgmii_phy: ethernet-phy at 1 {
+		compatible = "ethernet-phy-ieee802.3-c22";
+		reg = <1>;
+	};
+};
+
  &mmc0 {
  	pinctrl-names = "default";
  	pinctrl-0 = <&mmc0_pins>;

did you test? "reg = <1>" on a real hardware ?

Quoted 1 line

I have? "reg = <0>" in my dts? and? it has been working on my board for

0 is a wildcard address.

For nano pi, if 1 doesn't work, then it should be 7. 0 can work, but it won't be accepted by DT maintainers.

Quoted 4 lines

ages.

Thanks

#36 lore raw

PATCH v2 16/18 arm64: dts: allwinner: a64: NanoPi-A64: Add Ethernet

In reply to Sergey Suloev
Quoted 58 lines · Sergey Suloev

Hi,

Quoted 40 lines · Andre Przywara

The NanoPi-A64 has the usual Realtek Gbit PHY connected to the EMAC, so add the respective nodes to the DT. The PHY is powered by the VDD_SYS_3.3V line, which is always on.

---
  arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dts | 17
+++++++++++++++++
  1 file changed, 17 insertions(+)
arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dts +1 -0
index 5caba225b4f7..bd35a093e6cd 100644
@@ -51,6 +51,7 @@
        compatible = "friendlyarm,nanopi-a64", "allwinner,sun50i-a64";
        aliases {
+               ethernet0 = &emac;
                serial0 = &uart0;
        };
  @@ -67,6 +68,15 @@
        status = "okay";
  };
  +&emac {
arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dts +8 -0
+       pinctrl-names = "default";
+       pinctrl-0 = <&rgmii_pins>;
+       phy-mode = "rgmii";
+       phy-handle = <&ext_rgmii_phy>;
+       phy-supply = <&reg_dcdc1>;
+       status = "okay";
+};
+
  /* i2c1 connected with gpio headers like pine64, bananapi */
  &i2c1 {
        pinctrl-names = "default";
@@ -78,6 +88,13 @@
        bias-pull-up;
  };

arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dts line 99

Quoted 10 lines
arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dts +6 -0
  +&mdio {
+       ext_rgmii_phy: ethernet-phy at 1 {
+               compatible = "ethernet-phy-ieee802.3-c22";
+               reg = <1>;
+       };
+};
+
  &mmc0 {
        pinctrl-names = "default";
        pinctrl-0 = <&mmc0_pins>;

did you test "reg = <1>" on a real hardware ?

Quoted 2 lines

I have "reg = <0>" in my dts and it has been working on my board for ages.

reg = <0> is a catch-all for RTL8211. We prefer to have the actual wired address used here instead of a catch-all.

ChenYu

#30 lore raw

PATCH v2 16/18 arm64: dts: allwinner: a64: NanoPi-A64: Add Ethernet

In reply to Icenowy Zheng

Hi,

Quoted 61 lines · Icenowy Zheng

? 2018?7?26? GMT+08:00 ??9:39:56, Sergey Suloev <[email protected]> ??:

Quoted 58 lines

Hi,

Quoted 7 lines · Andre Przywara

The NanoPi-A64 has the usual Realtek Gbit PHY connected to the EMAC, so add the respective nodes to the DT. The PHY is powered by the VDD_SYS_3.3V line, which is always on.

---
  arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dts | 17

+++++++++++++++++

Review

Quoted 3 lines
  1 file changed, 17 insertions(+)
(quoted diff) +0 -0

b/arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dts

Quoted 31 lines

index 5caba225b4f7..bd35a093e6cd 100644

arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dts +10 -0
@@ -51,6 +51,7 @@
  	compatible = "friendlyarm,nanopi-a64", "allwinner,sun50i-a64";
 
  	aliases {
+		ethernet0 = &emac;
  		serial0 = &uart0;
  	};
 
@@ -67,6 +68,15 @@
  	status = "okay";
  };
 
+&emac {
+	pinctrl-names = "default";
+	pinctrl-0 = <&rgmii_pins>;
+	phy-mode = "rgmii";
+	phy-handle = <&ext_rgmii_phy>;
+	phy-supply = <&reg_dcdc1>;
+	status = "okay";
+};
+
  /* i2c1 connected with gpio headers like pine64, bananapi */
  &i2c1 {
  	pinctrl-names = "default";
@@ -78,6 +88,13 @@
  	bias-pull-up;
  };
 

arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dts line 100

Quoted 10 lines
arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dts +7 -0
+&mdio {
+	ext_rgmii_phy: ethernet-phy at 1 {
+		compatible = "ethernet-phy-ieee802.3-c22";
+		reg = <1>;
+	};
+};
+
  &mmc0 {
  	pinctrl-names = "default";
  	pinctrl-0 = <&mmc0_pins>;

did you test? "reg = <1>" on a real hardware ?

No, thanks for pointing this out.

According to the PHY's datasheet the PHY address is configured by the three pins also used for the LEDs. By looking at the schematics back then I somehow managed to convince myself that it should be 1, as most other boards use, but from looking again it indeed looks more like 7 (the other LED pin connected to 3.3V).

Can you please try with reg = <7> and confirm that it works that way?

Many thanks,
Andre.

Quoted 12 lines
Quoted 2 lines

I have? "reg = <0>" in my dts? and? it has been working on my board for

0 is a wildcard address.

For nano pi, if 1 doesn't work, then it should be 7. 0 can work, but it won't be accepted by DT maintainers.

Quoted 4 lines

ages.

Thanks

#31 lore raw

PATCH v2 16/18 arm64: dts: allwinner: a64: NanoPi-A64: Add Ethernet

? 2018?7?26? GMT+08:00 ??10:06:44, Andre Przywara <[email protected]> ??:

Quoted 70 lines

Hi,

Quoted 3 lines · Icenowy Zheng

? 2018?7?26? GMT+08:00 ??9:39:56, Sergey Suloev

<[email protected]> ??:

Quoted 4 lines
Quoted 4 lines

Hi,

Quoted 1 line · Andre Przywara

The NanoPi-A64 has the usual Realtek Gbit PHY connected to the

EMAC,

Quoted 10 lines
Quoted 10 lines
Quoted 6 lines

so add the respective nodes to the DT. The PHY is powered by the VDD_SYS_3.3V line, which is always on.

---
  arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dts | 17

+++++++++++++++++

Quoted 3 lines
  1 file changed, 17 insertions(+)

diff --git

a/arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dts

Quoted 32 lines
Quoted 32 lines

b/arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dts

Quoted 31 lines

index 5caba225b4f7..bd35a093e6cd 100644

arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dts +10 -0
@@ -51,6 +51,7 @@
  	compatible = "friendlyarm,nanopi-a64", "allwinner,sun50i-a64";
 
  	aliases {
+		ethernet0 = &emac;
  		serial0 = &uart0;
  	};
 
@@ -67,6 +68,15 @@
  	status = "okay";
  };
 
+&emac {
+	pinctrl-names = "default";
+	pinctrl-0 = <&rgmii_pins>;
+	phy-mode = "rgmii";
+	phy-handle = <&ext_rgmii_phy>;
+	phy-supply = <&reg_dcdc1>;
+	status = "okay";
+};
+
  /* i2c1 connected with gpio headers like pine64, bananapi */
  &i2c1 {
  	pinctrl-names = "default";
@@ -78,6 +88,13 @@
  	bias-pull-up;
  };
 
Quoted 12 lines
Quoted 4 lines
Quoted 4 lines
arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dts +4 -0
+&mdio {
+	ext_rgmii_phy: ethernet-phy at 1 {
+		compatible = "ethernet-phy-ieee802.3-c22";
+		reg = <1>;
Quoted 8 lines

arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dts line 100

Quoted 6 lines
arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dts +3 -0
+	};
+};
+
  &mmc0 {
  	pinctrl-names = "default";
  	pinctrl-0 = <&mmc0_pins>;

did you test? "reg = <1>" on a real hardware ?

No, thanks for pointing this out.

Quoted 7 lines

According to the PHY's datasheet the PHY address is configured by the three pins also used for the LEDs. By looking at the schematics back then I somehow managed to convince myself that it should be 1, as most other boards use, but from looking again it indeed looks more like 7 (the other LED pin connected to 3.3V).

Can you please try with reg = <7> and confirm that it works that way?

In my memory many nanopi's use 7.

Quoted 22 lines

Many thanks,
Andre.

Quoted 2 lines
Quoted 2 lines

I have? "reg = <0>" in my dts? and? it has been working on my board

for

Quoted 10 lines

0 is a wildcard address.

For nano pi, if 1 doesn't work, then it should be 7. 0 can work, but it won't be accepted by DT maintainers.

Quoted 4 lines

ages.

Thanks

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

#32 lore raw

PATCH v2 16/18 arm64: dts: allwinner: a64: NanoPi-A64: Add Ethernet

In reply to Andre Przywara
Quoted 70 lines · Andre Przywara

Hi,

Quoted 59 lines · Icenowy Zheng

? 2018?7?26? GMT+08:00 ??9:39:56, Sergey Suloev <[email protected]> ??:

Quoted 57 lines

Hi,

Quoted 7 lines · Andre Przywara

The NanoPi-A64 has the usual Realtek Gbit PHY connected to the EMAC, so add the respective nodes to the DT. The PHY is powered by the VDD_SYS_3.3V line, which is always on.

---
   arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dts | 17

+++++++++++++++++

Review

Quoted 3 lines
   1 file changed, 17 insertions(+)
(quoted diff) +0 -0

b/arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dts

Quoted 31 lines

index 5caba225b4f7..bd35a093e6cd 100644

arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dts +10 -0
@@ -51,6 +51,7 @@
   	compatible = "friendlyarm,nanopi-a64", "allwinner,sun50i-a64";
 
   	aliases {
+		ethernet0 = &emac;
   		serial0 = &uart0;
   	};
 
@@ -67,6 +68,15 @@
   	status = "okay";
   };
 
+&emac {
+	pinctrl-names = "default";
+	pinctrl-0 = <&rgmii_pins>;
+	phy-mode = "rgmii";
+	phy-handle = <&ext_rgmii_phy>;
+	phy-supply = <&reg_dcdc1>;
+	status = "okay";
+};
+
   /* i2c1 connected with gpio headers like pine64, bananapi */
   &i2c1 {
   	pinctrl-names = "default";
@@ -78,6 +88,13 @@
   	bias-pull-up;
   };
 

arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dts line 100

Quoted 10 lines
arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dts +7 -0
+&mdio {
+	ext_rgmii_phy: ethernet-phy at 1 {
+		compatible = "ethernet-phy-ieee802.3-c22";
+		reg = <1>;
+	};
+};
+
   &mmc0 {
   	pinctrl-names = "default";
   	pinctrl-0 = <&mmc0_pins>;

did you test? "reg = <1>" on a real hardware ?

No, thanks for pointing this out.

According to the PHY's datasheet the PHY address is configured by the three pins also used for the LEDs. By looking at the schematics back then I somehow managed to convince myself that it should be 1, as most other boards use, but from looking again it indeed looks more like 7 (the other LED pin connected to 3.3V).

Quoted 4 lines

Can you please try with reg = <7> and confirm that it works that way?

Many thanks,
Andre.

ok, let me check this. And what data sheet are you talking about ? Can you provide a link, please.

Quoted 9 lines
Quoted 9 lines
Quoted 1 line

I have? "reg = <0>" in my dts? and? it has been working on my board for

0 is a wildcard address.

For nano pi, if 1 doesn't work, then it should be 7. 0 can work, but it won't be accepted by DT maintainers.

Quoted 3 lines

ages.

Thanks

#33 lore raw

PATCH v2 16/18 arm64: dts: allwinner: a64: NanoPi-A64: Add Ethernet

Hi Sergey,

Quoted 68 lines · Sergey Suloev
Quoted 67 lines · Andre Przywara

Hi,

Quoted 56 lines · Icenowy Zheng

? 2018?7?26? GMT+08:00 ??9:39:56, Sergey Suloev
<[email protected]> ??:

Quoted 53 lines

Hi,

Quoted 7 lines · Andre Przywara

The NanoPi-A64 has the usual Realtek Gbit PHY connected to the EMAC, so add the respective nodes to the DT. The PHY is powered by the VDD_SYS_3.3V line, which is always on.

---
?? arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dts | 17

+++++++++++++++++

Review

Quoted 3 lines

?? 1 file changed, 17 insertions(+)

(quoted diff) +0 -0

b/arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dts

Quoted 27 lines

index 5caba225b4f7..bd35a093e6cd 100644

arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dts +1 -0
@@ -51,6 +51,7 @@
 ?????? compatible = "friendlyarm,nanopi-a64", "allwinner,sun50i-a64";
 ?? ?????? aliases {
+??????? ethernet0 = &emac;
 ?????????? serial0 = &uart0;
 ?????? };

?? @@ -67,6 +68,15 @@
?????? status = "okay";
?? };
?? +&emac {
+??? pinctrl-names = "default";
+??? pinctrl-0 = <&rgmii_pins>;
+??? phy-mode = "rgmii";
+??? phy-handle = <&ext_rgmii_phy>;
+??? phy-supply = <&reg_dcdc1>;
+??? status = "okay";

arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dts +2 -0
+};
+

?? /* i2c1 connected with gpio headers like pine64, bananapi */ ?? &i2c1 {
?????? pinctrl-names = "default";

arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dts +0 -0
@@ -78,6 +88,13 @@
 ?????? bias-pull-up;
 ?? };

arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dts line 99

Quoted 10 lines
arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dts +6 -0
 ?? +&mdio {
+??? ext_rgmii_phy: ethernet-phy at 1 {
+??????? compatible = "ethernet-phy-ieee802.3-c22";
+??????? reg = <1>;
+??? };
+};
+
 ?? &mmc0 {
 ?????? pinctrl-names = "default";
 ?????? pinctrl-0 = <&mmc0_pins>;

did you test? "reg = <1>" on a real hardware ?

No, thanks for pointing this out.

According to the PHY's datasheet the PHY address is configured by the three pins also used for the LEDs. By looking at the schematics back then I somehow managed to convince myself that it should be 1, as most other boards use, but from looking again it indeed looks more like 7 (the other LED pin connected to 3.3V).

Quoted 5 lines
Quoted 4 lines

Can you please try with reg = <7> and confirm that it works that way?

Many thanks,
Andre.

ok, let me check this.

Thanks!

Quoted 2 lines

And what data sheet are you talking about ? Can
you provide a link, please.

The RTL8211 datasheet, for instance from here:
http://files.pine64.org/doc/datasheet/pine64/rtl8211e(g)-vb(vl)-cg_datasheet_1.6.pdf

Chapter 7.8 explains how the PHY address configuration works. If I match this with the schematic, it should be 7 indeed.

Cheers,
Andre.

Quoted 11 lines
Quoted 9 lines
Quoted 9 lines
Quoted 1 line

I have? "reg = <0>" in my dts? and? it has been working on my board for

0 is a wildcard address.

For nano pi, if 1 doesn't work, then it should be 7. 0 can work, but it won't be accepted by DT maintainers.

Quoted 3 lines

ages.

Thanks

#34 lore raw

PATCH v2 16/18 arm64: dts: allwinner: a64: NanoPi-A64: Add Ethernet

Hi,

Quoted 70 lines · Andre Przywara

Hi Sergey,

Quoted 67 lines · Sergey Suloev
Quoted 66 lines · Andre Przywara

Hi,

Quoted 55 lines · Icenowy Zheng

? 2018?7?26? GMT+08:00 ??9:39:56, Sergey Suloev
<[email protected]> ??:

Quoted 53 lines

Hi,

Quoted 7 lines · Andre Przywara

The NanoPi-A64 has the usual Realtek Gbit PHY connected to the EMAC, so add the respective nodes to the DT. The PHY is powered by the VDD_SYS_3.3V line, which is always on.

---
 ?? arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dts | 17

+++++++++++++++++

Review

Quoted 3 lines

?? 1 file changed, 17 insertions(+)

(quoted diff) +0 -0

b/arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dts

Quoted 27 lines

index 5caba225b4f7..bd35a093e6cd 100644

arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dts +1 -0
@@ -51,6 +51,7 @@
 ?????? compatible = "friendlyarm,nanopi-a64", "allwinner,sun50i-a64";
 ?? ?????? aliases {
+??????? ethernet0 = &emac;
 ?????????? serial0 = &uart0;
 ?????? };
 ?? @@ -67,6 +68,15 @@
 ?????? status = "okay";

?? };
?? +&emac {
+??? pinctrl-names = "default";
+??? pinctrl-0 = <&rgmii_pins>;
+??? phy-mode = "rgmii";
+??? phy-handle = <&ext_rgmii_phy>;
+??? phy-supply = <&reg_dcdc1>;
+??? status = "okay";

arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dts +2 -0
+};
+
 ?? /* i2c1 connected with gpio headers like pine64, bananapi */
 ?? &i2c1 {
 ?????? pinctrl-names = "default";
@@ -78,6 +88,13 @@
 ?????? bias-pull-up;
 ?? };

arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dts line 99

Quoted 10 lines
arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dts +6 -0
 ?? +&mdio {
+??? ext_rgmii_phy: ethernet-phy at 1 {
+??????? compatible = "ethernet-phy-ieee802.3-c22";
+??????? reg = <1>;
+??? };
+};
+
 ?? &mmc0 {
 ?????? pinctrl-names = "default";
 ?????? pinctrl-0 = <&mmc0_pins>;

did you test? "reg = <1>" on a real hardware ?

No, thanks for pointing this out.

According to the PHY's datasheet the PHY address is configured by the three pins also used for the LEDs. By looking at the schematics back then I somehow managed to convince myself that it should be 1, as most other boards use, but from looking again it indeed looks more like 7 (the other LED pin connected to 3.3V).

Quoted 6 lines
Quoted 5 lines
Quoted 4 lines

Can you please try with reg = <7> and confirm that it works that way?

Many thanks,
Andre.

ok, let me check this.

Thanks!

I tested with reg=7 and it worked.

Quoted 23 lines
Quoted 3 lines

And what data sheet are you talking about ? Can
you provide a link, please.

The RTL8211 datasheet, for instance from here:
http://files.pine64.org/doc/datasheet/pine64/rtl8211e(g)-vb(vl)-cg_datasheet_1.6.pdf

Chapter 7.8 explains how the PHY address configuration works. If I match this with the schematic, it should be 7 indeed.

Cheers,
Andre.

Quoted 10 lines
Quoted 9 lines
Quoted 9 lines
Quoted 1 line

I have? "reg = <0>" in my dts? and? it has been working on my board for

0 is a wildcard address.

For nano pi, if 1 doesn't work, then it should be 7. 0 can work, but it won't be accepted by DT maintainers.

Quoted 3 lines

ages.

Thanks

#35 lore raw

PATCH v2 16/18 arm64: dts: allwinner: a64: NanoPi-A64: Add Ethernet

Hi,

Quoted 73 lines · Sergey Suloev

Hi,

Quoted 71 lines · Andre Przywara

Hi Sergey,

Quoted 68 lines · Sergey Suloev
Quoted 67 lines · Andre Przywara

Hi,

Quoted 56 lines · Icenowy Zheng

? 2018?7?26? GMT+08:00 ??9:39:56, Sergey Suloev
<[email protected]> ??:

Quoted 54 lines

Hi,

Quoted 7 lines · Andre Przywara

The NanoPi-A64 has the usual Realtek Gbit PHY connected to the EMAC, so add the respective nodes to the DT. The PHY is powered by the VDD_SYS_3.3V line, which is always on.

---
??? arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dts | 17

+++++++++++++++++

Review

Quoted 3 lines

??? 1 file changed, 17 insertions(+)

(quoted diff) +0 -0

b/arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dts

Quoted 28 lines

index 5caba225b4f7..bd35a093e6cd 100644

arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dts +1 -0
@@ -51,6 +51,7 @@
 ??????? compatible = "friendlyarm,nanopi-a64",
 "allwinner,sun50i-a64";
 ??? ?????? aliases {
+??????? ethernet0 = &emac;
 ??????????? serial0 = &uart0;
 ??????? };

??? @@ -67,6 +68,15 @@
??????? status = "okay";
??? };
??? +&emac {
+??? pinctrl-names = "default";
+??? pinctrl-0 = <&rgmii_pins>;
+??? phy-mode = "rgmii";
+??? phy-handle = <&ext_rgmii_phy>;
+??? phy-supply = <&reg_dcdc1>;
+??? status = "okay";

arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dts +2 -0
+};
+

??? /* i2c1 connected with gpio headers like pine64, bananapi */ ??? &i2c1 {
??????? pinctrl-names = "default";

arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dts +0 -0
@@ -78,6 +88,13 @@
 ??????? bias-pull-up;
 ??? };

arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dts line 99

Quoted 10 lines
arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dts +6 -0
 ??? +&mdio {
+??? ext_rgmii_phy: ethernet-phy at 1 {
+??????? compatible = "ethernet-phy-ieee802.3-c22";
+??????? reg = <1>;
+??? };
+};
+
 ??? &mmc0 {
 ??????? pinctrl-names = "default";
 ??????? pinctrl-0 = <&mmc0_pins>;

did you test? "reg = <1>" on a real hardware ?

No, thanks for pointing this out.

According to the PHY's datasheet the PHY address is configured by the three pins also used for the LEDs. By looking at the schematics back then I somehow managed to convince myself that it should be 1, as most other boards use, but from looking again it indeed looks more like 7 (the other LED pin connected to 3.3V).

Quoted 8 lines
Quoted 6 lines
Quoted 5 lines
Quoted 4 lines

Can you please try with reg = <7> and confirm that it works that way?

Many thanks,
Andre.

ok, let me check this.

Thanks!

I tested with reg=7 and it worked.

Thanks for that, will amend the patch accordingly!

Cheers,
Andre.

Quoted 25 lines
Quoted 24 lines
Quoted 2 lines

And what data sheet are you talking about ? Can
you provide a link, please.

The RTL8211 datasheet, for instance from here:
http://files.pine64.org/doc/datasheet/pine64/rtl8211e(g)-vb(vl)-cg_datasheet_1.6.pdf

Chapter 7.8 explains how the PHY address configuration works. If I match this with the schematic, it should be 7 indeed.

Cheers,
Andre.

Quoted 11 lines
Quoted 10 lines
Quoted 10 lines
Quoted 2 lines

I have? "reg = <0>" in my dts? and? it has been working on my board for

0 is a wildcard address.

For nano pi, if 1 doesn't work, then it should be 7. 0 can work, but it won't be accepted by DT maintainers.

Quoted 3 lines

ages.

Thanks

#14 lore raw

[linux-sunxi] Re: [PATCH v2 06/18] arm64: dts: allwinner: a64: Orange Pi Win: Add UARTs

In reply to Andre Przywara

Hi,

Quoted 96 lines · Andre Przywara

Hi,

Quoted 84 lines · Maxime Ripard
Quoted 60 lines · Andre Przywara

Hi,

Quoted 57 lines · Icenowy Zheng

? 2018?7?26? GMT+08:00 ??3:39:11, Maxime Ripard <[email protected]> ??:

Quoted 43 lines · Andre Przywara
Quoted 3 lines

From: Samuel Holland <[email protected]>

The Orange Pi Win exposes several UARTs on header pin, and connects

one

Quoted 7 lines

to the on-board WiFi/Bluetooth chip.
Add the pinmux definitions to the UART nodes, but keep them disabled.

---
 .../boot/dts/allwinner/sun50i-a64-orangepi-win.dts | 33

++++++++++++++++++++++

Quoted 3 lines
 1 file changed, 33 insertions(+)

diff --git

a/arch/arm64/boot/dts/allwinner/sun50i-a64-orangepi-win.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-orangepi-win.dts

Quoted 25 lines

index 0cadcd59edd9..10f63d0b99cb 100644

arch/arm64/boot/dts/allwinner/sun50i-a64-orangepi-win.dts +5 -0
@@ -54,6 +54,10 @@
 	aliases {
 		ethernet0 = &emac;
 		serial0 = &uart0;
+		serial1 = &uart1;
+		serial2 = &uart2;
+		serial3 = &uart3;
+		serial4 = &uart4;
 	};
 
 	chosen {
@@ -237,12 +241,41 @@
 	vcc-hdmi-supply = <&reg_dldo1>;
 };
 
+/* On debug connector */
 &uart0 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&uart0_pins_a>;
 	status = "okay";
 };
 
Quoted 9 lines

arch/arm64/boot/dts/allwinner/sun50i-a64-orangepi-win.dts line 256

Quoted 6 lines
arch/arm64/boot/dts/allwinner/sun50i-a64-orangepi-win.dts +6 -0
+/* Wi-Fi/BT */
+&uart1 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&uart1_pins>, <&uart1_rts_cts_pins>;
+	status = "okay";
+};

What BT chip is there? Does it have serdev support? If so, that should be enabled here.

RTL8723BS, no serdev.

https://www.spinics.net/lists/linux-bluetooth/msg76376.html

Not very far off though.

Quoted 9 lines

Yes. A while ago I managed to enable Bluetooth (on the Pine64 with the same chip), but that involved a lot of hacking with a special userland tool (not hciattach and no serdev).

What this node means to say is: The UART1 is hardwired to some on-board device and those pins are not available for GPIO, for instance.

At least that was my understanding when it comes to enabling devices in the DT. Is that correct?

Well, yes and no. Arguably, any device connected to the other side of the serial bus should have been there from the beginning. However, there wasn't any way to do that in Linux before serdev was introduced, so we weren't doing that. That resulted in hacky userspace tools to work around that, and other work arounds in the DT to for example tying BT resources (clock, regulators, resets) to the WiFi chip hoping that someone would use both all the time.

Quoted 2 lines

Now that it's just around the corner, we don't have any excuse to do these kind of hacks anymore.

That's true. Also I see that the serdev binding itself is not serdev specific, it just puts the Bluetooth node as a child of an UART node. But we would still need a compatible string for that child, wouldn't we? I guess we can't autodetect this? From what I can see from Hans' series there is no DT compatible string defined?

Quoted 3 lines

So do we just put a node there, specifying the resources it needs? Like the wake-up interrupt or regulators, if any? And leave out the compatible string, at least for now?

So I tried this:
https://github.com/apritzel/linux/commit/da8e1beadd2737067c#diff-1c31e6cad6646026007c68fe9d4a5079R257

but wasn't really happy with it. Without a proper binding we can't describe all the resources yet: what's the prefix for -supply, is the wake-up line a GPIO or an interrupt, is the reset line a GPIO or a reset property, and so on.

So I can use either an empty node, which would more serve as documentation, or at least put the wakeup line as an interrupt there.

Was there at least a proposed binding? I tried to look for other BT chips, but they don't seem to agree on some common properties.

Cheers,
Andre.

#15 lore raw

[linux-sunxi] Re: [PATCH v2 06/18] arm64: dts: allwinner: a64: Orange Pi Win: Add UARTs

Quoted 109 lines · Andre Przywara
Quoted 96 lines · Andre Przywara

Hi,

Quoted 84 lines · Maxime Ripard
Quoted 60 lines · Andre Przywara

Hi,

Quoted 57 lines · Icenowy Zheng

? 2018?7?26? GMT+08:00 ??3:39:11, Maxime Ripard <[email protected]> ??:

Quoted 43 lines · Andre Przywara
Quoted 3 lines

From: Samuel Holland <[email protected]>

The Orange Pi Win exposes several UARTs on header pin, and connects

one

Quoted 7 lines

to the on-board WiFi/Bluetooth chip.
Add the pinmux definitions to the UART nodes, but keep them disabled.

---
 .../boot/dts/allwinner/sun50i-a64-orangepi-win.dts | 33

++++++++++++++++++++++

Quoted 3 lines
 1 file changed, 33 insertions(+)

diff --git

a/arch/arm64/boot/dts/allwinner/sun50i-a64-orangepi-win.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-orangepi-win.dts

Quoted 25 lines

index 0cadcd59edd9..10f63d0b99cb 100644

arch/arm64/boot/dts/allwinner/sun50i-a64-orangepi-win.dts +5 -0
@@ -54,6 +54,10 @@
 	aliases {
 		ethernet0 = &emac;
 		serial0 = &uart0;
+		serial1 = &uart1;
+		serial2 = &uart2;
+		serial3 = &uart3;
+		serial4 = &uart4;
 	};
 
 	chosen {
@@ -237,12 +241,41 @@
 	vcc-hdmi-supply = <&reg_dldo1>;
 };
 
+/* On debug connector */
 &uart0 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&uart0_pins_a>;
 	status = "okay";
 };
 
Quoted 9 lines

arch/arm64/boot/dts/allwinner/sun50i-a64-orangepi-win.dts line 256

Quoted 6 lines
arch/arm64/boot/dts/allwinner/sun50i-a64-orangepi-win.dts +6 -0
+/* Wi-Fi/BT */
+&uart1 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&uart1_pins>, <&uart1_rts_cts_pins>;
+	status = "okay";
+};

What BT chip is there? Does it have serdev support? If so, that should be enabled here.

RTL8723BS, no serdev.

https://www.spinics.net/lists/linux-bluetooth/msg76376.html

Not very far off though.

Quoted 9 lines

Yes. A while ago I managed to enable Bluetooth (on the Pine64 with the same chip), but that involved a lot of hacking with a special userland tool (not hciattach and no serdev).

What this node means to say is: The UART1 is hardwired to some on-board device and those pins are not available for GPIO, for instance.

At least that was my understanding when it comes to enabling devices in the DT. Is that correct?

Well, yes and no. Arguably, any device connected to the other side of the serial bus should have been there from the beginning. However, there wasn't any way to do that in Linux before serdev was introduced, so we weren't doing that. That resulted in hacky userspace tools to work around that, and other work arounds in the DT to for example tying BT resources (clock, regulators, resets) to the WiFi chip hoping that someone would use both all the time.

Quoted 2 lines

Now that it's just around the corner, we don't have any excuse to do these kind of hacks anymore.

That's true. Also I see that the serdev binding itself is not serdev specific, it just puts the Bluetooth node as a child of an UART node. But we would still need a compatible string for that child, wouldn't we? I guess we can't autodetect this? From what I can see from Hans' series there is no DT compatible string defined?

Quoted 3 lines

So do we just put a node there, specifying the resources it needs? Like the wake-up interrupt or regulators, if any? And leave out the compatible string, at least for now?

So I tried this:
https://github.com/apritzel/linux/commit/da8e1beadd2737067c#diff-1c31e6cad6646026007c68fe9d4a5079R257

but wasn't really happy with it. Without a proper binding we can't describe all the resources yet: what's the prefix for -supply, is the wake-up line a GPIO or an interrupt, is the reset line a GPIO or a reset property, and so on.

Quoted 5 lines

So I can use either an empty node, which would more serve as documentation, or at least put the wakeup line as an interrupt there.

Was there at least a proposed binding? I tried to look for other BT chips, but they don't seem to agree on some common properties.

A partially empty binding isn't worth anything, since you cannot be sure it won't change during the review cycle, and you would have to change it anyway when adding the compatible.

I guess it's fine. I would have liked to postpone this and that we'd wait for that serie to be merged to create a binding and merge that patch, but I'm not that reluctant to merge it either.

Maxime

Signature · 10 lines
Maxime Ripard, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20180727/d6a7c50c/attachment.sig>