Skip to contentSkip to conversation

serial: 8250: Do XR17V35X specific wakeup in serial8250_do_startup

PATCH In review Joerg Roedel 2 participants 3 messages Jun 19, 2015 – Jun 29, 2015 TTY layer and serial drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 serial: 8250: Do XR17V35X specific wakeup in serial8250_do_startup

From: Joerg Roedel <[email protected]>

While debugging why my 8-port XR17V35X card does not work with the in-kernel serial driver, I found that some chip specific wakeup code is necessary to get it working.

Specificly the EFR_ECB bit needs to be set in the chip-specific UART_XR_EFR register, so that writing to a couple of other configuration bits is enabled.

Cc Peter Hurley <[email protected]>
Cc Michael Welling <[email protected]>
Cc Joe Schultz <[email protected]>
---
 drivers/tty/serial/8250/8250_core.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)
drivers/tty/serial/8250/8250_core.c +12 -0
index 4506e40..de34db3 100644
@@ -2176,6 +2176,18 @@ int serial8250_do_startup(struct uart_port *port)
 	 */
 	enable_rsa(up);
 #endif
+
+	/*
+	 * Do this right before clearing the FIFOs to prevent
+	 * interrupt storm.
+	 */
+	if (port->type == PORT_XR17V35X) {
+		/* Wake up and initialize UART */
+		serial_port_out(port, UART_XR_EFR, UART_EFR_ECB);
+		serial_port_out(port, UART_IER, 0);
+		serial_port_out(port, UART_LCR, 0);
+	}
+
 	/*
 	 * Clear the FIFO buffers and disable them.
 	 * (they will be reenabled in set_termios())
Signature · 1 line
1.8.4.5
#1 lore raw
Quoted 28 lines · Joerg Roedel

From: Joerg Roedel <[email protected]>

While debugging why my 8-port XR17V35X card does not work with the in-kernel serial driver, I found that some chip specific wakeup code is necessary to get it working.

Specificly the EFR_ECB bit needs to be set in the chip-specific UART_XR_EFR register, so that writing to a couple of other configuration bits is enabled.

Cc Peter Hurley <[email protected]>
Cc Michael Welling <[email protected]>
Cc Joe Schultz <[email protected]>
---
 drivers/tty/serial/8250/8250_core.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)
drivers/tty/serial/8250/8250_core.c +2 -0
index 4506e40..de34db3 100644
@@ -2176,6 +2176,18 @@ int serial8250_do_startup(struct uart_port *port)
 	 */
 	enable_rsa(up);
 #endif
+
+	/*

drivers/tty/serial/8250/8250_core.c int serial8250_do_startup(struct uart_port *port) · line 2190

Quoted 10 lines
drivers/tty/serial/8250/8250_core.c +10 -0
+	 * Do this right before clearing the FIFOs to prevent
+	 * interrupt storm.
+	 */
+	if (port->type == PORT_XR17V35X) {
+		/* Wake up and initialize UART */
+		serial_port_out(port, UART_XR_EFR, UART_EFR_ECB);
+		serial_port_out(port, UART_IER, 0);
+		serial_port_out(port, UART_LCR, 0);
+	}
+

Looks good to me. The datasheet indicates that bit 4 of the EFR needs to be set to access to IER [7:5], ISR [5:4], FCR[5:4], MCR[7:5], MSR.

Quoted 6 lines
drivers/tty/serial/8250/8250_core.c +0 -0
 	/*
 	 * Clear the FIFO buffers and disable them.
 	 * (they will be reenabled in set_termios())
Signature · 1 line
1.8.4.5
#2 lore raw
Quoted 3 lines · Michael Welling

Looks good to me. The datasheet indicates that bit 4 of the EFR needs to be set to access to IER [7:5], ISR [5:4], FCR[5:4], MCR[7:5], MSR.

Thanks! I updated the patch a little bit and wrote a better changelog entry, mentioning the above bits. Will send a new version after the merge window.

Joerg