drivers/acpi/spcr.c | 3 +++ 1 file changed, 3 insertions(+)
The Microsoft Serial Port Console Redirection (SPCR) specification
revision 1.08 comprises additional field: UART Clock Frequency [1].
It contains a non-zero value indicating the UART clock frequency in Hz.
Link: https://learn.microsoft.com/en-us/windows-hardware/drivers/serports/serial-port-console-redirection-table [1]
Signed-off-by: Markus Probst <markus.probst@posteo.de>
---
drivers/acpi/spcr.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/acpi/spcr.c b/drivers/acpi/spcr.c
index 73cb933fdc89..d80ad87efae0 100644
--- a/drivers/acpi/spcr.c
+++ b/drivers/acpi/spcr.c
@@ -220,6 +220,9 @@ int __init acpi_parse_spcr(bool enable_earlycon, bool enable_console)
if (!baud_rate) {
snprintf(opts, sizeof(opts), "%s,%s,0x%llx", uart, iotype,
table->serial_port.address);
+ } else if (table->header.revision >= 3 && table->uart_clk_freq) {
+ snprintf(opts, sizeof(opts), "%s,%s,0x%llx,%d,%u", uart, iotype,
+ table->serial_port.address, baud_rate, table->uart_clk_freq);
} else {
snprintf(opts, sizeof(opts), "%s,%s,0x%llx,%d", uart, iotype,
table->serial_port.address, baud_rate);
---
base-commit: 9e0898f1c0f134c6bad146ca8578f73c3e40ac0a
change-id: 20260430-acpi_spcr-61902fd923f2
On Tue, May 5, 2026 at 9:36 PM Markus Probst <markus.probst@posteo.de> wrote:
>
> The Microsoft Serial Port Console Redirection (SPCR) specification
> revision 1.08 comprises additional field: UART Clock Frequency [1].
>
> It contains a non-zero value indicating the UART clock frequency in Hz.
>
> Link: https://learn.microsoft.com/en-us/windows-hardware/drivers/serports/serial-port-console-redirection-table [1]
> Signed-off-by: Markus Probst <markus.probst@posteo.de>
> ---
> drivers/acpi/spcr.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/acpi/spcr.c b/drivers/acpi/spcr.c
> index 73cb933fdc89..d80ad87efae0 100644
> --- a/drivers/acpi/spcr.c
> +++ b/drivers/acpi/spcr.c
> @@ -220,6 +220,9 @@ int __init acpi_parse_spcr(bool enable_earlycon, bool enable_console)
> if (!baud_rate) {
> snprintf(opts, sizeof(opts), "%s,%s,0x%llx", uart, iotype,
> table->serial_port.address);
> + } else if (table->header.revision >= 3 && table->uart_clk_freq) {
> + snprintf(opts, sizeof(opts), "%s,%s,0x%llx,%d,%u", uart, iotype,
> + table->serial_port.address, baud_rate, table->uart_clk_freq);
> } else {
> snprintf(opts, sizeof(opts), "%s,%s,0x%llx,%d", uart, iotype,
> table->serial_port.address, baud_rate);
>
> ---
Please have a look at the sashiko.dev feedback at
https://sashiko.dev/#/patchset/20260505-acpi_spcr-v1-1-fd4bc6f4eb53%40posteo.de
and let me know what you think.
On Fri, 2026-05-08 at 21:19 +0200, Rafael J. Wysocki wrote:
> On Tue, May 5, 2026 at 9:36 PM Markus Probst <markus.probst@posteo.de> wrote:
> >
> > The Microsoft Serial Port Console Redirection (SPCR) specification
> > revision 1.08 comprises additional field: UART Clock Frequency [1].
> >
> > It contains a non-zero value indicating the UART clock frequency in Hz.
> >
> > Link: https://learn.microsoft.com/en-us/windows-hardware/drivers/serports/serial-port-console-redirection-table [1]
> > Signed-off-by: Markus Probst <markus.probst@posteo.de>
> > ---
> > drivers/acpi/spcr.c | 3 +++
> > 1 file changed, 3 insertions(+)
> >
> > diff --git a/drivers/acpi/spcr.c b/drivers/acpi/spcr.c
> > index 73cb933fdc89..d80ad87efae0 100644
> > --- a/drivers/acpi/spcr.c
> > +++ b/drivers/acpi/spcr.c
> > @@ -220,6 +220,9 @@ int __init acpi_parse_spcr(bool enable_earlycon, bool enable_console)
> > if (!baud_rate) {
> > snprintf(opts, sizeof(opts), "%s,%s,0x%llx", uart, iotype,
> > table->serial_port.address);
> > + } else if (table->header.revision >= 3 && table->uart_clk_freq) {
> > + snprintf(opts, sizeof(opts), "%s,%s,0x%llx,%d,%u", uart, iotype,
> > + table->serial_port.address, baud_rate, table->uart_clk_freq);
> > } else {
> > snprintf(opts, sizeof(opts), "%s,%s,0x%llx,%d", uart, iotype,
> > table->serial_port.address, baud_rate);
> >
> > ---
>
> Please have a look at the sashiko.dev feedback at
>
> https://sashiko.dev/#/patchset/20260505-acpi_spcr-v1-1-fd4bc6f4eb53%40posteo.de
>
> and let me know what you think.
For the first comment, I don't think thats an issue, as there is no
length check for the other fields either.
The second comment however seems true.
while earlycon parses
<baudrate>,<uartclk>
regular uart parses
<baudrate><parity><bits><flow>
This is strange, because according to kernel documentation, options for
uart should be identical for earlycon and console kernel parameters.
[1] [2].
Thanks
- Markus Probst
[1]
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/tty/serial/serial_core.c?h=v7.1-rc1#n2097
[2]
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/admin-guide/kernel-parameters.txt?h=v7.1-rc1#n1451
On Sat, 2026-05-09 at 08:13 +0200, Markus Probst wrote:
> On Fri, 2026-05-08 at 21:19 +0200, Rafael J. Wysocki wrote:
> > On Tue, May 5, 2026 at 9:36 PM Markus Probst <markus.probst@posteo.de> wrote:
> > >
> > > The Microsoft Serial Port Console Redirection (SPCR) specification
> > > revision 1.08 comprises additional field: UART Clock Frequency [1].
> > >
> > > It contains a non-zero value indicating the UART clock frequency in Hz.
> > >
> > > Link: https://learn.microsoft.com/en-us/windows-hardware/drivers/serports/serial-port-console-redirection-table [1]
> > > Signed-off-by: Markus Probst <markus.probst@posteo.de>
> > > ---
> > > drivers/acpi/spcr.c | 3 +++
> > > 1 file changed, 3 insertions(+)
> > >
> > > diff --git a/drivers/acpi/spcr.c b/drivers/acpi/spcr.c
> > > index 73cb933fdc89..d80ad87efae0 100644
> > > --- a/drivers/acpi/spcr.c
> > > +++ b/drivers/acpi/spcr.c
> > > @@ -220,6 +220,9 @@ int __init acpi_parse_spcr(bool enable_earlycon, bool enable_console)
> > > if (!baud_rate) {
> > > snprintf(opts, sizeof(opts), "%s,%s,0x%llx", uart, iotype,
> > > table->serial_port.address);
> > > + } else if (table->header.revision >= 3 && table->uart_clk_freq) {
> > > + snprintf(opts, sizeof(opts), "%s,%s,0x%llx,%d,%u", uart, iotype,
> > > + table->serial_port.address, baud_rate, table->uart_clk_freq);
> > > } else {
> > > snprintf(opts, sizeof(opts), "%s,%s,0x%llx,%d", uart, iotype,
> > > table->serial_port.address, baud_rate);
> > >
> > > ---
> >
> > Please have a look at the sashiko.dev feedback at
> >
> > https://sashiko.dev/#/patchset/20260505-acpi_spcr-v1-1-fd4bc6f4eb53%40posteo.de
> >
> > and let me know what you think.
> For the first comment, I don't think thats an issue, as there is no
> length check for the other fields either.
>
>
> The second comment however seems true.
>
> while earlycon parses
>
> <baudrate>,<uartclk>
>
> regular uart parses
>
> <baudrate><parity><bits><flow>
>
> This is strange, because according to kernel documentation, options for
> uart should be identical for earlycon and console kernel parameters.
> [1] [2].
I might have misinterpreted the documentation here. That uartclk only
existing on earlycon seems to be intended. Feel free to ignore the last
paragraph of my reply.
Thanks
- Markus Probst
© 2016 - 2026 Red Hat, Inc.