aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-ux500
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-07-02 17:33:21 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-07-02 17:33:21 -0400
commit0bf6a210a43f7118d858806200127e421649fc4e (patch)
tree9a17d88ebd1b9bc693fba7f39c12123dec96e930 /arch/arm/mach-ux500
parentee1a8d402e7e204d57fb108aa40003b6d1633036 (diff)
parent5c913a9a9772f4b434aaea7328836419287b5d1c (diff)
Merge tag 'drivers-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
Pull ARM SoC driver specific changes from Arnd Bergmann: "These changes are all driver specific and cross over between arm-soc contents and some other subsystem, in these cases cpufreq, crypto, dma, pinctrl, mailbox and usb, and the subsystem owners agreed to have these changes merged through arm-soc. As we proceed to untangle the dependencies between platform code and driver code, the amount of changes in this category is fortunately shrinking, for 3.11 we have 16 branches here and 101 non-merge changesets, the majority of which are for the stedma40 dma engine driver used in the ux500 platform. Cleaning up that code touches multiple subsystems, but gets rid of the dependency in the end. The mailbox code moved out from mach-omap2 to drivers/mailbox is an intermediate step and is still omap specific at the moment. Patches exist to generalize the subsystem and add other drivers with the same API, but those did not make it for 3.11." * tag 'drivers-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (101 commits) crypto: ux500: use dmaengine_submit API crypto: ux500: use dmaengine_prep_slave_sg API crypto: ux500: use dmaengine_device_control API crypto: ux500/crypt: add missing __iomem qualifiers crypto: ux500/hash: add missing static qualifiers crypto: ux500/hash: use readl on iomem addresses dmaengine: ste_dma40: Declare memcpy config as static ARM: ux500: Remove mop500_snowball_ethernet_clock_enable() ARM: ux500: Correct the EN_3v3 regulator's on/off GPIO ARM: ux500: Provide a AB8500 GPIO Device Tree node gpio: rcar: fix gpio_rcar_of_table gpio-rcar: Remove #ifdef CONFIG_OF around OF-specific sections gpio-rcar: Reference core gpio documentation in the DT bindings clk: exynos5250: Add enum entries for divider clock of i2s1 and i2s2 ARM: dts: Update Samsung I2S documentation ARM: dts: add clock provider information for i2s controllers in Exynos5250 ARM: dts: add Exynos audio subsystem clock controller node clk: samsung: register audio subsystem clocks using common clock framework ARM: dts: use #include for all device trees for Samsung pinctrl: s3c24xx: use correct header for chained_irq functions ...
Diffstat (limited to 'arch/arm/mach-ux500')
-rw-r--r--arch/arm/mach-ux500/board-mop500-audio.c68
-rw-r--r--arch/arm/mach-ux500/board-mop500-sdi.c56
-rw-r--r--arch/arm/mach-ux500/board-mop500.c94
-rw-r--r--arch/arm/mach-ux500/board-mop500.h2
-rw-r--r--arch/arm/mach-ux500/cpu-db8500.c66
-rw-r--r--arch/arm/mach-ux500/devices-db8500.c123
-rw-r--r--arch/arm/mach-ux500/ste-dma40-db8500.h193
-rw-r--r--arch/arm/mach-ux500/usb.c47
8 files changed, 148 insertions, 501 deletions
diff --git a/arch/arm/mach-ux500/board-mop500-audio.c b/arch/arm/mach-ux500/board-mop500-audio.c
index aba9e5692958..bfe443daf4b0 100644
--- a/arch/arm/mach-ux500/board-mop500-audio.c
+++ b/arch/arm/mach-ux500/board-mop500-audio.c
@@ -21,28 +21,14 @@
21 21
22static struct stedma40_chan_cfg msp0_dma_rx = { 22static struct stedma40_chan_cfg msp0_dma_rx = {
23 .high_priority = true, 23 .high_priority = true,
24 .dir = STEDMA40_PERIPH_TO_MEM, 24 .dir = DMA_DEV_TO_MEM,
25 25 .dev_type = DB8500_DMA_DEV31_MSP0_SLIM0_CH0,
26 .src_dev_type = DB8500_DMA_DEV31_MSP0_RX_SLIM0_CH0_RX,
27 .dst_dev_type = STEDMA40_DEV_DST_MEMORY,
28
29 .src_info.psize = STEDMA40_PSIZE_LOG_4,
30 .dst_info.psize = STEDMA40_PSIZE_LOG_4,
31
32 /* data_width is set during configuration */
33}; 26};
34 27
35static struct stedma40_chan_cfg msp0_dma_tx = { 28static struct stedma40_chan_cfg msp0_dma_tx = {
36 .high_priority = true, 29 .high_priority = true,
37 .dir = STEDMA40_MEM_TO_PERIPH, 30 .dir = DMA_MEM_TO_DEV,
38 31 .dev_type = DB8500_DMA_DEV31_MSP0_SLIM0_CH0,
39 .src_dev_type = STEDMA40_DEV_DST_MEMORY,
40 .dst_dev_type = DB8500_DMA_DEV31_MSP0_TX_SLIM0_CH0_TX,
41
42 .src_info.psize = STEDMA40_PSIZE_LOG_4,
43 .dst_info.psize = STEDMA40_PSIZE_LOG_4,
44
45 /* data_width is set during configuration */
46}; 32};
47 33
48struct msp_i2s_platform_data msp0_platform_data = { 34struct msp_i2s_platform_data msp0_platform_data = {
@@ -53,28 +39,14 @@ struct msp_i2s_platform_data msp0_platform_data = {
53 39
54static struct stedma40_chan_cfg msp1_dma_rx = { 40static struct stedma40_chan_cfg msp1_dma_rx = {
55 .high_priority = true, 41 .high_priority = true,
56 .dir = STEDMA40_PERIPH_TO_MEM, 42 .dir = DMA_DEV_TO_MEM,
57 43 .dev_type = DB8500_DMA_DEV30_MSP3,
58 .src_dev_type = DB8500_DMA_DEV30_MSP3_RX,
59 .dst_dev_type = STEDMA40_DEV_DST_MEMORY,
60
61 .src_info.psize = STEDMA40_PSIZE_LOG_4,
62 .dst_info.psize = STEDMA40_PSIZE_LOG_4,
63
64 /* data_width is set during configuration */
65}; 44};
66 45
67static struct stedma40_chan_cfg msp1_dma_tx = { 46static struct stedma40_chan_cfg msp1_dma_tx = {
68 .high_priority = true, 47 .high_priority = true,
69 .dir = STEDMA40_MEM_TO_PERIPH, 48 .dir = DMA_MEM_TO_DEV,
70 49 .dev_type = DB8500_DMA_DEV30_MSP1,
71 .src_dev_type = STEDMA40_DEV_DST_MEMORY,
72 .dst_dev_type = DB8500_DMA_DEV30_MSP1_TX,
73
74 .src_info.psize = STEDMA40_PSIZE_LOG_4,
75 .dst_info.psize = STEDMA40_PSIZE_LOG_4,
76
77 /* data_width is set during configuration */
78}; 50};
79 51
80struct msp_i2s_platform_data msp1_platform_data = { 52struct msp_i2s_platform_data msp1_platform_data = {
@@ -85,32 +57,16 @@ struct msp_i2s_platform_data msp1_platform_data = {
85 57
86static struct stedma40_chan_cfg msp2_dma_rx = { 58static struct stedma40_chan_cfg msp2_dma_rx = {
87 .high_priority = true, 59 .high_priority = true,
88 .dir = STEDMA40_PERIPH_TO_MEM, 60 .dir = DMA_DEV_TO_MEM,
89 61 .dev_type = DB8500_DMA_DEV14_MSP2,
90 .src_dev_type = DB8500_DMA_DEV14_MSP2_RX,
91 .dst_dev_type = STEDMA40_DEV_DST_MEMORY,
92
93 /* MSP2 DMA doesn't work with PSIZE == 4 on DB8500v2 */
94 .src_info.psize = STEDMA40_PSIZE_LOG_1,
95 .dst_info.psize = STEDMA40_PSIZE_LOG_1,
96
97 /* data_width is set during configuration */
98}; 62};
99 63
100static struct stedma40_chan_cfg msp2_dma_tx = { 64static struct stedma40_chan_cfg msp2_dma_tx = {
101 .high_priority = true, 65 .high_priority = true,
102 .dir = STEDMA40_MEM_TO_PERIPH, 66 .dir = DMA_MEM_TO_DEV,
103 67 .dev_type = DB8500_DMA_DEV14_MSP2,
104 .src_dev_type = STEDMA40_DEV_DST_MEMORY,
105 .dst_dev_type = DB8500_DMA_DEV14_MSP2_TX,
106
107 .src_info.psize = STEDMA40_PSIZE_LOG_4,
108 .dst_info.psize = STEDMA40_PSIZE_LOG_4,
109
110 .use_fixed_channel = true, 68 .use_fixed_channel = true,
111 .phy_channel = 1, 69 .phy_channel = 1,
112
113 /* data_width is set during configuration */
114}; 70};
115 71
116static struct platform_device *db8500_add_msp_i2s(struct device *parent, 72static struct platform_device *db8500_add_msp_i2s(struct device *parent,
diff --git a/arch/arm/mach-ux500/board-mop500-sdi.c b/arch/arm/mach-ux500/board-mop500-sdi.c
index 43be3e0d4e30..b3e61a38e5c8 100644
--- a/arch/arm/mach-ux500/board-mop500-sdi.c
+++ b/arch/arm/mach-ux500/board-mop500-sdi.c
@@ -34,20 +34,14 @@
34#ifdef CONFIG_STE_DMA40 34#ifdef CONFIG_STE_DMA40
35struct stedma40_chan_cfg mop500_sdi0_dma_cfg_rx = { 35struct 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 = DMA_DEV_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,
41 .dst_info.data_width = STEDMA40_WORD_WIDTH,
42}; 39};
43 40
44static struct stedma40_chan_cfg mop500_sdi0_dma_cfg_tx = { 41static struct stedma40_chan_cfg mop500_sdi0_dma_cfg_tx = {
45 .mode = STEDMA40_MODE_LOGICAL, 42 .mode = STEDMA40_MODE_LOGICAL,
46 .dir = STEDMA40_MEM_TO_PERIPH, 43 .dir = DMA_MEM_TO_DEV,
47 .src_dev_type = STEDMA40_DEV_SRC_MEMORY, 44 .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,
50 .dst_info.data_width = STEDMA40_WORD_WIDTH,
51}; 45};
52#endif 46#endif
53 47
@@ -89,20 +83,14 @@ void mop500_sdi_tc35892_init(struct device *parent)
89#ifdef CONFIG_STE_DMA40 83#ifdef CONFIG_STE_DMA40
90static struct stedma40_chan_cfg sdi1_dma_cfg_rx = { 84static struct stedma40_chan_cfg sdi1_dma_cfg_rx = {
91 .mode = STEDMA40_MODE_LOGICAL, 85 .mode = STEDMA40_MODE_LOGICAL,
92 .dir = STEDMA40_PERIPH_TO_MEM, 86 .dir = DMA_DEV_TO_MEM,
93 .src_dev_type = DB8500_DMA_DEV32_SD_MM1_RX, 87 .dev_type = DB8500_DMA_DEV32_SD_MM1,
94 .dst_dev_type = STEDMA40_DEV_DST_MEMORY,
95 .src_info.data_width = STEDMA40_WORD_WIDTH,
96 .dst_info.data_width = STEDMA40_WORD_WIDTH,
97}; 88};
98 89
99static struct stedma40_chan_cfg sdi1_dma_cfg_tx = { 90static struct stedma40_chan_cfg sdi1_dma_cfg_tx = {
100 .mode = STEDMA40_MODE_LOGICAL, 91 .mode = STEDMA40_MODE_LOGICAL,
101 .dir = STEDMA40_MEM_TO_PERIPH, 92 .dir = DMA_MEM_TO_DEV,
102 .src_dev_type = STEDMA40_DEV_SRC_MEMORY, 93 .dev_type = DB8500_DMA_DEV32_SD_MM1,
103 .dst_dev_type = DB8500_DMA_DEV32_SD_MM1_TX,
104 .src_info.data_width = STEDMA40_WORD_WIDTH,
105 .dst_info.data_width = STEDMA40_WORD_WIDTH,
106}; 94};
107#endif 95#endif
108 96
@@ -127,20 +115,14 @@ struct mmci_platform_data mop500_sdi1_data = {
127#ifdef CONFIG_STE_DMA40 115#ifdef CONFIG_STE_DMA40
128struct stedma40_chan_cfg mop500_sdi2_dma_cfg_rx = { 116struct stedma40_chan_cfg mop500_sdi2_dma_cfg_rx = {
129 .mode = STEDMA40_MODE_LOGICAL, 117 .mode = STEDMA40_MODE_LOGICAL,
130 .dir = STEDMA40_PERIPH_TO_MEM, 118 .dir = DMA_DEV_TO_MEM,
131 .src_dev_type = DB8500_DMA_DEV28_SD_MM2_RX, 119 .dev_type = DB8500_DMA_DEV28_SD_MM2,
132 .dst_dev_type = STEDMA40_DEV_DST_MEMORY,
133 .src_info.data_width = STEDMA40_WORD_WIDTH,
134 .dst_info.data_width = STEDMA40_WORD_WIDTH,
135}; 120};
136 121
137static struct stedma40_chan_cfg mop500_sdi2_dma_cfg_tx = { 122static struct stedma40_chan_cfg mop500_sdi2_dma_cfg_tx = {
138 .mode = STEDMA40_MODE_LOGICAL, 123 .mode = STEDMA40_MODE_LOGICAL,
139 .dir = STEDMA40_MEM_TO_PERIPH, 124 .dir = DMA_MEM_TO_DEV,
140 .src_dev_type = STEDMA40_DEV_SRC_MEMORY, 125 .dev_type = DB8500_DMA_DEV28_SD_MM2,
141 .dst_dev_type = DB8500_DMA_DEV28_SD_MM2_TX,
142 .src_info.data_width = STEDMA40_WORD_WIDTH,
143 .dst_info.data_width = STEDMA40_WORD_WIDTH,
144}; 126};
145#endif 127#endif
146 128
@@ -169,20 +151,14 @@ struct mmci_platform_data mop500_sdi2_data = {
169#ifdef CONFIG_STE_DMA40 151#ifdef CONFIG_STE_DMA40
170struct stedma40_chan_cfg mop500_sdi4_dma_cfg_rx = { 152struct stedma40_chan_cfg mop500_sdi4_dma_cfg_rx = {
171 .mode = STEDMA40_MODE_LOGICAL, 153 .mode = STEDMA40_MODE_LOGICAL,
172 .dir = STEDMA40_PERIPH_TO_MEM, 154 .dir = DMA_DEV_TO_MEM,
173 .src_dev_type = DB8500_DMA_DEV42_SD_MM4_RX, 155 .dev_type = DB8500_DMA_DEV42_SD_MM4,
174 .dst_dev_type = STEDMA40_DEV_DST_MEMORY,
175 .src_info.data_width = STEDMA40_WORD_WIDTH,
176 .dst_info.data_width = STEDMA40_WORD_WIDTH,
177}; 156};
178 157
179static struct stedma40_chan_cfg mop500_sdi4_dma_cfg_tx = { 158static struct stedma40_chan_cfg mop500_sdi4_dma_cfg_tx = {
180 .mode = STEDMA40_MODE_LOGICAL, 159 .mode = STEDMA40_MODE_LOGICAL,
181 .dir = STEDMA40_MEM_TO_PERIPH, 160 .dir = DMA_MEM_TO_DEV,
182 .src_dev_type = STEDMA40_DEV_SRC_MEMORY, 161 .dev_type = DB8500_DMA_DEV42_SD_MM4,
183 .dst_dev_type = DB8500_DMA_DEV42_SD_MM4_TX,
184 .src_info.data_width = STEDMA40_WORD_WIDTH,
185 .dst_info.data_width = STEDMA40_WORD_WIDTH,
186}; 162};
187#endif 163#endif
188 164
diff --git a/arch/arm/mach-ux500/board-mop500.c b/arch/arm/mach-ux500/board-mop500.c
index 78389de94dde..df5d27a532e9 100644
--- a/arch/arm/mach-ux500/board-mop500.c
+++ b/arch/arm/mach-ux500/board-mop500.c
@@ -413,47 +413,23 @@ static void mop500_prox_deactivate(struct device *dev)
413 regulator_put(prox_regulator); 413 regulator_put(prox_regulator);
414} 414}
415 415
416void mop500_snowball_ethernet_clock_enable(void)
417{
418 struct clk *clk;
419
420 clk = clk_get_sys("fsmc", NULL);
421 if (!IS_ERR(clk))
422 clk_prepare_enable(clk);
423}
424
425static struct cryp_platform_data u8500_cryp1_platform_data = { 416static struct cryp_platform_data u8500_cryp1_platform_data = {
426 .mem_to_engine = { 417 .mem_to_engine = {
427 .dir = STEDMA40_MEM_TO_PERIPH, 418 .dir = DMA_MEM_TO_DEV,
428 .src_dev_type = STEDMA40_DEV_SRC_MEMORY, 419 .dev_type = DB8500_DMA_DEV48_CAC1,
429 .dst_dev_type = DB8500_DMA_DEV48_CAC1_TX,
430 .src_info.data_width = STEDMA40_WORD_WIDTH,
431 .dst_info.data_width = STEDMA40_WORD_WIDTH,
432 .mode = STEDMA40_MODE_LOGICAL, 420 .mode = STEDMA40_MODE_LOGICAL,
433 .src_info.psize = STEDMA40_PSIZE_LOG_4,
434 .dst_info.psize = STEDMA40_PSIZE_LOG_4,
435 }, 421 },
436 .engine_to_mem = { 422 .engine_to_mem = {
437 .dir = STEDMA40_PERIPH_TO_MEM, 423 .dir = DMA_DEV_TO_MEM,
438 .src_dev_type = DB8500_DMA_DEV48_CAC1_RX, 424 .dev_type = DB8500_DMA_DEV48_CAC1,
439 .dst_dev_type = STEDMA40_DEV_DST_MEMORY,
440 .src_info.data_width = STEDMA40_WORD_WIDTH,
441 .dst_info.data_width = STEDMA40_WORD_WIDTH,
442 .mode = STEDMA40_MODE_LOGICAL, 425 .mode = STEDMA40_MODE_LOGICAL,
443 .src_info.psize = STEDMA40_PSIZE_LOG_4,
444 .dst_info.psize = STEDMA40_PSIZE_LOG_4,
445 } 426 }
446}; 427};
447 428
448static struct stedma40_chan_cfg u8500_hash_dma_cfg_tx = { 429static struct stedma40_chan_cfg u8500_hash_dma_cfg_tx = {
449 .dir = STEDMA40_MEM_TO_PERIPH, 430 .dir = DMA_MEM_TO_DEV,
450 .src_dev_type = STEDMA40_DEV_SRC_MEMORY, 431 .dev_type = DB8500_DMA_DEV50_HAC1_TX,
451 .dst_dev_type = DB8500_DMA_DEV50_HAC1_TX,
452 .src_info.data_width = STEDMA40_WORD_WIDTH,
453 .dst_info.data_width = STEDMA40_WORD_WIDTH,
454 .mode = STEDMA40_MODE_LOGICAL, 432 .mode = STEDMA40_MODE_LOGICAL,
455 .src_info.psize = STEDMA40_PSIZE_LOG_16,
456 .dst_info.psize = STEDMA40_PSIZE_LOG_16,
457}; 433};
458 434
459static struct hash_platform_data u8500_hash1_platform_data = { 435static struct hash_platform_data u8500_hash1_platform_data = {
@@ -470,20 +446,14 @@ static struct platform_device *mop500_platform_devs[] __initdata = {
470#ifdef CONFIG_STE_DMA40 446#ifdef CONFIG_STE_DMA40
471static struct stedma40_chan_cfg ssp0_dma_cfg_rx = { 447static struct stedma40_chan_cfg ssp0_dma_cfg_rx = {
472 .mode = STEDMA40_MODE_LOGICAL, 448 .mode = STEDMA40_MODE_LOGICAL,
473 .dir = STEDMA40_PERIPH_TO_MEM, 449 .dir = DMA_DEV_TO_MEM,
474 .src_dev_type = DB8500_DMA_DEV8_SSP0_RX, 450 .dev_type = DB8500_DMA_DEV8_SSP0,
475 .dst_dev_type = STEDMA40_DEV_DST_MEMORY,
476 .src_info.data_width = STEDMA40_BYTE_WIDTH,
477 .dst_info.data_width = STEDMA40_BYTE_WIDTH,
478}; 451};
479 452
480static struct stedma40_chan_cfg ssp0_dma_cfg_tx = { 453static struct stedma40_chan_cfg ssp0_dma_cfg_tx = {
481 .mode = STEDMA40_MODE_LOGICAL, 454 .mode = STEDMA40_MODE_LOGICAL,
482 .dir = STEDMA40_MEM_TO_PERIPH, 455 .dir = DMA_MEM_TO_DEV,
483 .src_dev_type = STEDMA40_DEV_SRC_MEMORY, 456 .dev_type = DB8500_DMA_DEV8_SSP0,
484 .dst_dev_type = DB8500_DMA_DEV8_SSP0_TX,
485 .src_info.data_width = STEDMA40_BYTE_WIDTH,
486 .dst_info.data_width = STEDMA40_BYTE_WIDTH,
487}; 457};
488#endif 458#endif
489 459
@@ -511,56 +481,38 @@ static void __init mop500_spi_init(struct device *parent)
511#ifdef CONFIG_STE_DMA40 481#ifdef CONFIG_STE_DMA40
512static struct stedma40_chan_cfg uart0_dma_cfg_rx = { 482static struct stedma40_chan_cfg uart0_dma_cfg_rx = {
513 .mode = STEDMA40_MODE_LOGICAL, 483 .mode = STEDMA40_MODE_LOGICAL,
514 .dir = STEDMA40_PERIPH_TO_MEM, 484 .dir = DMA_DEV_TO_MEM,
515 .src_dev_type = DB8500_DMA_DEV13_UART0_RX, 485 .dev_type = DB8500_DMA_DEV13_UART0,
516 .dst_dev_type = STEDMA40_DEV_DST_MEMORY,
517 .src_info.data_width = STEDMA40_BYTE_WIDTH,
518 .dst_info.data_width = STEDMA40_BYTE_WIDTH,
519}; 486};
520 487
521static struct stedma40_chan_cfg uart0_dma_cfg_tx = { 488static struct stedma40_chan_cfg uart0_dma_cfg_tx = {
522 .mode = STEDMA40_MODE_LOGICAL, 489 .mode = STEDMA40_MODE_LOGICAL,
523 .dir = STEDMA40_MEM_TO_PERIPH, 490 .dir = DMA_MEM_TO_DEV,
524 .src_dev_type = STEDMA40_DEV_SRC_MEMORY, 491 .dev_type = DB8500_DMA_DEV13_UART0,
525 .dst_dev_type = DB8500_DMA_DEV13_UART0_TX,
526 .src_info.data_width = STEDMA40_BYTE_WIDTH,
527 .dst_info.data_width = STEDMA40_BYTE_WIDTH,
528}; 492};
529 493
530static struct stedma40_chan_cfg uart1_dma_cfg_rx = { 494static struct stedma40_chan_cfg uart1_dma_cfg_rx = {
531 .mode = STEDMA40_MODE_LOGICAL, 495 .mode = STEDMA40_MODE_LOGICAL,
532 .dir = STEDMA40_PERIPH_TO_MEM, 496 .dir = DMA_DEV_TO_MEM,
533 .src_dev_type = DB8500_DMA_DEV12_UART1_RX, 497 .dev_type = DB8500_DMA_DEV12_UART1,
534 .dst_dev_type = STEDMA40_DEV_DST_MEMORY,
535 .src_info.data_width = STEDMA40_BYTE_WIDTH,
536 .dst_info.data_width = STEDMA40_BYTE_WIDTH,
537}; 498};
538 499
539static struct stedma40_chan_cfg uart1_dma_cfg_tx = { 500static struct stedma40_chan_cfg uart1_dma_cfg_tx = {
540 .mode = STEDMA40_MODE_LOGICAL, 501 .mode = STEDMA40_MODE_LOGICAL,
541 .dir = STEDMA40_MEM_TO_PERIPH, 502 .dir = DMA_MEM_TO_DEV,
542 .src_dev_type = STEDMA40_DEV_SRC_MEMORY, 503 .dev_type = DB8500_DMA_DEV12_UART1,
543 .dst_dev_type = DB8500_DMA_DEV12_UART1_TX,
544 .src_info.data_width = STEDMA40_BYTE_WIDTH,
545 .dst_info.data_width = STEDMA40_BYTE_WIDTH,
546}; 504};
547 505
548static struct stedma40_chan_cfg uart2_dma_cfg_rx = { 506static struct stedma40_chan_cfg uart2_dma_cfg_rx = {
549 .mode = STEDMA40_MODE_LOGICAL, 507 .mode = STEDMA40_MODE_LOGICAL,
550 .dir = STEDMA40_PERIPH_TO_MEM, 508 .dir = DMA_DEV_TO_MEM,
551 .src_dev_type = DB8500_DMA_DEV11_UART2_RX, 509 .dev_type = DB8500_DMA_DEV11_UART2,
552 .dst_dev_type = STEDMA40_DEV_DST_MEMORY,
553 .src_info.data_width = STEDMA40_BYTE_WIDTH,
554 .dst_info.data_width = STEDMA40_BYTE_WIDTH,
555}; 510};
556 511
557static struct stedma40_chan_cfg uart2_dma_cfg_tx = { 512static struct stedma40_chan_cfg uart2_dma_cfg_tx = {
558 .mode = STEDMA40_MODE_LOGICAL, 513 .mode = STEDMA40_MODE_LOGICAL,
559 .dir = STEDMA40_MEM_TO_PERIPH, 514 .dir = DMA_MEM_TO_DEV,
560 .src_dev_type = STEDMA40_DEV_SRC_MEMORY, 515 .dev_type = DB8500_DMA_DEV11_UART2,
561 .dst_dev_type = DB8500_DMA_DEV11_UART2_TX,
562 .src_info.data_width = STEDMA40_BYTE_WIDTH,
563 .dst_info.data_width = STEDMA40_BYTE_WIDTH,
564}; 516};
565#endif 517#endif
566 518
@@ -674,7 +626,7 @@ static void __init snowball_init_machine(void)
674 mop500_audio_init(parent); 626 mop500_audio_init(parent);
675 mop500_uart_init(parent); 627 mop500_uart_init(parent);
676 628
677 mop500_snowball_ethernet_clock_enable(); 629 u8500_cryp1_hash1_init(parent);
678 630
679 /* This board has full regulator constraints */ 631 /* This board has full regulator constraints */
680 regulator_has_full_constraints(); 632 regulator_has_full_constraints();
diff --git a/arch/arm/mach-ux500/board-mop500.h b/arch/arm/mach-ux500/board-mop500.h
index 49514b825034..d6fab166cbf1 100644
--- a/arch/arm/mach-ux500/board-mop500.h
+++ b/arch/arm/mach-ux500/board-mop500.h
@@ -93,6 +93,7 @@ extern struct amba_pl011_data uart0_plat;
93extern struct amba_pl011_data uart1_plat; 93extern struct amba_pl011_data uart1_plat;
94extern struct amba_pl011_data uart2_plat; 94extern struct amba_pl011_data uart2_plat;
95extern struct pl022_ssp_controller ssp0_plat; 95extern struct pl022_ssp_controller ssp0_plat;
96extern struct stedma40_platform_data dma40_plat_data;
96 97
97extern void mop500_sdi_init(struct device *parent); 98extern void mop500_sdi_init(struct device *parent);
98extern void snowball_sdi_init(struct device *parent); 99extern void snowball_sdi_init(struct device *parent);
@@ -104,7 +105,6 @@ void __init mop500_pinmaps_init(void);
104void __init snowball_pinmaps_init(void); 105void __init snowball_pinmaps_init(void);
105void __init hrefv60_pinmaps_init(void); 106void __init hrefv60_pinmaps_init(void);
106void mop500_audio_init(struct device *parent); 107void mop500_audio_init(struct device *parent);
107void mop500_snowball_ethernet_clock_enable(void);
108 108
109int __init mop500_uib_init(void); 109int __init mop500_uib_init(void);
110void mop500_uib_i2c_add(int busnum, struct i2c_board_info *info, 110void mop500_uib_i2c_add(int busnum, struct i2c_board_info *info,
diff --git a/arch/arm/mach-ux500/cpu-db8500.c b/arch/arm/mach-ux500/cpu-db8500.c
index 7669a49fb6fb..12eee8167525 100644
--- a/arch/arm/mach-ux500/cpu-db8500.c
+++ b/arch/arm/mach-ux500/cpu-db8500.c
@@ -162,26 +162,15 @@ static void __init db8500_add_gpios(struct device *parent)
162 dbx500_add_pinctrl(parent, "pinctrl-db8500", U8500_PRCMU_BASE); 162 dbx500_add_pinctrl(parent, "pinctrl-db8500", U8500_PRCMU_BASE);
163} 163}
164 164
165static int usb_db8500_rx_dma_cfg[] = { 165static int usb_db8500_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};
175
176static int usb_db8500_tx_dma_cfg[] = {
177 DB8500_DMA_DEV38_USB_OTG_OEP_1_9,
178 DB8500_DMA_DEV37_USB_OTG_OEP_2_10,
179 DB8500_DMA_DEV36_USB_OTG_OEP_3_11,
180 DB8500_DMA_DEV19_USB_OTG_OEP_4_12,
181 DB8500_DMA_DEV18_USB_OTG_OEP_5_13,
182 DB8500_DMA_DEV17_USB_OTG_OEP_6_14,
183 DB8500_DMA_DEV16_USB_OTG_OEP_7_15,
184 DB8500_DMA_DEV39_USB_OTG_OEP_8
185}; 174};
186 175
187static const char *db8500_read_soc_id(void) 176static const char *db8500_read_soc_id(void)
@@ -215,7 +204,7 @@ struct device * __init u8500_init_devices(void)
215 204
216 db8500_add_rtc(parent); 205 db8500_add_rtc(parent);
217 db8500_add_gpios(parent); 206 db8500_add_gpios(parent);
218 db8500_add_usb(parent, usb_db8500_rx_dma_cfg, usb_db8500_tx_dma_cfg); 207 db8500_add_usb(parent, usb_db8500_dma_cfg, usb_db8500_dma_cfg);
219 208
220 for (i = 0; i < ARRAY_SIZE(platform_devs); i++) 209 for (i = 0; i < ARRAY_SIZE(platform_devs); i++)
221 platform_devs[i]->dev.parent = parent; 210 platform_devs[i]->dev.parent = parent;
@@ -226,34 +215,13 @@ struct device * __init u8500_init_devices(void)
226} 215}
227 216
228#ifdef CONFIG_MACH_UX500_DT 217#ifdef CONFIG_MACH_UX500_DT
229
230/* TODO: Once all pieces are DT:ed, remove completely. */
231static struct device * __init u8500_of_init_devices(void)
232{
233 struct device *parent = db8500_soc_device_init();
234
235 db8500_add_usb(parent, usb_db8500_rx_dma_cfg, usb_db8500_tx_dma_cfg);
236
237 u8500_dma40_device.dev.parent = parent;
238
239 /*
240 * Devices to be DT:ed:
241 * u8500_dma40_device = todo
242 * db8500_pmu_device = done
243 * db8500_prcmu_device = done
244 */
245 platform_device_register(&u8500_dma40_device);
246
247 return parent;
248}
249
250static struct of_dev_auxdata u8500_auxdata_lookup[] __initdata = { 218static struct of_dev_auxdata u8500_auxdata_lookup[] __initdata = {
251 /* Requires call-back bindings. */ 219 /* Requires call-back bindings. */
252 OF_DEV_AUXDATA("arm,cortex-a9-pmu", 0, "arm-pmu", &db8500_pmu_platdata), 220 OF_DEV_AUXDATA("arm,cortex-a9-pmu", 0, "arm-pmu", &db8500_pmu_platdata),
253 /* Requires DMA bindings. */ 221 /* Requires DMA bindings. */
254 OF_DEV_AUXDATA("arm,pl011", 0x80120000, "uart0", &uart0_plat), 222 OF_DEV_AUXDATA("arm,pl011", 0x80120000, "uart0", NULL),
255 OF_DEV_AUXDATA("arm,pl011", 0x80121000, "uart1", &uart1_plat), 223 OF_DEV_AUXDATA("arm,pl011", 0x80121000, "uart1", NULL),
256 OF_DEV_AUXDATA("arm,pl011", 0x80007000, "uart2", &uart2_plat), 224 OF_DEV_AUXDATA("arm,pl011", 0x80007000, "uart2", NULL),
257 OF_DEV_AUXDATA("arm,pl022", 0x80002000, "ssp0", &ssp0_plat), 225 OF_DEV_AUXDATA("arm,pl022", 0x80002000, "ssp0", &ssp0_plat),
258 OF_DEV_AUXDATA("arm,pl18x", 0x80126000, "sdi0", &mop500_sdi0_data), 226 OF_DEV_AUXDATA("arm,pl18x", 0x80126000, "sdi0", &mop500_sdi0_data),
259 OF_DEV_AUXDATA("arm,pl18x", 0x80118000, "sdi1", &mop500_sdi1_data), 227 OF_DEV_AUXDATA("arm,pl18x", 0x80118000, "sdi1", &mop500_sdi1_data),
@@ -294,6 +262,8 @@ static struct of_dev_auxdata u8500_auxdata_lookup[] __initdata = {
294 "ux500-msp-i2s.2", &msp2_platform_data), 262 "ux500-msp-i2s.2", &msp2_platform_data),
295 OF_DEV_AUXDATA("stericsson,ux500-msp-i2s", 0x80125000, 263 OF_DEV_AUXDATA("stericsson,ux500-msp-i2s", 0x80125000,
296 "ux500-msp-i2s.3", &msp3_platform_data), 264 "ux500-msp-i2s.3", &msp3_platform_data),
265 /* Requires clock name bindings and channel address lookup table. */
266 OF_DEV_AUXDATA("stericsson,db8500-dma40", 0x801C0000, "dma40.0", NULL),
297 {}, 267 {},
298}; 268};
299 269
@@ -317,22 +287,18 @@ static const struct of_device_id u8500_local_bus_nodes[] = {
317 287
318static void __init u8500_init_machine(void) 288static void __init u8500_init_machine(void)
319{ 289{
320 struct device *parent = NULL; 290 struct device *parent = db8500_soc_device_init();
321 291
322 /* Pinmaps must be in place before devices register */ 292 /* Pinmaps must be in place before devices register */
323 if (of_machine_is_compatible("st-ericsson,mop500")) 293 if (of_machine_is_compatible("st-ericsson,mop500"))
324 mop500_pinmaps_init(); 294 mop500_pinmaps_init();
325 else if (of_machine_is_compatible("calaosystems,snowball-a9500")) { 295 else if (of_machine_is_compatible("calaosystems,snowball-a9500")) {
326 snowball_pinmaps_init(); 296 snowball_pinmaps_init();
327 mop500_snowball_ethernet_clock_enable();
328 } else if (of_machine_is_compatible("st-ericsson,hrefv60+")) 297 } else if (of_machine_is_compatible("st-ericsson,hrefv60+"))
329 hrefv60_pinmaps_init(); 298 hrefv60_pinmaps_init();
330 else if (of_machine_is_compatible("st-ericsson,ccu9540")) {} 299 else if (of_machine_is_compatible("st-ericsson,ccu9540")) {}
331 /* TODO: Add pinmaps for ccu9540 board. */ 300 /* TODO: Add pinmaps for ccu9540 board. */
332 301
333 /* TODO: Export SoC, USB, cpu-freq and DMA40 */
334 parent = u8500_of_init_devices();
335
336 /* automatically probe child nodes of dbx5x0 devices */ 302 /* automatically probe child nodes of dbx5x0 devices */
337 if (of_machine_is_compatible("st-ericsson,u8540")) 303 if (of_machine_is_compatible("st-ericsson,u8540"))
338 of_platform_populate(NULL, u8500_local_bus_nodes, 304 of_platform_populate(NULL, u8500_local_bus_nodes,
diff --git a/arch/arm/mach-ux500/devices-db8500.c b/arch/arm/mach-ux500/devices-db8500.c
index ddbdcda8306a..516a6f57d159 100644
--- a/arch/arm/mach-ux500/devices-db8500.c
+++ b/arch/arm/mach-ux500/devices-db8500.c
@@ -42,128 +42,7 @@ static struct resource dma40_resources[] = {
42 } 42 }
43}; 43};
44 44
45/* Default configuration for physcial memcpy */ 45struct stedma40_platform_data dma40_plat_data = {
46struct stedma40_chan_cfg dma40_memcpy_conf_phy = {
47 .mode = STEDMA40_MODE_PHYSICAL,
48 .dir = STEDMA40_MEM_TO_MEM,
49
50 .src_info.data_width = STEDMA40_BYTE_WIDTH,
51 .src_info.psize = STEDMA40_PSIZE_PHY_1,
52 .src_info.flow_ctrl = STEDMA40_NO_FLOW_CTRL,
53
54 .dst_info.data_width = STEDMA40_BYTE_WIDTH,
55 .dst_info.psize = STEDMA40_PSIZE_PHY_1,
56 .dst_info.flow_ctrl = STEDMA40_NO_FLOW_CTRL,
57};
58/* Default configuration for logical memcpy */
59struct stedma40_chan_cfg dma40_memcpy_conf_log = {
60 .dir = STEDMA40_MEM_TO_MEM,
61
62 .src_info.data_width = STEDMA40_BYTE_WIDTH,
63 .src_info.psize = STEDMA40_PSIZE_LOG_1,
64 .src_info.flow_ctrl = STEDMA40_NO_FLOW_CTRL,
65
66 .dst_info.data_width = STEDMA40_BYTE_WIDTH,
67 .dst_info.psize = STEDMA40_PSIZE_LOG_1,
68 .dst_info.flow_ctrl = STEDMA40_NO_FLOW_CTRL,
69};
70
71/*
72 * Mapping between destination event lines and physical device address.
73 * The event line is tied to a device and therefore the address is constant.
74 * When the address comes from a primecell it will be configured in runtime
75 * and we set the address to -1 as a placeholder.
76 */
77static const dma_addr_t dma40_tx_map[DB8500_DMA_NR_DEV] = {
78 /* MUSB - these will be runtime-reconfigured */
79 [DB8500_DMA_DEV39_USB_OTG_OEP_8] = -1,
80 [DB8500_DMA_DEV16_USB_OTG_OEP_7_15] = -1,
81 [DB8500_DMA_DEV17_USB_OTG_OEP_6_14] = -1,
82 [DB8500_DMA_DEV18_USB_OTG_OEP_5_13] = -1,
83 [DB8500_DMA_DEV19_USB_OTG_OEP_4_12] = -1,
84 [DB8500_DMA_DEV36_USB_OTG_OEP_3_11] = -1,
85 [DB8500_DMA_DEV37_USB_OTG_OEP_2_10] = -1,
86 [DB8500_DMA_DEV38_USB_OTG_OEP_1_9] = -1,
87 /* PrimeCells - run-time configured */
88 [DB8500_DMA_DEV0_SPI0_TX] = -1,
89 [DB8500_DMA_DEV1_SD_MMC0_TX] = -1,
90 [DB8500_DMA_DEV2_SD_MMC1_TX] = -1,
91 [DB8500_DMA_DEV3_SD_MMC2_TX] = -1,
92 [DB8500_DMA_DEV8_SSP0_TX] = -1,
93 [DB8500_DMA_DEV9_SSP1_TX] = -1,
94 [DB8500_DMA_DEV11_UART2_TX] = -1,
95 [DB8500_DMA_DEV12_UART1_TX] = -1,
96 [DB8500_DMA_DEV13_UART0_TX] = -1,
97 [DB8500_DMA_DEV28_SD_MM2_TX] = -1,
98 [DB8500_DMA_DEV29_SD_MM0_TX] = -1,
99 [DB8500_DMA_DEV32_SD_MM1_TX] = -1,
100 [DB8500_DMA_DEV33_SPI2_TX] = -1,
101 [DB8500_DMA_DEV35_SPI1_TX] = -1,
102 [DB8500_DMA_DEV40_SPI3_TX] = -1,
103 [DB8500_DMA_DEV41_SD_MM3_TX] = -1,
104 [DB8500_DMA_DEV42_SD_MM4_TX] = -1,
105 [DB8500_DMA_DEV43_SD_MM5_TX] = -1,
106 [DB8500_DMA_DEV14_MSP2_TX] = U8500_MSP2_BASE + MSP_TX_RX_REG_OFFSET,
107 [DB8500_DMA_DEV30_MSP1_TX] = U8500_MSP1_BASE + MSP_TX_RX_REG_OFFSET,
108 [DB8500_DMA_DEV31_MSP0_TX_SLIM0_CH0_TX] = U8500_MSP0_BASE + MSP_TX_RX_REG_OFFSET,
109 [DB8500_DMA_DEV48_CAC1_TX] = U8500_CRYP1_BASE + CRYP1_TX_REG_OFFSET,
110 [DB8500_DMA_DEV50_HAC1_TX] = U8500_HASH1_BASE + HASH1_TX_REG_OFFSET,
111};
112
113/* Mapping between source event lines and physical device address */
114static const dma_addr_t dma40_rx_map[DB8500_DMA_NR_DEV] = {
115 /* MUSB - these will be runtime-reconfigured */
116 [DB8500_DMA_DEV39_USB_OTG_IEP_8] = -1,
117 [DB8500_DMA_DEV16_USB_OTG_IEP_7_15] = -1,
118 [DB8500_DMA_DEV17_USB_OTG_IEP_6_14] = -1,
119 [DB8500_DMA_DEV18_USB_OTG_IEP_5_13] = -1,
120 [DB8500_DMA_DEV19_USB_OTG_IEP_4_12] = -1,
121 [DB8500_DMA_DEV36_USB_OTG_IEP_3_11] = -1,
122 [DB8500_DMA_DEV37_USB_OTG_IEP_2_10] = -1,
123 [DB8500_DMA_DEV38_USB_OTG_IEP_1_9] = -1,
124 /* PrimeCells */
125 [DB8500_DMA_DEV0_SPI0_RX] = -1,
126 [DB8500_DMA_DEV1_SD_MMC0_RX] = -1,
127 [DB8500_DMA_DEV2_SD_MMC1_RX] = -1,
128 [DB8500_DMA_DEV3_SD_MMC2_RX] = -1,
129 [DB8500_DMA_DEV8_SSP0_RX] = -1,
130 [DB8500_DMA_DEV9_SSP1_RX] = -1,
131 [DB8500_DMA_DEV11_UART2_RX] = -1,
132 [DB8500_DMA_DEV12_UART1_RX] = -1,
133 [DB8500_DMA_DEV13_UART0_RX] = -1,
134 [DB8500_DMA_DEV28_SD_MM2_RX] = -1,
135 [DB8500_DMA_DEV29_SD_MM0_RX] = -1,
136 [DB8500_DMA_DEV32_SD_MM1_RX] = -1,
137 [DB8500_DMA_DEV33_SPI2_RX] = -1,
138 [DB8500_DMA_DEV35_SPI1_RX] = -1,
139 [DB8500_DMA_DEV40_SPI3_RX] = -1,
140 [DB8500_DMA_DEV41_SD_MM3_RX] = -1,
141 [DB8500_DMA_DEV42_SD_MM4_RX] = -1,
142 [DB8500_DMA_DEV43_SD_MM5_RX] = -1,
143 [DB8500_DMA_DEV14_MSP2_RX] = U8500_MSP2_BASE + MSP_TX_RX_REG_OFFSET,
144 [DB8500_DMA_DEV30_MSP3_RX] = U8500_MSP3_BASE + MSP_TX_RX_REG_OFFSET,
145 [DB8500_DMA_DEV31_MSP0_RX_SLIM0_CH0_RX] = U8500_MSP0_BASE + MSP_TX_RX_REG_OFFSET,
146 [DB8500_DMA_DEV48_CAC1_RX] = U8500_CRYP1_BASE + CRYP1_RX_REG_OFFSET,
147};
148
149/* Reserved event lines for memcpy only */
150static int dma40_memcpy_event[] = {
151 DB8500_DMA_MEMCPY_TX_0,
152 DB8500_DMA_MEMCPY_TX_1,
153 DB8500_DMA_MEMCPY_TX_2,
154 DB8500_DMA_MEMCPY_TX_3,
155 DB8500_DMA_MEMCPY_TX_4,
156 DB8500_DMA_MEMCPY_TX_5,
157};
158
159static struct stedma40_platform_data dma40_plat_data = {
160 .dev_len = DB8500_DMA_NR_DEV,
161 .dev_rx = dma40_rx_map,
162 .dev_tx = dma40_tx_map,
163 .memcpy = dma40_memcpy_event,
164 .memcpy_len = ARRAY_SIZE(dma40_memcpy_event),
165 .memcpy_conf_phy = &dma40_memcpy_conf_phy,
166 .memcpy_conf_log = &dma40_memcpy_conf_log,
167 .disabled_channels = {-1}, 46 .disabled_channels = {-1},
168}; 47};
169 48
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
15enum 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, 20enum 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 */
77enum 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..b7bd8d3a5507 100644
--- a/arch/arm/mach-ux500/usb.c
+++ b/arch/arm/mach-ux500/usb.c
@@ -14,25 +14,15 @@
14 14
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 = DMA_DEV_TO_MEM, \
18 .dst_dev_type = STEDMA40_DEV_DST_MEMORY, \
19 .src_info.data_width = STEDMA40_WORD_WIDTH, \
20 .dst_info.data_width = STEDMA40_WORD_WIDTH, \
21 .src_info.psize = STEDMA40_PSIZE_LOG_16, \
22 .dst_info.psize = STEDMA40_PSIZE_LOG_16, \
23 } 18 }
24 19
25#define MUSB_DMA40_TX_CH { \ 20#define MUSB_DMA40_TX_CH { \
26 .mode = STEDMA40_MODE_LOGICAL, \ 21 .mode = STEDMA40_MODE_LOGICAL, \
27 .dir = STEDMA40_MEM_TO_PERIPH, \ 22 .dir = DMA_MEM_TO_DEV, \
28 .src_dev_type = STEDMA40_DEV_SRC_MEMORY, \
29 .src_info.data_width = STEDMA40_WORD_WIDTH, \
30 .dst_info.data_width = STEDMA40_WORD_WIDTH, \
31 .src_info.psize = STEDMA40_PSIZE_LOG_16, \
32 .dst_info.psize = STEDMA40_PSIZE_LOG_16, \
33 } 23 }
34 24
35static struct stedma40_chan_cfg musb_dma_rx_ch[UX500_MUSB_DMA_NUM_RX_CHANNELS] 25static struct stedma40_chan_cfg musb_dma_rx_ch[UX500_MUSB_DMA_NUM_RX_TX_CHANNELS]
36 = { 26 = {
37 MUSB_DMA40_RX_CH, 27 MUSB_DMA40_RX_CH,
38 MUSB_DMA40_RX_CH, 28 MUSB_DMA40_RX_CH,
@@ -44,7 +34,7 @@ static struct stedma40_chan_cfg musb_dma_rx_ch[UX500_MUSB_DMA_NUM_RX_CHANNELS]
44 MUSB_DMA40_RX_CH 34 MUSB_DMA40_RX_CH
45}; 35};
46 36
47static struct stedma40_chan_cfg musb_dma_tx_ch[UX500_MUSB_DMA_NUM_TX_CHANNELS] 37static struct stedma40_chan_cfg musb_dma_tx_ch[UX500_MUSB_DMA_NUM_RX_TX_CHANNELS]
48 = { 38 = {
49 MUSB_DMA40_TX_CH, 39 MUSB_DMA40_TX_CH,
50 MUSB_DMA40_TX_CH, 40 MUSB_DMA40_TX_CH,
@@ -56,7 +46,7 @@ static struct stedma40_chan_cfg musb_dma_tx_ch[UX500_MUSB_DMA_NUM_TX_CHANNELS]
56 MUSB_DMA40_TX_CH, 46 MUSB_DMA40_TX_CH,
57}; 47};
58 48
59static void *ux500_dma_rx_param_array[UX500_MUSB_DMA_NUM_RX_CHANNELS] = { 49static void *ux500_dma_rx_param_array[UX500_MUSB_DMA_NUM_RX_TX_CHANNELS] = {
60 &musb_dma_rx_ch[0], 50 &musb_dma_rx_ch[0],
61 &musb_dma_rx_ch[1], 51 &musb_dma_rx_ch[1],
62 &musb_dma_rx_ch[2], 52 &musb_dma_rx_ch[2],
@@ -67,7 +57,7 @@ static void *ux500_dma_rx_param_array[UX500_MUSB_DMA_NUM_RX_CHANNELS] = {
67 &musb_dma_rx_ch[7] 57 &musb_dma_rx_ch[7]
68}; 58};
69 59
70static void *ux500_dma_tx_param_array[UX500_MUSB_DMA_NUM_TX_CHANNELS] = { 60static void *ux500_dma_tx_param_array[UX500_MUSB_DMA_NUM_RX_TX_CHANNELS] = {
71 &musb_dma_tx_ch[0], 61 &musb_dma_tx_ch[0],
72 &musb_dma_tx_ch[1], 62 &musb_dma_tx_ch[1],
73 &musb_dma_tx_ch[2], 63 &musb_dma_tx_ch[2],
@@ -81,23 +71,11 @@ static void *ux500_dma_tx_param_array[UX500_MUSB_DMA_NUM_TX_CHANNELS] = {
81static struct ux500_musb_board_data musb_board_data = { 71static struct ux500_musb_board_data musb_board_data = {
82 .dma_rx_param_array = ux500_dma_rx_param_array, 72 .dma_rx_param_array = ux500_dma_rx_param_array,
83 .dma_tx_param_array = ux500_dma_tx_param_array, 73 .dma_tx_param_array = ux500_dma_tx_param_array,
84 .num_rx_channels = UX500_MUSB_DMA_NUM_RX_CHANNELS,
85 .num_tx_channels = UX500_MUSB_DMA_NUM_TX_CHANNELS,
86 .dma_filter = stedma40_filter, 74 .dma_filter = stedma40_filter,
87}; 75};
88 76
89static u64 ux500_musb_dmamask = DMA_BIT_MASK(32);
90
91static struct musb_hdrc_config musb_hdrc_config = {
92 .multipoint = true,
93 .dyn_fifo = true,
94 .num_eps = 16,
95 .ram_bits = 16,
96};
97
98static struct musb_hdrc_platform_data musb_platform_data = { 77static struct musb_hdrc_platform_data musb_platform_data = {
99 .mode = MUSB_OTG, 78 .mode = MUSB_OTG,
100 .config = &musb_hdrc_config,
101 .board_data = &musb_board_data, 79 .board_data = &musb_board_data,
102}; 80};
103 81
@@ -118,27 +96,26 @@ struct platform_device ux500_musb_device = {
118 .id = 0, 96 .id = 0,
119 .dev = { 97 .dev = {
120 .platform_data = &musb_platform_data, 98 .platform_data = &musb_platform_data,
121 .dma_mask = &ux500_musb_dmamask,
122 .coherent_dma_mask = DMA_BIT_MASK(32), 99 .coherent_dma_mask = DMA_BIT_MASK(32),
123 }, 100 },
124 .num_resources = ARRAY_SIZE(usb_resources), 101 .num_resources = ARRAY_SIZE(usb_resources),
125 .resource = usb_resources, 102 .resource = usb_resources,
126}; 103};
127 104
128static inline void ux500_usb_dma_update_rx_ch_config(int *src_dev_type) 105static inline void ux500_usb_dma_update_rx_ch_config(int *dev_type)
129{ 106{
130 u32 idx; 107 u32 idx;
131 108
132 for (idx = 0; idx < UX500_MUSB_DMA_NUM_RX_CHANNELS; idx++) 109 for (idx = 0; idx < UX500_MUSB_DMA_NUM_RX_TX_CHANNELS; idx++)
133 musb_dma_rx_ch[idx].src_dev_type = src_dev_type[idx]; 110 musb_dma_rx_ch[idx].dev_type = dev_type[idx];
134} 111}
135 112
136static inline void ux500_usb_dma_update_tx_ch_config(int *dst_dev_type) 113static inline void ux500_usb_dma_update_tx_ch_config(int *dev_type)
137{ 114{
138 u32 idx; 115 u32 idx;
139 116
140 for (idx = 0; idx < UX500_MUSB_DMA_NUM_TX_CHANNELS; idx++) 117 for (idx = 0; idx < UX500_MUSB_DMA_NUM_RX_TX_CHANNELS; idx++)
141 musb_dma_tx_ch[idx].dst_dev_type = dst_dev_type[idx]; 118 musb_dma_tx_ch[idx].dev_type = dev_type[idx];
142} 119}
143 120
144void ux500_add_usb(struct device *parent, resource_size_t base, int irq, 121void ux500_add_usb(struct device *parent, resource_size_t base, int irq,