aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-ux500/board-mop500.c
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2010-10-14 07:57:59 -0400
committerLinus Walleij <linus.walleij@linaro.org>2011-03-14 09:05:14 -0400
commit5d7b8467e18b14ed44c5781d77993bfdcd8c826b (patch)
tree0bc8e0cd883c9c6a0a8184c8e69b22a6a5b8bddf /arch/arm/mach-ux500/board-mop500.c
parentec8f12533b4a439a8feb0d1a3bf15516781804be (diff)
mach-ux500: config Ux500 PL011 PL022 PL180 for DMA
This will configure the platform data for the PL011, PL022 and PL180 (derivate) PrimeCells found in the Ux500 to use DMA with the generic DMA engine for DMA40. Signed-off-by: Per Forlin <per.forlin@linaro.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'arch/arm/mach-ux500/board-mop500.c')
-rw-r--r--arch/arm/mach-ux500/board-mop500.c135
1 files changed, 122 insertions, 13 deletions
diff --git a/arch/arm/mach-ux500/board-mop500.c b/arch/arm/mach-ux500/board-mop500.c
index 5babce497415..67d9c634c05d 100644
--- a/arch/arm/mach-ux500/board-mop500.c
+++ b/arch/arm/mach-ux500/board-mop500.c
@@ -17,6 +17,7 @@
17#include <linux/gpio.h> 17#include <linux/gpio.h>
18#include <linux/amba/bus.h> 18#include <linux/amba/bus.h>
19#include <linux/amba/pl022.h> 19#include <linux/amba/pl022.h>
20#include <linux/amba/serial.h>
20#include <linux/spi/spi.h> 21#include <linux/spi/spi.h>
21#include <linux/mfd/ab8500.h> 22#include <linux/mfd/ab8500.h>
22#include <linux/mfd/tc3589x.h> 23#include <linux/mfd/tc3589x.h>
@@ -29,12 +30,14 @@
29 30
30#include <plat/pincfg.h> 31#include <plat/pincfg.h>
31#include <plat/i2c.h> 32#include <plat/i2c.h>
33#include <plat/ste_dma40.h>
32 34
33#include <mach/hardware.h> 35#include <mach/hardware.h>
34#include <mach/setup.h> 36#include <mach/setup.h>
35#include <mach/devices.h> 37#include <mach/devices.h>
36#include <mach/irqs.h> 38#include <mach/irqs.h>
37 39
40#include "ste-dma40-db8500.h"
38#include "devices-db8500.h" 41#include "devices-db8500.h"
39#include "pins-db8500.h" 42#include "pins-db8500.h"
40#include "board-mop500.h" 43#include "board-mop500.h"
@@ -123,16 +126,6 @@ struct platform_device ab8500_device = {
123 .resource = ab8500_resources, 126 .resource = ab8500_resources,
124}; 127};
125 128
126static struct pl022_ssp_controller ssp0_platform_data = {
127 .bus_id = 0,
128 /* pl022 not yet supports dma */
129 .enable_dma = 0,
130 /* on this platform, gpio 31,142,144,214 &
131 * 224 are connected as chip selects
132 */
133 .num_chipselect = 5,
134};
135
136/* 129/*
137 * TC35892 130 * TC35892
138 */ 131 */
@@ -319,16 +312,132 @@ static struct platform_device *platform_devs[] __initdata = {
319 &mop500_gpio_keys_device, 312 &mop500_gpio_keys_device,
320}; 313};
321 314
315#ifdef CONFIG_STE_DMA40
316static struct stedma40_chan_cfg ssp0_dma_cfg_rx = {
317 .mode = STEDMA40_MODE_LOGICAL,
318 .dir = STEDMA40_PERIPH_TO_MEM,
319 .src_dev_type = DB8500_DMA_DEV8_SSP0_RX,
320 .dst_dev_type = STEDMA40_DEV_DST_MEMORY,
321 .src_info.data_width = STEDMA40_BYTE_WIDTH,
322 .dst_info.data_width = STEDMA40_BYTE_WIDTH,
323};
324
325static struct stedma40_chan_cfg ssp0_dma_cfg_tx = {
326 .mode = STEDMA40_MODE_LOGICAL,
327 .dir = STEDMA40_MEM_TO_PERIPH,
328 .src_dev_type = STEDMA40_DEV_SRC_MEMORY,
329 .dst_dev_type = DB8500_DMA_DEV8_SSP0_TX,
330 .src_info.data_width = STEDMA40_BYTE_WIDTH,
331 .dst_info.data_width = STEDMA40_BYTE_WIDTH,
332};
333#endif
334
335static struct pl022_ssp_controller ssp0_platform_data = {
336 .bus_id = 0,
337#ifdef CONFIG_STE_DMA40
338 .enable_dma = 1,
339 .dma_filter = stedma40_filter,
340 .dma_rx_param = &ssp0_dma_cfg_rx,
341 .dma_tx_param = &ssp0_dma_cfg_tx,
342#else
343 .enable_dma = 0,
344#endif
345 /* on this platform, gpio 31,142,144,214 &
346 * 224 are connected as chip selects
347 */
348 .num_chipselect = 5,
349};
350
322static void __init mop500_spi_init(void) 351static void __init mop500_spi_init(void)
323{ 352{
324 db8500_add_ssp0(&ssp0_platform_data); 353 db8500_add_ssp0(&ssp0_platform_data);
325} 354}
326 355
356#ifdef CONFIG_STE_DMA40
357static struct stedma40_chan_cfg uart0_dma_cfg_rx = {
358 .mode = STEDMA40_MODE_LOGICAL,
359 .dir = STEDMA40_PERIPH_TO_MEM,
360 .src_dev_type = DB8500_DMA_DEV13_UART0_RX,
361 .dst_dev_type = STEDMA40_DEV_DST_MEMORY,
362 .src_info.data_width = STEDMA40_BYTE_WIDTH,
363 .dst_info.data_width = STEDMA40_BYTE_WIDTH,
364};
365
366static struct stedma40_chan_cfg uart0_dma_cfg_tx = {
367 .mode = STEDMA40_MODE_LOGICAL,
368 .dir = STEDMA40_MEM_TO_PERIPH,
369 .src_dev_type = STEDMA40_DEV_SRC_MEMORY,
370 .dst_dev_type = DB8500_DMA_DEV13_UART0_TX,
371 .src_info.data_width = STEDMA40_BYTE_WIDTH,
372 .dst_info.data_width = STEDMA40_BYTE_WIDTH,
373};
374
375static struct stedma40_chan_cfg uart1_dma_cfg_rx = {
376 .mode = STEDMA40_MODE_LOGICAL,
377 .dir = STEDMA40_PERIPH_TO_MEM,
378 .src_dev_type = DB8500_DMA_DEV12_UART1_RX,
379 .dst_dev_type = STEDMA40_DEV_DST_MEMORY,
380 .src_info.data_width = STEDMA40_BYTE_WIDTH,
381 .dst_info.data_width = STEDMA40_BYTE_WIDTH,
382};
383
384static struct stedma40_chan_cfg uart1_dma_cfg_tx = {
385 .mode = STEDMA40_MODE_LOGICAL,
386 .dir = STEDMA40_MEM_TO_PERIPH,
387 .src_dev_type = STEDMA40_DEV_SRC_MEMORY,
388 .dst_dev_type = DB8500_DMA_DEV12_UART1_TX,
389 .src_info.data_width = STEDMA40_BYTE_WIDTH,
390 .dst_info.data_width = STEDMA40_BYTE_WIDTH,
391};
392
393static struct stedma40_chan_cfg uart2_dma_cfg_rx = {
394 .mode = STEDMA40_MODE_LOGICAL,
395 .dir = STEDMA40_PERIPH_TO_MEM,
396 .src_dev_type = DB8500_DMA_DEV11_UART2_RX,
397 .dst_dev_type = STEDMA40_DEV_DST_MEMORY,
398 .src_info.data_width = STEDMA40_BYTE_WIDTH,
399 .dst_info.data_width = STEDMA40_BYTE_WIDTH,
400};
401
402static struct stedma40_chan_cfg uart2_dma_cfg_tx = {
403 .mode = STEDMA40_MODE_LOGICAL,
404 .dir = STEDMA40_MEM_TO_PERIPH,
405 .src_dev_type = STEDMA40_DEV_SRC_MEMORY,
406 .dst_dev_type = DB8500_DMA_DEV11_UART2_TX,
407 .src_info.data_width = STEDMA40_BYTE_WIDTH,
408 .dst_info.data_width = STEDMA40_BYTE_WIDTH,
409};
410#endif
411
412static struct amba_pl011_data uart0_plat = {
413#ifdef CONFIG_STE_DMA40
414 .dma_filter = stedma40_filter,
415 .dma_rx_param = &uart0_dma_cfg_rx,
416 .dma_tx_param = &uart0_dma_cfg_tx,
417#endif
418};
419
420static struct amba_pl011_data uart1_plat = {
421#ifdef CONFIG_STE_DMA40
422 .dma_filter = stedma40_filter,
423 .dma_rx_param = &uart1_dma_cfg_rx,
424 .dma_tx_param = &uart1_dma_cfg_tx,
425#endif
426};
427
428static struct amba_pl011_data uart2_plat = {
429#ifdef CONFIG_STE_DMA40
430 .dma_filter = stedma40_filter,
431 .dma_rx_param = &uart2_dma_cfg_rx,
432 .dma_tx_param = &uart2_dma_cfg_tx,
433#endif
434};
435
327static void __init mop500_uart_init(void) 436static void __init mop500_uart_init(void)
328{ 437{
329 db8500_add_uart0(); 438 db8500_add_uart0(&uart0_plat);
330 db8500_add_uart1(); 439 db8500_add_uart1(&uart1_plat);
331 db8500_add_uart2(); 440 db8500_add_uart2(&uart2_plat);
332} 441}
333 442
334static void __init u8500_init_machine(void) 443static void __init u8500_init_machine(void)