Index: arch/parisc/config.in
===================================================================
RCS file: /home/cvs/parisc/linux/arch/parisc/config.in,v
retrieving revision 1.36
diff -u -p -r1.36 config.in
--- arch/parisc/config.in	2001/07/15 20:02:03	1.36
+++ arch/parisc/config.in	2001/10/10 19:59:52
@@ -34,10 +34,8 @@ choice 'Processor family' \
 
 if [ "$CONFIG_PA8X00" = "y" ] ; then
    define_bool CONFIG_PA20 y
-   bool '64-bit kernel' CONFIG_PARISC64 n
-   if [ "$CONFIG_PARISC64" = "y" ] ; then
-      bool '32-bit PDC' CONFIG_PDC_NARROW n
-   fi
+   bool '64-bit kernel' CONFIG_PARISC64
+   dep_bool '32-bit PDC' CONFIG_PDC_NARROW $CONFIG_PARISC64
 else
    define_bool CONFIG_PA11 y
 fi
@@ -51,20 +49,19 @@ bool 'Symmetric multi-processing support
 bool 'Kernel Debugger support' CONFIG_KWDB
 # define_bool CONFIG_KWDB n
 
-bool 'GSC/Gecko bus support' CONFIG_GSC y
+bool 'U2/Uturn I/O MMU' CONFIG_IOMMU_CCIO
+bool 'GSC bus support' CONFIG_GSC
+dep_bool '  Lasi I/O support' CONFIG_GSC_LASI $CONFIG_GSC
+dep_bool '  Wax I/O support' CONFIG_GSC_WAX $CONFIG_GSC
 
-bool 'U2/Uturn I/O MMU' CONFIG_IOMMU_CCIO y
-bool 'LASI I/O support' CONFIG_GSC_LASI y
-bool 'WAX support' CONFIG_GSC_WAX y
+bool 'EISA support' CONFIG_EISA
+bool 'PCI support' CONFIG_PCI
 
-bool 'PCI or EISA bus support' CONFIG_PCI y
-
 if [ "$CONFIG_PCI" = "y" ]; then
-   bool '  GSCtoPCI/DINO PCI support' CONFIG_GSC_DINO y
-   bool '  LBA/Elroy PCI support' CONFIG_PCI_LBA n
+   dep_bool '  GSCtoPCI/Dino PCI support' CONFIG_GSC_DINO $CONFIG_GSC
+   bool '  LBA/Elroy PCI support' CONFIG_PCI_LBA
 #   bool '  EPIC PCI support' CONFIG_PCI_EPIC n
-   dep_bool '  WAX EISA support' CONFIG_WAX_EISA y $CONFIG_GSC_WAX
-   bool '  SuperIO support' CONFIG_SUPERIO n
+   bool '  SuperIO support' CONFIG_SUPERIO
 fi 
 
 if [ "$CONFIG_PCI_LBA" = "y" ]; then
@@ -74,7 +71,7 @@ fi
 
 source drivers/pci/Config.in
 
-bool 'Chassis LCD and LED support' CONFIG_CHASSIS_LCD_LED y
+bool 'Chassis LCD and LED support' CONFIG_CHASSIS_LCD_LED
 
 endmenu
 
