[PATCH RFC 00/12] Add BL808 UART3 support with a Rust serial-core polling console
From: Kwanghoon Son
Date: Thu Oct 29 2026 - 01:09:37 EST
Introduce minimal Rust serial-core abstractions and a single UART3 polling
printk console for the BL808 D0 and Sipeed M1s Dock.
The BL808 is a RISC-V SoC used in boards such as the Sipeed M1s Dock
and PINE64 Ox64 [1].
The serial abstractions and their BL808 consumer are adjacent patches.
Port registration is owned and device-managed. The adapters provide UART
locking for termios changes and normal console writes. Userspace TTY I/O,
RX, interrupt-driven transfers and DMA are not included.
I kept the driver limited to polling console output for now, so the
initial driver and Rust abstractions stay small. Does this seem like a
reasonable starting point?
The Rust abstractions cover only what this driver needs. Is there
anything missing that should be addressed at this stage? I'd especially
appreciate feedback on the port ownership and locking interfaces.
UART3 is registered as ttyBFLB0, using line 0 of a one-port driver. The
board selects it through a full stdout-path at 115200 8N1 without aliases.
Firmware initializes clock routing, gates, reset and pinmux; the board
provides the existing 40 MHz fixed baud clock.
Jisheng Zhang previously submitted BL808 platform support with a C UART
driver in 2023 [2]. The UART compatible, bflb,uart, is reused from
Zephyr [3].
This series depends on the exclusive MMIO reservation fix posted at [4].
[1] https://pine64.org/devices/ox64/
[2] https://lore.kernel.org/r/20230518152244.2178-5-jszhang@xxxxxxxxxx/
[3] https://docs.zephyrproject.org/latest/build/dts/api/bindings/serial/bflb,uart.html
[4] https://lore.kernel.org/rust-for-linux/20261027-b4-rust-iomem-origin-master-fix-v1-1-16215ae197af@xxxxxxxxx/T/#u
---
Kwanghoon Son (12):
dt-bindings: vendor-prefixes: Add Bouffalo Lab
dt-bindings: interrupt-controller: Add BL808 PLIC
dt-bindings: timer: Add BL808 CLINT
dt-bindings: riscv: Add Bouffalo Lab BL808
dt-bindings: serial: Add BL808 UART
rust: serial: Add minimal serial-core polling console support
serial: bflb: Add Rust BL808 polling console
riscv: Add Bouffalo Lab SoC selection
riscv: dts: bouffalolab: Add BL808 SoC
riscv: dts: bouffalolab: Add Sipeed M1s Dock
riscv: defconfig: Enable Bouffalo Lab SoCs
MAINTAINERS: Add Bouffalo Lab BL808 support
.../interrupt-controller/sifive,plic-1.0.0.yaml | 1 +
Documentation/devicetree/bindings/riscv/bflb.yaml | 21 +
.../devicetree/bindings/serial/bflb,uart.yaml | 57 +++
.../devicetree/bindings/timer/sifive,clint.yaml | 1 +
.../devicetree/bindings/vendor-prefixes.yaml | 2 +
MAINTAINERS | 13 +
arch/riscv/Kconfig.socs | 8 +
arch/riscv/boot/dts/Makefile | 1 +
arch/riscv/boot/dts/bouffalolab/Makefile | 2 +
.../boot/dts/bouffalolab/bl808-sipeed-m1s-dock.dts | 18 +
.../boot/dts/bouffalolab/bl808-sipeed-m1s.dtsi | 19 +
arch/riscv/boot/dts/bouffalolab/bl808.dtsi | 70 +++
arch/riscv/configs/defconfig | 1 +
drivers/tty/serial/Kconfig | 16 +
drivers/tty/serial/Makefile | 2 +
drivers/tty/serial/bflb_uart.rs | 334 ++++++++++++++
rust/bindings/bindings_helper.h | 2 +
rust/helpers/helpers.c | 3 +
rust/helpers/serial.c | 33 ++
rust/kernel/lib.rs | 2 +
rust/kernel/serial.rs | 505 +++++++++++++++++++++
rust/kernel/serial/console.rs | 107 +++++
rust/kernel/serial/termios.rs | 104 +++++
23 files changed, 1322 insertions(+)
---
base-commit: b7ac81a9d691d0af65a5e1d3e16ef03d5dc8f2b4
change-id: 20261025-rust-bl808-console-1fbe1af3434d
Best regards,
--
Kwanghoon Son <asdfkwang@xxxxxxxxx>