diff options
-rw-r--r-- | arch/powerpc/kernel/legacy_serial.c | 25 | ||||
-rw-r--r-- | drivers/tty/serial/8250.c | 23 |
2 files changed, 25 insertions, 23 deletions
diff --git a/arch/powerpc/kernel/legacy_serial.c b/arch/powerpc/kernel/legacy_serial.c index 2b97b80d6d7d..c7b5afeecaf2 100644 --- a/arch/powerpc/kernel/legacy_serial.c +++ b/arch/powerpc/kernel/legacy_serial.c | |||
@@ -6,6 +6,7 @@ | |||
6 | #include <linux/pci.h> | 6 | #include <linux/pci.h> |
7 | #include <linux/of_address.h> | 7 | #include <linux/of_address.h> |
8 | #include <linux/of_device.h> | 8 | #include <linux/of_device.h> |
9 | #include <linux/serial_reg.h> | ||
9 | #include <asm/io.h> | 10 | #include <asm/io.h> |
10 | #include <asm/mmu.h> | 11 | #include <asm/mmu.h> |
11 | #include <asm/prom.h> | 12 | #include <asm/prom.h> |
@@ -47,6 +48,24 @@ static struct __initdata of_device_id legacy_serial_parents[] = { | |||
47 | static unsigned int legacy_serial_count; | 48 | static unsigned int legacy_serial_count; |
48 | static int legacy_serial_console = -1; | 49 | static int legacy_serial_console = -1; |
49 | 50 | ||
51 | static unsigned int tsi_serial_in(struct uart_port *p, int offset) | ||
52 | { | ||
53 | unsigned int tmp; | ||
54 | offset = offset << p->regshift; | ||
55 | if (offset == UART_IIR) { | ||
56 | tmp = readl(p->membase + (UART_IIR & ~3)); | ||
57 | return (tmp >> 16) & 0xff; /* UART_IIR % 4 == 2 */ | ||
58 | } else | ||
59 | return readb(p->membase + offset); | ||
60 | } | ||
61 | |||
62 | static void tsi_serial_out(struct uart_port *p, int offset, int value) | ||
63 | { | ||
64 | offset = offset << p->regshift; | ||
65 | if (!((offset == UART_IER) && (value & UART_IER_UUE))) | ||
66 | writeb(value, p->membase + offset); | ||
67 | } | ||
68 | |||
50 | static int __init add_legacy_port(struct device_node *np, int want_index, | 69 | static int __init add_legacy_port(struct device_node *np, int want_index, |
51 | int iotype, phys_addr_t base, | 70 | int iotype, phys_addr_t base, |
52 | phys_addr_t taddr, unsigned long irq, | 71 | phys_addr_t taddr, unsigned long irq, |
@@ -102,6 +121,7 @@ static int __init add_legacy_port(struct device_node *np, int want_index, | |||
102 | legacy_serial_ports[index].iobase = base; | 121 | legacy_serial_ports[index].iobase = base; |
103 | else | 122 | else |
104 | legacy_serial_ports[index].mapbase = base; | 123 | legacy_serial_ports[index].mapbase = base; |
124 | |||
105 | legacy_serial_ports[index].iotype = iotype; | 125 | legacy_serial_ports[index].iotype = iotype; |
106 | legacy_serial_ports[index].uartclk = clock; | 126 | legacy_serial_ports[index].uartclk = clock; |
107 | legacy_serial_ports[index].irq = irq; | 127 | legacy_serial_ports[index].irq = irq; |
@@ -112,6 +132,11 @@ static int __init add_legacy_port(struct device_node *np, int want_index, | |||
112 | legacy_serial_infos[index].speed = spd ? be32_to_cpup(spd) : 0; | 132 | legacy_serial_infos[index].speed = spd ? be32_to_cpup(spd) : 0; |
113 | legacy_serial_infos[index].irq_check_parent = irq_check_parent; | 133 | legacy_serial_infos[index].irq_check_parent = irq_check_parent; |
114 | 134 | ||
135 | if (iotype == UPIO_TSI) { | ||
136 | legacy_serial_ports[index].serial_in = tsi_serial_in; | ||
137 | legacy_serial_ports[index].serial_out = tsi_serial_out; | ||
138 | } | ||
139 | |||
115 | printk(KERN_DEBUG "Found legacy serial port %d for %s\n", | 140 | printk(KERN_DEBUG "Found legacy serial port %d for %s\n", |
116 | index, np->full_name); | 141 | index, np->full_name); |
117 | printk(KERN_DEBUG " %s=%llx, taddr=%llx, irq=%lx, clk=%d, speed=%d\n", | 142 | printk(KERN_DEBUG " %s=%llx, taddr=%llx, irq=%lx, clk=%d, speed=%d\n", |
diff --git a/drivers/tty/serial/8250.c b/drivers/tty/serial/8250.c index 7f50999eebc2..610b8e63710d 100644 --- a/drivers/tty/serial/8250.c +++ b/drivers/tty/serial/8250.c | |||
@@ -443,24 +443,6 @@ static void au_serial_out(struct uart_port *p, int offset, int value) | |||
443 | __raw_writel(value, p->membase + offset); | 443 | __raw_writel(value, p->membase + offset); |
444 | } | 444 | } |
445 | 445 | ||
446 | static unsigned int tsi_serial_in(struct uart_port *p, int offset) | ||
447 | { | ||
448 | unsigned int tmp; | ||
449 | offset = map_8250_in_reg(p, offset) << p->regshift; | ||
450 | if (offset == UART_IIR) { | ||
451 | tmp = readl(p->membase + (UART_IIR & ~3)); | ||
452 | return (tmp >> 16) & 0xff; /* UART_IIR % 4 == 2 */ | ||
453 | } else | ||
454 | return readb(p->membase + offset); | ||
455 | } | ||
456 | |||
457 | static void tsi_serial_out(struct uart_port *p, int offset, int value) | ||
458 | { | ||
459 | offset = map_8250_out_reg(p, offset) << p->regshift; | ||
460 | if (!((offset == UART_IER) && (value & UART_IER_UUE))) | ||
461 | writeb(value, p->membase + offset); | ||
462 | } | ||
463 | |||
464 | /* Save the LCR value so it can be re-written when a Busy Detect IRQ occurs. */ | 446 | /* Save the LCR value so it can be re-written when a Busy Detect IRQ occurs. */ |
465 | static inline void dwapb_save_out_value(struct uart_port *p, int offset, | 447 | static inline void dwapb_save_out_value(struct uart_port *p, int offset, |
466 | int value) | 448 | int value) |
@@ -535,11 +517,6 @@ static void set_io_from_upio(struct uart_port *p) | |||
535 | p->serial_out = au_serial_out; | 517 | p->serial_out = au_serial_out; |
536 | break; | 518 | break; |
537 | 519 | ||
538 | case UPIO_TSI: | ||
539 | p->serial_in = tsi_serial_in; | ||
540 | p->serial_out = tsi_serial_out; | ||
541 | break; | ||
542 | |||
543 | case UPIO_DWAPB: | 520 | case UPIO_DWAPB: |
544 | p->serial_in = mem_serial_in; | 521 | p->serial_in = mem_serial_in; |
545 | p->serial_out = dwapb_serial_out; | 522 | p->serial_out = dwapb_serial_out; |