diff mbox series

[v1,3/3] x86: acpi: Let OS know that console already had been initialized

Message ID 20200227152156.87385-3-andriy.shevchenko@linux.intel.com
State Accepted
Commit 98036fbdaf0ac1d6dc3ab3cb6db24c020bb65d6f
Delegated to: Bin Meng
Headers show
Series [v1,1/3] dm: serial: Add clock member to struct serial_device_info | expand

Commit Message

Andy Shevchenko Feb. 27, 2020, 3:21 p.m. UTC
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>
---
 arch/x86/lib/acpi_table.c | 9 +++++++++
 1 file changed, 9 insertions(+)

Comments

Bin Meng April 15, 2020, 2:20 p.m. UTC | #1
On Thu, Feb 27, 2020 at 11:22 PM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
>
> 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>
> ---
>  arch/x86/lib/acpi_table.c | 9 +++++++++
>  1 file changed, 9 insertions(+)
>

Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Bin Meng April 15, 2020, 2:27 p.m. UTC | #2
On Wed, Apr 15, 2020 at 10:20 PM Bin Meng <bmeng.cn@gmail.com> wrote:
>
> On Thu, Feb 27, 2020 at 11:22 PM Andy Shevchenko
> <andriy.shevchenko@linux.intel.com> wrote:
> >
> > 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>
> > ---
> >  arch/x86/lib/acpi_table.c | 9 +++++++++
> >  1 file changed, 9 insertions(+)
> >
>
> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

applied to u-boot-x86, thanks!
diff mbox series

Patch

diff --git a/arch/x86/lib/acpi_table.c b/arch/x86/lib/acpi_table.c
index 66e32f21bd..074987e294 100644
--- a/arch/x86/lib/acpi_table.c
+++ b/arch/x86/lib/acpi_table.c
@@ -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);
 }