Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Ivan Pfarher via B4 Relay <devnull+ipfarher.gmail.com@kernel.org>
To: Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	 Conor Dooley <conor+dt@kernel.org>,
	Chen-Yu Tsai <wens@kernel.org>,
	 Jernej Skrabec <jernej.skrabec@gmail.com>,
	 Samuel Holland <samuel@sholland.org>
Cc: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	 linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org,
	 Ivan Pfarher <ipfarher@gmail.com>
Subject: [PATCH v2 4/4] ARM: dts: allwinner: orangepi-zero-plus2: Add AP6212 Bluetooth
Date: Thu, 03 Dec 2026 10:04:18 +0100	[thread overview]
Message-ID: <20261203-orangepi-zero-plus2-fixes-v2-4-286df6b782f4@gmail.com> (raw)
In-Reply-To: <20261203-orangepi-zero-plus2-fixes-v2-0-286df6b782f4@gmail.com>

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




      parent reply	other threads:[~2026-12-03  9:04 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 ` Ivan Pfarher via B4 Relay [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261203-orangepi-zero-plus2-fixes-v2-4-286df6b782f4@gmail.com \
    --to=devnull+ipfarher.gmail.com@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=ipfarher@gmail.com \
    --cc=jernej.skrabec@gmail.com \
    --cc=krzk+dt@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sunxi@lists.linux.dev \
    --cc=robh@kernel.org \
    --cc=samuel@sholland.org \
    --cc=wens@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox