summaryrefslogtreecommitdiffstats
path: root/drivers/mci/mci-core.c
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2013-06-03 11:17:02 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2013-06-03 11:17:04 +0200
commitaf4e312929ce06e2020499d527dbb0a64b009656 (patch)
tree5dafbe70d810b86e92037e17c2d773f6573718a9 /drivers/mci/mci-core.c
parent2302fc6076879554aff61e8a5d33af6828d90c03 (diff)
downloadbarebox-af4e312929ce06e2020499d527dbb0a64b009656.tar.gz
barebox-af4e312929ce06e2020499d527dbb0a64b009656.tar.xz
mci: Print more info
In devinfo for the card also print: - capabilities for host and card - current bus width - current clock Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/mci/mci-core.c')
-rw-r--r--drivers/mci/mci-core.c28
1 files changed, 27 insertions, 1 deletions
diff --git a/drivers/mci/mci-core.c b/drivers/mci/mci-core.c
index fc921e5216..86600ec9ad 100644
--- a/drivers/mci/mci-core.c
+++ b/drivers/mci/mci-core.c
@@ -1366,6 +1366,16 @@ static unsigned extract_mtd_year(struct mci *mci)
return UNSTUFF_BITS(mci->cid, 8, 4) + 1997;
}
+static void mci_print_caps(unsigned caps)
+{
+ printf(" capabilities: %s%s%s%s%s\n",
+ caps & MMC_CAP_4_BIT_DATA ? "4bit " : "",
+ caps & MMC_CAP_8_BIT_DATA ? "8bit " : "",
+ caps & MMC_CAP_SD_HIGHSPEED ? "sd-hs " : "",
+ caps & MMC_CAP_MMC_HIGHSPEED ? "mmc-hs " : "",
+ caps & MMC_CAP_MMC_HIGHSPEED_52MHZ ? "mmc-52MHz " : "");
+}
+
/**
* Output some valuable information when the user runs 'devinfo' on an MCI device
* @param mci MCI device instance
@@ -1373,13 +1383,28 @@ static unsigned extract_mtd_year(struct mci *mci)
static void mci_info(struct device_d *dev)
{
struct mci *mci = container_of(dev, struct mci, dev);
+ struct mci_host *host = mci->host;
+ int bw;
if (mci->ready_for_use == 0) {
printf(" No information available:\n MCI card not probed yet\n");
return;
}
- printf(" Card:\n");
+ printf("Host information:\n");
+ printf(" current clock: %d\n", host->clock);
+
+ if (host->bus_width == MMC_BUS_WIDTH_8)
+ bw = 8;
+ else if (host->bus_width == MMC_BUS_WIDTH_4)
+ bw = 4;
+ else
+ bw = 1;
+
+ printf(" current buswidth: %d\n", bw);
+ mci_print_caps(host->host_caps);
+
+ printf("Card information:\n");
if (mci->version < SD_VERSION_SD) {
printf(" Attached is a MultiMediaCard (Version: %u.%u)\n",
(mci->version >> 4) & 0xf, mci->version & 0xf);
@@ -1396,6 +1421,7 @@ static void mci_info(struct device_d *dev)
printf(" CSD: %08X-%08X-%08X-%08X\n", mci->csd[0], mci->csd[1],
mci->csd[2], mci->csd[3]);
printf(" Max. transfer speed: %u Hz\n", mci->tran_speed);
+ mci_print_caps(mci->card_caps);
printf(" Manufacturer ID: %02X\n", extract_mid(mci));
printf(" OEM/Application ID: %04X\n", extract_oid(mci));
printf(" Product name: '%c%c%c%c%c'\n", mci->cid[0] & 0xff,