]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
ACPI: SPCR: work around clock issue on xgene UART
authorGraeme Gregory <graeme.gregory@linaro.org>
Fri, 4 Aug 2017 21:49:44 +0000 (22:49 +0100)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Wed, 16 Aug 2017 16:16:46 +0000 (18:16 +0200)
xgene v1/v2 8250 UARTs don't run at the standard clock rate expected by
the driver and there is no information on clocking available from the
SPCR table. As there has been no progress on relevant vendors updating
DBG2/SPCR specifications to fix this work around this using the previous
xgene quirk handling to avoid setting a baud rate and therefore using
the UART as configured by firmware.

Signed-off-by: Graeme Gregory <graeme.gregory@linaro.org>
Tested-by: Mark Salter <msalter@redhat.com>
Reviewed-by: Mark Salter <msalter@redhat.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/acpi/spcr.c

index 2c156941b371d701f48e0df8d223f27204fa3a37..40a56b538b9fe4e96ee9628947b5c2e02f7a7421 100644 (file)
@@ -188,11 +188,19 @@ int __init parse_spcr(bool earlycon)
                        uart = "qdf2400_e44";
        }
 
-       if (xgene_8250_erratum_present(table))
+       if (xgene_8250_erratum_present(table)) {
                iotype = "mmio32";
 
-       snprintf(opts, sizeof(opts), "%s,%s,0x%llx,%d", uart, iotype,
-                table->serial_port.address, baud_rate);
+               /* for xgene v1 and v2 we don't know the clock rate of the
+                * UART so don't attempt to change to the baud rate state
+                * in the table because driver cannot calculate the dividers
+                */
+               snprintf(opts, sizeof(opts), "%s,%s,0x%llx", uart, iotype,
+                        table->serial_port.address);
+       } else {
+               snprintf(opts, sizeof(opts), "%s,%s,0x%llx,%d", uart, iotype,
+                        table->serial_port.address, baud_rate);
+       }
 
        pr_info("console: %s\n", opts);