Skip to content

Commit 304484b

Browse files
timg236popcornmix
authored andcommitted
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. The firmware driver is designed to support 19200 baud. Higher rates up to 115200 seem to work but there may be more jitter. 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 834f328 commit 304484b

File tree

3 files changed

+574
-0
lines changed

3 files changed

+574
-0
lines changed

drivers/tty/serial/Kconfig

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1600,6 +1600,17 @@ config SERIAL_ESP32_ACM
16001600
snippet may be used:
16011601
earlycon=esp32s3acm,mmio32,0x60038000
16021602

1603+
config SERIAL_RPI_FW
1604+
tristate "Raspberry Pi Firmware software UART support"
1605+
depends on RASPBERRYPI_FIRMWARE || COMPILE_TEST
1606+
select SERIAL_CORE
1607+
help
1608+
This selects the Raspberry Pi firmware UART. This is a bit-bashed
1609+
implementation running on the Raspbery Pi VPU core.
1610+
This is not supported on Raspberry Pi 5 or newer platforms.
1611+
1612+
If unsure, say N.
1613+
16031614
endmenu
16041615

16051616
config SERIAL_MCTRL_GPIO

drivers/tty/serial/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ obj-$(CONFIG_SERIAL_QCOM_GENI) += qcom_geni_serial.o
7171
obj-$(CONFIG_SERIAL_QE) += ucc_uart.o
7272
obj-$(CONFIG_SERIAL_RDA) += rda-uart.o
7373
obj-$(CONFIG_SERIAL_RP2) += rp2.o
74+
obj-$(CONFIG_SERIAL_RPI_FW) += rpi-fw-uart.o
7475
obj-$(CONFIG_SERIAL_SA1100) += sa1100.o
7576
obj-$(CONFIG_SERIAL_SAMSUNG) += samsung_tty.o
7677
obj-$(CONFIG_SERIAL_SB1250_DUART) += sb1250-duart.o

0 commit comments

Comments
 (0)