diff options
author | imp <imp@FreeBSD.org> | 2001-06-04 17:14:28 +0000 |
---|---|---|
committer | imp <imp@FreeBSD.org> | 2001-06-04 17:14:28 +0000 |
commit | 93128f58b06b3185bc8c3bfa3328a344db298ef5 (patch) | |
tree | 3dd03c13abcf48cf21c3d51f77ba5e1fb50d8598 | |
parent | 2e89259fa7499525d5a3514d347a8d9bfec4bf9a (diff) | |
download | FreeBSD-src-93128f58b06b3185bc8c3bfa3328a344db298ef5.zip FreeBSD-src-93128f58b06b3185bc8c3bfa3328a344db298ef5.tar.gz |
If the chip isn't in power state D0, put it in power state D0. I
elected to do this in the probe rather than the attach so that we don't
disturb things which this might reset. different cards have different
quirks, according to their datasheets.
This should fix the "I booted in windows and rebooted to FreeBSD and
now things don't work" problem.
PR: 4847, 20670
-rw-r--r-- | sys/pccard/pcic_pci.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/sys/pccard/pcic_pci.c b/sys/pccard/pcic_pci.c index cd5912e..5076b4c 100644 --- a/sys/pccard/pcic_pci.c +++ b/sys/pccard/pcic_pci.c @@ -310,17 +310,8 @@ pcic_cd_event(void *arg) u_int32_t stat; stat = bus_space_read_4(sp->bst, sp->bsh, CB_SOCKET_STATE); - printf("State is %x\n", stat); - if (stat & CB_SS_5VCARD) - device_printf(sp->sc->dev, "5V card\n"); - if (stat & CB_SS_3VCARD) - device_printf(sp->sc->dev, "3V card\n"); - if (stat & CB_SS_CD) - device_printf(sp->sc->dev, "CD %x", - stat & CB_SS_CD); if ((stat & CB_SS_16BIT) == 0) { - device_printf(sp->sc->dev, - "Cardbus card inserted. NOT SUPPORTED\n"); + device_printf(sp->sc->dev, "Unsupported card type inserted\n"); } else { if (stat & CB_SS_CD) pccard_event(sp->slt, card_removed); @@ -383,8 +374,19 @@ pcic_pci_probe(device_t dev) device_set_desc(dev, desc); /* + * Take us out of power down mode. + */ + if (pci_get_powerstate(dev) != PCI_POWERSTATE_D0) { + /* Reset the power state. */ + device_printf(dev, "chip is in D%d power mode " + "-- setting to D0\n", pci_get_powerstate(dev)); + pci_set_powerstate(dev, PCI_POWERSTATE_D0); + } + + /* * Allocated/deallocate interrupt. This forces the PCI BIOS or * other MD method to route the interrupts to this card. + * This so we get the interrupt number in the probe message. */ rid = 0; res = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, 0, ~0, 1, RF_ACTIVE); |