Skip to contentSkip to conversation

serial: 8250: Do XR17V35X specific wakeup in serial8250_do_startup

PATCH In review Joerg Roedel 3 participants 4 messages Jul 16, 2015 – Jul 28, 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]>

The XR17V35X UART needs the ECB bit set in its XR_EFR register to enable access to IER [7:5], ISR [5:4], FCR[5:4], MCR[7:5], and MSR [7:0].

Also reset the IER register to mask interrupts after access to all bits of this register has been enabled.

This makes my 8-port XR17V35X working with the in-kernel serial driver.

Cc Peter Hurley <[email protected]>
Cc Michael Welling <[email protected]>
Cc Joe Schultz <[email protected]>
---
 drivers/tty/serial/8250/8250_core.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
drivers/tty/serial/8250/8250_core.c +15 -0
index 37fff12..4124a91 100644
@@ -2164,6 +2164,21 @@ int serial8250_do_startup(struct uart_port *port)
 	 */
 	enable_rsa(up);
 #endif
+
+	if (port->type == PORT_XR17V35X) {
+		/*
+		 * First enable access to IER [7:5], ISR [5:4], FCR [5:4],
+		 * MCR [7:5] and MSR [7:0]
+		 */
+		serial_port_out(port, UART_XR_EFR, UART_EFR_ECB);
+
+		/*
+		 * Make sure all interrups are masked until initialization is
+		 * complete and the FIFOs are cleared
+		 */
+		serial_port_out(port, UART_IER, 0);
+	}
+
 	/*
 	 * Clear the FIFO buffers and disable them.
 	 * (they will be reenabled in set_termios())
Signature · 1 line
1.9.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 33 lines · Joerg Roedel

From: Joerg Roedel <[email protected]>

The XR17V35X UART needs the ECB bit set in its XR_EFR register to enable access to IER [7:5], ISR [5:4], FCR[5:4], MCR[7:5], and MSR [7:0].

Also reset the IER register to mask interrupts after access to all bits of this register has been enabled.

This makes my 8-port XR17V35X working with the in-kernel serial driver.

Cc Peter Hurley <[email protected]>
Cc Michael Welling <[email protected]>
Cc Joe Schultz <[email protected]>
---
 drivers/tty/serial/8250/8250_core.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
drivers/tty/serial/8250/8250_core.c +5 -0
index 37fff12..4124a91 100644
@@ -2164,6 +2164,21 @@ int serial8250_do_startup(struct uart_port *port)
 	 */
 	enable_rsa(up);
 #endif
+
+	if (port->type == PORT_XR17V35X) {
+		/*
+		 * First enable access to IER [7:5], ISR [5:4], FCR [5:4],
+		 * MCR [7:5] and MSR [7:0]

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

Quoted 10 lines
drivers/tty/serial/8250/8250_core.c +10 -0
+		 */
+		serial_port_out(port, UART_XR_EFR, UART_EFR_ECB);
+
+		/*
+		 * Make sure all interrups are masked until initialization is
+		 * complete and the FIFOs are cleared
+		 */
+		serial_port_out(port, UART_IER, 0);
+	}
+
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.9.1
Reviewed-by on v1 1/1
#2 lore raw
In reply to Joerg Roedel
Quoted 11 lines · Joerg Roedel

From: Joerg Roedel <[email protected]>

The XR17V35X UART needs the ECB bit set in its XR_EFR register to enable access to IER [7:5], ISR [5:4], FCR[5:4], MCR[7:5], and MSR [7:0].

Also reset the IER register to mask interrupts after access to all bits of this register has been enabled.

This makes my 8-port XR17V35X working with the in-kernel serial driver.

Also, would you please find out what bits are set in the IER that this fixes and let me know? I don't have this hardware.

Regards,
Peter Hurley

Quoted 35 lines
Cc Peter Hurley <[email protected]>
Cc Michael Welling <[email protected]>
Cc Joe Schultz <[email protected]>
---
 drivers/tty/serial/8250/8250_core.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
drivers/tty/serial/8250/8250_core.c +15 -0
index 37fff12..4124a91 100644
@@ -2164,6 +2164,21 @@ int serial8250_do_startup(struct uart_port *port)
 	 */
 	enable_rsa(up);
 #endif
+
+	if (port->type == PORT_XR17V35X) {
+		/*
+		 * First enable access to IER [7:5], ISR [5:4], FCR [5:4],
+		 * MCR [7:5] and MSR [7:0]
+		 */
+		serial_port_out(port, UART_XR_EFR, UART_EFR_ECB);
+
+		/*
+		 * Make sure all interrups are masked until initialization is
+		 * complete and the FIFOs are cleared
+		 */
+		serial_port_out(port, UART_IER, 0);
+	}
+
 	/*
 	 * Clear the FIFO buffers and disable them.
 	 * (they will be reenabled in set_termios())
#3 lore raw

Hi Peter,

Quoted 7 lines · Peter Hurley
Quoted 6 lines · Joerg Roedel

From: Joerg Roedel <[email protected]>

The XR17V35X UART needs the ECB bit set in its XR_EFR register to enable access to IER [7:5], ISR [5:4], FCR[5:4], MCR[7:5], and MSR [7:0].

Quoted 7 lines
Quoted 5 lines

Also reset the IER register to mask interrupts after access to all bits of this register has been enabled.

This makes my 8-port XR17V35X working with the in-kernel serial driver.

Thanks for your review.

Quoted 2 lines

Also, would you please find out what bits are set in the IER that this fixes and let me know? I don't have this hardware.

Unfortunatly I put the card back into a production machine and can't easily check this anymore. But I'll let you know when I update the kernel on the box next time.

Joerg