Skip to content

lib: utils/serial: Add ARM PL011 UART driver - #17

Merged
cp0613 merged 1 commit into
XUANTIE-RV:opensbi-v1.7-devfrom
cp0613:opensbi-v1.7-dev
Aug 19, 2026
Merged

lib: utils/serial: Add ARM PL011 UART driver#17
cp0613 merged 1 commit into
XUANTIE-RV:opensbi-v1.7-devfrom
cp0613:opensbi-v1.7-dev

Conversation

@cp0613

@cp0613 cp0613 commented Aug 19, 2026

Copy link
Copy Markdown
Collaborator

OpenSBI has no driver for the ARM PrimeCell PL011 UART, so platforms that expose a PL011 as their console (for example a QEMU RISC-V virt machine wired with an "arm,pl011" serial port) cannot use it as the firmware console.

Add a polled MMIO PL011 driver modelled on the existing cadence-uart driver, together with an FDT glue driver matching "arm,pl011" and "arm,sbsa-uart", and wire it into the generic platform via a new FDT_SERIAL_PL011 / SERIAL_PL011 Kconfig pair enabled in the generic defconfig.

The baud-rate divisors are only programmed when both the input clock frequency and the target baud rate are known; on platforms that do not expose "clock-frequency" (such as QEMU) the divisor registers are left untouched, matching the cadence-uart behaviour. The MMIO window is registered with the root domain so the console keeps working under domain isolation.

OpenSBI has no driver for the ARM PrimeCell PL011 UART, so platforms
that expose a PL011 as their console (for example a QEMU RISC-V virt
machine wired with an "arm,pl011" serial port) cannot use it as the
firmware console.

Add a polled MMIO PL011 driver modelled on the existing cadence-uart
driver, together with an FDT glue driver matching "arm,pl011" and
"arm,sbsa-uart", and wire it into the generic platform via a new
FDT_SERIAL_PL011 / SERIAL_PL011 Kconfig pair enabled in the generic
defconfig.

The baud-rate divisors are only programmed when both the input clock
frequency and the target baud rate are known; on platforms that do not
expose "clock-frequency" (such as QEMU) the divisor registers are left
untouched, matching the cadence-uart behaviour. The MMIO window is
registered with the root domain so the console keeps working under
domain isolation.

Signed-off-by: Chen Pei <cp0613@linux.alibaba.com>
@cp0613
cp0613 merged commit 25e5f84 into XUANTIE-RV:opensbi-v1.7-dev Aug 19, 2026
1 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant