Devicetree
 help / color / mirror / Atom feed
* [PATCH v2 0/4] ARM: dts: allwinner: orangepi-zero-plus2: Fix Bluetooth and USB gadget
@ 2026-12-03  9:04 Ivan Pfarher via B4 Relay
  2026-12-03  9:04 ` [PATCH v2 1/4] ARM: dts: allwinner: orangepi-zero-plus2: Add LPO clock for AP6212 Ivan Pfarher via B4 Relay
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Ivan Pfarher via B4 Relay @ 2026-12-03  9:04 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Chen-Yu Tsai,
	Jernej Skrabec, Samuel Holland
  Cc: devicetree, linux-arm-kernel, linux-sunxi, linux-kernel,
	Ivan Pfarher

On the Orange Pi Zero Plus2, neither the Bluetooth part of the AP6212
module nor the micro USB port in peripheral mode work with the current
device trees. The board exists with an H3 and with an H5; it is the same
board, only the SoC differs. The H5 fixes from v1 have been applied
(bfa27cff7430, 4fb04f870eb6 in sunxi/dt-for-7.5). This series does the
same for the H3 version, moves the common parts to a shared dtsi and
then adds Bluetooth there:

1.   H3: the AP6212 needs the RTC 32.768 kHz clock (osc32k-out) as LPO.
     It is not referenced, so it gets disabled as unused, and the BT ROM
     then answers nothing but HCI_Reset.
2.   H3: EHCI0/OHCI0 share USB PHY 0 with the MUSB controller; when they
     register, the USB core switches the PHY to host mode, so the
     peripheral-only micro USB port never enumerates as a gadget.
3.   Move the common parts to sunxi-orangepi-zero-plus2.dtsi. No
     functional change.
4.   Describe the Bluetooth controller on UART1 (BT_RST_N on PA10,
     BT_WAKE on PA20, BT_HOST_WAKE on PL2), so hci_bcm can power it,
     load its firmware and use it at 1.5 Mbaud.

Testing: the H5 version was tested running Linux 6.6.160 with the same
DT content: Bluetooth comes up with firmware loaded, runtime-suspends
when idle and wakes up for scans, and the g_cdc gadget enumerates on a
PC. The H3 version was not tested on hardware. Against sunxi/dt-for-7.5
the series is build-tested only: dtc gives no warnings and dt-validate
reports nothing for both DTBs.

The issues were found and the patches drafted with the help of an AI
coding assistant (Claude by Anthropic), which also ran the diagnostics
on the board (raw HCI commands over the UART, GPIO and clock
experiments, USB PHY state). I reviewed and tested the changes.

Changes in v2:
- Rebased on sunxi/dt-for-7.5; dropped the H5 LPO and USB fixes, which
  were applied from v1.
- Describe the BT_WAKE (PA20) and BT_HOST_WAKE (PL2) lines from the
  schematic, as suggested in review; tested runtime suspend and
  wake-up on the board.
- The H3 and H5 versions are the same board, as pointed out in review:
  add the LPO and USB fixes for the H3 version too (patches 1-2), move
  the common parts to a shared dtsi (patch 3), and add Bluetooth there
  (patch 4) instead of to the H5 file.
- Drop the MMC aliases patch: sunxi does not use MMC aliases; root
  devices should be given by UUID or PARTUUID.
- Link to v1: https://lore.kernel.org/r/20261120-orangepi-zero-plus2-fixes-v1-0-ecd792189f27@gmail.com

---
Ivan Pfarher (4):
      ARM: dts: allwinner: orangepi-zero-plus2: Add LPO clock for AP6212
      ARM: dts: allwinner: orangepi-zero-plus2: Fix USB peripheral mode
      ARM: dts: allwinner: orangepi-zero-plus2: Share common board parts
      ARM: dts: allwinner: orangepi-zero-plus2: Add AP6212 Bluetooth

 .../dts/allwinner/sun8i-h3-orangepi-zero-plus2.dts | 127 +-----------------
 .../dts/allwinner/sunxi-orangepi-zero-plus2.dtsi   | 147 +++++++++++++++++++++
 .../allwinner/sun50i-h5-orangepi-zero-plus2.dts    | 125 +-----------------
 3 files changed, 149 insertions(+), 250 deletions(-)
---
base-commit: 7b78b5603bb6fa10848aa607d4298c7558765b1f
change-id: 20261120-orangepi-zero-plus2-fixes-92de09c1b5f5

Best regards,
-- 
Ivan Pfarher <ipfarher@gmail.com>



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

* [PATCH v2 1/4] ARM: dts: allwinner: orangepi-zero-plus2: Add LPO clock for AP6212
  2026-12-03  9:04 [PATCH v2 0/4] ARM: dts: allwinner: orangepi-zero-plus2: Fix Bluetooth and USB gadget Ivan Pfarher via B4 Relay
@ 2026-12-03  9:04 ` Ivan Pfarher via B4 Relay
  2026-12-03  9:04 ` [PATCH v2 2/4] ARM: dts: allwinner: orangepi-zero-plus2: Fix USB peripheral mode Ivan Pfarher via B4 Relay
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Ivan Pfarher via B4 Relay @ 2026-12-03  9:04 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Chen-Yu Tsai,
	Jernej Skrabec, Samuel Holland
  Cc: devicetree, linux-arm-kernel, linux-sunxi, linux-kernel,
	Ivan Pfarher

From: Ivan Pfarher <ipfarher@gmail.com>

The H3 version of the Orange Pi Zero Plus2 is the same board as the H5
version, with the same AP6212 WiFi/BT module. Its LPO input is wired to
the RTC clock output (net AP-CK32KO from X32KFOUT in the schematic), but
nothing in the device tree references that clock, so it is disabled as
unused during late boot. Without the LPO, the Bluetooth ROM answers
HCI_Reset and nothing else, so the controller can never be brought up.

Reference the clock from the WiFi power sequence, as done for the H5
version.

Not tested on the H3 variant. The same change was tested on the H5
variant of the board (Linux 6.6.160), where it makes the Bluetooth
controller answer HCI commands. Build-tested only against current
mainline.

This problem was investigated, and the patch drafted, in an interactive
session with an AI coding assistant (Claude by Anthropic). The submitter
reviewed the change and ran the tests described above.

Fixes: cd3f03df13d4 ("ARM: dts: sun8i: Add initial Orangepi Zero Plus 2 H3 support")
Signed-off-by: Ivan Pfarher <ipfarher@gmail.com>
---
 arch/arm/boot/dts/allwinner/sun8i-h3-orangepi-zero-plus2.dts | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/arm/boot/dts/allwinner/sun8i-h3-orangepi-zero-plus2.dts b/arch/arm/boot/dts/allwinner/sun8i-h3-orangepi-zero-plus2.dts
index 97a3565ac..852723e94 100644
--- a/arch/arm/boot/dts/allwinner/sun8i-h3-orangepi-zero-plus2.dts
+++ b/arch/arm/boot/dts/allwinner/sun8i-h3-orangepi-zero-plus2.dts
@@ -45,6 +45,7 @@
 
 #include "sun8i-h3.dtsi"
 
+#include <dt-bindings/clock/sun6i-rtc.h>
 #include <dt-bindings/gpio/gpio.h>
 
 / {
@@ -94,6 +95,8 @@
 
 	wifi_pwrseq: pwrseq {
 		compatible = "mmc-pwrseq-simple";
+		clocks = <&rtc CLK_OSC32K_FANOUT>;
+		clock-names = "ext_clock";
 		reset-gpios = <&pio 0 9 GPIO_ACTIVE_LOW>; /* PA9 */
 		post-power-on-delay-ms = <200>;
 	};

-- 
2.43.0



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

* [PATCH v2 2/4] ARM: dts: allwinner: orangepi-zero-plus2: Fix USB peripheral mode
  2026-12-03  9:04 [PATCH v2 0/4] ARM: dts: allwinner: orangepi-zero-plus2: Fix Bluetooth and USB gadget Ivan Pfarher via B4 Relay
  2026-12-03  9:04 ` [PATCH v2 1/4] ARM: dts: allwinner: orangepi-zero-plus2: Add LPO clock for AP6212 Ivan Pfarher via B4 Relay
