From 69ffb527317d292855e458f4a0485b3eefdd3709 Mon Sep 17 00:00:00 2001 From: Warner Losh Date: Mon, 21 May 2001 00:55:44 +0000 Subject: [PATCH] Two comments and one bug fix: o Add defines for the VS[12]# bits in register 0x16. o Add comment about what we're doing reading register 0x16 (PCIC_CDGC) in the DF case. o Check bit VS1# rather than a random bit I was checking due to a bogus transcrition on my part from nakagawa-san's article. o Add note about IBM KING and 3.3V operation from information larned from wildboard. --- sys/pccard/i82365.h | 2 ++ sys/pccard/pcic.c | 16 +++++++++++++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/sys/pccard/i82365.h b/sys/pccard/i82365.h index 060eec5baa4..d53aa692d5d 100644 --- a/sys/pccard/i82365.h +++ b/sys/pccard/i82365.h @@ -207,6 +207,8 @@ #define PCIC_GPI_TRANS 0x08 /* GPI Transition Control */ #define PCIC_CDRES_EN 0x10 /* card detect resume enable */ #define PCIC_SW_CD_INT 0x20 /* s/w card detect interrupt */ +#define PCIC_VS1STAT 0x40 /* 0 VS1# low, 1 VS1# high */ +#define PCIC_VS2STAT 0x80 /* 0 VS2# low, 1 VS2# high */ /* CL-PD67[12]x: For 3.3V cards, etc. (PCIC_MISC1) */ #define PCIC_MISC1_5V_DETECT 0x01 /* PD6710 only */ diff --git a/sys/pccard/pcic.c b/sys/pccard/pcic.c index 6a07b73367d..e3264ddc935 100644 --- a/sys/pccard/pcic.c +++ b/sys/pccard/pcic.c @@ -378,11 +378,13 @@ pcic_power(struct slot *slt) switch(sp->controller) { case PCIC_I82365SL_DF: /* - * Check to see if the power on bit is clear. If so, we're - * using the wrong voltage and should try 3.3V instead. + * Look at the VS[12]# bits on the card. If VS1 is clear + * then we should apply 3.3 volts. Maybe we should do this + * with other cards too. Cirrus logic cards (PD67[12]*) do + * things like this in a different way. */ c = sp->getb(sp, PCIC_CDGC); - if ((c & PCIC_POW) == 0) + if ((c & PCIC_VS1STAT) == 0) slt->pwr.vcc = 33; /* FALL THROUGH */ case PCIC_I82365: @@ -413,6 +415,14 @@ pcic_power(struct slot *slt) case 0: break; case 33: + /* + * The wildboar code has comments that state that + * the IBM KING controller doesn't support 3.3V + * on the "IBM Smart PC card drive". The code + * intemates that's the only place they have seen + * it used and that there's a boatload of issues + * with it. + */ if (sp->controller == PCIC_IBM_KING) { reg |= PCIC_VCC_5V_KING; break;