Skip to contentSkip to conversation

ACPI / LPSS: fix UART Auto Flow Control

PATCH In review Heikki Krogerus 2 participants 4 messages Oct 9, 2013 – Oct 10, 2013 ACPI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ACPI / LPSS: fix UART Auto Flow Control

There is an additional bit in the GENERAL register on newer silicon that needs to be set or UART's RTS pin fails to reflect the flow control settings in the Modem Control Register.

This will fix an issue where the RTS pin of the UART stays always at 1.8V, regardless of the register settings.

---
 drivers/acpi/acpi_lpss.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)
drivers/acpi/acpi_lpss.c +9 -3
index fb78bb9..d396101 100644
@@ -30,6 +30,7 @@ ACPI_MODULE_NAME("acpi_lpss");
 /* Offsets relative to LPSS_PRIVATE_OFFSET */
 #define LPSS_GENERAL			0x08
 #define LPSS_GENERAL_LTR_MODE_SW	BIT(2)
+#define LPSS_GENERAL_UART_RTS_OVRD	BIT(3)
 #define LPSS_SW_LTR			0x10
 #define LPSS_AUTO_LTR			0x14
 #define LPSS_TX_INT			0x20
@@ -68,11 +69,16 @@ struct lpss_private_data {
 
 static void lpss_uart_setup(struct lpss_private_data *pdata)
 {
-	unsigned int tx_int_offset = pdata->dev_desc->prv_offset + LPSS_TX_INT;
+	unsigned int offset;
 	u32 reg;
 
-	reg = readl(pdata->mmio_base + tx_int_offset);
-	writel(reg | LPSS_TX_INT_MASK, pdata->mmio_base + tx_int_offset);
+	offset = pdata->dev_desc->prv_offset + LPSS_TX_INT;
+	reg = readl(pdata->mmio_base + offset);
+	writel(reg | LPSS_TX_INT_MASK, pdata->mmio_base + offset);
+
+	offset = pdata->dev_desc->prv_offset + LPSS_GENERAL;
+	reg = readl(pdata->mmio_base + offset);
+	writel(reg | LPSS_GENERAL_UART_RTS_OVRD, pdata->mmio_base + offset);
 }
 
 static struct lpss_device_desc lpt_dev_desc = {
Signature · 1 line
1.8.4.rc3
#1 lore raw
Quoted 9 lines · Heikki Krogerus

There is an additional bit in the GENERAL register on newer silicon that needs to be set or UART's RTS pin fails to reflect the flow control settings in the Modem Control Register.

This will fix an issue where the RTS pin of the UART stays always at 1.8V, regardless of the register settings.

OK, is this urgent?

Rafael

Quoted 37 lines
---
 drivers/acpi/acpi_lpss.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)
drivers/acpi/acpi_lpss.c +9 -3
index fb78bb9..d396101 100644
@@ -30,6 +30,7 @@ ACPI_MODULE_NAME("acpi_lpss");
 /* Offsets relative to LPSS_PRIVATE_OFFSET */
 #define LPSS_GENERAL			0x08
 #define LPSS_GENERAL_LTR_MODE_SW	BIT(2)
+#define LPSS_GENERAL_UART_RTS_OVRD	BIT(3)
 #define LPSS_SW_LTR			0x10
 #define LPSS_AUTO_LTR			0x14
 #define LPSS_TX_INT			0x20
@@ -68,11 +69,16 @@ struct lpss_private_data {
 
 static void lpss_uart_setup(struct lpss_private_data *pdata)
 {
-	unsigned int tx_int_offset = pdata->dev_desc->prv_offset + LPSS_TX_INT;
+	unsigned int offset;
 	u32 reg;
 
-	reg = readl(pdata->mmio_base + tx_int_offset);
-	writel(reg | LPSS_TX_INT_MASK, pdata->mmio_base + tx_int_offset);
+	offset = pdata->dev_desc->prv_offset + LPSS_TX_INT;
+	reg = readl(pdata->mmio_base + offset);
+	writel(reg | LPSS_TX_INT_MASK, pdata->mmio_base + offset);
+
+	offset = pdata->dev_desc->prv_offset + LPSS_GENERAL;
+	reg = readl(pdata->mmio_base + offset);
+	writel(reg | LPSS_GENERAL_UART_RTS_OVRD, pdata->mmio_base + offset);
 }
 
 static struct lpss_device_desc lpt_dev_desc = {
Signature · 2 lines
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.
#2 lore raw
Quoted 6 lines · Rafael J. Wysocki
Quoted 5 lines · Heikki Krogerus

There is an additional bit in the GENERAL register on newer silicon that needs to be set or UART's RTS pin fails to reflect the flow control settings in the Modem Control Register.

Quoted 6 lines
Quoted 4 lines

This will fix an issue where the RTS pin of the UART stays always at 1.8V, regardless of the register settings.

OK, is this urgent?

No, we can wait for v3.13 if that is what you mean.

Quoted 3 lines

Rafael

Signature · 1 line
heikki
#3 lore raw
Quoted 7 lines · Heikki Krogerus
Quoted 6 lines · Rafael J. Wysocki
Quoted 5 lines · Heikki Krogerus

There is an additional bit in the GENERAL register on newer silicon that needs to be set or UART's RTS pin fails to reflect the flow control settings in the Modem Control Register.

Quoted 8 lines
Quoted 6 lines
Quoted 4 lines

This will fix an issue where the RTS pin of the UART stays always at 1.8V, regardless of the register settings.

OK, is this urgent?

No, we can wait for v3.13 if that is what you mean.

OK