summaryrefslogtreecommitdiffstats
path: root/drivers/block/ahci.c
diff options
context:
space:
mode:
authorRob Herring <rob.herring@calxeda.com>2013-08-24 10:10:50 -0500
committerTom Rini <trini@ti.com>2013-09-06 13:09:07 -0400
commit2bdb10dbf59f41ead73fb3fa69699de1b621f423 (patch)
tree3f736e8cbe7e0ce227dbd11c28f3028bf9280249 /drivers/block/ahci.c
parent796c2ebd6f17da605a05eb233c907e4d8330f751 (diff)
downloadtalos-obmc-uboot-2bdb10dbf59f41ead73fb3fa69699de1b621f423.tar.gz
talos-obmc-uboot-2bdb10dbf59f41ead73fb3fa69699de1b621f423.zip
ahci: add defines for PORT_SCR_STAT register bits
Replace hard-coded register values with proper defines for PORT_SCR_STAT register. Signed-off-by: Rob Herring <rob.herring@calxeda.com>
Diffstat (limited to 'drivers/block/ahci.c')
-rw-r--r--drivers/block/ahci.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/block/ahci.c b/drivers/block/ahci.c
index f08806348b..ad7e95fe08 100644
--- a/drivers/block/ahci.c
+++ b/drivers/block/ahci.c
@@ -207,7 +207,8 @@ static int ahci_host_init(struct ahci_probe_ent *probe_ent)
j = 0;
while (j < WAIT_MS_LINKUP) {
tmp = readl(port_mmio + PORT_SCR_STAT);
- if ((tmp & 0xf) == 0x3)
+ tmp &= PORT_SCR_STAT_DET_MASK;
+ if (tmp == PORT_SCR_STAT_DET_PHYRDY)
break;
udelay(1000);
j++;
@@ -258,7 +259,7 @@ static int ahci_host_init(struct ahci_probe_ent *probe_ent)
/* register linkup ports */
tmp = readl(port_mmio + PORT_SCR_STAT);
debug("SATA port %d status: 0x%x\n", i, tmp);
- if ((tmp & 0xf) == 0x03)
+ if ((tmp & PORT_SCR_STAT_DET_MASK) == PORT_SCR_STAT_DET_PHYRDY)
probe_ent->link_port_map |= (0x01 << i);
}
OpenPOWER on IntegriCloud