summaryrefslogtreecommitdiffstats
path: root/sys/pccard/pcic.c
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2001-11-09 07:33:54 +0000
committerimp <imp@FreeBSD.org>2001-11-09 07:33:54 +0000
commit66dabcc793efb40567d212a22a6bd88f4d264dc0 (patch)
tree2faca828cbc4923f603cb0cbe57b4077cdd20f36 /sys/pccard/pcic.c
parentdab2d92b007935a860120ec3ec7963659c29706f (diff)
downloadFreeBSD-src-66dabcc793efb40567d212a22a6bd88f4d264dc0.zip
FreeBSD-src-66dabcc793efb40567d212a22a6bd88f4d264dc0.tar.gz
o Try to do 3.3V support better for the 6722 and 6729/30.
o Bite the bullet and create controller types for the 6729 and also for the 673x. Rename the 672x to 6722. o Define minimal extended register info (just register 0xa for reading VS[12]). # I think the last version may have broken 673x controllers, but this should # fix them. Tested on the 6722, but not the 6729. Ideas from: Chiharu Shibata-san's article in bsd-nomads:15866
Diffstat (limited to 'sys/pccard/pcic.c')
-rw-r--r--sys/pccard/pcic.c46
1 files changed, 32 insertions, 14 deletions
diff --git a/sys/pccard/pcic.c b/sys/pccard/pcic.c
index aaa683a..b3ad06e 100644
--- a/sys/pccard/pcic.c
+++ b/sys/pccard/pcic.c
@@ -558,6 +558,7 @@ pcic_power(struct slot *slt)
unsigned char c;
unsigned char reg = PCIC_DISRST | PCIC_PCPWRE;
struct pcic_slot *sp = slt->cdata;
+ struct pcic_slot *sp2;
struct pcic_softc *sc = sp->sc;
/*
@@ -577,19 +578,36 @@ pcic_power(struct slot *slt)
}
if (sc->flags & PCIC_PD_POWER) {
/*
- * Datasheets indicate that this is only supported on
- * the CL-PD6710. However, my 6722 seems to support
- * it as well. The datasheet for the '22 talks about
- * the need to read this from register 0x6f.0xa (both
- * slots are read from the same register). The
- * datasheet is a little vauge. The '29 datasheet is
- * clear and spells out the recommends way on the '22
- * is the way on the '29. Note: PCIC_MISC1_5V_DETECT
- * is definitely not defined on the '29.
+ * The 6710 does it one way, and the '22 and '29 do it
+ * another. And it appears that the '32 and '33 yet
+ * another way (which I don't know).
*/
- c = sp->getb(sp, PCIC_MISC1);
- if ((c & PCIC_MISC1_5V_DETECT) == 0)
- slt->pwr.vcc = 33;
+ switch (sp->controller) {
+ case PCIC_PD6710:
+ c = sp->getb(sp, PCIC_MISC1);
+ if ((c & PCIC_MISC1_5V_DETECT) == 0)
+ slt->pwr.vcc = 33;
+ break;
+ case PCIC_PD6722:
+ case PCIC_PD6729:
+ /*
+ * VS[12] signals are in slot1's extended reg 0xa.
+ */
+ sp2 = &sc->slots[1];
+ sp2->putb(sp2, PCIC_EXT_IND, PCIC_EXT_DATA);
+ c = sp2->getb(sp2, PCIC_EXTENDED);
+ if (sp == sp2) { /* slot 1 */
+ if ((c & PCIC_VS1B) == 0)
+ slt->pwr.vcc = 33;
+ } else {
+ if ((c & PCIC_VS1A) == 0)
+ slt->pwr.vcc = 33;
+ }
+ break;
+ default:
+ /* I have no idea how do do this for others */
+ break;
+ }
/*
* Regardless of the above, setting the Auto Power Switch
@@ -757,7 +775,7 @@ pcic_reset(void *chan)
}
}
slt->insert_seq = 0;
- if (sp->controller == PCIC_PD672X || sp->controller == PCIC_PD6710) {
+ if (sp->controller == PCIC_PD6722 || sp->controller == PCIC_PD6710) {
sp->putb(sp, PCIC_TIME_SETUP0, 0x1);
sp->putb(sp, PCIC_TIME_CMD0, 0x6);
sp->putb(sp, PCIC_TIME_RECOV0, 0x0);
@@ -790,7 +808,7 @@ pcic_resume(struct slot *slt)
struct pcic_slot *sp = slt->cdata;
pcic_do_mgt_irq(sp, slt->irq);
- if (sp->controller == PCIC_PD672X) {
+ if (sp->controller == PCIC_PD6722) {
pcic_setb(sp, PCIC_MISC1, PCIC_MISC1_SPEAKER);
pcic_setb(sp, PCIC_MISC2, PCIC_LPDM_EN);
}
OpenPOWER on IntegriCloud