/*1* include/asm-xtensa/dma.h2*3* This file is subject to the terms and conditions of the GNU General Public4* License. See the file "COPYING" in the main directory of this archive5* for more details.6*7* Copyright (C) 2003 - 2005 Tensilica Inc.8*/910#ifndef _XTENSA_DMA_H11#define _XTENSA_DMA_H1213#include <asm/io.h> /* need byte IO */1415/*16* This is only to be defined if we have PC-like DMA.17* By default this is not true on an Xtensa processor,18* however on boards with a PCI bus, such functionality19* might be emulated externally.20*21* NOTE: there still exists driver code that assumes22* this is defined, eg. drivers/sound/soundcard.c (as of 2.4).23*/24#define MAX_DMA_CHANNELS 82526/*27* The maximum virtual address to which DMA transfers28* can be performed on this platform.29*30* NOTE: This is board (platform) specific, not processor-specific!31*32* NOTE: This assumes DMA transfers can only be performed on33* the section of physical memory contiguously mapped in virtual34* space for the kernel. For the Xtensa architecture, this35* means the maximum possible size of this DMA area is36* the size of the statically mapped kernel segment37* (XCHAL_KSEG_{CACHED,BYPASS}_SIZE), ie. 128 MB.38*39* NOTE: When the entire KSEG area is DMA capable, we subtract40* one from the max address so that the virt_to_phys() macro41* works correctly on the address (otherwise the address42* enters another area, and virt_to_phys() may not return43* the value desired).44*/4546#ifndef MAX_DMA_ADDRESS47#define MAX_DMA_ADDRESS (PAGE_OFFSET + XCHAL_KIO_SIZE - 1)48#endif4950/* Reserve and release a DMA channel */51extern int request_dma(unsigned int dmanr, const char * device_id);52extern void free_dma(unsigned int dmanr);5354#endif555657