sun60iw2: bring up AIC8800 UART Bluetooth on the Orange Pi A733 boards#10149
Conversation
The AIC8800D80 combo's BT is UART HCI on ttyS1. Its firmware (loaded over SDIO by aic8800_bsp) idles the BT core in low-power until BT_WAKE is asserted, so a plain hciattach times out waiting for HCI_Reset. Assert the wake via the btlpm sysfs knob, then attach the generic H4 line discipline. Adds aic8800-bluetooth.service (stock bluez hciattach, no vendor blob), installed and enabled by the family for boards that set SUN60IW2_UART_BT (both Orange Pi A733 boards). Validated on the Zero 3W.
|
Important Review skippedAuto reviews are limited based on label configuration. 🏷️ Required labels (at least one) (1)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughAdds a ChangesAIC8800D80 UART Bluetooth support
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
packages/bsp/sunxi/aic8800-bluetooth.service (1)
3-4: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick winConsider
Before=bluetooth.serviceinstead ofAfter=bluetooth.service.Both repo precedents for UART HCI bring-up (
pinebook-bluetooth.serviceusesBefore=bluetooth.service;rtl8723bs-bluetooth.serviceusesAfter=bluetooth.target, which also precedesbluetooth.service) start hciattach before bluetoothd so the HCI device exists when the daemon initializes. WithAfter=bluetooth.service, bluetoothd starts with no adapter and must detect hci0 via udev after hciattach creates it — functional but suboptimal, and can delay adapter availability.Switching to
Before=bluetooth.service(keepingWants=bluetooth.service) ensures hciattach creates hci0 first, then bluetoothd starts and finds the adapter ready.♻️ Proposed ordering fix
[Unit] Description=AIC8800 Bluetooth (UART HCI on ttyS1) -After=bluetooth.service +Before=bluetooth.service Wants=bluetooth.service🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/bsp/sunxi/aic8800-bluetooth.service` around lines 3 - 4, The unit ordering in the bluetooth service is backwards for UART HCI bring-up: `aic8800-bluetooth.service` should start `hciattach` before `bluetooth.service` so the adapter exists when bluetoothd initializes. Update the service ordering directive in this unit from `After=bluetooth.service` to `Before=bluetooth.service` while keeping `Wants=bluetooth.service`, matching the existing bring-up pattern used by the other bluetooth service units.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@packages/bsp/sunxi/aic8800-bluetooth.service`:
- Around line 3-4: The unit ordering in the bluetooth service is backwards for
UART HCI bring-up: `aic8800-bluetooth.service` should start `hciattach` before
`bluetooth.service` so the adapter exists when bluetoothd initializes. Update
the service ordering directive in this unit from `After=bluetooth.service` to
`Before=bluetooth.service` while keeping `Wants=bluetooth.service`, matching the
existing bring-up pattern used by the other bluetooth service units.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: ce4e648a-79cc-4e16-bded-90361714c519
📒 Files selected for processing (4)
config/boards/orangepi4pro.cscconfig/boards/orangepizero3w.cscconfig/sources/families/sun60iw2.confpackages/bsp/sunxi/aic8800-bluetooth.service
|
✅ This PR has been reviewed and approved — all set for merge! |
Description
Hi all — this is the Bluetooth follow-up I mentioned in the Orange Pi Zero 3W PR: a small, family-wide bring-up of the AIC8800D80's UART Bluetooth on both A733 boards (Orange Pi 4 Pro and Zero 3W). WiFi already works out of the box on these boards; this closes the last combo-radio gap. I tested it on my Orange Pi Zero 3W and it appears solid — as always, very open to feedback on the approach.
The AIC8800D80 combo's BT is UART HCI on
ttyS1. Its firmware (loaded over SDIO byaic8800_bsp) idles the BT core in low-power untilBT_WAKEis asserted, so a plainhciattachtimes out waiting forHCI_Reset. The fix is to assert the wake via thebtlpmsysfs knob, then attach the generic H4 line discipline.Documentation summary for feature / change
Not needed — no user-facing config; Bluetooth just works on these boards after this change.
How Has This Been Tested?
Validated on real hardware, Orange Pi Zero 3W (Trixie CLI image):
aic8800-bluetooth.servicecomes up clean on boot;hci0isUP RUNNING.bluetoothctlLE scan returns nearby devices.btlpmwake path exercised (without the wake,hciattachreproducibly times out onHCI_Reset).The Orange Pi 4 Pro shares the identical AIC8800D80 combo and UART-HCI wiring, so the same path applies; I've enabled it on both boards. (My primary bring-up + validation was on the Zero 3W.)
Checklist:
Thanks!
-James
Summary by CodeRabbit