Module Name:    src
Committed By:   mlelstv
Date:           Wed Sep  9 08:09:28 UTC 2015

Modified Files:
        src/sys/dev/sdmmc: sdhc.c

Log Message:
The iMX uSDHC controller doesn't have an interrupt error status flag,
the bit position is reserved and reads as value 0.
- Fake the flag if any of the error bits is set.
- uSDHC supports the 32bit access, the 16bit path doesn't need that quirk.


To generate a diff of this commit:
cvs rdiff -u -r1.86 -r1.87 src/sys/dev/sdmmc/sdhc.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/sdmmc/sdhc.c
diff -u src/sys/dev/sdmmc/sdhc.c:1.86 src/sys/dev/sdmmc/sdhc.c:1.87
--- src/sys/dev/sdmmc/sdhc.c:1.86	Wed Sep  9 08:06:47 2015
+++ src/sys/dev/sdmmc/sdhc.c	Wed Sep  9 08:09:28 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: sdhc.c,v 1.86 2015/09/09 08:06:47 mlelstv Exp $	*/
+/*	$NetBSD: sdhc.c,v 1.87 2015/09/09 08:09:28 mlelstv 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.86 2015/09/09 08:06:47 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sdhc.c,v 1.87 2015/09/09 08:09:28 mlelstv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_sdmmc.h"
@@ -2163,6 +2163,10 @@ sdhc_intr(void *arg)
 			uint32_t xstatus = HREAD4(hp, SDHC_NINTR_STATUS);
 			status = xstatus;
 			error = xstatus >> 16;
+			if (ISSET(sc->sc_flags, SDHC_FLAG_ENHANCED)) {
+				if ((error & SDHC_NINTR_STATUS_MASK) != 0)
+					SET(status, SDHC_ERROR_INTERRUPT);
+			}
 			if (error)
 				xstatus |= SDHC_ERROR_INTERRUPT;
 			else if (!ISSET(status, SDHC_NINTR_STATUS_MASK))

Reply via email to