Source-Changes-HG archive

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

[src/netbsd-9]: src/sys/dev/ic Pull up following revision(s) (requested by sk...



details:   https://anonhg.NetBSD.org/src/rev/8c487dcd76c8
branches:  netbsd-9
changeset: 963740:8c487dcd76c8
user:      martin <martin%NetBSD.org@localhost>
date:      Sat Mar 21 20:24:36 2020 +0000

description:
Pull up following revision(s) (requested by skrll in ticket #800):

        sys/dev/ic/dwc_mmc_var.h: revision 1.14
        sys/dev/ic/dwc_mmc_reg.h: revision 1.10
        sys/dev/ic/dwc_mmc.c: revision 1.23
        sys/dev/ic/dwc_mmc.c: revision 1.24
        sys/dev/ic/dwc_mmc.c: revision 1.25
        sys/dev/ic/dwc_mmc.c: revision 1.26

Release the sc_intr_lock on error

Trailing whitespace

Add DWC_MMC_VERID_280A

Remember / use sc_verid

Disable thrctrl or now and note why

diffstat:

 sys/dev/ic/dwc_mmc.c     |  25 ++++++++++++++++++-------
 sys/dev/ic/dwc_mmc_reg.h |   3 ++-
 sys/dev/ic/dwc_mmc_var.h |   3 ++-
 3 files changed, 22 insertions(+), 9 deletions(-)

diffs (107 lines):

diff -r a740fc4d2e46 -r 8c487dcd76c8 sys/dev/ic/dwc_mmc.c
--- a/sys/dev/ic/dwc_mmc.c      Sat Mar 21 20:21:58 2020 +0000
+++ b/sys/dev/ic/dwc_mmc.c      Sat Mar 21 20:24:36 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: dwc_mmc.c,v 1.17.2.2 2020/02/25 18:40:43 martin Exp $ */
+/* $NetBSD: dwc_mmc.c,v 1.17.2.3 2020/03/21 20:24:36 martin Exp $ */
 
 /*-
  * Copyright (c) 2014-2017 Jared McNeill <jmcneill%invisible.ca@localhost>
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: dwc_mmc.c,v 1.17.2.2 2020/02/25 18:40:43 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dwc_mmc.c,v 1.17.2.3 2020/03/21 20:24:36 martin Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -439,7 +439,7 @@
        }
 
        sc->sc_mmc_width = width;
-       
+
        return 0;
 }
 
@@ -662,11 +662,21 @@
                MMC_WRITE(sc, DWC_MMC_BLKSZ, cmd->c_blklen);
                MMC_WRITE(sc, DWC_MMC_BYTECNT,
                    nblks > 1 ? nblks * cmd->c_blklen : cmd->c_datalen);
+
+#if 0
+               /*
+                * The following doesn't work on the 250a verid IP in Odroid-XU4.
+               *
+                * thrctl should only be used for UHS/HS200 and faster timings on
+                * >=240a
+                */
+
                if (ISSET(cmd->c_flags, SCF_CMD_READ)) {
                        MMC_WRITE(sc, DWC_MMC_CARDTHRCTL,
                            __SHIFTIN(cmd->c_blklen, DWC_MMC_CARDTHRCTL_RDTHR) |
                            DWC_MMC_CARDTHRCTL_RDTHREN);
                }
+#endif
        }
 
        MMC_WRITE(sc, DWC_MMC_IMASK, imask | sc->sc_intr_card);
@@ -717,6 +727,7 @@
                if (error != 0) {
                        cmd->c_error = error;
                        SET(cmd->c_flags, SCF_ITSDONE);
+                       mutex_exit(&sc->sc_intr_lock);
                        goto done;
                }
        }
@@ -806,11 +817,11 @@
 {
        uint32_t val;
 
+       val = MMC_READ(sc, DWC_MMC_VERID);
+       sc->sc_verid = __SHIFTOUT(val, DWC_MMC_VERID_ID);
+
        if (sc->sc_fifo_reg == 0) {
-               val = MMC_READ(sc, DWC_MMC_VERID);
-               const u_int id = __SHIFTOUT(val, DWC_MMC_VERID_ID);
-
-               if (id < DWC_MMC_VERID_240A)
+               if (sc->sc_verid < DWC_MMC_VERID_240A)
                        sc->sc_fifo_reg = 0x100;
                else
                        sc->sc_fifo_reg = 0x200;
diff -r a740fc4d2e46 -r 8c487dcd76c8 sys/dev/ic/dwc_mmc_reg.h
--- a/sys/dev/ic/dwc_mmc_reg.h  Sat Mar 21 20:21:58 2020 +0000
+++ b/sys/dev/ic/dwc_mmc_reg.h  Sat Mar 21 20:24:36 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: dwc_mmc_reg.h,v 1.7.8.1 2020/02/25 18:40:43 martin Exp $ */
+/* $NetBSD: dwc_mmc_reg.h,v 1.7.8.2 2020/03/21 20:24:36 martin Exp $ */
 
 /*-
  * Copyright (c) 2014-2017 Jared McNeill <jmcneill%invisible.ca@localhost>
@@ -153,6 +153,7 @@
 
 #define DWC_MMC_VERID_ID               __BITS(15,0)
 #define DWC_MMC_VERID_240A             0x240a
+#define DWC_MMC_VERID_280A             0x280a
 
 #define DWC_MMC_IDST_HOST_ABT          __BIT(10)
 #define DWC_MMC_IDST_ABNORMAL_INT_SUM  __BIT(9)
diff -r a740fc4d2e46 -r 8c487dcd76c8 sys/dev/ic/dwc_mmc_var.h
--- a/sys/dev/ic/dwc_mmc_var.h  Sat Mar 21 20:21:58 2020 +0000
+++ b/sys/dev/ic/dwc_mmc_var.h  Sat Mar 21 20:24:36 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: dwc_mmc_var.h,v 1.8.2.2 2020/02/25 18:40:43 martin Exp $ */
+/* $NetBSD: dwc_mmc_var.h,v 1.8.2.3 2020/03/21 20:24:36 martin Exp $ */
 
 /*-
  * Copyright (c) 2014-2017 Jared McNeill <jmcneill%invisible.ca@localhost>
@@ -45,6 +45,7 @@
        u_int sc_clock_freq;
        u_int sc_bus_width;
        bool sc_card_inited;
+       u_int sc_verid;
 
        void *sc_ih;
        kmutex_t sc_lock;



Home | Main Index | Thread Index | Old Index