@ 2026-12-03  9:04 ` Ivan Pfarher via B4 Relay
  2026-12-03  9:04 ` [PATCH v2 3/4] ARM: dts: allwinner: orangepi-zero-plus2: Share common board parts Ivan Pfarher via B4 Relay
  2026-12-03  9:04 ` [PATCH v2 4/4] ARM: dts: allwinner: orangepi-zero-plus2: Add AP6212 Bluetooth Ivan Pfarher via B4 Relay
  3 siblings, 0 replies; 5+ messages in thread
From: Ivan Pfarher via B4 Relay @ 2026-12-03  9:04 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Chen-Yu Tsai,
	Jernej Skrabec, Samuel Holland
  Cc: devicetree, linux-arm-kernel, linux-sunxi, linux-kernel,
	Ivan Pfarher

From: Ivan Pfarher <ipfarher@gmail.com>

The micro USB port is set to dr_mode = "peripheral" because it cannot
supply VBUS, but EHCI0/OHCI0, which share USB PHY 0 with the MUSB
controller, are enabled too. When they register, the USB core asks the
shared PHY for host mode and phy-sun4i-usb switches PHY 0 to host, so a
gadget never shows up on the host.

This is the same problem as on the H5 version of the board, which is
the same hardware with a different SoC. The port cannot work as a host
anyway, so drop EHCI0 and OHCI0.

Not tested on the H3 variant. The same change was tested on the H5
variant of the board (Linux 6.6.160), where g_cdc then enumerates on
the PC. Build-tested only against current mainline.

This problem was investigated, and the patch drafted, in an interactive
session with an AI coding assistant (Claude by Anthropic). The submitter
reviewed the change and ran the tests described above.

Fixes: 43aad09c7928 ("ARM: dts: orange-pi-zero-plus2: enable USB OTG port")
Signed-off-by: Ivan Pfarher <ipfarher@gmail.com>
---
 arch/arm/boot/dts/allwinner/sun8i-h3-orangepi-zero-plus2.dts | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/arch/arm/boot/dts/allwinner/sun8i-h3-orangepi-zero-plus2.dts b/arch/arm/boot/dts/allwinner/sun8i-h3-orangepi-zero-plus2.dts
index 852723e94..0ca7d8a9d 100644
--- a/arch/arm/boot/dts/allwinner/sun8i-h3-orangepi-zero-plus2.dts
+++ b/arch/arm/boot/dts/allwinner/sun8i-h3-orangepi-zero-plus2.dts
@@ -120,10 +120,6 @@
 	status = "okay";
 };
 
-&ehci0 {
-	status = "okay";
-};
-
 &hdmi {
 	status = "okay";
 };
@@ -168,10 +164,6 @@
 	status = "okay";
 };
 
-&ohci0 {
-	status = "okay";
-};
-
 &uart0 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&uart0_pa_pins>;

-- 
2.43.0



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

* [PATCH v2 3/4] ARM: dts: allwinner: orangepi-zero-plus2: Share common board parts
  2026-12-03  9:04 [PATCH v2 0/4] ARM: dts: allwinner: orangepi-zero-plus2: Fix Bluetooth and USB gadget Ivan Pfarher via B4 Relay
  2026-12-03  9:04 ` [PATCH v2 1/4] ARM: dts: allwinner: orangepi-zero-plus2: Add LPO clock for AP6212 Ivan Pfarher via B4 Relay
  2026-12-03  9:04 ` [PATCH v2 2/4] ARM: dts: allwinner: orangepi-zero-plus2: Fix USB peripheral mode Ivan Pfarher via B4 Relay
@ 2026-12-03  9:04 ` Ivan Pfarher via B4 Relay
  2026-12-03  9:04 ` [PATCH v2 4/4] ARM: dts: allwinner: orangepi-zero-plus2: Add AP6212 Bluetooth Ivan Pfarher via B4 Relay
  3 siblings, 0 replies; 5+ messages in thread
From: Ivan Pfarher via B4 Relay @ 2026-12-03  9:04 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Chen-Yu Tsai,
	Jernej Skrabec, Samuel Holland
  Cc: devicetree, linux-arm-kernel, linux-sunxi, linux-kernel,
	Ivan Pfarher

From: Ivan Pfarher <ipfarher@gmail.com>

The H3 and H5 versions of the Orange Pi Zero Plus2 are the same board;
H3 and H5 are pin compatible, so only the SoC differs. Move the common
parts to sunxi-orangepi-zero-plus2.dtsi and include it from both board
files, as done for the Bananapi M2 Plus and the Libre Computer
ALL-H3-CC.

The H3 board file keeps the audio routing, the H5 board file keeps
disable-wp for the microSD slot and UART1, which only it enables.

No functional change: the H3 DTB is byte-identical, and the H5 DTB has
the same nodes and properties (decompiled with dtc -s, the output is
identical).

The patch was drafted with an AI coding assistant (Claude by Anthropic)
after review feedback that the two boards should share a .dtsi; the
submitter reviewed it.

Signed-off-by: Ivan Pfarher <ipfarher@gmail.com>
---
 .../dts/allwinner/sun8i-h3-orangepi-zero-plus2.dts | 122 +-------------------
 .../dts/allwinner/sunxi-orangepi-zero-plus2.dtsi   | 126 +++++++++++++++++++++
 .../allwinner/sun50i-h5-orangepi-zero-plus2.dts    | 119 +------------------
 3 files changed, 128 insertions(+), 239 deletions(-)

diff --git a/arch/arm/boot/dts/allwinner/sun8i-h3-orangepi-zero-plus2.dts b/arch/arm/boot/dts/allwinner/sun8i-h3-orangepi-zero-plus2.dts
index 0ca7d8a9d..91ec10998 100644
--- a/arch/arm/boot/dts/allwinner/sun8i-h3-orangepi-zero-plus2.dts
+++ b/arch/arm/boot/dts/allwinner/sun8i-h3-orangepi-zero-plus2.dts
@@ -44,62 +44,11 @@
 /dts-v1/;
 
 #include "sun8i-h3.dtsi"
-
-#include <dt-bindings/clock/sun6i-rtc.h>
-#include <dt-bindings/gpio/gpio.h>
+#include "sunxi-orangepi-zero-plus2.dtsi"
 
 / {
 	model = "OrangePi Zero Plus2 H3";
 	compatible = "xunlong,orangepi-zero-plus2-h3", "allwinner,sun8i-h3";
-
-	aliases {
-		serial0 = &uart0;
-	};
-
-	chosen {
-		stdout-path = "serial0:115200n8";
-	};
-
-	connector {
-		compatible = "hdmi-connector";
-		type = "a";
-
-		port {
-			hdmi_con_in: endpoint {
-				remote-endpoint = <&hdmi_out_con>;
-			};
-		};
-	};
-
-	leds {
-		compatible = "gpio-leds";
-
-		led-0 {
-			label = "orangepi:green:pwr";
-			gpios = <&r_pio 0 10 GPIO_ACTIVE_HIGH>;
-			default-state = "on";
-		};
-
-		led-1 {
-			label = "orangepi:red:status";
-			gpios = <&pio 0 17 GPIO_ACTIVE_HIGH>;
-		};
-	};
-
-	reg_vcc3v3: vcc3v3 {
-		compatible = "regulator-fixed";
-		regulator-name = "vcc3v3";
-		regulator-min-microvolt = <3300000>;
-		regulator-max-microvolt = <3300000>;
-	};
-
-	wifi_pwrseq: pwrseq {
-		compatible = "mmc-pwrseq-simple";
-		clocks = <&rtc CLK_OSC32K_FANOUT>;
-		clock-names = "ext_clock";
-		reset-gpios = <&pio 0 9 GPIO_ACTIVE_LOW>; /* PA9 */
-		post-power-on-delay-ms = <200>;
-	};
 };
 
 /*
@@ -115,72 +64,3 @@
 		"Mic",  "MBIAS";
 	status = "disabled";
 };
-
-&de {
-	status = "okay";
-};
-
-&hdmi {
-	status = "okay";
-};
-
-&hdmi_out {
-	hdmi_out_con: endpoint {
-		remote-endpoint = <&hdmi_con_in>;
-	};
-};
-
-&mmc0 {
-	vmmc-supply = <&reg_vcc3v3>;
-	bus-width = <4>;
-	cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>;
-	status = "okay";
-};
-
-&mmc1 {
-	vmmc-supply = <&reg_vcc3v3>;
-	vqmmc-supply = <&reg_vcc3v3>;
-	mmc-pwrseq = <&wifi_pwrseq>;
-	bus-width = <4>;
-	non-removable;
-	status = "okay";
-
-	brcmf: wifi@1 {
-		reg = <1>;
-		compatible = "brcm,bcm4329-fmac";
-		interrupt-parent = <&r_pio>;
-		interrupts = <0 7 IRQ_TYPE_LEVEL_LOW>;	/* PL7 */
-		interrupt-names = "host-wake";
-	};
-};
-
-&mmc2 {
-	pinctrl-names = "default";
-	pinctrl-0 = <&mmc2_8bit_pins>;
-	vmmc-supply = <&reg_vcc3v3>;
-	bus-width = <8>;
-	non-removable;
-	cap-mmc-hw-reset;
-	status = "okay";
-};
-
-&uart0 {
-	pinctrl-names = "default";
-	pinctrl-0 = <&uart0_pa_pins>;
-	status = "okay";
-};
-
-&usb_otg {
-	/*
-	 * According to schematics CN1 MicroUSB port can be used to take
-	 * external 5V to power up the board VBUS. On the contrary CN1 MicroUSB
-	 * port cannot provide power externally even if the board is powered
-	 * via GPIO pins. It thus makes sense to force peripheral mode.
-	 */
-	dr_mode = "peripheral";
-	status = "okay";
-};
-
-&usbphy {
-	status = "okay";
-};
diff --git a/arch/arm/boot/dts/allwinner/sunxi-orangepi-zero-plus2.dtsi b/arch/arm/boot/dts/allwinner/sunxi-orangepi-zero-plus2.dtsi
new file mode 100644
index 000000000..763aaffaf
--- /dev/null
+++ b/arch/arm/boot/dts/allwinner/sunxi-orangepi-zero-plus2.dtsi
@@ -0,0 +1,126 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+// Copyright (C) 2017 Jagan Teki <jteki@openedev.com>
+// Copyright (C) 2018 Diego Rondini <diego.rondini@kynetics.com>
+
+#include <dt-bindings/clock/sun6i-rtc.h>
+#include <dt-bindings/gpio/gpio.h>
+
+/ {
+	aliases {
+		serial0 = &uart0;
+	};
+
+	chosen {
+		stdout-path = "serial0:115200n8";
+	};
+
+	connector {
+		compatible = "hdmi-connector";
+		type = "a";
+
+		port {
+			hdmi_con_in: endpoint {
+				remote-endpoint = <&hdmi_out_con>;
+			};
+		};
+	};
+
+	leds {
+		compatible = "gpio-leds";
+
+		led-0 {
+			label = "orangepi:green:pwr";
+			gpios = <&r_pio 0 10 GPIO_ACTIVE_HIGH>;
+			default-state = "on";
+		};
+
+		led-1 {
+			label = "orangepi:red:status";
+			gpios = <&pio 0 17 GPIO_ACTIVE_HIGH>;
+		};
+	};
+
+	reg_vcc3v3: vcc3v3 {
+		compatible = "regulator-fixed";
+		regulator-name = "vcc3v3";
+		regulator-min-microvolt = <3300000>;
+		regulator-max-microvolt = <3300000>;
+	};
+
+	wifi_pwrseq: pwrseq {
+		compatible = "mmc-pwrseq-simple";
+		clocks = <&rtc CLK_OSC32K_FANOUT>;
+		clock-names = "ext_clock";
+		reset-gpios = <&pio 0 9 GPIO_ACTIVE_LOW>; /* PA9 */
+		post-power-on-delay-ms = <200>;
+	};
+};
+
+&de {
+	status = "okay";
+};
+
+&hdmi {
+	status = "okay";
+};
+
+&hdmi_out {
+	hdmi_out_con: endpoint {
+		remote-endpoint = <&hdmi_con_in>;
+	};
+};
+
+&mmc0 {
+	vmmc-supply = <&reg_vcc3v3>;
+	bus-width = <4>;
+	cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>;
+	status = "okay";
+};
+
+&mmc1 {
+	vmmc-supply = <&reg_vcc3v3>;
+	vqmmc-supply = <&reg_vcc3v3>;
+	mmc-pwrseq = <&wifi_pwrseq>;
+	bus-width = <4>;
+	non-removable;
+	status = "okay";
+
+	brcmf: wifi@1 {
+		reg = <1>;
+		compatible = "brcm,bcm4329-fmac";
+		interrupt-parent = <&r_pio>;
+		interrupts = <0 7 IRQ_TYPE_LEVEL_LOW>;	/* PL7 */
+		interrupt-names = "host-wake";
+	};
+};
+
+&mmc2 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&mmc2_8bit_pins>;
+	vmmc-supply = <&reg_vcc3v3>;
+	bus-width = <8>;
+	non-removable;
+	cap-mmc-hw-reset;
+	status = "okay";
+};
+
+&uart0 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&uart0_pa_pins>;
+	status = "okay";
+};
+
+&usb_otg {
+	/*
+	 * According to schematics CN1 MicroUSB port can be used to take
+	 * external 5V to power up the board VBUS. On the contrary CN1 MicroUSB
+	 * port cannot provide power externally even if the board is powered
+	 * via GPIO pins. It thus makes sense to force peripheral mode.
+	 */
+	dr_mode = "peripheral";
+	status = "okay";
+};
+
+&usbphy {
+	status = "okay";
+};
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-zero-plus2.dts b/arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-zero-plus2.dts
index acef0e242..10463ee6c 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-zero-plus2.dts
+++ b/arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-zero-plus2.dts
@@ -4,117 +4,15 @@
 /dts-v1/;
 
 #include "sun50i-h5.dtsi"
-
-#include <dt-bindings/clock/sun6i-rtc.h>
-#include <dt-bindings/gpio/gpio.h>
+#include <arm/allwinner/sunxi-orangepi-zero-plus2.dtsi>
 
 / {
 	model = "OrangePi Zero Plus2";
 	compatible = "xunlong,orangepi-zero-plus2", "allwinner,sun50i-h5";
-
-	aliases {
-		serial0 = &uart0;
-	};
-
-	chosen {
-		stdout-path = "serial0:115200n8";
-	};
-
-	connector {
-		compatible = "hdmi-connector";
-		type = "a";
-
-		port {
-			hdmi_con_in: endpoint {
-				remote-endpoint = <&hdmi_out_con>;
-			};
-		};
-	};
-
-	leds {
-		compatible = "gpio-leds";
-
-		led-0 {
-			label = "orangepi:green:pwr";
-			gpios = <&r_pio 0 10 GPIO_ACTIVE_HIGH>;
-			default-state = "on";
-		};
-
-		led-1 {
-			label = "orangepi:red:status";
-			gpios = <&pio 0 17 GPIO_ACTIVE_HIGH>;
-		};
-	};
-
-	reg_vcc3v3: vcc3v3 {
-		compatible = "regulator-fixed";
-		regulator-name = "vcc3v3";
-		regulator-min-microvolt = <3300000>;
-		regulator-max-microvolt = <3300000>;
-	};
-
-	wifi_pwrseq: pwrseq {
-		compatible = "mmc-pwrseq-simple";
-		clocks = <&rtc CLK_OSC32K_FANOUT>;
-		clock-names = "ext_clock";
-		reset-gpios = <&pio 0 9 GPIO_ACTIVE_LOW>; /* PA9 */
-		post-power-on-delay-ms = <200>;
-	};
-};
-
-&de {
-	status = "okay";
-};
-
-&hdmi {
-	status = "okay";
-};
-
-&hdmi_out {
-	hdmi_out_con: endpoint {
-		remote-endpoint = <&hdmi_con_in>;
-	};
 };
 
 &mmc0 {
-	vmmc-supply = <&reg_vcc3v3>;
 	disable-wp;
-	bus-width = <4>;
-	cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>;
-	status = "okay";
-};
-
-&mmc1 {
-	vmmc-supply = <&reg_vcc3v3>;
-	vqmmc-supply = <&reg_vcc3v3>;
-	mmc-pwrseq = <&wifi_pwrseq>;
-	bus-width = <4>;
-	non-removable;
-	status = "okay";
-
-	brcmf: wifi@1 {
-		reg = <1>;
-		compatible = "brcm,bcm4329-fmac";
-		interrupt-parent = <&r_pio>;
-		interrupts = <0 7 IRQ_TYPE_LEVEL_LOW>;	/* PL7 */
-		interrupt-names = "host-wake";
-	};
-};
-
-&mmc2 {
-	pinctrl-names = "default";
-	pinctrl-0 = <&mmc2_8bit_pins>;
-	vmmc-supply = <&reg_vcc3v3>;
-	bus-width = <8>;
-	non-removable;
-	cap-mmc-hw-reset;
-	status = "okay";
-};
-
-&uart0 {
-	pinctrl-names = "default";
-	pinctrl-0 = <&uart0_pa_pins>;
-	status = "okay";
 };
 
 &uart1 {
@@ -122,18 +20,3 @@
 	pinctrl-0 = <&uart1_pins>, <&uart1_rts_cts_pins>;
 	status = "okay";
 };
-
-&usb_otg {
-	/*
-	 * According to schematics CN1 MicroUSB port can be used to take
-	 * external 5V to power up the board VBUS. On the contrary CN1 MicroUSB
-	 * port cannot provide power externally even if the board is powered
-	 * via GPIO pins. It thus makes sense to force peripheral mode.
-	 */
-	dr_mode = "peripheral";
-	status = "okay";
-};
-
-&usbphy {
-	status = "okay";
-};

-- 
2.43.0



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

* [PATCH v2 4/4] ARM: dts: allwinner: orangepi-zero-plus2: Add AP6212 Bluetooth
  2026-12-03  9:04 [PATCH v2 0/4] ARM: dts: allwinner: orangepi-zero-plus2: Fix Bluetooth and USB gadget Ivan Pfarher via B4 Relay
                   ` (2 preceding siblings ...)
  2026-12-03  9:04 ` [PATCH v2 3/4] ARM: dts: allwinner: orangepi-zero-plus2: Share common board parts Ivan Pfarher via B4 Relay
@ 2026-12-03  9:04 ` Ivan Pfarher via B4 Relay
  3 siblings, 0 replies; 5+ messages in thread
