Source-Changes-HG archive

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

[src/netbsd-7]: src/sys Pull up following revision(s) (requested by nonaka in...



details:   https://anonhg.NetBSD.org/src/rev/5aceebd83eb5
branches:  netbsd-7
changeset: 799070:5aceebd83eb5
user:      snj <snj%NetBSD.org@localhost>
date:      Mon Mar 09 09:29:32 2015 +0000

description:
Pull up following revision(s) (requested by nonaka in ticket #577):
        sys/arch/powerpc/booke/dev/pq3sdhc.c: revision 1.6
        sys/dev/sdmmc/sdhc.c: revision 1.54
        sys/dev/sdmmc/sdmmc.c: revision 1.24
eSDHC has no DMA_BOUNDARY in BLOCK_SIZE register.
So clear multi segment DMA transfer support bit.
--
fix to simulate multi-segment dma transfer for pq3sdhc(4).
--
pq3sdhc: Enable DMA transfer.

diffstat:

 sys/arch/powerpc/booke/dev/pq3sdhc.c |   6 +++---
 sys/dev/sdmmc/sdhc.c                 |   8 +++++---
 sys/dev/sdmmc/sdmmc.c                |  25 ++++++++++++++++---------
 3 files changed, 24 insertions(+), 15 deletions(-)

diffs (123 lines):

diff -r 26767864685d -r 5aceebd83eb5 sys/arch/powerpc/booke/dev/pq3sdhc.c
--- a/sys/arch/powerpc/booke/dev/pq3sdhc.c      Mon Mar 09 09:23:36 2015 +0000
+++ b/sys/arch/powerpc/booke/dev/pq3sdhc.c      Mon Mar 09 09:29:32 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pq3sdhc.c,v 1.5 2012/07/26 18:38:10 matt Exp $ */
+/*     $NetBSD: pq3sdhc.c,v 1.5.14.1 2015/03/09 09:29:32 snj Exp $     */
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -31,7 +31,7 @@
 #define        ESDHC_PRIVATE
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pq3sdhc.c,v 1.5 2012/07/26 18:38:10 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pq3sdhc.c,v 1.5.14.1 2015/03/09 09:29:32 snj Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -87,7 +87,7 @@
        psc->sc_children |= cna->cna_childmask;
        sc->sc.sc_dmat = cna->cna_dmat;
        sc->sc.sc_dev = self;
-       //sc->sc.sc_flags |= SDHC_FLAG_USE_DMA;
+       sc->sc.sc_flags |= SDHC_FLAG_USE_DMA;
        sc->sc.sc_flags |=
            SDHC_FLAG_HAVE_DVS | SDHC_FLAG_32BIT_ACCESS | SDHC_FLAG_ENHANCED;
        sc->sc.sc_host = sc->sc_hosts;
diff -r 26767864685d -r 5aceebd83eb5 sys/dev/sdmmc/sdhc.c
--- a/sys/dev/sdmmc/sdhc.c      Mon Mar 09 09:23:36 2015 +0000
+++ b/sys/dev/sdmmc/sdhc.c      Mon Mar 09 09:29:32 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sdhc.c,v 1.44.2.6 2015/01/27 08:17:09 martin Exp $     */
+/*     $NetBSD: sdhc.c,v 1.44.2.7 2015/03/09 09:29:33 snj 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.44.2.6 2015/01/27 08:17:09 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sdhc.c,v 1.44.2.7 2015/03/09 09:29:33 snj Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_sdmmc.h"
@@ -425,7 +425,9 @@
        if (ISSET(caps, SDHC_HIGH_SPEED_SUPP))
                saa.saa_caps |= SMC_CAPS_SD_HIGHSPEED;
        if (ISSET(hp->flags, SHF_USE_DMA)) {
-               saa.saa_caps |= SMC_CAPS_DMA | SMC_CAPS_MULTI_SEG_DMA;
+               saa.saa_caps |= SMC_CAPS_DMA;
+               if (!ISSET(hp->sc->sc_flags, SDHC_FLAG_ENHANCED))
+                       saa.saa_caps |= SMC_CAPS_MULTI_SEG_DMA;
        }
        if (ISSET(sc->sc_flags, SDHC_FLAG_SINGLE_ONLY))
                saa.saa_caps |= SMC_CAPS_SINGLE_ONLY;
diff -r 26767864685d -r 5aceebd83eb5 sys/dev/sdmmc/sdmmc.c
--- a/sys/dev/sdmmc/sdmmc.c     Mon Mar 09 09:23:36 2015 +0000
+++ b/sys/dev/sdmmc/sdmmc.c     Mon Mar 09 09:29:32 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sdmmc.c,v 1.22.4.1 2014/12/01 11:38:43 martin Exp $    */
+/*     $NetBSD: sdmmc.c,v 1.22.4.2 2015/03/09 09:29:33 snj Exp $       */
 /*     $OpenBSD: sdmmc.c,v 1.18 2009/01/09 10:58:38 jsg Exp $  */
 
 /*
@@ -49,7 +49,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sdmmc.c,v 1.22.4.1 2014/12/01 11:38:43 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sdmmc.c,v 1.22.4.2 2015/03/09 09:29:33 snj Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_sdmmc.h"
@@ -626,25 +626,31 @@
                bus_dma_segment_t ds;
                int rseg, error;
 
-               error = bus_dmamap_create(sc->sc_dmat, SDMMC_SECTOR_SIZE, 1,
-                   SDMMC_SECTOR_SIZE, 0, BUS_DMA_WAITOK, &sf->bbuf_dmap);
+               error = bus_dmamap_create(sc->sc_dmat, MAXPHYS, 1,
+                   MAXPHYS, 0, BUS_DMA_WAITOK, &sf->bbuf_dmap);
                if (error)
                        goto fail1;
-               error = bus_dmamem_alloc(sc->sc_dmat, SDMMC_SECTOR_SIZE,
+               error = bus_dmamem_alloc(sc->sc_dmat, MAXPHYS,
                    PAGE_SIZE, 0, &ds, 1, &rseg, BUS_DMA_WAITOK);
                if (error)
                        goto fail2;
-               error = bus_dmamem_map(sc->sc_dmat, &ds, 1, SDMMC_SECTOR_SIZE,
+               error = bus_dmamem_map(sc->sc_dmat, &ds, 1, MAXPHYS,
                    &sf->bbuf, BUS_DMA_WAITOK);
                if (error)
                        goto fail3;
                error = bus_dmamap_load(sc->sc_dmat, sf->bbuf_dmap,
-                   sf->bbuf, SDMMC_SECTOR_SIZE, NULL,
+                   sf->bbuf, MAXPHYS, NULL,
                    BUS_DMA_WAITOK|BUS_DMA_READ|BUS_DMA_WRITE);
+               if (error)
+                       goto fail4;
+               error = bus_dmamap_create(sc->sc_dmat, MAXPHYS, 1,
+                   MAXPHYS, 0, BUS_DMA_WAITOK, &sf->sseg_dmap);
                if (!error)
                        goto out;
 
-               bus_dmamem_unmap(sc->sc_dmat, sf->bbuf, SDMMC_SECTOR_SIZE);
+               bus_dmamap_unload(sc->sc_dmat, sf->bbuf_dmap);
+fail4:
+               bus_dmamem_unmap(sc->sc_dmat, sf->bbuf, MAXPHYS);
 fail3:
                bus_dmamem_free(sc->sc_dmat, &ds, 1);
 fail2:
@@ -666,8 +672,9 @@
        if (ISSET(sc->sc_flags, SMF_MEM_MODE) &&
            ISSET(sc->sc_caps, SMC_CAPS_DMA) &&
            !ISSET(sc->sc_caps, SMC_CAPS_MULTI_SEG_DMA)) {
+               bus_dmamap_destroy(sc->sc_dmat, sf->sseg_dmap);
                bus_dmamap_unload(sc->sc_dmat, sf->bbuf_dmap);
-               bus_dmamem_unmap(sc->sc_dmat, sf->bbuf, SDMMC_SECTOR_SIZE);
+               bus_dmamem_unmap(sc->sc_dmat, sf->bbuf, MAXPHYS);
                bus_dmamem_free(sc->sc_dmat,
                    sf->bbuf_dmap->dm_segs, sf->bbuf_dmap->dm_nsegs);
                bus_dmamap_destroy(sc->sc_dmat, sf->bbuf_dmap);



Home | Main Index | Thread Index | Old Index