Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 30 May 2015 01:01:08 GMT
From:      pratiksinghal@FreeBSD.org
To:        svn-soc-all@FreeBSD.org
Subject:   socsvn commit: r286395 - soc2015/pratiksinghal/cubie-head/sys/arm/allwinner
Message-ID:  <201505300101.t4U118av017459@socsvn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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 <arm/allwinner/a10_clk.h>
 #include <arm/allwinner/a10_mmc.h>
 
-#include <vm/pmap.h>  
-
-#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),



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201505300101.t4U118av017459>