mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
tty: pl011: Work around QDF2400 E44 stuck BUSY bit
The Qualcomm Datacenter Technologies QDF2400 family of SoCs contains a custom (non-PrimeCell) implementation of the SBSA UART. Occasionally the BUSY bit in the Flag Register gets stuck as 1, erratum 44 for both 2432v1 and 2400v1 SoCs.Checking that the Transmit FIFO Empty (TXFE) bit is 0, instead of checking that the BUSY bit is 1, works around the issue. To facilitate this substitution of flags and values, introduce vendor-specific inversion of Feature Register bits when UART AMBA Port (UAP) data is available. For the earlycon case, prior to UAP availability, implement alternative putc and early_write functions. Similar to what how ARMv8 ACPI PCI quirks are detected during MCFG parsing, check the OEM fields of the Serial Port Console Redirection (SPCR) ACPI table to determine if the current platform is known to be affected by the erratum. Signed-off-by: Christopher Covington <[email protected]> Acked-by: Russell King <[email protected]> Acked-by: Timur Tabi <[email protected]> Acked-by: Mark Rutland <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
This commit is contained in:
parent
2867af2dcf
commit
d8a4995bce
2 changed files with 82 additions and 7 deletions
|
|
@ -16,6 +16,26 @@
|
|||
#include <linux/kernel.h>
|
||||
#include <linux/serial_core.h>
|
||||
|
||||
/*
|
||||
* Some Qualcomm Datacenter Technologies SoCs have a defective UART BUSY bit.
|
||||
* Detect them by examining the OEM fields in the SPCR header, similiar to PCI
|
||||
* quirk detection in pci_mcfg.c.
|
||||
*/
|
||||
static bool qdf2400_erratum_44_present(struct acpi_table_header *h)
|
||||
{
|
||||
if (memcmp(h->oem_id, "QCOM ", ACPI_OEM_ID_SIZE))
|
||||
return false;
|
||||
|
||||
if (!memcmp(h->oem_table_id, "QDF2432 ", ACPI_OEM_TABLE_ID_SIZE))
|
||||
return true;
|
||||
|
||||
if (!memcmp(h->oem_table_id, "QDF2400 ", ACPI_OEM_TABLE_ID_SIZE) &&
|
||||
h->oem_revision == 0)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* parse_spcr() - parse ACPI SPCR table and add preferred console
|
||||
*
|
||||
|
|
@ -93,6 +113,9 @@ int __init parse_spcr(bool earlycon)
|
|||
goto done;
|
||||
}
|
||||
|
||||
if (qdf2400_erratum_44_present(&table->header))
|
||||
uart = "qdf2400_e44";
|
||||
|
||||
snprintf(opts, sizeof(opts), "%s,%s,0x%llx,%d", uart, iotype,
|
||||
table->serial_port.address, baud_rate);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue