diff options
Diffstat (limited to 'sys/i386/eisa/aic7770.c')
-rw-r--r-- | sys/i386/eisa/aic7770.c | 31 |
1 files changed, 19 insertions, 12 deletions
diff --git a/sys/i386/eisa/aic7770.c b/sys/i386/eisa/aic7770.c index b7da311..2e215b0 100644 --- a/sys/i386/eisa/aic7770.c +++ b/sys/i386/eisa/aic7770.c @@ -2,7 +2,7 @@ * Product specific probe and attach routines for: * 27/284X and aic7770 motherboard SCSI controllers * - * Copyright (c) 1995 Justin T. Gibbs + * Copyright (c) 1995, 1996 Justin T. Gibbs * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -19,7 +19,7 @@ * 4. Modifications may be freely made to this file if the above conditions * are met. * - * $Id: aic7770.c,v 1.21 1996/01/03 06:28:00 gibbs Exp $ + * $Id: aic7770.c,v 1.22 1996/01/23 21:48:28 se Exp $ */ #include "eisa.h" @@ -44,8 +44,9 @@ #define EISA_DEVICE_ID_ADAPTEC_284xB 0x04907756 /* BIOS enabled */ #define EISA_DEVICE_ID_ADAPTEC_284x 0x04907757 /* BIOS disabled*/ -#define AHC_EISA_IOSIZE 0x100 -#define INTDEF 0x5cul /* Interrupt Definition Register */ +#define AHC_EISA_SLOT_OFFSET 0xc00 +#define AHC_EISA_IOSIZE 0x100 +#define INTDEF 0x5cul /* Interrupt Definition Register */ static int aic7770probe __P((void)); static int aic7770_attach __P((struct eisa_device *e_dev)); @@ -106,10 +107,11 @@ aic7770probe(void) count = 0; while ((e_dev = eisa_match_dev(e_dev, aic7770_match))) { - iobase = e_dev->ioconf.iobase; + iobase = (e_dev->ioconf.slot * EISA_SLOT_SIZE) + + AHC_EISA_SLOT_OFFSET; ahc_reset(iobase); - eisa_add_iospace(e_dev, iobase, AHC_EISA_IOSIZE); + eisa_add_iospace(e_dev, iobase, AHC_EISA_IOSIZE, RESVADDR_NONE); intdef = inb(INTDEF + iobase); switch (intdef & 0xf) { case 9: @@ -154,10 +156,18 @@ aic7770_attach(e_dev) { ahc_type type; struct ahc_data *ahc; + resvaddr_t *iospace; u_long iobase; int unit = e_dev->unit; int irq = ffs(e_dev->ioconf.irq) - 1; + iospace = e_dev->ioconf.ioaddrs.lh_first; + + if(!iospace) + return -1; + + iobase = iospace->addr; + switch(e_dev->id) { case EISA_DEVICE_ID_ADAPTEC_AIC7770: type = AHC_AIC7770; @@ -175,11 +185,11 @@ aic7770_attach(e_dev) break; } - if(!(ahc = ahc_alloc(unit, e_dev->ioconf.iobase, type, AHC_FNONE))) + if(!(ahc = ahc_alloc(unit, iospace->addr, type, AHC_FNONE))) return -1; eisa_reg_start(e_dev); - if(eisa_reg_iospace(e_dev, e_dev->ioconf.iobase, AHC_EISA_IOSIZE)) { + if(eisa_reg_iospace(e_dev, iospace)) { ahc_free(ahc); return -1; } @@ -211,10 +221,7 @@ aic7770_attach(e_dev) /* * Now that we know we own the resources we need, do the * card initialization. - */ - iobase = ahc->baseport; - - /* + * * First, the aic7770 card specific setup. */ switch( ahc->type ) { |