x86: acpi: Let OS know that console already had been initialized
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Thu, 27 Feb 2020 15:21:56 +0000 (17:21 +0200)
committerBin Meng <bmeng.cn@gmail.com>
Thu, 16 Apr 2020 06:36:28 +0000 (14:36 +0800)
SPCR has no clue if the UART base clock speed is different to
the default one. However, the SPCR 1.04 defines baud rate 0 as
a preconfigured state of UART and OS is supposed not to touch
the configuration of the serial device.

Linux kernel supports that starting from v5.0, see commit
b413b1abeb21 ("ACPI: SPCR: Consider baud rate 0 as preconfigured state")
for the details.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
arch/x86/lib/acpi_table.c

index 66e32f21bdbd84643bcabbe8dc77d515ed91a917..074987e29433929b49c8339ca2fd235a3c6cf91c 100644 (file)
@@ -471,6 +471,15 @@ static void acpi_create_spcr(struct acpi_spcr *spcr)
        spcr->pci_device_id = 0xffff;
        spcr->pci_vendor_id = 0xffff;
 
+       /*
+        * SPCR has no clue if the UART base clock speed is different
+        * to the default one. However, the SPCR 1.04 defines baud rate
+        * 0 as a preconfigured state of UART and OS is supposed not
+        * to touch the configuration of the serial device.
+        */
+       if (serial_info.clock != SERIAL_DEFAULT_CLOCK)
+               spcr->baud_rate = 0;
+
        /* Fix checksum */
        header->checksum = table_compute_checksum((void *)spcr, header->length);
 }