Devicetree
 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, Ivan Pfarher <ipfarher@gmail.com>
Subject: [PATCH 0/4] arm64: dts: allwinner: h5: orangepi-zero-plus2: Fix Bluetooth and USB gadget
Date: Fri, 20 Nov 2026 12:40:44 +0100	[thread overview]
Message-ID: <20261120-orangepi-zero-plus2-fixes-v1-0-ecd792189f27@gmail.com> (raw)

On the Orange Pi Zero Plus2 (H5), neither the Bluetooth part of the
AP6212 module nor the micro USB port in peripheral mode work with the
current device tree. This series fixes both and adds MMC aliases:

1. 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. Describe the Bluetooth controller on UART1 (BT_REG_ON on PA10), so
   hci_bcm can power it, load its firmware and use it at 1.5 Mbaud.
3. 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. Drop
   them, as the port cannot supply VBUS anyway.
4. Add MMC aliases so the microSD card and the eMMC keep fixed numbers.

About patch 3: the root cause is that phy-sun4i-usb accepts the
host-mode request from the HCD even though the PHY's dr_mode is fixed
to "peripheral". Changing the PHY driver would also cover other
boards, but that is a separate discussion; this series only fixes the
board DT. The H3 version of the board (sun8i-h3-orangepi-zero-plus2.dts)
has the same USB and AP6212 setup and very likely the same problems,
but it is not changed here because I could not test it.

Testing: all four changes were tested on an Orange Pi Zero Plus2 (H5)
running Linux 6.6.160 (Yocto scarthgap, meta-sunxi) with the same DT
changes: Bluetooth comes up with firmware loaded and scans, the g_cdc
gadget enumerates on a PC, and the board boots with the microSD card
as mmcblk0 and the eMMC as mmcblk1. Against current mainline the
series is build-tested only: dtc gives no new warnings and dt-validate
reports nothing for the resulting DTB.

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.

Signed-off-by: Ivan Pfarher <ipfarher@gmail.com>

Signed-off-by: Ivan Pfarher <ipfarher@gmail.com>
---
Ivan Pfarher (4):
      arm64: dts: allwinner: h5: orangepi-zero-plus2: Add LPO clock for AP6212
      arm64: dts: allwinner: h5: orangepi-zero-plus2: Add AP6212 Bluetooth
      arm64: dts: allwinner: h5: orangepi-zero-plus2: Fix USB peripheral mode
      arm64: dts: allwinner: h5: orangepi-zero-plus2: Add MMC aliases

 .../allwinner/sun50i-h5-orangepi-zero-plus2.dts    | 25 +++++++++++++++-------
 1 file changed, 17 insertions(+), 8 deletions(-)
---
base-commit: 65e4fd942f72a9dba0e4e257290c4fa1aa756854
change-id: 20261120-orangepi-zero-plus2-fixes-92de09c1b5f5

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



             reply	other threads:[~2026-11-20 11:40 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-20 11:40 Ivan Pfarher via B4 Relay [this message]
2026-11-20 11:40 ` [PATCH 1/4] arm64: dts: allwinner: h5: orangepi-zero-plus2: Add LPO clock for AP6212 Ivan Pfarher via B4 Relay
2026-11-20 11:40 ` [PATCH 2/4] arm64: dts: allwinner: h5: orangepi-zero-plus2: Add AP6212 Bluetooth Ivan Pfarher via B4 Relay
2026-11-20 11:40 ` [PATCH 3/4] arm64: dts: allwinner: h5: orangepi-zero-plus2: Fix USB peripheral mode Ivan Pfarher via B4 Relay
2026-11-20 11:40 ` [PATCH 4/4] arm64: dts: allwinner: h5: orangepi-zero-plus2: Add MMC aliases Ivan Pfarher via B4 Relay

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=20261120-orangepi-zero-plus2-fixes-v1-0-ecd792189f27@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-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