aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2014-06-03 03:33:41 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2014-06-04 23:20:36 -0400
commitc4cad90f9e9dcb85afc5e75a02ae3522ed077296 (patch)
treec14e8a189f705b3429cecd38cdfa1bfdfab12760
parent91a6151be2a936e87ce422fcd9262377ad9ed91c (diff)
powerpc/serial: Use saner flags when creating legacy ports
We had a mix & match of flags used when creating legacy ports depending on where we found them in the device-tree. Among others we were missing UPF_SKIP_TEST for some kind of ISA ports which is a problem as quite a few UARTs out there don't support the loopback test (such as a lot of BMCs). Let's pick the set of flags used by the SoC code and generalize it which means autoconf, no loopback test, irq maybe shared and fixed port. Sending to stable as the lack of UPF_SKIP_TEST is breaking serial on some machines so I want this back into distros Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> CC: stable@vger.kernel.org
-rw-r--r--arch/powerpc/kernel/legacy_serial.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/arch/powerpc/kernel/legacy_serial.c b/arch/powerpc/kernel/legacy_serial.c
index 85fb16e64cef..936258881c98 100644
--- a/arch/powerpc/kernel/legacy_serial.c
+++ b/arch/powerpc/kernel/legacy_serial.c
@@ -48,6 +48,9 @@ static struct of_device_id legacy_serial_parents[] __initdata = {
48static unsigned int legacy_serial_count; 48static unsigned int legacy_serial_count;
49static int legacy_serial_console = -1; 49static int legacy_serial_console = -1;
50 50
51static const upf_t legacy_port_flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST |
52 UPF_SHARE_IRQ | UPF_FIXED_PORT;
53
51static unsigned int tsi_serial_in(struct uart_port *p, int offset) 54static unsigned int tsi_serial_in(struct uart_port *p, int offset)
52{ 55{
53 unsigned int tmp; 56 unsigned int tmp;
@@ -160,8 +163,6 @@ static int __init add_legacy_soc_port(struct device_node *np,
160{ 163{
161 u64 addr; 164 u64 addr;
162 const __be32 *addrp; 165 const __be32 *addrp;
163 upf_t flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | UPF_SHARE_IRQ
164 | UPF_FIXED_PORT;
165 struct device_node *tsi = of_get_parent(np); 166 struct device_node *tsi = of_get_parent(np);
166 167
167 /* We only support ports that have a clock frequency properly 168 /* We only support ports that have a clock frequency properly
@@ -191,9 +192,11 @@ static int __init add_legacy_soc_port(struct device_node *np,
191 * IO port value. It will be fixed up later along with the irq 192 * IO port value. It will be fixed up later along with the irq
192 */ 193 */
193 if (tsi && !strcmp(tsi->type, "tsi-bridge")) 194 if (tsi && !strcmp(tsi->type, "tsi-bridge"))
194 return add_legacy_port(np, -1, UPIO_TSI, addr, addr, NO_IRQ, flags, 0); 195 return add_legacy_port(np, -1, UPIO_TSI, addr, addr,
196 NO_IRQ, legacy_port_flags, 0);
195 else 197 else
196 return add_legacy_port(np, -1, UPIO_MEM, addr, addr, NO_IRQ, flags, 0); 198 return add_legacy_port(np, -1, UPIO_MEM, addr, addr,
199 NO_IRQ, legacy_port_flags, 0);
197} 200}
198 201
199static int __init add_legacy_isa_port(struct device_node *np, 202static int __init add_legacy_isa_port(struct device_node *np,
@@ -239,7 +242,7 @@ static int __init add_legacy_isa_port(struct device_node *np,
239 242
240 /* Add port, irq will be dealt with later */ 243 /* Add port, irq will be dealt with later */
241 return add_legacy_port(np, index, UPIO_PORT, be32_to_cpu(reg[1]), 244 return add_legacy_port(np, index, UPIO_PORT, be32_to_cpu(reg[1]),
242 taddr, NO_IRQ, UPF_BOOT_AUTOCONF, 0); 245 taddr, NO_IRQ, legacy_port_flags, 0);
243 246
244} 247}
245 248
@@ -312,7 +315,7 @@ static int __init add_legacy_pci_port(struct device_node *np,
312 * IO port value. It will be fixed up later along with the irq 315 * IO port value. It will be fixed up later along with the irq
313 */ 316 */
314 return add_legacy_port(np, index, iotype, base, addr, NO_IRQ, 317 return add_legacy_port(np, index, iotype, base, addr, NO_IRQ,
315 UPF_BOOT_AUTOCONF, np != pci_dev); 318 legacy_port_flags, np != pci_dev);
316} 319}
317#endif 320#endif
318 321