summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Herring <rob.herring@calxeda.com>2013-08-24 10:10:52 -0500
committerTom Rini <trini@ti.com>2013-09-06 13:09:07 -0400
commit178210847f7d8492c6aa1d39867d99538be0e7d4 (patch)
treec369bf725c306fa4e9156b73fa73d10725cf2b27
parent124e9fa132338c32409bd556c9c0a47a2bb70cc2 (diff)
downloadu-boot-imx-178210847f7d8492c6aa1d39867d99538be0e7d4.zip
u-boot-imx-178210847f7d8492c6aa1d39867d99538be0e7d4.tar.gz
u-boot-imx-178210847f7d8492c6aa1d39867d99538be0e7d4.tar.bz2
ahci: handle COMINIT received during spin-up
Some Intel SSDs can send a COMINIT after the initial COMRESET. This causes the link to go down and we need to re-initialize the link. Signed-off-by: Rob Herring <rob.herring@calxeda.com>
-rw-r--r--drivers/block/ahci.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/block/ahci.c b/drivers/block/ahci.c
index 5e7d01b..a7044f2 100644
--- a/drivers/block/ahci.c
+++ b/drivers/block/ahci.c
@@ -243,8 +243,20 @@ static int ahci_host_init(struct ahci_probe_ent *probe_ent)
if (!(tmp & (ATA_STAT_BUSY | ATA_STAT_DRQ)))
break;
udelay(1000);
+ tmp = readl(port_mmio + PORT_SCR_STAT);
+ tmp &= PORT_SCR_STAT_DET_MASK;
+ if (tmp == PORT_SCR_STAT_DET_PHYRDY)
+ break;
j++;
}
+
+ tmp = readl(port_mmio + PORT_SCR_STAT) & PORT_SCR_STAT_DET_MASK;
+ if (tmp == PORT_SCR_STAT_DET_COMINIT) {
+ debug("SATA link %d down (COMINIT received), retrying...\n", i);
+ i--;
+ continue;
+ }
+
printf("Target spinup took %d ms.\n", j);
if (j == WAIT_MS_SPINUP)
debug("timeout.\n");