lib: utils/serial: Add ARM PL011 UART driver - #17
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.