summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKanoj Sarcar <kanoj@engr.sgi.com>2000-08-31 01:58:45 +0000
committerKanoj Sarcar <kanoj@engr.sgi.com>2000-08-31 01:58:45 +0000
commit691ce1627151a0ceba3f30252f0aa79d8d8b06c1 (patch)
tree7e11a014c7dbb7257bbb7e7a73c0ba4b86e7f55d
parent1e5e4189137e2bae18ea0763bbaf9e6f2ddaf817 (diff)
No more hardcoded serial port addresses. Get the serial driver probing
addresses for ports. Serial driver changes are being sent to Linus.
-rw-r--r--arch/mips64/sgi-ip27/ip27-pci.c16
-rw-r--r--drivers/char/serial.c9
-rw-r--r--include/asm-mips64/serial.h46
3 files changed, 39 insertions, 32 deletions
diff --git a/arch/mips64/sgi-ip27/ip27-pci.c b/arch/mips64/sgi-ip27/ip27-pci.c
index eaf944943..e9cd1d8e4 100644
--- a/arch/mips64/sgi-ip27/ip27-pci.c
+++ b/arch/mips64/sgi-ip27/ip27-pci.c
@@ -316,6 +316,22 @@ pci_fixup_ioc3(struct pci_dev *d)
}
pci_disable_swapping(d);
+
+ /*
+ * The serial driver will try to probe for serial ports
+ * later on. MENET boards dbe out unrecoverably on sio space
+ * access to the 4th ioc3. (The first 3 iocs work okay, they
+ * have kbd/ms ports; all have ethernet ports). Catch this
+ * case now and disable the serial driver from looking at
+ * these ioc3s. Identify MENET cards by seeing if an ioc3 is
+ * at slot 3.
+ */
+ if (PCI_SLOT(d->devfn) == 3) {
+ struct list_head *p;
+ list_for_each(p, &d->bus->devices) {
+ list_entry(p, struct pci_dev, bus_list)->device = 0;
+ }
+ }
}
static void __init
diff --git a/drivers/char/serial.c b/drivers/char/serial.c
index f23f911ad..7b11c8f84 100644
--- a/drivers/char/serial.c
+++ b/drivers/char/serial.c
@@ -4560,6 +4560,9 @@ static struct pci_board pci_boards[] __initdata = {
{ PCI_VENDOR_ID_ROCKWELL, 0x1004,
0x1048, 0x1500,
SPCI_FL_BASE1, 1, 115200 },
+ { PCI_VENDOR_ID_SGI, PCI_DEVICE_ID_SGI_IOC3,
+ 0xFF00, 0, SPCI_FL_BASE0 | SPCI_FL_IRQRESOURCE,
+ 1, 458333, 0, 0, 0, 0x20178 },
#if CONFIG_DDB5074
/*
* NEC Vrc-5074 (Nile 4) builtin UART.
@@ -5282,12 +5285,6 @@ int register_serial(struct serial_struct *req)
break;
}
if (i == NR_PORTS) {
- for (i = 4; i < NR_PORTS; i++)
- if ((rs_table[i].type == PORT_UNKNOWN) &&
- (rs_table[i].count == 0))
- break;
- }
- if (i == NR_PORTS) {
for (i = 0; i < NR_PORTS; i++)
if ((rs_table[i].type == PORT_UNKNOWN) &&
(rs_table[i].count == 0))
diff --git a/include/asm-mips64/serial.h b/include/asm-mips64/serial.h
index 4da0ce949..4d8b7852b 100644
--- a/include/asm-mips64/serial.h
+++ b/include/asm-mips64/serial.h
@@ -10,10 +10,6 @@
#ifndef _ASM_SERIAL_H
#define _ASM_SERIAL_H
-#include <linux/config.h>
-
-#include <asm/sn/sn0/ip27.h>
-
/*
* This assumes you have a 1.8432 MHz clock for your UART.
*
@@ -23,32 +19,30 @@
*/
#define BASE_BAUD (1843200 / 16)
-/* Standard COM flags (except for COM4, because of the 8514 problem) */
-#define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST)
-
/*
+ * Note about serial ports and consoles:
+ * For console output, everyone uses the IOC3 UARTA (offset 0x178)
+ * connected to the master node (look in ip27_setup_console() and
+ * ip27prom_console_write()).
+ *
+ * For serial (/dev/ttyS0 etc), we can not have hardcoded serial port
+ * addresses on a partitioned machine. Since we currently use the ioc3
+ * serial ports, we use dynamic serial port discovery that the serial.c
+ * driver uses for pci/pnp ports (there is an entry for the SGI ioc3
+ * boards in pci_boards[]). Unfortunately, UARTA's pio address is greater
+ * than UARTB's, although UARTA on o200s has traditionally been known as
+ * port 0. So, we just use one serial port from each ioc3 (since the
+ * serial driver adds addresses to get to higher ports).
+ *
+ * Also look in ip27-pci.c:pci_fixuop_ioc3() for some comments on working
+ * around ioc3 oddities in this respect.
+ *
* The IOC3 serials use a 22MHz clock rate with an additional divider by 3.
+ * (IOC3_BAUD = (22000000 / (3*16)))
*/
-#define IOC3_BAUD (22000000 / (3*16))
-#define IOC3_COM_FLAGS (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST)
-
-/* Let the compiler figure out the size. */
-#define RS_TABLE_SIZE
-
-#ifdef CONFIG_SGI_IP27
-#define _ORIGIN_SERIAL_INIT(int, base) \
- { baud_base: IOC3_BAUD, irq: int, flags: IOC3_COM_FLAGS, \
- iomem_base: (u8 *) base, iomem_reg_shift: 0, \
- io_type: SERIAL_IO_MEM }
-#define ORIGIN_SERIAL_PORT_DFNS \
- _ORIGIN_SERIAL_INIT(0, 0x9200000008620178UL), \
- _ORIGIN_SERIAL_INIT(0, 0x9200000008620170UL),
-#else
-#define ORIGIN_SERIAL_PORT_DFNS
-#endif
+#define RS_TABLE_SIZE 64
-#define SERIAL_PORT_DFNS \
- ORIGIN_SERIAL_PORT_DFNS
+#define SERIAL_PORT_DFNS
#endif /* _ASM_SERIAL_H */