
Updates for drivers/parisc.  Mostly conversion to generic device model.

diff -urpNX build-tools/dontdiff linus-2.5/drivers/parisc/Kconfig parisc-2.5/drivers/parisc/Kconfig
--- linus-2.5/drivers/parisc/Kconfig	Mon Nov 11 12:48:13 2002
+++ parisc-2.5/drivers/parisc/Kconfig	Fri Nov 15 08:40:36 2002
@@ -10,6 +10,13 @@ config GSC
 	  are not found in B1000, C3000, J5000, A500, L1000, N4000 and upwards.
 	  If in doubt, say "Y".
 
+config HPPB
+	bool "HP-PB bus support"
+	depends on GSC
+	help
+	  The HP-PB bus was used in the Nova class and K-class servers.
+	  If in doubt, say "Y"
+
 config IOMMU_CCIO
 	bool "U2/Uturn I/O MMU"
 	depends on GSC
@@ -60,6 +67,8 @@ config PCI
 	  Beware that some GSC cards have a Dino onboard and PCI inside them,
 	  so it may be safest to say "Y" anyway.
 
+source "drivers/pci/Kconfig"
+
 config GSC_DINO
 	bool "GSCtoPCI/Dino PCI support"
 	depends on PCI && GSC
@@ -82,22 +91,21 @@ config PCI_LBA
 config IOSAPIC
 	bool
 	depends on PCI_LBA
-	default y
+	default PCI_LBA
 
 config IOMMU_SBA
 	bool
 	depends on PCI_LBA
-	default y
-
-source "drivers/pci/Kconfig"
+	default PCI_LBA
 
 #config PCI_EPIC
 #	bool "EPIC/SAGA PCI support"
 #	depends on PCI
 
 config SUPERIO
-	bool
+	bool "SuperIO (SuckyIO) support"
 	depends on PCI
+	default y
 	help
 	  Say Y here to support the SuperIO chip found in Bxxxx, C3xxx and
 	  J5xxx+ machines. This enables IDE, Floppy, Parallel Port, and
@@ -105,6 +113,7 @@ config SUPERIO
 
 config CHASSIS_LCD_LED
 	bool "Chassis LCD and LED support"
+	default y
 	help
 	  Say Y here if you want to enable support for the Heartbeat,
 	  Disk/Network activities LEDs on some PA-RISC machines,
diff -urpNX build-tools/dontdiff linus-2.5/drivers/parisc/Makefile parisc-2.5/drivers/parisc/Makefile
--- linus-2.5/drivers/parisc/Makefile	Sun Jan  5 11:02:05 2003
+++ parisc-2.5/drivers/parisc/Makefile	Sun Jan  5 11:19:41 2003
@@ -2,24 +2,32 @@
 # Makefile for most of the non-PCI devices in PA-RISC machines
 #
 
-export-objs	:= gsc.o superio.o
+export-objs			:= gsc.o superio.o
 
-obj-y := gsc.o power.o
+obj-y :=
 obj-m :=
 obj-n :=
 obj-  :=
 
-obj-$(CONFIG_GSC_DINO) += dino.o
-obj-$(CONFIG_GSC_LASI) += lasi.o asp.o
-obj-$(CONFIG_GSC_WAX) += wax.o
-obj-$(CONFIG_EISA) += eisa.o eisa_enumerator.o eisa_eeprom.o
-obj-$(CONFIG_SUPERIO) += superio.o
-obj-$(CONFIG_PCI_LBA) += lba_pci.o
 # I/O SAPIC is also on IA64 platforms.
 # The two could be merged into a common source some day.
-obj-$(CONFIG_IOSAPIC) += iosapic.o
-obj-$(CONFIG_IOMMU_SBA) += sba_iommu.o
+obj-$(CONFIG_IOSAPIC)		+= iosapic.o
+obj-$(CONFIG_IOMMU_SBA)		+= sba_iommu.o
+obj-$(CONFIG_PCI_LBA)		+= lba_pci.o
+
 # Only use one of them: ccio-rm-dma is for PCX-W systems *only*
-# obj-$(CONFIG_IOMMU_CCIO) += ccio-rm-dma.o
-obj-$(CONFIG_IOMMU_CCIO) += ccio-dma.o
-obj-$(CONFIG_CHASSIS_LCD_LED) += led.o
+# obj-$(CONFIG_IOMMU_CCIO)	+= ccio-rm-dma.o
+obj-$(CONFIG_IOMMU_CCIO)	+= ccio-dma.o
+
+obj-y				+= gsc.o
+
+obj-$(CONFIG_HPPB)		+= hppb.o
+obj-$(CONFIG_GSC_DINO)		+= dino.o
+obj-$(CONFIG_GSC_LASI)		+= lasi.o asp.o
+obj-$(CONFIG_GSC_WAX)		+= wax.o
+obj-$(CONFIG_EISA)		+= eisa.o eisa_enumerator.o eisa_eeprom.o
+
+obj-$(CONFIG_SUPERIO)		+= superio.o
+obj-$(CONFIG_CHASSIS_LCD_LED)	+= led.o
+obj-y				+= power.o
+
diff -urpNX build-tools/dontdiff linus-2.5/drivers/parisc/asp.c parisc-2.5/drivers/parisc/asp.c
--- linus-2.5/drivers/parisc/asp.c	Sun Jan  5 11:02:05 2003
+++ parisc-2.5/drivers/parisc/asp.c	Sun Jan  5 11:19:41 2003
@@ -76,6 +76,8 @@ asp_init_chip(struct parisc_device *dev)
 
 	printk(KERN_INFO "%s version %d at 0x%lx found.\n", 
 		asp->name, asp->version, dev->hpa);
+	snprintf(dev->dev.name, sizeof(dev->dev.name), "%s version %d",
+		 asp->name, asp->version);
 
 	/* the IRQ ASP should use */
 	ret = -EBUSY;
