/* * BRIEF MODULE DESCRIPTION * Defines for using and allocating DMA channels on the Alchemy * Au1x00 MIPS processors. * * Copyright 2000, 2008 MontaVista Software Inc. * Author: MontaVista Software, Inc. <source@mvista.com> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation; either version 2 of the License, or (at your * option) any later version. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 675 Mass Ave, Cambridge, MA 02139, USA. *
*/ #ifndef __ASM_AU1000_DMA_H #define __ASM_AU1000_DMA_H
#include <linux/io.h> /* need byte IO */ #include <linux/spinlock.h> /* And spinlocks */ #include <linux/delay.h>
if (!chan) return;
__raw_writel(DMA_GO, chan->io + DMA_MODE_CLEAR);
/* Poll the halt bit */ for (i = 0; i < DMA_HALT_POLL; i++) if (__raw_readl(chan->io + DMA_MODE_READ) & DMA_HALT) break; if (i == DMA_HALT_POLL)
printk(KERN_INFO "halt_dma: HALT poll expired!\n");
}
/* * Set the device FIFO address for a specific DMA channel - only * applicable to GPO4 and GPO5. All the other devices have fixed * FIFO addresses.
*/ staticinlinevoid set_dma_fifo_addr(unsignedint dmanr, unsignedint a)
{ struct dma_chan *chan = get_dma_chan(dmanr);
if (!chan) return;
if (chan->mode & DMA_DS) /* second bank of device IDs */ return;
if (chan->dev_id != DMA_ID_GP04 && chan->dev_id != DMA_ID_GP05) return;
if (!chan) return;
__raw_writel(DMA_D1, chan->io + DMA_MODE_CLEAR);
}
/* * This does nothing - not applicable to Au1000 DMA.
*/ staticinlinevoid set_dma_page(unsignedint dmanr, char pagenr)
{
}
/* * Set Buffer 0 transfer address for specific DMA channel.
*/ staticinlinevoid set_dma_addr0(unsignedint dmanr, unsignedint a)
{ struct dma_chan *chan = get_dma_chan(dmanr);
if (!chan) return;
__raw_writel(a, chan->io + DMA_BUFFER0_START);
}
/* * Set Buffer 1 transfer address for specific DMA channel.
*/ staticinlinevoid set_dma_addr1(unsignedint dmanr, unsignedint a)
{ struct dma_chan *chan = get_dma_chan(dmanr);
if (!chan) return;
__raw_writel(a, chan->io + DMA_BUFFER1_START);
}
/* * Set Buffer 0 transfer size (max 64k) for a specific DMA channel.
*/ staticinlinevoid set_dma_count0(unsignedint dmanr, unsignedint count)
{ struct dma_chan *chan = get_dma_chan(dmanr);
/* * Set both buffer transfer sizes (max 64k) for a specific DMA channel.
*/ staticinlinevoid set_dma_count(unsignedint dmanr, unsignedint count)
{ struct dma_chan *chan = get_dma_chan(dmanr);
/* * Returns which buffer has its done bit set in the mode register. * Returns -1 if neither or both done bits set.
*/ staticinlineunsignedint get_dma_buffer_done(unsignedint dmanr)
{ struct dma_chan *chan = get_dma_chan(dmanr);
/* * Get DMA residue count. Returns the number of _bytes_ left to transfer.
*/ staticinlineint get_dma_residue(unsignedint dmanr)
{ int curBufCntReg, count; struct dma_chan *chan = get_dma_chan(dmanr);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.