Commit d3902aad authored by Bjorn Helgaas's avatar Bjorn Helgaas Committed by Russell King

[SERIAL] removing legacy UART cruft

I'm trying to remove all the legacy UART cruft from ia64.  In theory
we should be able to discover all UARTs on ia64 via ACPI and PCI
enumeration, so we shouldn't need SERIAL_PORT_DFNS.

But SERIAL_PORT_DFNS currently does two things:
        1) it tells you about legacy devices you can't discover
           via a standard enumeration method, and
        2) it sizes old_serial_port[], which determines UART_NR,
           which is the maximum number of ports the driver will
           support

So here's a proposal to make SERIAL_PORT_DFNS optional and
provide another mechanism for configuring the number of ports
to support.
parent 01d0c436
...@@ -105,11 +105,20 @@ unsigned int share_irqs = SERIAL8250_SHARE_IRQS; ...@@ -105,11 +105,20 @@ unsigned int share_irqs = SERIAL8250_SHARE_IRQS;
#include <asm/serial.h> #include <asm/serial.h>
/*
* SERIAL_PORT_DFNS tells us about built-in ports that have no
* standard enumeration mechanism. Platforms that can find all
* serial ports via mechanisms like ACPI or PCI need not supply it.
*/
#ifndef SERIAL_PORT_DFNS
#define SERIAL_PORT_DFNS
#endif
static struct old_serial_port old_serial_port[] = { static struct old_serial_port old_serial_port[] = {
SERIAL_PORT_DFNS /* defined in asm/serial.h */ SERIAL_PORT_DFNS /* defined in asm/serial.h */
}; };
#define UART_NR ARRAY_SIZE(old_serial_port) #define UART_NR (ARRAY_SIZE(old_serial_port) + CONFIG_SERIAL_8250_NR_UARTS)
#if defined(CONFIG_SERIAL_8250_RSA) && defined(MODULE) #if defined(CONFIG_SERIAL_8250_RSA) && defined(MODULE)
...@@ -2136,7 +2145,8 @@ static int __init serial8250_init(void) ...@@ -2136,7 +2145,8 @@ static int __init serial8250_init(void)
int ret, i; int ret, i;
printk(KERN_INFO "Serial: 8250/16550 driver $Revision: 1.90 $ " printk(KERN_INFO "Serial: 8250/16550 driver $Revision: 1.90 $ "
"IRQ sharing %sabled\n", share_irqs ? "en" : "dis"); "%d ports, IRQ sharing %sabled\n", (int) UART_NR,
share_irqs ? "en" : "dis");
for (i = 0; i < NR_IRQS; i++) for (i = 0; i < NR_IRQS; i++)
spin_lock_init(&irq_lists[i].lock); spin_lock_init(&irq_lists[i].lock);
......
...@@ -1552,9 +1552,11 @@ pciserial_init_one(struct pci_dev *dev, const struct pci_device_id *ent) ...@@ -1552,9 +1552,11 @@ pciserial_init_one(struct pci_dev *dev, const struct pci_device_id *ent)
#endif #endif
priv->line[i] = register_serial(&serial_req); priv->line[i] = register_serial(&serial_req);
if (priv->line[i] < 0) if (priv->line[i] < 0) {
printk(KERN_WARNING "Couldn't register serial port %s: %d\n", pci_name(dev), priv->line[i]);
break; break;
} }
}
priv->nr = i; priv->nr = i;
......
...@@ -93,6 +93,16 @@ config SERIAL_8250_HCDP ...@@ -93,6 +93,16 @@ config SERIAL_8250_HCDP
purpose port, say Y here. See purpose port, say Y here. See
<http://www.dig64.org/specifications/DIG64_HCDPv10a_01.pdf>. <http://www.dig64.org/specifications/DIG64_HCDPv10a_01.pdf>.
config SERIAL_8250_NR_UARTS
int "Maximum number of non-legacy 8250/16550 serial ports"
depends on SERIAL_8250
default "4"
---help---
Set this to the number of non-legacy serial ports you want
the driver to support. This includes any ports discovered
via ACPI or PCI enumeration and any ports that may be added
at run-time via hot-plug.
config SERIAL_8250_EXTENDED config SERIAL_8250_EXTENDED
bool "Extended 8250/16550 serial driver options" bool "Extended 8250/16550 serial driver options"
depends on SERIAL_8250 depends on SERIAL_8250
...@@ -107,8 +117,8 @@ config SERIAL_8250_EXTENDED ...@@ -107,8 +117,8 @@ config SERIAL_8250_EXTENDED
the questions about serial driver options. If unsure, say N. the questions about serial driver options. If unsure, say N.
config SERIAL_8250_MANY_PORTS config SERIAL_8250_MANY_PORTS
bool "Support more than 4 serial ports" bool "Support more than 4 legacy serial ports"
depends on SERIAL_8250_EXTENDED depends on SERIAL_8250_EXTENDED && !IA64
help help
Say Y here if you have dumb serial boards other than the four Say Y here if you have dumb serial boards other than the four
standard COM 1/2/3/4 ports. This may happen if you have an AST standard COM 1/2/3/4 ports. This may happen if you have an AST
......
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