diff -urpNX build-tools/dontdiff linus-2.5/drivers/parisc/ccio-dma.c parisc-2.5/drivers/parisc/ccio-dma.c
--- linus-2.5/drivers/parisc/ccio-dma.c	Sun Jan  5 11:02:05 2003
+++ parisc-2.5/drivers/parisc/ccio-dma.c	Sun Jan  5 11:19:41 2003
@@ -50,6 +50,7 @@
 #include <asm/dma.h>
 #include <asm/io.h>
 #include <asm/hardware.h>       /* for register_module() */
+#include <asm/parisc-device.h>
 
 /* 
 ** Choose "ccio" since that's what HP-UX calls it.
@@ -599,7 +600,7 @@ ccio_mark_invalid(struct ioc *ioc, dma_a
  * This function implements the pci_dma_supported function.
  */
 static int 
-ccio_dma_supported(struct pci_dev *dev, u64 mask)
+ccio_dma_supported(struct device *dev, u64 mask)
 {
 	if(dev == NULL) {
 		printk(KERN_ERR MODULE_NAME ": EISA/ISA/et al not supported\n");
@@ -607,8 +608,6 @@ ccio_dma_supported(struct pci_dev *dev, 
 		return 0;
 	}
 
-	dev->dma_mask = mask;   /* save it */
-
 	/* only support 32-bit devices (ie PCI/GSC) */
 	return (int)(mask == 0xffffffffUL);
 }
@@ -623,7 +622,8 @@ ccio_dma_supported(struct pci_dev *dev, 
  * This function implements the pci_map_single function.
  */
 static dma_addr_t 
-ccio_map_single(struct pci_dev *dev, void *addr, size_t size, int direction)
+ccio_map_single(struct device *dev, void *addr, size_t size,
+		enum dma_data_direction direction)
 {
 	int idx;
 	struct ioc *ioc;
@@ -631,11 +631,9 @@ ccio_map_single(struct pci_dev *dev, voi
 	dma_addr_t iovp;
 	dma_addr_t offset;
 	u64 *pdir_start;
-	unsigned long hint = hint_lookup[direction];
+	unsigned long hint = hint_lookup[(int)direction];
 
-	ASSERT(dev);
-	ASSERT(dev->sysdata);
-	ASSERT(HBA_DATA(dev->sysdata)->iommu);
+	BUG_ON(!dev);
 	ioc = GET_IOC(dev);
 
 	ASSERT(size > 0);
@@ -692,16 +690,14 @@ ccio_map_single(struct pci_dev *dev, voi
  * This function implements the pci_unmap_single function.
  */
 static void 
-ccio_unmap_single(struct pci_dev *dev, dma_addr_t iova, size_t size, 
-		  int direction)
+ccio_unmap_single(struct device *dev, dma_addr_t iova, size_t size, 
+		  enum dma_data_direction direction)
 {
 	struct ioc *ioc;
 	unsigned long flags; 
 	dma_addr_t offset = iova & ~IOVP_MASK;
 	
-	ASSERT(dev);
-	ASSERT(dev->sysdata);
-	ASSERT(HBA_DATA(dev->sysdata)->iommu);
+	BUG_ON(!dev);
 	ioc = GET_IOC(dev);
 
 	DBG_RUN("%s() iovp 0x%lx/%x\n",
@@ -732,7 +728,7 @@ ccio_unmap_single(struct pci_dev *dev, d
  * This function implements the pci_alloc_consistent function.
  */
 static void * 
-ccio_alloc_consistent(struct pci_dev *dev, size_t size, dma_addr_t *dma_handle)
+ccio_alloc_consistent(struct device *dev, size_t size, dma_addr_t *dma_handle)
 {
       void *ret;
 #if 0
@@ -765,7 +761,7 @@ ccio_alloc_consistent(struct pci_dev *de
  * This function implements the pci_free_consistent function.
  */
 static void 
-ccio_free_consistent(struct pci_dev *dev, size_t size, void *cpu_addr, 
+ccio_free_consistent(struct device *dev, size_t size, void *cpu_addr, 
 		     dma_addr_t dma_handle)
 {
 	ccio_unmap_single(dev, dma_handle, size, 0);
@@ -964,17 +960,15 @@ ccio_coalesce_chunks(struct ioc *ioc, st
  * This function implements the pci_map_sg function.
  */
 static int
-ccio_map_sg(struct pci_dev *dev, struct scatterlist *sglist, int nents, 
-	    int direction)
+ccio_map_sg(struct device *dev, struct scatterlist *sglist, int nents, 
+	    enum dma_data_direction direction)
 {
 	struct ioc *ioc;
 	int coalesced, filled = 0;
 	unsigned long flags;
-	unsigned long hint = hint_lookup[direction];
+	unsigned long hint = hint_lookup[(int)direction];
 	
-	ASSERT(dev);
-	ASSERT(dev->sysdata);
-	ASSERT(HBA_DATA(dev->sysdata)->iommu);
+	BUG_ON(!dev);
 	ioc = GET_IOC(dev);
 	
 	DBG_RUN_SG("%s() START %d entries\n", __FUNCTION__, nents);
@@ -1032,14 +1026,12 @@ ccio_map_sg(struct pci_dev *dev, struct 
  * This function implements the pci_unmap_sg function.
  */
 static void 
-ccio_unmap_sg(struct pci_dev *dev, struct scatterlist *sglist, int nents, 
-	      int direction)
+ccio_unmap_sg(struct device *dev, struct scatterlist *sglist, int nents, 
+	      enum dma_data_direction direction)
 {
 	struct ioc *ioc;
 
-	ASSERT(dev);
-	ASSERT(dev->sysdata);
-	ASSERT(HBA_DATA(dev->sysdata)->iommu);
+	BUG_ON(!dev);
 	ioc = GET_IOC(dev);
 
 	DBG_RUN_SG("%s() START %d entries,  %08lx,%x\n",
@@ -1062,16 +1054,17 @@ ccio_unmap_sg(struct pci_dev *dev, struc
 	DBG_RUN_SG("%s() DONE (nents %d)\n", __FUNCTION__, nents);
 }
 
-static struct pci_dma_ops ccio_ops = {
-	ccio_dma_supported,
-	ccio_alloc_consistent,
-	ccio_free_consistent,
-	ccio_map_single,
-	ccio_unmap_single,
-	ccio_map_sg,
-	ccio_unmap_sg,
-	NULL,                   /* dma_sync_single : NOP for U2/Uturn */
-	NULL,                   /* dma_sync_sg     : ditto */
+static struct hppa_dma_ops ccio_ops = {
+	.dma_supported =	ccio_dma_supported,
+	.alloc_consistent =	ccio_alloc_consistent,
+	.alloc_noncoherent =	ccio_alloc_consistent,
+	.free_consistent =	ccio_free_consistent,
+	.map_single =		ccio_map_single,
+	.unmap_single =		ccio_unmap_single,
+	.map_sg = 		ccio_map_sg,
+	.unmap_sg = 		ccio_unmap_sg,
+	.dma_sync_single =	NULL,	/* NOP for U2/Uturn */
+	.dma_sync_sg =		NULL,	/* ditto */
 };
 
 #ifdef CONFIG_PROC_FS
@@ -1529,6 +1522,7 @@ static int ccio_probe(struct parisc_devi
 	memset(ioc, 0, sizeof(struct ioc));
 
 	ioc->name = dev->id.hversion == U2_IOA_RUNWAY ? "U2" : "UTurn";
+	strncpy(dev->dev.name, ioc->name, sizeof(dev->dev.name));
 
 	printk(KERN_INFO "Found %s at 0x%lx\n", ioc->name, dev->hpa);
 
@@ -1542,6 +1536,12 @@ static int ccio_probe(struct parisc_devi
 	ccio_ioc_init(ioc);
 	ccio_init_resources(ioc);
 	hppa_dma_ops = &ccio_ops;
+	dev->dev.platform_data = kmalloc(sizeof(struct pci_hba_data), GFP_KERNEL);
+
+	/* if this fails, no I/O cards will work, so may as well bug */
+	BUG_ON(dev->dev.platform_data == NULL);
+	HBA_DATA(dev->dev.platform_data)->iommu = ioc;
+	
 
 	if (ioc_count == 0) {
 		/* XXX: Create separate entries for each ioc */
@@ -1577,13 +1577,13 @@ struct pci_dev * ccio_get_fake(const str
 	}
 	memset(ioc->fake_pci_dev, 0, sizeof(struct pci_dev));
 
-	ioc->fake_pci_dev->sysdata = kmalloc(sizeof(struct pci_hba_data), GFP_KERNEL);
-	if(ioc->fake_pci_dev->sysdata == NULL) {
+	ioc->fake_pci_dev->dev.platform_data = kmalloc(sizeof(struct pci_hba_data), GFP_KERNEL);
+	if(ioc->fake_pci_dev->dev.platform_data == NULL) {
 		printk(KERN_ERR MODULE_NAME ": memory allocation failure\n");
 		return NULL;
 	}
 
-	HBA_DATA(ioc->fake_pci_dev->sysdata)->iommu = ioc;
+	HBA_DATA(ioc->fake_pci_dev->dev.platform_data)->iommu = ioc;
 	return ioc->fake_pci_dev;
 }
 
@@ -1595,7 +1595,7 @@ static struct parisc_device_id ccio_tbl[
 };
 
 static struct parisc_driver ccio_driver = {
-	.name =		"U2/Uturn",
+	.name =		"U2:Uturn",
 	.id_table =	ccio_tbl,
 	.probe =	ccio_probe,
 };
diff -urpNX build-tools/dontdiff linus-2.5/drivers/parisc/ccio-rm-dma.c parisc-2.5/drivers/parisc/ccio-rm-dma.c
--- linus-2.5/drivers/parisc/ccio-rm-dma.c	Mon Nov 11 12:48:13 2002
+++ parisc-2.5/drivers/parisc/ccio-rm-dma.c	Wed Nov 27 09:14:02 2002
@@ -74,8 +74,6 @@ static int ccio_dma_supported( struct pc
 		return(0);
 	}
 
-	dev->dma_mask = mask;   /* save it */
-
 	/* only support 32-bit devices (ie PCI/GSC) */
 	return((int) (mask >= 0xffffffffUL));
 }
diff -urpNX build-tools/dontdiff linus-2.5/drivers/parisc/dino.c parisc-2.5/drivers/parisc/dino.c
--- linus-2.5/drivers/parisc/dino.c	Sun Jan  5 11:02:05 2003
+++ parisc-2.5/drivers/parisc/dino.c	Sun Jan  5 11:19:41 2003
@@ -168,7 +168,7 @@ struct dino_device
 static int dino_cfg_read(struct pci_bus *bus, unsigned int devfn, int where,
 		int size, u32 *val)
 {
-	struct dino_device *d = DINO_DEV(bus->sysdata);
+	struct dino_device *d = DINO_DEV(parisc_walk_tree(bus->dev));
 	u32 local_bus = (bus->parent == NULL) ? 0 : bus->secondary;
 	u32 v = DINO_CFG_TOK(local_bus, devfn, where & ~3);
 	unsigned long base_addr = d->hba.base_addr;
@@ -202,7 +202,7 @@ static int dino_cfg_read(struct pci_bus 
 static int dino_cfg_write(struct pci_bus *bus, unsigned int devfn, int where,
 	int size, u32 val)
 {
-	struct dino_device *d = DINO_DEV(bus->sysdata);
+	struct dino_device *d = DINO_DEV(parisc_walk_tree(bus->dev));
 	u32 local_bus = (bus->parent == NULL) ? 0 : bus->secondary;
 	u32 v = DINO_CFG_TOK(local_bus, devfn, where & ~3);
 	unsigned long base_addr = d->hba.base_addr;
@@ -255,7 +255,7 @@ static u##size dino_in##size (struct pci
 	unsigned long flags; \
 	spin_lock_irqsave(&(DINO_DEV(d)->dinosaur_pen), flags); \
 	/* tell HW which IO Port address */ \
-	gsc_writel((u32) addr & ~3, d->base_addr + DINO_PCI_ADDR); \
+	gsc_writel((u32) addr, d->base_addr + DINO_PCI_ADDR); \
 	/* generate I/O PORT read cycle */ \
 	v = gsc_read##type(d->base_addr+DINO_IO_DATA+(addr&mask)); \
 	spin_unlock_irqrestore(&(DINO_DEV(d)->dinosaur_pen), flags); \
@@ -271,7 +271,7 @@ static void dino_out##size (struct pci_h
 { \
 	unsigned long flags; \
 	spin_lock_irqsave(&(DINO_DEV(d)->dinosaur_pen), flags); \
-	/* tell HW which CFG address */ \
+	/* tell HW which IO port address */ \
 	gsc_writel((u32) addr, d->base_addr + DINO_PCI_ADDR); \
 	/* generate cfg write cycle */ \
 	gsc_write##type(cpu_to_le##size(val), d->base_addr+DINO_IO_DATA+(addr&mask)); \
@@ -475,7 +475,7 @@ static void __init
 dino_card_setup(struct pci_bus *bus, unsigned long base_addr)
 {
 	int i;
-	struct dino_device *dino_dev = DINO_DEV(bus->sysdata);
+	struct dino_device *dino_dev = DINO_DEV(parisc_walk_tree(bus->dev));
 	struct resource *res;
 
 	res = &dino_dev->hba.lmmio_space;
@@ -498,7 +498,7 @@ dino_card_setup(struct pci_bus *bus, uns
 	}
 	gsc_writel(1 << i, base_addr + DINO_IO_ADDR_EN);
 
-	pcibios_assign_unassigned_resources(bus);
+	pci_bus_assign_resources(bus);
 }
 
 static void __init
@@ -545,11 +545,11 @@ dino_fixup_bus(struct pci_bus *bus)
 {
 	struct list_head *ln;
         struct pci_dev *dev;
-        struct dino_device *dino_dev = DINO_DEV(bus->sysdata);
+        struct dino_device *dino_dev = DINO_DEV(parisc_walk_tree(bus->dev));
 	int port_base = HBA_PORT_BASE(dino_dev->hba.hba_num);
 
 	DBG(KERN_WARNING "%s(0x%p) bus %d sysdata 0x%p\n",
-			__FUNCTION__, bus, bus->secondary, bus->sysdata);
+			__FUNCTION__, bus, bus->secondary, bus->dev->platform_data);
 
 	/* Firmware doesn't set up card-mode dino, so we have to */
 	if (is_card_dino(&dino_dev->hba.dev->id))
@@ -836,6 +836,8 @@ dino_driver_callback(struct parisc_devic
 	}
 
 	printk("%s version %s found at 0x%lx\n", name, version, dev->hpa);
+	snprintf(dev->dev.name, sizeof(dev->dev.name), 
+		 "%s version %s", name, version);
 
 	if (!request_mem_region(dev->hpa, PAGE_SIZE, name)) {
 		printk(KERN_ERR "DINO: Hey! Someone took my MMIO space (0x%ld)!\n",
@@ -891,13 +893,15 @@ dino_driver_callback(struct parisc_devic
 	if (dino_common_init(dev, dino_dev, name))
 		return 1;
 
+	dev->dev.platform_data = dino_dev;
+
 	/*
 	** It's not used to avoid chicken/egg problems
 	** with configuration accessor functions.
 	*/
-	dino_dev->hba.hba_bus = pci_scan_bus(dino_dev->hba.hba_num,
-			&dino_cfg_ops, dino_dev);
-
+	dino_dev->hba.hba_bus = 
+		pci_scan_bus_parented(&dev->dev, dino_dev->hba.hba_num,
+				      &dino_cfg_ops, NULL);
 	return 0;
 }
 
diff -urpNX build-tools/dontdiff linus-2.5/drivers/parisc/eisa.c parisc-2.5/drivers/parisc/eisa.c
--- linus-2.5/drivers/parisc/eisa.c	Sun Jan  5 11:02:05 2003
+++ parisc-2.5/drivers/parisc/eisa.c	Sun Jan  5 11:19:41 2003
@@ -40,6 +40,7 @@
 #include <asm/io.h>
 #include <asm/hardware.h>
 #include <asm/processor.h>
+#include <asm/parisc-device.h>
 #include <asm/delay.h>
 #include <asm/eisa_bus.h>
 
@@ -322,6 +323,7 @@ static int __devinit eisa_probe(struct p
 
 	printk(KERN_INFO "%s EISA Adapter found at 0x%08lx\n", 
 		name, dev->hpa);
+	snprintf(dev->dev.name, sizeof(dev->dev.name), "%s EISA", name);
 
 	eisa_dev.hba.dev = dev;
 	eisa_dev.hba.iommu = ccio_get_iommu(dev);
diff -urpNX build-tools/dontdiff linus-2.5/drivers/parisc/gsc.h parisc-2.5/drivers/parisc/gsc.h
--- linus-2.5/drivers/parisc/gsc.h	Tue Nov  5 09:43:57 2002
+++ parisc-2.5/drivers/parisc/gsc.h	Sun Jan  5 11:19:41 2003
@@ -8,6 +8,7 @@
 
 #include <linux/interrupt.h>
 #include <asm/hardware.h>
+#include <asm/parisc-device.h>
 
 #define OFFSET_IRR 0x0000   /* Interrupt request register */
 #define OFFSET_IMR 0x0004   /* Interrupt mask register */
diff -urpNX build-tools/dontdiff linus-2.5/drivers/parisc/hppb.c parisc-2.5/drivers/parisc/hppb.c
--- linus-2.5/drivers/parisc/hppb.c	Wed Dec 31 17:00:00 1969
+++ parisc-2.5/drivers/parisc/hppb.c	Mon Jan 13 12:58:34 2003
@@ -0,0 +1,111 @@
+/*
+** hppb.c:
+**      HP-PB bus driver for the NOVA and K-Class systems.
+**
+**      (c) Copyright 2002 Ryan Bradetich
+**      (c) Copyright 2002 Hewlett-Packard Company
+**
+** 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.
+**
+** This Driver currently only supports the console (port 0) on the MUX.
+** Additional work will be needed on this driver to enable the full
+** functionality of the MUX.
+**
+*/
+
+#include <linux/config.h>
+#include <linux/types.h>
+#include <linux/init.h>
+#include <linux/mm.h>
+#include <linux/slab.h>
+#include <linux/ioport.h>
+
+#include <asm/io.h>
+#include <asm/hardware.h>
+#include <asm/parisc-device.h>
+
+#include <linux/pci.h>
+
+struct hppb_card {
+	unsigned long hpa;
+	struct resource mmio_region;
+	struct hppb_card *next;
+};
+
+struct hppb_card hppb_card_head = {
+	.hpa = 0,
+	.next = NULL,
+};
+
+#define IO_IO_LOW  offsetof(struct bc_module, io_io_low)
+#define IO_IO_HIGH offsetof(struct bc_module, io_io_high)
+
+/**
+ * hppb_probe - Determine if the hppb driver should claim this device.
+ * @dev: The device which has been found
+ *
+ * Determine if hppb driver should claim this chip (return 0) or not 
+ * (return 1). If so, initialize the chip and tell other partners in crime 
+ * they have work to do.
+ */
+static int hppb_probe(struct parisc_device *dev)
+{
+	int status;
+	struct hppb_card *card = &hppb_card_head;
+
+	while(card->next) {
+		card = card->next;
+	}
+
+	if(card->hpa) {
+		card->next = kmalloc(sizeof(struct hppb_card), GFP_KERNEL);
+		if(!card->next) {
+			printk(KERN_ERR "HP-PB: Unable to allocate memory.\n");
+			return 1;
+		}
+		memset(card->next, '\0', sizeof(struct hppb_card));
+		card = card->next;
+	}
+        printk(KERN_INFO "Found GeckoBoa at 0x%lx\n", dev->hpa);
+	snprintf(dev->dev.name, sizeof(dev->dev.name), "GeckoBoa");
+
+	card->hpa = dev->hpa;
+	card->mmio_region.name = "HP-PB Bus";
+	card->mmio_region.flags = IORESOURCE_MEM;
+
+	card->mmio_region.start = __raw_readl(dev->hpa + IO_IO_LOW);
+	card->mmio_region.end = __raw_readl(dev->hpa + IO_IO_HIGH) - 1;
+
+	status = ccio_request_resource(dev, &card->mmio_region);
+	if(status < 0) {
+		printk(KERN_ERR "%s: failed to claim HP-PB bus space (%08lx, %08lx)\n",
+			__FILE__, card->mmio_region.start, card->mmio_region.end);
+	}
+
+        return 0;
+}
+
+
+static struct parisc_device_id hppb_tbl[] = {
+        { HPHW_BCPORT, HVERSION_REV_ANY_ID, 0x500, 0xc }, 
+        { 0, }
+};
+
+static struct parisc_driver hppb_driver = {
+        .name =         "Gecko Boa",
+        .id_table =     hppb_tbl,
+	.probe =        hppb_probe,
+};
+
+/**
+ * hppb_init - HP-PB bus initalization procedure.
+ *
+ * Register this driver.   
+ */
+void __init hppb_init(void)
+{
+        register_parisc_driver(&hppb_driver);
+}
diff -urpNX build-tools/dontdiff linus-2.5/drivers/parisc/iosapic.c parisc-2.5/drivers/parisc/iosapic.c
--- linus-2.5/drivers/parisc/iosapic.c	Sun Jan  5 11:02:05 2003
+++ parisc-2.5/drivers/parisc/iosapic.c	Fri Nov 29 10:54:29 2002
@@ -641,7 +641,7 @@ iosapic_fixup_irq(void *isi_obj, struct 
 
 	if (NULL == isi) {
 		printk(KERN_WARNING MODULE_NAME ": hpa not registered for %s\n",
-			pcidev->name);
+			pcidev->dev.name);
 		return(-1);
 	}
 
diff -urpNX build-tools/dontdiff linus-2.5/drivers/parisc/lasi.c parisc-2.5/drivers/parisc/lasi.c
--- linus-2.5/drivers/parisc/lasi.c	Sun Jan  5 11:02:05 2003
+++ parisc-2.5/drivers/parisc/lasi.c	Sun Jan  5 11:19:41 2003
@@ -77,7 +77,8 @@ lasi_init_irq(struct busdevice *this_las
 
 	/* Resets */
 	/* gsc_writel(0xFFFFFFFF, lasi_base+0x2000);*/	/* Parallel */
-	gsc_writel(0xFFFFFFFF, lasi_base+0x4004);	/* Audio */
+	if(pdc_add_valid(lasi_base+0x4004) == PDC_OK)
+		gsc_writel(0xFFFFFFFF, lasi_base+0x4004);	/* Audio */
 	/* gsc_writel(0xFFFFFFFF, lasi_base+0x5000);*/	/* Serial */ 
 	/* gsc_writel(0xFFFFFFFF, lasi_base+0x6000);*/	/* SCSI */
 	gsc_writel(0xFFFFFFFF, lasi_base+0x7000);	/* LAN */
@@ -184,6 +185,8 @@ lasi_init_chip(struct parisc_device *dev
 	lasi->version = gsc_readl(lasi->hpa + LASI_VER) & 0xf;
 	printk(KERN_INFO "%s version %d at 0x%lx found.\n",
 		lasi->name, lasi->version, lasi->hpa);
+	snprintf(dev->dev.name, sizeof(dev->dev.name), "%s version %d",
+		 lasi->name, lasi->version);
 
 	/* initialize the chassis LEDs really early */ 
 	lasi_led_init(lasi->hpa);
diff -urpNX build-tools/dontdiff linus-2.5/drivers/parisc/lba_pci.c parisc-2.5/drivers/parisc/lba_pci.c
--- linus-2.5/drivers/parisc/lba_pci.c	Mon Nov 11 12:48:14 2002
+++ parisc-2.5/drivers/parisc/lba_pci.c	Sun Jan  5 11:19:41 2003
@@ -48,6 +48,7 @@
 #include <asm/system.h>
 
 #include <asm/hardware.h>	/* for register_parisc_driver() stuff */
+#include <asm/parisc-device.h>
 #include <asm/iosapic.h>	/* for iosapic_register() */
 #include <asm/io.h>		/* read/write stuff */
 
@@ -507,7 +508,7 @@ lba_rd_cfg(struct lba_device *d, u32 tok
 
 static int lba_cfg_read(struct pci_bus *bus, unsigned int devfn, int pos, int size, u32 *data)
 {
-	struct lba_device *d = LBA_DEV(bus->sysdata);
+	struct lba_device *d = LBA_DEV(parisc_walk_tree(bus->dev));
 	u32 local_bus = (bus->parent == NULL) ? 0 : bus->secondary;
 	u32 tok = LBA_CFG_TOK(local_bus, devfn);
 
@@ -591,7 +592,7 @@ lba_wr_cfg( struct lba_device *d, u32 to
 
 static int lba_cfg_write(struct pci_bus *bus, unsigned int devfn, int pos, int size, u32 data)
 {
-	struct lba_device *d = LBA_DEV(bus->sysdata);
+	struct lba_device *d = LBA_DEV(parisc_walk_tree(bus->dev));
 	u32 local_bus = (bus->parent == NULL) ? 0 : bus->secondary;
 	u32 tok = LBA_CFG_TOK(local_bus,devfn);
 
@@ -697,11 +698,11 @@ lba_fixup_bus(struct pci_bus *bus)
 	u16 fbb_enable = PCI_STATUS_FAST_BACK;
 	u16 status;
 #endif
-	struct lba_device *ldev = LBA_DEV(bus->sysdata);
+	struct lba_device *ldev = LBA_DEV(parisc_walk_tree(bus->dev));
 	int lba_portbase = HBA_PORT_BASE(ldev->hba.hba_num);
 
 	DBG("lba_fixup_bus(0x%p) bus %d sysdata 0x%p\n",
-		bus, bus->secondary, bus->sysdata);
+		bus, bus->secondary, bus->dev->platform_data);
 
 	/*
 	** Properly Setup MMIO resources for this bus.
@@ -1357,6 +1358,8 @@ lba_driver_callback(struct parisc_device
 
 	printk(KERN_INFO "%s version %s (0x%x) found at 0x%lx\n",
 		MODULE_NAME, version, func_class & 0xf, dev->hpa);
+	snprintf(dev->dev.name, sizeof(dev->dev.name), "%s version %s",
+		 MODULE_NAME, version);
 
 	/* Just in case we find some prototypes... */
 	if (func_class < 2) {
@@ -1425,14 +1428,16 @@ lba_driver_callback(struct parisc_device
 	** Tell PCI support another PCI bus was found.
 	** Walks PCI bus for us too.
 	*/
+	dev->dev.platform_data = lba_dev;
 	lba_bus = lba_dev->hba.hba_bus =
-		pci_scan_bus(lba_dev->hba.bus_num.start, &lba_cfg_ops, (void *) lba_dev);
+		pci_scan_bus_parented(&dev->dev, lba_dev->hba.bus_num.start,
+				      &lba_cfg_ops, NULL);
 
 #ifdef __LP64__
 	if (is_pdc_pat()) {
 		/* assign resources to un-initialized devices */
-		DBG_PAT("LBA pcibios_assign_unassigned_resources()\n");
-		pcibios_assign_unassigned_resources(lba_bus);
+		DBG_PAT("LBA pci_bus_assign_resources()\n");
+		pci_bus_assign_resources(lba_bus);
 
 #ifdef DEBUG_LBA_PAT
 		DBG_PAT("\nLBA PIOP resource tree\n");
@@ -1464,7 +1469,7 @@ static struct parisc_device_id lba_tbl[]
 static struct parisc_driver lba_driver = {
 	.name =		MODULE_NAME,
 	.id_table =	lba_tbl,
-	.probe =	lba_driver_callback
+	.probe =	lba_driver_callback,
 };
 
 /*
diff -urpNX build-tools/dontdiff linus-2.5/drivers/parisc/led.c parisc-2.5/drivers/parisc/led.c
--- linus-2.5/drivers/parisc/led.c	Sun Jan  5 11:02:05 2003
+++ parisc-2.5/drivers/parisc/led.c	Fri Nov 29 08:30:56 2002
@@ -404,7 +404,7 @@ static void led_get_diskio_stats(int add
 	int major, disk, total;
 	
 	total = 0;
-#ifdef 0
+#if 0
 	/*
 	 * this section will no longer work in 2.5, as we no longer
 	 * have either kstat.dk_drive nor DK_MAX_*.  It can probably
diff -urpNX build-tools/dontdiff linus-2.5/drivers/parisc/power.c parisc-2.5/drivers/parisc/power.c
--- linus-2.5/drivers/parisc/power.c	Sun Jan  5 11:02:05 2003
+++ parisc-2.5/drivers/parisc/power.c	Fri Nov 29 08:30:56 2002
@@ -44,8 +44,6 @@
 #include <linux/reboot.h>
 #include <linux/sched.h>
 #include <linux/interrupt.h>
-#include <linux/proc_fs.h>
-#include <linux/ctype.h>
 #include <linux/workqueue.h>
 
 #include <asm/pdc.h>
@@ -142,11 +140,7 @@ static void process_shutdown(void)
 DECLARE_TASKLET_DISABLED(power_tasklet, NULL, 0);
 
 /* soft power switch enabled/disabled */
-#ifdef CONFIG_PROC_FS
-static int pwrsw_enabled = 1;
-#else
-#define pwrsw_enabled (1)
-#endif
+int pwrsw_enabled = 1;
 
 /*
  * On gecko style machines (e.g. 712/xx and 715/xx) 
@@ -207,90 +201,6 @@ static void powerfail_interrupt(int code
 
 
 
-/* 
- * /proc filesystem support 
- */
-
-#ifdef CONFIG_SYSCTL
-static int power_proc_read(char *page, char **start, off_t off, int count, 
-	int *eof, void *data)
-{
-	char *out = page;
-	int len;
-
-	out += sprintf(out, "Software power switch support: ");
-	out += sprintf(out, pwrsw_enabled ? "enabled (1)" : "disabled (0)" );
-	out += sprintf(out, "\n");
-
-	len = out - page - off;
-	if (len < count) {
-		*eof = 1;
-		if (len <= 0) return 0;
-	} else {
-		len = count;
-	}
-	*start = page + off;
-	return len;
-}
-
-static int power_proc_write(struct file *file, const char *buf, 
-	unsigned long count, void *data)
-{
-	char *cur, lbuf[count];
-
-	if (!capable(CAP_SYS_ADMIN))
-		return -EACCES;
-
-	memset(lbuf, 0, count);
-
-	copy_from_user(lbuf, buf, count);
-	cur = lbuf;
-
-	/* skip initial spaces */
-	while (*cur && isspace(*cur))
-		cur++;
-
-	switch (*cur) {
-	case '0':	pwrsw_enabled = 0;
-			break;
-	case '1':	pwrsw_enabled = 1;
-			break;
-	default:	printk(KERN_CRIT "/proc/" SYSCTL_FILENAME 
-					": Parse error: only '0' or '1' allowed!\n");
-			return -EINVAL;
-	} /* switch() */
-
-	return count;
-}
-
-static struct proc_dir_entry *ent;
-
-static void __init power_create_procfs(void)
-{
-	if (!power_tasklet.func)
-		return;
-	
-	ent = create_proc_entry(SYSCTL_FILENAME, S_IFREG|S_IRUGO|S_IWUSR, 0);
-	if (!ent) return;
-	
-	ent->nlink = 1;
-	ent->read_proc = power_proc_read;
-	ent->write_proc = power_proc_write;
-	ent->owner = THIS_MODULE;
-}
-
-static void __exit power_remove_procfs(void)
-{
-	remove_proc_entry(SYSCTL_FILENAME, NULL);
-}
-
-#else
-#define power_create_procfs()	do { } while (0)
-#define power_remove_procfs()	do { } while (0)
-#endif	/* CONFIG_SYSCTL */
-
-
-
 /* parisc_panic_event() is called by the panic handler.
  * As soon as a panic occurs, our tasklets above will not be
  * executed any longer. This function then re-enables the 
@@ -344,7 +254,6 @@ static int __init power_init(void)
 	/* Register a call for panic conditions. */
 	notifier_chain_register(&panic_notifier_list, &parisc_panic_block);
 
-	power_create_procfs();
 	tasklet_enable(&power_tasklet);
 
 	return 0;
@@ -357,7 +266,6 @@ static void __exit power_exit(void)
 
 	tasklet_disable(&power_tasklet);
 	notifier_chain_unregister(&panic_notifier_list, &parisc_panic_block);
-	power_remove_procfs();
 	power_tasklet.func = NULL;
 	pdc_soft_power_button(0);
 }
diff -urpNX build-tools/dontdiff linus-2.5/drivers/parisc/sba_iommu.c parisc-2.5/drivers/parisc/sba_iommu.c
--- linus-2.5/drivers/parisc/sba_iommu.c	Sun Jan  5 11:02:05 2003
+++ parisc-2.5/drivers/parisc/sba_iommu.c	Sun Jan  5 11:19:41 2003
@@ -40,6 +40,7 @@
 #include <linux/proc_fs.h>
 #include <asm/runway.h>		/* for proc_runway_root */
 #include <asm/pdc.h>		/* for PDC_MODEL_* */
+#include <asm/parisc-device.h>
 
 #define MODULE_NAME "SBA"
 
@@ -803,7 +804,7 @@ sba_mark_invalid(struct ioc *ioc, dma_ad
  * See Documentation/DMA-mapping.txt
  */
 static int
-sba_dma_supported( struct pci_dev *dev, u64 mask)
+sba_dma_supported( struct device *dev, u64 mask)
 {
 	if (dev == NULL) {
 		printk(KERN_ERR MODULE_NAME ": EISA/ISA/et al not supported\n");
@@ -811,10 +812,8 @@ sba_dma_supported( struct pci_dev *dev, 
 		return(0);
 	}
 
-	dev->dma_mask = mask;	/* save it */
-
 	/* only support 32-bit PCI devices - no DAC support (yet) */
-	return((int) (mask == 0xffffffff));
+	return((int) (mask == 0xffffffffUL));
 }
 
 
@@ -828,7 +827,8 @@ sba_dma_supported( struct pci_dev *dev, 
  * See Documentation/DMA-mapping.txt
  */
 static dma_addr_t
-sba_map_single(struct pci_dev *dev, void *addr, size_t size, int direction)
+sba_map_single(struct device *dev, void *addr, size_t size,
+	       enum dma_data_direction direction)
 {
 	struct ioc *ioc;
 	unsigned long flags; 
@@ -840,7 +840,6 @@ sba_map_single(struct pci_dev *dev, void
 	ASSERT(size > 0);
 	ASSERT(size <= DMA_CHUNK_SIZE);
 
-	ASSERT(dev->sysdata);
 	ioc = GET_IOC(dev);
 	ASSERT(ioc);
 
@@ -906,7 +905,8 @@ sba_map_single(struct pci_dev *dev, void
  * See Documentation/DMA-mapping.txt
  */
 static void
-sba_unmap_single(struct pci_dev *dev, dma_addr_t iova, size_t size, int direction)
+sba_unmap_single(struct device *dev, dma_addr_t iova, size_t size,
+		 enum dma_data_direction direction)
 {
 	struct ioc *ioc;
 #if DELAYED_RESOURCE_CNT > 0
@@ -915,7 +915,6 @@ sba_unmap_single(struct pci_dev *dev, dm
 	unsigned long flags; 
 	dma_addr_t offset;
 
-	ASSERT(dev->sysdata);
 	ioc = GET_IOC(dev);
 	ASSERT(ioc);
 
@@ -976,7 +975,7 @@ sba_unmap_single(struct pci_dev *dev, dm
  * See Documentation/DMA-mapping.txt
  */
 static void *
-sba_alloc_consistent(struct pci_dev *hwdev, size_t size, dma_addr_t *dma_handle)
+sba_alloc_consistent(struct device *hwdev, size_t size, dma_addr_t *dma_handle)
 {
 	void *ret;
 
@@ -1007,7 +1006,8 @@ sba_alloc_consistent(struct pci_dev *hwd
  * See Documentation/DMA-mapping.txt
  */
 static void
-sba_free_consistent(struct pci_dev *hwdev, size_t size, void *vaddr, dma_addr_t dma_handle)
+sba_free_consistent(struct device *hwdev, size_t size, void *vaddr,
+		    dma_addr_t dma_handle)
 {
 	sba_unmap_single(hwdev, dma_handle, size, 0);
 	free_pages((unsigned long) vaddr, get_order(size));
@@ -1269,7 +1269,8 @@ sba_coalesce_chunks( struct ioc *ioc,
  * See Documentation/DMA-mapping.txt
  */
 static int
-sba_map_sg(struct pci_dev *dev, struct scatterlist *sglist, int nents, int direction)
+sba_map_sg(struct device *dev, struct scatterlist *sglist, int nents,
+	   enum dma_data_direction direction)
 {
 	struct ioc *ioc;
 	int coalesced, filled = 0;
@@ -1277,7 +1278,6 @@ sba_map_sg(struct pci_dev *dev, struct s
 
 	DBG_RUN_SG("%s() START %d entries\n", __FUNCTION__, nents);
 
-	ASSERT(dev->sysdata);
 	ioc = GET_IOC(dev);
 	ASSERT(ioc);
 
@@ -1351,7 +1351,8 @@ sba_map_sg(struct pci_dev *dev, struct s
  * See Documentation/DMA-mapping.txt
  */
 static void 
-sba_unmap_sg(struct pci_dev *dev, struct scatterlist *sglist, int nents, int direction)
+sba_unmap_sg(struct device *dev, struct scatterlist *sglist, int nents,
+	     enum dma_data_direction direction)
 {
 	struct ioc *ioc;
 #ifdef ASSERT_PDIR_SANITY
@@ -1361,7 +1362,6 @@ sba_unmap_sg(struct pci_dev *dev, struct
 	DBG_RUN_SG("%s() START %d entries,  %p,%x\n",
 		__FUNCTION__, nents, sg_virt_addr(sglist), sglist->length);
 
-	ASSERT(dev->sysdata);
 	ioc = GET_IOC(dev);
 	ASSERT(ioc);
 
@@ -1395,16 +1395,17 @@ sba_unmap_sg(struct pci_dev *dev, struct
 
 }
 
-static struct pci_dma_ops sba_ops = {
-	sba_dma_supported,
-	sba_alloc_consistent,	/* allocate cacheable host mem */
-	sba_free_consistent,	/* release cacheable host mem */
-	sba_map_single,
-	sba_unmap_single,
-	sba_map_sg,
-	sba_unmap_sg,
-	NULL,			/* dma_sync_single */
-	NULL			/* dma_sync_sg */
+static struct hppa_dma_ops sba_ops = {
+	.dma_supported =	sba_dma_supported,
+	.alloc_consistent =	sba_alloc_consistent,
+	.alloc_noncoherent =	sba_alloc_consistent,
+	.free_consistent =	sba_free_consistent,
+	.map_single =		sba_map_single,
+	.unmap_single =		sba_unmap_single,
+	.map_sg =		sba_map_sg,
+	.unmap_sg =		sba_unmap_sg,
+	.dma_sync_single =	NULL,
+	.dma_sync_sg =		NULL,
 };
 
 
@@ -1977,6 +1978,8 @@ sba_driver_callback(struct parisc_device
 
 	printk(KERN_INFO "%s found %s at 0x%lx\n",
 		MODULE_NAME, version, dev->hpa);
+	snprintf(dev->dev.name, sizeof(dev->dev.name), "%s version %s",
+		 MODULE_NAME, version);
 
 #ifdef DEBUG_SBA_INIT
 	sba_dump_tlb(dev->hpa);
diff -urpNX build-tools/dontdiff linus-2.5/drivers/parisc/superio.c parisc-2.5/drivers/parisc/superio.c
--- linus-2.5/drivers/parisc/superio.c	Sun Jan  5 11:02:05 2003
+++ parisc-2.5/drivers/parisc/superio.c	Sun Jan  5 11:19:41 2003
@@ -390,7 +390,7 @@ int superio_fixup_irq(struct pci_dev *pc
 void __devinit
 superio_serial_init(void)
 {
-#ifdef CONFIG_SERIAL
+#ifdef CONFIG_SERIAL_8250
 	struct serial_struct *serial;
 	int retval;
 	
@@ -443,7 +443,7 @@ superio_serial_init(void)
 	retval = register_serial(serial);
 	if (retval < 0)
 		printk(KERN_WARNING "SuperIO: Register Serial #1 failed.\n");
-#endif /* CONFIG_SERIAL */
+#endif /* CONFIG_SERIAL_8250 */
 }
 
 EXPORT_SYMBOL(superio_serial_init);
@@ -504,7 +504,7 @@ static int __devinit superio_probe(struc
 #ifdef CONFIG_PARPORT_PC
 		superio_parport_init();
 #endif
-#ifdef CONFIG_SERIAL
+#ifdef CONFIG_SERIAL_8250
 		superio_serial_init();
 #endif
 		/* REVISIT : superio_fdc_init() ? */
@@ -530,6 +530,11 @@ static struct pci_driver superio_driver 
 
 static int __init superio_modinit(void)
 {
+#ifdef CONFIG_SERIAL_8250
+	extern int serial8250_init(void);
+	serial8250_init();
+#endif
+
 	return pci_module_init(&superio_driver);
 }
 
diff -urpNX build-tools/dontdiff linus-2.5/drivers/parisc/wax.c parisc-2.5/drivers/parisc/wax.c
--- linus-2.5/drivers/parisc/wax.c	Sun Jan  5 11:02:05 2003
+++ parisc-2.5/drivers/parisc/wax.c	Sun Jan  5 11:19:41 2003
@@ -83,6 +83,8 @@ wax_init_chip(struct parisc_device *dev)
 
 	wax->version = 0;   /* gsc_readb(wax->hpa+WAX_VER); */
 	printk(KERN_INFO "%s at 0x%lx found.\n", wax->name, wax->hpa);
+	snprintf(dev->dev.name, sizeof(dev->dev.name), "%s version %d",
+		 wax->name, wax->version);
 
 	/* Stop wax hissing for a bit */
 	wax_init_irq(wax);
