Fix a bug with the 3.3V code for the ricoh bridges.  I got the bit
detect backwards.  Also, we can only detect 3.3V cards when the GPI
interrupt is disabled.  So when it is enabled assume 5.0V card.

Obtained from: NetBSD (takemura-san from patches by ngc@ff.iij4u.or.jp)
Approved by: re (blanket)
This commit is contained in:
Warner Losh 2002-11-27 06:04:49 +00:00
parent fef82663b8
commit 53662117cc
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=107298

View File

@ -664,7 +664,7 @@ pcic_cardbus_power(struct pcic_slot *sp, struct slot *slt)
static int
pcic_power(struct slot *slt)
{
unsigned char c;
unsigned char c, c2;
unsigned char reg = PCIC_DISRST | PCIC_PCPWRE;
struct pcic_slot *sp = slt->cdata;
struct pcic_slot *sp2;
@ -760,22 +760,20 @@ pcic_power(struct slot *slt)
reg |= PCIC_APSENA;
}
if (sc->flags & PCIC_RICOH_POWER) {
switch (sp->controller) {
case PCIC_RF5C396:
case PCIC_RF5C296:
/*
* The ISA bridge have the 5V/3.3V in register
* 1, bit 7.
*/
c = sp->getb(sp, PCIC_STATUS);
if ((c & PCIC_RICOH_5VCARD) == 0)
slt->pwr.vcc = 33;
else
slt->pwr.vcc = 50;
break;
}
/*
* The ISA bridge have the 5V/3.3V in register
* 1, bit 7. However, 3.3V cards can only be
* detected if GPI_EN is disabled.
*/
c = sp->getb(sp, PCIC_STATUS);
c2 = sp->getb(sp, PCIC_CDGC);
if ((c & PCIC_RICOH_5VCARD) && (c2 & PCIC_GPI_EN) == 0)
slt->pwr.vcc = 33;
else
slt->pwr.vcc = 50;
}
/* Other bridges here */
/* Other power schemes here */
if (bootverbose && slt->pwr.vcc != -1)
device_printf(sc->dev, "Autodetected %d.%dV card\n",
slt->pwr.vcc / 10, slt->pwr.vcc %10);