summaryrefslogtreecommitdiffstats
path: root/sys/dev/ahci/ahci.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/ahci/ahci.c')
-rw-r--r--sys/dev/ahci/ahci.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/sys/dev/ahci/ahci.c b/sys/dev/ahci/ahci.c
index 1295de7..5fabdaf 100644
--- a/sys/dev/ahci/ahci.c
+++ b/sys/dev/ahci/ahci.c
@@ -668,6 +668,21 @@ ahci_ch_attach(device_t dev)
if (!(ch->r_mem = bus_alloc_resource_any(dev, SYS_RES_MEMORY,
&rid, RF_ACTIVE)))
return (ENXIO);
+ ch->chcaps = ATA_INL(ch->r_mem, AHCI_P_CMD);
+ version = ATA_INL(ctlr->r_mem, AHCI_VS);
+ if (version < 0x00010200 && (ctlr->caps & AHCI_CAP_FBSS))
+ ch->chcaps |= AHCI_P_CMD_FBSCP;
+ if (ch->caps2 & AHCI_CAP2_SDS)
+ ch->chscaps = ATA_INL(ch->r_mem, AHCI_P_DEVSLP);
+ if (bootverbose) {
+ device_printf(dev, "Caps:%s%s%s%s%s%s\n",
+ (ch->chcaps & AHCI_P_CMD_HPCP) ? " HPCP":"",
+ (ch->chcaps & AHCI_P_CMD_MPSP) ? " MPSP":"",
+ (ch->chcaps & AHCI_P_CMD_CPD) ? " CPD":"",
+ (ch->chcaps & AHCI_P_CMD_ESP) ? " ESP":"",
+ (ch->chcaps & AHCI_P_CMD_FBSCP) ? " FBSCP":"",
+ (ch->chscaps & AHCI_P_DEVSLP_DSP) ? " DSP":"");
+ }
ahci_dmainit(dev);
ahci_slotsalloc(dev);
mtx_lock(&ch->mtx);
@@ -686,21 +701,6 @@ ahci_ch_attach(device_t dev)
error = ENXIO;
goto err1;
}
- ch->chcaps = ATA_INL(ch->r_mem, AHCI_P_CMD);
- version = ATA_INL(ctlr->r_mem, AHCI_VS);
- if (version < 0x00010200 && (ctlr->caps & AHCI_CAP_FBSS))
- ch->chcaps |= AHCI_P_CMD_FBSCP;
- if (ch->caps2 & AHCI_CAP2_SDS)
- ch->chscaps = ATA_INL(ch->r_mem, AHCI_P_DEVSLP);
- if (bootverbose) {
- device_printf(dev, "Caps:%s%s%s%s%s%s\n",
- (ch->chcaps & AHCI_P_CMD_HPCP) ? " HPCP":"",
- (ch->chcaps & AHCI_P_CMD_MPSP) ? " MPSP":"",
- (ch->chcaps & AHCI_P_CMD_CPD) ? " CPD":"",
- (ch->chcaps & AHCI_P_CMD_ESP) ? " ESP":"",
- (ch->chcaps & AHCI_P_CMD_FBSCP) ? " FBSCP":"",
- (ch->chscaps & AHCI_P_DEVSLP_DSP) ? " DSP":"");
- }
/* Create the device queue for our SIM. */
devq = cam_simq_alloc(ch->numslots);
if (devq == NULL) {
OpenPOWER on IntegriCloud