diff options
-rw-r--r-- | sys/dev/ic/ahci.c | 22 | ||||
-rw-r--r-- | sys/include/dev/ic/ahciregs.h | 2 |
2 files changed, 9 insertions, 15 deletions
diff --git a/sys/dev/ic/ahci.c b/sys/dev/ic/ahci.c index b713711..d4c10c7 100644 --- a/sys/dev/ic/ahci.c +++ b/sys/dev/ic/ahci.c @@ -760,27 +760,19 @@ ahci_init_port(struct ahci_hba *hba, uint32_t portno) struct hba_device *dp; struct ctlfs_dev dev; size_t clen, pagesz; - uint32_t lo, hi, ssts; - uint8_t det; + uint32_t lo, hi, sig; paddr_t fra, cmdlist, tmp; int error; pagesz = DEFAULT_PAGESIZE; port = &abar->ports[portno]; - /* Is anything on the port? */ - ssts = mmio_read32(&port->ssts); - det = AHCI_PXSCTL_DET(ssts); - switch (det) { - case AHCI_DET_NULL: - /* No device attached */ - return 0; - case AHCI_DET_PRESENT: - if ((error = hba_port_reset(hba, port)) < 0) { - pr_trace("failed to reset port %d\n", portno); - return error; - } - break; + if ((error = hba_port_reset(hba, port)) < 0) { + return error; + } + sig = mmio_read32(&port->sig); + if (sig == ATAPI_SIG) { + return -ENOTSUP; } pr_trace("found device @ port %d\n", portno); diff --git a/sys/include/dev/ic/ahciregs.h b/sys/include/dev/ic/ahciregs.h index 129ac76..232b41e 100644 --- a/sys/include/dev/ic/ahciregs.h +++ b/sys/include/dev/ic/ahciregs.h @@ -163,6 +163,8 @@ struct hba_memspace { #define AHCI_DIAG_T BIT(24) /* Transport state transition error */ #define AHCI_DIAG_F BIT(25) /* Unknown FIS type */ +#define ATAPI_SIG 0xEB140101 + /* * Device detection initialization values * See section 3.3.11 of the AHCI spec. |