From 73bac981ddc7b224582a4a07ffc86f6afe5f6a7a Mon Sep 17 00:00:00 2001 From: Julian Elischer Date: Sun, 23 Apr 1995 09:13:08 +0000 Subject: [PATCH] include hooks for EISA configuration (possibly wrong :) --- sys/amd64/amd64/autoconf.c | 7 ++++++- sys/amd64/isa/isa.c | 26 ++++++++++++++------------ sys/i386/i386/autoconf.c | 7 ++++++- sys/i386/isa/bt742a.c | 18 +++++++++++++++++- sys/i386/isa/isa.c | 26 ++++++++++++++------------ sys/i386/isa/isa_device.h | 12 +++++++++++- 6 files changed, 68 insertions(+), 28 deletions(-) diff --git a/sys/amd64/amd64/autoconf.c b/sys/amd64/amd64/autoconf.c index 6e352f1adb9e..199aad4332e9 100644 --- a/sys/amd64/amd64/autoconf.c +++ b/sys/amd64/amd64/autoconf.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * from: @(#)autoconf.c 7.1 (Berkeley) 5/9/91 - * $Id: autoconf.c,v 1.23 1995/04/14 15:13:23 dufault Exp $ + * $Id: autoconf.c,v 1.24 1995/04/23 04:14:41 phk Exp $ */ /* @@ -78,6 +78,7 @@ int nfs_mountroot __P((void)); int cd9660_mountroot __P((void)); #endif +#include "eisa.h" #include "isa.h" #if NISA > 0 #include @@ -146,6 +147,10 @@ void configure() { +#if NEISA > 0 + eisa_configure(); +#endif + configure_start(); #if NISA > 0 diff --git a/sys/amd64/isa/isa.c b/sys/amd64/isa/isa.c index 24228936f923..edb6ba39f8ea 100644 --- a/sys/amd64/isa/isa.c +++ b/sys/amd64/isa/isa.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * from: @(#)isa.c 7.2 (Berkeley) 5/13/91 - * $Id: isa.c,v 1.44 1995/04/06 13:55:56 ache Exp $ + * $Id: isa.c,v 1.45 1995/04/12 20:47:54 wollman Exp $ */ /* @@ -85,15 +85,6 @@ #define DMA2_MODE (IO_DMA2 + 2*11) /* mode register */ #define DMA2_FFC (IO_DMA2 + 2*12) /* clear first/last FF */ -/* - * Bits to specify the type and amount of conflict checking. - */ -#define CC_ATTACH (1 << 0) -#define CC_DRQ (1 << 1) -#define CC_IOADDR (1 << 2) -#define CC_IRQ (1 << 3) -#define CC_MEMADDR (1 << 4) - /* * XXX these defines should be in a central place. */ @@ -147,7 +138,6 @@ static void conflict __P((struct isa_device *dvp, struct isa_device *tmpdvp, char const *format)); static int haveseen __P((struct isa_device *dvp, struct isa_device *tmpdvp, u_int checkbits)); -static int haveseen_isadev __P((struct isa_device *dvp, u_int checkbits)); static inthand2_t isa_strayintr; static void register_imask __P((struct isa_device *dvp, u_int mask)); @@ -249,7 +239,12 @@ haveseen(dvp, tmpdvp, checkbits) * Search through all the isa_devtab_* tables looking for anything that * conflicts with the current device. */ -static int +#include "eisa.h" +#if NEISA > 0 +extern struct isa_device isa_devtab_eisa[]; +#endif + +int haveseen_isadev(dvp, checkbits) struct isa_device *dvp; u_int checkbits; @@ -277,6 +272,13 @@ haveseen_isadev(dvp, checkbits) if (status) return status; } +#if NEISA > 0 + for (tmpdvp = isa_devtab_eisa; tmpdvp->id_driver; tmpdvp++) { + status |= haveseen(dvp, tmpdvp, checkbits); + if (status) + return status; + } +#endif return(status); } diff --git a/sys/i386/i386/autoconf.c b/sys/i386/i386/autoconf.c index 6e352f1adb9e..199aad4332e9 100644 --- a/sys/i386/i386/autoconf.c +++ b/sys/i386/i386/autoconf.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * from: @(#)autoconf.c 7.1 (Berkeley) 5/9/91 - * $Id: autoconf.c,v 1.23 1995/04/14 15:13:23 dufault Exp $ + * $Id: autoconf.c,v 1.24 1995/04/23 04:14:41 phk Exp $ */ /* @@ -78,6 +78,7 @@ int nfs_mountroot __P((void)); int cd9660_mountroot __P((void)); #endif +#include "eisa.h" #include "isa.h" #if NISA > 0 #include @@ -146,6 +147,10 @@ void configure() { +#if NEISA > 0 + eisa_configure(); +#endif + configure_start(); #if NISA > 0 diff --git a/sys/i386/isa/bt742a.c b/sys/i386/isa/bt742a.c index b1f0d7f53113..f6c2f074f2bd 100644 --- a/sys/i386/isa/bt742a.c +++ b/sys/i386/isa/bt742a.c @@ -12,7 +12,7 @@ * on the understanding that TFS is not responsible for the correct * functioning of this software in any circumstances. * - * $Id: bt742a.c,v 1.31 1995/03/16 18:11:56 bde Exp $ + * $Id: bt742a.c,v 1.32 1995/04/12 20:47:38 wollman Exp $ */ /* @@ -642,6 +642,22 @@ btprobe(dev) } bzero(bt, sizeof(struct bt_data)); btdata[unit] = bt; + if(dev->id_iobase > 0xFFF) /* an EISA card, we have an EISA port */ + { + int i = inb(dev->id_iobase + 0x0C); + static unsigned long bt_iobase[8] = + { 0x330,0x334,0x230,0x234,0x130,0x134,0x00,0x00 }; + + if (!(dev->id_iobase = bt_iobase[i&7])) { + printf("bt_iobase disabled or invalid; index %d\n" + ,i&7); + return 0; + } +#if defined(DEBUG) + printf("btprobe: Trying iobase 0x%x\n",dev->dev_addr); +#endif /* defined(DEBUG) */ + } + bt->bt_base = dev->id_iobase; #ifndef DEV_LKM diff --git a/sys/i386/isa/isa.c b/sys/i386/isa/isa.c index 24228936f923..edb6ba39f8ea 100644 --- a/sys/i386/isa/isa.c +++ b/sys/i386/isa/isa.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * from: @(#)isa.c 7.2 (Berkeley) 5/13/91 - * $Id: isa.c,v 1.44 1995/04/06 13:55:56 ache Exp $ + * $Id: isa.c,v 1.45 1995/04/12 20:47:54 wollman Exp $ */ /* @@ -85,15 +85,6 @@ #define DMA2_MODE (IO_DMA2 + 2*11) /* mode register */ #define DMA2_FFC (IO_DMA2 + 2*12) /* clear first/last FF */ -/* - * Bits to specify the type and amount of conflict checking. - */ -#define CC_ATTACH (1 << 0) -#define CC_DRQ (1 << 1) -#define CC_IOADDR (1 << 2) -#define CC_IRQ (1 << 3) -#define CC_MEMADDR (1 << 4) - /* * XXX these defines should be in a central place. */ @@ -147,7 +138,6 @@ static void conflict __P((struct isa_device *dvp, struct isa_device *tmpdvp, char const *format)); static int haveseen __P((struct isa_device *dvp, struct isa_device *tmpdvp, u_int checkbits)); -static int haveseen_isadev __P((struct isa_device *dvp, u_int checkbits)); static inthand2_t isa_strayintr; static void register_imask __P((struct isa_device *dvp, u_int mask)); @@ -249,7 +239,12 @@ haveseen(dvp, tmpdvp, checkbits) * Search through all the isa_devtab_* tables looking for anything that * conflicts with the current device. */ -static int +#include "eisa.h" +#if NEISA > 0 +extern struct isa_device isa_devtab_eisa[]; +#endif + +int haveseen_isadev(dvp, checkbits) struct isa_device *dvp; u_int checkbits; @@ -277,6 +272,13 @@ haveseen_isadev(dvp, checkbits) if (status) return status; } +#if NEISA > 0 + for (tmpdvp = isa_devtab_eisa; tmpdvp->id_driver; tmpdvp++) { + status |= haveseen(dvp, tmpdvp, checkbits); + if (status) + return status; + } +#endif return(status); } diff --git a/sys/i386/isa/isa_device.h b/sys/i386/isa/isa_device.h index 579f06d8be26..c21d35a1cf5e 100644 --- a/sys/i386/isa/isa_device.h +++ b/sys/i386/isa/isa_device.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)isa_device.h 7.1 (Berkeley) 5/9/91 - * $Id: isa_device.h,v 1.19 1995/03/16 17:31:19 se Exp $ + * $Id: isa_device.h,v 1.20 1995/03/28 07:55:39 bde Exp $ */ #ifndef _I386_ISA_ISA_DEVICE_H_ @@ -78,6 +78,15 @@ struct isa_device { struct isa_device *id_next; /* used in isa_devlist in userconfig() */ }; +/* + * Bits to specify the type and amount of conflict checking. + */ +#define CC_ATTACH (1 << 0) +#define CC_DRQ (1 << 1) +#define CC_IOADDR (1 << 2) +#define CC_IRQ (1 << 3) +#define CC_MEMADDR (1 << 4) + /* * Per-driver structure. * @@ -128,6 +137,7 @@ inthand_t IDTVEC(intr12), IDTVEC(intr13), IDTVEC(intr14), IDTVEC(intr15); void isa_configure __P((void)); +int haveseen_isadev __P((struct isa_device *dvp, u_int checkbits)); void isa_defaultirq __P((void)); void isa_dmacascade __P((unsigned chan)); void isa_dmadone __P((int, caddr_t, int, int));