summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorStefan Reinauer <reinauer@chromium.org>2012-01-25 16:13:09 -0800
committerStefan Reinauer <reinauer@chromium.org>2012-01-25 16:24:52 -0800
commit051212846b8f5fb768db800ad1b7ee8ae60cc7af (patch)
tree3e55d09609ccc10d39e7d755f2cea23791e1dca9 /drivers
parente5a2e1d512074b91ac35c6d06262e756e8e66e10 (diff)
Improve AHCI debugging
- remove unused ssleep macro - add some useful debugging information Signed-off-by: Stefan Reinauer <reinauer@google.com> BUG=none TEST=boot latest firmware on stumpy, no functional change. Change-Id: Ieef3c199225b8c1aa979dfebf8a6f2178d5aa316 Reviewed-on: https://gerrit.chromium.org/gerrit/14836 Reviewed-by: Vadim Bendebury <vbendeb@chromium.org> Tested-by: Stefan Reinauer <reinauer@chromium.org> Commit-Ready: Stefan Reinauer <reinauer@chromium.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/block/ahci.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/block/ahci.c b/drivers/block/ahci.c
index af33cab700..4afdc76e88 100644
--- a/drivers/block/ahci.c
+++ b/drivers/block/ahci.c
@@ -69,7 +69,6 @@ static void ahci_setup_port(struct ahci_ioports *port, unsigned long base,
#define msleep(a) udelay(a * 1000)
-#define ssleep(a) msleep(a * 1000)
static int waiting_for_cmd_completed(volatile u8 *offset,
int timeout_msec,
@@ -151,6 +150,7 @@ static int ahci_host_init(struct ahci_probe_ent *probe_ent)
tmp = readl(port_mmio + PORT_CMD);
if (tmp & (PORT_CMD_LIST_ON | PORT_CMD_FIS_ON |
PORT_CMD_FIS_RX | PORT_CMD_START)) {
+ debug("Port %d is active. Deactivating.\n", i);
tmp &= ~(PORT_CMD_LIST_ON | PORT_CMD_FIS_ON |
PORT_CMD_FIS_RX | PORT_CMD_START);
writel_with_flush(tmp, port_mmio + PORT_CMD);
@@ -161,16 +161,21 @@ static int ahci_host_init(struct ahci_probe_ent *probe_ent)
msleep(500);
}
+ debug("Spinning up port %d... ", i);
writel(PORT_CMD_SPIN_UP, port_mmio + PORT_CMD);
j = 0;
- while (j < 100) {
- msleep(10);
+ while (j < 1000) {
+ msleep(1);
tmp = readl(port_mmio + PORT_SCR_STAT);
if ((tmp & 0xf) == 0x3)
break;
j++;
}
+ if (j == 1000)
+ debug("timeout.\n");
+ else
+ debug("ok.\n");
tmp = readl(port_mmio + PORT_SCR_ERR);
debug("PORT_SCR_ERR 0x%x\n", tmp);