Source-Changes-HG archive

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

[src/netbsd-8]: src/sys/dev/sdmmc Pull up following revision(s) (requested by...



details:   https://anonhg.NetBSD.org/src/rev/73fe20fbd31d
branches:  netbsd-8
changeset: 434529:73fe20fbd31d
user:      snj <snj%NetBSD.org@localhost>
date:      Sun Jan 07 09:24:59 2018 +0000

description:
Pull up following revision(s) (requested by ryo in ticket #468):
        sys/dev/sdmmc/sdhcreg.h: revision 1.19
        sys/dev/sdmmc/sdhc.c: revision 1.101
fix problem for ESDHC/USDHC due to change of r1.96
on ESDHC/USDHC, even if the iosize is less than SDHC_HOST_CTL_VERSION,
specver must be an appropriate value.

diffstat:

 sys/dev/sdmmc/sdhc.c    |  71 ++++++++++++++++++++++++------------------------
 sys/dev/sdmmc/sdhcreg.h |   3 +-
 2 files changed, 37 insertions(+), 37 deletions(-)

diffs (111 lines):

diff -r ab2109d1e612 -r 73fe20fbd31d sys/dev/sdmmc/sdhc.c
--- a/sys/dev/sdmmc/sdhc.c      Sun Jan 07 09:22:38 2018 +0000
+++ b/sys/dev/sdmmc/sdhc.c      Sun Jan 07 09:24:59 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sdhc.c,v 1.100 2017/04/22 21:49:41 jmcneill Exp $      */
+/*     $NetBSD: sdhc.c,v 1.100.4.1 2018/01/07 09:24:59 snj 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.100 2017/04/22 21:49:41 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sdhc.c,v 1.100.4.1 2018/01/07 09:24:59 snj Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_sdmmc.h"
@@ -292,42 +292,41 @@
        callout_init(&hp->tuning_timer, CALLOUT_MPSAFE);
        callout_setfunc(&hp->tuning_timer, sdhc_tuning_timer, hp);
 
-       if (iosize <= SDHC_HOST_CTL_VERSION) {
-               aprint_normal_dev(sc->sc_dev, "SDHC NO-VERS");
-               hp->specver = -1;
+       if (ISSET(hp->sc->sc_flags, SDHC_FLAG_USDHC)) {
+               sdhcver = SDHC_SPEC_VERS_300 << SDHC_SPEC_VERS_SHIFT;
+       } else if (ISSET(hp->sc->sc_flags, SDHC_FLAG_ENHANCED)) {
+               sdhcver = HREAD4(hp, SDHC_ESDHC_HOST_CTL_VERSION);
+       } else if (iosize <= SDHC_HOST_CTL_VERSION) {
+               sdhcver = SDHC_SPEC_NOVERS << SDHC_SPEC_VERS_SHIFT;
        } else {
-               if (ISSET(hp->sc->sc_flags, SDHC_FLAG_USDHC)) {
-                       sdhcver = SDHC_SPEC_VERS_300 << SDHC_SPEC_VERS_SHIFT;
-               } else if (ISSET(hp->sc->sc_flags, SDHC_FLAG_ENHANCED)) {
-                       sdhcver = HREAD4(hp, SDHC_ESDHC_HOST_CTL_VERSION);
-               } else
-                       sdhcver = HREAD2(hp, SDHC_HOST_CTL_VERSION);
-               aprint_normal_dev(sc->sc_dev, "SDHC ");
-               hp->specver = SDHC_SPEC_VERSION(sdhcver);
-               switch (SDHC_SPEC_VERSION(sdhcver)) {
-               case SDHC_SPEC_VERS_100:
-                       aprint_normal("1.0");
-                       break;
-
-               case SDHC_SPEC_VERS_200:
-                       aprint_normal("2.0");
-                       break;
-
-               case SDHC_SPEC_VERS_300:
-                       aprint_normal("3.0");
-                       break;
-
-               case SDHC_SPEC_VERS_400:
-                       aprint_normal("4.0");
-                       break;
-
-               default:
-                       aprint_normal("unknown version(0x%x)",
-                           SDHC_SPEC_VERSION(sdhcver));
-                       break;
-               }
+               sdhcver = HREAD2(hp, SDHC_HOST_CTL_VERSION);
+       }
+       aprint_normal_dev(sc->sc_dev, "SDHC ");
+       hp->specver = SDHC_SPEC_VERSION(sdhcver);
+       switch (SDHC_SPEC_VERSION(sdhcver)) {
+       case SDHC_SPEC_VERS_100:
+               aprint_normal("1.0");
+               break;
+       case SDHC_SPEC_VERS_200:
+               aprint_normal("2.0");
+               break;
+       case SDHC_SPEC_VERS_300:
+               aprint_normal("3.0");
+               break;
+       case SDHC_SPEC_VERS_400:
+               aprint_normal("4.0");
+               break;
+       case SDHC_SPEC_NOVERS:
+               hp->specver = -1;
+               aprint_normal("NO-VERS");
+               break;
+       default:
+               aprint_normal("unknown version(0x%x)",
+                   SDHC_SPEC_VERSION(sdhcver));
+               break;
+       }
+       if (SDHC_SPEC_VERSION(sdhcver) != SDHC_SPEC_NOVERS)
                aprint_normal(", rev %u", SDHC_VENDOR_VERSION(sdhcver));
-       }
 
        /*
         * Reset the host controller and enable interrupts.
diff -r ab2109d1e612 -r 73fe20fbd31d sys/dev/sdmmc/sdhcreg.h
--- a/sys/dev/sdmmc/sdhcreg.h   Sun Jan 07 09:22:38 2018 +0000
+++ b/sys/dev/sdmmc/sdhcreg.h   Sun Jan 07 09:24:59 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sdhcreg.h,v 1.18 2015/12/31 11:53:19 ryo Exp $ */
+/*     $NetBSD: sdhcreg.h,v 1.18.10.1 2018/01/07 09:24:59 snj Exp $    */
 /*     $OpenBSD: sdhcreg.h,v 1.4 2006/07/30 17:20:40 fgsch Exp $       */
 
 /*
@@ -246,6 +246,7 @@
 #define SDHC_SPEC_VERS_200             0x01
 #define SDHC_SPEC_VERS_300             0x02
 #define SDHC_SPEC_VERS_400             0x03
+#define SDHC_SPEC_NOVERS               0xff    /* dummy */
 
 /* SDHC_CAPABILITIES decoding */
 #define SDHC_BASE_V3_FREQ_KHZ(cap)                                     \



Home | Main Index | Thread Index | Old Index