From: Ivan Pfarher via B4 Relay @ 2026-12-03  9:04 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Chen-Yu Tsai,
	Jernej Skrabec, Samuel Holland
  Cc: devicetree, linux-arm-kernel, linux-sunxi, linux-kernel,
	Ivan Pfarher

From: Ivan Pfarher <ipfarher@gmail.com>

UART1 is connected to the Bluetooth part of the AP6212 module, but the
controller itself is not described, so nothing powers it up and the
kernel never registers it.

Add it as a serdev child of UART1 in the shared board dtsi, so both
the H3 and the H5 version get it; UART1 was so far only enabled for
the H5 version. Per the board schematic, BT_RST_N
(BT_REG_ON) is connected to PA10, BT_WAKE (net AP-WAKE-BT) to PA20 and
BT_HOST_WAKE (net BT-WAKE-AP) to PL2, which is used as the host-wakeup
interrupt. The controller uses the same RTC LPO clock as the WiFi part.

Tested on the H5 version of the board running Linux 6.6.160 with this
change applied: hci_bcm powers the controller, loads
brcm/BCM43430A1.hcd, switches the UART to 1.5 Mbaud and the adapter
works with BlueZ:

  Bluetooth: hci0: BCM43430A1 'brcm/BCM43430A1.hcd' Patch
  Bluetooth: hci0: BCM43438A1 26MHz AP6212A1_CL1 BT4.0 OTP-BD-0034

