From c6306ff591cef2a224bc663e3efb508f4aac0f47 Mon Sep 17 00:00:00 2001 From: Werner Almesberger Date: Mon, 14 Jan 2013 23:29:23 -0300 Subject: [PATCH] ubb-patgen/ubb-patgen.c: DMA works now. Get rid of the PIO option. --- ubb-patgen/ubb-patgen.c | 32 -------------------------------- 1 file changed, 32 deletions(-) diff --git a/ubb-patgen/ubb-patgen.c b/ubb-patgen/ubb-patgen.c index 8f54852..7ea0e59 100644 --- a/ubb-patgen/ubb-patgen.c +++ b/ubb-patgen/ubb-patgen.c @@ -26,7 +26,6 @@ #include -#define USE_DMA #define DMA 5 @@ -137,8 +136,6 @@ static int select_freq(struct mmcclk *res, int hz, int rel) /* ----- DMA the pattern --------------------------------------------------- */ -#ifdef USE_DMA - static uint32_t old_dmac; @@ -186,15 +183,6 @@ static void wait_dma_done(void) while (!((DCS(DMA) >> 3) & 1)); /* DCS.TT */ } -#else /* USE_DMA */ - - -static void dma_init(void) {} -static void dma_cleanup(void) {} -static void dma_setup(unsigned long buf, int nibbles) {} - -#endif /* !USE_DMA */ - static void wait_response(void) { @@ -240,9 +228,7 @@ static void mmc_buffer(const struct mmcclk *clk, MSC_CMDAT = (2 << 9) | /* 4 bit bus */ -#ifdef USE_DMA (1 << 8) | /* DMA */ -#endif (1 << 4) | /* write */ (1 << 3) | /* with data transfer */ 1; /* R1 response */ @@ -270,8 +256,6 @@ static void mmc_buffer(const struct mmcclk *clk, PDFUNS = mask; -#ifdef USE_DMA - /* * Send the pattern with DMA. Note that we still have to send the first * pattern, since the static state we begin from may not have been @@ -283,18 +267,6 @@ static void mmc_buffer(const struct mmcclk *clk, 1; /* enable transfer */ wait_dma_done(); - -#else /* USE_DMA */ - - const uint32_t *p; - - for (p = (void *) buf; p != (void *) buf+(nibbles >> 1); p++) { - while ((MSC_STAT >> 7) & 1); - MSC_TXFIFO = *p; - } - -#endif /* !USE_DMA */ - wait_fifo_empty(); wait_shifted(clk); @@ -311,7 +283,6 @@ static void mmc_buffer(const struct mmcclk *clk, static void send_buffer(const struct mmcclk *clk, const uint8_t *buf, int nibbles, uint32_t mask) { -#ifdef USE_DMA unsigned long phys; if (cacheflush((void *) buf, nibbles >> 1, DCACHE)) { @@ -323,9 +294,6 @@ static void send_buffer(const struct mmcclk *clk, phys = physmem_xlat((void *) buf); mmc_buffer(clk, buf[0] >> 4, phys, nibbles, mask); -#else - mmc_buffer(clk, buf[0] >> 4, (unsigned long) buf, nibbles, mask); -#endif }