diff options
-rw-r--r-- | arch/arm/mach-ux500/board-mop500-audio.c | 18 | ||||
-rw-r--r-- | arch/arm/mach-ux500/board-mop500-sdi.c | 24 | ||||
-rw-r--r-- | arch/arm/mach-ux500/board-mop500.c | 33 | ||||
-rw-r--r-- | arch/arm/mach-ux500/cpu-db8500.c | 32 | ||||
-rw-r--r-- | arch/arm/mach-ux500/devices-db8500.c | 120 | ||||
-rw-r--r-- | arch/arm/mach-ux500/ste-dma40-db8500.h | 193 | ||||
-rw-r--r-- | arch/arm/mach-ux500/usb.c | 10 | ||||
-rw-r--r-- | drivers/dma/ste_dma40.c | 93 | ||||
-rw-r--r-- | drivers/dma/ste_dma40_ll.c | 4 | ||||
-rw-r--r-- | include/linux/platform_data/dma-ste-dma40.h | 6 |
10 files changed, 207 insertions, 326 deletions
diff --git a/arch/arm/mach-ux500/board-mop500-audio.c b/arch/arm/mach-ux500/board-mop500-audio.c index aba9e5692958..5a968fa8b90c 100644 --- a/arch/arm/mach-ux500/board-mop500-audio.c +++ b/arch/arm/mach-ux500/board-mop500-audio.c | |||
@@ -23,8 +23,7 @@ static struct stedma40_chan_cfg msp0_dma_rx = { | |||
23 | .high_priority = true, | 23 | .high_priority = true, |
24 | .dir = STEDMA40_PERIPH_TO_MEM, | 24 | .dir = STEDMA40_PERIPH_TO_MEM, |
25 | 25 | ||
26 | .src_dev_type = DB8500_DMA_DEV31_MSP0_RX_SLIM0_CH0_RX, | 26 | .dev_type = DB8500_DMA_DEV31_MSP0_SLIM0_CH0, |
27 | .dst_dev_type = STEDMA40_DEV_DST_MEMORY, | ||
28 | 27 | ||
29 | .src_info.psize = STEDMA40_PSIZE_LOG_4, | 28 | .src_info.psize = STEDMA40_PSIZE_LOG_4, |
30 | .dst_info.psize = STEDMA40_PSIZE_LOG_4, | 29 | .dst_info.psize = STEDMA40_PSIZE_LOG_4, |
@@ -36,8 +35,7 @@ static struct stedma40_chan_cfg msp0_dma_tx = { | |||
36 | .high_priority = true, | 35 | .high_priority = true, |
37 | .dir = STEDMA40_MEM_TO_PERIPH, | 36 | .dir = STEDMA40_MEM_TO_PERIPH, |
38 | 37 | ||
39 | .src_dev_type = STEDMA40_DEV_DST_MEMORY, | 38 | .dev_type = DB8500_DMA_DEV31_MSP0_SLIM0_CH0, |
40 | .dst_dev_type = DB8500_DMA_DEV31_MSP0_TX_SLIM0_CH0_TX, | ||
41 | 39 | ||
42 | .src_info.psize = STEDMA40_PSIZE_LOG_4, | 40 | .src_info.psize = STEDMA40_PSIZE_LOG_4, |
43 | .dst_info.psize = STEDMA40_PSIZE_LOG_4, | 41 | .dst_info.psize = STEDMA40_PSIZE_LOG_4, |
@@ -55,8 +53,7 @@ static struct stedma40_chan_cfg msp1_dma_rx = { | |||
55 | .high_priority = true, | 53 | .high_priority = true, |
56 | .dir = STEDMA40_PERIPH_TO_MEM, | 54 | .dir = STEDMA40_PERIPH_TO_MEM, |
57 | 55 | ||
58 | .src_dev_type = DB8500_DMA_DEV30_MSP3_RX, | 56 | .dev_type = DB8500_DMA_DEV30_MSP3, |
59 | .dst_dev_type = STEDMA40_DEV_DST_MEMORY, | ||
60 | 57 | ||
61 | .src_info.psize = STEDMA40_PSIZE_LOG_4, | 58 | .src_info.psize = STEDMA40_PSIZE_LOG_4, |
62 | .dst_info.psize = STEDMA40_PSIZE_LOG_4, | 59 | .dst_info.psize = STEDMA40_PSIZE_LOG_4, |
@@ -68,8 +65,7 @@ static struct stedma40_chan_cfg msp1_dma_tx = { | |||
68 | .high_priority = true, | 65 | .high_priority = true, |
69 | .dir = STEDMA40_MEM_TO_PERIPH, | 66 | .dir = STEDMA40_MEM_TO_PERIPH, |
70 | 67 | ||
71 | .src_dev_type = STEDMA40_DEV_DST_MEMORY, | 68 | .dev_type = DB8500_DMA_DEV30_MSP1, |
72 | .dst_dev_type = DB8500_DMA_DEV30_MSP1_TX, | ||
73 | 69 | ||
74 | .src_info.psize = STEDMA40_PSIZE_LOG_4, | 70 | .src_info.psize = STEDMA40_PSIZE_LOG_4, |
75 | .dst_info.psize = STEDMA40_PSIZE_LOG_4, | 71 | .dst_info.psize = STEDMA40_PSIZE_LOG_4, |
@@ -87,8 +83,7 @@ static struct stedma40_chan_cfg msp2_dma_rx = { | |||
87 | .high_priority = true, | 83 | .high_priority = true, |
88 | .dir = STEDMA40_PERIPH_TO_MEM, | 84 | .dir = STEDMA40_PERIPH_TO_MEM, |
89 | 85 | ||
90 | .src_dev_type = DB8500_DMA_DEV14_MSP2_RX, | 86 | .dev_type = DB8500_DMA_DEV14_MSP2, |
91 | .dst_dev_type = STEDMA40_DEV_DST_MEMORY, | ||
92 | 87 | ||
93 | /* MSP2 DMA doesn't work with PSIZE == 4 on DB8500v2 */ | 88 | /* MSP2 DMA doesn't work with PSIZE == 4 on DB8500v2 */ |
94 | .src_info.psize = STEDMA40_PSIZE_LOG_1, | 89 | .src_info.psize = STEDMA40_PSIZE_LOG_1, |
@@ -101,8 +96,7 @@ static struct stedma40_chan_cfg msp2_dma_tx = { | |||
101 | .high_priority = true, | 96 | .high_priority = true, |
102 | .dir = STEDMA40_MEM_TO_PERIPH, | 97 | .dir = STEDMA40_MEM_TO_PERIPH, |
103 | 98 | ||
104 | .src_dev_type = STEDMA40_DEV_DST_MEMORY, | 99 | .dev_type = DB8500_DMA_DEV14_MSP2, |
105 | .dst_dev_type = DB8500_DMA_DEV14_MSP2_TX, | ||
106 | 100 | ||
107 | .src_info.psize = STEDMA40_PSIZE_LOG_4, | 101 | .src_info.psize = STEDMA40_PSIZE_LOG_4, |
108 | .dst_info.psize = STEDMA40_PSIZE_LOG_4, | 102 | .dst_info.psize = STEDMA40_PSIZE_LOG_4, |
diff --git a/arch/arm/mach-ux500/board-mop500-sdi.c b/arch/arm/mach-ux500/board-mop500-sdi.c index 0ef38775a0c1..4e30b6dc9ac5 100644 --- a/arch/arm/mach-ux500/board-mop500-sdi.c +++ b/arch/arm/mach-ux500/board-mop500-sdi.c | |||
@@ -35,8 +35,7 @@ | |||
35 | struct stedma40_chan_cfg mop500_sdi0_dma_cfg_rx = { | 35 | struct stedma40_chan_cfg mop500_sdi0_dma_cfg_rx = { |
36 | .mode = STEDMA40_MODE_LOGICAL, | 36 | .mode = STEDMA40_MODE_LOGICAL, |
37 | .dir = STEDMA40_PERIPH_TO_MEM, | 37 | .dir = STEDMA40_PERIPH_TO_MEM, |
38 | .src_dev_type = DB8500_DMA_DEV29_SD_MM0_RX, | 38 | .dev_type = DB8500_DMA_DEV29_SD_MM0, |
39 | .dst_dev_type = STEDMA40_DEV_DST_MEMORY, | ||
40 | .src_info.data_width = STEDMA40_WORD_WIDTH, | 39 | .src_info.data_width = STEDMA40_WORD_WIDTH, |
41 | .dst_info.data_width = STEDMA40_WORD_WIDTH, | 40 | .dst_info.data_width = STEDMA40_WORD_WIDTH, |
42 | }; | 41 | }; |
@@ -44,8 +43,7 @@ struct stedma40_chan_cfg mop500_sdi0_dma_cfg_rx = { | |||
44 | static struct stedma40_chan_cfg mop500_sdi0_dma_cfg_tx = { | 43 | static struct stedma40_chan_cfg mop500_sdi0_dma_cfg_tx = { |
45 | .mode = STEDMA40_MODE_LOGICAL, | 44 | .mode = STEDMA40_MODE_LOGICAL, |
46 | .dir = STEDMA40_MEM_TO_PERIPH, | 45 | .dir = STEDMA40_MEM_TO_PERIPH, |
47 | .src_dev_type = STEDMA40_DEV_SRC_MEMORY, | 46 | .dev_type = DB8500_DMA_DEV29_SD_MM0, |
48 | .dst_dev_type = DB8500_DMA_DEV29_SD_MM0_TX, | ||
49 | .src_info.data_width = STEDMA40_WORD_WIDTH, | 47 | .src_info.data_width = STEDMA40_WORD_WIDTH, |
50 | .dst_info.data_width = STEDMA40_WORD_WIDTH, | 48 | .dst_info.data_width = STEDMA40_WORD_WIDTH, |
51 | }; | 49 | }; |
@@ -88,8 +86,7 @@ void mop500_sdi_tc35892_init(struct device *parent) | |||
88 | static struct stedma40_chan_cfg sdi1_dma_cfg_rx = { | 86 | static struct stedma40_chan_cfg sdi1_dma_cfg_rx = { |
89 | .mode = STEDMA40_MODE_LOGICAL, | 87 | .mode = STEDMA40_MODE_LOGICAL, |
90 | .dir = STEDMA40_PERIPH_TO_MEM, | 88 | .dir = STEDMA40_PERIPH_TO_MEM, |
91 | .src_dev_type = DB8500_DMA_DEV32_SD_MM1_RX, | 89 | .dev_type = DB8500_DMA_DEV32_SD_MM1, |
92 | .dst_dev_type = STEDMA40_DEV_DST_MEMORY, | ||
93 | .src_info.data_width = STEDMA40_WORD_WIDTH, | 90 | .src_info.data_width = STEDMA40_WORD_WIDTH, |
94 | .dst_info.data_width = STEDMA40_WORD_WIDTH, | 91 | .dst_info.data_width = STEDMA40_WORD_WIDTH, |
95 | }; | 92 | }; |
@@ -97,8 +94,7 @@ static struct stedma40_chan_cfg sdi1_dma_cfg_rx = { | |||
97 | static struct stedma40_chan_cfg sdi1_dma_cfg_tx = { | 94 | static struct stedma40_chan_cfg sdi1_dma_cfg_tx = { |
98 | .mode = STEDMA40_MODE_LOGICAL, | 95 | .mode = STEDMA40_MODE_LOGICAL, |
99 | .dir = STEDMA40_MEM_TO_PERIPH, | 96 | .dir = STEDMA40_MEM_TO_PERIPH, |
100 | .src_dev_type = STEDMA40_DEV_SRC_MEMORY, | 97 | .dev_type = DB8500_DMA_DEV32_SD_MM1, |
101 | .dst_dev_type = DB8500_DMA_DEV32_SD_MM1_TX, | ||
102 | .src_info.data_width = STEDMA40_WORD_WIDTH, | 98 | .src_info.data_width = STEDMA40_WORD_WIDTH, |
103 | .dst_info.data_width = STEDMA40_WORD_WIDTH, | 99 | .dst_info.data_width = STEDMA40_WORD_WIDTH, |
104 | }; | 100 | }; |
@@ -125,8 +121,7 @@ struct mmci_platform_data mop500_sdi1_data = { | |||
125 | struct stedma40_chan_cfg mop500_sdi2_dma_cfg_rx = { | 121 | struct stedma40_chan_cfg mop500_sdi2_dma_cfg_rx = { |
126 | .mode = STEDMA40_MODE_LOGICAL, | 122 | .mode = STEDMA40_MODE_LOGICAL, |
127 | .dir = STEDMA40_PERIPH_TO_MEM, | 123 | .dir = STEDMA40_PERIPH_TO_MEM, |
128 | .src_dev_type = DB8500_DMA_DEV28_SD_MM2_RX, | 124 | .dev_type = DB8500_DMA_DEV28_SD_MM2, |
129 | .dst_dev_type = STEDMA40_DEV_DST_MEMORY, | ||
130 | .src_info.data_width = STEDMA40_WORD_WIDTH, | 125 | .src_info.data_width = STEDMA40_WORD_WIDTH, |
131 | .dst_info.data_width = STEDMA40_WORD_WIDTH, | 126 | .dst_info.data_width = STEDMA40_WORD_WIDTH, |
132 | }; | 127 | }; |
@@ -134,8 +129,7 @@ struct stedma40_chan_cfg mop500_sdi2_dma_cfg_rx = { | |||
134 | static struct stedma40_chan_cfg mop500_sdi2_dma_cfg_tx = { | 129 | static struct stedma40_chan_cfg mop500_sdi2_dma_cfg_tx = { |
135 | .mode = STEDMA40_MODE_LOGICAL, | 130 | .mode = STEDMA40_MODE_LOGICAL, |
136 | .dir = STEDMA40_MEM_TO_PERIPH, | 131 | .dir = STEDMA40_MEM_TO_PERIPH, |
137 | .src_dev_type = STEDMA40_DEV_SRC_MEMORY, | 132 | .dev_type = DB8500_DMA_DEV28_SD_MM2, |
138 | .dst_dev_type = DB8500_DMA_DEV28_SD_MM2_TX, | ||
139 | .src_info.data_width = STEDMA40_WORD_WIDTH, | 133 | .src_info.data_width = STEDMA40_WORD_WIDTH, |
140 | .dst_info.data_width = STEDMA40_WORD_WIDTH, | 134 | .dst_info.data_width = STEDMA40_WORD_WIDTH, |
141 | }; | 135 | }; |
@@ -163,8 +157,7 @@ struct mmci_platform_data mop500_sdi2_data = { | |||
163 | struct stedma40_chan_cfg mop500_sdi4_dma_cfg_rx = { | 157 | struct stedma40_chan_cfg mop500_sdi4_dma_cfg_rx = { |
164 | .mode = STEDMA40_MODE_LOGICAL, | 158 | .mode = STEDMA40_MODE_LOGICAL, |
165 | .dir = STEDMA40_PERIPH_TO_MEM, | 159 | .dir = STEDMA40_PERIPH_TO_MEM, |
166 | .src_dev_type = DB8500_DMA_DEV42_SD_MM4_RX, | 160 | .dev_type = DB8500_DMA_DEV42_SD_MM4, |
167 | .dst_dev_type = STEDMA40_DEV_DST_MEMORY, | ||
168 | .src_info.data_width = STEDMA40_WORD_WIDTH, | 161 | .src_info.data_width = STEDMA40_WORD_WIDTH, |
169 | .dst_info.data_width = STEDMA40_WORD_WIDTH, | 162 | .dst_info.data_width = STEDMA40_WORD_WIDTH, |
170 | }; | 163 | }; |
@@ -172,8 +165,7 @@ struct stedma40_chan_cfg mop500_sdi4_dma_cfg_rx = { | |||
172 | static struct stedma40_chan_cfg mop500_sdi4_dma_cfg_tx = { | 165 | static struct stedma40_chan_cfg mop500_sdi4_dma_cfg_tx = { |
173 | .mode = STEDMA40_MODE_LOGICAL, | 166 | .mode = STEDMA40_MODE_LOGICAL, |
174 | .dir = STEDMA40_MEM_TO_PERIPH, | 167 | .dir = STEDMA40_MEM_TO_PERIPH, |
175 | .src_dev_type = STEDMA40_DEV_SRC_MEMORY, | 168 | .dev_type = DB8500_DMA_DEV42_SD_MM4, |
176 | .dst_dev_type = DB8500_DMA_DEV42_SD_MM4_TX, | ||
177 | .src_info.data_width = STEDMA40_WORD_WIDTH, | 169 | .src_info.data_width = STEDMA40_WORD_WIDTH, |
178 | .dst_info.data_width = STEDMA40_WORD_WIDTH, | 170 | .dst_info.data_width = STEDMA40_WORD_WIDTH, |
179 | }; | 171 | }; |
diff --git a/arch/arm/mach-ux500/board-mop500.c b/arch/arm/mach-ux500/board-mop500.c index 3cd555ac6d0a..871e61517fb2 100644 --- a/arch/arm/mach-ux500/board-mop500.c +++ b/arch/arm/mach-ux500/board-mop500.c | |||
@@ -425,8 +425,7 @@ void mop500_snowball_ethernet_clock_enable(void) | |||
425 | static struct cryp_platform_data u8500_cryp1_platform_data = { | 425 | static struct cryp_platform_data u8500_cryp1_platform_data = { |
426 | .mem_to_engine = { | 426 | .mem_to_engine = { |
427 | .dir = STEDMA40_MEM_TO_PERIPH, | 427 | .dir = STEDMA40_MEM_TO_PERIPH, |
428 | .src_dev_type = STEDMA40_DEV_SRC_MEMORY, | 428 | .dev_type = DB8500_DMA_DEV48_CAC1, |
429 | .dst_dev_type = DB8500_DMA_DEV48_CAC1_TX, | ||
430 | .src_info.data_width = STEDMA40_WORD_WIDTH, | 429 | .src_info.data_width = STEDMA40_WORD_WIDTH, |
431 | .dst_info.data_width = STEDMA40_WORD_WIDTH, | 430 | .dst_info.data_width = STEDMA40_WORD_WIDTH, |
432 | .mode = STEDMA40_MODE_LOGICAL, | 431 | .mode = STEDMA40_MODE_LOGICAL, |
@@ -435,8 +434,7 @@ static struct cryp_platform_data u8500_cryp1_platform_data = { | |||
435 | }, | 434 | }, |
436 | .engine_to_mem = { | 435 | .engine_to_mem = { |
437 | .dir = STEDMA40_PERIPH_TO_MEM, | 436 | .dir = STEDMA40_PERIPH_TO_MEM, |
438 | .src_dev_type = DB8500_DMA_DEV48_CAC1_RX, | 437 | .dev_type = DB8500_DMA_DEV48_CAC1, |
439 | .dst_dev_type = STEDMA40_DEV_DST_MEMORY, | ||
440 | .src_info.data_width = STEDMA40_WORD_WIDTH, | 438 | .src_info.data_width = STEDMA40_WORD_WIDTH, |
441 | .dst_info.data_width = STEDMA40_WORD_WIDTH, | 439 | .dst_info.data_width = STEDMA40_WORD_WIDTH, |
442 | .mode = STEDMA40_MODE_LOGICAL, | 440 | .mode = STEDMA40_MODE_LOGICAL, |
@@ -447,8 +445,7 @@ static struct cryp_platform_data u8500_cryp1_platform_data = { | |||
447 | 445 | ||
448 | static struct stedma40_chan_cfg u8500_hash_dma_cfg_tx = { | 446 | static struct stedma40_chan_cfg u8500_hash_dma_cfg_tx = { |
449 | .dir = STEDMA40_MEM_TO_PERIPH, | 447 | .dir = STEDMA40_MEM_TO_PERIPH, |
450 | .src_dev_type = STEDMA40_DEV_SRC_MEMORY, | 448 | .dev_type = DB8500_DMA_DEV50_HAC1_TX, |
451 | .dst_dev_type = DB8500_DMA_DEV50_HAC1_TX, | ||
452 | .src_info.data_width = STEDMA40_WORD_WIDTH, | 449 | .src_info.data_width = STEDMA40_WORD_WIDTH, |
453 | .dst_info.data_width = STEDMA40_WORD_WIDTH, | 450 | .dst_info.data_width = STEDMA40_WORD_WIDTH, |
454 | .mode = STEDMA40_MODE_LOGICAL, | 451 | .mode = STEDMA40_MODE_LOGICAL, |
@@ -471,8 +468,7 @@ static struct platform_device *mop500_platform_devs[] __initdata = { | |||
471 | static struct stedma40_chan_cfg ssp0_dma_cfg_rx = { | 468 | static struct stedma40_chan_cfg ssp0_dma_cfg_rx = { |
472 | .mode = STEDMA40_MODE_LOGICAL, | 469 | .mode = STEDMA40_MODE_LOGICAL, |
473 | .dir = STEDMA40_PERIPH_TO_MEM, | 470 | .dir = STEDMA40_PERIPH_TO_MEM, |
474 | .src_dev_type = DB8500_DMA_DEV8_SSP0_RX, | 471 | .dev_type = DB8500_DMA_DEV8_SSP0, |
475 | .dst_dev_type = STEDMA40_DEV_DST_MEMORY, | ||
476 | .src_info.data_width = STEDMA40_BYTE_WIDTH, | 472 | .src_info.data_width = STEDMA40_BYTE_WIDTH, |
477 | .dst_info.data_width = STEDMA40_BYTE_WIDTH, | 473 | .dst_info.data_width = STEDMA40_BYTE_WIDTH, |
478 | }; | 474 | }; |
@@ -480,8 +476,7 @@ static struct stedma40_chan_cfg ssp0_dma_cfg_rx = { | |||
480 | static struct stedma40_chan_cfg ssp0_dma_cfg_tx = { | 476 | static struct stedma40_chan_cfg ssp0_dma_cfg_tx = { |
481 | .mode = STEDMA40_MODE_LOGICAL, | 477 | .mode = STEDMA40_MODE_LOGICAL, |
482 | .dir = STEDMA40_MEM_TO_PERIPH, | 478 | .dir = STEDMA40_MEM_TO_PERIPH, |
483 | .src_dev_type = STEDMA40_DEV_SRC_MEMORY, | 479 | .dev_type = DB8500_DMA_DEV8_SSP0, |
484 | .dst_dev_type = DB8500_DMA_DEV8_SSP0_TX, | ||
485 | .src_info.data_width = STEDMA40_BYTE_WIDTH, | 480 | .src_info.data_width = STEDMA40_BYTE_WIDTH, |
486 | .dst_info.data_width = STEDMA40_BYTE_WIDTH, | 481 | .dst_info.data_width = STEDMA40_BYTE_WIDTH, |
487 | }; | 482 | }; |
@@ -512,8 +507,7 @@ static void __init mop500_spi_init(struct device *parent) | |||
512 | static struct stedma40_chan_cfg uart0_dma_cfg_rx = { | 507 | static struct stedma40_chan_cfg uart0_dma_cfg_rx = { |
513 | .mode = STEDMA40_MODE_LOGICAL, | 508 | .mode = STEDMA40_MODE_LOGICAL, |
514 | .dir = STEDMA40_PERIPH_TO_MEM, | 509 | .dir = STEDMA40_PERIPH_TO_MEM, |
515 | .src_dev_type = DB8500_DMA_DEV13_UART0_RX, | 510 | .dev_type = DB8500_DMA_DEV13_UART0, |
516 | .dst_dev_type = STEDMA40_DEV_DST_MEMORY, | ||
517 | .src_info.data_width = STEDMA40_BYTE_WIDTH, | 511 | .src_info.data_width = STEDMA40_BYTE_WIDTH, |
518 | .dst_info.data_width = STEDMA40_BYTE_WIDTH, | 512 | .dst_info.data_width = STEDMA40_BYTE_WIDTH, |
519 | }; | 513 | }; |
@@ -521,8 +515,7 @@ static struct stedma40_chan_cfg uart0_dma_cfg_rx = { | |||
521 | static struct stedma40_chan_cfg uart0_dma_cfg_tx = { | 515 | static struct stedma40_chan_cfg uart0_dma_cfg_tx = { |
522 | .mode = STEDMA40_MODE_LOGICAL, | 516 | .mode = STEDMA40_MODE_LOGICAL, |
523 | .dir = STEDMA40_MEM_TO_PERIPH, | 517 | .dir = STEDMA40_MEM_TO_PERIPH, |
524 | .src_dev_type = STEDMA40_DEV_SRC_MEMORY, | 518 | .dev_type = DB8500_DMA_DEV13_UART0, |
525 | .dst_dev_type = DB8500_DMA_DEV13_UART0_TX, | ||
526 | .src_info.data_width = STEDMA40_BYTE_WIDTH, | 519 | .src_info.data_width = STEDMA40_BYTE_WIDTH, |
527 | .dst_info.data_width = STEDMA40_BYTE_WIDTH, | 520 | .dst_info.data_width = STEDMA40_BYTE_WIDTH, |
528 | }; | 521 | }; |
@@ -530,8 +523,7 @@ static struct stedma40_chan_cfg uart0_dma_cfg_tx = { | |||
530 | static struct stedma40_chan_cfg uart1_dma_cfg_rx = { | 523 | static struct stedma40_chan_cfg uart1_dma_cfg_rx = { |
531 | .mode = STEDMA40_MODE_LOGICAL, | 524 | .mode = STEDMA40_MODE_LOGICAL, |
532 | .dir = STEDMA40_PERIPH_TO_MEM, | 525 | .dir = STEDMA40_PERIPH_TO_MEM, |
533 | .src_dev_type = DB8500_DMA_DEV12_UART1_RX, | 526 | .dev_type = DB8500_DMA_DEV12_UART1, |
534 | .dst_dev_type = STEDMA40_DEV_DST_MEMORY, | ||
535 | .src_info.data_width = STEDMA40_BYTE_WIDTH, | 527 | .src_info.data_width = STEDMA40_BYTE_WIDTH, |
536 | .dst_info.data_width = STEDMA40_BYTE_WIDTH, | 528 | .dst_info.data_width = STEDMA40_BYTE_WIDTH, |
537 | }; | 529 | }; |
@@ -539,8 +531,7 @@ static struct stedma40_chan_cfg uart1_dma_cfg_rx = { | |||
539 | static struct stedma40_chan_cfg uart1_dma_cfg_tx = { | 531 | static struct stedma40_chan_cfg uart1_dma_cfg_tx = { |
540 | .mode = STEDMA40_MODE_LOGICAL, | 532 | .mode = STEDMA40_MODE_LOGICAL, |
541 | .dir = STEDMA40_MEM_TO_PERIPH, | 533 | .dir = STEDMA40_MEM_TO_PERIPH, |
542 | .src_dev_type = STEDMA40_DEV_SRC_MEMORY, | 534 | .dev_type = DB8500_DMA_DEV12_UART1, |
543 | .dst_dev_type = DB8500_DMA_DEV12_UART1_TX, | ||
544 | .src_info.data_width = STEDMA40_BYTE_WIDTH, | 535 | .src_info.data_width = STEDMA40_BYTE_WIDTH, |
545 | .dst_info.data_width = STEDMA40_BYTE_WIDTH, | 536 | .dst_info.data_width = STEDMA40_BYTE_WIDTH, |
546 | }; | 537 | }; |
@@ -548,8 +539,7 @@ static struct stedma40_chan_cfg uart1_dma_cfg_tx = { | |||
548 | static struct stedma40_chan_cfg uart2_dma_cfg_rx = { | 539 | static struct stedma40_chan_cfg uart2_dma_cfg_rx = { |
549 | .mode = STEDMA40_MODE_LOGICAL, | 540 | .mode = STEDMA40_MODE_LOGICAL, |
550 | .dir = STEDMA40_PERIPH_TO_MEM, | 541 | .dir = STEDMA40_PERIPH_TO_MEM, |
551 | .src_dev_type = DB8500_DMA_DEV11_UART2_RX, | 542 | .dev_type = DB8500_DMA_DEV11_UART2, |
552 | .dst_dev_type = STEDMA40_DEV_DST_MEMORY, | ||
553 | .src_info.data_width = STEDMA40_BYTE_WIDTH, | 543 | .src_info.data_width = STEDMA40_BYTE_WIDTH, |
554 | .dst_info.data_width = STEDMA40_BYTE_WIDTH, | 544 | .dst_info.data_width = STEDMA40_BYTE_WIDTH, |
555 | }; | 545 | }; |
@@ -557,8 +547,7 @@ static struct stedma40_chan_cfg uart2_dma_cfg_rx = { | |||
557 | static struct stedma40_chan_cfg uart2_dma_cfg_tx = { | 547 | static struct stedma40_chan_cfg uart2_dma_cfg_tx = { |
558 | .mode = STEDMA40_MODE_LOGICAL, | 548 | .mode = STEDMA40_MODE_LOGICAL, |
559 | .dir = STEDMA40_MEM_TO_PERIPH, | 549 | .dir = STEDMA40_MEM_TO_PERIPH, |
560 | .src_dev_type = STEDMA40_DEV_SRC_MEMORY, | 550 | .dev_type = DB8500_DMA_DEV11_UART2, |
561 | .dst_dev_type = DB8500_DMA_DEV11_UART2_TX, | ||
562 | .src_info.data_width = STEDMA40_BYTE_WIDTH, | 551 | .src_info.data_width = STEDMA40_BYTE_WIDTH, |
563 | .dst_info.data_width = STEDMA40_BYTE_WIDTH, | 552 | .dst_info.data_width = STEDMA40_BYTE_WIDTH, |
564 | }; | 553 | }; |
diff --git a/arch/arm/mach-ux500/cpu-db8500.c b/arch/arm/mach-ux500/cpu-db8500.c index e90b5ab23b6d..67d68e05f3a7 100644 --- a/arch/arm/mach-ux500/cpu-db8500.c +++ b/arch/arm/mach-ux500/cpu-db8500.c | |||
@@ -163,25 +163,25 @@ static void __init db8500_add_gpios(struct device *parent) | |||
163 | } | 163 | } |
164 | 164 | ||
165 | static int usb_db8500_rx_dma_cfg[] = { | 165 | static int usb_db8500_rx_dma_cfg[] = { |
166 | DB8500_DMA_DEV38_USB_OTG_IEP_1_9, | 166 | DB8500_DMA_DEV38_USB_OTG_IEP_AND_OEP_1_9, |
167 | DB8500_DMA_DEV37_USB_OTG_IEP_2_10, | 167 | DB8500_DMA_DEV37_USB_OTG_IEP_AND_OEP_2_10, |
168 | DB8500_DMA_DEV36_USB_OTG_IEP_3_11, | 168 | DB8500_DMA_DEV36_USB_OTG_IEP_AND_OEP_3_11, |
169 | DB8500_DMA_DEV19_USB_OTG_IEP_4_12, | 169 | DB8500_DMA_DEV19_USB_OTG_IEP_AND_OEP_4_12, |
170 | DB8500_DMA_DEV18_USB_OTG_IEP_5_13, | 170 | DB8500_DMA_DEV18_USB_OTG_IEP_AND_OEP_5_13, |
171 | DB8500_DMA_DEV17_USB_OTG_IEP_6_14, | 171 | DB8500_DMA_DEV17_USB_OTG_IEP_AND_OEP_6_14, |
172 | DB8500_DMA_DEV16_USB_OTG_IEP_7_15, | 172 | DB8500_DMA_DEV16_USB_OTG_IEP_AND_OEP_7_15, |
173 | DB8500_DMA_DEV39_USB_OTG_IEP_8 | 173 | DB8500_DMA_DEV39_USB_OTG_IEP_AND_OEP_8 |
174 | }; | 174 | }; |
175 | 175 | ||
176 | static int usb_db8500_tx_dma_cfg[] = { | 176 | static int usb_db8500_tx_dma_cfg[] = { |
177 | DB8500_DMA_DEV38_USB_OTG_OEP_1_9, | 177 | DB8500_DMA_DEV38_USB_OTG_IEP_AND_OEP_1_9, |
178 | DB8500_DMA_DEV37_USB_OTG_OEP_2_10, | 178 | DB8500_DMA_DEV37_USB_OTG_IEP_AND_OEP_2_10, |
179 | DB8500_DMA_DEV36_USB_OTG_OEP_3_11, | 179 | DB8500_DMA_DEV36_USB_OTG_IEP_AND_OEP_3_11, |
180 | DB8500_DMA_DEV19_USB_OTG_OEP_4_12, | 180 | DB8500_DMA_DEV19_USB_OTG_IEP_AND_OEP_4_12, |
181 | DB8500_DMA_DEV18_USB_OTG_OEP_5_13, | 181 | DB8500_DMA_DEV18_USB_OTG_IEP_AND_OEP_5_13, |
182 | DB8500_DMA_DEV17_USB_OTG_OEP_6_14, | 182 | DB8500_DMA_DEV17_USB_OTG_IEP_AND_OEP_6_14, |
183 | DB8500_DMA_DEV16_USB_OTG_OEP_7_15, | 183 | DB8500_DMA_DEV16_USB_OTG_IEP_AND_OEP_7_15, |
184 | DB8500_DMA_DEV39_USB_OTG_OEP_8 | 184 | DB8500_DMA_DEV39_USB_OTG_IEP_AND_OEP_8 |
185 | }; | 185 | }; |
186 | 186 | ||
187 | static const char *db8500_read_soc_id(void) | 187 | static const char *db8500_read_soc_id(void) |
diff --git a/arch/arm/mach-ux500/devices-db8500.c b/arch/arm/mach-ux500/devices-db8500.c index a30977b374ba..7989c564e47a 100644 --- a/arch/arm/mach-ux500/devices-db8500.c +++ b/arch/arm/mach-ux500/devices-db8500.c | |||
@@ -50,74 +50,74 @@ static struct resource dma40_resources[] = { | |||
50 | */ | 50 | */ |
51 | static const dma_addr_t dma40_tx_map[DB8500_DMA_NR_DEV] = { | 51 | static const dma_addr_t dma40_tx_map[DB8500_DMA_NR_DEV] = { |
52 | /* MUSB - these will be runtime-reconfigured */ | 52 | /* MUSB - these will be runtime-reconfigured */ |
53 | [DB8500_DMA_DEV39_USB_OTG_OEP_8] = -1, | 53 | [DB8500_DMA_DEV39_USB_OTG_IEP_AND_OEP_8] = -1, |
54 | [DB8500_DMA_DEV16_USB_OTG_OEP_7_15] = -1, | 54 | [DB8500_DMA_DEV16_USB_OTG_IEP_AND_OEP_7_15] = -1, |
55 | [DB8500_DMA_DEV17_USB_OTG_OEP_6_14] = -1, | 55 | [DB8500_DMA_DEV17_USB_OTG_IEP_AND_OEP_6_14] = -1, |
56 | [DB8500_DMA_DEV18_USB_OTG_OEP_5_13] = -1, | 56 | [DB8500_DMA_DEV18_USB_OTG_IEP_AND_OEP_5_13] = -1, |
57 | [DB8500_DMA_DEV19_USB_OTG_OEP_4_12] = -1, | 57 | [DB8500_DMA_DEV19_USB_OTG_IEP_AND_OEP_4_12] = -1, |
58 | [DB8500_DMA_DEV36_USB_OTG_OEP_3_11] = -1, | 58 | [DB8500_DMA_DEV36_USB_OTG_IEP_AND_OEP_3_11] = -1, |
59 | [DB8500_DMA_DEV37_USB_OTG_OEP_2_10] = -1, | 59 | [DB8500_DMA_DEV37_USB_OTG_IEP_AND_OEP_2_10] = -1, |
60 | [DB8500_DMA_DEV38_USB_OTG_OEP_1_9] = -1, | 60 | [DB8500_DMA_DEV38_USB_OTG_IEP_AND_OEP_1_9] = -1, |
61 | /* PrimeCells - run-time configured */ | 61 | /* PrimeCells - run-time configured */ |
62 | [DB8500_DMA_DEV0_SPI0_TX] = -1, | 62 | [DB8500_DMA_DEV0_SPI0] = -1, |
63 | [DB8500_DMA_DEV1_SD_MMC0_TX] = -1, | 63 | [DB8500_DMA_DEV1_SD_MMC0] = -1, |
64 | [DB8500_DMA_DEV2_SD_MMC1_TX] = -1, | 64 | [DB8500_DMA_DEV2_SD_MMC1] = -1, |
65 | [DB8500_DMA_DEV3_SD_MMC2_TX] = -1, | 65 | [DB8500_DMA_DEV3_SD_MMC2] = -1, |
66 | [DB8500_DMA_DEV8_SSP0_TX] = -1, | 66 | [DB8500_DMA_DEV8_SSP0] = -1, |
67 | [DB8500_DMA_DEV9_SSP1_TX] = -1, | 67 | [DB8500_DMA_DEV9_SSP1] = -1, |
68 | [DB8500_DMA_DEV11_UART2_TX] = -1, | 68 | [DB8500_DMA_DEV11_UART2] = -1, |
69 | [DB8500_DMA_DEV12_UART1_TX] = -1, | 69 | [DB8500_DMA_DEV12_UART1] = -1, |
70 | [DB8500_DMA_DEV13_UART0_TX] = -1, | 70 | [DB8500_DMA_DEV13_UART0] = -1, |
71 | [DB8500_DMA_DEV28_SD_MM2_TX] = -1, | 71 | [DB8500_DMA_DEV28_SD_MM2] = -1, |
72 | [DB8500_DMA_DEV29_SD_MM0_TX] = -1, | 72 | [DB8500_DMA_DEV29_SD_MM0] = -1, |
73 | [DB8500_DMA_DEV32_SD_MM1_TX] = -1, | 73 | [DB8500_DMA_DEV32_SD_MM1] = -1, |
74 | [DB8500_DMA_DEV33_SPI2_TX] = -1, | 74 | [DB8500_DMA_DEV33_SPI2] = -1, |
75 | [DB8500_DMA_DEV35_SPI1_TX] = -1, | 75 | [DB8500_DMA_DEV35_SPI1] = -1, |
76 | [DB8500_DMA_DEV40_SPI3_TX] = -1, | 76 | [DB8500_DMA_DEV40_SPI3] = -1, |
77 | [DB8500_DMA_DEV41_SD_MM3_TX] = -1, | 77 | [DB8500_DMA_DEV41_SD_MM3] = -1, |
78 | [DB8500_DMA_DEV42_SD_MM4_TX] = -1, | 78 | [DB8500_DMA_DEV42_SD_MM4] = -1, |
79 | [DB8500_DMA_DEV43_SD_MM5_TX] = -1, | 79 | [DB8500_DMA_DEV43_SD_MM5] = -1, |
80 | [DB8500_DMA_DEV14_MSP2_TX] = U8500_MSP2_BASE + MSP_TX_RX_REG_OFFSET, | 80 | [DB8500_DMA_DEV14_MSP2] = U8500_MSP2_BASE + MSP_TX_RX_REG_OFFSET, |
81 | [DB8500_DMA_DEV30_MSP1_TX] = U8500_MSP1_BASE + MSP_TX_RX_REG_OFFSET, | 81 | [DB8500_DMA_DEV30_MSP1] = U8500_MSP1_BASE + MSP_TX_RX_REG_OFFSET, |
82 | [DB8500_DMA_DEV31_MSP0_TX_SLIM0_CH0_TX] = U8500_MSP0_BASE + MSP_TX_RX_REG_OFFSET, | 82 | [DB8500_DMA_DEV31_MSP0_SLIM0_CH0] = U8500_MSP0_BASE + MSP_TX_RX_REG_OFFSET, |
83 | [DB8500_DMA_DEV48_CAC1_TX] = U8500_CRYP1_BASE + CRYP1_TX_REG_OFFSET, | 83 | [DB8500_DMA_DEV48_CAC1] = U8500_CRYP1_BASE + CRYP1_TX_REG_OFFSET, |
84 | [DB8500_DMA_DEV50_HAC1_TX] = U8500_HASH1_BASE + HASH1_TX_REG_OFFSET, | 84 | [DB8500_DMA_DEV50_HAC1_TX] = U8500_HASH1_BASE + HASH1_TX_REG_OFFSET, |
85 | }; | 85 | }; |
86 | 86 | ||
87 | /* Mapping between source event lines and physical device address */ | 87 | /* Mapping between source event lines and physical device address */ |
88 | static const dma_addr_t dma40_rx_map[DB8500_DMA_NR_DEV] = { | 88 | static const dma_addr_t dma40_rx_map[DB8500_DMA_NR_DEV] = { |
89 | /* MUSB - these will be runtime-reconfigured */ | 89 | /* MUSB - these will be runtime-reconfigured */ |
90 | [DB8500_DMA_DEV39_USB_OTG_IEP_8] = -1, | 90 | [DB8500_DMA_DEV39_USB_OTG_IEP_AND_OEP_8] = -1, |
91 | [DB8500_DMA_DEV16_USB_OTG_IEP_7_15] = -1, | 91 | [DB8500_DMA_DEV16_USB_OTG_IEP_AND_OEP_7_15] = -1, |
92 | [DB8500_DMA_DEV17_USB_OTG_IEP_6_14] = -1, | 92 | [DB8500_DMA_DEV17_USB_OTG_IEP_AND_OEP_6_14] = -1, |
93 | [DB8500_DMA_DEV18_USB_OTG_IEP_5_13] = -1, | 93 | [DB8500_DMA_DEV18_USB_OTG_IEP_AND_OEP_5_13] = -1, |
94 | [DB8500_DMA_DEV19_USB_OTG_IEP_4_12] = -1, | 94 | [DB8500_DMA_DEV19_USB_OTG_IEP_AND_OEP_4_12] = -1, |
95 | [DB8500_DMA_DEV36_USB_OTG_IEP_3_11] = -1, | 95 | [DB8500_DMA_DEV36_USB_OTG_IEP_AND_OEP_3_11] = -1, |
96 | [DB8500_DMA_DEV37_USB_OTG_IEP_2_10] = -1, | 96 | [DB8500_DMA_DEV37_USB_OTG_IEP_AND_OEP_2_10] = -1, |
97 | [DB8500_DMA_DEV38_USB_OTG_IEP_1_9] = -1, | 97 | [DB8500_DMA_DEV38_USB_OTG_IEP_AND_OEP_1_9] = -1, |
98 | /* PrimeCells */ | 98 | /* PrimeCells */ |
99 | [DB8500_DMA_DEV0_SPI0_RX] = -1, | 99 | [DB8500_DMA_DEV0_SPI0] = -1, |
100 | [DB8500_DMA_DEV1_SD_MMC0_RX] = -1, | 100 | [DB8500_DMA_DEV1_SD_MMC0] = -1, |
101 | [DB8500_DMA_DEV2_SD_MMC1_RX] = -1, | 101 | [DB8500_DMA_DEV2_SD_MMC1] = -1, |
102 | [DB8500_DMA_DEV3_SD_MMC2_RX] = -1, | 102 | [DB8500_DMA_DEV3_SD_MMC2] = -1, |
103 | [DB8500_DMA_DEV8_SSP0_RX] = -1, | 103 | [DB8500_DMA_DEV8_SSP0] = -1, |
104 | [DB8500_DMA_DEV9_SSP1_RX] = -1, | 104 | [DB8500_DMA_DEV9_SSP1] = -1, |
105 | [DB8500_DMA_DEV11_UART2_RX] = -1, | 105 | [DB8500_DMA_DEV11_UART2] = -1, |
106 | [DB8500_DMA_DEV12_UART1_RX] = -1, | 106 | [DB8500_DMA_DEV12_UART1] = -1, |
107 | [DB8500_DMA_DEV13_UART0_RX] = -1, | 107 | [DB8500_DMA_DEV13_UART0] = -1, |
108 | [DB8500_DMA_DEV28_SD_MM2_RX] = -1, | 108 | [DB8500_DMA_DEV28_SD_MM2] = -1, |
109 | [DB8500_DMA_DEV29_SD_MM0_RX] = -1, | 109 | [DB8500_DMA_DEV29_SD_MM0] = -1, |
110 | [DB8500_DMA_DEV32_SD_MM1_RX] = -1, | 110 | [DB8500_DMA_DEV32_SD_MM1] = -1, |
111 | [DB8500_DMA_DEV33_SPI2_RX] = -1, | 111 | [DB8500_DMA_DEV33_SPI2] = -1, |
112 | [DB8500_DMA_DEV35_SPI1_RX] = -1, | 112 | [DB8500_DMA_DEV35_SPI1] = -1, |
113 | [DB8500_DMA_DEV40_SPI3_RX] = -1, | 113 | [DB8500_DMA_DEV40_SPI3] = -1, |
114 | [DB8500_DMA_DEV41_SD_MM3_RX] = -1, | 114 | [DB8500_DMA_DEV41_SD_MM3] = -1, |
115 | [DB8500_DMA_DEV42_SD_MM4_RX] = -1, | 115 | [DB8500_DMA_DEV42_SD_MM4] = -1, |
116 | [DB8500_DMA_DEV43_SD_MM5_RX] = -1, | 116 | [DB8500_DMA_DEV43_SD_MM5] = -1, |
117 | [DB8500_DMA_DEV14_MSP2_RX] = U8500_MSP2_BASE + MSP_TX_RX_REG_OFFSET, | 117 | [DB8500_DMA_DEV14_MSP2] = U8500_MSP2_BASE + MSP_TX_RX_REG_OFFSET, |
118 | [DB8500_DMA_DEV30_MSP3_RX] = U8500_MSP3_BASE + MSP_TX_RX_REG_OFFSET, | 118 | [DB8500_DMA_DEV30_MSP3] = U8500_MSP3_BASE + MSP_TX_RX_REG_OFFSET, |
119 | [DB8500_DMA_DEV31_MSP0_RX_SLIM0_CH0_RX] = U8500_MSP0_BASE + MSP_TX_RX_REG_OFFSET, | 119 | [DB8500_DMA_DEV31_MSP0_SLIM0_CH0] = U8500_MSP0_BASE + MSP_TX_RX_REG_OFFSET, |
120 | [DB8500_DMA_DEV48_CAC1_RX] = U8500_CRYP1_BASE + CRYP1_RX_REG_OFFSET, | 120 | [DB8500_DMA_DEV48_CAC1] = U8500_CRYP1_BASE + CRYP1_RX_REG_OFFSET, |
121 | }; | 121 | }; |
122 | 122 | ||
123 | static struct stedma40_platform_data dma40_plat_data = { | 123 | static struct stedma40_platform_data dma40_plat_data = { |
diff --git a/arch/arm/mach-ux500/ste-dma40-db8500.h b/arch/arm/mach-ux500/ste-dma40-db8500.h index a616419bea76..0296ae5b0fd9 100644 --- a/arch/arm/mach-ux500/ste-dma40-db8500.h +++ b/arch/arm/mach-ux500/ste-dma40-db8500.h | |||
@@ -12,133 +12,74 @@ | |||
12 | 12 | ||
13 | #define DB8500_DMA_NR_DEV 64 | 13 | #define DB8500_DMA_NR_DEV 64 |
14 | 14 | ||
15 | enum dma_src_dev_type { | 15 | /* |
16 | DB8500_DMA_DEV0_SPI0_RX = 0, | 16 | * Unless otherwise specified, all channels numbers are used for |
17 | DB8500_DMA_DEV1_SD_MMC0_RX = 1, | 17 | * TX & RX, and can be used for either source or destination |
18 | DB8500_DMA_DEV2_SD_MMC1_RX = 2, | 18 | * channels. |
19 | DB8500_DMA_DEV3_SD_MMC2_RX = 3, | 19 | */ |
20 | DB8500_DMA_DEV4_I2C1_RX = 4, | 20 | enum dma_dev_type { |
21 | DB8500_DMA_DEV5_I2C3_RX = 5, | 21 | DB8500_DMA_DEV0_SPI0 = 0, |
22 | DB8500_DMA_DEV6_I2C2_RX = 6, | 22 | DB8500_DMA_DEV1_SD_MMC0 = 1, |
23 | DB8500_DMA_DEV7_I2C4_RX = 7, /* Only on V1 and later */ | 23 | DB8500_DMA_DEV2_SD_MMC1 = 2, |
24 | DB8500_DMA_DEV8_SSP0_RX = 8, | 24 | DB8500_DMA_DEV3_SD_MMC2 = 3, |
25 | DB8500_DMA_DEV9_SSP1_RX = 9, | 25 | DB8500_DMA_DEV4_I2C1 = 4, |
26 | DB8500_DMA_DEV10_MCDE_RX = 10, | 26 | DB8500_DMA_DEV5_I2C3 = 5, |
27 | DB8500_DMA_DEV11_UART2_RX = 11, | 27 | DB8500_DMA_DEV6_I2C2 = 6, |
28 | DB8500_DMA_DEV12_UART1_RX = 12, | 28 | DB8500_DMA_DEV7_I2C4 = 7, /* Only on V1 and later */ |
29 | DB8500_DMA_DEV13_UART0_RX = 13, | 29 | DB8500_DMA_DEV8_SSP0 = 8, |
30 | DB8500_DMA_DEV14_MSP2_RX = 14, | 30 | DB8500_DMA_DEV9_SSP1 = 9, |
31 | DB8500_DMA_DEV15_I2C0_RX = 15, | 31 | DB8500_DMA_DEV10_MCDE_RX = 10, /* RX only */ |
32 | DB8500_DMA_DEV16_USB_OTG_IEP_7_15 = 16, | 32 | DB8500_DMA_DEV11_UART2 = 11, |
33 | DB8500_DMA_DEV17_USB_OTG_IEP_6_14 = 17, | 33 | DB8500_DMA_DEV12_UART1 = 12, |
34 | DB8500_DMA_DEV18_USB_OTG_IEP_5_13 = 18, | 34 | DB8500_DMA_DEV13_UART0 = 13, |
35 | DB8500_DMA_DEV19_USB_OTG_IEP_4_12 = 19, | 35 | DB8500_DMA_DEV14_MSP2 = 14, |
36 | DB8500_DMA_DEV20_SLIM0_CH0_RX_HSI_RX_CH0 = 20, | 36 | DB8500_DMA_DEV15_I2C0 = 15, |
37 | DB8500_DMA_DEV21_SLIM0_CH1_RX_HSI_RX_CH1 = 21, | 37 | DB8500_DMA_DEV16_USB_OTG_IEP_AND_OEP_7_15 = 16, |
38 | DB8500_DMA_DEV22_SLIM0_CH2_RX_HSI_RX_CH2 = 22, | 38 | DB8500_DMA_DEV17_USB_OTG_IEP_AND_OEP_6_14 = 17, |
39 | DB8500_DMA_DEV23_SLIM0_CH3_RX_HSI_RX_CH3 = 23, | 39 | DB8500_DMA_DEV18_USB_OTG_IEP_AND_OEP_5_13 = 18, |
40 | DB8500_DMA_DEV24_SRC_SXA0_RX_TX = 24, | 40 | DB8500_DMA_DEV19_USB_OTG_IEP_AND_OEP_4_12 = 19, |
41 | DB8500_DMA_DEV25_SRC_SXA1_RX_TX = 25, | 41 | DB8500_DMA_DEV20_SLIM0_CH0_HSI_CH0 = 20, |
42 | DB8500_DMA_DEV26_SRC_SXA2_RX_TX = 26, | 42 | DB8500_DMA_DEV21_SLIM0_CH1_HSI_CH1 = 21, |
43 | DB8500_DMA_DEV27_SRC_SXA3_RX_TX = 27, | 43 | DB8500_DMA_DEV22_SLIM0_CH2_HSI_CH2 = 22, |
44 | DB8500_DMA_DEV28_SD_MM2_RX = 28, | 44 | DB8500_DMA_DEV23_SLIM0_CH3_HSI_CH3 = 23, |
45 | DB8500_DMA_DEV29_SD_MM0_RX = 29, | 45 | DB8500_DMA_DEV24_SXA0 = 24, |
46 | DB8500_DMA_DEV30_MSP1_RX = 30, | 46 | DB8500_DMA_DEV25_SXA1 = 25, |
47 | DB8500_DMA_DEV26_SXA2 = 26, | ||
48 | DB8500_DMA_DEV27_SXA3 = 27, | ||
49 | DB8500_DMA_DEV28_SD_MM2 = 28, | ||
50 | DB8500_DMA_DEV29_SD_MM0 = 29, | ||
51 | DB8500_DMA_DEV30_MSP1 = 30, | ||
47 | /* On DB8500v2, MSP3 RX replaces MSP1 RX */ | 52 | /* On DB8500v2, MSP3 RX replaces MSP1 RX */ |
48 | DB8500_DMA_DEV30_MSP3_RX = 30, | 53 | DB8500_DMA_DEV30_MSP3 = 30, |
49 | DB8500_DMA_DEV31_MSP0_RX_SLIM0_CH0_RX = 31, | 54 | DB8500_DMA_DEV31_MSP0_SLIM0_CH0 = 31, |
50 | DB8500_DMA_DEV32_SD_MM1_RX = 32, | 55 | DB8500_DMA_DEV32_SD_MM1 = 32, |
51 | DB8500_DMA_DEV33_SPI2_RX = 33, | 56 | DB8500_DMA_DEV33_SPI2 = 33, |
52 | DB8500_DMA_DEV34_I2C3_RX2 = 34, | 57 | DB8500_DMA_DEV34_I2C3_RX2_TX2 = 34, |
53 | DB8500_DMA_DEV35_SPI1_RX = 35, | 58 | DB8500_DMA_DEV35_SPI1 = 35, |
54 | DB8500_DMA_DEV36_USB_OTG_IEP_3_11 = 36, | 59 | DB8500_DMA_DEV36_USB_OTG_IEP_AND_OEP_3_11 = 36, |
55 | DB8500_DMA_DEV37_USB_OTG_IEP_2_10 = 37, | 60 | DB8500_DMA_DEV37_USB_OTG_IEP_AND_OEP_2_10 = 37, |
56 | DB8500_DMA_DEV38_USB_OTG_IEP_1_9 = 38, | 61 | DB8500_DMA_DEV38_USB_OTG_IEP_AND_OEP_1_9 = 38, |
57 | DB8500_DMA_DEV39_USB_OTG_IEP_8 = 39, | 62 | DB8500_DMA_DEV39_USB_OTG_IEP_AND_OEP_8 = 39, |
58 | DB8500_DMA_DEV40_SPI3_RX = 40, | 63 | DB8500_DMA_DEV40_SPI3 = 40, |
59 | DB8500_DMA_DEV41_SD_MM3_RX = 41, | 64 | DB8500_DMA_DEV41_SD_MM3 = 41, |
60 | DB8500_DMA_DEV42_SD_MM4_RX = 42, | 65 | DB8500_DMA_DEV42_SD_MM4 = 42, |
61 | DB8500_DMA_DEV43_SD_MM5_RX = 43, | 66 | DB8500_DMA_DEV43_SD_MM5 = 43, |
62 | DB8500_DMA_DEV44_SRC_SXA4_RX_TX = 44, | 67 | DB8500_DMA_DEV44_SXA4 = 44, |
63 | DB8500_DMA_DEV45_SRC_SXA5_RX_TX = 45, | 68 | DB8500_DMA_DEV45_SXA5 = 45, |
64 | DB8500_DMA_DEV46_SLIM0_CH8_RX_SRC_SXA6_RX_TX = 46, | 69 | DB8500_DMA_DEV46_SLIM0_CH8_SRC_SXA6 = 46, |
65 | DB8500_DMA_DEV47_SLIM0_CH9_RX_SRC_SXA7_RX_TX = 47, | 70 | DB8500_DMA_DEV47_SLIM0_CH9_SRC_SXA7 = 47, |
66 | DB8500_DMA_DEV48_CAC1_RX = 48, | 71 | DB8500_DMA_DEV48_CAC1 = 48, |
67 | /* 49, 50 and 51 are not used */ | 72 | DB8500_DMA_DEV49_CAC1_TX_HAC1_TX = 49, /* TX only */ |
68 | DB8500_DMA_DEV52_SLIM0_CH4_RX_HSI_RX_CH4 = 52, | 73 | DB8500_DMA_DEV50_HAC1_TX = 50, /* TX only */ |
69 | DB8500_DMA_DEV53_SLIM0_CH5_RX_HSI_RX_CH5 = 53, | 74 | DB8500_DMA_MEMCPY_TX_0 = 51, /* TX only */ |
70 | DB8500_DMA_DEV54_SLIM0_CH6_RX_HSI_RX_CH6 = 54, | 75 | DB8500_DMA_DEV52_SLIM0_CH4_HSI_CH4 = 52, |
71 | DB8500_DMA_DEV55_SLIM0_CH7_RX_HSI_RX_CH7 = 55, | 76 | DB8500_DMA_DEV53_SLIM0_CH5_HSI_CH5 = 53, |
72 | /* 56, 57, 58, 59 and 60 are not used */ | 77 | DB8500_DMA_DEV54_SLIM0_CH6_HSI_CH6 = 54, |
73 | DB8500_DMA_DEV61_CAC0_RX = 61, | 78 | DB8500_DMA_DEV55_SLIM0_CH7_HSI_CH7 = 55, |
74 | /* 62 and 63 are not used */ | 79 | /* 56 -> 60 are channels reserved for memcpy only */ |
75 | }; | 80 | DB8500_DMA_DEV61_CAC0 = 61, |
76 | 81 | DB8500_DMA_DEV62_CAC0_TX_HAC0_TX = 62, /* TX only */ | |
77 | enum dma_dest_dev_type { | 82 | DB8500_DMA_DEV63_HAC0_TX = 63, /* TX only */ |
78 | DB8500_DMA_DEV0_SPI0_TX = 0, | ||
79 | DB8500_DMA_DEV1_SD_MMC0_TX = 1, | ||
80 | DB8500_DMA_DEV2_SD_MMC1_TX = 2, | ||
81 | DB8500_DMA_DEV3_SD_MMC2_TX = 3, | ||
82 | DB8500_DMA_DEV4_I2C1_TX = 4, | ||
83 | DB8500_DMA_DEV5_I2C3_TX = 5, | ||
84 | DB8500_DMA_DEV6_I2C2_TX = 6, | ||
85 | DB8500_DMA_DEV7_I2C4_TX = 7, /* Only on V1 and later */ | ||
86 | DB8500_DMA_DEV8_SSP0_TX = 8, | ||
87 | DB8500_DMA_DEV9_SSP1_TX = 9, | ||
88 | /* 10 is not used*/ | ||
89 | DB8500_DMA_DEV11_UART2_TX = 11, | ||
90 | DB8500_DMA_DEV12_UART1_TX = 12, | ||
91 | DB8500_DMA_DEV13_UART0_TX = 13, | ||
92 | DB8500_DMA_DEV14_MSP2_TX = 14, | ||
93 | DB8500_DMA_DEV15_I2C0_TX = 15, | ||
94 | DB8500_DMA_DEV16_USB_OTG_OEP_7_15 = 16, | ||
95 | DB8500_DMA_DEV17_USB_OTG_OEP_6_14 = 17, | ||
96 | DB8500_DMA_DEV18_USB_OTG_OEP_5_13 = 18, | ||
97 | DB8500_DMA_DEV19_USB_OTG_OEP_4_12 = 19, | ||
98 | DB8500_DMA_DEV20_SLIM0_CH0_TX_HSI_TX_CH0 = 20, | ||
99 | DB8500_DMA_DEV21_SLIM0_CH1_TX_HSI_TX_CH1 = 21, | ||
100 | DB8500_DMA_DEV22_SLIM0_CH2_TX_HSI_TX_CH2 = 22, | ||
101 | DB8500_DMA_DEV23_SLIM0_CH3_TX_HSI_TX_CH3 = 23, | ||
102 | DB8500_DMA_DEV24_DST_SXA0_RX_TX = 24, | ||
103 | DB8500_DMA_DEV25_DST_SXA1_RX_TX = 25, | ||
104 | DB8500_DMA_DEV26_DST_SXA2_RX_TX = 26, | ||
105 | DB8500_DMA_DEV27_DST_SXA3_RX_TX = 27, | ||
106 | DB8500_DMA_DEV28_SD_MM2_TX = 28, | ||
107 | DB8500_DMA_DEV29_SD_MM0_TX = 29, | ||
108 | DB8500_DMA_DEV30_MSP1_TX = 30, | ||
109 | DB8500_DMA_DEV31_MSP0_TX_SLIM0_CH0_TX = 31, | ||
110 | DB8500_DMA_DEV32_SD_MM1_TX = 32, | ||
111 | DB8500_DMA_DEV33_SPI2_TX = 33, | ||
112 | DB8500_DMA_DEV34_I2C3_TX2 = 34, | ||
113 | DB8500_DMA_DEV35_SPI1_TX = 35, | ||
114 | DB8500_DMA_DEV36_USB_OTG_OEP_3_11 = 36, | ||
115 | DB8500_DMA_DEV37_USB_OTG_OEP_2_10 = 37, | ||
116 | DB8500_DMA_DEV38_USB_OTG_OEP_1_9 = 38, | ||
117 | DB8500_DMA_DEV39_USB_OTG_OEP_8 = 39, | ||
118 | DB8500_DMA_DEV40_SPI3_TX = 40, | ||
119 | DB8500_DMA_DEV41_SD_MM3_TX = 41, | ||
120 | DB8500_DMA_DEV42_SD_MM4_TX = 42, | ||
121 | DB8500_DMA_DEV43_SD_MM5_TX = 43, | ||
122 | DB8500_DMA_DEV44_DST_SXA4_RX_TX = 44, | ||
123 | DB8500_DMA_DEV45_DST_SXA5_RX_TX = 45, | ||
124 | DB8500_DMA_DEV46_SLIM0_CH8_TX_DST_SXA6_RX_TX = 46, | ||
125 | DB8500_DMA_DEV47_SLIM0_CH9_TX_DST_SXA7_RX_TX = 47, | ||
126 | DB8500_DMA_DEV48_CAC1_TX = 48, | ||
127 | DB8500_DMA_DEV49_CAC1_TX_HAC1_TX = 49, | ||
128 | DB8500_DMA_DEV50_HAC1_TX = 50, | ||
129 | DB8500_DMA_MEMCPY_TX_0 = 51, | ||
130 | DB8500_DMA_DEV52_SLIM1_CH4_TX_HSI_TX_CH4 = 52, | ||
131 | DB8500_DMA_DEV53_SLIM1_CH5_TX_HSI_TX_CH5 = 53, | ||
132 | DB8500_DMA_DEV54_SLIM1_CH6_TX_HSI_TX_CH6 = 54, | ||
133 | DB8500_DMA_DEV55_SLIM1_CH7_TX_HSI_TX_CH7 = 55, | ||
134 | DB8500_DMA_MEMCPY_TX_1 = 56, | ||
135 | DB8500_DMA_MEMCPY_TX_2 = 57, | ||
136 | DB8500_DMA_MEMCPY_TX_3 = 58, | ||
137 | DB8500_DMA_MEMCPY_TX_4 = 59, | ||
138 | DB8500_DMA_MEMCPY_TX_5 = 60, | ||
139 | DB8500_DMA_DEV61_CAC0_TX = 61, | ||
140 | DB8500_DMA_DEV62_CAC0_TX_HAC0_TX = 62, | ||
141 | DB8500_DMA_DEV63_HAC0_TX = 63, | ||
142 | }; | 83 | }; |
143 | 84 | ||
144 | #endif | 85 | #endif |
diff --git a/arch/arm/mach-ux500/usb.c b/arch/arm/mach-ux500/usb.c index 2dfc72f7cd8a..45af3031dfef 100644 --- a/arch/arm/mach-ux500/usb.c +++ b/arch/arm/mach-ux500/usb.c | |||
@@ -15,7 +15,6 @@ | |||
15 | #define MUSB_DMA40_RX_CH { \ | 15 | #define MUSB_DMA40_RX_CH { \ |
16 | .mode = STEDMA40_MODE_LOGICAL, \ | 16 | .mode = STEDMA40_MODE_LOGICAL, \ |
17 | .dir = STEDMA40_PERIPH_TO_MEM, \ | 17 | .dir = STEDMA40_PERIPH_TO_MEM, \ |
18 | .dst_dev_type = STEDMA40_DEV_DST_MEMORY, \ | ||
19 | .src_info.data_width = STEDMA40_WORD_WIDTH, \ | 18 | .src_info.data_width = STEDMA40_WORD_WIDTH, \ |
20 | .dst_info.data_width = STEDMA40_WORD_WIDTH, \ | 19 | .dst_info.data_width = STEDMA40_WORD_WIDTH, \ |
21 | .src_info.psize = STEDMA40_PSIZE_LOG_16, \ | 20 | .src_info.psize = STEDMA40_PSIZE_LOG_16, \ |
@@ -25,7 +24,6 @@ | |||
25 | #define MUSB_DMA40_TX_CH { \ | 24 | #define MUSB_DMA40_TX_CH { \ |
26 | .mode = STEDMA40_MODE_LOGICAL, \ | 25 | .mode = STEDMA40_MODE_LOGICAL, \ |
27 | .dir = STEDMA40_MEM_TO_PERIPH, \ | 26 | .dir = STEDMA40_MEM_TO_PERIPH, \ |
28 | .src_dev_type = STEDMA40_DEV_SRC_MEMORY, \ | ||
29 | .src_info.data_width = STEDMA40_WORD_WIDTH, \ | 27 | .src_info.data_width = STEDMA40_WORD_WIDTH, \ |
30 | .dst_info.data_width = STEDMA40_WORD_WIDTH, \ | 28 | .dst_info.data_width = STEDMA40_WORD_WIDTH, \ |
31 | .src_info.psize = STEDMA40_PSIZE_LOG_16, \ | 29 | .src_info.psize = STEDMA40_PSIZE_LOG_16, \ |
@@ -125,20 +123,20 @@ struct platform_device ux500_musb_device = { | |||
125 | .resource = usb_resources, | 123 | .resource = usb_resources, |
126 | }; | 124 | }; |
127 | 125 | ||
128 | static inline void ux500_usb_dma_update_rx_ch_config(int *src_dev_type) | 126 | static inline void ux500_usb_dma_update_rx_ch_config(int *dev_type) |
129 | { | 127 | { |
130 | u32 idx; | 128 | u32 idx; |
131 | 129 | ||
132 | for (idx = 0; idx < UX500_MUSB_DMA_NUM_RX_CHANNELS; idx++) | 130 | for (idx = 0; idx < UX500_MUSB_DMA_NUM_RX_CHANNELS; idx++) |
133 | musb_dma_rx_ch[idx].src_dev_type = src_dev_type[idx]; | 131 | musb_dma_rx_ch[idx].dev_type = dev_type[idx]; |
134 | } | 132 | } |
135 | 133 | ||
136 | static inline void ux500_usb_dma_update_tx_ch_config(int *dst_dev_type) | 134 | static inline void ux500_usb_dma_update_tx_ch_config(int *dev_type) |
137 | { | 135 | { |
138 | u32 idx; | 136 | u32 idx; |
139 | 137 | ||
140 | for (idx = 0; idx < UX500_MUSB_DMA_NUM_TX_CHANNELS; idx++) | 138 | for (idx = 0; idx < UX500_MUSB_DMA_NUM_TX_CHANNELS; idx++) |
141 | musb_dma_tx_ch[idx].dst_dev_type = dst_dev_type[idx]; | 139 | musb_dma_tx_ch[idx].dev_type = dev_type[idx]; |
142 | } | 140 | } |
143 | 141 | ||
144 | void ux500_add_usb(struct device *parent, resource_size_t base, int irq, | 142 | void ux500_add_usb(struct device *parent, resource_size_t base, int irq, |
diff --git a/drivers/dma/ste_dma40.c b/drivers/dma/ste_dma40.c index d481cb8521d9..63495f6a36f9 100644 --- a/drivers/dma/ste_dma40.c +++ b/drivers/dma/ste_dma40.c | |||
@@ -1302,21 +1302,17 @@ static void __d40_config_set_event(struct d40_chan *d40c, | |||
1302 | static void d40_config_set_event(struct d40_chan *d40c, | 1302 | static void d40_config_set_event(struct d40_chan *d40c, |
1303 | enum d40_events event_type) | 1303 | enum d40_events event_type) |
1304 | { | 1304 | { |
1305 | u32 event = D40_TYPE_TO_EVENT(d40c->dma_cfg.dev_type); | ||
1306 | |||
1305 | /* Enable event line connected to device (or memcpy) */ | 1307 | /* Enable event line connected to device (or memcpy) */ |
1306 | if ((d40c->dma_cfg.dir == STEDMA40_PERIPH_TO_MEM) || | 1308 | if ((d40c->dma_cfg.dir == STEDMA40_PERIPH_TO_MEM) || |
1307 | (d40c->dma_cfg.dir == STEDMA40_PERIPH_TO_PERIPH)) { | 1309 | (d40c->dma_cfg.dir == STEDMA40_PERIPH_TO_PERIPH)) |
1308 | u32 event = D40_TYPE_TO_EVENT(d40c->dma_cfg.src_dev_type); | ||
1309 | |||
1310 | __d40_config_set_event(d40c, event_type, event, | 1310 | __d40_config_set_event(d40c, event_type, event, |
1311 | D40_CHAN_REG_SSLNK); | 1311 | D40_CHAN_REG_SSLNK); |
1312 | } | ||
1313 | |||
1314 | if (d40c->dma_cfg.dir != STEDMA40_PERIPH_TO_MEM) { | ||
1315 | u32 event = D40_TYPE_TO_EVENT(d40c->dma_cfg.dst_dev_type); | ||
1316 | 1312 | ||
1313 | if (d40c->dma_cfg.dir != STEDMA40_PERIPH_TO_MEM) | ||
1317 | __d40_config_set_event(d40c, event_type, event, | 1314 | __d40_config_set_event(d40c, event_type, event, |
1318 | D40_CHAN_REG_SDLNK); | 1315 | D40_CHAN_REG_SDLNK); |
1319 | } | ||
1320 | } | 1316 | } |
1321 | 1317 | ||
1322 | static u32 d40_chan_has_events(struct d40_chan *d40c) | 1318 | static u32 d40_chan_has_events(struct d40_chan *d40c) |
@@ -1758,8 +1754,6 @@ static int d40_validate_conf(struct d40_chan *d40c, | |||
1758 | struct stedma40_chan_cfg *conf) | 1754 | struct stedma40_chan_cfg *conf) |
1759 | { | 1755 | { |
1760 | int res = 0; | 1756 | int res = 0; |
1761 | u32 dst_event_group = D40_TYPE_TO_GROUP(conf->dst_dev_type); | ||
1762 | u32 src_event_group = D40_TYPE_TO_GROUP(conf->src_dev_type); | ||
1763 | bool is_log = conf->mode == STEDMA40_MODE_LOGICAL; | 1757 | bool is_log = conf->mode == STEDMA40_MODE_LOGICAL; |
1764 | 1758 | ||
1765 | if (!conf->dir) { | 1759 | if (!conf->dir) { |
@@ -1767,44 +1761,26 @@ static int d40_validate_conf(struct d40_chan *d40c, | |||
1767 | res = -EINVAL; | 1761 | res = -EINVAL; |
1768 | } | 1762 | } |
1769 | 1763 | ||
1770 | if (conf->dst_dev_type != STEDMA40_DEV_DST_MEMORY && | 1764 | if ((is_log && conf->dev_type > d40c->base->num_log_chans) || |
1771 | d40c->base->plat_data->dev_tx[conf->dst_dev_type] == 0 && | 1765 | (!is_log && conf->dev_type > d40c->base->num_phy_chans) || |
1772 | d40c->runtime_addr == 0) { | 1766 | (conf->dev_type < 0)) { |
1773 | 1767 | chan_err(d40c, "Invalid device type (%d)\n", conf->dev_type); | |
1774 | chan_err(d40c, "Invalid TX channel address (%d)\n", | ||
1775 | conf->dst_dev_type); | ||
1776 | res = -EINVAL; | ||
1777 | } | ||
1778 | |||
1779 | if (conf->src_dev_type != STEDMA40_DEV_SRC_MEMORY && | ||
1780 | d40c->base->plat_data->dev_rx[conf->src_dev_type] == 0 && | ||
1781 | d40c->runtime_addr == 0) { | ||
1782 | chan_err(d40c, "Invalid RX channel address (%d)\n", | ||
1783 | conf->src_dev_type); | ||
1784 | res = -EINVAL; | 1768 | res = -EINVAL; |
1785 | } | 1769 | } |
1786 | 1770 | ||
1787 | if (conf->dir == STEDMA40_MEM_TO_PERIPH && | 1771 | if (conf->dir == STEDMA40_MEM_TO_PERIPH && |
1788 | conf->dst_dev_type == STEDMA40_DEV_DST_MEMORY) { | 1772 | d40c->base->plat_data->dev_tx[conf->dev_type] == 0 && |
1789 | chan_err(d40c, "Invalid dst\n"); | 1773 | d40c->runtime_addr == 0) { |
1774 | chan_err(d40c, "Invalid TX channel address (%d)\n", | ||
1775 | conf->dev_type); | ||
1790 | res = -EINVAL; | 1776 | res = -EINVAL; |
1791 | } | 1777 | } |
1792 | 1778 | ||
1793 | if (conf->dir == STEDMA40_PERIPH_TO_MEM && | 1779 | if (conf->dir == STEDMA40_PERIPH_TO_MEM && |
1794 | conf->src_dev_type == STEDMA40_DEV_SRC_MEMORY) { | 1780 | d40c->base->plat_data->dev_rx[conf->dev_type] == 0 && |
1795 | chan_err(d40c, "Invalid src\n"); | 1781 | d40c->runtime_addr == 0) { |
1796 | res = -EINVAL; | 1782 | chan_err(d40c, "Invalid RX channel address (%d)\n", |
1797 | } | 1783 | conf->dev_type); |
1798 | |||
1799 | if (conf->src_dev_type == STEDMA40_DEV_SRC_MEMORY && | ||
1800 | conf->dst_dev_type == STEDMA40_DEV_DST_MEMORY && is_log) { | ||
1801 | chan_err(d40c, "No event line\n"); | ||
1802 | res = -EINVAL; | ||
1803 | } | ||
1804 | |||
1805 | if (conf->dir == STEDMA40_PERIPH_TO_PERIPH && | ||
1806 | (src_event_group != dst_event_group)) { | ||
1807 | chan_err(d40c, "Invalid event group\n"); | ||
1808 | res = -EINVAL; | 1784 | res = -EINVAL; |
1809 | } | 1785 | } |
1810 | 1786 | ||
@@ -1925,7 +1901,7 @@ out: | |||
1925 | 1901 | ||
1926 | static int d40_allocate_channel(struct d40_chan *d40c, bool *first_phy_user) | 1902 | static int d40_allocate_channel(struct d40_chan *d40c, bool *first_phy_user) |
1927 | { | 1903 | { |
1928 | int dev_type; | 1904 | int dev_type = d40c->dma_cfg.dev_type; |
1929 | int event_group; | 1905 | int event_group; |
1930 | int event_line; | 1906 | int event_line; |
1931 | struct d40_phy_res *phys; | 1907 | struct d40_phy_res *phys; |
@@ -1940,13 +1916,11 @@ static int d40_allocate_channel(struct d40_chan *d40c, bool *first_phy_user) | |||
1940 | num_phy_chans = d40c->base->num_phy_chans; | 1916 | num_phy_chans = d40c->base->num_phy_chans; |
1941 | 1917 | ||
1942 | if (d40c->dma_cfg.dir == STEDMA40_PERIPH_TO_MEM) { | 1918 | if (d40c->dma_cfg.dir == STEDMA40_PERIPH_TO_MEM) { |
1943 | dev_type = d40c->dma_cfg.src_dev_type; | ||
1944 | log_num = 2 * dev_type; | 1919 | log_num = 2 * dev_type; |
1945 | is_src = true; | 1920 | is_src = true; |
1946 | } else if (d40c->dma_cfg.dir == STEDMA40_MEM_TO_PERIPH || | 1921 | } else if (d40c->dma_cfg.dir == STEDMA40_MEM_TO_PERIPH || |
1947 | d40c->dma_cfg.dir == STEDMA40_MEM_TO_MEM) { | 1922 | d40c->dma_cfg.dir == STEDMA40_MEM_TO_MEM) { |
1948 | /* dst event lines are used for logical memcpy */ | 1923 | /* dst event lines are used for logical memcpy */ |
1949 | dev_type = d40c->dma_cfg.dst_dev_type; | ||
1950 | log_num = 2 * dev_type + 1; | 1924 | log_num = 2 * dev_type + 1; |
1951 | is_src = false; | 1925 | is_src = false; |
1952 | } else | 1926 | } else |
@@ -2058,8 +2032,7 @@ static int d40_config_memcpy(struct d40_chan *d40c) | |||
2058 | 2032 | ||
2059 | if (dma_has_cap(DMA_MEMCPY, cap) && !dma_has_cap(DMA_SLAVE, cap)) { | 2033 | if (dma_has_cap(DMA_MEMCPY, cap) && !dma_has_cap(DMA_SLAVE, cap)) { |
2060 | d40c->dma_cfg = dma40_memcpy_conf_log; | 2034 | d40c->dma_cfg = dma40_memcpy_conf_log; |
2061 | d40c->dma_cfg.src_dev_type = STEDMA40_DEV_SRC_MEMORY; | 2035 | d40c->dma_cfg.dev_type = dma40_memcpy_channels[d40c->chan.chan_id]; |
2062 | d40c->dma_cfg.dst_dev_type = dma40_memcpy_channels[d40c->chan.chan_id]; | ||
2063 | 2036 | ||
2064 | } else if (dma_has_cap(DMA_MEMCPY, cap) && | 2037 | } else if (dma_has_cap(DMA_MEMCPY, cap) && |
2065 | dma_has_cap(DMA_SLAVE, cap)) { | 2038 | dma_has_cap(DMA_SLAVE, cap)) { |
@@ -2076,7 +2049,7 @@ static int d40_free_dma(struct d40_chan *d40c) | |||
2076 | { | 2049 | { |
2077 | 2050 | ||
2078 | int res = 0; | 2051 | int res = 0; |
2079 | u32 event; | 2052 | u32 event = D40_TYPE_TO_EVENT(d40c->dma_cfg.dev_type); |
2080 | struct d40_phy_res *phy = d40c->phy_chan; | 2053 | struct d40_phy_res *phy = d40c->phy_chan; |
2081 | bool is_src; | 2054 | bool is_src; |
2082 | 2055 | ||
@@ -2095,13 +2068,11 @@ static int d40_free_dma(struct d40_chan *d40c) | |||
2095 | } | 2068 | } |
2096 | 2069 | ||
2097 | if (d40c->dma_cfg.dir == STEDMA40_MEM_TO_PERIPH || | 2070 | if (d40c->dma_cfg.dir == STEDMA40_MEM_TO_PERIPH || |
2098 | d40c->dma_cfg.dir == STEDMA40_MEM_TO_MEM) { | 2071 | d40c->dma_cfg.dir == STEDMA40_MEM_TO_MEM) |
2099 | event = D40_TYPE_TO_EVENT(d40c->dma_cfg.dst_dev_type); | ||
2100 | is_src = false; | 2072 | is_src = false; |
2101 | } else if (d40c->dma_cfg.dir == STEDMA40_PERIPH_TO_MEM) { | 2073 | else if (d40c->dma_cfg.dir == STEDMA40_PERIPH_TO_MEM) |
2102 | event = D40_TYPE_TO_EVENT(d40c->dma_cfg.src_dev_type); | ||
2103 | is_src = true; | 2074 | is_src = true; |
2104 | } else { | 2075 | else { |
2105 | chan_err(d40c, "Unknown direction\n"); | 2076 | chan_err(d40c, "Unknown direction\n"); |
2106 | return -EINVAL; | 2077 | return -EINVAL; |
2107 | } | 2078 | } |
@@ -2142,7 +2113,7 @@ static bool d40_is_paused(struct d40_chan *d40c) | |||
2142 | unsigned long flags; | 2113 | unsigned long flags; |
2143 | void __iomem *active_reg; | 2114 | void __iomem *active_reg; |
2144 | u32 status; | 2115 | u32 status; |
2145 | u32 event; | 2116 | u32 event = D40_TYPE_TO_EVENT(d40c->dma_cfg.dev_type); |
2146 | 2117 | ||
2147 | spin_lock_irqsave(&d40c->lock, flags); | 2118 | spin_lock_irqsave(&d40c->lock, flags); |
2148 | 2119 | ||
@@ -2163,10 +2134,8 @@ static bool d40_is_paused(struct d40_chan *d40c) | |||
2163 | 2134 | ||
2164 | if (d40c->dma_cfg.dir == STEDMA40_MEM_TO_PERIPH || | 2135 | if (d40c->dma_cfg.dir == STEDMA40_MEM_TO_PERIPH || |
2165 | d40c->dma_cfg.dir == STEDMA40_MEM_TO_MEM) { | 2136 | d40c->dma_cfg.dir == STEDMA40_MEM_TO_MEM) { |
2166 | event = D40_TYPE_TO_EVENT(d40c->dma_cfg.dst_dev_type); | ||
2167 | status = readl(chanbase + D40_CHAN_REG_SDLNK); | 2137 | status = readl(chanbase + D40_CHAN_REG_SDLNK); |
2168 | } else if (d40c->dma_cfg.dir == STEDMA40_PERIPH_TO_MEM) { | 2138 | } else if (d40c->dma_cfg.dir == STEDMA40_PERIPH_TO_MEM) { |
2169 | event = D40_TYPE_TO_EVENT(d40c->dma_cfg.src_dev_type); | ||
2170 | status = readl(chanbase + D40_CHAN_REG_SSLNK); | 2139 | status = readl(chanbase + D40_CHAN_REG_SSLNK); |
2171 | } else { | 2140 | } else { |
2172 | chan_err(d40c, "Unknown direction\n"); | 2141 | chan_err(d40c, "Unknown direction\n"); |
@@ -2308,9 +2277,9 @@ d40_get_dev_addr(struct d40_chan *chan, enum dma_transfer_direction direction) | |||
2308 | return chan->runtime_addr; | 2277 | return chan->runtime_addr; |
2309 | 2278 | ||
2310 | if (direction == DMA_DEV_TO_MEM) | 2279 | if (direction == DMA_DEV_TO_MEM) |
2311 | addr = plat->dev_rx[cfg->src_dev_type]; | 2280 | addr = plat->dev_rx[cfg->dev_type]; |
2312 | else if (direction == DMA_MEM_TO_DEV) | 2281 | else if (direction == DMA_MEM_TO_DEV) |
2313 | addr = plat->dev_tx[cfg->dst_dev_type]; | 2282 | addr = plat->dev_tx[cfg->dev_type]; |
2314 | 2283 | ||
2315 | return addr; | 2284 | return addr; |
2316 | } | 2285 | } |
@@ -2441,11 +2410,11 @@ static void d40_set_prio_realtime(struct d40_chan *d40c) | |||
2441 | 2410 | ||
2442 | if ((d40c->dma_cfg.dir == STEDMA40_PERIPH_TO_MEM) || | 2411 | if ((d40c->dma_cfg.dir == STEDMA40_PERIPH_TO_MEM) || |
2443 | (d40c->dma_cfg.dir == STEDMA40_PERIPH_TO_PERIPH)) | 2412 | (d40c->dma_cfg.dir == STEDMA40_PERIPH_TO_PERIPH)) |
2444 | __d40_set_prio_rt(d40c, d40c->dma_cfg.src_dev_type, true); | 2413 | __d40_set_prio_rt(d40c, d40c->dma_cfg.dev_type, true); |
2445 | 2414 | ||
2446 | if ((d40c->dma_cfg.dir == STEDMA40_MEM_TO_PERIPH) || | 2415 | if ((d40c->dma_cfg.dir == STEDMA40_MEM_TO_PERIPH) || |
2447 | (d40c->dma_cfg.dir == STEDMA40_PERIPH_TO_PERIPH)) | 2416 | (d40c->dma_cfg.dir == STEDMA40_PERIPH_TO_PERIPH)) |
2448 | __d40_set_prio_rt(d40c, d40c->dma_cfg.dst_dev_type, false); | 2417 | __d40_set_prio_rt(d40c, d40c->dma_cfg.dev_type, false); |
2449 | } | 2418 | } |
2450 | 2419 | ||
2451 | /* DMA ENGINE functions */ | 2420 | /* DMA ENGINE functions */ |
@@ -2489,10 +2458,10 @@ static int d40_alloc_chan_resources(struct dma_chan *chan) | |||
2489 | 2458 | ||
2490 | if (d40c->dma_cfg.dir == STEDMA40_PERIPH_TO_MEM) | 2459 | if (d40c->dma_cfg.dir == STEDMA40_PERIPH_TO_MEM) |
2491 | d40c->lcpa = d40c->base->lcpa_base + | 2460 | d40c->lcpa = d40c->base->lcpa_base + |
2492 | d40c->dma_cfg.src_dev_type * D40_LCPA_CHAN_SIZE; | 2461 | d40c->dma_cfg.dev_type * D40_LCPA_CHAN_SIZE; |
2493 | else | 2462 | else |
2494 | d40c->lcpa = d40c->base->lcpa_base + | 2463 | d40c->lcpa = d40c->base->lcpa_base + |
2495 | d40c->dma_cfg.dst_dev_type * | 2464 | d40c->dma_cfg.dev_type * |
2496 | D40_LCPA_CHAN_SIZE + D40_LCPA_CHAN_DST_DELTA; | 2465 | D40_LCPA_CHAN_SIZE + D40_LCPA_CHAN_DST_DELTA; |
2497 | } | 2466 | } |
2498 | 2467 | ||
@@ -2755,7 +2724,7 @@ static int d40_set_runtime_config(struct dma_chan *chan, | |||
2755 | 2724 | ||
2756 | if (config->direction == DMA_DEV_TO_MEM) { | 2725 | if (config->direction == DMA_DEV_TO_MEM) { |
2757 | dma_addr_t dev_addr_rx = | 2726 | dma_addr_t dev_addr_rx = |
2758 | d40c->base->plat_data->dev_rx[cfg->src_dev_type]; | 2727 | d40c->base->plat_data->dev_rx[cfg->dev_type]; |
2759 | 2728 | ||
2760 | config_addr = config->src_addr; | 2729 | config_addr = config->src_addr; |
2761 | if (dev_addr_rx) | 2730 | if (dev_addr_rx) |
@@ -2778,7 +2747,7 @@ static int d40_set_runtime_config(struct dma_chan *chan, | |||
2778 | 2747 | ||
2779 | } else if (config->direction == DMA_MEM_TO_DEV) { | 2748 | } else if (config->direction == DMA_MEM_TO_DEV) { |
2780 | dma_addr_t dev_addr_tx = | 2749 | dma_addr_t dev_addr_tx = |
2781 | d40c->base->plat_data->dev_tx[cfg->dst_dev_type]; | 2750 | d40c->base->plat_data->dev_tx[cfg->dev_type]; |
2782 | 2751 | ||
2783 | config_addr = config->dst_addr; | 2752 | config_addr = config->dst_addr; |
2784 | if (dev_addr_tx) | 2753 | if (dev_addr_tx) |
diff --git a/drivers/dma/ste_dma40_ll.c b/drivers/dma/ste_dma40_ll.c index 7180e0d41722..5eb6c10beae1 100644 --- a/drivers/dma/ste_dma40_ll.c +++ b/drivers/dma/ste_dma40_ll.c | |||
@@ -63,7 +63,7 @@ void d40_phy_cfg(struct stedma40_chan_cfg *cfg, | |||
63 | (cfg->dir == STEDMA40_PERIPH_TO_PERIPH)) { | 63 | (cfg->dir == STEDMA40_PERIPH_TO_PERIPH)) { |
64 | /* Set master port to 1 */ | 64 | /* Set master port to 1 */ |
65 | src |= 1 << D40_SREG_CFG_MST_POS; | 65 | src |= 1 << D40_SREG_CFG_MST_POS; |
66 | src |= D40_TYPE_TO_EVENT(cfg->src_dev_type); | 66 | src |= D40_TYPE_TO_EVENT(cfg->dev_type); |
67 | 67 | ||
68 | if (cfg->src_info.flow_ctrl == STEDMA40_NO_FLOW_CTRL) | 68 | if (cfg->src_info.flow_ctrl == STEDMA40_NO_FLOW_CTRL) |
69 | src |= 1 << D40_SREG_CFG_PHY_TM_POS; | 69 | src |= 1 << D40_SREG_CFG_PHY_TM_POS; |
@@ -74,7 +74,7 @@ void d40_phy_cfg(struct stedma40_chan_cfg *cfg, | |||
74 | (cfg->dir == STEDMA40_PERIPH_TO_PERIPH)) { | 74 | (cfg->dir == STEDMA40_PERIPH_TO_PERIPH)) { |
75 | /* Set master port to 1 */ | 75 | /* Set master port to 1 */ |
76 | dst |= 1 << D40_SREG_CFG_MST_POS; | 76 | dst |= 1 << D40_SREG_CFG_MST_POS; |
77 | dst |= D40_TYPE_TO_EVENT(cfg->dst_dev_type); | 77 | dst |= D40_TYPE_TO_EVENT(cfg->dev_type); |
78 | 78 | ||
79 | if (cfg->dst_info.flow_ctrl == STEDMA40_NO_FLOW_CTRL) | 79 | if (cfg->dst_info.flow_ctrl == STEDMA40_NO_FLOW_CTRL) |
80 | dst |= 1 << D40_SREG_CFG_PHY_TM_POS; | 80 | dst |= 1 << D40_SREG_CFG_PHY_TM_POS; |
diff --git a/include/linux/platform_data/dma-ste-dma40.h b/include/linux/platform_data/dma-ste-dma40.h index 869c571c8c08..9e42a67d0cd5 100644 --- a/include/linux/platform_data/dma-ste-dma40.h +++ b/include/linux/platform_data/dma-ste-dma40.h | |||
@@ -109,8 +109,7 @@ struct stedma40_half_channel_info { | |||
109 | * version 3+, i.e DB8500v2+ | 109 | * version 3+, i.e DB8500v2+ |
110 | * @mode: channel mode: physical, logical, or operation | 110 | * @mode: channel mode: physical, logical, or operation |
111 | * @mode_opt: options for the chosen channel mode | 111 | * @mode_opt: options for the chosen channel mode |
112 | * @src_dev_type: Src device type | 112 | * @dev_type: src/dst device type (driver uses dir to figure out which) |
113 | * @dst_dev_type: Dst device type | ||
114 | * @src_info: Parameters for dst half channel | 113 | * @src_info: Parameters for dst half channel |
115 | * @dst_info: Parameters for dst half channel | 114 | * @dst_info: Parameters for dst half channel |
116 | * @use_fixed_channel: if true, use physical channel specified by phy_channel | 115 | * @use_fixed_channel: if true, use physical channel specified by phy_channel |
@@ -126,8 +125,7 @@ struct stedma40_chan_cfg { | |||
126 | bool realtime; | 125 | bool realtime; |
127 | enum stedma40_mode mode; | 126 | enum stedma40_mode mode; |
128 | enum stedma40_mode_opt mode_opt; | 127 | enum stedma40_mode_opt mode_opt; |
129 | int src_dev_type; | 128 | int dev_type; |
130 | int dst_dev_type; | ||
131 | struct stedma40_half_channel_info src_info; | 129 | struct stedma40_half_channel_info src_info; |
132 | struct stedma40_half_channel_info dst_info; | 130 | struct stedma40_half_channel_info dst_info; |
133 | 131 | ||