| Ben Dooks | a21765a | 2007-02-11 18:31:01 +0100 | [diff] [blame] | 1 | /* linux/include/asm-arm/plat-s3c24xx/dma.h | 
| Ben Dooks | 505788c | 2006-09-15 23:42:24 +0100 | [diff] [blame] | 2 | * | 
|  | 3 | * Copyright (C) 2006 Simtec Electronics | 
|  | 4 | *	Ben Dooks <ben@simtec.co.uk> | 
|  | 5 | * | 
|  | 6 | * Samsung S3C24XX DMA support | 
|  | 7 | * | 
|  | 8 | * This program is free software; you can redistribute it and/or modify | 
|  | 9 | * it under the terms of the GNU General Public License version 2 as | 
|  | 10 | * published by the Free Software Foundation. | 
|  | 11 | */ | 
|  | 12 |  | 
|  | 13 | extern struct sysdev_class dma_sysclass; | 
|  | 14 | extern struct s3c2410_dma_chan s3c2410_chans[S3C2410_DMA_CHANNELS]; | 
|  | 15 |  | 
|  | 16 | #define DMA_CH_VALID		(1<<31) | 
| Ben Dooks | 0c6022d | 2007-02-13 13:02:52 +0100 | [diff] [blame^] | 17 | #define DMA_CH_NEVER		(1<<30) | 
| Ben Dooks | 505788c | 2006-09-15 23:42:24 +0100 | [diff] [blame] | 18 |  | 
|  | 19 | struct s3c24xx_dma_addr { | 
|  | 20 | unsigned long		from; | 
|  | 21 | unsigned long		to; | 
|  | 22 | }; | 
|  | 23 |  | 
|  | 24 | /* struct s3c24xx_dma_map | 
|  | 25 | * | 
|  | 26 | * this holds the mapping information for the channel selected | 
|  | 27 | * to be connected to the specified device | 
|  | 28 | */ | 
|  | 29 |  | 
|  | 30 | struct s3c24xx_dma_map { | 
|  | 31 | const char		*name; | 
|  | 32 | struct s3c24xx_dma_addr  hw_addr; | 
|  | 33 |  | 
|  | 34 | unsigned long		 channels[S3C2410_DMA_CHANNELS]; | 
|  | 35 | }; | 
|  | 36 |  | 
|  | 37 | struct s3c24xx_dma_selection { | 
|  | 38 | struct s3c24xx_dma_map	*map; | 
|  | 39 | unsigned long		 map_size; | 
|  | 40 | unsigned long		 dcon_mask; | 
|  | 41 |  | 
|  | 42 | void	(*select)(struct s3c2410_dma_chan *chan, | 
|  | 43 | struct s3c24xx_dma_map *map); | 
|  | 44 | }; | 
|  | 45 |  | 
|  | 46 | extern int s3c24xx_dma_init_map(struct s3c24xx_dma_selection *sel); | 
| Ben Dooks | 0c6022d | 2007-02-13 13:02:52 +0100 | [diff] [blame^] | 47 |  | 
|  | 48 | /* struct s3c24xx_dma_order_ch | 
|  | 49 | * | 
|  | 50 | * channel map for one of the `enum dma_ch` dma channels. the list | 
|  | 51 | * entry contains a set of low-level channel numbers, orred with | 
|  | 52 | * DMA_CH_VALID, which are checked in the order in the array. | 
|  | 53 | */ | 
|  | 54 |  | 
|  | 55 | struct s3c24xx_dma_order_ch { | 
|  | 56 | unsigned int	list[S3C2410_DMA_CHANNELS];	/* list of channels */ | 
|  | 57 | unsigned int	flags;				/* flags */ | 
|  | 58 | }; | 
|  | 59 |  | 
|  | 60 | /* struct s3c24xx_dma_order | 
|  | 61 | * | 
|  | 62 | * information provided by either the core or the board to give the | 
|  | 63 | * dma system a hint on how to allocate channels | 
|  | 64 | */ | 
|  | 65 |  | 
|  | 66 | struct s3c24xx_dma_order { | 
|  | 67 | struct s3c24xx_dma_order_ch	channels[DMACH_MAX]; | 
|  | 68 | }; | 
|  | 69 |  | 
|  | 70 | extern int s3c24xx_dma_order_set(struct s3c24xx_dma_order *map); |