Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/sdmmc Give a hint to controllers in the command flag...



details:   https://anonhg.NetBSD.org/src/rev/73c5e6b20be3
branches:  trunk
changeset: 824419:73c5e6b20be3
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Sun Jun 04 15:00:02 2017 +0000

description:
Give a hint to controllers in the command flags if we are performing a
transfer with an SDHC capable card. If the controller needs to adjust
command args, it can use this hint to understand how it is encoded.

diffstat:

 sys/dev/sdmmc/sdmmc_mem.c |  8 ++++++--
 sys/dev/sdmmc/sdmmcvar.h  |  4 +++-
 2 files changed, 9 insertions(+), 3 deletions(-)

diffs (54 lines):

diff -r 096d8d5dd5b6 -r 73c5e6b20be3 sys/dev/sdmmc/sdmmc_mem.c
--- a/sys/dev/sdmmc/sdmmc_mem.c Sun Jun 04 10:58:28 2017 +0000
+++ b/sys/dev/sdmmc/sdmmc_mem.c Sun Jun 04 15:00:02 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sdmmc_mem.c,v 1.56 2017/04/11 23:26:33 jmcneill Exp $  */
+/*     $NetBSD: sdmmc_mem.c,v 1.57 2017/06/04 15:00:02 jmcneill Exp $  */
 /*     $OpenBSD: sdmmc_mem.c,v 1.10 2009/01/09 10:55:22 jsg Exp $      */
 
 /*
@@ -45,7 +45,7 @@
 /* Routines for SD/MMC memory cards. */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sdmmc_mem.c,v 1.56 2017/04/11 23:26:33 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sdmmc_mem.c,v 1.57 2017/06/04 15:00:02 jmcneill Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_sdmmc.h"
@@ -1641,6 +1641,8 @@
        if (!ISSET(sf->flags, SFF_SDHC))
                cmd.c_arg <<= SDMMC_SECTOR_SIZE_SB;
        cmd.c_flags = SCF_CMD_ADTC | SCF_CMD_READ | SCF_RSP_R1 | SCF_RSP_SPI_R1;
+       if (ISSET(sf->flags, SFF_SDHC))
+               cmd.c_flags |= SCF_XFER_SDHC;
        if (ISSET(sc->sc_caps, SMC_CAPS_DMA))
                cmd.c_dmamap = dmap;
 
@@ -1866,6 +1868,8 @@
        if (!ISSET(sf->flags, SFF_SDHC))
                cmd.c_arg <<= SDMMC_SECTOR_SIZE_SB;
        cmd.c_flags = SCF_CMD_ADTC | SCF_RSP_R1;
+       if (ISSET(sf->flags, SFF_SDHC))
+               cmd.c_flags |= SCF_XFER_SDHC;
        if (ISSET(sc->sc_caps, SMC_CAPS_DMA))
                cmd.c_dmamap = dmap;
 
diff -r 096d8d5dd5b6 -r 73c5e6b20be3 sys/dev/sdmmc/sdmmcvar.h
--- a/sys/dev/sdmmc/sdmmcvar.h  Sun Jun 04 10:58:28 2017 +0000
+++ b/sys/dev/sdmmc/sdmmcvar.h  Sun Jun 04 15:00:02 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sdmmcvar.h,v 1.23 2017/02/17 10:51:48 nonaka Exp $     */
+/*     $NetBSD: sdmmcvar.h,v 1.24 2017/06/04 15:00:02 jmcneill Exp $   */
 /*     $OpenBSD: sdmmcvar.h,v 1.13 2009/01/09 10:55:22 jsg Exp $       */
 
 /*
@@ -122,6 +122,8 @@
 #define SCF_RSP_SPI_BSY        (1U << 13)
 /* Probing */
 #define SCF_TOUT_OK    (1U << 14)      /* command timeout expected */
+/* Transfer hints */
+#define SCF_XFER_SDHC  (1U << 15)      /* card is SDHC */
 /* response types */
 #define SCF_RSP_R0     0       /* none */
 #define SCF_RSP_R1     (SCF_RSP_PRESENT|SCF_RSP_CRC|SCF_RSP_IDX)



Home | Main Index | Thread Index | Old Index