summaryrefslogtreecommitdiffstats
path: root/drivers/acpi/spcr.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi/spcr.c')
-rw-r--r--drivers/acpi/spcr.c36
1 files changed, 26 insertions, 10 deletions
diff --git a/drivers/acpi/spcr.c b/drivers/acpi/spcr.c
index 98aa8c808a33..324b35bfe781 100644
--- a/drivers/acpi/spcr.c
+++ b/drivers/acpi/spcr.c
@@ -53,17 +53,24 @@ static bool qdf2400_erratum_44_present(struct acpi_table_header *h)
53 */ 53 */
54static bool xgene_8250_erratum_present(struct acpi_table_spcr *tb) 54static bool xgene_8250_erratum_present(struct acpi_table_spcr *tb)
55{ 55{
56 bool xgene_8250 = false;
57
56 if (tb->interface_type != ACPI_DBG2_16550_COMPATIBLE) 58 if (tb->interface_type != ACPI_DBG2_16550_COMPATIBLE)
57 return false; 59 return false;
58 60
59 if (memcmp(tb->header.oem_id, "APMC0D", ACPI_OEM_ID_SIZE)) 61 if (memcmp(tb->header.oem_id, "APMC0D", ACPI_OEM_ID_SIZE) &&
62 memcmp(tb->header.oem_id, "HPE ", ACPI_OEM_ID_SIZE))
60 return false; 63 return false;
61 64
62 if (!memcmp(tb->header.oem_table_id, "XGENESPC", 65 if (!memcmp(tb->header.oem_table_id, "XGENESPC",
63 ACPI_OEM_TABLE_ID_SIZE) && tb->header.oem_revision == 0) 66 ACPI_OEM_TABLE_ID_SIZE) && tb->header.oem_revision == 0)
64 return true; 67 xgene_8250 = true;
65 68
66 return false; 69 if (!memcmp(tb->header.oem_table_id, "ProLiant",
70 ACPI_OEM_TABLE_ID_SIZE) && tb->header.oem_revision == 1)
71 xgene_8250 = true;
72
73 return xgene_8250;
67} 74}
68 75
69/** 76/**
@@ -105,16 +112,17 @@ int __init parse_spcr(bool earlycon)
105 } 112 }
106 113
107 if (table->serial_port.space_id == ACPI_ADR_SPACE_SYSTEM_MEMORY) { 114 if (table->serial_port.space_id == ACPI_ADR_SPACE_SYSTEM_MEMORY) {
108 switch (table->serial_port.access_width) { 115 switch (ACPI_ACCESS_BIT_WIDTH((
116 table->serial_port.access_width))) {
109 default: 117 default:
110 pr_err("Unexpected SPCR Access Width. Defaulting to byte size\n"); 118 pr_err("Unexpected SPCR Access Width. Defaulting to byte size\n");
111 case ACPI_ACCESS_SIZE_BYTE: 119 case 8:
112 iotype = "mmio"; 120 iotype = "mmio";
113 break; 121 break;
114 case ACPI_ACCESS_SIZE_WORD: 122 case 16:
115 iotype = "mmio16"; 123 iotype = "mmio16";
116 break; 124 break;
117 case ACPI_ACCESS_SIZE_DWORD: 125 case 32:
118 iotype = "mmio32"; 126 iotype = "mmio32";
119 break; 127 break;
120 } 128 }
@@ -181,11 +189,19 @@ int __init parse_spcr(bool earlycon)
181 uart = "qdf2400_e44"; 189 uart = "qdf2400_e44";
182 } 190 }
183 191
184 if (xgene_8250_erratum_present(table)) 192 if (xgene_8250_erratum_present(table)) {
185 iotype = "mmio32"; 193 iotype = "mmio32";
186 194
187 snprintf(opts, sizeof(opts), "%s,%s,0x%llx,%d", uart, iotype, 195 /* for xgene v1 and v2 we don't know the clock rate of the
188 table->serial_port.address, baud_rate); 196 * UART so don't attempt to change to the baud rate state
197 * in the table because driver cannot calculate the dividers
198 */
199 snprintf(opts, sizeof(opts), "%s,%s,0x%llx", uart, iotype,
200 table->serial_port.address);
201 } else {
202 snprintf(opts, sizeof(opts), "%s,%s,0x%llx,%d", uart, iotype,
203 table->serial_port.address, baud_rate);
204 }
189 205
190 pr_info("console: %s\n", opts); 206 pr_info("console: %s\n", opts);
191 207