Re: [PATCH RESEND v2 1/2] serial: earlycon: add uart_clk_freq parameter
From: Geert Uytterhoeven
Date: Tue Jun 09 2026 - 02:54:54 EST
Hi Markus,
On Tue, 9 Jun 2026 at 00:40, Markus Probst <markus.probst@xxxxxxxxx> wrote:
> Add `uart_clk_freq` parameter to `setup_earlycon`. This allows the
> options string to be reused with `add_preferred_console`, while still
> allowing to set the uart clock frequency. This will be used in the
> following commit ("ACPI: SPCR: Support UART clock frequency field").
>
> No logical change intended.
>
> Signed-off-by: Markus Probst <markus.probst@xxxxxxxxx>
> --- a/drivers/tty/serial/earlycon.c
> +++ b/drivers/tty/serial/earlycon.c
> @@ -135,11 +135,14 @@ static int __init parse_options(struct earlycon_device *device, char *options)
> return 0;
> }
>
> -static int __init register_earlycon(char *buf, const struct earlycon_id *match)
> +static int __init register_earlycon(char *buf, unsigned int uart_clk_freq,
> + const struct earlycon_id *match)
> {
> int err;
> struct uart_port *port = &early_console_dev.port;
>
> + port->uartclk = uart_clk_freq;
Who is actually consuming this value?
Earlycon typically works with the serial console, as configured before
Linux boot by the firmware.
The Microsoft doc referenced in patch 2 seem to agree with that:
"On a system where the BIOS or system firmware uses the serial
port for console input/output, this table should be used to convey
information about the settings, to ensure a seamless transition
between the firmware console output and Windows EMS output."
> +
> /* On parsing error, pass the options buf to the setup function */
> if (buf && !parse_options(&early_console_dev, buf))
> buf = NULL;
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds