From owner-svn-soc-all@FreeBSD.ORG Sat May 30 01:01:08 2015 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CBF1C35C for ; Sat, 30 May 2015 01:01:08 +0000 (UTC) (envelope-from pratiksinghal@FreeBSD.org) Received: from socsvn.freebsd.org (socsvn.freebsd.org [IPv6:2001:1900:2254:206a::50:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B8D531CE1 for ; Sat, 30 May 2015 01:01:08 +0000 (UTC) (envelope-from pratiksinghal@FreeBSD.org) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4U1189W017660 for ; Sat, 30 May 2015 01:01:08 GMT (envelope-from pratiksinghal@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.14.9/8.14.9/Submit) id t4U118av017459 for svn-soc-all@FreeBSD.org; Sat, 30 May 2015 01:01:08 GMT (envelope-from pratiksinghal@FreeBSD.org) Date: Sat, 30 May 2015 01:01:08 GMT Message-Id: <201505300101.t4U118av017459@socsvn.freebsd.org> X-Authentication-Warning: socsvn.freebsd.org: www set sender to pratiksinghal@FreeBSD.org using -f From: pratiksinghal@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r286395 - soc2015/pratiksinghal/cubie-head/sys/arm/allwinner MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 May 2015 01:01:08 -0000 Author: pratiksinghal Date: Sat May 30 01:01:07 2015 New Revision: 286395 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=286395 Log: Reverted a10_mmc.c file to old working version Modified: soc2015/pratiksinghal/cubie-head/sys/arm/allwinner/a10_mmc.c Modified: soc2015/pratiksinghal/cubie-head/sys/arm/allwinner/a10_mmc.c ============================================================================== --- soc2015/pratiksinghal/cubie-head/sys/arm/allwinner/a10_mmc.c Fri May 29 23:37:27 2015 (r286394) +++ soc2015/pratiksinghal/cubie-head/sys/arm/allwinner/a10_mmc.c Sat May 30 01:01:07 2015 (r286395) @@ -51,10 +51,6 @@ #include #include -#include - -#include "a10_dma.h" - #define A10_MMC_MEMRES 0 #define A10_MMC_IRQRES 1 #define A10_MMC_RESSZ 2 @@ -62,7 +58,6 @@ struct a10_mmc_softc { bus_space_handle_t a10_bsh; bus_space_tag_t a10_bst; - //bus_dma_tag_t a10_dmat ; device_t a10_dev; int a10_bus_busy; int a10_id; @@ -75,8 +70,6 @@ struct resource * a10_res[A10_MMC_RESSZ]; uint32_t a10_intr; uint32_t a10_intr_wait; - uint8_t ddma_channel ; - uint8_t use_dma ; void * a10_intrhand; }; @@ -92,7 +85,6 @@ static int a10_mmc_reset(struct a10_mmc_softc *); static void a10_mmc_intr(void *); static int a10_mmc_update_clock(struct a10_mmc_softc *); -static void a10_mmc_init_dma() ; static int a10_mmc_update_ios(device_t, device_t); static int a10_mmc_request(device_t, device_t, struct mmc_request *); @@ -190,18 +182,7 @@ device_delete_child(dev, child); goto fail; } - sc->ddma_channel = NDDMA + 1 ; - sc->use_dma = 0 ; - // /* Setup DMA */ - // uint32_t err = bus_dma_tag_create(bus_get_dma_tag(dev), 4096,0, - // BUS_SPACE_MAXADDR,BUS_SPACE_MAXADDR,NULL,NULL, - // BUS_SPACE_UNRESTRICTED,1,PAGE_SIZE,0, - // busdma_lock_mutex,&sc->sc_mtx,&sc->a10_dmat) ; - // if(err) { - // device_printf(dev, "Could not create dma tag.\n"); - // goto fail ; - // } return (0); fail: @@ -329,7 +310,6 @@ "Spurious timeout - no active request\n"); } -/* We have to request the dma controller to transfer data in this function. */ static int a10_mmc_pio_transfer(struct a10_mmc_softc *sc, struct mmc_data *data) { @@ -339,30 +319,16 @@ buf = (uint32_t *)data->data; write = (data->flags & MMC_DATA_WRITE) ? 1 : 0; bit = write ? A10_MMC_FIFO_FULL : A10_MMC_FIFO_EMPTY; - uint32_t old_resid = sc->a10_resid ; for (i = sc->a10_resid; i < (data->len >> 2); i++) { if ((A10_MMC_READ_4(sc, A10_MMC_STAS) & bit)) return (1); if (write) A10_MMC_WRITE_4(sc, A10_MMC_FIFO, buf[i]); else - { - uint32_t* p1 = (uint32_t*) A10_MMC_FIFO + A10_MMC_BASE ; - uint32_t* p2 = (uint32_t*) vtophys(buf + i) ; - a10_ddma_config_channel(sc->ddma_channel,p1, p2, 4, SET_BIT(31)|SET_BIT(30)|SET_BIT(29)|SET_BIT(28)|SET_BIT(26)|SET_BIT(15)|SET_BIT(12)|SET_BIT(10)|SET_BIT(0) ) ; - //buf[i] = A10_MMC_READ_4(sc, A10_MMC_FIFO); - } + buf[i] = A10_MMC_READ_4(sc, A10_MMC_FIFO); sc->a10_resid = i + 1; } - if(sc->use_dma == 1) { - device_printf(sc->a10_dev, "DMA channel no %d allocated.\n", sc->ddma_channel) ; - } - if(!write) { - device_printf(sc->a10_dev, "Transferred %d bytes from the card\n", (i-old_resid)*4 ) ; - } - else { - device_printf(sc->a10_dev, "Wrote %d bytes to the card\n", (i-old_resid)*4 ) ; - } + return (0); } @@ -426,14 +392,6 @@ sc = device_get_softc(bus); A10_MMC_LOCK(sc); - if(sc->ddma_channel == NDDMA + 1) { - sc->ddma_channel = a10_get_ddma_channel() ; - if(sc->ddma_channel != NDDMA + 1) - sc->use_dma = 1 ; - else - sc->use_dma = 0 ; - } - if (sc->a10_req) { A10_MMC_UNLOCK(sc); return (EBUSY); @@ -699,13 +657,6 @@ return (0); } -static void a10_mmc_init_dma(device_t parent) -{ - /* Identify the parent tag. */ - //bus_dma_tag_t parent_tag = bus_get_dma_tag(parent) ; - - /*TODO :- Create children dma tags and maps and initiate the dma transfer. */ -} static device_method_t a10_mmc_methods[] = { /* Device interface */ DEVMETHOD(device_probe, a10_mmc_probe),