3 * This file is subject to the terms and conditions of the GNU General Public
4 * License. See the file "COPYING" in the main directory of this archive
7 * Copyright (C) 1992 - 1997, 2000-2002 Silicon Graphics, Inc. All rights reserved.
10 #include <linux/config.h>
11 #include <linux/types.h>
12 #include <asm/sn/sgi.h>
14 #include <asm/sn/invent.h>
15 #include <asm/sn/hcl.h>
16 #include <asm/sn/pci/bridge.h>
17 #include "asm/sn/ioerror_handling.h"
18 #include <asm/sn/xtalk/xbow.h>
20 /* these get called directly in cdl_add_connpt in fops bypass hack */
21 extern int pcibr_attach(devfs_handle_t);
22 extern int xbow_attach(devfs_handle_t);
23 extern int pic_attach(devfs_handle_t);
27 * cdl: Connection and Driver List
29 * We are not porting this to Linux. Devices are registered via
30 * the normal Linux PCI layer. This is a very simplified version
31 * of cdl that will allow us to register and call our very own
32 * IO Infrastructure Drivers e.g. pcibr.
38 int (*attach) (devfs_handle_t);
41 #ifdef CONFIG_IA64_SGI_SN1
42 #define MAX_SGI_IO_INFRA_DRVR 4
44 #define MAX_SGI_IO_INFRA_DRVR 7
46 static struct cdl sgi_infrastructure_drivers[MAX_SGI_IO_INFRA_DRVR] =
48 { XBRIDGE_WIDGET_PART_NUM, XBRIDGE_WIDGET_MFGR_NUM, pcibr_attach /* &pcibr_fops */},
49 { BRIDGE_WIDGET_PART_NUM, BRIDGE_WIDGET_MFGR_NUM, pcibr_attach /* &pcibr_fops */},
50 #ifndef CONFIG_IA64_SGI_SN1
51 { PIC_WIDGET_PART_NUM_BUS0, PIC_WIDGET_MFGR_NUM, pic_attach /* &pic_fops */},
52 { PIC_WIDGET_PART_NUM_BUS1, PIC_WIDGET_MFGR_NUM, pic_attach /* &pic_fops */},
54 { XXBOW_WIDGET_PART_NUM, XXBOW_WIDGET_MFGR_NUM, xbow_attach /* &xbow_fops */},
55 { XBOW_WIDGET_PART_NUM, XBOW_WIDGET_MFGR_NUM, xbow_attach /* &xbow_fops */},
56 #ifndef CONFIG_IA64_SGI_SN1
57 { PXBOW_WIDGET_PART_NUM, XXBOW_WIDGET_MFGR_NUM, xbow_attach /* &xbow_fops */},
62 * cdl_new: Called by pciio and xtalk.
65 cdl_new(char *name, char *k1str, char *k2str)
68 * Just return a dummy pointer.
70 return((cdl_p)&dummy_reg);
74 * cdl_del: Do nothing.
83 * cdl_add_driver: The driver part number and manufacturers number
84 * are statically initialized above.
89 cdl_add_driver(cdl_p reg, int key1, int key2, char *prefix, int flags, cdl_drv_f *func)
95 * cdl_del_driver: Not supported.
98 cdl_del_driver(cdl_p reg, char *prefix, cdl_drv_f *func)
104 * cdl_add_connpt: We found a device and it's connect point. Call the
105 * attach routine of that driver.
107 * May need support for pciba registration here ...
109 * This routine use to create /hw/.id/pci/.../.. that links to
110 * /hw/module/006c06/Pbrick/xtalk/15/pci/<slotnum> .. do we still need
111 * it? The specified driver attach routine does not reference these
115 cdl_add_connpt(cdl_p reg, int part_num, int mfg_num,
116 devfs_handle_t connpt, int drv_flags)
121 * Find the driver entry point and call the attach routine.
123 for (i = 0; i < MAX_SGI_IO_INFRA_DRVR; i++) {
125 if ( (part_num == sgi_infrastructure_drivers[i].part_num) &&
126 ( mfg_num == sgi_infrastructure_drivers[i].mfg_num) ) {
128 * Call the device attach routines.
130 if (sgi_infrastructure_drivers[i].attach) {
131 return(sgi_infrastructure_drivers[i].attach(connpt));
138 /* printk("WARNING: cdl_add_connpt: Driver not found for part_num 0x%x mfg_num 0x%x\n", part_num, mfg_num); */
144 * cdl_del_connpt: Not implemented.
147 cdl_del_connpt(cdl_p reg, int key1, int key2, devfs_handle_t connpt, int drv_flags)
154 * cdl_iterate: Not Implemented.
157 cdl_iterate(cdl_p reg,
165 async_attach_new(void)
172 async_attach_free(async_attach_t aa)
178 async_attach_get_info(devfs_handle_t vhdl)
185 async_attach_add_info(devfs_handle_t vhdl, async_attach_t aa)
192 async_attach_del_info(devfs_handle_t vhdl)
197 void async_attach_signal_start(async_attach_t aa)
202 void async_attach_signal_done(async_attach_t aa)
207 void async_attach_waitall(async_attach_t aa)