Re: [PATCH] serial: amba-pl011: Enable UART in earlycon setup
From: Arnd Bergmann
Date: Tue Feb 10 2026 - 08:23:12 EST
On Tue, Feb 10, 2026, at 13:50, Peter Maydell wrote:
> Currently the PL011 driver only enables the UART (by setting UARTEN
> in REG_CR) in pl011_startup(), so if it is used for earlycon it is
> relying on the bootrom/firmware having left the UART enabled.
>
> There's no particular reason not to actively enable the UART before
> using it for earlycon, and the earlycon handling for e.g. the 8250
> UART sets up the UART in its setup function, so follow that in the
> PL011.
>
> This allows use of earlycon with a UART that the firmware hasn't
> already been using for its own output, but the main motivation is
> that QEMU will otherwise log a message complaining that the guest is
> trying to write to a UART it never enabled.
>
> Signed-off-by: Peter Maydell <peter.maydell@xxxxxxxxxx>
> ---
> NB: I have tested this under QEMU, but I do not have any real
> PL011-using hardware to hand to test with.
Looks good to me,
Acked-by: Arnd Bergmann <arnd@xxxxxxxx>
One more question: what is the symptom without this patch with
qemu? You mentioned on IRC that qemu may warn about attempting
to write to the uart when it is disabled. Would we still get
the correct early console output before the uart is enabled?
Arnd