summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2013-03-04 09:21:36 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2013-03-04 09:21:36 +0100
commit4c246afad36e4f756162a551b9744d75e78c546f (patch)
treec24d033c656022abe9efc29de517ea971c6a4792 /drivers
parent0e1c864e8a3736f8e28e1783c569e5cc21aeeecf (diff)
parent5f337b5452eebe9369a322fc9f49ae1449f104b8 (diff)
downloadbarebox-4c246afad36e4f756162a551b9744d75e78c546f.tar.gz
barebox-4c246afad36e4f756162a551b9744d75e78c546f.tar.xz
Merge branch 'for-next/ahci'
Diffstat (limited to 'drivers')
-rw-r--r--drivers/ata/ahci.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
index 14de3c5061..2d6e42232f 100644
--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -385,14 +385,21 @@ static int ahci_init_port(struct ahci_port *ahci_port)
ahci_port_info(ahci_port, "Spinning up device...\n");
ret = wait_on_timeout(WAIT_SPINUP,
- (readl(port_mmio + PORT_TFDATA) &
- (ATA_STATUS_BUSY | ATA_STATUS_DRQ)) == 0);
+ ((readl(port_mmio + PORT_TFDATA) &
+ (ATA_STATUS_BUSY | ATA_STATUS_DRQ)) == 0)
+ || !((readl(port_mmio + PORT_SCR_STAT) & 0xf) == 1));
if (ret) {
ahci_port_info(ahci_port, "timeout.\n");
ret = -ENODEV;
goto err_init;
}
+ if ((readl(port_mmio + PORT_SCR_STAT) & 0xf) == 1) {
+ ahci_port_info(ahci_port, "down.\n");
+ ret = -ENODEV;
+ goto err_init;
+ }
+
ahci_port_info(ahci_port, "ok.\n");
val = ahci_port_read(ahci_port, PORT_SCR_ERR);
@@ -664,10 +671,19 @@ static int ahci_probe(struct device_d *dev)
return ret;
}
+static __maybe_unused struct of_device_id ahci_dt_ids[] = {
+ {
+ .compatible = "calxeda,hb-ahci",
+ }, {
+ /* sentinel */
+ }
+};
+
static struct driver_d ahci_driver = {
.name = "ahci",
.probe = ahci_probe,
.info = ahci_info,
+ .of_compatible = DRV_OF_COMPAT(ahci_dt_ids),
};
static int ahci_init(void)