2010-02-20 23:01:33 +00:00
/* linux/arch/arm/plat-samsung/include/plat/dma-s3c24xx.h
2006-09-15 23:42:24 +01:00
*
* Copyright ( C ) 2006 Simtec Electronics
* Ben Dooks < ben @ simtec . co . uk >
*
2010-02-20 23:01:33 +00:00
* Samsung S3C24XX DMA support - per SoC functions
2006-09-15 23:42:24 +01:00
*
* This program is free software ; you can redistribute it and / or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation .
*/
2009-03-19 15:02:39 +00:00
# include <plat/dma-core.h>
2011-12-21 16:01:38 -08:00
extern struct bus_type dma_subsys ;
2009-03-19 15:02:39 +00:00
extern struct s3c2410_dma_chan s3c2410_chans [ S3C_DMA_CHANNELS ] ;
2006-09-15 23:42:24 +01:00
# define DMA_CH_VALID (1<<31)
2007-02-13 13:02:52 +01:00
# define DMA_CH_NEVER (1<<30)
2006-09-15 23:42:24 +01:00
/* struct s3c24xx_dma_map
*
* this holds the mapping information for the channel selected
* to be connected to the specified device
*/
struct s3c24xx_dma_map {
const char * name ;
2009-03-19 15:02:39 +00:00
unsigned long channels [ S3C_DMA_CHANNELS ] ;
unsigned long channels_rx [ S3C_DMA_CHANNELS ] ;
2006-09-15 23:42:24 +01:00
} ;
struct s3c24xx_dma_selection {
struct s3c24xx_dma_map * map ;
unsigned long map_size ;
unsigned long dcon_mask ;
void ( * select ) ( struct s3c2410_dma_chan * chan ,
struct s3c24xx_dma_map * map ) ;
2008-01-28 13:01:20 +01:00
void ( * direction ) ( struct s3c2410_dma_chan * chan ,
struct s3c24xx_dma_map * map ,
2011-09-02 09:44:44 +09:00
enum dma_data_direction dir ) ;
2006-09-15 23:42:24 +01:00
} ;
extern int s3c24xx_dma_init_map ( struct s3c24xx_dma_selection * sel ) ;
2007-02-13 13:02:52 +01:00
/* struct s3c24xx_dma_order_ch
*
* channel map for one of the ` enum dma_ch ` dma channels . the list
* entry contains a set of low - level channel numbers , orred with
* DMA_CH_VALID , which are checked in the order in the array .
*/
struct s3c24xx_dma_order_ch {
2009-03-19 15:02:39 +00:00
unsigned int list [ S3C_DMA_CHANNELS ] ; /* list of channels */
2007-02-13 13:02:52 +01:00
unsigned int flags ; /* flags */
} ;
/* struct s3c24xx_dma_order
*
* information provided by either the core or the board to give the
* dma system a hint on how to allocate channels
*/
struct s3c24xx_dma_order {
struct s3c24xx_dma_order_ch channels [ DMACH_MAX ] ;
} ;
extern int s3c24xx_dma_order_set ( struct s3c24xx_dma_order * map ) ;
2007-02-17 15:37:14 +01:00
/* DMA init code, called from the cpu support code */
extern int s3c2410_dma_init ( void ) ;
extern int s3c24xx_dma_init ( unsigned int channels , unsigned int irq ,
unsigned int stride ) ;