With the wake-up lines the controller runtime-suspends when idle (PA20
deasserted) and resumes for scans, and the host_wake interrupt on PL2
fires on controller activity. Classic inquiry and LE scans find nearby
devices both from the suspended state and with runtime PM disabled.
Not tested on the H3 version. Build-tested only against current
mainline.

This problem was investigated, and the patch drafted, in an interactive
session with an AI coding assistant (Claude by Anthropic). The submitter
reviewed the change and ran the tests described above.

Signed-off-by: Ivan Pfarher <ipfarher@gmail.com>
---
 .../dts/allwinner/sunxi-orangepi-zero-plus2.dtsi    | 21 +++++++++++++++++++++
 .../dts/allwinner/sun50i-h5-orangepi-zero-plus2.dts |  6 ------
 2 files changed, 21 insertions(+), 6 deletions(-)

diff --git a/arch/arm/boot/dts/allwinner/sunxi-orangepi-zero-plus2.dtsi b/arch/arm/boot/dts/allwinner/sunxi-orangepi-zero-plus2.dtsi
index 763aaffaf..d468e188b 100644
--- a/arch/arm/boot/dts/allwinner/sunxi-orangepi-zero-plus2.dtsi
+++ b/arch/arm/boot/dts/allwinner/sunxi-orangepi-zero-plus2.dtsi
@@ -110,6 +110,27 @@
 	status = "okay";
 };
 
