Commit 2bdb10db authored by Rob Herring's avatar Rob Herring Committed by Tom Rini
Browse files

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: default avatarRob Herring <rob.herring@calxeda.com>
parent 796c2ebd
...@@ -207,7 +207,8 @@ static int ahci_host_init(struct ahci_probe_ent *probe_ent) ...@@ -207,7 +207,8 @@ static int ahci_host_init(struct ahci_probe_ent *probe_ent)
j = 0; j = 0;
while (j < WAIT_MS_LINKUP) { while (j < WAIT_MS_LINKUP) {
tmp = readl(port_mmio + PORT_SCR_STAT); 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; break;
udelay(1000); udelay(1000);
j++; j++;
...@@ -258,7 +259,7 @@ static int ahci_host_init(struct ahci_probe_ent *probe_ent) ...@@ -258,7 +259,7 @@ static int ahci_host_init(struct ahci_probe_ent *probe_ent)
/* register linkup ports */ /* register linkup ports */
tmp = readl(port_mmio + PORT_SCR_STAT); tmp = readl(port_mmio + PORT_SCR_STAT);
debug("SATA port %d status: 0x%x\n", i, tmp); 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); probe_ent->link_port_map |= (0x01 << i);
} }
......
...@@ -87,6 +87,11 @@ ...@@ -87,6 +87,11 @@
| PORT_IRQ_DMAS_FIS | PORT_IRQ_PIOS_FIS \ | PORT_IRQ_DMAS_FIS | PORT_IRQ_PIOS_FIS \
| PORT_IRQ_D2H_REG_FIS | PORT_IRQ_D2H_REG_FIS
/* PORT_SCR_STAT bits */
#define PORT_SCR_STAT_DET_MASK 0x3
#define PORT_SCR_STAT_DET_COMINIT 0x1
#define PORT_SCR_STAT_DET_PHYRDY 0x3
/* PORT_CMD bits */ /* PORT_CMD bits */
#define PORT_CMD_ATAPI (1 << 24) /* Device is ATAPI */ #define PORT_CMD_ATAPI (1 << 24) /* Device is ATAPI */
#define PORT_CMD_LIST_ON (1 << 15) /* cmd list DMA engine running */ #define PORT_CMD_LIST_ON (1 << 15) /* cmd list DMA engine running */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment