version 1.22, 2009/11/21 23:47:01 |
version 1.23, 2010/02/23 21:38:36 |
Line 507 ahci_reset_channel(struct ata_channel *c |
|
Line 507 ahci_reset_channel(struct ata_channel *c |
|
chp->ch_queue->active_xfer->c_kill_xfer(chp, |
chp->ch_queue->active_xfer->c_kill_xfer(chp, |
chp->ch_queue->active_xfer, KILL_RESET); |
chp->ch_queue->active_xfer, KILL_RESET); |
} |
} |
ahci_channel_start(sc, chp); |
|
/* wait 31s for BSY to clear */ |
/* wait 31s for BSY to clear */ |
for (i = 0; i <3100; i++) { |
for (i = 0; i <3100; i++) { |
tfd = AHCI_READ(sc, AHCI_P_TFD(chp->ch_channel)); |
tfd = AHCI_READ(sc, AHCI_P_TFD(chp->ch_channel)); |
Line 523 ahci_reset_channel(struct ata_channel *c |
|
Line 522 ahci_reset_channel(struct ata_channel *c |
|
DEBUG_PROBE); |
DEBUG_PROBE); |
/* clear port interrupt register */ |
/* clear port interrupt register */ |
AHCI_WRITE(sc, AHCI_P_IS(chp->ch_channel), 0xffffffff); |
AHCI_WRITE(sc, AHCI_P_IS(chp->ch_channel), 0xffffffff); |
|
/* and start channel */ |
|
ahci_channel_start(sc, chp); |
|
|
return; |
return; |
} |
} |
Line 567 ahci_probe_drive(struct ata_channel *chp |
|
Line 568 ahci_probe_drive(struct ata_channel *chp |
|
switch (sata_reset_interface(chp, sc->sc_ahcit, achp->ahcic_scontrol, |
switch (sata_reset_interface(chp, sc->sc_ahcit, achp->ahcic_scontrol, |
achp->ahcic_sstatus)) { |
achp->ahcic_sstatus)) { |
case SStatus_DET_DEV: |
case SStatus_DET_DEV: |
/* clear SErrors and start operations */ |
|
ahci_channel_start(sc, chp); |
|
/* wait 31s for BSY to clear */ |
/* wait 31s for BSY to clear */ |
for (i = 0; i <3100; i++) { |
for (i = 0; i <3100; i++) { |
sig = AHCI_READ(sc, AHCI_P_TFD(chp->ch_channel)); |
sig = AHCI_READ(sc, AHCI_P_TFD(chp->ch_channel)); |
Line 577 ahci_probe_drive(struct ata_channel *chp |
|
Line 576 ahci_probe_drive(struct ata_channel *chp |
|
break; |
break; |
tsleep(&sc, PRIBIO, "ahcid2h", mstohz(10)); |
tsleep(&sc, PRIBIO, "ahcid2h", mstohz(10)); |
} |
} |
if (i == 1500) |
if (i == 1500) { |
aprint_error("%s: BSY never cleared, TD 0x%x\n", |
aprint_error("%s: BSY never cleared, TD 0x%x\n", |
AHCINAME(sc), sig); |
AHCINAME(sc), sig); |
|
return; |
|
} |
AHCIDEBUG_PRINT(("%s: BSY took %d ms\n", AHCINAME(sc), i * 10), |
AHCIDEBUG_PRINT(("%s: BSY took %d ms\n", AHCINAME(sc), i * 10), |
DEBUG_PROBE); |
DEBUG_PROBE); |
sig = AHCI_READ(sc, AHCI_P_SIG(chp->ch_channel)); |
sig = AHCI_READ(sc, AHCI_P_SIG(chp->ch_channel)); |
Line 596 ahci_probe_drive(struct ata_channel *chp |
|
Line 597 ahci_probe_drive(struct ata_channel *chp |
|
} else |
} else |
chp->ch_drive[0].drive_flags |= DRIVE_ATA; |
chp->ch_drive[0].drive_flags |= DRIVE_ATA; |
splx(s); |
splx(s); |
/* enable interrupts */ |
/* clear port interrupt register */ |
|
AHCI_WRITE(sc, AHCI_P_IS(chp->ch_channel), 0xffffffff); |
|
/* start channel */ |
|
ahci_channel_start(sc, chp); |
|
/* and enable interrupts */ |
AHCI_WRITE(sc, AHCI_P_IE(chp->ch_channel), |
AHCI_WRITE(sc, AHCI_P_IE(chp->ch_channel), |
AHCI_P_IX_TFES | AHCI_P_IX_HBFS | AHCI_P_IX_IFS | |
AHCI_P_IX_TFES | AHCI_P_IX_HBFS | AHCI_P_IX_IFS | |
AHCI_P_IX_OFS | AHCI_P_IX_DPS | AHCI_P_IX_UFS | |
AHCI_P_IX_OFS | AHCI_P_IX_DPS | AHCI_P_IX_UFS | |