93 #define NCR_D700_VERSION "2.2"
97 #include <linux/kernel.h>
98 #include <linux/module.h>
99 #include <linux/mca.h>
100 #include <linux/slab.h>
110 static char *NCR_D700;
118 { [0 ... 2*(MCA_MAX_SLOT_NR + 1)-1] = 7 };
127 param_setup(
char *
string)
130 int slot = -1, siop = -1;
137 else if(!
strncmp(pos,
"siop:", 5))
139 else if(!
strncmp(pos,
"id:", 3)) {
142 }
else if(slot > MCA_MAX_SLOT_NR) {
145 if(siop != 0 && siop != 1) {
146 id_array[slot*2] =
val;
147 id_array[slot*2 + 1] =
val;
149 id_array[slot*2 + siop] =
val;
163 .name =
"NCR Dual 700 MCA",
164 .proc_name =
"NCR_D700",
184 hostdata = kzalloc(
sizeof(*hostdata),
GFP_KERNEL);
187 "data, detatching\n", siop);
200 hostdata->
differential = (((1<<siop) & differential) != 0);
211 p->
hosts[siop] = host;
213 host->
this_id = id_array[slot * 2 + siop];
229 NCR_D700_intr(
int irq,
void *
data)
234 for (i = 0; i < 2; i++)
251 static int banner = 1;
252 struct mca_device *mca_dev = to_mca_device(dev);
253 int slot = mca_dev->slot;
256 int pos3j, pos3k, pos3a, pos3b, pos4;
257 __u32 base_addr, offset_addr;
260 pos4 = mca_device_read_pos(mca_dev, 4);
262 mca_device_write_pos(mca_dev, 4, pos4);
264 mca_device_write_pos(mca_dev, 6, 9);
265 pos3j = mca_device_read_pos(mca_dev, 3);
266 mca_device_write_pos(mca_dev, 6, 10);
267 pos3k = mca_device_read_pos(mca_dev, 3);
268 mca_device_write_pos(mca_dev, 6, 0);
269 pos3a = mca_device_read_pos(mca_dev, 3);
270 mca_device_write_pos(mca_dev, 6, 1);
271 pos3b = mca_device_read_pos(mca_dev, 3);
273 base_addr = ((pos3j << 8) | pos3k) & 0xfffffff0;
274 offset_addr = ((pos3a << 8) | pos3b) & 0xffffff70;
276 irq = (pos4 & 0x3) + 11;
286 irq = mca_device_transform_irq(mca_dev, irq);
287 base_addr = mca_device_transform_ioport(mca_dev, base_addr);
288 offset_addr = mca_device_transform_ioport(mca_dev, offset_addr);
290 printk(
KERN_NOTICE "NCR D700: found in slot %d irq = %d I/O base = 0x%x\n", slot, irq, offset_addr);
297 switch(differential = (
inb(base_addr + 0x08) >> 6)) {
329 for (i = 0; i < 2; i++) {
332 if ((err = NCR_D700_probe_one(p, i, irq, slot,
333 offset_addr + (0x80 * i),
335 printk(
"D700: SIOP%d: probe failed, error = %d\n",
346 mca_device_set_claim(mca_dev, 1);
347 mca_device_set_name(mca_dev,
"NCR_D700");
353 NCR_D700_remove_one(
struct Scsi_Host *host)
363 NCR_D700_remove(
struct device *dev)
368 for (i = 0; i < 2; i++)
369 NCR_D700_remove_one(p->
hosts[i]);
377 static struct mca_driver NCR_D700_driver = {
378 .id_table = NCR_D700_id_table,
381 .bus = &mca_bus_type,
382 .probe = NCR_D700_probe,
387 static int __init NCR_D700_init(
void)
391 param_setup(NCR_D700);
394 return mca_register_driver(&NCR_D700_driver);
397 static void __exit NCR_D700_exit(
void)
399 mca_unregister_driver(&NCR_D700_driver);
405 __setup(
"NCR_D700=", param_setup);