diff options
Diffstat (limited to 'include/asm-arm/arch-s3c2410/dma.h')
-rw-r--r-- | include/asm-arm/arch-s3c2410/dma.h | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/include/asm-arm/arch-s3c2410/dma.h b/include/asm-arm/arch-s3c2410/dma.h index 3661e465b0a5..7ac224836971 100644 --- a/include/asm-arm/arch-s3c2410/dma.h +++ b/include/asm-arm/arch-s3c2410/dma.h | |||
@@ -23,6 +23,39 @@ | |||
23 | #define MAX_DMA_ADDRESS 0x40000000 | 23 | #define MAX_DMA_ADDRESS 0x40000000 |
24 | #define MAX_DMA_TRANSFER_SIZE 0x100000 /* Data Unit is half word */ | 24 | #define MAX_DMA_TRANSFER_SIZE 0x100000 /* Data Unit is half word */ |
25 | 25 | ||
26 | /* We use `virtual` dma channels to hide the fact we have only a limited | ||
27 | * number of DMA channels, and not of all of them (dependant on the device) | ||
28 | * can be attached to any DMA source. We therefore let the DMA core handle | ||
29 | * the allocation of hardware channels to clients. | ||
30 | */ | ||
31 | |||
32 | enum dma_ch { | ||
33 | DMACH_XD0, | ||
34 | DMACH_XD1, | ||
35 | DMACH_SDI, | ||
36 | DMACH_SPI0, | ||
37 | DMACH_SPI1, | ||
38 | DMACH_UART0, | ||
39 | DMACH_UART1, | ||
40 | DMACH_UART2, | ||
41 | DMACH_TIMER, | ||
42 | DMACH_I2S_IN, | ||
43 | DMACH_I2S_OUT, | ||
44 | DMACH_PCM_IN, | ||
45 | DMACH_PCM_OUT, | ||
46 | DMACH_MIC_IN, | ||
47 | DMACH_USB_EP1, | ||
48 | DMACH_USB_EP2, | ||
49 | DMACH_USB_EP3, | ||
50 | DMACH_USB_EP4, | ||
51 | DMACH_UART0_SRC2, /* s3c2412 second uart sources */ | ||
52 | DMACH_UART1_SRC2, | ||
53 | DMACH_UART2_SRC2, | ||
54 | DMACH_MAX, /* the end entry */ | ||
55 | }; | ||
56 | |||
57 | #define DMACH_LOW_LEVEL (1<<28) /* use this to specifiy hardware ch no */ | ||
58 | |||
26 | /* we have 4 dma channels */ | 59 | /* we have 4 dma channels */ |
27 | #define S3C2410_DMA_CHANNELS (4) | 60 | #define S3C2410_DMA_CHANNELS (4) |
28 | 61 | ||
@@ -149,6 +182,8 @@ struct s3c2410_dma_stats { | |||
149 | unsigned long timeout_failed; | 182 | unsigned long timeout_failed; |
150 | }; | 183 | }; |
151 | 184 | ||
185 | struct s3c2410_dma_map; | ||
186 | |||
152 | /* struct s3c2410_dma_chan | 187 | /* struct s3c2410_dma_chan |
153 | * | 188 | * |
154 | * full state information for each DMA channel | 189 | * full state information for each DMA channel |
@@ -174,6 +209,8 @@ struct s3c2410_dma_chan { | |||
174 | unsigned long load_timeout; | 209 | unsigned long load_timeout; |
175 | unsigned int flags; /* channel flags */ | 210 | unsigned int flags; /* channel flags */ |
176 | 211 | ||
212 | struct s3c24xx_dma_map *map; /* channel hw maps */ | ||
213 | |||
177 | /* channel's hardware position and configuration */ | 214 | /* channel's hardware position and configuration */ |
178 | void __iomem *regs; /* channels registers */ | 215 | void __iomem *regs; /* channels registers */ |
179 | void __iomem *addr_reg; /* data address register */ | 216 | void __iomem *addr_reg; /* data address register */ |
@@ -283,6 +320,7 @@ extern int s3c2410_dma_set_buffdone_fn(dmach_t, s3c2410_dma_cbfn_t rtn); | |||
283 | #define S3C2410_DMA_DCSRC (0x18) | 320 | #define S3C2410_DMA_DCSRC (0x18) |
284 | #define S3C2410_DMA_DCDST (0x1C) | 321 | #define S3C2410_DMA_DCDST (0x1C) |
285 | #define S3C2410_DMA_DMASKTRIG (0x20) | 322 | #define S3C2410_DMA_DMASKTRIG (0x20) |
323 | #define S3C2412_DMA_DMAREQSEL (0x24) | ||
286 | 324 | ||
287 | #define S3C2410_DISRCC_INC (1<<0) | 325 | #define S3C2410_DISRCC_INC (1<<0) |
288 | #define S3C2410_DISRCC_APB (1<<1) | 326 | #define S3C2410_DISRCC_APB (1<<1) |
@@ -349,4 +387,32 @@ extern int s3c2410_dma_set_buffdone_fn(dmach_t, s3c2410_dma_cbfn_t rtn); | |||
349 | #define S3C2440_DCON_CH3_PCMOUT (6<<24) | 387 | #define S3C2440_DCON_CH3_PCMOUT (6<<24) |
350 | #endif | 388 | #endif |
351 | 389 | ||
390 | #ifdef CONFIG_CPU_S3C2412 | ||
391 | |||
392 | #define S3C2412_DMAREQSEL_SRC(x) ((x)<<1) | ||
393 | |||
394 | #define S3C2412_DMAREQSEL_HW (1) | ||
395 | |||
396 | #define S3C2412_DMAREQSEL_SPI0TX S3C2412_DMAREQSEL_SRC(0) | ||
397 | #define S3C2412_DMAREQSEL_SPI0RX S3C2412_DMAREQSEL_SRC(1) | ||
398 | #define S3C2412_DMAREQSEL_SPI1TX S3C2412_DMAREQSEL_SRC(2) | ||
399 | #define S3C2412_DMAREQSEL_SPI1RX S3C2412_DMAREQSEL_SRC(3) | ||
400 | #define S3C2412_DMAREQSEL_I2STX S3C2412_DMAREQSEL_SRC(4) | ||
401 | #define S3C2412_DMAREQSEL_I2SRX S3C2412_DMAREQSEL_SRC(5) | ||
402 | #define S3C2412_DMAREQSEL_TIMER S3C2412_DMAREQSEL_SRC(9) | ||
403 | #define S3C2412_DMAREQSEL_SDI S3C2412_DMAREQSEL_SRC(10) | ||
404 | #define S3C2412_DMAREQSEL_USBEP1 S3C2412_DMAREQSEL_SRC(13) | ||
405 | #define S3C2412_DMAREQSEL_USBEP2 S3C2412_DMAREQSEL_SRC(14) | ||
406 | #define S3C2412_DMAREQSEL_USBEP3 S3C2412_DMAREQSEL_SRC(15) | ||
407 | #define S3C2412_DMAREQSEL_USBEP4 S3C2412_DMAREQSEL_SRC(16) | ||
408 | #define S3C2412_DMAREQSEL_XDREQ0 S3C2412_DMAREQSEL_SRC(17) | ||
409 | #define S3C2412_DMAREQSEL_XDREQ1 S3C2412_DMAREQSEL_SRC(18) | ||
410 | #define S3C2412_DMAREQSEL_UART0_0 S3C2412_DMAREQSEL_SRC(19) | ||
411 | #define S3C2412_DMAREQSEL_UART0_1 S3C2412_DMAREQSEL_SRC(20) | ||
412 | #define S3C2412_DMAREQSEL_UART1_0 S3C2412_DMAREQSEL_SRC(21) | ||
413 | #define S3C2412_DMAREQSEL_UART1_1 S3C2412_DMAREQSEL_SRC(22) | ||
414 | #define S3C2412_DMAREQSEL_UART2_0 S3C2412_DMAREQSEL_SRC(23) | ||
415 | #define S3C2412_DMAREQSEL_UART2_1 S3C2412_DMAREQSEL_SRC(24) | ||
416 | |||
417 | #endif | ||
352 | #endif /* __ASM_ARCH_DMA_H */ | 418 | #endif /* __ASM_ARCH_DMA_H */ |