aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/tty/serial/8250.c68
-rw-r--r--drivers/tty/serial/serial_core.c4
-rw-r--r--include/linux/serial_core.h4
3 files changed, 1 insertions, 75 deletions
diff --git a/drivers/tty/serial/8250.c b/drivers/tty/serial/8250.c
index 833e011a426f..6f594d2d334f 100644
--- a/drivers/tty/serial/8250.c
+++ b/drivers/tty/serial/8250.c
@@ -461,42 +461,6 @@ static void tsi_serial_out(struct uart_port *p, int offset, int value)
461 writeb(value, p->membase + offset); 461 writeb(value, p->membase + offset);
462} 462}
463 463
464/* Save the LCR value so it can be re-written when a Busy Detect IRQ occurs. */
465static inline void dwapb_save_out_value(struct uart_port *p, int offset,
466 int value)
467{
468 struct uart_8250_port *up =
469 container_of(p, struct uart_8250_port, port);
470
471 if (offset == UART_LCR)
472 up->lcr = value;
473}
474
475/* Read the IER to ensure any interrupt is cleared before returning from ISR. */
476static inline void dwapb_check_clear_ier(struct uart_port *p, int offset)
477{
478 if (offset == UART_TX || offset == UART_IER)
479 p->serial_in(p, UART_IER);
480}
481
482static void dwapb_serial_out(struct uart_port *p, int offset, int value)
483{
484 int save_offset = offset;
485 offset = map_8250_out_reg(p, offset) << p->regshift;
486 dwapb_save_out_value(p, save_offset, value);
487 writeb(value, p->membase + offset);
488 dwapb_check_clear_ier(p, save_offset);
489}
490
491static void dwapb32_serial_out(struct uart_port *p, int offset, int value)
492{
493 int save_offset = offset;
494 offset = map_8250_out_reg(p, offset) << p->regshift;
495 dwapb_save_out_value(p, save_offset, value);
496 writel(value, p->membase + offset);
497 dwapb_check_clear_ier(p, save_offset);
498}
499
500static unsigned int io_serial_in(struct uart_port *p, int offset) 464static unsigned int io_serial_in(struct uart_port *p, int offset)
501{ 465{
502 offset = map_8250_in_reg(p, offset) << p->regshift; 466 offset = map_8250_in_reg(p, offset) << p->regshift;
@@ -542,16 +506,6 @@ static void set_io_from_upio(struct uart_port *p)
542 p->serial_out = tsi_serial_out; 506 p->serial_out = tsi_serial_out;
543 break; 507 break;
544 508
545 case UPIO_DWAPB:
546 p->serial_in = mem_serial_in;
547 p->serial_out = dwapb_serial_out;
548 break;
549
550 case UPIO_DWAPB32:
551 p->serial_in = mem32_serial_in;
552 p->serial_out = dwapb32_serial_out;
553 break;
554
555 default: 509 default:
556 p->serial_in = io_serial_in; 510 p->serial_in = io_serial_in;
557 p->serial_out = io_serial_out; 511 p->serial_out = io_serial_out;
@@ -570,8 +524,6 @@ serial_out_sync(struct uart_8250_port *up, int offset, int value)
570 case UPIO_MEM: 524 case UPIO_MEM:
571 case UPIO_MEM32: 525 case UPIO_MEM32:
572 case UPIO_AU: 526 case UPIO_AU:
573 case UPIO_DWAPB:
574 case UPIO_DWAPB32:
575 p->serial_out(p, offset, value); 527 p->serial_out(p, offset, value);
576 p->serial_in(p, UART_LCR); /* safe, no side-effects */ 528 p->serial_in(p, UART_LCR); /* safe, no side-effects */
577 break; 529 break;
@@ -1679,23 +1631,7 @@ static irqreturn_t serial8250_interrupt(int irq, void *dev_id)
1679 port = &up->port; 1631 port = &up->port;
1680 1632
1681 if (port->handle_irq(port)) { 1633 if (port->handle_irq(port)) {
1682
1683 handled = 1; 1634 handled = 1;
1684
1685 end = NULL;
1686 } else if ((up->port.iotype == UPIO_DWAPB ||
1687 up->port.iotype == UPIO_DWAPB32) &&
1688 (iir & UART_IIR_BUSY) == UART_IIR_BUSY) {
1689 /* The DesignWare APB UART has an Busy Detect (0x07)
1690 * interrupt meaning an LCR write attempt occurred while the
1691 * UART was busy. The interrupt must be cleared by reading
1692 * the UART status register (USR) and the LCR re-written. */
1693 unsigned int status;
1694 status = *(volatile u32 *)up->port.private_data;
1695 serial_out(up, UART_LCR, up->lcr);
1696
1697 handled = 1;
1698
1699 end = NULL; 1635 end = NULL;
1700 } else if (end == NULL) 1636 } else if (end == NULL)
1701 end = l; 1637 end = l;
@@ -2592,8 +2528,6 @@ static int serial8250_request_std_resource(struct uart_8250_port *up)
2592 case UPIO_TSI: 2528 case UPIO_TSI:
2593 case UPIO_MEM32: 2529 case UPIO_MEM32:
2594 case UPIO_MEM: 2530 case UPIO_MEM:
2595 case UPIO_DWAPB:
2596 case UPIO_DWAPB32:
2597 if (!up->port.mapbase) 2531 if (!up->port.mapbase)
2598 break; 2532 break;
2599 2533
@@ -2630,8 +2564,6 @@ static void serial8250_release_std_resource(struct uart_8250_port *up)
2630 case UPIO_TSI: 2564 case UPIO_TSI:
2631 case UPIO_MEM32: 2565 case UPIO_MEM32:
2632 case UPIO_MEM: 2566 case UPIO_MEM:
2633 case UPIO_DWAPB:
2634 case UPIO_DWAPB32:
2635 if (!up->port.mapbase) 2567 if (!up->port.mapbase)
2636 break; 2568 break;
2637 2569
diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c
index 44c29631b724..3844980b397f 100644
--- a/drivers/tty/serial/serial_core.c
+++ b/drivers/tty/serial/serial_core.c
@@ -2032,8 +2032,6 @@ uart_report_port(struct uart_driver *drv, struct uart_port *port)
2032 case UPIO_MEM32: 2032 case UPIO_MEM32:
2033 case UPIO_AU: 2033 case UPIO_AU:
2034 case UPIO_TSI: 2034 case UPIO_TSI:
2035 case UPIO_DWAPB:
2036 case UPIO_DWAPB32:
2037 snprintf(address, sizeof(address), 2035 snprintf(address, sizeof(address),
2038 "MMIO 0x%llx", (unsigned long long)port->mapbase); 2036 "MMIO 0x%llx", (unsigned long long)port->mapbase);
2039 break; 2037 break;
@@ -2446,8 +2444,6 @@ int uart_match_port(struct uart_port *port1, struct uart_port *port2)
2446 case UPIO_MEM32: 2444 case UPIO_MEM32:
2447 case UPIO_AU: 2445 case UPIO_AU:
2448 case UPIO_TSI: 2446 case UPIO_TSI:
2449 case UPIO_DWAPB:
2450 case UPIO_DWAPB32:
2451 return (port1->mapbase == port2->mapbase); 2447 return (port1->mapbase == port2->mapbase);
2452 } 2448 }
2453 return 0; 2449 return 0;
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
index c31ae43c073d..493773e3b46d 100644
--- a/include/linux/serial_core.h
+++ b/include/linux/serial_core.h
@@ -318,9 +318,7 @@ struct uart_port {
318#define UPIO_MEM32 (3) 318#define UPIO_MEM32 (3)
319#define UPIO_AU (4) /* Au1x00 type IO */ 319#define UPIO_AU (4) /* Au1x00 type IO */
320#define UPIO_TSI (5) /* Tsi108/109 type IO */ 320#define UPIO_TSI (5) /* Tsi108/109 type IO */
321#define UPIO_DWAPB (6) /* DesignWare APB UART */ 321#define UPIO_RM9000 (6) /* RM9000 type IO */
322#define UPIO_RM9000 (7) /* RM9000 type IO */
323#define UPIO_DWAPB32 (8) /* DesignWare APB UART (32 bit accesses) */
324 322
325 unsigned int read_status_mask; /* driver specific */ 323 unsigned int read_status_mask; /* driver specific */
326 unsigned int ignore_status_mask; /* driver specific */ 324 unsigned int ignore_status_mask; /* driver specific */