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
This commit is contained in:
parent
ee6e1fc380
commit
81aad9b606
@ -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);
|
||||
@ -382,9 +373,20 @@ pcic_pci_probe(device_t dev)
|
||||
return (ENXIO);
|
||||
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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user