]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
ACPI: SPCR: Support Precise Baud Rate field
authorChen Pei <cp0613@linux.alibaba.com>
Sat, 13 Sep 2025 07:08:15 +0000 (15:08 +0800)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 22 Sep 2025 17:13:08 +0000 (19:13 +0200)
The Microsoft Serial Port Console Redirection (SPCR) specification
revision 1.09 comprises additional field: Precise Baud Rate [1].

It is used to describe non-traditional baud rates (such as those
used by high-speed UARTs).

It contains a specific non-zero baud rate which overrides the value
of the Configured Baud Rate field. If this field is zero or not
present, Configured Baud Rate is used.

Link: https://learn.microsoft.com/en-us/windows-hardware/drivers/serports/serial-port-console-redirection-table
Signed-off-by: Chen Pei <cp0613@linux.alibaba.com>
Link: https://patch.msgid.link/20250913070815.16758-1-cp0613@linux.alibaba.com
[ rjw: Corrected typo in the subject ]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/acpi/spcr.c

index 208d6bbc65e0378d3d4d0cc7281f8000f8744908..d4d52d5e9016ca8278e99c9fd81b48c85510d3be 100644 (file)
@@ -149,7 +149,15 @@ int __init acpi_parse_spcr(bool enable_earlycon, bool enable_console)
                goto done;
        }
 
-       switch (table->baud_rate) {
+       /*
+        * SPCR 1.09 defines Precise Baud Rate Filed contains a specific
+        * non-zero baud rate which overrides the value of the Configured
+        * Baud Rate field. If this field is zero or not present, Configured
+        * Baud Rate is used.
+        */
+       if (table->precise_baudrate)
+               baud_rate = table->precise_baudrate;
+       else switch (table->baud_rate) {
        case 0:
                /*
                 * SPCR 1.04 defines 0 as a preconfigured state of UART.