Sun Dec 23 18:34:01 2012 UTC ()
TI_AM335X SDHCI does not need SDHC_FLAG_SINGLE_ONLY.  This was
drastically hindering transfer rate performance.

I suspect SDHC_FLAG_SINGLE_ONLY is bogus on most/all other TI-flavored
SDHCI cores as well, but I am unable to confirm.


(jakllsch)
diff -r1.6 -r1.7 src/sys/arch/arm/omap/omap3_sdhc.c

cvs diff -r1.6 -r1.7 src/sys/arch/arm/omap/Attic/omap3_sdhc.c (expand / switch to unified diff)

--- src/sys/arch/arm/omap/Attic/omap3_sdhc.c 2012/12/13 06:43:38 1.6
+++ src/sys/arch/arm/omap/Attic/omap3_sdhc.c 2012/12/23 18:34:01 1.7
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: omap3_sdhc.c,v 1.6 2012/12/13 06:43:38 riastradh Exp $ */ 1/* $NetBSD: omap3_sdhc.c,v 1.7 2012/12/23 18:34:01 jakllsch Exp $ */
2/*- 2/*-
3 * Copyright (c) 2011 The NetBSD Foundation, Inc. 3 * Copyright (c) 2011 The NetBSD Foundation, Inc.
4 * All rights reserved. 4 * All rights reserved.
5 * 5 *
6 * This code is derived from software contributed to The NetBSD Foundation 6 * This code is derived from software contributed to The NetBSD Foundation
7 * by Matt Thomas of 3am Software Foundry. 7 * by Matt Thomas of 3am Software Foundry.
8 * 8 *
9 * Redistribution and use in source and binary forms, with or without 9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions 10 * modification, are permitted provided that the following conditions
11 * are met: 11 * are met:
12 * 1. Redistributions of source code must retain the above copyright 12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer. 13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright 14 * 2. Redistributions in binary form must reproduce the above copyright
@@ -19,27 +19,27 @@ @@ -19,27 +19,27 @@
19 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 19 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
20 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 20 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
21 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 21 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
22 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 25 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 26 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 27 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28 * POSSIBILITY OF SUCH DAMAGE. 28 * POSSIBILITY OF SUCH DAMAGE.
29 */ 29 */
30 30
31#include <sys/cdefs.h> 31#include <sys/cdefs.h>
32__KERNEL_RCSID(0, "$NetBSD: omap3_sdhc.c,v 1.6 2012/12/13 06:43:38 riastradh Exp $"); 32__KERNEL_RCSID(0, "$NetBSD: omap3_sdhc.c,v 1.7 2012/12/23 18:34:01 jakllsch Exp $");
33 33
34#include "opt_omap.h" 34#include "opt_omap.h"
35 35
36#include <sys/param.h> 36#include <sys/param.h>
37#include <sys/systm.h> 37#include <sys/systm.h>
38#include <sys/device.h> 38#include <sys/device.h>
39#include <sys/kernel.h> 39#include <sys/kernel.h>
40#include <sys/proc.h> 40#include <sys/proc.h>
41#include <sys/queue.h> 41#include <sys/queue.h>
42 42
43#include <sys/bus.h> 43#include <sys/bus.h>
44 44
45#include <arm/omap/omap2_obiovar.h> 45#include <arm/omap/omap2_obiovar.h>
@@ -142,26 +142,27 @@ obiosdhc_attach(device_t parent, device_ @@ -142,26 +142,27 @@ obiosdhc_attach(device_t parent, device_
142#ifdef TI_AM335X 142#ifdef TI_AM335X
143 size_t i; 143 size_t i;
144#endif 144#endif
145 145
146 sc->sc.sc_dmat = oa->obio_dmat; 146 sc->sc.sc_dmat = oa->obio_dmat;
147 sc->sc.sc_dev = self; 147 sc->sc.sc_dev = self;
148 //sc->sc.sc_flags |= SDHC_FLAG_USE_DMA; 148 //sc->sc.sc_flags |= SDHC_FLAG_USE_DMA;
149 sc->sc.sc_flags |= SDHC_FLAG_32BIT_ACCESS; 149 sc->sc.sc_flags |= SDHC_FLAG_32BIT_ACCESS;
150 sc->sc.sc_flags |= SDHC_FLAG_NO_LED_ON; 150 sc->sc.sc_flags |= SDHC_FLAG_NO_LED_ON;
151 sc->sc.sc_flags |= SDHC_FLAG_RSP136_CRC; 151 sc->sc.sc_flags |= SDHC_FLAG_RSP136_CRC;
152 sc->sc.sc_flags |= SDHC_FLAG_SINGLE_ONLY; 152 sc->sc.sc_flags |= SDHC_FLAG_SINGLE_ONLY;
153#ifdef TI_AM335X 153#ifdef TI_AM335X
154 sc->sc.sc_flags |= SDHC_FLAG_WAIT_RESET; 154 sc->sc.sc_flags |= SDHC_FLAG_WAIT_RESET;
 155 sc->sc.sc_flags &= ~SDHC_FLAG_SINGLE_ONLY;
155#endif 156#endif
156 sc->sc.sc_host = sc->sc_hosts; 157 sc->sc.sc_host = sc->sc_hosts;
157 sc->sc.sc_clkbase = 96000; /* 96MHZ */ 158 sc->sc.sc_clkbase = 96000; /* 96MHZ */
158 if (!prop_dictionary_get_uint32(prop, "clkmask", &sc->sc.sc_clkmsk)) 159 if (!prop_dictionary_get_uint32(prop, "clkmask", &sc->sc.sc_clkmsk))
159 sc->sc.sc_clkmsk = 0x0000ffc0; 160 sc->sc.sc_clkmsk = 0x0000ffc0;
160 sc->sc.sc_vendor_rod = obiosdhc_rod; 161 sc->sc.sc_vendor_rod = obiosdhc_rod;
161 sc->sc.sc_vendor_write_protect = obiosdhc_write_protect; 162 sc->sc.sc_vendor_write_protect = obiosdhc_write_protect;
162 sc->sc.sc_vendor_card_detect = obiosdhc_card_detect; 163 sc->sc.sc_vendor_card_detect = obiosdhc_card_detect;
163 sc->sc.sc_vendor_bus_clock = obiosdhc_bus_clock; 164 sc->sc.sc_vendor_bus_clock = obiosdhc_bus_clock;
164 sc->sc_bst = oa->obio_iot; 165 sc->sc_bst = oa->obio_iot;
165 166
166 clksft = ffs(sc->sc.sc_clkmsk) - 1; 167 clksft = ffs(sc->sc.sc_clkmsk) - 1;
167 168