Skip to content

Enable HW flow control on Yellow's mini UART to stabilize Bluetooth - #4957

Merged
sairon merged 1 commit into
devfrom
yellow-enable-miniuart-flow-control
Aug 10, 2026
Merged

sairon merged 1 commit into
devfrom
yellow-enable-miniuart-flow-control

Conversation

@sairon

@sairon sairon commented Aug 10, 2026 •

Copy link
Copy Markdown
Member

Apply patch implementing HW flow control in BCM2835's mini UART and indicate the RTS/CTS is wired in Yellow's device tree to enable using the flow control for the Bluetooth interface. This greatly improves stability of the Bluetooth interface, which started to be unstable with kernel update to 6.18 in OS 18.0 and newer.

Fixes #4898

Summary by CodeRabbit

  • New Features
    • Added hardware RTS/CTS auto-flow control support for compatible Raspberry Pi UART ports.
    • Enabled RTS/CTS flow control on UART1 for the CM4 HA Yellow device.
    • Added handling to preserve reliable serial communication during throttling and RS-485 operation.

Apply patch implementing HW flow control in BCM2835's mini UART and
indicate the RTS/CTS is wired in Yellow's device tree to enable using
the flow control for the Bluetooth interface. This greatly improves
stability of the Bluetooth interface, which started to be unstable with
kernel update to 6.18 in OS 18.0 and newer.

Fixes #4898
@sairon
sairon requested a review from agners August 10, 2026 15:52
@sairon sairon added linux Linux kernel related issue board/yellow Home Assistant Yellow bluetooth labels Aug 10, 2026
@coderabbitai

coderabbitai Bot commented Aug 10, 2026 •

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 3c863edc-f283-44cf-92f1-059b537cfc20

📥 Commits

Reviewing files that changed from the base of the PR and between e6c3221 and c9388f9.

📒 Files selected for processing (2)
  • buildroot-external/board/raspberrypi/patches/linux/0005-serial-8250_bcm2835aux-Add-support-for-RTS-CTS-auto-.patch
  • buildroot-external/board/raspberrypi/yellow/patches/linux/0005-ARM-dts-bcm2711-Enable-flow-control-on-uart1.patch

📝 Walkthrough

Walkthrough

The UART driver adds BCM2835 auxiliary UART RTS/CTS auto-flow control, throttling, and RS-485 coordination. The Yellow device tree declares RTS/CTS support for uart1.

Changes

UART hardware flow control

Layer / File(s) Summary
Driver capability and flow-control state
buildroot-external/board/raspberrypi/patches/linux/0005-serial-8250_bcm2835aux-Add-support-for-RTS-CTS-auto-.patch
The driver defines auto-flow configuration, detects uart-has-rtscts, and adds helpers to manage auto-RTS/CTS and RX interrupts.
TTY flow-control callbacks
buildroot-external/board/raspberrypi/patches/linux/0005-serial-8250_bcm2835aux-Add-support-for-RTS-CTS-auto-.patch
Custom modem-control, termios, throttle, and unthrottle handlers synchronize RTS/CTS state and remove unsupported software-only CRTSCTS.
RS-485 coordination and Yellow wiring
buildroot-external/board/raspberrypi/patches/linux/0005-serial-8250_bcm2835aux-Add-support-for-RTS-CTS-auto-.patch, buildroot-external/board/raspberrypi/yellow/patches/linux/0005-ARM-dts-bcm2711-Enable-flow-control-on-uart1.patch
RS-485 configuration disables auto-flow and restores RX when disabled. The Yellow device tree enables uart-has-rtscts for uart1.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant DeviceTree
  participant UARTDriver
  participant TTY
  participant UARTHardware
  DeviceTree->>UARTDriver: Declare uart1 RTS/CTS capability
  UARTDriver->>UARTHardware: Enable auto-RTS/CTS
  TTY->>UARTDriver: Request throttle or unthrottle
  UARTDriver->>UARTHardware: Disable or restore RX interrupts
  TTY->>UARTDriver: Configure RS-485
  UARTDriver->>UARTHardware: Disable auto-flow during RS-485
Loading

Possibly related PRs

Suggested reviewers: agners

Poem

I’m a rabbit by the UART line,
With RTS and CTS in time.
RX pauses, then wakes bright,
RS-485 keeps flow just right.
Yellow’s uart1 now hops along.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes enabling hardware flow control on Yellow's mini UART to improve Bluetooth stability.
Linked Issues check ✅ Passed The changes directly address issue [#4898] by enabling RTS/CTS flow control for Yellow's Bluetooth UART.
Out of Scope Changes check ✅ Passed The driver and device-tree changes are directly related to the linked issue and stated Bluetooth stability objective.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch yellow-enable-miniuart-flow-control

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@agners agners left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, LGTM!

@sairon
sairon merged commit 6538e48 into dev Aug 10, 2026
3 checks passed
@sairon
sairon deleted the yellow-enable-miniuart-flow-control branch August 10, 2026 18:35
@github-actions github-actions Bot locked and limited conversation to collaborators Aug 18, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

bluetooth board/yellow Home Assistant Yellow cla-signed linux Linux kernel related issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[HA Yellow] BLE fails regularly after upgrade from v17. 3 to 18.0

2 participants