Kernel bug / UART

uart_pl011: no baud clock on Raspberry Pi, no RTS/CTS

The Bluetooth chip wakes up and says hello. The UART cannot change speed to answer.

A bug under a magnifying glass.
Component
sys/dev/uart/uart_dev_pl011.c
Found on
Raspberry Pi Zero 2 W, 15.1-RELEASE-p7
Status
Drafted
Written

uart_pl011_param() writes the baud divisor only when the driver knows the reference clock (rclk). It takes that from a clock-frequency property (a FreeBSD extension) or the parent's bus-frequency. The Raspberry Pi device tree, and FreeBSD's own bcm283x.dtsi, name the clock only through clocks, which nothing in sys/dev/uart reads. On a booted Zero 2 W:

# sysctl dev.uart.0.rclk
dev.uart.0.rclk: 0

The UART keeps whatever speed the firmware left and ignores speed changes. The driver also has no hardware RTS/CTS, which the Bluetooth chip expects at high speeds. Together they are why Bluetooth is stuck. The report is drafted for Base System / kern, without a patch.

All kernel bugs

Built with ssg