summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorStefan Reinauer <reinauer@chromium.org>2012-01-24 16:47:45 -0800
committerGerrit <chrome-bot@google.com>2012-01-25 15:06:01 -0800
commite5a2e1d512074b91ac35c6d06262e756e8e66e10 (patch)
tree6145c64d6ce3361317747484e0acb61a1736a6aa /drivers
parentcf11fae2e4367bd2287b063217321efd10c5f189 (diff)
AHCI: cosmetics and cleanup
- print the correct speed - print all the AHCI capability flags (information taken from Linux kernel driver) - clean up some comments Signed-off-by: Stefan Reinauer <reinauer@google.com> BUG=chrome-os-partner:7714 TEST=See the following string in bios_log: AHCI 0001.0300 32 slots 6 ports 6 Gbps 0x3 impl SATA mode Change-Id: Ib32dbeddd0714359948e2bec033b2ec7aabbdb10 Reviewed-on: https://gerrit.chromium.org/gerrit/14754 Tested-by: Stefan Reinauer <reinauer@chromium.org> Reviewed-by: Duncan Laurie <dlaurie@chromium.org> Commit-Ready: Stefan Reinauer <reinauer@chromium.org> Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/block/ahci.c25
1 files changed, 18 insertions, 7 deletions
diff --git a/drivers/block/ahci.c b/drivers/block/ahci.c
index f637c8f6b1..af33cab700 100644
--- a/drivers/block/ahci.c
+++ b/drivers/block/ahci.c
@@ -187,7 +187,7 @@ static int ahci_host_init(struct ahci_probe_ent *probe_ent)
/* set irq mask (enables interrupts) */
writel(DEF_PORT_IRQ, port_mmio + PORT_IRQ_MASK);
- /*register linkup ports */
+ /* register linkup ports */
tmp = readl(port_mmio + PORT_SCR_STAT);
debug("Port %d status: 0x%x\n", i, tmp);
if ((tmp & 0xf) == 0x03)
@@ -212,13 +212,14 @@ static void ahci_print_info(struct ahci_probe_ent *probe_ent)
{
pci_dev_t pdev = probe_ent->dev;
volatile u8 *mmio = (volatile u8 *)probe_ent->mmio_base;
- u32 vers, cap, impl, speed;
+ u32 vers, cap, cap2, impl, speed;
const char *speed_s;
u16 cc;
const char *scc_s;
vers = readl(mmio + HOST_VERSION);
cap = probe_ent->cap;
+ cap2 = readl(mmio + HOST_CAP2);
impl = probe_ent->port_map;
speed = (cap >> 20) & 0xf;
@@ -226,6 +227,8 @@ static void ahci_print_info(struct ahci_probe_ent *probe_ent)
speed_s = "1.5";
else if (speed == 2)
speed_s = "3";
+ else if (speed == 3)
+ speed_s = "6";
else
speed_s = "?";
@@ -248,8 +251,9 @@ static void ahci_print_info(struct ahci_probe_ent *probe_ent)
((cap >> 8) & 0x1f) + 1, (cap & 0x1f) + 1, speed_s, impl, scc_s);
printf("flags: "
- "%s%s%s%s%s%s"
- "%s%s%s%s%s%s%s\n",
+ "%s%s%s%s%s%s%s"
+ "%s%s%s%s%s%s%s"
+ "%s%s%s%s%s%s\n",
cap & (1 << 31) ? "64bit " : "",
cap & (1 << 30) ? "ncq " : "",
cap & (1 << 28) ? "ilck " : "",
@@ -260,9 +264,16 @@ static void ahci_print_info(struct ahci_probe_ent *probe_ent)
cap & (1 << 19) ? "nz " : "",
cap & (1 << 18) ? "only " : "",
cap & (1 << 17) ? "pmp " : "",
+ cap & (1 << 16) ? "fbss " : "",
cap & (1 << 15) ? "pio " : "",
cap & (1 << 14) ? "slum " : "",
- cap & (1 << 13) ? "part " : "");
+ cap & (1 << 13) ? "part " : "",
+ cap & (1 << 7) ? "ccc " : "",
+ cap & (1 << 6) ? "ems " : "",
+ cap & (1 << 5) ? "sxs " : "",
+ cap2 & (1 << 2) ? "apst " : "",
+ cap2 & (1 << 1) ? "nvmp " : "",
+ cap2 & (1 << 0) ? "boh " : "");
}
static int ahci_init_one(pci_dev_t pdev)
@@ -356,7 +367,7 @@ static void ahci_set_feature(u8 port)
u32 cmd_fis_len = 5; /* five dwords */
u8 fis[20];
- /*set feature */
+ /* set feature */
memset(fis, 0, 20);
fis[0] = 0x27;
fis[1] = 1 << 7;
@@ -370,7 +381,7 @@ static void ahci_set_feature(u8 port)
readl(port_mmio + PORT_CMD_ISSUE);
if (waiting_for_cmd_completed(port_mmio + PORT_CMD_ISSUE, 150, 0x1)) {
- printf("set feature error!\n");
+ printf("set feature error on port %d!\n", port);
}
}