Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/sdmmc print some useful information at attach time



details:   https://anonhg.NetBSD.org/src/rev/34961bf7fb84
branches:  trunk
changeset: 808069:34961bf7fb84
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Sun May 03 22:37:27 2015 +0000

description:
print some useful information at attach time

diffstat:

 sys/dev/sdmmc/sdhc.c |  27 +++++++++++++++++----------
 1 files changed, 17 insertions(+), 10 deletions(-)

diffs (96 lines):

diff -r 0960944bc3b8 -r 34961bf7fb84 sys/dev/sdmmc/sdhc.c
--- a/sys/dev/sdmmc/sdhc.c      Sun May 03 21:59:23 2015 +0000
+++ b/sys/dev/sdmmc/sdhc.c      Sun May 03 22:37:27 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sdhc.c,v 1.57 2015/05/03 11:46:25 jmcneill Exp $       */
+/*     $NetBSD: sdhc.c,v 1.58 2015/05/03 22:37:27 jmcneill Exp $       */
 /*     $OpenBSD: sdhc.c,v 1.25 2009/01/13 19:44:20 grange Exp $        */
 
 /*
@@ -23,7 +23,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sdhc.c,v 1.57 2015/05/03 11:46:25 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sdhc.c,v 1.58 2015/05/03 22:37:27 jmcneill Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_sdmmc.h"
@@ -274,7 +274,7 @@
        } else {
                sdhcver = HREAD2(hp, SDHC_HOST_CTL_VERSION);
        }
-       aprint_normal_dev(sc->sc_dev, "SD Host Specification ");
+       aprint_normal_dev(sc->sc_dev, "SDHC ");
        hp->specver = SDHC_SPEC_VERSION(sdhcver);
        switch (SDHC_SPEC_VERSION(sdhcver)) {
        case SDHC_SPEC_VERS_100:
@@ -298,7 +298,7 @@
                    SDHC_SPEC_VERSION(sdhcver));
                break;
        }
-       aprint_normal(", rev.%u\n", SDHC_VENDOR_VERSION(sdhcver));
+       aprint_normal(", rev %u", SDHC_VENDOR_VERSION(sdhcver));
 
        /*
         * Reset the host controller and enable interrupts.
@@ -327,7 +327,9 @@
                    ISSET(sc->sc_flags, SDHC_FLAG_EXTDMA_DMAEN))
                        SET(hp->flags, SHF_MODE_DMAEN);
 
-               aprint_normal_dev(sc->sc_dev, "using DMA transfer\n");
+               aprint_normal(", DMA");
+       } else {
+               aprint_normal(", PIO");
        }
 
        /*
@@ -355,8 +357,7 @@
                    hp->clkbase / 1000);
                goto err;
        }
-       DPRINTF(1,("%s: base clock frequency %u MHz\n",
-           device_xname(sc->sc_dev), hp->clkbase / 1000));
+       aprint_normal(", %u kHz", hp->clkbase);
 
        /*
         * XXX Set the data timeout counter value according to
@@ -368,19 +369,26 @@
                HWRITE4(hp, SDHC_NINTR_STATUS, SDHC_CMD_TIMEOUT_ERROR << 16);
 #endif
 
+       if (ISSET(caps, SDHC_EMBEDDED_SLOT))
+               aprint_normal(", embedded slot");
+
        /*
         * Determine SD bus voltage levels supported by the controller.
         */
+       aprint_normal(",");
        if (ISSET(caps, SDHC_VOLTAGE_SUPP_1_8V) &&
            (hp->specver < SDHC_SPEC_VERS_300 ||
             ISSET(caps, SDHC_EMBEDDED_SLOT))) {
                SET(hp->ocr, MMC_OCR_1_7V_1_8V | MMC_OCR_1_8V_1_9V);
+               aprint_normal(" 1.8V");
        }
        if (ISSET(caps, SDHC_VOLTAGE_SUPP_3_0V)) {
                SET(hp->ocr, MMC_OCR_2_9V_3_0V | MMC_OCR_3_0V_3_1V);
+               aprint_normal(" 3.0V");
        }
        if (ISSET(caps, SDHC_VOLTAGE_SUPP_3_3V)) {
                SET(hp->ocr, MMC_OCR_3_2V_3_3V | MMC_OCR_3_3V_3_4V);
+               aprint_normal(" 3.3V");
        }
 
        /*
@@ -408,9 +416,8 @@
                aprint_error_dev(sc->sc_dev, "max block length unknown\n");
                goto err;
        }
-       DPRINTF(1, ("%s: max block length %u byte%s\n",
-           device_xname(sc->sc_dev), hp->maxblklen,
-           hp->maxblklen > 1 ? "s" : ""));
+       aprint_normal(", %u byte blocks", hp->maxblklen);
+       aprint_normal("\n");
 
        /*
         * Attach the generic SD/MMC bus driver.  (The bus driver must



Home | Main Index | Thread Index | Old Index