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: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
CC: stable@vger.kernel.org
parent 91a6151b
...@@ -48,6 +48,9 @@ static struct of_device_id legacy_serial_parents[] __initdata = { ...@@ -48,6 +48,9 @@ static struct of_device_id legacy_serial_parents[] __initdata = {
static unsigned int legacy_serial_count; static unsigned int legacy_serial_count;
static int legacy_serial_console = -1; static int legacy_serial_console = -1;
static const upf_t legacy_port_flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST |
UPF_SHARE_IRQ | UPF_FIXED_PORT;
static unsigned int tsi_serial_in(struct uart_port *p, int offset) static unsigned int tsi_serial_in(struct uart_port *p, int offset)
{ {
unsigned int tmp; unsigned int tmp;
...@@ -160,8 +163,6 @@ static int __init add_legacy_soc_port(struct device_node *np, ...@@ -160,8 +163,6 @@ static int __init add_legacy_soc_port(struct device_node *np,
{ {
u64 addr; u64 addr;
const __be32 *addrp; const __be32 *addrp;
upf_t flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | UPF_SHARE_IRQ
| UPF_FIXED_PORT;
struct device_node *tsi = of_get_parent(np); struct device_node *tsi = of_get_parent(np);
/* We only support ports that have a clock frequency properly /* 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,9 +192,11 @@ static int __init add_legacy_soc_port(struct device_node *np,
* IO port value. It will be fixed up later along with the irq * IO port value. It will be fixed up later along with the irq
*/ */
if (tsi && !strcmp(tsi->type, "tsi-bridge")) if (tsi && !strcmp(tsi->type, "tsi-bridge"))
return add_legacy_port(np, -1, UPIO_TSI, addr, addr, NO_IRQ, flags, 0); return add_legacy_port(np, -1, UPIO_TSI, addr, addr,
NO_IRQ, legacy_port_flags, 0);
else else
return add_legacy_port(np, -1, UPIO_MEM, addr, addr, NO_IRQ, flags, 0); return add_legacy_port(np, -1, UPIO_MEM, addr, addr,
NO_IRQ, legacy_port_flags, 0);
} }
static int __init add_legacy_isa_port(struct device_node *np, static 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,7 +242,7 @@ static int __init add_legacy_isa_port(struct device_node *np,
/* Add port, irq will be dealt with later */ /* Add port, irq will be dealt with later */
return add_legacy_port(np, index, UPIO_PORT, be32_to_cpu(reg[1]), return add_legacy_port(np, index, UPIO_PORT, be32_to_cpu(reg[1]),
taddr, NO_IRQ, UPF_BOOT_AUTOCONF, 0); taddr, NO_IRQ, legacy_port_flags, 0);
} }
...@@ -312,7 +315,7 @@ static int __init add_legacy_pci_port(struct device_node *np, ...@@ -312,7 +315,7 @@ static int __init add_legacy_pci_port(struct device_node *np,
* IO port value. It will be fixed up later along with the irq * IO port value. It will be fixed up later along with the irq
*/ */
return add_legacy_port(np, index, iotype, base, addr, NO_IRQ, return add_legacy_port(np, index, iotype, base, addr, NO_IRQ,
UPF_BOOT_AUTOCONF, np != pci_dev); legacy_port_flags, np != pci_dev);
} }
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment