? parisc_device.2.diff Index: arch/parisc/kernel/ccio-dma.c =================================================================== RCS file: /home/cvs/parisc/linux/arch/parisc/kernel/ccio-dma.c,v retrieving revision 1.33 diff -u -p -r1.33 ccio-dma.c --- arch/parisc/kernel/ccio-dma.c 2001/07/14 21:17:01 1.33 +++ arch/parisc/kernel/ccio-dma.c 2001/08/05 04:05:37 @@ -99,27 +99,7 @@ #define U2_BC_GSC 0x501 #define UTURN_IOA_RUNWAY 0x581 #define UTURN_BC_GSC 0x502 -/* We *can't* support JAVA (T600). Venture there at your own risk. */ - - -static int ccio_driver_callback(struct hp_device *, struct pa_iodc_driver *); - -static struct pa_iodc_driver ccio_drivers_for[] = { - {HPHW_IOA, U2_IOA_RUNWAY, 0x0, 0xb, 0, 0x10, - DRIVER_CHECK_HVERSION + DRIVER_CHECK_SVERSION + - DRIVER_CHECK_HWTYPE, MODULE_NAME, "U2 I/O MMU", - (void *)ccio_driver_callback}, - - {HPHW_IOA, UTURN_IOA_RUNWAY, 0x0, 0xb, 0, 0x10, - DRIVER_CHECK_HVERSION + DRIVER_CHECK_SVERSION + - DRIVER_CHECK_HWTYPE, MODULE_NAME, "Uturn I/O MMU", - (void *)ccio_driver_callback}, - - {0,0,0,0,0,0,0, - (char *)NULL, (char *)NULL, (void *)NULL} -}; - #define IS_U2(id) ( \ (((id)->hw_type == HPHW_IOA) && ((id)->hversion == U2_IOA_RUNWAY)) || \ (((id)->hw_type == HPHW_BCPORT) && ((id)->hversion == U2_BC_GSC)) \ @@ -192,7 +172,7 @@ struct ioc { u32 pdir_size; /* in bytes, determined by IOV Space size */ u32 chainid_shift; /* specify bit location of chain_id */ struct ccio_device *ioa; - struct hp_device *iodc; /* data about dev from firmware */ + struct parisc_device_id *iodc; /* data about dev from firmware */ }; struct ccio_device { @@ -1333,12 +1313,12 @@ ccio_cujo20_hack(struct ioc *ioc) ** I think only Java (K/D/R-class too?) systems don't do this. */ static int -ccio_get_iotlb_size(struct hp_device *d) +ccio_get_iotlb_size(struct parisc_device *dev) { - if(d->spa_shift == 0) { + if (dev->spa_shift == 0) { panic("%s() : Can't determine I/O TLB size.\n", __FUNCTION__); } - return(1 << d->spa_shift); + return (1 << dev->spa_shift); } #else @@ -1480,15 +1460,17 @@ int do_native_bus_walk(unsigned long io_ ** have work to do. */ static int -ccio_driver_callback(struct hp_device *d, struct pa_iodc_driver *dri) +ccio_driver_callback(struct parisc_device *dev) { int i, start_index, num_devices; unsigned long io_io_low, io_io_high; struct ccio_device *ioa = ccio_list; - printk(KERN_INFO "%s found %s at 0x%p\n", dri->name, dri->version, d->hpa); + printk(KERN_INFO "%s found %s at 0x%lx\n", MODULE_NAME, + dev->id.sversion == U2_IOA_RUNWAY ? "U2" : "UTurn", + dev->hpa); - if(NULL == ccio_list) { + if (NULL == ccio_list) { create_proc_info_entry(MODULE_NAME, 0, proc_runway_root, ccio_proc_info); create_proc_info_entry(MODULE_NAME"-bitmap", 0, proc_runway_root, ccio_resource_map); @@ -1524,8 +1506,8 @@ ccio_driver_callback(struct hp_device *d i = 0; } - ioa->ioc[i].iodc = d; - ioa->ioc[i].ioc_hpa = d->hpa; + ioa->ioc[i].iodc = &dev->id; + ioa->ioc[i].ioc_hpa = (struct ioa_registers *)dev->hpa; ioa->ioc[i].ioa = ioa; ccio_ioc_init(&ioa->ioc[i]); @@ -1540,11 +1522,21 @@ ccio_driver_callback(struct hp_device *d return 0; } + +/* We *can't* support JAVA (T600). Venture there at your own risk. */ +static struct parisc_device_id ccio_tbl[] = { + { HPHW_IOA, HVERSION_REV_ANY_ID, U2_IOA_RUNWAY, 0xb }, /* U2 */ + { HPHW_IOA, HVERSION_REV_ANY_ID, UTURN_IOA_RUNWAY, 0xb }, /* UTurn */ + { 0, } +}; + +static struct parisc_driver ccio_driver = { + name: "U2/Uturn", + id_table: ccio_tbl, + probe: ccio_driver_callback, +}; -void __init -ccio_init(void) +void __init ccio_init(void) { - ccio_list = (struct ccio_device *)NULL; - ccio_count = 0; - pdc_register_driver(ccio_drivers_for); + register_parisc_driver(&ccio_driver); } Index: arch/parisc/kernel/drivers.c =================================================================== RCS file: /home/cvs/parisc/linux/arch/parisc/kernel/drivers.c,v retrieving revision 1.18 diff -u -p -r1.18 drivers.c --- arch/parisc/kernel/drivers.c 2001/07/14 21:17:01 1.18 +++ arch/parisc/kernel/drivers.c 2001/08/05 04:05:37 @@ -1,10 +1,17 @@ -/* drivers.c - - Copyright (c) 1999 The Puffin Group - - This is a collection of routines intended to register all the devices - in a system, and register device drivers. -*/ +/* + * drivers.c + * + * 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) 1999 The Puffin Group + * Copyright (c) 2001 Matthew Wilcox for Hewlett Packard + * + * The file handles registering devices and drivers, then matching them. + * It's the closest we get to a dating agency. + */ #include #include @@ -20,72 +27,74 @@ #define MAX_DEVICES 64 static int num_devices; -static struct hp_device pa_devices[MAX_DEVICES]; -static struct pa_iodc_driver *pa_drivers = NULL; +static struct parisc_device pa_devices[MAX_DEVICES]; +static struct parisc_driver *pa_drivers = NULL; -static int compare_spec(struct hp_device * hp_dev, struct pa_iodc_driver *driver) -{ - if((driver->check & DRIVER_CHECK_HWTYPE) - && (driver->hw_type != hp_dev->hw_type)) - return 0; - - if((driver->check & DRIVER_CHECK_HVERSION) - && (driver->hversion != hp_dev->hversion)) - return 0; +/** + * match_device - Report whether this driver can handle this device + * @driver: the PA-RISC driver to try + * @dev: the PA-RISC device to try + */ +static int match_device(struct parisc_driver *driver, struct parisc_device *dev) +{ + const struct parisc_device_id *ids; + + for (ids = driver->id_table; ids->hw_type || ids->hversion || + ids->hversion_rev || ids->sversion; ids++) { + if ((ids->hw_type != HWTYPE_ANY_ID) && + (ids->hw_type != dev->id.hw_type)) + continue; - if((driver->check & DRIVER_CHECK_HVERSION_REV) - && (driver->hversion_rev != hp_dev->hversion_rev)) - return 0; + if ((ids->hversion != HVERSION_ANY_ID) && + (ids->hversion != dev->id.hversion)) + continue; - if((driver->check & DRIVER_CHECK_SVERSION) - && (driver->sversion != hp_dev->sversion)) - return 0; + if ((ids->hversion_rev != HVERSION_REV_ANY_ID) && + (ids->hversion_rev != dev->id.hversion_rev)) + continue; - if((driver->check & DRIVER_CHECK_SVERSION_REV) - && (driver->sversion_rev != hp_dev->sversion_rev)) - return 0; + if ((ids->sversion != SVERSION_ANY_ID) && + (ids->sversion != dev->id.sversion)) + continue; - if((driver->check & DRIVER_CHECK_OPT) - && (driver->opt != hp_dev->opt)) - return 0; + return 1; + } + return 0; - return 1; } -int pdc_register_driver(struct pa_iodc_driver *driver) +int register_parisc_driver(struct parisc_driver *driver) { int i; - struct hp_device * device; + + if (driver->next) { + BUG(); + printk(KERN_WARNING "BUG: Skipping previously registered driver: %s %s\n", driver->name, driver->version); + return 1; + } + + /* link driver to the head of the global list. + * The list gets built in reverse order...ideally, it shouldn't + * matter but reality will eventually rear its ugly head. + */ + driver->next = pa_drivers; + pa_drivers = driver; - for(;driver->check;driver++) { - if(driver->next) { - BUG(); - printk(KERN_WARNING "BUG: Skipping previously registered driver: %s %s\n", driver->name, driver->version); + for (i=0; i < num_devices; i++) { + struct parisc_device *device = &pa_devices[i]; + + if (device->driver) continue; - } + if (!match_device(driver, device)) + continue; - /* link driver to the head of the global list. - ** The list gets built in reverse order...ideally, it shouldn't - ** matter but reality will eventually rear it's ugly head. - */ - driver->next = pa_drivers; - pa_drivers = driver; - - for (i=0; i < num_devices; i++) { - device = &pa_devices[i]; - - if (device->driver) continue; - if (0 == compare_spec(device, driver)) continue; - - if ( (*driver->callback)(device,driver) == 0) { - device->driver=driver; - } else { - printk(KERN_WARNING "Warning : device (%d, 0x%x, 0x%x, 0x%x, 0x%x) NOT claimed by %s %s\n", - device->hw_type, - device->hversion, device->hversion_rev, - device->sversion, device->sversion_rev, - driver->name, driver->version); - } + if (driver->probe(device) == 0) { + device->driver = driver; + } else { + printk(KERN_WARNING "Warning : device (%d, 0x%x, 0x%x, 0x%x) NOT claimed by %s\n", + device->id.hw_type, device->id.hversion, + device->id.hversion_rev, device->id.sversion, + driver->name); } } @@ -94,7 +103,7 @@ int pdc_register_driver(struct pa_iodc_d -int pdc_unregister_driver(struct pa_iodc_driver *driver) +int unregister_parisc_driver(struct parisc_driver *driver) { int i; @@ -102,41 +111,37 @@ int pdc_unregister_driver(struct pa_iodc ** SMP_REVISIT: code is NOT SMP safe. Need to use a spinlock ** around *all* references to pa_drivers list. */ - for(;driver->check;driver++) { + if (pa_drivers == driver) { + /* was head of list - update head */ + pa_drivers = driver->next; + } else { + struct parisc_driver *prev = pa_drivers; - if(pa_drivers==driver) { - /* was head of list - update head */ - pa_drivers=driver->next; - } else { - struct pa_iodc_driver * prev = pa_drivers; - - while(prev && driver!=prev->next) { - prev = prev->next; - } - - if(prev==NULL) { - printk(KERN_WARNING "pdc_unregister_driver: %s %s wasn't registered\n", driver->name, driver->version); - continue; - } else { - /* Drop driver from list */ - prev->next=driver->next; - driver->next=NULL; - } - + while (prev && driver != prev->next) { + prev = prev->next; } - for (i=0; i < num_devices; i++) { - if (pa_devices[i].driver == driver) - pa_devices[i].driver = NULL; + if (prev == NULL) { + printk(KERN_WARNING "unregister_parisc_driver: %s wasn't registered\n", driver->name); + } else { + /* Drop driver from list */ + prev->next=driver->next; + driver->next=NULL; } } + + for (i=0; i < num_devices; i++) { + if (pa_devices[i].driver == driver) + pa_devices[i].driver = NULL; + } + return 0; } /* this function adds an address to the list of additional addresses of a module */ -int add_pa_dev_addr(struct hp_device *hp_device, unsigned long addr) +int add_pa_dev_addr(struct parisc_device *hp_device, unsigned long addr) { if (!hp_device || !addr) return 0; @@ -155,59 +160,54 @@ int add_pa_dev_addr(struct hp_device *hp } -struct hp_device *alloc_pa_dev(unsigned long hpa) +struct parisc_device *alloc_pa_dev(unsigned long hpa) { int i, status; unsigned long bytecnt; u8 iodc_data[32]; - struct hp_device * d; + struct parisc_device *dev; + + /* Check to make sure this device has not already been added -Ryan */ + for (i = 0; i < num_devices; i++) { + if (pa_devices[i].hpa == hpa) + return NULL; + } - d = &pa_devices[num_devices]; + dev = &pa_devices[num_devices]; status = pdc_iodc_read(&bytecnt, (void *)hpa, 0, &iodc_data, 32); if (status != PDC_RET_OK) { /* There is no device here, so we'll skip it */ return NULL; } - - /* Check to make sure this device has not already been added -Ryan */ - for(i = 0; i < num_devices; ++i) { - if((unsigned long)pa_devices[i].hpa == hpa) - return NULL; - } - d->hw_type = iodc_data[3]&0x1f; - d->hversion = (iodc_data[0]<<4)|((iodc_data[1]&0xf0)>>4); - d->sversion = - ((iodc_data[4]&0x0f)<<16)|(iodc_data[5]<<8)|(iodc_data[6]); - d->hversion_rev = iodc_data[1]&0x0f; - d->sversion_rev = iodc_data[4]>>4; - d->opt = iodc_data[7]; - d->hpa = (void *) hpa; - d->driver = NULL; - d->reference = parisc_get_reference(d->hw_type, - d->hversion, d->sversion); + dev->id.hw_type = iodc_data[3] & 0x1f; + dev->id.hversion = (iodc_data[0] << 4) | ((iodc_data[1] & 0xf0) >> 4); + dev->id.hversion_rev = iodc_data[1] & 0x0f; + dev->id.sversion = ((iodc_data[4] & 0x0f) << 16) | + (iodc_data[5] << 8) | iodc_data[6]; + dev->hpa = hpa; + dev->driver = NULL; + dev->reference = parisc_get_reference(&dev->id); /* add the hpa of this module as the first additional address */ - add_pa_dev_addr(d, hpa); + add_pa_dev_addr(dev, hpa); num_devices++; - return d; + return dev; } /* Return status if device is managed */ -int register_pa_dev(struct hp_device *hp_dev) +int register_pa_dev(struct parisc_device *hp_dev) { - struct pa_iodc_driver *driver = pa_drivers; + struct parisc_driver *driver = pa_drivers; - /* - ** Locate a driver which agrees to manage this device. - */ + /* Locate a driver which agrees to manage this device. */ while ((NULL == hp_dev->driver) && (NULL != driver)) { - if (compare_spec(hp_dev,driver)) { - hp_dev->driver = (*driver->callback)(hp_dev,driver)==0 - ? driver : NULL; + if (match_device(driver,hp_dev)) { + if (driver->probe(hp_dev) == 0) + hp_dev->driver = driver; } driver = driver->next; } @@ -215,7 +215,7 @@ int register_pa_dev(struct hp_device *hp return (NULL != hp_dev->driver); } -struct hp_device *get_pa_dev(unsigned int index) +struct parisc_device *get_pa_dev(unsigned int index) { if (index >= num_devices) return NULL; @@ -230,23 +230,22 @@ inline int get_num_pa_dev() void print_pa_devices(int start_index, int num_indexes) { - int i, k; - int end_index = start_index + num_indexes; - struct hp_device *d; + int i; + struct parisc_device *d; - for(i = start_index; i < end_index; i++) { + for(i = start_index; i < start_index + num_indexes; i++) { d = &pa_devices[i]; printk(KERN_INFO - "%d. %s (%d) at 0x%p, versions 0x%x, 0x%x, 0x%x, 0x%x, 0x%x", - i+1, - (d->reference) ? d->reference->name : "Unknown device", - d->hw_type, d->hpa, d->hversion, d->hversion_rev, - d->sversion, d->sversion_rev, d->opt); - - if (d->num_addrs>1) { - printk(KERN_INFO ", additional addresses: "); - for (k=1; knum_addrs; k++) - printk(KERN_INFO "0x%lx ", d->addr[k]); + "%d. %s (%d) at 0x%lx, versions 0x%x, 0x%x, 0x%x", + i + 1, (d->reference) ? d->reference->name : "Unknown device", + d->id.hw_type, d->hpa, d->id.hversion, d->id.hversion_rev, + d->id.sversion); + + if (d->num_addrs > 1) { + int k; + printk(KERN_INFO ", additional addresses: "); + for (k = 1; k < d->num_addrs; k++) + printk(KERN_INFO "0x%lx ", d->addr[k]); } printk(KERN_INFO "\n"); Index: arch/parisc/kernel/firmware.c =================================================================== RCS file: /home/cvs/parisc/linux/arch/parisc/kernel/firmware.c,v retrieving revision 1.28 diff -u -p -r1.28 firmware.c --- arch/parisc/kernel/firmware.c 2001/06/30 23:47:53 1.28 +++ arch/parisc/kernel/firmware.c 2001/08/05 04:05:37 @@ -66,7 +66,6 @@ static unsigned long pdc_result2[32] __a * Note that some PAT boxes may have 64-bit IODC I/O... */ -/* yes 'int', not 'long' -- IODC I/O is always 32-bit stuff */ #ifdef __LP64__ static long real64_call(unsigned long function, ...); #endif Index: arch/parisc/kernel/hardware.c =================================================================== RCS file: /home/cvs/parisc/linux/arch/parisc/kernel/hardware.c,v retrieving revision 1.20 diff -u -p -r1.20 hardware.c --- arch/parisc/kernel/hardware.c 2001/06/23 17:29:06 1.20 +++ arch/parisc/kernel/hardware.c 2001/08/05 04:05:37 @@ -1460,15 +1460,14 @@ enum cpu_type parisc_get_cpu_type(unsign } -struct hp_hardware *parisc_get_reference(unsigned short hw_type, - unsigned long hversion, unsigned long sversion) +struct hp_hardware *parisc_get_reference(struct parisc_device_id *id) { struct hp_hardware *listptr = hp_hardware_list; for (listptr = hp_hardware_list; listptr->name; listptr++) { - if ((listptr->hw_type == hw_type) && - (listptr->hversion == hversion) && - (listptr->sversion == sversion)) { + if ((listptr->hw_type == id->hw_type) && + (listptr->hversion == id->hversion) && + (listptr->sversion == id->sversion)) { return listptr; } } Index: arch/parisc/kernel/inventory.c =================================================================== RCS file: /home/cvs/parisc/linux/arch/parisc/kernel/inventory.c,v retrieving revision 1.31 diff -u -p -r1.31 inventory.c --- arch/parisc/kernel/inventory.c 2001/07/14 21:17:01 1.31 +++ arch/parisc/kernel/inventory.c 2001/08/05 04:05:37 @@ -162,7 +162,7 @@ static int pat_query_module(ulong pcell_ unsigned long bytecnt; unsigned long temp; /* 64-bit scratch value */ long status; /* PDC return value status */ - struct hp_device *dev; + struct parisc_device *dev; /* return cell module (PA or Processor view) */ status = pdc_pat_cell_module(&bytecnt, pcell_loc, mod_index, @@ -260,8 +260,7 @@ static void do_pat_memconfig(void) unsigned long length; int i; - length = (unsigned long)(PAT_MAX_RANGES + 1) - * sizeof(struct pdc_pat_pd_addr_map_entry); + length = (PAT_MAX_RANGES + 1) * sizeof(struct pdc_pat_pd_addr_map_entry); status = pdc_pat_pd_get_addr_map(&actual_len, mem_table, length, 0L); @@ -402,9 +401,7 @@ static void do_system_map_memconfig(void */ static int check_if_715old(void) { - /* To do this check, I'm going to look at the CPU's hversion and - ** and sversion. I'm taking the following from documentation. Here's - ** the table of machines to skip (CPU_HVERSIONs from hardware.c): + /* We trust that the CPU HVersion returned by PDC is correct. ** ** Machine CPU_HVERSION real life verification ** @@ -418,16 +415,9 @@ static int check_if_715old(void) ** */ - switch (CPU_HVERSION) { - case 0x310: - case 0x311: - case 0x312: - case 0x313: - case 0x314: - case 0x315: - case 0x316: + if (CPU_HVERSION >= 0x310 && CPU_HVERSION <=0x316) return 1; - } + return 0; } @@ -467,7 +457,7 @@ int do_legacy_inventory(void) ** In any case, this is where the hook is. */ if (r_addr.hpa == 0xf8000000 && check_if_715old()) { - printk(KERN_WARNING "Using Alex's odd 715/old exception, " + printk(KERN_ERR "Using Alex's odd 715/old exception, " "onboard graphics won't be inventoried!\n"); continue; } @@ -528,7 +518,7 @@ int do_legacy_inventory(void) ** most of the above cases. */ if (stype) { - struct hp_device *hp_dev; + struct parisc_device *hp_dev; status = pdc_mem_map_hpa(&r_addr, &module_path); if (status == PDC_RET_OK @@ -568,9 +558,8 @@ int do_legacy_inventory(void) } } - } + } /* hw_type == HPHW_BA */ - /* hw_type == HPHW_BA */ /* reset module_path.bc[] */ memset(module_path.bc, 0xff, sizeof(module_path.bc)); @@ -598,12 +587,11 @@ int do_legacy_inventory(void) int do_native_bus_walk(unsigned long hpa) { int num = 0; - struct hp_device *hp_device; unsigned long hpa_end = hpa + (MAX_NATIVE_DEVICES * NATIVE_DEVICE_OFFSET); for (; hpa < hpa_end; hpa += NATIVE_DEVICE_OFFSET) { - hp_device = alloc_pa_dev(hpa); + struct parisc_device *hp_device = alloc_pa_dev(hpa); if (!hp_device) continue; @@ -617,7 +605,7 @@ static int do_system_map_inventory(void) { int i, j, num; long status; - struct hp_device *hp_device; + struct parisc_device *hp_device; struct pdc_system_map_mod_info module_result; struct pdc_system_map_addr_info addr_result; struct pdc_module_path module_path; Index: arch/parisc/kernel/iosapic.c =================================================================== RCS file: /home/cvs/parisc/linux/arch/parisc/kernel/iosapic.c,v retrieving revision 1.27 diff -u -p -r1.27 iosapic.c --- arch/parisc/kernel/iosapic.c 2001/07/14 21:17:02 1.27 +++ arch/parisc/kernel/iosapic.c 2001/08/05 04:05:37 @@ -979,7 +979,7 @@ iosapic_rd_version(struct iosapic_info * ** o allocate isi_region (registers region handlers) */ void * -iosapic_register(void *hpa) +iosapic_register(unsigned long hpa) { struct iosapic_info *isi = NULL; struct irt_entry *irte = irt_cell; Index: arch/parisc/kernel/lba_pci.c =================================================================== RCS file: /home/cvs/parisc/linux/arch/parisc/kernel/lba_pci.c,v retrieving revision 1.30 diff -u -p -r1.30 lba_pci.c --- arch/parisc/kernel/lba_pci.c 2001/07/17 00:27:02 1.30 +++ arch/parisc/kernel/lba_pci.c 2001/08/05 04:05:37 @@ -110,22 +110,6 @@ #define MODULE_NAME "lba" -static int lba_driver_callback(struct hp_device *, struct pa_iodc_driver *); - - -static struct pa_iodc_driver lba_drivers_for[]= { - - {HPHW_BRIDGE, 0x782, 0x0, 0xa, 0,0, - DRIVER_CHECK_HVERSION + - DRIVER_CHECK_SVERSION + DRIVER_CHECK_HWTYPE, - MODULE_NAME, "tbd", (void *) lba_driver_callback}, - - {0,0,0,0,0,0, - 0, - (char *) NULL, (char *) NULL, (void *) NULL} -}; - - #define LBA_FUNC_ID 0x0000 /* function id */ #define LBA_FCLASS 0x0008 /* function class, bist, header, rev... */ #define LBA_CAPABLE 0x0030 /* capabilities register */ @@ -276,16 +260,6 @@ static u32 lba_t32; #define ROPES_PER_SBA 8 #define LBA_NUM(x) ((((unsigned long) x) >> 13) & (ROPES_PER_SBA-1)) -/* -** One time initialization to let the world know the LBA was found. -** This is the only routine which is NOT static. -** Must be called exactly once before pci_init(). -*/ -void __init lba_init(void) -{ - pdc_register_driver(lba_drivers_for); -} - static void lba_dump_res(struct resource *r, int d) @@ -1036,7 +1010,7 @@ static struct pci_port_ops lba_pat_port_ ** We don't have a struct pci_bus assigned to us yet. */ static void -lba_pat_resources( struct hp_device *d, struct lba_device *lba_dev) +lba_pat_resources(struct parisc_device *pa_dev, struct lba_device *lba_dev) { unsigned long bytecnt; pdc_pat_cell_mod_maddr_block_t pa_pdc_cell; /* PA_VIEW */ @@ -1049,12 +1023,12 @@ lba_pat_resources( struct hp_device *d, int i; /* return cell module (IO view) */ - status = pdc_pat_cell_module(&bytecnt, d->pcell_loc, d->mod_index, + status = pdc_pat_cell_module(&bytecnt, pa_dev->pcell_loc, pa_dev->mod_index, PA_VIEW, & pa_pdc_cell); pa_count = pa_pdc_cell.mod[1]; #ifdef DONT_NEED_THIS_FOR_ASTRO - status |= pdc_pat_cell_module(&bytecnt, d->pcell_loc, d->mod_index, + status |= pdc_pat_cell_module(&bytecnt, pa_dev->pcell_loc, pa_dev->mod_index, IO_VIEW, & io_pdc_cell); io_count = io_pdc_cell.mod[1]; #endif @@ -1136,7 +1110,7 @@ lba_pat_resources( struct hp_device *d, static void -lba_legacy_resources( struct hp_device *d, struct lba_device *lba_dev) +lba_legacy_resources(struct parisc_device *pa_dev, struct lba_device *lba_dev) { struct resource *r; unsigned long rsize; @@ -1157,7 +1131,7 @@ lba_legacy_resources( struct hp_device * ** PCI bus walk *should* end up with the same result. ** FIXME: But we don't have sanity checks in PCI or LBA. */ - lba_num = READ_REG32(d->hpa + LBA_FW_SCRATCH); + lba_num = READ_REG32(pa_dev->hpa + LBA_FW_SCRATCH); r = &(lba_dev->hba.bus_num); r->name = "LBA PCI Busses"; r->start = lba_num & 0xff; @@ -1170,18 +1144,18 @@ lba_legacy_resources( struct hp_device * r->name = "LBA PCI LMMIO"; r->flags = IORESOURCE_MEM; /* Ignore "Range Enable" bit in the BASE register */ - r->start = ((long) READ_REG32(d->hpa + LBA_LMMIO_BASE)) & ~1UL; + r->start = ((long) READ_REG32(pa_dev->hpa + LBA_LMMIO_BASE)) & ~1UL; #ifdef __LP64__ r->start |= 0xffffffff00000000UL; /* sign extend f-space */ #endif - rsize = ~READ_REG32(d->hpa + LBA_LMMIO_MASK) + 1; + rsize = ~READ_REG32(pa_dev->hpa + LBA_LMMIO_MASK) + 1; /* ** Each rope only gets part of the distributed range. ** Adjust "window" for this rope */ rsize /= ROPES_PER_SBA; - r->start += rsize * LBA_NUM(d->hpa); + r->start += rsize * LBA_NUM(pa_dev->hpa); r->end = r->start + rsize - 1 ; /* @@ -1203,9 +1177,9 @@ lba_legacy_resources( struct hp_device * r = &(lba_dev->hba.io_space); r->name = "LBA PCI I/O Ports"; r->flags = IORESOURCE_IO; - r->start = READ_REG32(d->hpa + LBA_IOS_BASE) & ~1L; + r->start = READ_REG32(pa_dev->hpa + LBA_IOS_BASE) & ~1L; r->end = r->start + - (READ_REG32(d->hpa + LBA_IOS_MASK) ^ (HBA_PORT_SPACE_SIZE - 1)) - 1; + (READ_REG32(pa_dev->hpa + LBA_IOS_MASK) ^ (HBA_PORT_SPACE_SIZE - 1)) - 1; /* Virtualize the I/O Port space ranges */ lba_num = HBA_PORT_BASE(lba_dev->hba.hba_num); @@ -1260,7 +1234,8 @@ lba_hw_init(struct lba_device *d) #ifdef PDC_PAT_BUG /* Bug exhibited with PDC rev 40.48 on L2000 */ - if (bus_reset = (READ_REG32(d->hba.base_addr + LBA_STAT_CTL + 4) & 1)) { + bus_reset = READ_REG32(d->hba.base_addr + LBA_STAT_CTL + 4) & 1; + if (bus_reset) { BUG(); } #endif @@ -1325,29 +1300,30 @@ lba_common_init(struct lba_device *lba_d ** have work to do. */ static __init int -lba_driver_callback(struct hp_device *d, struct pa_iodc_driver *dri) +lba_driver_callback(struct parisc_device *dev) { struct lba_device *lba_dev; struct pci_bus *lba_bus; u32 func_class; void *tmp_obj; + char *version; /* Read HW Rev First */ - func_class = READ_REG32(d->hpa + LBA_FCLASS); + func_class = READ_REG32(dev->hpa + LBA_FCLASS); func_class &= 0xf; switch (func_class) { - case 0: dri->version = "TR1.0"; break; - case 1: dri->version = "TR2.0"; break; - case 2: dri->version = "TR2.1"; break; - case 3: dri->version = "TR2.2"; break; - case 4: dri->version = "TR3.0"; break; - case 5: dri->version = "TR4.0"; break; - default: dri->version = "TR4+"; + case 0: version = "TR1.0"; break; + case 1: version = "TR2.0"; break; + case 2: version = "TR2.1"; break; + case 3: version = "TR2.2"; break; + case 4: version = "TR3.0"; break; + case 5: version = "TR4.0"; break; + default: version = "TR4+"; } - printk(KERN_INFO "%s version %s (0x%x) found at 0x%p\n", - dri->name, dri->version, func_class & 0xf, d->hpa); + printk(KERN_INFO "%s version %s (0x%x) found at 0x%lx\n", + MODULE_NAME, version, func_class & 0xf, dev->hpa); /* Just in case we find some prototypes... */ if (func_class < 2) { @@ -1358,7 +1334,7 @@ lba_driver_callback(struct hp_device *d, /* ** Tell I/O SAPIC driver we have a IRQ handler/region. */ - tmp_obj = iosapic_register(d->hpa+LBA_IOSAPIC_BASE); + tmp_obj = iosapic_register(dev->hpa + LBA_IOSAPIC_BASE); #if 0 /* FIXME: some graphic cards (e.g. 103c:1005) don't have an IRT. */ if (NULL == tmp_obj) { /* iosapic may have failed. But more likely the @@ -1390,7 +1366,7 @@ lba_driver_callback(struct hp_device *d, */ lba_dev->hw_rev = func_class; - lba_dev->hba.base_addr = d->hpa; /* faster access */ + lba_dev->hba.base_addr = dev->hpa; /* faster access */ lba_dev->iosapic_obj = tmp_obj; /* save interrupt handle */ /* ------------ Second : initialize common stuff ---------- */ @@ -1407,7 +1383,7 @@ lba_driver_callback(struct hp_device *d, pci_port = &lba_pat_port_ops; /* Go ask PDC PAT what resources this LBA has */ - lba_pat_resources(d, lba_dev); + lba_pat_resources(dev, lba_dev); } else #endif @@ -1416,7 +1392,7 @@ lba_driver_callback(struct hp_device *d, pci_port = &lba_astro_port_ops; /* Poke the chip a bit for /proc output */ - lba_legacy_resources(d, lba_dev); + lba_legacy_resources(dev, lba_dev); } /* @@ -1454,6 +1430,26 @@ lba_driver_callback(struct hp_device *d, return 0; } +static struct parisc_device_id lba_tbl[] = { + { HPHW_BRIDGE, HVERSION_REV_ANY_ID, 0x782, 0xa }, + { 0, } +}; + +static struct parisc_driver lba_driver = { + name: MODULE_NAME, + id_table: lba_tbl, + probe: lba_driver_callback +}; + +/* +** One time initialization to let the world know the LBA was found. +** This is the only routine which is NOT static. +** Must be called exactly once before pci_init(). +*/ +void __init lba_init(void) +{ + register_parisc_driver(&lba_driver); +} /* ** Initialize the IBASE/IMASK registers for LBA (Elroy). Index: arch/parisc/kernel/led.c =================================================================== RCS file: /home/cvs/parisc/linux/arch/parisc/kernel/led.c,v retrieving revision 1.21 diff -u -p -r1.21 led.c --- arch/parisc/kernel/led.c 2001/07/15 18:49:16 1.21 +++ arch/parisc/kernel/led.c 2001/08/05 04:05:37 @@ -418,7 +418,7 @@ static int led_halt(struct notifier_bloc ** */ -int __init register_led_driver( int model, char *cmd_reg, char *data_reg ) +int __init register_led_driver(int model, char *cmd_reg, char *data_reg) { static int initialized; Index: arch/parisc/kernel/sba_iommu.c =================================================================== RCS file: /home/cvs/parisc/linux/arch/parisc/kernel/sba_iommu.c,v retrieving revision 1.48 diff -u -p -r1.48 sba_iommu.c --- arch/parisc/kernel/sba_iommu.c 2001/07/14 21:17:02 1.48 +++ arch/parisc/kernel/sba_iommu.c 2001/08/05 04:05:37 @@ -106,41 +106,7 @@ #define IKE_MERCED_PORT 0x803 #define IKE_ROPES_PORT 0x781 -int sba_driver_callback(struct hp_device *, struct pa_iodc_driver *); -static struct pa_iodc_driver sba_drivers_for[] = { - -/* FIXME: why is SVERSION checked? */ - - {HPHW_IOA, ASTRO_RUNWAY_PORT, 0x0, 0xb, 0, 0x10, - DRIVER_CHECK_HVERSION + - DRIVER_CHECK_SVERSION + DRIVER_CHECK_HWTYPE, - MODULE_NAME, "I/O MMU", (void *) sba_driver_callback}, - - {HPHW_BCPORT, ASTRO_ROPES_PORT, 0x0, 0xb, 0, 0x10, - DRIVER_CHECK_HVERSION + - DRIVER_CHECK_SVERSION + DRIVER_CHECK_HWTYPE, - MODULE_NAME, "I/O MMU", (void *) sba_driver_callback}, - -#if 0 -/* FIXME : N-class! Use a different "callback"? */ - {HPHW_BCPORT, IKE_MERCED_PORT, 0x0, 0xb, 0, 0x10, - DRIVER_CHECK_HVERSION + - DRIVER_CHECK_SVERSION + DRIVER_CHECK_HWTYPE, - MODULE_NAME, "I/O MMU", (void *) sba_driver_callback}, - - {HPHW_BCPORT, IKE_ROPES_PORT, 0x0, 0xb, 0, 0x10, - DRIVER_CHECK_HVERSION + - DRIVER_CHECK_SVERSION + DRIVER_CHECK_HWTYPE, - MODULE_NAME, "I/O MMU", (void *) sba_driver_callback}, -#endif - - {0,0,0,0,0,0, - 0, - (char *) NULL, (char *) NULL, (void *) NULL } -}; - - #define SBA_FUNC_ID 0x0000 /* function id */ #define SBA_FCLASS 0x0008 /* function class, bist, header, rev... */ @@ -271,13 +237,13 @@ struct ioc { struct sba_device { struct sba_device *next; /* list of LBA's in system */ - struct hp_device *iodc; /* data about dev from firmware */ - char *sba_hpa; /* base address */ + struct parisc_device_id *iodc; /* data about dev from firmware */ + unsigned long sba_hpa; /* base address */ spinlock_t sba_lock; - unsigned int flags; /* state/functionality enabled */ - unsigned int hw_rev; /* HW revision of chip */ + unsigned int flags; /* state/functionality enabled */ + unsigned int hw_rev; /* HW revision of chip */ - unsigned int num_ioc; /* number of on-board IOC's */ + unsigned int num_ioc; /* number of on-board IOC's */ struct ioc ioc[MAX_IOC]; }; @@ -446,26 +412,7 @@ sba_dump_sg( struct ioc *ioc, struct sca -/* -** One time initialization to let the world know the LBA was found. -** This is the only routine which is NOT static. -** Must be called exactly once before pci_init(). -*/ -void __init -sba_init(void) -{ - sba_list = (struct sba_device *) NULL; - sba_count = 0; - -#ifdef DEBUG_SBA_INIT - sba_dump_ranges((char *) 0xFED00000L); -#endif - - pdc_register_driver(sba_drivers_for); -} - - /************************************************************** * * I/O Pdir Resource Management @@ -1687,37 +1634,37 @@ sba_resource_map(char *buf, char **start ** have work to do. */ int -sba_driver_callback(struct hp_device *d, struct pa_iodc_driver *dri) +sba_driver_callback(struct parisc_device *dev) { struct sba_device *sba_dev; u32 func_class; int i; + char *version; - if (IS_ASTRO(d)) { + if (IS_ASTRO(&dev->id)) { static char astro_rev[]="Astro ?.?"; /* Read HW Rev First */ - func_class = READ_REG32(d->hpa); + func_class = READ_REG32(dev->hpa); astro_rev[6] = '1' + (char) (func_class & 0x7); astro_rev[8] = '0' + (char) ((func_class & 0x18) >> 3); - dri->version = astro_rev; + version = astro_rev; } else { static char ike_rev[]="Ike rev ?"; /* Read HW Rev First */ - func_class = READ_REG32(d->hpa + SBA_FCLASS); + func_class = READ_REG32(dev->hpa + SBA_FCLASS); ike_rev[8] = '0' + (char) (func_class & 0xff); - dri->version = ike_rev; + version = ike_rev; } - printk(KERN_INFO "%s found %s at 0x%p\n", - dri->name, dri->version, d->hpa); + printk(KERN_INFO "%s found %s at 0x%lx\n", + MODULE_NAME, version, dev->hpa); sba_dev = kmalloc(sizeof(struct sba_device), GFP_KERNEL); - if (NULL == sba_dev) - { + if (NULL == sba_dev) { printk(KERN_ERR MODULE_NAME " - couldn't alloc sba_device\n"); return(1); } @@ -1727,8 +1674,8 @@ sba_driver_callback(struct hp_device *d, sba_dev->hw_rev = func_class; - sba_dev->iodc = d; - sba_dev->sba_hpa = d->hpa; /* faster access */ + sba_dev->iodc = &dev->id; + sba_dev->sba_hpa = dev->hpa; /* faster access */ sba_get_pat_resources(sba_dev); sba_hw_init(sba_dev); @@ -1737,7 +1684,7 @@ sba_driver_callback(struct hp_device *d, hppa_dma_ops = &sba_ops; #ifdef CONFIG_PROC_FS - if (IS_ASTRO(d)) { + if (IS_ASTRO(&dev->id)) { create_proc_info_entry("Astro", 0, proc_runway_root, sba_proc_info); } else { create_proc_info_entry("Ike", 0, proc_runway_root, sba_proc_info); @@ -1746,3 +1693,35 @@ sba_driver_callback(struct hp_device *d, #endif return 0; } + +static struct parisc_device_id sba_tbl[] = { +/* FIXME: why is SVERSION checked? */ + { HPHW_IOA, HVERSION_REV_ANY_ID, ASTRO_RUNWAY_PORT, 0xb }, + { HPHW_BCPORT, HVERSION_REV_ANY_ID, ASTRO_ROPES_PORT, 0xb }, +#if 0 + { HPHW_BCPORT, HVERSION_REV_ANY_ID, IKE_MERCED_PORT, 0xb }, + { HPHW_BCPORT, HVERSION_REV_ANY_ID, IKE_ROPES_PORT, 0xb }, +#endif + { 0, } +}; + +static struct parisc_driver sba_driver = { + name: MODULE_NAME, + id_table: sba_tbl, + probe: sba_driver_callback, +}; + +/* +** One time initialization to let the world know the SBA was found. +** This is the only routine which is NOT static. +** Must be called exactly once before pci_init(). +*/ +void __init sba_init(void) +{ +#ifdef DEBUG_SBA_INIT + sba_dump_ranges((char *) 0xFED00000L); +#endif + + register_parisc_driver(&sba_driver); +} + Index: arch/parisc/kernel/setup.c =================================================================== RCS file: /home/cvs/parisc/linux/arch/parisc/kernel/setup.c,v retrieving revision 1.86 diff -u -p -r1.86 setup.c --- arch/parisc/kernel/setup.c 2001/07/14 21:17:02 1.86 +++ arch/parisc/kernel/setup.c 2001/08/05 04:05:37 @@ -70,15 +70,6 @@ char command_line[COMMAND_LINE_SIZE]; struct system_cpuinfo_parisc boot_cpu_data; struct cpuinfo_parisc cpu_data[NR_CPUS]; -static int cpu_driver_callback(struct hp_device *, struct pa_iodc_driver *); - -static struct pa_iodc_driver cpu_drivers_for[] = { - {HPHW_NPROC, 0x0, 0x0, 0x0, 0, 0, - DRIVER_CHECK_HWTYPE, - "CPU", "PARISC", (void *) cpu_driver_callback}, - {0,} -}; - static long fallback_cpu_hpa[] = { 0xfffa0000L, 0xfffbe000L, 0x0 }; /* This has to go somewhere in architecture specific code. */ @@ -95,7 +86,7 @@ int EISA_bus; ** The callback *should* do per-instance initialization of ** everything including the monarch. "Per CPU" init code in ** setup.c:start_parisc() has migrated here and start_parisc() -** will "pdc_register_driver(cpu_driver_for)" before calling do_inventory(). +** will call register_parisc_driver(&cpu_driver) before calling do_inventory(). ** ** The goal of consolidating CPU initialization into one place is ** to make sure all CPU's get initialized the same way. @@ -111,7 +102,7 @@ int EISA_bus; static int -cpu_driver_callback(struct hp_device *d, struct pa_iodc_driver *dri) +cpu_driver_callback(struct parisc_device *dev) { unsigned long txn_addr; unsigned long cpuid; @@ -131,28 +122,28 @@ cpu_driver_callback(struct hp_device *d, pdc_pat_cell_mod_maddr_block_t pa_pdc_cell; struct pdc_pat_cpu_num cpu_info; - status = pdc_pat_cell_module(&bytecnt, d->pcell_loc, - d->mod_index, PA_VIEW, &pa_pdc_cell); + status = pdc_pat_cell_module(&bytecnt, dev->pcell_loc, + dev->mod_index, PA_VIEW, &pa_pdc_cell); ASSERT(PDC_RET_OK == status); /* verify it's the same as what do_pat_inventory() found */ - ASSERT(d->mod_info == pa_pdc_cell.mod_info); - ASSERT(d->pmod_loc == pa_pdc_cell.mod_location); - ASSERT(d->mod_path == pa_pdc_cell.mod_path); + ASSERT(dev->mod_info == pa_pdc_cell.mod_info); + ASSERT(dev->pmod_loc == pa_pdc_cell.mod_location); + ASSERT(dev->mod_path == pa_pdc_cell.mod_path); txn_addr = pa_pdc_cell.mod[0]; /* id_eid for IO sapic */ /* get the cpu number */ - status = pdc_pat_cpu_get_number(&cpu_info, d->hpa); + status = pdc_pat_cpu_get_number(&cpu_info, dev->hpa); ASSERT(PDC_RET_OK == status); if(cpu_info.cpu_num >= NR_CPUS) { - printk(KERN_WARNING "IGNORING CPU at 0x%p," + printk(KERN_WARNING "IGNORING CPU at 0x%x," " cpu_slot_id > NR_CPUS" " (%ld > %d)\n", - d->hpa, cpu_info.cpu_num, NR_CPUS); + dev->hpa, cpu_info.cpu_num, NR_CPUS); /* Ignore CPU since it will only crash */ boot_cpu_data.cpu_count--; return(1); @@ -162,7 +153,7 @@ cpu_driver_callback(struct hp_device *d, } else #endif { - txn_addr = (unsigned long) d->hpa; /* for legacy PDC */ + txn_addr = dev->hpa; /* for legacy PDC */ /* logical CPU ID and update global counter */ cpuid = boot_cpu_data.cpu_count; @@ -174,10 +165,10 @@ cpu_driver_callback(struct hp_device *d, /* initialize counters */ memset(p, 0, sizeof(struct cpuinfo_parisc)); - p->dev = d; /* Save hp_device ref in case we want PDC data */ - p->hpa = (unsigned long) d->hpa; /* save CPU hpa */ - p->cpuid = cpuid; /* save CPU hpa */ - p->txn_addr = txn_addr; /* save CPU hpa */ + p->dev = dev; /* Save IODC data in case we need it */ + p->hpa = dev->hpa; /* save CPU hpa */ + p->cpuid = cpuid; /* save CPU id */ + p->txn_addr = txn_addr; /* save CPU hpa */ /* ** CONFIG_SMP: init_smp_config() will attempt to get CPU's into @@ -191,7 +182,7 @@ cpu_driver_callback(struct hp_device *d, */ p->region = irq_region[IRQ_FROM_REGION(CPU_IRQ_REGION)]; - return(0); + return 0; } @@ -202,18 +193,17 @@ cpu_driver_callback(struct hp_device *d, void __init register_fallback_cpu (void) { - struct hp_device *d = NULL; int i = 0; printk(KERN_INFO "No CPUs reported by firmware - probing...\n"); while (fallback_cpu_hpa[i]) { + struct parisc_device *dev = alloc_pa_dev(fallback_cpu_hpa[i]); + /* Um, where do we free this? */ - d = alloc_pa_dev(fallback_cpu_hpa[i]); - - if (d && (HPHW_NPROC == d->hw_type)) { + if (dev && (HPHW_NPROC == dev->id.hw_type)) { printk(KERN_INFO "Found CPU at %lx\n", fallback_cpu_hpa[i]); - (void) register_pa_dev(d); + register_pa_dev(dev); return; } @@ -377,6 +367,18 @@ void __init dma_ops_init(void) } } + +static struct parisc_device_id cpu_tbl[] = { + { HPHW_NPROC, HVERSION_REV_ANY_ID, HVERSION_ANY_ID, SVERSION_ANY_ID }, + { 0, } +}; + +static struct parisc_driver cpu_driver = { + name: "CPU", + id_table: cpu_tbl, + probe: cpu_driver_callback +}; + void __init setup_arch(char **cmdline_p) { init_per_cpu(smp_processor_id()); /* Set Modes & Enable FP */ @@ -406,7 +408,7 @@ void __init setup_arch(char **cmdline_p) dma_ops_init(); do_device_inventory(); /* probe for hardware */ - pdc_register_driver(cpu_drivers_for); /* claim all the CPUs */ + register_parisc_driver(&cpu_driver); /* claim all the CPUs */ if (boot_cpu_data.cpu_count == 0) register_fallback_cpu(); @@ -472,4 +474,3 @@ int get_cpuinfo(char *buffer) return p - buffer; } #endif - Index: drivers/char/hp_psaux.c =================================================================== RCS file: /home/cvs/parisc/linux/drivers/char/hp_psaux.c,v retrieving revision 1.11 diff -u -p -r1.11 hp_psaux.c --- drivers/char/hp_psaux.c 2001/07/31 22:11:04 1.11 +++ drivers/char/hp_psaux.c 2001/08/05 04:05:38 @@ -14,10 +14,6 @@ #include -#include -#include -#include - #include #include /* interrupt.h wants struct pt_regs defined */ #include @@ -28,6 +24,7 @@ #include #include #include +#include #include #include @@ -37,9 +34,13 @@ #include #include #include -#include #include +#include +#include +#include +#include + /* HP specific LASI PS/2 keyboard and psaux constants */ #define AUX_REPLY_ACK 0xFA /* Command byte ACK. */ #define AUX_RECONNECT 0xAA /* scancode when ps2 device is plugged (back) in */ @@ -69,31 +70,31 @@ #define LASI_STAT_DATSHD 0x40 #define LASI_STAT_CLKSHD 0x80 -static void *lasikbd_hpa; -static void *lasips2_hpa; +static unsigned long lasikbd_hpa; +static unsigned long lasips2_hpa; -static inline u8 read_input(void *hpa) +static inline u8 read_input(unsigned long hpa) { return gsc_readb(hpa+LASI_RCVDATA); } -static inline u8 read_control(void *hpa) +static inline u8 read_control(unsigned long hpa) { return gsc_readb(hpa+LASI_CONTROL); } -static inline void write_control(u8 val, void *hpa) +static inline void write_control(u8 val, unsigned long hpa) { gsc_writeb(val, hpa+LASI_CONTROL); } -static inline u8 read_status(void *hpa) +static inline u8 read_status(unsigned long hpa) { return gsc_readb(hpa+LASI_STATUS); } -static int write_output(u8 val, void *hpa) +static int write_output(u8 val, unsigned long hpa) { int wait = 0; @@ -154,7 +155,7 @@ int lasi_ps2_test(void *hpa) } #endif -static int __init lasi_ps2_reset(void *hpa, int id) +static int __init lasi_ps2_reset(unsigned long hpa, int id) { u8 control; int ret = 1; @@ -389,7 +390,7 @@ static struct miscdevice psaux_mouse = { /* This function is looking at the PS2 controller and empty the two buffers */ -static u8 handle_lasikbd_event(void *hpa) +static u8 handle_lasikbd_event(unsigned long hpa) { u8 status_keyb,status_mouse,scancode,id; extern void handle_at_scancode(int); /* in drivers/char/keyb_at.c */ @@ -443,7 +444,7 @@ extern struct pt_regs *kbd_pt_regs; static void lasikbd_interrupt(int irq, void *dev, struct pt_regs *regs) { - lasips2_hpa = dev; /* save "hpa" for lasikbd_leds() */ + lasips2_hpa = (unsigned long) dev; /* save "hpa" for lasikbd_leds() */ kbd_pt_regs = regs; handle_lasikbd_event(lasips2_hpa); } @@ -462,9 +463,9 @@ static struct kbd_ops gsc_ps2_kbd_ops = }; static int __init -lasi_ps2_register(struct hp_device *d, struct pa_iodc_driver *dri) +lasi_ps2_register(struct parisc_device *dev) { - void *hpa = (void *) d->hpa; + unsigned long hpa = dev->hpa; unsigned int irq; char *name; int device_found; @@ -490,13 +491,13 @@ lasi_ps2_register(struct hp_device *d, s device_found = lasi_ps2_reset(hpa,id); /* allocate the irq and memory region for that device */ - if (!(irq = busdevice_alloc_irq(d))) + if (!(irq = busdevice_alloc_irq(dev))) return -ENODEV; - if (request_irq(irq, lasikbd_interrupt, 0, name, hpa)) + if (request_irq(irq, lasikbd_interrupt, 0, name, (void *)hpa)) return -ENODEV; - if (!request_mem_region((unsigned long)hpa, LASI_STATUS + 4, name)) + if (!request_mem_region(hpa, LASI_STATUS + 4, name)) return -ENODEV; switch (id) { @@ -528,23 +529,27 @@ lasi_ps2_register(struct hp_device *d, s printk(KERN_INFO "PS/2 %s controller at 0x%08lx (irq %d) found, " "%sdevice attached.\n", - name, (unsigned long)hpa, irq, - device_found ? "":"no "); + name, hpa, irq, device_found ? "":"no "); return 0; } +static struct parisc_device_id lasi_psaux_tbl[] __devinitdata = { + { HPHW_FIO, HVERSION_REV_ANY_ID, HVERSION_ANY_ID, 0x00084 }, + { 0, } /* 0 terminated list */ +}; + +MODULE_DEVICE_TABLE(parisc, lasi_psaux_tbl); -static struct pa_iodc_driver lasi_psaux_drivers_for[] __initdata = { - {HPHW_FIO, 0x0, 0,0x00084, 0, 0, - DRIVER_CHECK_HWTYPE + DRIVER_CHECK_SVERSION, - "Lasi psaux", "generic", (void *) lasi_ps2_register}, - { 0, } +static struct parisc_driver lasi_psaux_driver = { + name: "Lasi psaux", + id_table: lasi_psaux_tbl, + probe: lasi_ps2_register, }; static int __init gsc_ps2_init(void) { - return pdc_register_driver(lasi_psaux_drivers_for); + return register_parisc_driver(&lasi_psaux_driver); } module_init(gsc_ps2_init); Index: drivers/gsc/asp.c =================================================================== RCS file: /home/cvs/parisc/linux/drivers/gsc/asp.c,v retrieving revision 1.8 diff -u -p -r1.8 asp.c --- drivers/gsc/asp.c 2001/07/31 22:08:48 1.8 +++ drivers/gsc/asp.c 2001/08/05 04:05:38 @@ -13,8 +13,9 @@ #include #include -#include +#include #include +#include #include #include @@ -30,10 +31,10 @@ #undef USE_VIPER /* VIPER - graphics-board */ static int -asp_find_irq(struct busdevice *busdev_dev, struct hp_device *dev) +asp_find_irq(struct busdevice *busdev_dev, struct parisc_device *dev) { int irq; - int off = ((int) dev->hpa) & 0xffff; + int off = dev->hpa & 0xffff; /* ** "irq" bits below are numbered relative to most significant bit. @@ -57,7 +58,7 @@ asp_find_irq(struct busdevice *busdev_de } int __init -asp_init_chip(struct hp_device *d, struct pa_iodc_driver *dri) +asp_init_chip(struct parisc_device *dev) { struct busdevice *asp; struct gsc_irq gsc_irq; @@ -67,14 +68,14 @@ asp_init_chip(struct hp_device *d, struc if(!asp) return -ENOMEM; - asp->name = "ASP"; + asp->name = "Asp"; asp->find_irq = asp_find_irq; /* The PDC-Firmware reports the ASP at 0xF082F000, but we must use a HPA of 0xF0820000 */ - asp->hpa = (char *) ASP_HPA_HARD; + asp->hpa = ASP_HPA_HARD; asp->version = gsc_readb(asp->hpa + ASP_VER_OFFSET); - printk(KERN_INFO "%s version %d at 0x%p found.\n", + printk(KERN_INFO "%s version %d at 0x%lx found.\n", asp->name, asp->version, asp->hpa); /* Stop ASP hissing for a bit */ @@ -106,14 +107,14 @@ asp_init_chip(struct hp_device *d, struc // gsc_writel(asp->eim, asp->hpa + OFFSET_IAR); /* Done init'ing, register this driver */ - ret = register_busdevice( d, asp ); + ret = register_busdevice(dev, asp); if (ret) - goto out; + goto out; /* initialize the chassis LEDs */ #ifdef CONFIG_CHASSIS_LCD_LED - register_led_driver( DISPLAY_MODEL_OLD_ASP, LED_CMD_REG_NONE, - (char *) (asp->hpa + OFFSET_ASP_LED) ); + register_led_driver(DISPLAY_MODEL_OLD_ASP, LED_CMD_REG_NONE, + (char *)(asp->hpa + OFFSET_ASP_LED)); #endif return 0; @@ -122,3 +123,14 @@ out: kfree(asp); return ret; } + +static struct parisc_device_id asp_tbl[] = { + { HPHW_BA, HVERSION_REV_ANY_ID, HVERSION_ANY_ID, 0x00081 }, + { 0, } +}; + +struct parisc_driver asp_driver = { + name: "Asp", + id_table: asp_tbl, + probe: asp_init_chip, +}; Index: drivers/gsc/busdevice.c =================================================================== RCS file: /home/cvs/parisc/linux/drivers/gsc/busdevice.c,v retrieving revision 1.23 diff -u -p -r1.23 busdevice.c --- drivers/gsc/busdevice.c 2001/07/31 22:08:48 1.23 +++ drivers/gsc/busdevice.c 2001/08/05 04:05:38 @@ -39,18 +39,6 @@ #endif -static struct pa_iodc_driver busdev_drivers_for[] = { -/* I'm pretty sure this covers them all. */ - {HPHW_BA, 0x0, 0, 0x00081, 0, 0, - DRIVER_CHECK_HWTYPE + DRIVER_CHECK_SVERSION, - "Lasi", "generic", lasi_init_chip}, - {HPHW_BA, 0x0, 0, 0x00070, 0, 0, - DRIVER_CHECK_HWTYPE + DRIVER_CHECK_SVERSION, - "ASP", "generic", asp_init_chip}, - { 0 } -}; - - /* IRQ bits must be numbered from Most Significant Bit */ #define BUSDEV_FIX_IRQ(x) (31-(x)) #define BUSDEV_MASK_IRQ(x) (1<<(BUSDEV_FIX_IRQ(x))) @@ -59,13 +47,12 @@ static struct pa_iodc_driver busdev_driv static struct busdevice *busdev_list = NULL; -int busdevice_alloc_irq( struct hp_device *dev ) +int busdevice_alloc_irq(struct parisc_device *dev) { struct busdevice *busdev = busdev_list; int irq; - if (!busdev) - { + if (!busdev) { printk(KERN_ERR "%s(0x%p): No LASI/ASP/WAX found in system yet !\n", __FUNCTION__, dev); return 0; @@ -75,15 +62,12 @@ int busdevice_alloc_irq( struct hp_devic /* deller: Changed to test only the 3 highest nibbles of the address-range, since ASP uses hpa of 0xf080yyyy, but devices are at adress 0xf082yyyy ! */ - while (busdev && - (((unsigned long) busdev->hpa & ~0xfffff) != ((unsigned long) dev->hpa & ~0xfffff))) - { + while (busdev && ((busdev->hpa & ~0xfffff) != (dev->hpa & ~0xfffff))) { busdev = busdev->next; } - if (!busdev) - { - printk(KERN_WARNING "%s(0x%p): No known LASI/ASP/WAX owns device at 0x%p !\n", + if (!busdev) { + printk(KERN_WARNING "%s(0x%p): No known LASI/ASP/WAX owns device at 0x%lx !\n", __FUNCTION__, dev, dev->hpa); return 0; } @@ -92,9 +76,8 @@ int busdevice_alloc_irq( struct hp_devic irq = busdev->find_irq(busdev, dev); if (irq < 0) { - printk(KERN_ERR "%s(0x%p): %s has never seen the HPA offset of 0x%lx.\n", - __FUNCTION__, dev->hpa, busdev->name, - ((unsigned long) dev->hpa) & 0xffff ); + printk(KERN_ERR "%s(0x%lx): %s has never seen the HPA offset of 0x%lx.\n", + __FUNCTION__, dev->hpa, busdev->name, dev->hpa & 0xffff ); return (0); } @@ -200,7 +183,7 @@ struct irq_region_ops busdev_irq_ops = { } while (0) -int register_busdevice( struct hp_device *gsc_parent, +int register_busdevice( struct parisc_device *gsc_parent, struct busdevice *busdev ) { struct resource *res; @@ -218,7 +201,7 @@ int register_busdevice( struct hp_device res = kmalloc(sizeof(struct resource), GFP_KERNEL); if (res) { res->name = busdev->name; - res->start = (unsigned long) busdev->hpa; + res->start = busdev->hpa; res->end = res->start + 0x100000 - 1; res->flags = IORESOURCE_MEM; /* do not mark it busy ! */ res->child = NULL; @@ -236,19 +219,17 @@ int register_busdevice( struct hp_device return 0; } - - -/* - * Initialize all main controller chips (LASI/ASP/WAX/EISA) - */ - 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; void __init busdevices_init(void) { - pdc_register_driver(busdev_drivers_for); - +#ifdef CONFIG_GSC_LASI + register_parisc_driver(&lasi_driver); + register_parisc_driver(&asp_driver); +#endif #ifdef CONFIG_GSC_WAX register_wax_driver(); #endif Index: drivers/gsc/busdevice.h =================================================================== RCS file: /home/cvs/parisc/linux/drivers/gsc/busdevice.h,v retrieving revision 1.4 diff -u -p -r1.4 busdevice.h --- drivers/gsc/busdevice.h 2000/04/20 16:56:18 1.4 +++ drivers/gsc/busdevice.h 2001/08/05 04:05:38 @@ -13,11 +13,10 @@ #define OFFSET_IAR 0x0010 /* Interrupt address register */ -struct busdevice -{ +struct busdevice { struct busdevice *next; - struct hp_device *gsc; - volatile char *hpa; + struct parisc_device *gsc; + unsigned long hpa; char *name; int version; int type; @@ -25,25 +24,20 @@ struct busdevice int eim; struct irq_region *busdev_region; spinlock_t spinlock; - int (*find_irq) (struct busdevice *this_dev, struct hp_device *dev); + int (*find_irq) (struct busdevice *this_dev, struct parisc_device *dev); }; /* short cut to keep the compiler happy */ #define BUSDEV_DEV(x) ((struct busdevice *) (x)) -int register_busdevice( struct hp_device *gsc_parent, struct busdevice *busdev_new ); +int register_busdevice(struct parisc_device *gsc_parent, struct busdevice *busdev_new); /* returns a virtual irq for device at dev->hpa (works for all LASI/ASP/WAX) */ -int busdevice_alloc_irq( struct hp_device *dev ); +int busdevice_alloc_irq(struct parisc_device *dev); void busdev_barked(int busdev_irq, void *dev, struct pt_regs *regs); extern unsigned int hil_base; /* BASE of HIL-Port */ extern unsigned int hil_irq; /* IRQ of HIL-Port */ - -int lasi_init_chip(struct hp_device *d, struct pa_iodc_driver * dri); -int asp_init_chip(struct hp_device *d, struct pa_iodc_driver * dri); -int wax_init_chip(struct hp_device *d, struct pa_iodc_driver * dri); -/* int eisa_wax_init_chip(struct hp_device *d, struct pa_iodc_driver * dri); */ #endif /* BUSDEVICE_H */ Index: drivers/gsc/dino.c =================================================================== RCS file: /home/cvs/parisc/linux/drivers/gsc/dino.c,v retrieving revision 1.33 diff -u -p -r1.33 dino.c --- drivers/gsc/dino.c 2001/07/31 22:08:48 1.33 +++ drivers/gsc/dino.c 2001/08/05 04:05:38 @@ -87,68 +87,10 @@ ** bus number for each dino. */ -/* -** If hversion is what is read from Dino, we should be OK. -** If it's what PDC told us, J2240 PDC reports the hv_model wrong -** for the first Dino. I think it reports 0x05d. ... -** -** But life gets worse...the "lba" PCI bus adapter (used in newer -** B/C/J/L/N-class) has the same hversion. Also need to test sversion -** when support for "lba" is added as well. -*/ - // REVISIT: 715 reports card-mode Dino IODC data wrong. // May need to read it "by hand". -#define is_card_dino(dev) (dev->sversion == 0x9d || dev->sversion == 0x8080) -#define dino_hrev(dev) (dev->hversion & 0xf) - -static int dino_driver_callback(struct hp_device *d, struct pa_iodc_driver *dri); - -static struct pa_iodc_driver dino_drivers_for[] = { +#define is_card_dino(id) ((id)->sversion == 0x9d || (id)->sversion == 0x8080) - /* A180 reports the card-mode Dino as: */ - {HPHW_A_DMA, 0x004, 0, 0x0009D, 0, 0x80, - DRIVER_CHECK_HVERSION + DRIVER_CHECK_HVERSION_REV + - DRIVER_CHECK_SVERSION, - "Dino", "3.x (card mode)",(void *) dino_driver_callback}, - - /* 715 reports same card-mode Dino, uh, erm,...differently. - ** bug in pdc_iodc_read() PDC support? - */ - {HPHW_A_DMA, 0x444, 0, 0x8080, 0, 0x80, - DRIVER_CHECK_HVERSION + DRIVER_CHECK_SVERSION + - DRIVER_CHECK_HWTYPE, - "Dino", "3.x (card mode)",(void *) dino_driver_callback}, - - {HPHW_BRIDGE, 0x680, 0x3, 0xa, 0,0, - DRIVER_CHECK_HVERSION + DRIVER_CHECK_HVERSION_REV + - DRIVER_CHECK_SVERSION + DRIVER_CHECK_HWTYPE, - "Dino", "3.1 (bridge mode)", (void *) dino_driver_callback}, - - {HPHW_BRIDGE, 0x680, 0x02, 0xa, 0,0, - DRIVER_CHECK_HVERSION + DRIVER_CHECK_HVERSION_REV + - DRIVER_CHECK_SVERSION + DRIVER_CHECK_HWTYPE, - "Dino", "3.0 (bridge mode)", (void *) dino_driver_callback}, - - {HPHW_BRIDGE, 0x680, 0x01, 0xa, 0,0, - DRIVER_CHECK_HVERSION + DRIVER_CHECK_HVERSION_REV + - DRIVER_CHECK_SVERSION + DRIVER_CHECK_HWTYPE, - "Dino", "2.1 (bridge mode)", (void *) dino_driver_callback}, - - {HPHW_BRIDGE, 0x680, 0x00, 0xa, 0,0, - DRIVER_CHECK_HVERSION + DRIVER_CHECK_HVERSION_REV + - DRIVER_CHECK_SVERSION + DRIVER_CHECK_HWTYPE, - "Dino", "2.0 (bridge mode)", (void *) dino_driver_callback}, - - {HPHW_BRIDGE, 0x05d, 0x03, 0xa, 0,0, - DRIVER_CHECK_HVERSION + DRIVER_CHECK_HVERSION_REV + - DRIVER_CHECK_SVERSION + DRIVER_CHECK_HWTYPE, - "Dino", "J2240 (bridge mode)", (void *) dino_driver_callback}, - - { 0, } -}; - - #define DINO_IAR0 0x004 #define DINO_IODC_ADDR 0x008 #define DINO_IODC_DATA_0 0x008 @@ -213,18 +155,6 @@ static struct pa_iodc_driver dino_driver /* #define xxx 0x200 - bit 9 not used */ #define RS232INT 0x400 -/* REVISIT: replace dino_version with something GSC generic */ -struct dino_version_mapping -{ - u16 hversion; /* model:12 rev:4 */ - u8 spa; - u8 type; - char *version_string; -}; - - - char *base_addr; /* REVISIT: declare this volatile */ - struct dino_device { struct pci_hba_data hba; /* 'C' inheritance - must be first */ @@ -370,20 +300,6 @@ struct pci_port_ops dino_port_ops = { -/* -** One time initialization to let the world know Dino is here. -** This is the only routine which is NOT static. -** Must be called exactly once before pci_init(). -*/ -int __init dino_init(void) -{ - /* This claim any Dino devices discovered to date - ** and invoke our driver_callback. - */ - pdc_register_driver(dino_drivers_for); - return 0; -} - static void dino_mask_irq(void *irq_dev, int irq) @@ -539,10 +455,10 @@ ilr_again: } static int -dino_find_irq(struct busdevice *dino_dev, struct hp_device *dev) +dino_find_irq(struct busdevice *dino_dev, struct parisc_device *dev) { int irq; - int off = ((int) dev->hpa) & 0xffff; + int off = dev->hpa & 0xffff; switch (off) { case 0x1000: irq = 8; break; /* PS/2 Keyboard and Mouse */ @@ -681,7 +597,7 @@ dino_fixup_bus(struct pci_bus *bus) pci_read_bridge_bases(bus); list_for_each(ln, &bus->devices) { - int i; + int i; dev = pci_dev_b(ln); if (is_card_dino(dino_dev->hba.iodc_info)) @@ -815,7 +731,7 @@ dino_bridge_init(struct dino_device *din } static int __init -dino_common_init(struct hp_device *d, struct dino_device *dino_dev) +dino_common_init(struct parisc_device *d, struct dino_device *dino_dev) { int status; u32 eim; @@ -926,7 +842,7 @@ dino_common_init(struct hp_device *d, st res->flags = IORESOURCE_IO; /* do not mark it busy ! */ res->child = NULL; if (request_resource(&ioport_resource, res) < 0) { - printk(KERN_ERR "DINO: request I/O Port region failed 0x%lx/%lx (hpa 0x%p)\n" + printk(KERN_ERR "DINO: request I/O Port region failed 0x%lx/%lx (hpa 0x%lx)\n" , res->start, res->end, dino_dev->hba.base_addr); return(1); } @@ -942,15 +858,28 @@ dino_common_init(struct hp_device *d, st ** Much of the initialization is common though. */ static int __init -dino_driver_callback(struct hp_device *d, struct pa_iodc_driver *dri) +dino_driver_callback(struct parisc_device *dev) { struct dino_device *dino_dev; // Dino specific control struct + char *version; - printk("Dino version %s found at 0x%p\n",dri->version, d->hpa); + if (dev->id.hw_type == HPHW_A_DMA) { + version = "3.x (card mode)"; + } else { + switch (dev->id.hversion_rev) { + case 0: version = "2.0"; break; + case 1: version = "2.1"; break; + case 2: version = "3.0"; break; + case 3: version = "3.1"; break; + default: version = "unknown"; return 1; + } + } - if (!request_mem_region((ulong) d->hpa, PAGE_SIZE, "Dino HPA")) { - printk(KERN_ERR "DINO: Hey! Someone took my MMIO space (0x%p)!\n", - d->hpa); + printk("Dino version %s found at 0x%lx\n", version, dev->hpa); + + if (!request_mem_region(dev->hpa, PAGE_SIZE, "Dino HPA")) { + printk(KERN_ERR "DINO: Hey! Someone took my MMIO space (0x%ld)!\n", + dev->hpa); return 1; } @@ -959,49 +888,77 @@ dino_driver_callback(struct hp_device *d ** The data corruption problem in their case was fixed ** by changing the PAL. */ - if (!is_card_dino(d) && (d->hversion_rev < 3)) { + if (!is_card_dino(&dev->id) && (dev->id.hversion_rev < 3)) { printk(KERN_WARNING "\n\nThe GSCtoPCI (Dino hrev %d) bus converter found may exhibit\n" "data corruption. See Service Note Numbers: A4190A-01, A4191A-01.\n" "Systems shipped after Aug 20, 1997 will not exhibit this problem.\n" "Models affected: C180, C160, C160L, B160L, and B132L workstations.\n\n", - d->hversion_rev); + dev->id.hversion_rev); /* REVISIT: why are C200/C240 listed in the README table but not ** "Models affected"? Could be an ommission in the original literature. */ } dino_dev = kmalloc(sizeof(struct dino_device), GFP_KERNEL); - if (!dino_dev) - { + if (!dino_dev) { printk("dino_init_chip - couldn't alloc dino_device\n"); - return(1); + return 1; } memset(dino_dev, 0, sizeof(struct dino_device)); - dino_dev->hba.iodc_info = d; - dino_dev->hba.base_addr = d->hpa; /* faster access */ + dino_dev->hba.iodc_info = &dev->id; + dino_dev->hba.base_addr = dev->hpa; /* faster access */ dino_dev->dinosaur_pen = SPIN_LOCK_UNLOCKED; - if (is_card_dino(d)) - { + if (is_card_dino(&dev->id)) { dino_card_init(dino_dev); } else { dino_bridge_init(dino_dev); } - if (dino_common_init(d,dino_dev)) - return(1); + if (dino_common_init(dev, dino_dev)) + return 1; /* ** 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, (void *) dino_dev); + dino_dev->hba.hba_bus = pci_scan_bus(dino_dev->hba.hba_num, &dino_cfg_ops, (void *) dino_dev); return 0; } +/* + * If we read hversion from Dino, we're OK. But the J2240 PDC reports the + * wrong hversion for the first Dino. Unfortunately, the Elroy PCI bus + * adapter (used in newer B/C/J/A/L/N-class) has the same hversion. So we + * test the sversion as well to distinguish between the two. + */ + +static struct parisc_device_id dino_tbl[] = { + { HPHW_A_DMA, 0, 0x004, 0x0009D }, /* A180 card-mode Dino. Ver 3.x */ + { HPHW_A_DMA, 0, 0x444, 0x08080 }, /* Same card in a 715. Bug? */ + { HPHW_BRIDGE, HVERSION_REV_ANY_ID, 0x680, 0xa }, /* Bridge-mode Dino */ + { HPHW_BRIDGE, 0x03, 0x05d, 0xa }, /* Dino in a J2240 */ + { 0, } +}; + +static struct parisc_driver dino_driver = { + name: "Dino", + id_table: dino_tbl, + probe: dino_driver_callback, +}; + +/* + * One time initialization to let the world know Dino is here. + * This is the only routine which is NOT static. + * Must be called exactly once before pci_init(). + */ +int __init dino_init(void) +{ + register_parisc_driver(&dino_driver); + return 0; +} Index: drivers/gsc/hil.c =================================================================== RCS file: /home/cvs/parisc/linux/drivers/gsc/hil.c,v retrieving revision 1.7 diff -u -p -r1.7 hil.c --- drivers/gsc/hil.c 2001/07/31 22:08:48 1.7 +++ drivers/gsc/hil.c 2001/08/05 04:05:38 @@ -14,10 +14,13 @@ #include #include #include -#include +#include #include +#include #include + #include +#include #include "busdevice.h" @@ -27,18 +30,18 @@ unsigned int hil_irq; extern int hil_keyb_init(void); static int __init -hil_init_chip(struct hp_device *d, struct pa_iodc_driver *dri) +hil_init_chip(struct parisc_device *dev) { int retval, irq; - irq = busdevice_alloc_irq(d); + irq = busdevice_alloc_irq(dev); if (!irq) { - printk(__FILE__ ": IRQ not found for HIL at 0x%p\n", d->hpa); - return -ENODEV; + printk(__FILE__ ": IRQ not found for HIL at 0x%lx\n", dev->hpa); + return -ENODEV; } - hil_base = (unsigned int) d->hpa; + hil_base = dev->hpa; hil_irq = irq; /* store the IRQ */ printk(KERN_INFO "Found HIL at 0x%x, IRQ %d\n", hil_base, hil_irq); @@ -50,18 +53,22 @@ hil_init_chip(struct hp_device *d, struc } -static struct pa_iodc_driver hil_drivers_for[] = { - {HPHW_FIO, 0x0, 0x0, 0x73, 0x0, 0, - DRIVER_CHECK_SVERSION + DRIVER_CHECK_HWTYPE, - "HIL", "712, 715 or similiar", hil_init_chip}, - { 0 } +static struct parisc_device_id hil_tbl[] = { + { HPHW_FIO, HVERSION_REV_ANY_ID, HVERSION_ANY_ID, 0x00073 }, + { 0, } }; + +MODULE_DEVICE_TABLE(parisc, hil_tbl); -static int __init -register_hil_drivers(void) +static struct parisc_driver hil_driver = { + name: "HIL", + id_table: hil_tbl, + probe: hil_init_chip, +}; + +static int __init hil_init(void) { - return pdc_register_driver(hil_drivers_for); + return register_parisc_driver(&hil_driver); } - -module_init(register_hil_drivers); +module_init(hil_init); Index: drivers/gsc/lan.c =================================================================== RCS file: /home/cvs/parisc/linux/drivers/gsc/lan.c,v retrieving revision 1.11 diff -u -p -r1.11 lan.c --- drivers/gsc/lan.c 2001/07/31 22:08:48 1.11 +++ drivers/gsc/lan.c 2001/08/05 04:05:38 @@ -13,44 +13,47 @@ #include #include -#include -#include -#include #include +#include +#include +#include +#include +#include + +#include + #include #include "busdevice.h" -#include - extern int __init lasi_i82596_probe(struct net_device *dev); extern int __init asp_i82596_probe(struct net_device *dev); static int __init -lan_init_chip(struct hp_device *d, struct pa_iodc_driver *dri) +lan_init_chip(struct parisc_device *dev) { struct net_device *netdevice; int retval, irq; - irq = busdevice_alloc_irq(d); + irq = busdevice_alloc_irq(dev); if (!irq) { - printk(KERN_ERR __FILE__ ": IRQ not found for i82596 at 0x%p\n", d->hpa); - return -ENODEV; + printk(KERN_ERR __FILE__ ": IRQ not found for i82596 at 0x%lx\n", dev->hpa); + return -ENODEV; } - printk(KERN_INFO "Found i82596 at 0x%p, IRQ %d\n", d->hpa, irq); + printk(KERN_INFO "Found i82596 at 0x%lx, IRQ %d\n", dev->hpa, irq); - netdevice = alloc_etherdev(NULL,0); + netdevice = alloc_etherdev(0); if (!netdevice) return -ENOMEM; - netdevice->base_addr = (unsigned long) d->hpa; + netdevice->base_addr = dev->hpa; netdevice->irq = irq; - netdevice->init = - (d->sversion == 0x72) ? asp_i82596_probe :lasi_i82596_probe; + netdevice->init = (dev->id.sversion == 0x72) ? + asp_i82596_probe : lasi_i82596_probe; retval = register_netdev(netdevice); if (retval) { @@ -63,21 +66,23 @@ lan_init_chip(struct hp_device *d, struc } -static struct pa_iodc_driver lan_drivers_for[] = { - {HPHW_FIO, 0x0, 0x0, 0x8a, 0x0, 0, - DRIVER_CHECK_SVERSION + DRIVER_CHECK_HWTYPE, - "Lasi i82596 LAN", "712, 715 or similiar", lan_init_chip}, - {HPHW_FIO, 0x0, 0x0, 0x72, 0x0, 0, - DRIVER_CHECK_SVERSION + DRIVER_CHECK_HWTYPE, - "ASP i82596 LAN", "700 or similiar (old)", lan_init_chip}, - { 0 } +static struct parisc_device_id lan_tbl[] = { + { HPHW_FIO, HVERSION_REV_ANY_ID, HVERSION_ANY_ID, 0x0008a }, + { HPHW_FIO, HVERSION_REV_ANY_ID, HVERSION_ANY_ID, 0x00072 }, + { 0, } }; -static int __init -register_lan_drivers(void) +MODULE_DEVICE_TABLE(parisc, lan_tbl); + +static struct parisc_driver lan_driver = { + name: "Apricot", + id_table: lan_tbl, + probe: lan_init_chip, +}; + +static int __init lan_init(void) { - return pdc_register_driver(lan_drivers_for); + return register_parisc_driver(&lan_driver); } - -module_init(register_lan_drivers); +module_init(lan_init); Index: drivers/gsc/lasi.c =================================================================== RCS file: /home/cvs/parisc/linux/drivers/gsc/lasi.c,v retrieving revision 1.24 diff -u -p -r1.24 lasi.c --- drivers/gsc/lasi.c 2001/07/31 22:08:48 1.24 +++ drivers/gsc/lasi.c 2001/08/05 04:05:38 @@ -16,12 +16,16 @@ #include #include -#include -#include +#include +#include +#include #include +#include +#include + #include +#include #include -#include #include "busdevice.h" @@ -32,10 +36,10 @@ #define LASI_IO_CONF2 0x7FFFF /* LASI secondary configuration register */ static int -lasi_find_irq(struct busdevice *lasi_dev, struct hp_device *dev) +lasi_find_irq(struct busdevice *lasi_dev, struct parisc_device *dev) { int irq; - int off = ((int) dev->hpa) & 0xffff; + int off = dev->hpa & 0xffff; /* ** "irq" bits below are numbered relative to most significant bit. @@ -104,9 +108,9 @@ lasi_init_irq(struct busdevice *this_las #else -void __init lasi_led_init(char *lasi_hpa) +void __init lasi_led_init(unsigned long lasi_hpa) { - char *datareg; + unsigned long datareg; switch (CPU_HVERSION) { /* Gecko machines have only one single LED, which can be permanently @@ -135,7 +139,7 @@ void __init lasi_led_init(char *lasi_hpa break; } /* switch() */ - register_led_driver(DISPLAY_MODEL_LASI, LED_CMD_REG_NONE, datareg); + register_led_driver(DISPLAY_MODEL_LASI, LED_CMD_REG_NONE, (char *)datareg); } #endif @@ -148,11 +152,11 @@ void __init lasi_led_init(char *lasi_hpa * KNOWN BUG: doesn't work yet on 715/64 /80 and /100 (new 715 machines) and above */ -static char * lasi_power_off_hpa; +static unsigned long lasi_power_off_hpa; static void lasi_power_off(void) { - char *datareg; + unsigned long datareg; /* calculate addr of the Power Control Register */ datareg = lasi_power_off_hpa + 0x0000C000; @@ -163,7 +167,7 @@ static void lasi_power_off(void) } int __init -lasi_init_chip(struct hp_device *d, struct pa_iodc_driver *dri) +lasi_init_chip(struct parisc_device *dev) { struct busdevice *lasi; struct gsc_irq gsc_irq; @@ -174,16 +178,16 @@ lasi_init_chip(struct hp_device *d, stru return -ENOMEM; lasi->name = "Lasi"; - lasi->hpa = d->hpa; + lasi->hpa = dev->hpa; lasi->find_irq = lasi_find_irq; /* Check the 4-bit (yes, only 4) version register */ lasi->version = gsc_readl(lasi->hpa + LASI_VER) & 0xf; - printk(KERN_INFO "%s version %d at 0x%p found.\n", + printk(KERN_INFO "%s version %d at 0x%lx found.\n", lasi->name, lasi->version, lasi->hpa); /* initialize the chassis LEDs really early */ - lasi_led_init((char *)lasi->hpa); + lasi_led_init(lasi->hpa); /* Stop LASI barking for a bit */ lasi_init_irq(lasi); @@ -210,18 +214,29 @@ lasi_init_chip(struct hp_device *d, stru gsc_writel(lasi->eim, lasi->hpa + OFFSET_IAR); /* Done init'ing, register this driver */ - ret = register_busdevice( d, lasi ); + ret = register_busdevice(dev, lasi); if (ret) { - kfree(lasi); - return ret; + kfree(lasi); + return ret; } /* initialize the power off function */ /* FIXME: Record the LASI HPA for the power off function. This should * ensure that only the first LASI (the one controlling the power off) * should set the HPA here */ - lasi_power_off_hpa = (char *)lasi->hpa; + lasi_power_off_hpa = lasi->hpa; pm_power_off = lasi_power_off; return ret; } + +static struct parisc_device_id lasi_tbl[] = { + { HPHW_BA, HVERSION_REV_ANY_ID, HVERSION_ANY_ID, 0x00081 }, + { 0, } +}; + +struct parisc_driver lasi_driver = { + name: "Lasi", + id_table: lasi_tbl, + probe: lasi_init_chip, +}; Index: drivers/gsc/serial.c =================================================================== RCS file: /home/cvs/parisc/linux/drivers/gsc/serial.c,v retrieving revision 1.16 diff -u -p -r1.16 serial.c --- drivers/gsc/serial.c 2001/07/31 22:08:48 1.16 +++ drivers/gsc/serial.c 2001/08/05 04:05:38 @@ -21,9 +21,9 @@ #include #include #include -#include -#include +#include #include +#include #include #include @@ -38,12 +38,12 @@ static int serial_line_nr; static int __init -serial_init_chip(struct hp_device *d, struct pa_iodc_driver *dri) +serial_init_chip(struct parisc_device *dev) { struct serial_struct *serial; int retval, irq; - irq = busdevice_alloc_irq(d); + irq = busdevice_alloc_irq(dev); if (!irq) { #ifndef CONFIG_GSC_WAX if (serial_line_nr == 1) @@ -51,7 +51,7 @@ serial_init_chip(struct hp_device *d, st "enable WAX support in order to use the 2nd serial port (ttyS1) on this machine.\n"); else #endif - printk(KERN_WARNING "IRQ not found for serial device at 0x%p\n", d->hpa); + printk(KERN_WARNING "IRQ not found for serial device at 0x%lx\n", dev->hpa); return -ENODEV; } @@ -67,7 +67,7 @@ serial_init_chip(struct hp_device *d, st serial->type = PORT_16550A; serial->line = serial_line_nr; - serial->iomem_base = ioremap(((unsigned long) d->hpa) + 0x800, 0x80); + serial->iomem_base = ioremap(dev->hpa + 0x800, 0x80); serial->irq = irq; serial->io_type = SERIAL_IO_MEM; /* define access method */ @@ -87,94 +87,43 @@ serial_init_chip(struct hp_device *d, st serial_line_nr++; return 0; } + +static struct parisc_device_id serial_tbl[] = { + { HPHW_FIO, HVERSION_REV_ANY_ID, 0x006, 0x0008C }, /* C1xx/C1xxL */ + { HPHW_FIO, HVERSION_REV_ANY_ID, 0x019, 0x0008C }, /* B180L+ */ + { HPHW_FIO, HVERSION_REV_ANY_ID, 0x022, 0x0008C }, /* B132L+ */ + { HPHW_FIO, HVERSION_REV_ANY_ID, 0x03B, 0x0008C }, /* C1xx/C1xxL */ + { HPHW_FIO, HVERSION_REV_ANY_ID, 0x03C, 0x0008C }, /* B132L */ + { HPHW_FIO, HVERSION_REV_ANY_ID, 0x03D, 0x0008C }, /* B160L */ + { HPHW_FIO, HVERSION_REV_ANY_ID, 0x03E, 0x0008C }, /* B132L+ */ + { HPHW_FIO, HVERSION_REV_ANY_ID, 0x03F, 0x0008C }, /* B180L+ */ + { HPHW_FIO, HVERSION_REV_ANY_ID, 0x040, 0x0008C }, /* B132L */ + { HPHW_FIO, HVERSION_REV_ANY_ID, 0x041, 0x0008C }, /* B160L */ + { HPHW_FIO, HVERSION_REV_ANY_ID, 0x046, 0x0008C }, /* Rocky2 120 */ + { HPHW_FIO, HVERSION_REV_ANY_ID, 0x047, 0x0008C }, /* Rocky2 150 */ + { HPHW_FIO, HVERSION_REV_ANY_ID, 0x048, 0x0008C }, /* Rocky2 120 */ + { HPHW_FIO, HVERSION_REV_ANY_ID, 0x049, 0x0008C }, /* Rocky2 150 */ + { HPHW_FIO, HVERSION_REV_ANY_ID, 0x04E, 0x0008C }, /* Kiji L2 132 */ + { HPHW_FIO, HVERSION_REV_ANY_ID, 0x04F, 0x0008C }, /* Kiji L2 132 */ + { HPHW_FIO, HVERSION_REV_ANY_ID, 0x056, 0x0008C }, /* Raven+ */ + { HPHW_FIO, HVERSION_REV_ANY_ID, 0x05F, 0x00081 }, /* A-class 180 */ + { HPHW_FIO, HVERSION_REV_ANY_ID, HVERSION_ANY_ID, 0x0008c },/* 715/64 */ + { HPHW_FIO, HVERSION_REV_ANY_ID, HVERSION_ANY_ID, 0x00075 },/* 715/33 */ + { 0 } +}; + +MODULE_DEVICE_TABLE(parisc, serial_tbl); -static struct pa_iodc_driver serial_drivers_for[] = { - {HPHW_FIO, 0x03C, 0x0, 0x0008C, 0x0, 0, /* B132L */ - DRIVER_CHECK_HVERSION + - DRIVER_CHECK_SVERSION + DRIVER_CHECK_HWTYPE, - "serial device", "Merlin 132 Core", serial_init_chip}, - {HPHW_FIO, 0x03D, 0x0, 0x0008C, 0x0, 0, /* B160L */ - DRIVER_CHECK_HVERSION + - DRIVER_CHECK_SVERSION + DRIVER_CHECK_HWTYPE, - "serial device", "Merlin 160 Core", serial_init_chip}, - {HPHW_FIO, 0x03E, 0x0, 0x0008C, 0x0, 0, /* B132L+ */ - DRIVER_CHECK_HVERSION + - DRIVER_CHECK_SVERSION + DRIVER_CHECK_HWTYPE, - "serial device", "Merlin+ 132 Core", serial_init_chip}, - {HPHW_FIO, 0x03F, 0x0, 0x0008C, 0x0, 0, /* B180L+ */ - DRIVER_CHECK_HVERSION + - DRIVER_CHECK_SVERSION + DRIVER_CHECK_HWTYPE, - "serial device", "Merlin+ 180 Core", serial_init_chip}, - {HPHW_FIO, 0x056, 0x0, 0x0008C, 0x0, 0, /* Raven+ w SE FWSCSI */ - DRIVER_CHECK_HVERSION + DRIVER_CHECK_HVERSION_REV + - DRIVER_CHECK_SVERSION + DRIVER_CHECK_HWTYPE, - "serial device", "Raven+ w SE FWSCSI", serial_init_chip}, - {HPHW_FIO, 0x03B, 0x0, 0x0008C, 0x0, 0, /* C1xx/C1xxL */ - DRIVER_CHECK_HVERSION + - DRIVER_CHECK_SVERSION + DRIVER_CHECK_HWTYPE, - "serial device", "Raven U/L2 Core", serial_init_chip}, - {HPHW_FIO, 0x046, 0x0, 0x0008C, 0x0, 0, /* Rocky2 120 */ - DRIVER_CHECK_HVERSION + - DRIVER_CHECK_SVERSION + DRIVER_CHECK_HWTYPE, - "serial device", "Rocky2 120 Core", serial_init_chip}, - {HPHW_FIO, 0x047, 0x0, 0x0008C, 0x0, 0, /* Rocky2 150 */ - DRIVER_CHECK_HVERSION + - DRIVER_CHECK_SVERSION + DRIVER_CHECK_HWTYPE, - "serial device", "Rocky2 150 Core", serial_init_chip}, - {HPHW_FIO, 0x04E, 0x0, 0x0008C, 0x0, 0, /* Kiji L2 132 */ - DRIVER_CHECK_HVERSION + - DRIVER_CHECK_SVERSION + DRIVER_CHECK_HWTYPE, - "serial device", "Kiji L2 Core", serial_init_chip}, - {HPHW_FIO, 0x040, 0x0, 0x0008C, 0x0, 0, /* B132L */ - DRIVER_CHECK_HVERSION + - DRIVER_CHECK_SVERSION + DRIVER_CHECK_HWTYPE, - "serial device", "Merlin 132 Wax", serial_init_chip}, - {HPHW_FIO, 0x041, 0x0, 0x0008C, 0x0, 0, /* B160L */ - DRIVER_CHECK_HVERSION + - DRIVER_CHECK_SVERSION + DRIVER_CHECK_HWTYPE, - "serial device", "Merlin 160 Wax", serial_init_chip}, - {HPHW_FIO, 0x022, 0x0, 0x0008C, 0x0, 0, /* B132L+ */ - DRIVER_CHECK_HVERSION + - DRIVER_CHECK_SVERSION + DRIVER_CHECK_HWTYPE, - "serial device", "Merlin+ 132 Dino", serial_init_chip}, - {HPHW_FIO, 0x019, 0x0, 0x0008C, 0x0, 0, /* B180L+ */ - DRIVER_CHECK_HVERSION + - DRIVER_CHECK_SVERSION + DRIVER_CHECK_HWTYPE, - "serial device", "Merlin+ 180 Dino", serial_init_chip}, - {HPHW_FIO, 0x006, 0x0, 0x0008C, 0x0, 0, /* C1xx/C1xxL */ - DRIVER_CHECK_HVERSION + - DRIVER_CHECK_SVERSION + DRIVER_CHECK_HWTYPE, - "serial device", "Raven U/L2 Dino", serial_init_chip}, - {HPHW_FIO, 0x048, 0x0, 0x0008C, 0x0, 0, /* Rocky2 120 */ - DRIVER_CHECK_HVERSION + - DRIVER_CHECK_SVERSION + DRIVER_CHECK_HWTYPE, - "serial device", "Rocky2 120 Dino", serial_init_chip}, - {HPHW_FIO, 0x049, 0x0, 0x0008C, 0x0, 0, /* Rocky2 150 */ - DRIVER_CHECK_HVERSION + - DRIVER_CHECK_SVERSION + DRIVER_CHECK_HWTYPE, - "serial device", "Rocky2 150 Dino", serial_init_chip}, - {HPHW_FIO, 0x04F, 0x0, 0x0008C, 0x0, 0, /* Kiji L2 132 */ - DRIVER_CHECK_HVERSION + - DRIVER_CHECK_SVERSION + DRIVER_CHECK_HWTYPE, - "serial device", "Kiji L2 132 Dino", serial_init_chip}, - {HPHW_FIO, 0x05F, 0x0, 0x00081, 0x0, 0, /* A-class 180 */ - DRIVER_CHECK_HVERSION + - DRIVER_CHECK_SVERSION + DRIVER_CHECK_HWTYPE, - "serial device", "unknown", serial_init_chip}, - {HPHW_FIO, 0x0, 0x0, 0x8c, 0x0, 0, /* 715/64 */ - DRIVER_CHECK_SVERSION + DRIVER_CHECK_HWTYPE, - "serial device", "715/new or similiar", serial_init_chip}, - {HPHW_FIO, 0x0, 0x0, 0x75, 0x0, 0, /* 715/33 */ - DRIVER_CHECK_SVERSION + DRIVER_CHECK_HWTYPE, - "serial device", "712, 715/old or similiar", serial_init_chip}, - { 0 } +static struct parisc_driver serial_driver = { + name: "Serial RS232", + id_table: serial_tbl, + probe: serial_init_chip, }; -void __init -probe_serial_gsc(void) +void __init probe_serial_gsc(void) { #ifdef CONFIG_SUPERIO superio_serial_init(); #endif - pdc_register_driver(serial_drivers_for); + register_parisc_driver(&serial_driver); } Index: drivers/gsc/wax.c =================================================================== RCS file: /home/cvs/parisc/linux/drivers/gsc/wax.c,v retrieving revision 1.10 diff -u -p -r1.10 wax.c --- drivers/gsc/wax.c 2001/07/31 22:08:48 1.10 +++ drivers/gsc/wax.c 2001/08/05 04:05:38 @@ -13,10 +13,13 @@ #include #include -#include +#include #include +#include +#include #include -#include +#include + #include #include #include @@ -27,10 +30,10 @@ #define WAX_GSC_IRQ 7 /* Hardcoded Interrupt for GSC */ #define WAX_GSC_NMI_IRQ 29 -static int wax_find_irq(struct busdevice *lasi_dev, struct hp_device *dev) +static int wax_find_irq(struct busdevice *lasi_dev, struct parisc_device *dev) { int irq; - int off = ((unsigned long) dev->hpa) & 0xffff; + int off = dev->hpa & 0xffff; /* ** "irq" bits below are numbered relative to most significant bit. @@ -57,7 +60,7 @@ wax_hil_nmi(int irq, void *handle, struc static void __init wax_init_irq(struct busdevice *wax) { - char *base = (char *) wax->hpa; + unsigned long base = wax->hpa; /* Stop WAX barking for a bit */ gsc_writel(0x00000000, base+OFFSET_IMR); @@ -80,22 +83,22 @@ wax_init_irq(struct busdevice *wax) } int __init -wax_init_chip(struct hp_device *d, struct pa_iodc_driver *dri) +wax_init_chip(struct parisc_device *dev) { struct busdevice *wax; struct gsc_irq gsc_irq; int irq, ret; wax = kmalloc(sizeof(struct busdevice), GFP_KERNEL); - if(!wax) + if (!wax) return -ENOMEM; wax->name = "Wax"; - wax->hpa = d->hpa; + wax->hpa = dev->hpa; wax->find_irq = wax_find_irq; wax->version = 0; /* gsc_readb(wax->hpa+WAX_VER); */ - printk(KERN_INFO "%s at 0x%p found.\n", wax->name, wax->hpa); + printk(KERN_INFO "%s at 0x%lx found.\n", wax->name, wax->hpa); /* Stop wax hissing for a bit */ wax_init_irq(wax); @@ -122,9 +125,11 @@ wax_init_chip(struct hp_device *d, struc // gsc_writel(wax->eim, wax->hpa + OFFSET_IAR); /* Done init'ing, register this driver */ - ret = register_busdevice( d, wax ); - if (ret) - kfree(wax); + ret = register_busdevice(dev, wax); + if (ret) { + kfree(wax); + return ret; + } /* Register the HIL-Keyboard NMI-Handler */ #ifdef CONFIG_HIL @@ -135,17 +140,21 @@ wax_init_chip(struct hp_device *d, struc return ret; } - -static struct pa_iodc_driver wax_driver_for[] = { - {HPHW_BA, 0x0, 0, 0x0008e, 0, 0, - DRIVER_CHECK_HWTYPE + DRIVER_CHECK_SVERSION, - "Wax", "generic", (void *) wax_init_chip}, +static struct parisc_device_id wax_tbl[] = { + { HPHW_BA, HVERSION_REV_ANY_ID, HVERSION_ANY_ID, 0x0008e }, { 0, } }; +MODULE_DEVICE_TABLE(parisc, wax_tbl); + +static struct parisc_driver wax_driver = { + name: "Wax", + id_table: wax_tbl, + probe: wax_init_chip, +}; + int __init register_wax_driver(void) { - return pdc_register_driver(wax_driver_for); + return register_parisc_driver(&wax_driver); } - Index: drivers/gsc/wax_eisa.c =================================================================== RCS file: /home/cvs/parisc/linux/drivers/gsc/wax_eisa.c,v retrieving revision 1.7 diff -u -p -r1.7 wax_eisa.c --- drivers/gsc/wax_eisa.c 2001/07/31 22:08:48 1.7 +++ drivers/gsc/wax_eisa.c 2001/08/05 04:05:38 @@ -16,11 +16,13 @@ #include #include +#include #include #include -#include +#include #include -#include +#include + #include #include #include @@ -91,44 +93,40 @@ struct wax_eisa_device static struct wax_eisa_device *eisa_dev; static int __init -wax_eisa_driver_init(struct hp_device *d, struct pa_iodc_driver *dri) { +wax_eisa_driver_init(struct parisc_device *dev) +{ /* we will only support one EISA bus */ if (eisa_dev) return -ENODEV; - /* It sounds unusual, but because the parisc-linux PCI infrastructure - has been done so well, I'm just going to register the WAX EISA - bus adapter as a PCI device. This is to handle the in{w|l|b} - and out{w|l|b} routines. */ - eisa_dev = kmalloc(sizeof(*eisa_dev), GFP_KERNEL); if (!eisa_dev) return -ENOMEM; memset(eisa_dev, 0, sizeof(*eisa_dev)); - eisa_dev->version = gsc_readw(d->hpa+0x7000); + eisa_dev->version = gsc_readw(dev->hpa + 0x7000); - eisa_dev->hba.iodc_info = d; - eisa_dev->hba.base_addr = d->hpa; /* faster access */ + eisa_dev->hba.iodc_info = &dev->id; + eisa_dev->hba.base_addr = dev->hpa; /* faster access */ eisa_dev->dinosaur_pen = SPIN_LOCK_UNLOCKED; - printk(KERN_INFO "Wax EISA bus adapter version 0x%x at 0x%p\n", - eisa_dev->version, d->hpa); + printk(KERN_INFO "Wax EISA bus adapter version 0x%x at 0x%lx\n", + eisa_dev->version, dev->hpa); pcibios_register_hba(&eisa_dev->hba); pci_port = &wax_port_ops; #if 0 /* Turn off lock control */ - gsc_writeb(0x0,d->hpa + 0x10001); + gsc_writeb(0x0,dev->hpa + 0x10001); /* Disable the FIFO */ - gsc_writeb(0x0,d->hpa + 0x11001); + gsc_writeb(0x0,dev->hpa + 0x11001); /* Disable multiple splits and concurrent bus accesses */ - gsc_writeb(0x0,d->hpa + 0x12001); + gsc_writeb(0x0,dev->hpa + 0x12001); #endif @@ -139,20 +137,21 @@ wax_eisa_driver_init(struct hp_device *d -static struct pa_iodc_driver wax_eisa_drivers_for[] = { - {HPHW_BA, 0x01B, 0, 0x0008e, 0x0, 0x0, /* 0x8e is WAX, not WAX EISA! Maybe 0x90 ?? */ - DRIVER_CHECK_HWTYPE + DRIVER_CHECK_SVERSION, - "Wax EISA BA", "generic", (void *) wax_eisa_driver_init}, - {HPHW_BA, 0x01B, 0, 0x00076, 0x0, 0x0, - DRIVER_CHECK_HWTYPE + DRIVER_CHECK_SVERSION, - "Wax EISA BA", "generic", (void *) wax_eisa_driver_init}, +static struct parisc_device_id wax_eisa_tbl[] = { + { HPHW_BA, HVERSION_REV_ANY_ID, 0x01B, 0x0008e }, /* 0x8e is WAX, not WAX EISA! Maybe 0x90 ?? */ + { HPHW_BA, HVERSION_REV_ANY_ID, 0x01B, 0x00076 }, { 0, } }; +MODULE_DEVICE_TABLE(parisc, wax_eisa_tbl); -int __init -register_wax_eisa_driver(void) +static struct parisc_driver wax_eisa_driver = { + name: "Wax EISA BA", + id_table: wax_eisa_tbl, + probe: wax_eisa_driver_init +}; + +int __init register_wax_eisa_driver(void) { - return pdc_register_driver(wax_eisa_drivers_for); + return register_parisc_driver(&wax_eisa_driver); } - Index: drivers/parport/parport_gsc.c =================================================================== RCS file: /home/cvs/parisc/linux/drivers/parport/parport_gsc.c,v retrieving revision 1.13 diff -u -p -r1.13 parport_gsc.c --- drivers/parport/parport_gsc.c 2001/07/09 02:34:02 1.13 +++ drivers/parport/parport_gsc.c 2001/08/05 04:05:38 @@ -462,23 +462,23 @@ struct parport *__devinit parport_gsc_pr static int __initdata parport_count; -static int __devinit parport_init_chip(struct hp_device *d, struct pa_iodc_driver *dri) +static int __devinit parport_init_chip(struct parisc_device *dev) { unsigned long port; int irq; - irq = busdevice_alloc_irq(d); + irq = busdevice_alloc_irq(dev); if (!irq) { - printk("IRQ not found for parallel device at 0x%p\n", d->hpa); - return -ENODEV; + printk("IRQ not found for parallel device at 0x%lx\n", dev->hpa); + return -ENODEV; } - port = ((unsigned long) d->hpa) + PARPORT_GSC_OFFSET; + port = dev->hpa + PARPORT_GSC_OFFSET; - /* - some older machines with ASP-chip don't support the enhanced parport modes - */ + /* some older machines with ASP-chip don't support + * the enhanced parport modes + */ if (boot_cpu_data.cpu_type > pcxt && !pdc_add_valid( (void *)(port+4))) { /* Initialize bidirectional-mode (0x10) & data-tranfer-mode #1 (0x20) */ printk("%s: initialize bidirectional-mode.\n", __FUNCTION__); @@ -495,18 +495,24 @@ static int __devinit parport_init_chip(s return 0; } -static struct pa_iodc_driver parport_drivers_for[] = { - {HPHW_FIO, 0x0, 0x0, 0x74, 0x0, 0, /* 715/64 */ - DRIVER_CHECK_SVERSION + DRIVER_CHECK_HWTYPE, - "parallel device", "HP 7xx - Series", parport_init_chip}, - { 0 } +static struct parisc_device_id parport_tbl[] = { + { HPHW_FIO, HVERSION_REV_ANY_ID, HVERSION_ANY_ID, 0x74 }, /* 715/64 */ + { 0, } }; +MODULE_DEVICE_TABLE(parisc, parport_tbl); + +static struct parisc_driver parport_driver = { + name: "parallel device", + id_table: parport_tbl, + probe: parport_init_chip, +}; + int __devinit parport_gsc_init(void) { parport_count = 0; - pdc_register_driver(parport_drivers_for); + register_parisc_driver(&parport_driver); return 0; } Index: drivers/scsi/lasi7xx.c =================================================================== RCS file: /home/cvs/parisc/linux/drivers/scsi/lasi7xx.c,v retrieving revision 1.17 diff -u -p -r1.17 lasi7xx.c --- drivers/scsi/lasi7xx.c 2001/07/09 02:34:04 1.17 +++ drivers/scsi/lasi7xx.c 2001/08/05 04:05:38 @@ -22,6 +22,7 @@ #include #include #include +#include #include #include @@ -42,30 +43,43 @@ static Scsi_Host_Template *hosts_tptr; static int hosts_used; -static int lasi_scsi_callback_700(struct hp_device *d, struct pa_iodc_driver *dri); -static int lasi_scsi_callback_710(struct hp_device *d, struct pa_iodc_driver *dri); - extern int sim700_init_host(Scsi_Host_Template *tpnt, int chip, unsigned long base_addr, int irq_vector, u32 options ); + -static struct pa_iodc_driver lasi_scsi_drivers[] = { +static int +lasi_scsi_callback(struct parisc_device *dev) +{ + if (dev->id.sversion == 0x00071) { + hosts_used = sim700_init_host(hosts_tptr, 700, + dev->hpa + LASI_SCSI_CORE_OFFSET, + busdevice_alloc_irq(dev), OPT_NCR_LE); + } else { + hosts_used = sim700_init_host(hosts_tptr, 710, + dev->hpa + LASI_SCSI_CORE_OFFSET, + busdevice_alloc_irq(dev), 0); + } - {HPHW_FIO, 0x0, 0, 0x00071, 0x0, 0, - DRIVER_CHECK_HWTYPE | DRIVER_CHECK_SVERSION, - "Lasi SCSI", "53c700", - (void *) lasi_scsi_callback_700}, - - {HPHW_FIO, 0x0, 0, 0x00082, 0x0, 0, - DRIVER_CHECK_HWTYPE | DRIVER_CHECK_SVERSION, - "Lasi SCSI", "53c710", - (void *) lasi_scsi_callback_710}, - {0, } + return (hosts_used == 0); +} + +static struct parisc_device_id lasi_scsi_tbl[] = { + { HPHW_FIO, HVERSION_REV_ANY_ID, HVERSION_ANY_ID, 0x00071 }, /* 53c700 */ + { HPHW_FIO, HVERSION_REV_ANY_ID, HVERSION_ANY_ID, 0x00082 }, /* 53c710 */ + { 0, } }; +MODULE_DEVICE_TABLE(parisc, lasi_scsi_tbl); + +static struct parisc_driver lasi_scsi_driver = { + name: "Lasi SCSI", + id_table: lasi_scsi_tbl, + probe: lasi_scsi_callback, +}; int lasi7xx_detect(Scsi_Host_Template *tpnt) { @@ -76,30 +90,10 @@ int lasi7xx_detect(Scsi_Host_Template *t /* This will cause *all* known devices which match entries ** in lasi_scsi_drivers[] to get invoked and registered. */ - pdc_register_driver(lasi_scsi_drivers); + register_parisc_driver(&lasi_scsi_driver); /* ** Check if any callbacks actually found/claimed anything. */ return (hosts_used != 0); -} - -static int -lasi_scsi_callback_700(struct hp_device *d, struct pa_iodc_driver *dri) -{ - hosts_used = sim700_init_host(hosts_tptr, 700, - (unsigned long)d->hpa + LASI_SCSI_CORE_OFFSET, - busdevice_alloc_irq(d), OPT_NCR_LE); - - return (hosts_used == 0); -} - -static int -lasi_scsi_callback_710(struct hp_device *d, struct pa_iodc_driver *dri) -{ - hosts_used = sim700_init_host(hosts_tptr, 710, - (unsigned long)d->hpa + LASI_SCSI_CORE_OFFSET, - busdevice_alloc_irq(d), 0); - - return (hosts_used == 0); } Index: drivers/scsi/zalon7xx.c =================================================================== RCS file: /home/cvs/parisc/linux/drivers/scsi/zalon7xx.c,v retrieving revision 1.8 diff -u -p -r1.8 zalon7xx.c --- drivers/scsi/zalon7xx.c 2001/07/09 02:34:04 1.8 +++ drivers/scsi/zalon7xx.c 2001/08/05 04:05:38 @@ -11,6 +11,7 @@ #include #include #include +#include #include #include @@ -40,41 +41,12 @@ static Scsi_Host_Template *hosts_tptr; static int hosts_used=0; static int zalon_id = 0; -static int zalon_scsi_callback(struct hp_device *d, struct pa_iodc_driver *dri); - - extern int zalon_attach(Scsi_Host_Template *tpnt, unsigned long base_addr, int irq_vector, int unit ); -static struct pa_iodc_driver zalon_scsi_drivers[] = { - {HPHW_A_DMA, 0x007, 0, 0x00089, 0x0, 0, - DRIVER_CHECK_HWTYPE | DRIVER_CHECK_SVERSION, - "GSC SCSI (Zalon)", "53c720", - (void *) zalon_scsi_callback}, - - {0,0,0,0,0,0, 0, (char *) NULL,(char *) NULL,(void *) NULL} -}; - - -int zalon7xx_detect(Scsi_Host_Template *tpnt) -{ - /* "pass" the parameter to the callback functions */ - hosts_tptr = tpnt; - hosts_used = 0; - - /* - ** claim all zalon cards. - */ - pdc_register_driver(zalon_scsi_drivers); - - /* - ** Check if any callbacks actually found/claimed anything. - */ - return (hosts_used != 0); -} #if 0 /* FIXME: @@ -108,12 +80,12 @@ lasi_scsi_clock(void * hpa, int defaultc #endif static int __init -zalon_scsi_callback(struct hp_device *d, struct pa_iodc_driver *dri) +zalon_scsi_callback(struct parisc_device *dev) { struct gsc_irq gsc_irq; u32 zalon_vers; int irq; - unsigned long zalon = (unsigned long)d->hpa; + unsigned long zalon = dev->hpa; writel(CMD_RESET, zalon + IO_MODULE_IO_COMMAND); while (!(readl(zalon + IO_MODULE_IO_STATUS) & IOSTATUS_RY)) @@ -122,7 +94,7 @@ zalon_scsi_callback(struct hp_device *d, zalon + IO_MODULE_II_CDATA); /* XXX: Save the Zalon version for bug workarounds? */ - zalon_vers = gsc_readl(d->hpa + IO_MODULE_II_CDATA) & 0x07000000; + zalon_vers = gsc_readl(dev->hpa + IO_MODULE_II_CDATA) & 0x07000000; zalon_vers >>= 24; /* Setup the interrupts first. @@ -133,7 +105,7 @@ zalon_scsi_callback(struct hp_device *d, printk(__FUNCTION__ ": Zalon vers field is 0x%x, IRQ %d\n", zalon_vers, irq); - gsc_writel(gsc_irq.txn_addr | gsc_irq.txn_data, d->hpa + IO_MODULE_EIM); + gsc_writel(gsc_irq.txn_addr | gsc_irq.txn_data, dev->hpa + IO_MODULE_EIM); if ( zalon_vers == 0) printk(KERN_WARNING __FUNCTION__ ": Zalon 1.1 or earlier\n"); @@ -141,7 +113,7 @@ zalon_scsi_callback(struct hp_device *d, /* ** zalon_attach: returns -1 on failure, 0 on success */ - hosts_used = zalon_attach(hosts_tptr, (unsigned long)d->hpa + GSC_SCSI_ZALON_OFFSET, + hosts_used = zalon_attach(hosts_tptr, dev->hpa + GSC_SCSI_ZALON_OFFSET, irq, zalon_id); if (hosts_used == 0) @@ -149,5 +121,31 @@ zalon_scsi_callback(struct hp_device *d, hosts_used = (hosts_used == 0); return (hosts_used == 0); +} + +static struct parisc_device_id zalon_tbl[] = { + { HPHW_A_DMA, HVERSION_REV_ANY_ID, 0x007, 0x00089 }, + { 0, } +}; + +MODULE_DEVICE_TABLE(parisc, zalon_tbl); + +static struct parisc_driver zalon_driver = { + name: "GSC SCSI (Zalon)", + id_table: zalon_tbl, + probe: zalon_scsi_callback, +}; + +int zalon7xx_detect(Scsi_Host_Template *tpnt) +{ + /* "pass" the parameter to the callback functions */ + hosts_tptr = tpnt; + hosts_used = 0; + + /* claim all zalon cards. */ + register_parisc_driver(&zalon_driver); + + /* Check if any callbacks actually found/claimed anything. */ + return (hosts_used != 0); } Index: drivers/sound/harmony.c =================================================================== RCS file: /home/cvs/parisc/linux/drivers/sound/harmony.c,v retrieving revision 1.11 diff -u -p -r1.11 harmony.c --- drivers/sound/harmony.c 2001/07/09 02:34:05 1.11 +++ drivers/sound/harmony.c 2001/08/05 04:05:38 @@ -1157,7 +1157,7 @@ static int __init harmony_mixer_init(voi * if it finds a match to the registered driver. */ static int __init -harmony_driver_callback(struct hp_device *d, struct pa_iodc_driver *dri) +harmony_driver_callback(struct parisc_device *dev) { u8 id; u8 rev; @@ -1165,10 +1165,10 @@ harmony_driver_callback(struct hp_device int ret; /* Set the HPA of harmony */ - harmony.hpa = d->hpa; + harmony.hpa = (struct harmony_hpa *)dev->hpa; /* Grab an IRQ from Lasi */ - harmony.irq = busdevice_alloc_irq(d); + harmony.irq = busdevice_alloc_irq(dev); if (!harmony.irq) { printk(KERN_ERR "%s: problem getting irq\n", __FUNCTION__); @@ -1176,17 +1176,17 @@ harmony_driver_callback(struct hp_device } /* Grab the ID and revision from the device */ - id = gsc_readb((void *) &(harmony.hpa->id)); + id = gsc_readb(&harmony.hpa->id); if ((id | 1) != 0x15) { printk(KERN_WARNING "%s: wrong id %02x\n", __FUNCTION__, id); return -EBUSY; } cntl = gsc_readl(&harmony.hpa->cntl); - rev = ((cntl>>20) & 0x3f); /* 0xff ?? */ + rev = (cntl>>20) & 0x3f; /* 0xff ?? */ - printk(KERN_INFO "Lasi Harmony Audio rev. %i at 0x%p, using IRQ %i\n", - rev, d->hpa, harmony.irq); + printk(KERN_INFO "Lasi Harmony Audio rev. %i at 0x%lx, using IRQ %i\n", + rev, dev->hpa, harmony.irq); /* Make sure the control bit isn't set, although I don't think it ever is. */ @@ -1202,26 +1202,28 @@ harmony_driver_callback(struct hp_device if ((ret=harmony_audio_init())) return ret; - request_mem_region((unsigned long)harmony.hpa, 13, "harmony"); + request_mem_region(dev->hpa, 13, "harmony"); return 0; } -/* This is the PDC signature to load up the driver. */ -static struct pa_iodc_driver harmony_drivers_for[] = -{ - {HPHW_FIO, 0x01B, 0, 0x0007B, 0x0, 0x0, - DRIVER_CHECK_HWTYPE + DRIVER_CHECK_SVERSION, - "Lasi Harmony", "Harmony", harmony_driver_callback}, - {0, } +static struct parisc_device_id harmony_tbl[] = { + { HPHW_FIO, HVERSION_REV_ANY_ID, 0x01B, 0x0007B }, + { 0, } }; +MODULE_DEVICE_TABLE(parisc, harmony_tbl); + +static struct parisc_driver harmony_driver = { + name: "Lasi Harmony", + id_table: harmony_tbl, + probe: harmony_driver_callback, +}; static int __init init_harmony(void) { - pdc_register_driver(harmony_drivers_for); - return 0; + return register_parisc_driver(&harmony_driver); } static void __exit cleanup_harmony(void) @@ -1230,7 +1232,7 @@ static void __exit cleanup_harmony(void) unregister_sound_mixer(harmony.mixer_unit); unregister_sound_dsp(harmony.dsp_unit); release_mem_region((unsigned long)harmony.hpa, 13); - pdc_unregister_driver(harmony_drivers_for); + unregister_parisc_driver(&harmony_driver); } EXPORT_NO_SYMBOLS; Index: drivers/video/sti/sticore.c =================================================================== RCS file: /home/cvs/parisc/linux/drivers/video/sti/sticore.c,v retrieving revision 1.20 diff -u -p -r1.20 sticore.c --- drivers/video/sti/sticore.c 2001/07/31 22:12:27 1.20 +++ drivers/video/sti/sticore.c 2001/08/05 04:05:38 @@ -832,14 +832,14 @@ search_sti(unsigned long flash_sti_rom, int index; unsigned long rom; struct sti_struct *sti; - struct hp_device *pa_dev; + struct parisc_device *pa_dev; index = 0; while ((pa_dev = get_pa_dev(index)) != NULL) { - - if (((unsigned long)pa_dev->hpa == hpa) && - ((pa_dev->sversion == 0x85) || /* Gecko graphics (WORD MODE) */ - (pa_dev->sversion == 0x77)) ) /* Coral graphics (BYTE MODE) */ + + if ((pa_dev->hpa == hpa) && + ((pa_dev->id.sversion == 0x85) || /* Gecko graphics (WORD MODE) */ + (pa_dev->id.sversion == 0x77)) ) /* Coral graphics (BYTE MODE) */ { /* on newer systems PDC gives the address of the ROM Index: include/asm-parisc/gsc.h =================================================================== RCS file: /home/cvs/parisc/linux/include/asm-parisc/gsc.h,v retrieving revision 1.9 diff -u -p -r1.9 gsc.h --- include/asm-parisc/gsc.h 2001/03/02 00:09:47 1.9 +++ include/asm-parisc/gsc.h 2001/08/05 04:05:38 @@ -68,7 +68,7 @@ extern int gsc_alloc_irq(struct gsc_irq extern int gsc_claim_irq(struct gsc_irq *dev, int irq); /* dev needs this irq */ struct gsc_bus { - void *hpa; /* HPA of device 0, function 0 of this bus */ + unsigned long hpa; /* HPA of device 0, function 0 of this bus */ }; /* @@ -81,7 +81,7 @@ struct gsc_dev *gsc_find_device(u16 hver extern void probe_serial_gsc(void); /* returns a virtual irq for device at dev->hpa (works for all LASI/ASP/WAX) */ -extern int busdevice_alloc_irq( struct hp_device *dev ); +extern int busdevice_alloc_irq(struct parisc_device *dev ); #endif /* __KERNEL__ */ #endif /* LINUX_GSC_H */ Index: include/asm-parisc/hardware.h =================================================================== RCS file: /home/cvs/parisc/linux/include/asm-parisc/hardware.h,v retrieving revision 1.18 diff -u -p -r1.18 hardware.h --- include/asm-parisc/hardware.h 2001/07/13 04:22:26 1.18 +++ include/asm-parisc/hardware.h 2001/08/05 04:05:38 @@ -1,6 +1,18 @@ -#ifndef _PARISC_HP_MACHINES_H_ -#define _PARISC_HP_MACHINES_H_ +#ifndef _PARISC_HARDWARE_H +#define _PARISC_HARDWARE_H +struct parisc_device_id { + unsigned char hw_type; /* 5 bits used */ + unsigned char hversion_rev; /* 4 bits */ + unsigned short hversion; /* 12 bits */ + unsigned int sversion; /* 20 bits */ +}; + +#define HWTYPE_ANY_ID 0xff +#define HVERSION_REV_ANY_ID 0xff +#define HVERSION_ANY_ID 0xffff +#define SVERSION_ANY_ID 0xffffffffU + struct hp_hardware { unsigned short hw_type:5; /* HPHW_xxx */ unsigned short hversion; @@ -10,19 +22,16 @@ struct hp_hardware { }; -#define MAX_ADD_ADDRS 5 /* 5 additional adress ranges should be sufficient */ +#define MAX_ADD_ADDRS 5 /* 5 additional address ranges should be sufficient */ -struct hp_device { - void *hpa; - unsigned short hw_type:5; /* HPHW_xxx */ - unsigned short hversion; /* HP-UX uses hv_model:12 */ - unsigned int sversion; /* HP-UX uses sv_model:20 sv_opt:8 */ - unsigned short opt; - unsigned int hversion_rev; - unsigned int sversion_rev; - struct hp_hardware *reference; /* This is a pointer to the - reference */ - struct pa_iodc_driver *driver; /* this is if the device has a driver for it */ +struct parisc_device { + unsigned long hpa; /* Hard Physical Address */ + struct parisc_device_id id; + struct parisc_device *parent; + struct parisc_device *sibling; + struct parisc_device *child; + struct hp_hardware *reference; /* The hardware description */ + struct parisc_driver *driver; /* Driver for this device */ unsigned int num_addrs; /* some devices have additional address ranges, */ unsigned long addr[MAX_ADD_ADDRS]; /* which will be stored here */ @@ -49,35 +58,21 @@ enum cpu_type { pcxu = 6, /* pa8000 pa 2.0 */ pcxu_ = 7, /* pa8200 (u+) pa 2.0 */ pcxw = 8, /* pa8500 pa 2.0 */ - pcxw_ = 9 /* pa8600 (w+) pa 2.0 */ + pcxw_ = 9, /* pa8600 (w+) pa 2.0 */ + pcxw2 = 10 /* pa8700 pa 2.0 */ }; extern char *cpu_name_version[][2]; /* mapping from enum cpu_type to strings */ -struct pa_iodc_driver { - unsigned short hw_type:5; /* HPHW_xxx */ - unsigned short hversion; - unsigned short hversion_rev; - unsigned long sversion:28; - unsigned short sversion_rev; - unsigned short opt; - unsigned int check; /* Components that are significant */ - char *name; - char *version; - int (* callback)(struct hp_device *d, struct pa_iodc_driver *dri); - struct pa_iodc_driver *next; +struct parisc_driver { + struct parisc_driver *next; + char *name; + const struct parisc_device_id *id_table; + char *version; + int (*probe) (struct parisc_device *dev); /* New device discovered */ }; -#define DRIVER_CHECK_HWTYPE 1 -#define DRIVER_CHECK_HVERSION 2 -#define DRIVER_CHECK_SVERSION 4 -#define DRIVER_CHECK_OPT 8 -/* The following two are useless right now */ -#define DRIVER_CHECK_HVERSION_REV 16 -#define DRIVER_CHECK_SVERSION_REV 32 -#define DRIVER_CHECK_EVERYTHING 63 - #define HPHW_NPROC 0 #define HPHW_MEMORY 1 #define HPHW_B_DMA 2 @@ -101,23 +96,21 @@ extern char *parisc_getHWtype(unsigned s extern char *parisc_getHWdescription(unsigned short hw_type, unsigned long hversion, unsigned long sversion); extern enum cpu_type parisc_get_cpu_type(unsigned long hversion); -extern struct hp_hardware *parisc_get_reference( - unsigned short hw_type, unsigned long hversion, - unsigned long sversion); +extern struct hp_hardware *parisc_get_reference(struct parisc_device_id *); /* drivers.c: */ -extern struct hp_device *alloc_pa_dev(unsigned long hpa); -extern int register_pa_dev(struct hp_device *hp_device); -extern int add_pa_dev_addr(struct hp_device *hp_device, unsigned long addr); -extern struct hp_device *get_pa_dev(unsigned int index); -extern inline int get_num_pa_dev(void); +extern struct parisc_device *alloc_pa_dev(unsigned long hpa); +extern int register_pa_dev(struct parisc_device *dev); +extern int add_pa_dev_addr(struct parisc_device *dev, unsigned long addr); +extern struct parisc_device *get_pa_dev(unsigned int index); +extern int get_num_pa_dev(void); extern void print_pa_devices(int start_index, int num_indexes); -extern int pdc_register_driver(struct pa_iodc_driver *driver); -extern int pdc_unregister_driver(struct pa_iodc_driver *driver); +extern int register_parisc_driver(struct parisc_driver *driver); +extern int unregister_parisc_driver(struct parisc_driver *driver); /* inventory.c: */ extern void do_memory_inventory(void); extern void do_device_inventory(void); -#endif +#endif /* _PARISC_HARDWARE_H */ Index: include/asm-parisc/iosapic.h =================================================================== RCS file: /home/cvs/parisc/linux/include/asm-parisc/iosapic.h,v retrieving revision 1.1 diff -u -p -r1.1 iosapic.h --- include/asm-parisc/iosapic.h 2000/02/04 00:10:14 1.1 +++ include/asm-parisc/iosapic.h 2001/08/05 04:05:38 @@ -15,7 +15,7 @@ ** fixup_irq is to initialize PCI IRQ line support and ** virtualize pcidev->irq value. To be called by pci_fixup_bus(). */ -extern void *iosapic_register(void *hpa); +extern void *iosapic_register(unsigned long hpa); extern int iosapic_fixup_irq(void *obj, struct pci_dev *pcidev); Index: include/asm-parisc/pci.h =================================================================== RCS file: /home/cvs/parisc/linux/include/asm-parisc/pci.h,v retrieving revision 1.28 diff -u -p -r1.28 pci.h --- include/asm-parisc/pci.h 2001/07/06 04:09:03 1.28 +++ include/asm-parisc/pci.h 2001/08/05 04:05:38 @@ -50,8 +50,8 @@ */ struct pci_hba_data { struct pci_hba_data *next; /* global chain of HBAs */ - char *base_addr; /* aka Host Physical Address */ - struct hp_device *iodc_info; /* Info from PA bus walk */ + 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 */ int hba_num; /* I/O port space access "key" */ struct resource bus_num; /* PCI bus numbers */ Index: include/asm-parisc/processor.h =================================================================== RCS file: /home/cvs/parisc/linux/include/asm-parisc/processor.h,v retrieving revision 1.42 diff -u -p -r1.42 processor.h --- include/asm-parisc/processor.h 2001/04/06 05:10:59 1.42 +++ include/asm-parisc/processor.h 2001/08/05 04:05:38 @@ -87,7 +87,7 @@ struct cpuinfo_parisc { unsigned long fp_rev; unsigned long fp_model; unsigned int state; - struct hp_device *dev; + struct parisc_device *dev; }; extern struct system_cpuinfo_parisc boot_cpu_data;