summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFederico G. Schwindt <fgsch@cvs.openbsd.org>1999-05-02 22:35:41 +0000
committerFederico G. Schwindt <fgsch@cvs.openbsd.org>1999-05-02 22:35:41 +0000
commitcfda8b8847afc6a44e952fa3a892e806823a7257 (patch)
treedd351927090d64e44d7d1b657b7936319dbacb4d
parent90818f1a628cce299c28451fe18ca8718e6b4a7f (diff)
Add support for Vadem PCMCIA controllers.
-rw-r--r--sys/dev/ic/i82365.c63
-rw-r--r--sys/dev/ic/i82365reg.h23
-rw-r--r--sys/dev/ic/i82365var.h6
3 files changed, 74 insertions, 18 deletions
diff --git a/sys/dev/ic/i82365.c b/sys/dev/ic/i82365.c
index 1e4db8972a2..191bdcbe4b3 100644
--- a/sys/dev/ic/i82365.c
+++ b/sys/dev/ic/i82365.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: i82365.c,v 1.6 1999/02/13 09:58:38 fgsch Exp $ */
+/* $OpenBSD: i82365.c,v 1.7 1999/05/02 22:35:40 fgsch Exp $ */
/* $NetBSD: i82365.c,v 1.10 1998/06/09 07:36:55 thorpej Exp $ */
/*
@@ -57,8 +57,11 @@
#define PCIC_VENDOR_UNKNOWN 0
#define PCIC_VENDOR_I82365SLR0 1
#define PCIC_VENDOR_I82365SLR1 2
-#define PCIC_VENDOR_CIRRUS_PD6710 3
-#define PCIC_VENDOR_CIRRUS_PD672X 4
+#define PCIC_VENDOR_I82365SLR2 3
+#define PCIC_VENDOR_CIRRUS_PD6710 4
+#define PCIC_VENDOR_CIRRUS_PD672X 5
+#define PCIC_VENDOR_VADEM_VG468 6
+#define PCIC_VENDOR_VADEM_VG469 7
/*
* Individual drivers will allocate their own memory and io regions. Memory
@@ -109,7 +112,7 @@ int
pcic_vendor(h)
struct pcic_handle *h;
{
- int reg;
+ int vendor, reg;
/*
* the chip_id of the cirrus toggles between 11 and 00 after a write.
@@ -132,12 +135,42 @@ pcic_vendor(h)
reg = pcic_read(h, PCIC_IDENT);
- if ((reg & PCIC_IDENT_REV_MASK) == PCIC_IDENT_REV_I82365SLR0)
- return (PCIC_VENDOR_I82365SLR0);
- else
- return (PCIC_VENDOR_I82365SLR1);
+ switch (reg) {
+ case PCIC_IDENT_REV_I82365SLR0:
+ vendor = PCIC_VENDOR_I82365SLR0;
+ break;
+ case PCIC_IDENT_REV_I82365SLR1:
+ vendor = PCIC_VENDOR_I82365SLR1;
+ break;
+ case PCIC_IDENT_REV_I82365SLR2:
+ vendor = PCIC_VENDOR_I82365SLR2;
+ break;
+ default:
+ vendor = PCIC_VENDOR_UNKNOWN;
+ break;
+ }
+
+ pcic_write(h, 0x0e, -1);
+ pcic_write(h, 0x37, -1);
- return (PCIC_VENDOR_UNKNOWN);
+ reg = pcic_read(h, PCIC_VG468_MISC);
+ reg |= PCIC_VG468_MISC_VADEMREV;
+ pcic_write(h, PCIC_VG468_MISC, reg);
+
+ reg = pcic_read(h, PCIC_IDENT);
+
+ if (reg & PCIC_IDENT_VADEM_MASK) {
+ if ((reg & 7) >= 4)
+ vendor = PCIC_VENDOR_VADEM_VG469;
+ else
+ vendor = PCIC_VENDOR_VADEM_VG468;
+
+ reg = pcic_read(h, PCIC_VG468_MISC);
+ reg &= ~PCIC_VG468_MISC_VADEMREV;
+ pcic_write(h, PCIC_VG468_MISC, reg);
+ }
+
+ return (vendor);
}
char *
@@ -149,10 +182,16 @@ pcic_vendor_to_string(vendor)
return ("Intel 82365SL Revision 0");
case PCIC_VENDOR_I82365SLR1:
return ("Intel 82365SL Revision 1");
+ case PCIC_VENDOR_I82365SLR2:
+ return ("Intel 82365SL Revision 2");
case PCIC_VENDOR_CIRRUS_PD6710:
return ("Cirrus PD6710");
case PCIC_VENDOR_CIRRUS_PD672X:
return ("Cirrus PD672X");
+ case PCIC_VENDOR_VADEM_VG468:
+ return ("Vadem VG468");
+ case PCIC_VENDOR_VADEM_VG469:
+ return ("Vadem VG469");
}
return ("Unknown controller");
@@ -1116,6 +1155,12 @@ pcic_chip_socket_enable(pch)
*/
delay((300 + 100) * 1000);
+ if (h->vendor == PCIC_VENDOR_VADEM_VG469) {
+ reg = pcic_read(h, PCIC_VG469_VSELECT);
+ reg &= ~PCIC_VG469_VSELECT_VCC;
+ pcic_write(h, PCIC_VG469_VSELECT, reg);
+ }
+
/* power up the socket */
pcic_write(h, PCIC_PWRCTL, PCIC_PWRCTL_DISABLE_RESETDRV
diff --git a/sys/dev/ic/i82365reg.h b/sys/dev/ic/i82365reg.h
index e1811a6d8f2..14d7f8fad05 100644
--- a/sys/dev/ic/i82365reg.h
+++ b/sys/dev/ic/i82365reg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: i82365reg.h,v 1.6 1999/01/28 04:58:33 fgsch Exp $ */
+/* $OpenBSD: i82365reg.h,v 1.7 1999/05/02 22:35:40 fgsch Exp $ */
/* $NetBSD: i82365reg.h,v 1.2 1997/10/16 23:18:18 thorpej Exp $ */
/*
@@ -65,8 +65,9 @@
#define PCIC_IDENT_IFTYPE_RESERVED 0xC0
#define PCIC_IDENT_ZERO 0x30
#define PCIC_IDENT_REV_MASK 0x0F
-#define PCIC_IDENT_REV_I82365SLR0 0x02
-#define PCIC_IDENT_REV_I82365SLR1 0x03
+#define PCIC_IDENT_REV_I82365SLR0 0x82
+#define PCIC_IDENT_REV_I82365SLR1 0x83
+#define PCIC_IDENT_REV_I82365SLR2 0x84
#define PCIC_IF_STATUS 0x01 /* RO */
#define PCIC_IF_STATUS_GPI 0x80 /* General Purpose Input */
@@ -332,7 +333,15 @@
#define PCIC_CIRRUS_CHIP_INFO_SLOTS 0x20
#define PCIC_CIRRUS_CHIP_INFO_REV 0x1F
-#define PCIC_CIRRUS_EXTENDED_INDEX 0x2E
-#define PCIC_CIRRUS_EXTENDED_DATA 0x2F
-#define PCIC_CIRRUS_EXT_CONTROL_1 0x03
-#define PCIC_CIRRUS_EXT_CONTROL_1_PCI_INTR_MASK 0x18
+#define PCIC_CIRRUS_EXTENDED_INDEX 0x2E
+#define PCIC_CIRRUS_EXTENDED_DATA 0x2F
+#define PCIC_CIRRUS_EXT_CONTROL_1 0x03
+#define PCIC_CIRRUS_EXT_CONTROL_1_PCI_INTR_MASK 0x18
+
+#define PCIC_IDENT_VADEM_MASK 0x08
+
+#define PCIC_VG468_MISC 0x3A
+#define PCIC_VG468_MISC_VADEMREV 0x40
+
+#define PCIC_VG469_VSELECT 0x2f
+#define PCIC_VG469_VSELECT_VCC 0x03
diff --git a/sys/dev/ic/i82365var.h b/sys/dev/ic/i82365var.h
index 7c62228d87e..511d4e277c9 100644
--- a/sys/dev/ic/i82365var.h
+++ b/sys/dev/ic/i82365var.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: i82365var.h,v 1.2 1999/01/03 10:05:52 deraadt Exp $ */
+/* $OpenBSD: i82365var.h,v 1.3 1999/05/02 22:35:40 fgsch Exp $ */
/* $NetBSD: i82365var.h,v 1.4 1998/05/23 18:32:29 matt Exp $ */
/*
@@ -171,5 +171,7 @@ pcic_write(h, idx, data)
if (idx != -1)
bus_space_write_1(h->sc->iot, h->sc->ioh, PCIC_REG_INDEX,
h->sock + idx);
- bus_space_write_1(h->sc->iot, h->sc->ioh, PCIC_REG_DATA, (data));
+ if (data != -1)
+ bus_space_write_1(h->sc->iot, h->sc->ioh, PCIC_REG_DATA,
+ (data));
}