Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/sdmmc Add vendor callback for post-bus clock ops and...



details:   https://anonhg.NetBSD.org/src/rev/e4f68439829d
branches:  trunk
changeset: 449628:e4f68439829d
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Wed Mar 13 12:16:49 2019 +0000

description:
Add vendor callback for post-bus clock ops and add SDHC_FLAG_STOP_WITH_TC flag

diffstat:

 sys/dev/sdmmc/sdhc.c    |  15 +++++++++++++--
 sys/dev/sdmmc/sdhcvar.h |   4 +++-
 2 files changed, 16 insertions(+), 3 deletions(-)

diffs (68 lines):

diff -r 38cc807b86de -r e4f68439829d sys/dev/sdmmc/sdhc.c
--- a/sys/dev/sdmmc/sdhc.c      Wed Mar 13 10:29:56 2019 +0000
+++ b/sys/dev/sdmmc/sdhc.c      Wed Mar 13 12:16:49 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sdhc.c,v 1.101 2017/06/23 08:43:59 ryo Exp $   */
+/*     $NetBSD: sdhc.c,v 1.102 2019/03/13 12:16:49 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.101 2017/06/23 08:43:59 ryo Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sdhc.c,v 1.102 2019/03/13 12:16:49 jmcneill Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_sdmmc.h"
@@ -1236,6 +1236,12 @@
                        HCLR1(hp, SDHC_HOST_CTL, SDHC_HIGH_SPEED);
        }
 
+       if (hp->sc->sc_vendor_bus_clock_post) {
+               error = (*hp->sc->sc_vendor_bus_clock_post)(hp->sc, freq);
+               if (error != 0)
+                       goto out;
+       }
+
 out:
        mutex_exit(&hp->intr_lock);
 
@@ -1556,6 +1562,11 @@
                }
        }
 
+       if (ISSET(hp->sc->sc_flags, SDHC_FLAG_STOP_WITH_TC)) {
+               if (cmd->c_opcode == MMC_STOP_TRANSMISSION)
+                       SET(cmd->c_flags, SCF_RSP_BSY);
+       }
+
        /*
         * Start the MMC command, or mark `cmd' as failed and return.
         */
diff -r 38cc807b86de -r e4f68439829d sys/dev/sdmmc/sdhcvar.h
--- a/sys/dev/sdmmc/sdhcvar.h   Wed Mar 13 10:29:56 2019 +0000
+++ b/sys/dev/sdmmc/sdhcvar.h   Wed Mar 13 12:16:49 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sdhcvar.h,v 1.29 2017/04/22 21:49:41 jmcneill Exp $    */
+/*     $NetBSD: sdhcvar.h,v 1.30 2019/03/13 12:16:49 jmcneill Exp $    */
 /*     $OpenBSD: sdhcvar.h,v 1.3 2007/09/06 08:01:01 jsg Exp $ */
 
 /*
@@ -61,6 +61,7 @@
 #define        SDHC_FLAG_USDHC         0x00800000 /* Freescale uSDHC */
 #define        SDHC_FLAG_NO_AUTO_STOP  0x01000000 /* No auto CMD12 */
 #define        SDHC_FLAG_NO_BUSY_INTR  0x02000000 /* No intr when RESP_BUSY */
+#define        SDHC_FLAG_STOP_WITH_TC  0x04000000 /* CMD12 can set xfer complete w/o SCF_RSP_BSY */
 
        uint32_t                sc_clkbase;
        int                     sc_clkmsk;      /* Mask for SDCLK */
@@ -72,6 +73,7 @@
        int (*sc_vendor_card_detect)(struct sdhc_softc *);
        int (*sc_vendor_bus_width)(struct sdhc_softc *, int);
        int (*sc_vendor_bus_clock)(struct sdhc_softc *, int);
+       int (*sc_vendor_bus_clock_post)(struct sdhc_softc *, int);
        int (*sc_vendor_transfer_data_dma)(struct sdhc_softc *, struct sdmmc_command *);
        void (*sc_vendor_hw_reset)(struct sdhc_softc *, struct sdhc_host *);
        int (*sc_vendor_signal_voltage)(struct sdhc_softc *, int);



Home | Main Index | Thread Index | Old Index