summaryrefslogtreecommitdiffstats
path: root/sys/i4b/layer1
diff options
context:
space:
mode:
authorhm <hm@FreeBSD.org>2001-10-21 09:20:52 +0000
committerhm <hm@FreeBSD.org>2001-10-21 09:20:52 +0000
commit980b42ded4563ef17d4c397c89546cf8a4130587 (patch)
tree251cd6004f12e1bb30d45c66dfd8c8e8227407f8 /sys/i4b/layer1
parentf392095807b868bdc264122bb22c9df0fbc0610e (diff)
downloadFreeBSD-src-980b42ded4563ef17d4c397c89546cf8a4130587.zip
FreeBSD-src-980b42ded4563ef17d4c397c89546cf8a4130587.tar.gz
Add a driver for the Compaq Microcom 610 ISDN (Compaq series PSB2222I) ISA PnP
card. Submitted by: Steve Looman Reviewed by: hm MFC after: 1 month
Diffstat (limited to 'sys/i4b/layer1')
-rw-r--r--sys/i4b/layer1/isic/i4b_ctx_s0P.c115
-rw-r--r--sys/i4b/layer1/isic/i4b_isic_pnp.c11
2 files changed, 100 insertions, 26 deletions
diff --git a/sys/i4b/layer1/isic/i4b_ctx_s0P.c b/sys/i4b/layer1/isic/i4b_ctx_s0P.c
index 8be6979..c1b61cd 100644
--- a/sys/i4b/layer1/isic/i4b_ctx_s0P.c
+++ b/sys/i4b/layer1/isic/i4b_ctx_s0P.c
@@ -43,7 +43,7 @@
#include "isic.h"
#include "opt_i4b.h"
-#if (NISIC > 0) && (defined(CRTX_S0_P) || defined(TEL_S0_16_3_P))
+#if (NISIC > 0) && (defined(CRTX_S0_P) || defined(TEL_S0_16_3_P) || defined(COMPAQ_M610))
#include <sys/param.h>
#include <sys/systm.h>
@@ -109,6 +109,7 @@ isic_attach_Cs0P(device_t dev)
{
u_int32_t iobase1;
u_int32_t iobase2;
+ u_int32_t iocfg;
int unit = device_get_unit(dev);
struct l1_softc *sc = &l1_sc[unit];
bus_space_tag_t t;
@@ -131,25 +132,61 @@ isic_attach_Cs0P(device_t dev)
return ENXIO;
}
- /* remember the io base addresses */
+ /*
+ * Compaq M610 has a cfg io area,
+ * we need it
+ */
+
+ if (sc->sc_cardtyp == CARD_TYPEP_COMPAQ_M610)
+ {
+ sc->sc_resources.io_rid[2] = 2;
- iobase1 = rman_get_start(sc->sc_resources.io_base[0]);
- iobase2 = rman_get_start(sc->sc_resources.io_base[1]);
+ if(!(sc->sc_resources.io_base[2] =
+ bus_alloc_resource(dev, SYS_RES_IOPORT,
+ &sc->sc_resources.io_rid[2],
+ 0UL, ~0UL, 1, RF_ACTIVE)))
+ {
+ printf("isic%d: Could not get cfg io area for Compaq Microcom 610\n", unit);
+ isic_detach_common(dev);
+ return ENXIO;
+ }
+
+ iocfg = rman_get_start(sc->sc_resources.io_base[2]);
+
+ bus_release_resource(dev, SYS_RES_IOPORT, sc->sc_resources.io_rid[2],
+ sc->sc_resources.io_base[2]);
+ }
+
+ /* remember the io base addresses */
+ if (sc->sc_cardtyp != CARD_TYPEP_COMPAQ_M610)
+ {
+ iobase1 = rman_get_start(sc->sc_resources.io_base[0]);
+ iobase2 = rman_get_start(sc->sc_resources.io_base[1]);
+ }
+ else
+ {
+ iobase1 = rman_get_start(sc->sc_resources.io_base[1]);
+ iobase2 = rman_get_start(sc->sc_resources.io_base[0]);
+ }
+
/*
* because overlapping resources are invalid,
- * release the first io port resource
+ * release the first and second io port resource
*/
bus_release_resource(dev, SYS_RES_IOPORT, sc->sc_resources.io_rid[0],
sc->sc_resources.io_base[0]);
+ bus_release_resource(dev, SYS_RES_IOPORT, sc->sc_resources.io_rid[1],
+ sc->sc_resources.io_base[1]);
+
/* set and allocate a base io address for the ISAC chip */
sc->sc_resources.io_rid[2] = 2;
bus_set_resource(dev, SYS_RES_IOPORT, 2, iobase1-0x20, 0x40);
-
+
if(!(sc->sc_resources.io_base[2] =
bus_alloc_resource(dev, SYS_RES_IOPORT,
&sc->sc_resources.io_rid[2],
@@ -160,13 +197,6 @@ isic_attach_Cs0P(device_t dev)
return ENXIO;
}
- /*
- * because overlapping resources are invalid,
- * release the second io port resource
- */
-
- bus_release_resource(dev, SYS_RES_IOPORT, sc->sc_resources.io_rid[1],
- sc->sc_resources.io_base[1]);
/* set and allocate a resource for the HSCX channel A */
@@ -200,7 +230,7 @@ isic_attach_Cs0P(device_t dev)
sc->sc_resources.io_rid[4] = 4;
bus_set_resource(dev, SYS_RES_IOPORT, 4, iobase2, 0x40);
-
+
if(!(sc->sc_resources.io_base[4] =
bus_alloc_resource(dev,SYS_RES_IOPORT,
&sc->sc_resources.io_rid[4],
@@ -210,7 +240,29 @@ isic_attach_Cs0P(device_t dev)
isic_detach_common(dev);
return ENXIO;
}
-
+
+ /*
+ * set and allocate a resource for the cfg io
+ * for compaq m610
+ */
+
+ if (sc->sc_cardtyp == CARD_TYPEP_COMPAQ_M610)
+ {
+ sc->sc_resources.io_rid[5] = 5;
+
+ bus_set_resource(dev, SYS_RES_IOPORT, 5, iocfg, 0x01);
+
+ if(!(sc->sc_resources.io_base[5] =
+ bus_alloc_resource(dev,SYS_RES_IOPORT,
+ &sc->sc_resources.io_rid[5],
+ 0ul, ~0ul, 1, RF_ACTIVE)))
+ {
+ printf("isic%d: Could not get cfg io area for Compaq Microcom 610!\n", unit);
+ isic_detach_common(dev);
+ return ENXIO;
+ }
+ }
+
/* setup access routines */
sc->clearirq = NULL;
@@ -221,8 +273,9 @@ isic_attach_Cs0P(device_t dev)
sc->writefifo = ctxs0P_write_fifo;
/* setup card type */
-
- sc->sc_cardtyp = CARD_TYPEP_CS0P;
+
+ if (sc->sc_cardtyp != CARD_TYPEP_COMPAQ_M610)
+ sc->sc_cardtyp = CARD_TYPEP_CS0P;
/* setup IOM bus type */
@@ -233,17 +286,31 @@ isic_attach_Cs0P(device_t dev)
/* enable the card */
- t = rman_get_bustag(sc->sc_resources.io_base[2]);
- h = rman_get_bushandle(sc->sc_resources.io_base[2]);
+ if (sc->sc_cardtyp != CARD_TYPEP_COMPAQ_M610)
+ {
+ t = rman_get_bustag(sc->sc_resources.io_base[2]);
+ h = rman_get_bushandle(sc->sc_resources.io_base[2]);
- bus_space_write_1(t, h, 0x3c, 0);
- DELAY(SEC_DELAY / 10);
+ bus_space_write_1(t, h, 0x3c, 0);
+ DELAY(SEC_DELAY / 10);
- bus_space_write_1(t, h, 0x3c, 1);
- DELAY(SEC_DELAY / 10);
+ bus_space_write_1(t, h, 0x3c, 1);
+ DELAY(SEC_DELAY / 10);
+ }
+ else
+ {
+ t = rman_get_bustag(sc->sc_resources.io_base[5]);
+ h = rman_get_bushandle(sc->sc_resources.io_base[5]);
+
+ bus_space_write_1(t, h, 0xff, 0);
+ DELAY(SEC_DELAY / 10);
+
+ bus_space_write_1(t, h, 0x00, 1);
+ DELAY(SEC_DELAY / 10);
+ }
return 0;
}
-#endif /* (NISIC > 0) && (defined(CRTX_S0_P) || defined(TEL_S0_16_3_P)) */
+#endif /* (NISIC > 0) && (defined(CRTX_S0_P) || defined(TEL_S0_16_3_P) || defined(COMPAQ_M610)) */
diff --git a/sys/i4b/layer1/isic/i4b_isic_pnp.c b/sys/i4b/layer1/isic/i4b_isic_pnp.c
index e02878d..f5e1bcc 100644
--- a/sys/i4b/layer1/isic/i4b_isic_pnp.c
+++ b/sys/i4b/layer1/isic/i4b_isic_pnp.c
@@ -71,14 +71,16 @@
#define VID_ASUSCOM_IPAC 0x90167506 /* Asuscom (with IPAC) */
#define VID_EICON_DIVA_20 0x7100891c /* Eicon DIVA 2.0 ISAC/HSCX */
#define VID_EICON_DIVA_202 0xa100891c /* Eicon DIVA 2.02 IPAC */
+#define VID_COMPAQ_M610 0x0210110e /* Compaq Microcom 610 */
static struct isic_pnp_ids {
u_long vend_id;
char *id_str;
} isic_pnp_ids[] = {
-#if defined(TEL_S0_16_3_P) || defined(CRTX_S0_P)
+#if defined(TEL_S0_16_3_P) || defined(CRTX_S0_P) || defined(COMPAQ_M610)
{ VID_TEL163PNP, "Teles S0/16.3 PnP" },
{ VID_CREATIXPP, "Creatix S0/16 PnP" },
+ { VID_COMPAQ_M610, "Compaq Microcom 610" },
#endif
#ifdef DYNALINK
{ VID_DYNALINK, "Dynalink IS64PH" },
@@ -223,7 +225,7 @@ isic_pnp_attach(device_t dev)
switch(vend_id)
{
-#if defined(TEL_S0_16_3_P) || defined(CRTX_S0_P)
+#if defined(TEL_S0_16_3_P) || defined(CRTX_S0_P) || defined(COMPAQ_M610)
case VID_TEL163PNP:
sc->sc_cardtyp = CARD_TYPEP_163P;
ret = isic_attach_Cs0P(dev);
@@ -233,6 +235,11 @@ isic_pnp_attach(device_t dev)
sc->sc_cardtyp = CARD_TYPEP_CS0P;
ret = isic_attach_Cs0P(dev);
break;
+
+ case VID_COMPAQ_M610:
+ sc->sc_cardtyp = CARD_TYPEP_COMPAQ_M610;
+ ret = isic_attach_Cs0P(dev);
+ break;
#endif
#ifdef DYNALINK
case VID_DYNALINK:
OpenPOWER on IntegriCloud