1 From 56cc31513311b73874e05d23e2429bf31e1441c2 Mon Sep 17 00:00:00 2001
2 From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
3 Date: Wed, 21 Nov 2018 15:43:37 +0200
4 Subject: ACPI: SPCR: Consider baud rate 0 as preconfigured state
6 [ Upstream commit b413b1abeb21b4a152c0bf8d1379efa30759b6e3 ]
8 Since SPCR 1.04 [1] the baud rate of 0 means a preconfigured state of UART.
9 Assume firmware or bootloader configures console correctly.
11 [1]: https://docs.microsoft.com/en-us/windows-hardware/drivers/serports/serial-port-console-redirection-table
13 Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
14 Reviewed-by: Prarit Bhargava <prarit@redhat.com>
15 Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
16 Signed-off-by: Sasha Levin <sashal@kernel.org>
18 drivers/acpi/spcr.c | 11 +++++++++++
19 1 file changed, 11 insertions(+)
21 diff --git a/drivers/acpi/spcr.c b/drivers/acpi/spcr.c
22 index 324b35bfe781..f567fa5f0148 100644
23 --- a/drivers/acpi/spcr.c
24 +++ b/drivers/acpi/spcr.c
25 @@ -148,6 +148,13 @@ int __init parse_spcr(bool earlycon)
28 switch (table->baud_rate) {
31 + * SPCR 1.04 defines 0 as a preconfigured state of UART.
32 + * Assume firmware or bootloader configures console correctly.
39 @@ -196,6 +203,10 @@ int __init parse_spcr(bool earlycon)
40 * UART so don't attempt to change to the baud rate state
41 * in the table because driver cannot calculate the dividers
47 snprintf(opts, sizeof(opts), "%s,%s,0x%llx", uart, iotype,
48 table->serial_port.address);