Fri Feb 27 01:52:15 2015 UTC ()
Don't clear other bits. pq3sdhc is set more bits.


(nonaka)
diff -r1.52 -r1.53 src/sys/dev/sdmmc/sdhc.c

cvs diff -r1.52 -r1.53 src/sys/dev/sdmmc/sdhc.c (expand / switch to unified diff)

--- src/sys/dev/sdmmc/sdhc.c 2015/01/26 04:56:56 1.52
+++ src/sys/dev/sdmmc/sdhc.c 2015/02/27 01:52:15 1.53
@@ -1,39 +1,39 @@ @@ -1,39 +1,39 @@
1/* $NetBSD: sdhc.c,v 1.52 2015/01/26 04:56:56 nonaka Exp $ */ 1/* $NetBSD: sdhc.c,v 1.53 2015/02/27 01:52:15 nonaka Exp $ */
2/* $OpenBSD: sdhc.c,v 1.25 2009/01/13 19:44:20 grange Exp $ */ 2/* $OpenBSD: sdhc.c,v 1.25 2009/01/13 19:44:20 grange Exp $ */
3 3
4/* 4/*
5 * Copyright (c) 2006 Uwe Stuehler <uwe@openbsd.org> 5 * Copyright (c) 2006 Uwe Stuehler <uwe@openbsd.org>
6 * 6 *
7 * Permission to use, copy, modify, and distribute this software for any 7 * Permission to use, copy, modify, and distribute this software for any
8 * purpose with or without fee is hereby granted, provided that the above 8 * purpose with or without fee is hereby granted, provided that the above
9 * copyright notice and this permission notice appear in all copies. 9 * copyright notice and this permission notice appear in all copies.
10 * 10 *
11 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 11 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
12 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 12 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
13 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 13 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
14 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 14 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
15 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 15 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
16 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 16 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
17 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 17 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18 */ 18 */
19 19
20/* 20/*
21 * SD Host Controller driver based on the SD Host Controller Standard 21 * SD Host Controller driver based on the SD Host Controller Standard
22 * Simplified Specification Version 1.00 (www.sdcard.com). 22 * Simplified Specification Version 1.00 (www.sdcard.com).
23 */ 23 */
24 24
25#include <sys/cdefs.h> 25#include <sys/cdefs.h>
26__KERNEL_RCSID(0, "$NetBSD: sdhc.c,v 1.52 2015/01/26 04:56:56 nonaka Exp $"); 26__KERNEL_RCSID(0, "$NetBSD: sdhc.c,v 1.53 2015/02/27 01:52:15 nonaka Exp $");
27 27
28#ifdef _KERNEL_OPT 28#ifdef _KERNEL_OPT
29#include "opt_sdmmc.h" 29#include "opt_sdmmc.h"
30#endif 30#endif
31 31
32#include <sys/param.h> 32#include <sys/param.h>
33#include <sys/device.h> 33#include <sys/device.h>
34#include <sys/kernel.h> 34#include <sys/kernel.h>
35#include <sys/kthread.h> 35#include <sys/kthread.h>
36#include <sys/malloc.h> 36#include <sys/malloc.h>
37#include <sys/systm.h> 37#include <sys/systm.h>
38#include <sys/mutex.h> 38#include <sys/mutex.h>
39#include <sys/condvar.h> 39#include <sys/condvar.h>
@@ -1619,27 +1619,27 @@ sdhc_soft_reset(struct sdhc_host *hp, in @@ -1619,27 +1619,27 @@ sdhc_soft_reset(struct sdhc_host *hp, in
1619 */ 1619 */
1620 for (timo = 10; timo > 0; timo--) { 1620 for (timo = 10; timo > 0; timo--) {
1621 if (!ISSET(HREAD1(hp, SDHC_SOFTWARE_RESET), mask)) 1621 if (!ISSET(HREAD1(hp, SDHC_SOFTWARE_RESET), mask))
1622 break; 1622 break;
1623 sdmmc_delay(10000); 1623 sdmmc_delay(10000);
1624 } 1624 }
1625 if (timo == 0) { 1625 if (timo == 0) {
1626 DPRINTF(1,("%s: timeout reg=%08x\n", HDEVNAME(hp), 1626 DPRINTF(1,("%s: timeout reg=%08x\n", HDEVNAME(hp),
1627 HREAD1(hp, SDHC_SOFTWARE_RESET))); 1627 HREAD1(hp, SDHC_SOFTWARE_RESET)));
1628 return ETIMEDOUT; 1628 return ETIMEDOUT;
1629 } 1629 }
1630 1630
1631 if (ISSET(hp->sc->sc_flags, SDHC_FLAG_ENHANCED)) { 1631 if (ISSET(hp->sc->sc_flags, SDHC_FLAG_ENHANCED)) {
1632 HWRITE4(hp, SDHC_DMA_CTL, SDHC_DMA_SNOOP); 1632 HSET4(hp, SDHC_DMA_CTL, SDHC_DMA_SNOOP);
1633 } 1633 }
1634 1634
1635 return 0; 1635 return 0;
1636} 1636}
1637 1637
1638static int 1638static int
1639sdhc_wait_intr(struct sdhc_host *hp, int mask, int timo) 1639sdhc_wait_intr(struct sdhc_host *hp, int mask, int timo)
1640{ 1640{
1641 int status; 1641 int status;
1642 1642
1643 mask |= SDHC_ERROR_INTERRUPT; 1643 mask |= SDHC_ERROR_INTERRUPT;
1644 1644
1645 mutex_enter(&hp->intr_mtx); 1645 mutex_enter(&hp->intr_mtx);