Mike Frysinger | 66c4cf4 | 2008-02-04 19:26:55 -0500 | [diff] [blame] | 1 | /* |
| 2 | * DMA Masks |
| 3 | */ |
| 4 | |
| 5 | #ifndef __BFIN_PERIPHERAL_DMA__ |
| 6 | #define __BFIN_PERIPHERAL_DMA__ |
| 7 | |
| 8 | /* DMAx_CONFIG, MDMA_yy_CONFIG Masks */ |
| 9 | #define DMAEN 0x0001 /* DMA Channel Enable */ |
| 10 | #define WNR 0x0002 /* Channel Direction (W/R*) */ |
| 11 | #define WDSIZE_8 0x0000 /* Transfer Word Size = 8 */ |
Bob Liu | 6e24a61 | 2012-08-16 11:19:08 +0800 | [diff] [blame] | 12 | |
| 13 | #ifdef CONFIG_BF60x |
| 14 | |
| 15 | #define PSIZE_8 0x00000000 /* Transfer Word Size = 16 */ |
| 16 | #define PSIZE_16 0x00000010 /* Transfer Word Size = 16 */ |
| 17 | #define PSIZE_32 0x00000020 /* Transfer Word Size = 32 */ |
| 18 | #define PSIZE_64 0x00000030 /* Transfer Word Size = 32 */ |
| 19 | #define WDSIZE_16 0x00000100 /* Transfer Word Size = 16 */ |
| 20 | #define WDSIZE_32 0x00000200 /* Transfer Word Size = 32 */ |
| 21 | #define WDSIZE_64 0x00000300 /* Transfer Word Size = 32 */ |
| 22 | #define WDSIZE_128 0x00000400 /* Transfer Word Size = 32 */ |
| 23 | #define WDSIZE_256 0x00000500 /* Transfer Word Size = 32 */ |
| 24 | #define DMA2D 0x04000000 /* DMA Mode (2D/1D*) */ |
| 25 | #define RESTART 0x00000004 /* DMA Buffer Clear SYNC */ |
| 26 | #define DI_EN_X 0x00100000 /* Data Int Enable in X count */ |
| 27 | #define DI_EN_Y 0x00200000 /* Data Int Enable in Y count */ |
| 28 | #define DI_EN_P 0x00300000 /* Data Int Enable in Peri */ |
| 29 | #define DI_EN DI_EN_X /* Data Int Enable */ |
| 30 | #define NDSIZE_0 0x00000000 /* Next Desc Size = 0 */ |
| 31 | #define NDSIZE_1 0x00010000 /* Next Desc Size = 1 */ |
| 32 | #define NDSIZE_2 0x00020000 /* Next Desc Size = 2 */ |
| 33 | #define NDSIZE_3 0x00030000 /* Next Desc Size = 3 */ |
| 34 | #define NDSIZE_4 0x00040000 /* Next Desc Size = 4 */ |
| 35 | #define NDSIZE_5 0x00050000 /* Next Desc Size = 5 */ |
| 36 | #define NDSIZE_6 0x00060000 /* Next Desc Size = 6 */ |
| 37 | #define NDSIZE 0x00070000 /* Next Desc Size */ |
| 38 | #define NDSIZE_OFFSET 16 /* Next Desc Size Offset */ |
| 39 | #define DMAFLOW_LIST 0x00004000 /* Desc List Mode */ |
| 40 | #define DMAFLOW_ARRAY 0x00005000 /* Desc Array Mode */ |
| 41 | #define DMAFLOW_LIST_DEMAND 0x00006000 /* Desc Demand List Mode */ |
| 42 | #define DMAFLOW_ARRAY_DEMAND 0x00007000 /* Desc Demand Array Mode */ |
| 43 | #define DMA_RUN_DFETCH 0x00000100 /* DMA Channel Run (DFETCH) */ |
| 44 | #define DMA_RUN 0x00000200 /* DMA Channel Run */ |
| 45 | #define DMA_RUN_WAIT_TRIG 0x00000300 /* DMA Channel Run (WAIT TRIG)*/ |
| 46 | #define DMA_RUN_WAIT_ACK 0x00000400 /* DMA Channel Run (WAIT ACK) */ |
| 47 | |
| 48 | #else |
| 49 | |
Mike Frysinger | 66c4cf4 | 2008-02-04 19:26:55 -0500 | [diff] [blame] | 50 | #define WDSIZE_16 0x0004 /* Transfer Word Size = 16 */ |
| 51 | #define WDSIZE_32 0x0008 /* Transfer Word Size = 32 */ |
Bob Liu | 6e24a61 | 2012-08-16 11:19:08 +0800 | [diff] [blame] | 52 | #define PSIZE_16 WDSIZE_16 |
| 53 | #define PSIZE_32 WDSIZE_32 |
Mike Frysinger | 66c4cf4 | 2008-02-04 19:26:55 -0500 | [diff] [blame] | 54 | #define DMA2D 0x0010 /* DMA Mode (2D/1D*) */ |
| 55 | #define RESTART 0x0020 /* DMA Buffer Clear */ |
| 56 | #define DI_SEL 0x0040 /* Data Interrupt Timing Select */ |
| 57 | #define DI_EN 0x0080 /* Data Interrupt Enable */ |
| 58 | #define NDSIZE 0x0F00 /* Next Descriptor bitmask */ |
Bob Liu | 6e24a61 | 2012-08-16 11:19:08 +0800 | [diff] [blame] | 59 | #define NDSIZE_0 0x0000 /* Next Descriptor Size = 0 */ |
Mike Frysinger | 66c4cf4 | 2008-02-04 19:26:55 -0500 | [diff] [blame] | 60 | #define NDSIZE_1 0x0100 /* Next Descriptor Size = 1 */ |
| 61 | #define NDSIZE_2 0x0200 /* Next Descriptor Size = 2 */ |
| 62 | #define NDSIZE_3 0x0300 /* Next Descriptor Size = 3 */ |
| 63 | #define NDSIZE_4 0x0400 /* Next Descriptor Size = 4 */ |
| 64 | #define NDSIZE_5 0x0500 /* Next Descriptor Size = 5 */ |
| 65 | #define NDSIZE_6 0x0600 /* Next Descriptor Size = 6 */ |
| 66 | #define NDSIZE_7 0x0700 /* Next Descriptor Size = 7 */ |
| 67 | #define NDSIZE_8 0x0800 /* Next Descriptor Size = 8 */ |
| 68 | #define NDSIZE_9 0x0900 /* Next Descriptor Size = 9 */ |
Mike Frysinger | 66c4cf4 | 2008-02-04 19:26:55 -0500 | [diff] [blame] | 69 | #define FLOW_ARRAY 0x4000 /* Descriptor Array Mode */ |
| 70 | #define FLOW_SMALL 0x6000 /* Small Model Descriptor List Mode */ |
| 71 | #define FLOW_LARGE 0x7000 /* Large Model Descriptor List Mode */ |
| 72 | |
| 73 | #define DMAEN_P 0 /* Channel Enable */ |
| 74 | #define WNR_P 1 /* Channel Direction (W/R*) */ |
Bob Liu | 6e24a61 | 2012-08-16 11:19:08 +0800 | [diff] [blame] | 75 | #define WDSIZE_P 2 /* Transfer Word Size */ |
Mike Frysinger | 66c4cf4 | 2008-02-04 19:26:55 -0500 | [diff] [blame] | 76 | #define DMA2D_P 4 /* 2D/1D* Mode */ |
| 77 | #define RESTART_P 5 /* Restart */ |
| 78 | #define DI_SEL_P 6 /* Data Interrupt Select */ |
| 79 | #define DI_EN_P 7 /* Data Interrupt Enable */ |
| 80 | |
| 81 | /* DMAx_IRQ_STATUS, MDMA_yy_IRQ_STATUS Masks */ |
| 82 | #define DMA_DONE 0x0001 /* DMA Completion Interrupt Status */ |
| 83 | #define DMA_ERR 0x0002 /* DMA Error Interrupt Status */ |
| 84 | #define DFETCH 0x0004 /* DMA Descriptor Fetch Indicator */ |
| 85 | #define DMA_RUN 0x0008 /* DMA Channel Running Indicator */ |
| 86 | |
Bob Liu | 6e24a61 | 2012-08-16 11:19:08 +0800 | [diff] [blame] | 87 | #endif |
| 88 | #define DMAFLOW 0x7000 /* Flow Control */ |
| 89 | #define FLOW_STOP 0x0000 /* Stop Mode */ |
| 90 | #define FLOW_AUTO 0x1000 /* Autobuffer Mode */ |
| 91 | |
Mike Frysinger | 66c4cf4 | 2008-02-04 19:26:55 -0500 | [diff] [blame] | 92 | #define DMA_DONE_P 0 /* DMA Done Indicator */ |
| 93 | #define DMA_ERR_P 1 /* DMA Error Indicator */ |
| 94 | #define DFETCH_P 2 /* Descriptor Fetch Indicator */ |
| 95 | #define DMA_RUN_P 3 /* DMA Running Indicator */ |
| 96 | |
| 97 | /* DMAx_PERIPHERAL_MAP, MDMA_yy_PERIPHERAL_MAP Masks */ |
Bob Liu | 6e24a61 | 2012-08-16 11:19:08 +0800 | [diff] [blame] | 98 | #define CTYPE 0x0040 /* DMA Channel Type (Mem/Peri) */ |
| 99 | #define CTYPE_P 6 /* DMA Channel Type BIT POSITION */ |
Mike Frysinger | 66c4cf4 | 2008-02-04 19:26:55 -0500 | [diff] [blame] | 100 | #define PMAP 0xF000 /* Peripheral Mapped To This Channel */ |
| 101 | |
| 102 | #endif |