version 1.4, 2007/07/09 21:00:34 |
version 1.4.12.2, 2007/08/31 20:09:23 |
Line 39 __KERNEL_RCSID(0, "$NetBSD$"); |
|
Line 39 __KERNEL_RCSID(0, "$NetBSD$"); |
|
#include <sys/kernel.h> |
#include <sys/kernel.h> |
#include <sys/systm.h> |
#include <sys/systm.h> |
#include <sys/disklabel.h> |
#include <sys/disklabel.h> |
#include <sys/proc.h> |
|
|
|
#include <uvm/uvm_extern.h> |
#include <uvm/uvm_extern.h> |
|
|
Line 102 ahci_attach(struct ahci_softc *sc) |
|
Line 101 ahci_attach(struct ahci_softc *sc) |
|
bus_dma_segment_t seg; |
bus_dma_segment_t seg; |
int rseg; |
int rseg; |
int dmasize; |
int dmasize; |
void *cmdhp; |
caddr_t cmdhp; |
void *cmdtblp; |
caddr_t cmdtblp; |
|
|
/* reset controller */ |
/* reset controller */ |
AHCI_WRITE(sc, AHCI_GHC, AHCI_GHC_HR); |
AHCI_WRITE(sc, AHCI_GHC, AHCI_GHC_HR); |
Line 277 ahci_attach(struct ahci_softc *sc) |
|
Line 276 ahci_attach(struct ahci_softc *sc) |
|
goto end; |
goto end; |
} |
} |
} |
} |
AHCI_WRITE(sc, AHCI_P_CLB(i), achp->ahcic_bus_cmdh); |
AHCI_WRITE(sc, AHCI_P_CLB(port), achp->ahcic_bus_cmdh); |
AHCI_WRITE(sc, AHCI_P_CLBU(i), 0); |
AHCI_WRITE(sc, AHCI_P_CLBU(port), 0); |
AHCI_WRITE(sc, AHCI_P_FB(i), achp->ahcic_bus_rfis); |
AHCI_WRITE(sc, AHCI_P_FB(port), achp->ahcic_bus_rfis); |
AHCI_WRITE(sc, AHCI_P_FBU(i), 0); |
AHCI_WRITE(sc, AHCI_P_FBU(port), 0); |
chp->ch_ndrive = 1; |
chp->ch_ndrive = 1; |
if (bus_space_subregion(sc->sc_ahcit, sc->sc_ahcih, |
if (bus_space_subregion(sc->sc_ahcit, sc->sc_ahcih, |
AHCI_P_SSTS(i), 1, &achp->ahcic_sstatus) != 0) { |
AHCI_P_SSTS(i), 1, &achp->ahcic_sstatus) != 0) { |
Line 741 ahci_cmd_done(struct ata_channel *chp, s |
|
Line 740 ahci_cmd_done(struct ata_channel *chp, s |
|
bus_dmamap_unload(sc->sc_dmat, achp->ahcic_datad[slot]); |
bus_dmamap_unload(sc->sc_dmat, achp->ahcic_datad[slot]); |
} |
} |
|
|
AHCI_CMDH_SYNC(sc, achp, slot, |
|
BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); |
|
|
|
ata_c->flags |= AT_DONE; |
ata_c->flags |= AT_DONE; |
if (achp->ahcic_cmdh[slot].cmdh_prdbc) |
if (achp->ahcic_cmdh[slot].cmdh_prdbc) |
ata_c->flags |= AT_XFDONE; |
ata_c->flags |= AT_XFDONE; |
Line 856 ahci_bio_start(struct ata_channel *chp, |
|
Line 852 ahci_bio_start(struct ata_channel *chp, |
|
((ata_bio->flags & ATA_READ) ? 0 : AHCI_CMDH_F_WR) | |
((ata_bio->flags & ATA_READ) ? 0 : AHCI_CMDH_F_WR) | |
20 /* fis lenght */ / 4); |
20 /* fis lenght */ / 4); |
cmd_h->cmdh_prdbc = 0; |
cmd_h->cmdh_prdbc = 0; |
AHCI_CMDH_SYNC(sc, achp, slot, |
AHCI_CMDH_SYNC(sc, achp, slot, BUS_DMASYNC_PREWRITE); |
BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); |
|
|
|
if (xfer->c_flags & C_POLL) { |
if (xfer->c_flags & C_POLL) { |
/* polled command, disable interrupts */ |
/* polled command, disable interrupts */ |