From 93128f58b06b3185bc8c3bfa3328a344db298ef5 Mon Sep 17 00:00:00 2001 From: imp Date: Mon, 4 Jun 2001 17:14:28 +0000 Subject: 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 --- sys/pccard/pcic_pci.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'sys/pccard/pcic_pci.c') 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); -- cgit v1.1