Index: arch/parisc/kernel/lba_pci.c
===================================================================
RCS file: /home/cvs/parisc/linux/arch/parisc/kernel/lba_pci.c,v
retrieving revision 1.37
diff -u -p -r1.37 lba_pci.c
--- arch/parisc/kernel/lba_pci.c	2001/10/05 20:32:03	1.37
+++ arch/parisc/kernel/lba_pci.c	2001/10/10 19:59:53
@@ -1474,8 +1474,7 @@ void __init lba_init(void)
 void __init
 lba_init_iregs(void *sba_hpa, u32 ibase, u32 imask)
 {
-	extern struct pci_hba_data *hba_list;	/* arch/parisc/kernel/pci.c */
-	struct pci_hba_data *lba;
+	int i;
 
 	imask <<= 2;	/* adjust for hints - 2 more bits */
 
@@ -1486,10 +1485,10 @@ lba_init_iregs(void *sba_hpa, u32 ibase,
 	**      determine which LBA's belong to the caller's SBA.
 	** IS_ASTRO: just assume only one SBA for now.
 	*/
-	ASSERT(NULL != hba_list);
 	DBG("%s() ibase 0x%x imask 0x%x\n", __FUNCTION__, ibase, imask);
 
-	for (lba = hba_list; NULL != lba; lba = lba->next) {
+	for (i = 1; i < pci_hba_count; i++) {
+		struct pci_hba_data *lba = &parisc_pci_hba[i];
 		DBG("%s() base_addr %p\n", __FUNCTION__, lba->base_addr);
 		WRITE_REG32( imask, lba->base_addr + LBA_IMASK);
 		WRITE_REG32( ibase, lba->base_addr + LBA_IBASE);
Index: arch/parisc/kernel/pci.c
===================================================================
RCS file: /home/cvs/parisc/linux/arch/parisc/kernel/pci.c,v
retrieving revision 1.27
diff -u -p -r1.27 pci.c
--- arch/parisc/kernel/pci.c	2001/09/18 16:12:08	1.27
+++ arch/parisc/kernel/pci.c	2001/10/10 19:59:53
@@ -9,6 +9,7 @@
  * Copyright (C) 1999-2001 Hewlett-Packard Company
  * Copyright (C) 1999-2001 Grant Grundler
  */
+#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
 #include <linux/init.h>		/* for __init and __devinit */
@@ -16,6 +17,7 @@
 #include <linux/spinlock.h>
 #include <linux/string.h>	/* for memcpy() */
 
+#include <asm/io.h>
 #include <asm/system.h>
 #include <asm/cache.h>		/* for L1_CACHE_BYTES */
 #include <asm/pdc.h>         /* for is_pdc_pat() macro */
@@ -49,14 +51,14 @@ int pci_post_reset_delay = 50;
 struct pci_port_ops *pci_port;
 struct pci_bios_ops *pci_bios;
 
-struct pci_hba_data *hba_list;
-static int hba_count;
+/* NB: hba 0 is reserved for EISA */
+int pci_hba_count = 1;
 
 /*
 ** parisc_pci_hba used by pci_port->in/out() ops to lookup bus data.
 */
 #define PCI_HBA_MAX 32
-static struct pci_hba_data *parisc_pci_hba[PCI_HBA_MAX];
+struct pci_hba_data *parisc_pci_hba[PCI_HBA_MAX];
 
 
 /********************************************************************
@@ -65,17 +67,27 @@ static struct pci_hba_data *parisc_pci_h
 **
 *********************************************************************/
 
-/* KLUGE : inb needs to be defined differently for PCI devices than
-** for other bus interfaces. Doing this at runtime sucks but is the
-** only way one driver binary can support devices on different bus types.
-**
-*/
+/* EISA port numbers and PCI port numbers share the same interface.  Some
+ * machines have both EISA and PCI adapters installed.  Rather than turn
+ * pci_port into an array, we reserve bus 0 for EISA and call the EISA
+ * routines if the access is to a port on bus 0.  Many EISA and ISA drivers
+ * assume that port space is <= 0xffff anyway, so we don't have to fix them.
+ */
 
+#ifdef CONFIG_EISA
+#define EISA_IN(size) if (b == 0) return eisa_in##size(addr)
+#define EISA_OUT(size) if (b == 0) return eisa_out##size(d, addr)
+#else
+#define EISA_IN(size)
+#define EISA_OUT(size)
+#endif
+
 #define PCI_PORT_IN(type, size) \
 u##size in##type (int addr) \
 { \
 	int b = PCI_PORT_HBA(addr); \
 	u##size d = (u##size) -1; \
+	EISA_IN(size); \
 	ASSERT(pci_port); /* make sure services are defined */ \
 	ASSERT(parisc_pci_hba[b]); /* make sure ioaddr are "fixed up" */ \
 	if (parisc_pci_hba[b] == NULL) { \
@@ -95,6 +107,7 @@ PCI_PORT_IN(l, 32)
 void out##type (u##size d, int addr) \
 { \
 	int b = PCI_PORT_HBA(addr); \
+	EISA_OUT(size); \
 	ASSERT(pci_port); \
 	pci_port->out##type(parisc_pci_hba[b], PCI_PORT_ADDR(addr), d); \
 }
@@ -127,7 +140,7 @@ void pcibios_fixup_bus(struct pci_bus *b
 	ASSERT(pci_bios != NULL);
 
 	if (pci_bios->fixup_bus) {
-		(*pci_bios->fixup_bus)(bus);
+		pci_bios->fixup_bus(bus);
 	} else {
 		printk(KERN_WARNING "pci_bios != NULL but fixup_bus() is!\n");
 	}
@@ -493,14 +506,9 @@ pcibios_assign_unassigned_resources(stru
 */
 void pcibios_register_hba(struct pci_hba_data *hba)
 {
-	hba->next = hba_list;
-	hba_list = hba;
-
-	ASSERT(hba_count < PCI_HBA_MAX);
+	ASSERT(pci_hba_count < PCI_HBA_MAX);
 
-	/*
-	** pci_port->in/out() uses parisc_pci_hba to lookup parameter.
-	*/
-	parisc_pci_hba[hba_count] = hba;
-	hba->hba_num = hba_count++;
+	/* pci_port->in/out() uses parisc_pci_hba to lookup parameter. */
+	parisc_pci_hba[pci_hba_count] = hba;
+	hba->hba_num = pci_hba_count++;
 }
Index: arch/parisc/kernel/setup.c
===================================================================
RCS file: /home/cvs/parisc/linux/arch/parisc/kernel/setup.c,v
retrieving revision 1.91
diff -u -p -r1.91 setup.c
--- arch/parisc/kernel/setup.c	2001/09/17 22:13:51	1.91
+++ arch/parisc/kernel/setup.c	2001/10/10 19:59:53
@@ -181,6 +181,7 @@ extern void dino_init(void);
 extern void iosapic_init(void);
 extern void lba_init(void);
 extern void sba_init(void);
+extern void eisa_init(void);
 
 void __init parisc_init(void)
 {
@@ -210,8 +211,12 @@ void __init parisc_init(void)
 #if defined(CONFIG_GSC_DINO)
 	dino_init();
 #endif
+#ifdef CONFIG_EISA
+	eisa_init();
+#endif
 
-#ifdef CONFIG_GSC_LASI
+#if defined(CONFIG_GSC_LASI) || defined(CONFIG_GSC_DINO) \
+		|| defined(CONFIG_GSC_WAX)
 	busdevices_init();
 #endif
 
Index: arch/parisc/mm/ioremap.c
===================================================================
RCS file: /home/cvs/parisc/linux/arch/parisc/mm/ioremap.c,v
retrieving revision 1.5
diff -u -p -r1.5 ioremap.c
--- arch/parisc/mm/ioremap.c	2001/07/14 21:17:04	1.5
+++ arch/parisc/mm/ioremap.c	2001/10/10 19:59:53
@@ -110,6 +110,13 @@ void * __ioremap(unsigned long phys_addr
 {
 #if !(USE_HPPA_IOREMAP)
 
+	unsigned long end = phys_addr + size - 1;
+	/* Support EISA addresses */
+	if ((phys_addr >= 0x00080000 && end < 0x000fffff)
+			|| (phys_addr >= 0x00500000 && end < 0x03bfffff)) {
+		phys_addr |= 0xfc000000;
+	}
+
 	return (void *)phys_addr;
 
 #else
Index: drivers/gsc/Makefile
===================================================================
RCS file: /home/cvs/parisc/linux/drivers/gsc/Makefile,v
retrieving revision 1.10
diff -u -p -r1.10 Makefile
--- drivers/gsc/Makefile	2001/08/28 01:16:16	1.10
+++ drivers/gsc/Makefile	2001/10/10 19:59:53
@@ -16,10 +16,10 @@ obj-m :=
 obj-n :=
 obj-  :=
 
-obj-$(CONFIG_GSC_DINO) += dino.o
+obj-$(CONFIG_GSC_DINO) += busdevice.o dino.o
 obj-$(CONFIG_GSC_LASI) += busdevice.o lasi.o asp.o
-obj-$(CONFIG_GSC_WAX) += wax.o
+obj-$(CONFIG_GSC_WAX) += busdevice.o wax.o
 obj-$(CONFIG_SERIAL) += serial.o
-obj-$(CONFIG_WAX_EISA) += wax_eisa.o
+obj-$(CONFIG_EISA) += eisa.o
 
 include $(TOPDIR)/Rules.make
Index: drivers/gsc/busdevice.c
===================================================================
RCS file: /home/cvs/parisc/linux/drivers/gsc/busdevice.c,v
retrieving revision 1.25
diff -u -p -r1.25 busdevice.c
--- drivers/gsc/busdevice.c	2001/08/30 16:48:59	1.25
+++ drivers/gsc/busdevice.c	2001/10/10 19:59:53
@@ -224,10 +224,9 @@ int register_busdevice( struct parisc_de
 	return 0;
 }
 
-extern void register_wax_driver(void);
-extern void register_wax_eisa_driver(void);
 extern struct parisc_driver lasi_driver;
 extern struct parisc_driver asp_driver;
+extern struct parisc_driver wax_driver;
 
 void __init busdevices_init(void)
 {
@@ -236,10 +235,6 @@ void __init busdevices_init(void)
 	register_parisc_driver(&asp_driver);
 #endif
 #ifdef CONFIG_GSC_WAX
-	register_wax_driver();
-#endif
-
-#ifdef CONFIG_WAX_EISA
-	register_wax_eisa_driver();
+	register_parisc_driver(&wax_driver);
 #endif
 }
Index: drivers/gsc/eisa.c
===================================================================
RCS file: eisa.c
diff -N eisa.c
--- /dev/null	Tue May  5 14:32:27 1998
+++ drivers/gsc/eisa.c	Wed Oct 10 13:59:53 2001
@@ -0,0 +1,126 @@
+/*
+ * eisa.c - provide support for EISA adapters in PA-RISC machines
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ *
+ * Copyright (c) 2001 Matthew Wilcox for Hewlett Packard
+ *
+ * There are two distinct EISA adapters.  Mongoose is found in machines
+ * up to the 712; then the Wax ASIC is used.  To complicate matters, the
+ * Wax ASIC also includes a PS/2 and RS-232 controller, but those are
+ * dealt with elsewhere; this file is concerned only with the EISA portions
+ * of Wax.
+ */
+
+#include <linux/init.h>
+#include <linux/ioport.h>
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/pci.h>
+
+#include <asm/byteorder.h>
+#include <asm/gsc.h>
+#include <asm/hardware.h>
+#include <asm/processor.h>
+
+/* We can only have one EISA adapter in the system because neither
+ * implementation can be flexed.
+ */
+struct eisa_ba {
+	struct resource mem;
+} eisa_dev;
+
+/* Port ops */
+
+static inline unsigned long eisa_permute(u16 port)
+{
+	if (port & 0x300) {
+		return 0xfc000000 | ((port & 0xfc00) >> 6)
+			| ((port & 0x3f8) << 9) | (port & 7);
+	} else {
+		return 0xfc000000 | port;
+	}
+}
+
+u8 eisa_in8(u16 port)
+{
+	if (EISA_bus)
+		return gsc_readb(eisa_permute(port));
+	return 0xff;
+}
+
+u16 eisa_in16(u16 port)
+{
+	if (EISA_bus)
+		return le16_to_cpu(gsc_readw(eisa_permute(port)));
+	return 0xffff;
+}
+
+u32 eisa_in32(u16 port)
+{
+	if (EISA_bus)
+		return le32_to_cpu(gsc_readl(eisa_permute(port)));
+	return 0xffffffff;
+}
+
+void eisa_out8(u8 data, u16 port)
+{
+	if (EISA_bus)
+		gsc_writeb(data, eisa_permute(port));
+}
+
+void eisa_out16(u16 data, u16 port)
+{
+	if (EISA_bus)
+		gsc_writew(cpu_to_le16(data), eisa_permute(port));
+}
+
+void eisa_out32(u32 data, u16 port)
+{
+	if (EISA_bus)
+		gsc_writel(cpu_to_le32(data), eisa_permute(port));
+}
+
+static int __devinit eisa_probe(struct parisc_device *dev)
+{
+	int result;
+	char *name = (dev->id.sversion == 0x00076) ? "Mongoose" : "Wax";
+
+	printk("%s EISA Adapter found at 0x%08lx\n", name, dev->hpa);
+
+	eisa_dev.mem.name = "EISA Bus";
+	eisa_dev.mem.start = 0xfc000000;
+	eisa_dev.mem.end = 0xffbfffff;
+	eisa_dev.mem.flags = IORESOURCE_MEM;
+	result = request_resource(&iomem_resource, &eisa_dev.mem);
+	if (result < 0) {
+		printk(KERN_ERR "EISA: failed to claim EISA Bus address space!\n");
+		return result;
+	}
+
+	EISA_bus = 1;
+
+	return 0;
+}
+
+static struct parisc_device_id __devinitdata eisa_tbl[] = {
+	{ HPHW_BA, HVERSION_REV_ANY_ID, HVERSION_ANY_ID, 0x00076 }, /* Mongoose */
+	{ HPHW_BA, HVERSION_REV_ANY_ID, HVERSION_ANY_ID, 0x00090 }, /* Wax EISA */
+	{ 0, }
+}
+
+MODULE_DEVICE_TABLE(parisc, eisa_tbl);
+
+static struct parisc_driver eisa_driver = {
+	name:		"EISA Bus Adapter",
+	id_table:	eisa_tbl,
+	probe:		eisa_probe,
+};
+
+void __init eisa_init(void)
+{
+	register_parisc_driver(&eisa_driver);
+}
Index: drivers/gsc/wax.c
===================================================================
RCS file: /home/cvs/parisc/linux/drivers/gsc/wax.c,v
retrieving revision 1.11
diff -u -p -r1.11 wax.c
--- drivers/gsc/wax.c	2001/08/14 16:54:54	1.11
+++ drivers/gsc/wax.c	2001/10/10 19:59:53
@@ -148,13 +148,8 @@ static struct parisc_device_id wax_tbl[]
 
 MODULE_DEVICE_TABLE(parisc, wax_tbl);
 
-static struct parisc_driver wax_driver = {
+struct parisc_driver wax_driver = {
 	name:		"Wax",
 	id_table:	wax_tbl,
 	probe:		wax_init_chip,
 };
-
-int __init register_wax_driver(void) 
-{
-	return register_parisc_driver(&wax_driver);
-}
Index: include/asm-parisc/io.h
===================================================================
RCS file: /home/cvs/parisc/linux/include/asm-parisc/io.h,v
retrieving revision 1.22
diff -u -p -r1.22 io.h
--- include/asm-parisc/io.h	2001/07/15 22:30:29	1.22
+++ include/asm-parisc/io.h	2001/10/10 19:59:53
@@ -42,18 +42,50 @@
 #define writel(b,addr) gsc_writel(b,addr)
 #endif /* USE_HPPA_IOREMAP */
 
-#if defined(CONFIG_PCI) || defined(CONFIG_ISA)
-/*
- *	So we get clear link errors 
- */
-extern unsigned char inb(unsigned long addr);
-extern unsigned short inw(unsigned long addr);
-extern unsigned int inl(unsigned long addr);
-
-extern void outb(unsigned char b, unsigned long addr);
-extern void outw(unsigned short b, unsigned long addr);
-extern void outl(unsigned int b, unsigned long addr);
-
+extern char eisa_in8(short port);
+extern short eisa_in16(short port);
+extern int eisa_in32(short port);
+extern void eisa_out8(char data, short port);
+extern void eisa_out16(short data, short port);
+extern void eisa_out32(int data, short port);
+
+#if defined(CONFIG_PCI)
+extern unsigned char inb(int addr);
+extern unsigned short inw(int addr);
+extern unsigned int inl(int addr);
+
+extern void outb(unsigned char b, int addr);
+extern void outw(unsigned short b, int addr);
+extern void outl(unsigned int b, int addr);
+#elif defined(CONFIG_EISA)
+#define inb eisa_in8
+#define inw eisa_in16
+#define inl eisa_in32
+#define outb eisa_out8
+#define outw eisa_out16
+#define outl eisa_out32
+#else
+static inline char inb(unsigned long addr)
+{
+	BUG();
+	return -1;
+}
+
+static inline short inw(unsigned long addr)
+{
+	BUG();
+	return -1;
+}
+
+static inline int inl(unsigned long addr)
+{
+	BUG();
+	return -1
+}
+
+#define outb(x, y)	BUG()
+#define outw(x, y)	BUG()
+#define outl(x, y)	BUG()
 #endif
 
 extern void memcpy_fromio(void *dest, unsigned long src, int count);
@@ -74,7 +106,20 @@ extern void outsl (unsigned long port, c
 /* IO Port space is :      BBiiii   where BB is HBA number. */
 #define IO_SPACE_LIMIT 0x00ffffff
 
+/* Support old drivers which don't ioremap.
+ * NB this interface is scheduled to disappear in 2.5
+ */
 
+#define EISA_BASE 0xfffffffffc000000UL
+#define isa_readb(a) readb(EISA_BASE | (a))
+#define isa_readw(a) readw(EISA_BASE | (a))
+#define isa_readl(a) readl(EISA_BASE | (a))
+#define isa_writeb(b,a) writeb((b), EISA_BASE | (a))
+#define isa_writew(b,a) writew((b), EISA_BASE | (a))
+#define isa_writel(b,a) writel((b), EISA_BASE | (a))
+#define isa_memset_io(a,b,c) memset_io(EISA_BASE | (a), (b), (c))
+#define isa_memcpy_fromio(a,b,c) memcpy_fromio((a), EISA_BASE | (b), (c))
+#define isa_memcpy_toio(a,b,c) memcpy_toio(EISA_BASE | (a), (b), (c))
 
 /* Right now we don't support Dino-on-a-card and V class which do PCI MMIO
  * through address/data registers. */
Index: include/asm-parisc/pci.h
===================================================================
RCS file: /home/cvs/parisc/linux/include/asm-parisc/pci.h,v
retrieving revision 1.30
diff -u -p -r1.30 pci.h
--- include/asm-parisc/pci.h	2001/09/18 16:12:11	1.30
+++ include/asm-parisc/pci.h	2001/10/10 19:59:53
@@ -46,7 +46,6 @@
 ** Data needed by pcibios layer belongs here.
 */
 struct pci_hba_data {
-	struct pci_hba_data *next;	/* global chain of HBAs */
 	unsigned long	base_addr;	/* aka Host Physical Address */
 	const struct parisc_device_id *iodc_info; /* Info from PA bus walk */
 	struct pci_bus *hba_bus;	/* primary PCI bus below HBA */
@@ -205,12 +204,12 @@ static inline int pci_dma_panic(char *ms
 extern struct pci_port_ops *pci_port;
 extern struct pci_bios_ops *pci_bios;
 extern int pci_post_reset_delay;	/* delay after de-asserting #RESET */
+extern int pci_hba_count;
+extern struct pci_hba_data *parisc_pci_hba[];
 
 extern void pcibios_register_hba(struct pci_hba_data *);
 extern void pcibios_set_master(struct pci_dev *);
-#ifdef __LP64__
 extern void pcibios_assign_unassigned_resources(struct pci_bus *);
-#endif
 
 /*
 ** used by drivers/pci/pci.c:pci_do_scan_bus()