+&uart1 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&uart1_pins>, <&uart1_rts_cts_pins>;
+	uart-has-rtscts;
+	status = "okay";
+
+	bluetooth {
+		compatible = "brcm,bcm43438-bt";
+		max-speed = <1500000>;
+		clocks = <&rtc CLK_OSC32K_FANOUT>;
+		clock-names = "lpo";
+		vbat-supply = <&reg_vcc3v3>;
+		vddio-supply = <&reg_vcc3v3>;
+		shutdown-gpios = <&pio 0 10 GPIO_ACTIVE_HIGH>; /* PA10 */
+		device-wakeup-gpios = <&pio 0 20 GPIO_ACTIVE_HIGH>; /* PA20 */
+		interrupt-parent = <&r_pio>;
+		interrupts = <0 2 IRQ_TYPE_EDGE_RISING>; /* PL2 */
+		interrupt-names = "host-wakeup";
+	};
+};
+
 &usb_otg {
 	/*
 	 * According to schematics CN1 MicroUSB port can be used to take
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-zero-plus2.dts b/arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-zero-plus2.dts
index 10463ee6c..8c3425616 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-zero-plus2.dts
+++ b/arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-zero-plus2.dts
@@ -14,9 +14,3 @@
 &mmc0 {
 	disable-wp;
 };
-
-&uart1 {
-	pinctrl-names = "default";
-	pinctrl-0 = <&uart1_pins>, <&uart1_rts_cts_pins>;
-	status = "okay";
-};

-- 
2.43.0



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

end of thread, other threads:[~2026-12-03  9:04 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-03  9:04 [PATCH v2 0/4] ARM: dts: allwinner: orangepi-zero-plus2: Fix Bluetooth and USB gadget Ivan Pfarher via B4 Relay
2026-12-03  9:04 ` [PATCH v2 1/4] ARM: dts: allwinner: orangepi-zero-plus2: Add LPO clock for AP6212 Ivan Pfarher via B4 Relay
2026-12-03  9:04 ` [PATCH v2 2/4] ARM: dts: allwinner: orangepi-zero-plus2: Fix USB peripheral mode Ivan Pfarher via B4 Relay
2026-12-03  9:04 ` [PATCH v2 3/4] ARM: dts: allwinner: orangepi-zero-plus2: Share common board parts Ivan Pfarher via B4 Relay
2026-12-03  9:04 ` [PATCH v2 4/4] ARM: dts: allwinner: orangepi-zero-plus2: Add AP6212 Bluetooth Ivan Pfarher via B4 Relay

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox