aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/legacy_serial.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/kernel/legacy_serial.c')
-rw-r--r--arch/powerpc/kernel/legacy_serial.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/arch/powerpc/kernel/legacy_serial.c b/arch/powerpc/kernel/legacy_serial.c
index 7e98e778b52f..40a39291861f 100644
--- a/arch/powerpc/kernel/legacy_serial.c
+++ b/arch/powerpc/kernel/legacy_serial.c
@@ -112,9 +112,10 @@ static int __init add_legacy_port(struct device_node *np, int want_index,
112static int __init add_legacy_soc_port(struct device_node *np, 112static int __init add_legacy_soc_port(struct device_node *np,
113 struct device_node *soc_dev) 113 struct device_node *soc_dev)
114{ 114{
115 phys_addr_t addr; 115 u64 addr;
116 u32 *addrp; 116 u32 *addrp;
117 upf_t flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | UPF_SHARE_IRQ; 117 upf_t flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | UPF_SHARE_IRQ;
118 struct device_node *tsi = of_get_parent(np);
118 119
119 /* We only support ports that have a clock frequency properly 120 /* We only support ports that have a clock frequency properly
120 * encoded in the device-tree. 121 * encoded in the device-tree.
@@ -134,7 +135,10 @@ static int __init add_legacy_soc_port(struct device_node *np,
134 /* Add port, irq will be dealt with later. We passed a translated 135 /* Add port, irq will be dealt with later. We passed a translated
135 * IO port value. It will be fixed up later along with the irq 136 * IO port value. It will be fixed up later along with the irq
136 */ 137 */
137 return add_legacy_port(np, -1, UPIO_MEM, addr, addr, NO_IRQ, flags, 0); 138 if (tsi && !strcmp(tsi->type, "tsi-bridge"))
139 return add_legacy_port(np, -1, UPIO_TSI, addr, addr, NO_IRQ, flags, 0);
140 else
141 return add_legacy_port(np, -1, UPIO_MEM, addr, addr, NO_IRQ, flags, 0);
138} 142}
139 143
140static int __init add_legacy_isa_port(struct device_node *np, 144static int __init add_legacy_isa_port(struct device_node *np,
@@ -143,7 +147,7 @@ static int __init add_legacy_isa_port(struct device_node *np,
143 u32 *reg; 147 u32 *reg;
144 char *typep; 148 char *typep;
145 int index = -1; 149 int index = -1;
146 phys_addr_t taddr; 150 u64 taddr;
147 151
148 DBG(" -> add_legacy_isa_port(%s)\n", np->full_name); 152 DBG(" -> add_legacy_isa_port(%s)\n", np->full_name);
149 153
@@ -165,10 +169,13 @@ static int __init add_legacy_isa_port(struct device_node *np,
165 if (typep && *typep == 'S') 169 if (typep && *typep == 'S')
166 index = simple_strtol(typep+1, NULL, 0) - 1; 170 index = simple_strtol(typep+1, NULL, 0) - 1;
167 171
168 /* Translate ISA address */ 172 /* Translate ISA address. If it fails, we still register the port
173 * with no translated address so that it can be picked up as an IO
174 * port later by the serial driver
175 */
169 taddr = of_translate_address(np, reg); 176 taddr = of_translate_address(np, reg);
170 if (taddr == OF_BAD_ADDR) 177 if (taddr == OF_BAD_ADDR)
171 return -1; 178 taddr = 0;
172 179
173 /* Add port, irq will be dealt with later */ 180 /* Add port, irq will be dealt with later */
174 return add_legacy_port(np, index, UPIO_PORT, reg[1], taddr, 181 return add_legacy_port(np, index, UPIO_PORT, reg[1], taddr,
@@ -180,7 +187,7 @@ static int __init add_legacy_isa_port(struct device_node *np,
180static int __init add_legacy_pci_port(struct device_node *np, 187static int __init add_legacy_pci_port(struct device_node *np,
181 struct device_node *pci_dev) 188 struct device_node *pci_dev)
182{ 189{
183 phys_addr_t addr, base; 190 u64 addr, base;
184 u32 *addrp; 191 u32 *addrp;
185 unsigned int flags; 192 unsigned int flags;
186 int iotype, index = -1, lindex = 0; 193 int iotype, index = -1, lindex = 0;
@@ -461,7 +468,7 @@ static int __init serial_dev_init(void)
461 fixup_port_irq(i, np, port); 468 fixup_port_irq(i, np, port);
462 if (port->iotype == UPIO_PORT) 469 if (port->iotype == UPIO_PORT)
463 fixup_port_pio(i, np, port); 470 fixup_port_pio(i, np, port);
464 if (port->iotype == UPIO_MEM) 471 if ((port->iotype == UPIO_MEM) || (port->iotype == UPIO_TSI))
465 fixup_port_mmio(i, np, port); 472 fixup_port_mmio(i, np, port);
466 } 473 }
467 474