Skip to content

Commit 5883150

Browse files
committed
serial: tty: Add a driver for the RPi firmware UART
On Raspberry Pi 4 and earlier models the firmware provides a low speed (up to 115200 baud) bit-bashed UART on arbitrary GPIOs using the second VPU core. This has only been properly tested at 9600. Higher rates appear to work but YMMV. This can be useful for debug or managing additional low speed peripherals if the hardware PL011 and 8250 hardware UARTs are already used for console / bluetooth. The firmware driver requires a fixed core clock frequency and also requires the VPU PWM audio driver to be disabled (dtparam=audio=off) Runtime configuration is handled via the vc-mailbox APIs with the FIFO buffers being allocated in uncached VPU addressable memory. The FIFO pointers are stored in spare VideoCore multi-core sync registers in order to reduce the number of uncached SDRAM accesses thereby reducing jitter. Signed-off-by: Tim Gover <tim.gover@raspberrypi.com>
1 parent adb7163 commit 5883150

File tree

3 files changed

+575
-0
lines changed

3 files changed

+575
-0
lines changed

drivers/tty/serial/Kconfig

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1578,6 +1578,17 @@ config SERIAL_NUVOTON_MA35D1_CONSOLE
15781578
but you can alter that using a kernel command line option such as
15791579
"console=ttyNVTx".
15801580

1581+
config SERIAL_RPI_FW
1582+
tristate "Raspberry Pi Firmware software UART support"
1583+
depends on ARM_AMBA || COMPILE_TEST
1584+
select SERIAL_CORE
1585+
help
1586+
This selects the Raspberry Pi firmware UART. This is a bit-bashed
1587+
implementation running on the Raspbery Pi VPU core.
1588+
This is not supported on Raspberry Pi 5 or newer platforms.
1589+
1590+
If unsure, say N.
1591+
15811592
endmenu
15821593

15831594
config SERIAL_MCTRL_GPIO

drivers/tty/serial/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ obj-$(CONFIG_SERIAL_MILBEAUT_USIO) += milbeaut_usio.o
8888
obj-$(CONFIG_SERIAL_SIFIVE) += sifive.o
8989
obj-$(CONFIG_SERIAL_LITEUART) += liteuart.o
9090
obj-$(CONFIG_SERIAL_SUNPLUS) += sunplus-uart.o
91+
obj-$(CONFIG_SERIAL_RPI_FW) += rpi-fw-uart.o
9192

9293
# GPIOLIB helpers for modem control lines
9394
obj-$(CONFIG_SERIAL_MCTRL_GPIO) += serial_mctrl_gpio.o

0 commit comments

Comments
 (0)