diff options
author | Rafael J. Wysocki <rjw@sisk.pl> | 2012-06-30 09:30:16 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rjw@sisk.pl> | 2012-06-30 09:30:16 -0400 |
commit | 0fcc6d55028d94f3e5c1f9de39e6134764a4a17c (patch) | |
tree | 47b3cc2714099a1b4d9aa1fb78c06e41197f050c /arch/arm/mach-shmobile | |
parent | 080e0d1384a3fce16b7d5324dbfc47c136cc3573 (diff) | |
parent | 6088b422706af496d72065e8c539929f2d4a7e8b (diff) |
Merge branch 'renesas-sh73a0' into renesas-kzm9g
* renesas-sh73a0:
ARM: shmobile: use common DMAEngine definitions on sh73a0
ARM: shmobile: sh73a0: add DMAEngine support for MPDMAC
ARM: shmobile: sh73a0: add USB clock support
ARM: shmobile: add common DMAEngine definitions
ARM: shmobile: add common extra gpio functions
Diffstat (limited to 'arch/arm/mach-shmobile')
-rw-r--r-- | arch/arm/mach-shmobile/clock-sh73a0.c | 8 | ||||
-rw-r--r-- | arch/arm/mach-shmobile/include/mach/dma-register.h | 84 | ||||
-rw-r--r-- | arch/arm/mach-shmobile/include/mach/gpio.h | 32 | ||||
-rw-r--r-- | arch/arm/mach-shmobile/include/mach/sh73a0.h | 7 | ||||
-rw-r--r-- | arch/arm/mach-shmobile/setup-sh73a0.c | 152 |
5 files changed, 247 insertions, 36 deletions
diff --git a/arch/arm/mach-shmobile/clock-sh73a0.c b/arch/arm/mach-shmobile/clock-sh73a0.c index ad6f9ade7402..37ba0140b427 100644 --- a/arch/arm/mach-shmobile/clock-sh73a0.c +++ b/arch/arm/mach-shmobile/clock-sh73a0.c | |||
@@ -475,9 +475,9 @@ static struct clk *late_main_clks[] = { | |||
475 | 475 | ||
476 | enum { MSTP001, | 476 | enum { MSTP001, |
477 | MSTP129, MSTP128, MSTP127, MSTP126, MSTP125, MSTP118, MSTP116, MSTP100, | 477 | MSTP129, MSTP128, MSTP127, MSTP126, MSTP125, MSTP118, MSTP116, MSTP100, |
478 | MSTP219, MSTP218, | 478 | MSTP219, MSTP218, MSTP217, |
479 | MSTP207, MSTP206, MSTP204, MSTP203, MSTP202, MSTP201, MSTP200, | 479 | MSTP207, MSTP206, MSTP204, MSTP203, MSTP202, MSTP201, MSTP200, |
480 | MSTP331, MSTP329, MSTP328, MSTP325, MSTP323, | 480 | MSTP331, MSTP329, MSTP328, MSTP325, MSTP323, MSTP322, |
481 | MSTP314, MSTP313, MSTP312, MSTP311, | 481 | MSTP314, MSTP313, MSTP312, MSTP311, |
482 | MSTP303, MSTP302, MSTP301, MSTP300, | 482 | MSTP303, MSTP302, MSTP301, MSTP300, |
483 | MSTP411, MSTP410, MSTP403, | 483 | MSTP411, MSTP410, MSTP403, |
@@ -498,6 +498,7 @@ static struct clk mstp_clks[MSTP_NR] = { | |||
498 | [MSTP100] = MSTP(&div4_clks[DIV4_B], SMSTPCR1, 0, 0), /* LCDC0 */ | 498 | [MSTP100] = MSTP(&div4_clks[DIV4_B], SMSTPCR1, 0, 0), /* LCDC0 */ |
499 | [MSTP219] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 19, 0), /* SCIFA7 */ | 499 | [MSTP219] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 19, 0), /* SCIFA7 */ |
500 | [MSTP218] = MSTP(&div4_clks[DIV4_HP], SMSTPCR2, 18, 0), /* SY-DMAC */ | 500 | [MSTP218] = MSTP(&div4_clks[DIV4_HP], SMSTPCR2, 18, 0), /* SY-DMAC */ |
501 | [MSTP217] = MSTP(&div4_clks[DIV4_HP], SMSTPCR2, 17, 0), /* MP-DMAC */ | ||
501 | [MSTP207] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 7, 0), /* SCIFA5 */ | 502 | [MSTP207] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 7, 0), /* SCIFA5 */ |
502 | [MSTP206] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 6, 0), /* SCIFB */ | 503 | [MSTP206] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 6, 0), /* SCIFB */ |
503 | [MSTP204] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 4, 0), /* SCIFA0 */ | 504 | [MSTP204] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 4, 0), /* SCIFA0 */ |
@@ -510,6 +511,7 @@ static struct clk mstp_clks[MSTP_NR] = { | |||
510 | [MSTP328] = MSTP(&div4_clks[DIV4_HP], SMSTPCR3, 28, 0), /*FSI*/ | 511 | [MSTP328] = MSTP(&div4_clks[DIV4_HP], SMSTPCR3, 28, 0), /*FSI*/ |
511 | [MSTP325] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR3, 25, 0), /* IrDA */ | 512 | [MSTP325] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR3, 25, 0), /* IrDA */ |
512 | [MSTP323] = MSTP(&div4_clks[DIV4_HP], SMSTPCR3, 23, 0), /* IIC1 */ | 513 | [MSTP323] = MSTP(&div4_clks[DIV4_HP], SMSTPCR3, 23, 0), /* IIC1 */ |
514 | [MSTP322] = MSTP(&div4_clks[DIV4_HP], SMSTPCR3, 22, 0), /* USB */ | ||
513 | [MSTP314] = MSTP(&div6_clks[DIV6_SDHI0], SMSTPCR3, 14, 0), /* SDHI0 */ | 515 | [MSTP314] = MSTP(&div6_clks[DIV6_SDHI0], SMSTPCR3, 14, 0), /* SDHI0 */ |
514 | [MSTP313] = MSTP(&div6_clks[DIV6_SDHI1], SMSTPCR3, 13, 0), /* SDHI1 */ | 516 | [MSTP313] = MSTP(&div6_clks[DIV6_SDHI1], SMSTPCR3, 13, 0), /* SDHI1 */ |
515 | [MSTP312] = MSTP(&div4_clks[DIV4_HP], SMSTPCR3, 12, 0), /* MMCIF0 */ | 517 | [MSTP312] = MSTP(&div4_clks[DIV4_HP], SMSTPCR3, 12, 0), /* MMCIF0 */ |
@@ -554,6 +556,7 @@ static struct clk_lookup lookups[] = { | |||
554 | CLKDEV_DEV_ID("sh_mobile_lcdc_fb.0", &mstp_clks[MSTP100]), /* LCDC0 */ | 556 | CLKDEV_DEV_ID("sh_mobile_lcdc_fb.0", &mstp_clks[MSTP100]), /* LCDC0 */ |
555 | CLKDEV_DEV_ID("sh-sci.7", &mstp_clks[MSTP219]), /* SCIFA7 */ | 557 | CLKDEV_DEV_ID("sh-sci.7", &mstp_clks[MSTP219]), /* SCIFA7 */ |
556 | CLKDEV_DEV_ID("sh-dma-engine.0", &mstp_clks[MSTP218]), /* SY-DMAC */ | 558 | CLKDEV_DEV_ID("sh-dma-engine.0", &mstp_clks[MSTP218]), /* SY-DMAC */ |
559 | CLKDEV_DEV_ID("sh-dma-engine.1", &mstp_clks[MSTP217]), /* MP-DMAC */ | ||
557 | CLKDEV_DEV_ID("sh-sci.5", &mstp_clks[MSTP207]), /* SCIFA5 */ | 560 | CLKDEV_DEV_ID("sh-sci.5", &mstp_clks[MSTP207]), /* SCIFA5 */ |
558 | CLKDEV_DEV_ID("sh-sci.8", &mstp_clks[MSTP206]), /* SCIFB */ | 561 | CLKDEV_DEV_ID("sh-sci.8", &mstp_clks[MSTP206]), /* SCIFB */ |
559 | CLKDEV_DEV_ID("sh-sci.0", &mstp_clks[MSTP204]), /* SCIFA0 */ | 562 | CLKDEV_DEV_ID("sh-sci.0", &mstp_clks[MSTP204]), /* SCIFA0 */ |
@@ -566,6 +569,7 @@ static struct clk_lookup lookups[] = { | |||
566 | CLKDEV_DEV_ID("sh_fsi2", &mstp_clks[MSTP328]), /* FSI */ | 569 | CLKDEV_DEV_ID("sh_fsi2", &mstp_clks[MSTP328]), /* FSI */ |
567 | CLKDEV_DEV_ID("sh_irda.0", &mstp_clks[MSTP325]), /* IrDA */ | 570 | CLKDEV_DEV_ID("sh_irda.0", &mstp_clks[MSTP325]), /* IrDA */ |
568 | CLKDEV_DEV_ID("i2c-sh_mobile.1", &mstp_clks[MSTP323]), /* I2C1 */ | 571 | CLKDEV_DEV_ID("i2c-sh_mobile.1", &mstp_clks[MSTP323]), /* I2C1 */ |
572 | CLKDEV_DEV_ID("renesas_usbhs", &mstp_clks[MSTP322]), /* USB */ | ||
569 | CLKDEV_DEV_ID("sh_mobile_sdhi.0", &mstp_clks[MSTP314]), /* SDHI0 */ | 573 | CLKDEV_DEV_ID("sh_mobile_sdhi.0", &mstp_clks[MSTP314]), /* SDHI0 */ |
570 | CLKDEV_DEV_ID("sh_mobile_sdhi.1", &mstp_clks[MSTP313]), /* SDHI1 */ | 574 | CLKDEV_DEV_ID("sh_mobile_sdhi.1", &mstp_clks[MSTP313]), /* SDHI1 */ |
571 | CLKDEV_DEV_ID("sh_mmcif.0", &mstp_clks[MSTP312]), /* MMCIF0 */ | 575 | CLKDEV_DEV_ID("sh_mmcif.0", &mstp_clks[MSTP312]), /* MMCIF0 */ |
diff --git a/arch/arm/mach-shmobile/include/mach/dma-register.h b/arch/arm/mach-shmobile/include/mach/dma-register.h new file mode 100644 index 000000000000..97c40bd9b94f --- /dev/null +++ b/arch/arm/mach-shmobile/include/mach/dma-register.h | |||
@@ -0,0 +1,84 @@ | |||
1 | /* | ||
2 | * SH-ARM CPU-specific DMA definitions, used by both DMA drivers | ||
3 | * | ||
4 | * Copyright (C) 2012 Renesas Solutions Corp | ||
5 | * | ||
6 | * Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> | ||
7 | * | ||
8 | * Based on arch/sh/include/cpu-sh4/cpu/dma-register.h | ||
9 | * Copyright (C) 2010 Guennadi Liakhovetski <g.liakhovetski@gmx.de> | ||
10 | * | ||
11 | * This program is free software; you can redistribute it and/or modify | ||
12 | * it under the terms of the GNU General Public License version 2 as | ||
13 | * published by the Free Software Foundation. | ||
14 | */ | ||
15 | |||
16 | #ifndef DMA_REGISTER_H | ||
17 | #define DMA_REGISTER_H | ||
18 | |||
19 | /* | ||
20 | * Direct Memory Access Controller | ||
21 | */ | ||
22 | |||
23 | /* Transmit sizes and respective CHCR register values */ | ||
24 | enum { | ||
25 | XMIT_SZ_8BIT = 0, | ||
26 | XMIT_SZ_16BIT = 1, | ||
27 | XMIT_SZ_32BIT = 2, | ||
28 | XMIT_SZ_64BIT = 7, | ||
29 | XMIT_SZ_128BIT = 3, | ||
30 | XMIT_SZ_256BIT = 4, | ||
31 | XMIT_SZ_512BIT = 5, | ||
32 | }; | ||
33 | |||
34 | /* log2(size / 8) - used to calculate number of transfers */ | ||
35 | static const unsigned int dma_ts_shift[] = { | ||
36 | [XMIT_SZ_8BIT] = 0, | ||
37 | [XMIT_SZ_16BIT] = 1, | ||
38 | [XMIT_SZ_32BIT] = 2, | ||
39 | [XMIT_SZ_64BIT] = 3, | ||
40 | [XMIT_SZ_128BIT] = 4, | ||
41 | [XMIT_SZ_256BIT] = 5, | ||
42 | [XMIT_SZ_512BIT] = 6, | ||
43 | }; | ||
44 | |||
45 | #define TS_LOW_BIT 0x3 /* --xx */ | ||
46 | #define TS_HI_BIT 0xc /* xx-- */ | ||
47 | |||
48 | #define TS_LOW_SHIFT (3) | ||
49 | #define TS_HI_SHIFT (20 - 2) /* 2 bits for shifted low TS */ | ||
50 | |||
51 | #define TS_INDEX2VAL(i) \ | ||
52 | ((((i) & TS_LOW_BIT) << TS_LOW_SHIFT) |\ | ||
53 | (((i) & TS_HI_BIT) << TS_HI_SHIFT)) | ||
54 | |||
55 | #define CHCR_TX(xmit_sz) (DM_FIX | SM_INC | 0x800 | TS_INDEX2VAL((xmit_sz))) | ||
56 | #define CHCR_RX(xmit_sz) (DM_INC | SM_FIX | 0x800 | TS_INDEX2VAL((xmit_sz))) | ||
57 | |||
58 | |||
59 | /* | ||
60 | * USB High-Speed DMAC | ||
61 | */ | ||
62 | /* Transmit sizes and respective CHCR register values */ | ||
63 | enum { | ||
64 | USBTS_XMIT_SZ_8BYTE = 0, | ||
65 | USBTS_XMIT_SZ_16BYTE = 1, | ||
66 | USBTS_XMIT_SZ_32BYTE = 2, | ||
67 | }; | ||
68 | |||
69 | /* log2(size / 8) - used to calculate number of transfers */ | ||
70 | static const unsigned int dma_usbts_shift[] = { | ||
71 | [USBTS_XMIT_SZ_8BYTE] = 3, | ||
72 | [USBTS_XMIT_SZ_16BYTE] = 4, | ||
73 | [USBTS_XMIT_SZ_32BYTE] = 5, | ||
74 | }; | ||
75 | |||
76 | #define USBTS_LOW_BIT 0x3 /* --xx */ | ||
77 | #define USBTS_HI_BIT 0x0 /* ---- */ | ||
78 | |||
79 | #define USBTS_LOW_SHIFT 6 | ||
80 | #define USBTS_HI_SHIFT 0 | ||
81 | |||
82 | #define USBTS_INDEX2VAL(i) (((i) & 3) << 6) | ||
83 | |||
84 | #endif /* DMA_REGISTER_H */ | ||
diff --git a/arch/arm/mach-shmobile/include/mach/gpio.h b/arch/arm/mach-shmobile/include/mach/gpio.h index de795b42232a..844507d937cb 100644 --- a/arch/arm/mach-shmobile/include/mach/gpio.h +++ b/arch/arm/mach-shmobile/include/mach/gpio.h | |||
@@ -13,6 +13,7 @@ | |||
13 | #include <linux/kernel.h> | 13 | #include <linux/kernel.h> |
14 | #include <linux/errno.h> | 14 | #include <linux/errno.h> |
15 | #include <linux/sh_pfc.h> | 15 | #include <linux/sh_pfc.h> |
16 | #include <linux/io.h> | ||
16 | 17 | ||
17 | #ifdef CONFIG_GPIOLIB | 18 | #ifdef CONFIG_GPIOLIB |
18 | 19 | ||
@@ -27,4 +28,35 @@ static inline int irq_to_gpio(unsigned int irq) | |||
27 | 28 | ||
28 | #endif /* CONFIG_GPIOLIB */ | 29 | #endif /* CONFIG_GPIOLIB */ |
29 | 30 | ||
31 | /* | ||
32 | * FIXME !! | ||
33 | * | ||
34 | * current gpio frame work doesn't have | ||
35 | * the method to control only pull up/down/free. | ||
36 | * this function should be replaced by correct gpio function | ||
37 | */ | ||
38 | static inline void __init gpio_direction_none(u32 addr) | ||
39 | { | ||
40 | __raw_writeb(0x00, addr); | ||
41 | } | ||
42 | |||
43 | static inline void __init gpio_request_pullup(u32 addr) | ||
44 | { | ||
45 | u8 data = __raw_readb(addr); | ||
46 | |||
47 | data &= 0x0F; | ||
48 | data |= 0xC0; | ||
49 | __raw_writeb(data, addr); | ||
50 | } | ||
51 | |||
52 | static inline void __init gpio_request_pulldown(u32 addr) | ||
53 | { | ||
54 | u8 data = __raw_readb(addr); | ||
55 | |||
56 | data &= 0x0F; | ||
57 | data |= 0xA0; | ||
58 | |||
59 | __raw_writeb(data, addr); | ||
60 | } | ||
61 | |||
30 | #endif /* __ASM_ARCH_GPIO_H */ | 62 | #endif /* __ASM_ARCH_GPIO_H */ |
diff --git a/arch/arm/mach-shmobile/include/mach/sh73a0.h b/arch/arm/mach-shmobile/include/mach/sh73a0.h index 398e2c10913b..fe950f25d793 100644 --- a/arch/arm/mach-shmobile/include/mach/sh73a0.h +++ b/arch/arm/mach-shmobile/include/mach/sh73a0.h | |||
@@ -516,6 +516,13 @@ enum { | |||
516 | SHDMA_SLAVE_SDHI2_RX, | 516 | SHDMA_SLAVE_SDHI2_RX, |
517 | SHDMA_SLAVE_MMCIF_TX, | 517 | SHDMA_SLAVE_MMCIF_TX, |
518 | SHDMA_SLAVE_MMCIF_RX, | 518 | SHDMA_SLAVE_MMCIF_RX, |
519 | SHDMA_SLAVE_FSI2A_TX, | ||
520 | SHDMA_SLAVE_FSI2A_RX, | ||
521 | SHDMA_SLAVE_FSI2B_TX, | ||
522 | SHDMA_SLAVE_FSI2B_RX, | ||
523 | SHDMA_SLAVE_FSI2C_TX, | ||
524 | SHDMA_SLAVE_FSI2C_RX, | ||
525 | SHDMA_SLAVE_FSI2D_RX, | ||
519 | }; | 526 | }; |
520 | 527 | ||
521 | /* | 528 | /* |
diff --git a/arch/arm/mach-shmobile/setup-sh73a0.c b/arch/arm/mach-shmobile/setup-sh73a0.c index 04a0dfe75493..d230af656fc9 100644 --- a/arch/arm/mach-shmobile/setup-sh73a0.c +++ b/arch/arm/mach-shmobile/setup-sh73a0.c | |||
@@ -30,6 +30,7 @@ | |||
30 | #include <linux/sh_dma.h> | 30 | #include <linux/sh_dma.h> |
31 | #include <linux/sh_intc.h> | 31 | #include <linux/sh_intc.h> |
32 | #include <linux/sh_timer.h> | 32 | #include <linux/sh_timer.h> |
33 | #include <mach/dma-register.h> | ||
33 | #include <mach/hardware.h> | 34 | #include <mach/hardware.h> |
34 | #include <mach/irqs.h> | 35 | #include <mach/irqs.h> |
35 | #include <mach/sh73a0.h> | 36 | #include <mach/sh73a0.h> |
@@ -415,32 +416,6 @@ static struct platform_device i2c4_device = { | |||
415 | .num_resources = ARRAY_SIZE(i2c4_resources), | 416 | .num_resources = ARRAY_SIZE(i2c4_resources), |
416 | }; | 417 | }; |
417 | 418 | ||
418 | /* Transmit sizes and respective CHCR register values */ | ||
419 | enum { | ||
420 | XMIT_SZ_8BIT = 0, | ||
421 | XMIT_SZ_16BIT = 1, | ||
422 | XMIT_SZ_32BIT = 2, | ||
423 | XMIT_SZ_64BIT = 7, | ||
424 | XMIT_SZ_128BIT = 3, | ||
425 | XMIT_SZ_256BIT = 4, | ||
426 | XMIT_SZ_512BIT = 5, | ||
427 | }; | ||
428 | |||
429 | /* log2(size / 8) - used to calculate number of transfers */ | ||
430 | #define TS_SHIFT { \ | ||
431 | [XMIT_SZ_8BIT] = 0, \ | ||
432 | [XMIT_SZ_16BIT] = 1, \ | ||
433 | [XMIT_SZ_32BIT] = 2, \ | ||
434 | [XMIT_SZ_64BIT] = 3, \ | ||
435 | [XMIT_SZ_128BIT] = 4, \ | ||
436 | [XMIT_SZ_256BIT] = 5, \ | ||
437 | [XMIT_SZ_512BIT] = 6, \ | ||
438 | } | ||
439 | |||
440 | #define TS_INDEX2VAL(i) ((((i) & 3) << 3) | (((i) & 0xc) << (20 - 2))) | ||
441 | #define CHCR_TX(xmit_sz) (DM_FIX | SM_INC | 0x800 | TS_INDEX2VAL((xmit_sz))) | ||
442 | #define CHCR_RX(xmit_sz) (DM_INC | SM_FIX | 0x800 | TS_INDEX2VAL((xmit_sz))) | ||
443 | |||
444 | static const struct sh_dmae_slave_config sh73a0_dmae_slaves[] = { | 419 | static const struct sh_dmae_slave_config sh73a0_dmae_slaves[] = { |
445 | { | 420 | { |
446 | .slave_id = SHDMA_SLAVE_SCIF0_TX, | 421 | .slave_id = SHDMA_SLAVE_SCIF0_TX, |
@@ -604,19 +579,17 @@ static const struct sh_dmae_channel sh73a0_dmae_channels[] = { | |||
604 | DMAE_CHANNEL(0x8980), | 579 | DMAE_CHANNEL(0x8980), |
605 | }; | 580 | }; |
606 | 581 | ||
607 | static const unsigned int ts_shift[] = TS_SHIFT; | ||
608 | |||
609 | static struct sh_dmae_pdata sh73a0_dmae_platform_data = { | 582 | static struct sh_dmae_pdata sh73a0_dmae_platform_data = { |
610 | .slave = sh73a0_dmae_slaves, | 583 | .slave = sh73a0_dmae_slaves, |
611 | .slave_num = ARRAY_SIZE(sh73a0_dmae_slaves), | 584 | .slave_num = ARRAY_SIZE(sh73a0_dmae_slaves), |
612 | .channel = sh73a0_dmae_channels, | 585 | .channel = sh73a0_dmae_channels, |
613 | .channel_num = ARRAY_SIZE(sh73a0_dmae_channels), | 586 | .channel_num = ARRAY_SIZE(sh73a0_dmae_channels), |
614 | .ts_low_shift = 3, | 587 | .ts_low_shift = TS_LOW_SHIFT, |
615 | .ts_low_mask = 0x18, | 588 | .ts_low_mask = TS_LOW_BIT << TS_LOW_SHIFT, |
616 | .ts_high_shift = (20 - 2), /* 2 bits for shifted low TS */ | 589 | .ts_high_shift = TS_HI_SHIFT, |
617 | .ts_high_mask = 0x00300000, | 590 | .ts_high_mask = TS_HI_BIT << TS_HI_SHIFT, |
618 | .ts_shift = ts_shift, | 591 | .ts_shift = dma_ts_shift, |
619 | .ts_shift_num = ARRAY_SIZE(ts_shift), | 592 | .ts_shift_num = ARRAY_SIZE(dma_ts_shift), |
620 | .dmaor_init = DMAOR_DME, | 593 | .dmaor_init = DMAOR_DME, |
621 | }; | 594 | }; |
622 | 595 | ||
@@ -651,6 +624,116 @@ static struct platform_device dma0_device = { | |||
651 | }, | 624 | }, |
652 | }; | 625 | }; |
653 | 626 | ||
627 | /* MPDMAC */ | ||
628 | static const struct sh_dmae_slave_config sh73a0_mpdma_slaves[] = { | ||
629 | { | ||
630 | .slave_id = SHDMA_SLAVE_FSI2A_RX, | ||
631 | .addr = 0xec230020, | ||
632 | .chcr = CHCR_RX(XMIT_SZ_32BIT), | ||
633 | .mid_rid = 0xd6, /* CHECK ME */ | ||
634 | }, { | ||
635 | .slave_id = SHDMA_SLAVE_FSI2A_TX, | ||
636 | .addr = 0xec230024, | ||
637 | .chcr = CHCR_TX(XMIT_SZ_32BIT), | ||
638 | .mid_rid = 0xd5, /* CHECK ME */ | ||
639 | }, { | ||
640 | .slave_id = SHDMA_SLAVE_FSI2C_RX, | ||
641 | .addr = 0xec230060, | ||
642 | .chcr = CHCR_RX(XMIT_SZ_32BIT), | ||
643 | .mid_rid = 0xda, /* CHECK ME */ | ||
644 | }, { | ||
645 | .slave_id = SHDMA_SLAVE_FSI2C_TX, | ||
646 | .addr = 0xec230064, | ||
647 | .chcr = CHCR_TX(XMIT_SZ_32BIT), | ||
648 | .mid_rid = 0xd9, /* CHECK ME */ | ||
649 | }, { | ||
650 | .slave_id = SHDMA_SLAVE_FSI2B_RX, | ||
651 | .addr = 0xec240020, | ||
652 | .chcr = CHCR_RX(XMIT_SZ_32BIT), | ||
653 | .mid_rid = 0x8e, /* CHECK ME */ | ||
654 | }, { | ||
655 | .slave_id = SHDMA_SLAVE_FSI2B_TX, | ||
656 | .addr = 0xec240024, | ||
657 | .chcr = CHCR_RX(XMIT_SZ_32BIT), | ||
658 | .mid_rid = 0x8d, /* CHECK ME */ | ||
659 | }, { | ||
660 | .slave_id = SHDMA_SLAVE_FSI2D_RX, | ||
661 | .addr = 0xec240060, | ||
662 | .chcr = CHCR_RX(XMIT_SZ_32BIT), | ||
663 | .mid_rid = 0x9a, /* CHECK ME */ | ||
664 | }, | ||
665 | }; | ||
666 | |||
667 | #define MPDMA_CHANNEL(a, b, c) \ | ||
668 | { \ | ||
669 | .offset = a, \ | ||
670 | .dmars = b, \ | ||
671 | .dmars_bit = c, \ | ||
672 | .chclr_offset = (0x220 - 0x20) + a \ | ||
673 | } | ||
674 | |||
675 | static const struct sh_dmae_channel sh73a0_mpdma_channels[] = { | ||
676 | MPDMA_CHANNEL(0x00, 0, 0), | ||
677 | MPDMA_CHANNEL(0x10, 0, 8), | ||
678 | MPDMA_CHANNEL(0x20, 4, 0), | ||
679 | MPDMA_CHANNEL(0x30, 4, 8), | ||
680 | MPDMA_CHANNEL(0x50, 8, 0), | ||
681 | MPDMA_CHANNEL(0x70, 8, 8), | ||
682 | }; | ||
683 | |||
684 | static struct sh_dmae_pdata sh73a0_mpdma_platform_data = { | ||
685 | .slave = sh73a0_mpdma_slaves, | ||
686 | .slave_num = ARRAY_SIZE(sh73a0_mpdma_slaves), | ||
687 | .channel = sh73a0_mpdma_channels, | ||
688 | .channel_num = ARRAY_SIZE(sh73a0_mpdma_channels), | ||
689 | .ts_low_shift = TS_LOW_SHIFT, | ||
690 | .ts_low_mask = TS_LOW_BIT << TS_LOW_SHIFT, | ||
691 | .ts_high_shift = TS_HI_SHIFT, | ||
692 | .ts_high_mask = TS_HI_BIT << TS_HI_SHIFT, | ||
693 | .ts_shift = dma_ts_shift, | ||
694 | .ts_shift_num = ARRAY_SIZE(dma_ts_shift), | ||
695 | .dmaor_init = DMAOR_DME, | ||
696 | .chclr_present = 1, | ||
697 | }; | ||
698 | |||
699 | /* Resource order important! */ | ||
700 | static struct resource sh73a0_mpdma_resources[] = { | ||
701 | { | ||
702 | /* Channel registers and DMAOR */ | ||
703 | .start = 0xec618020, | ||
704 | .end = 0xec61828f, | ||
705 | .flags = IORESOURCE_MEM, | ||
706 | }, | ||
707 | { | ||
708 | /* DMARSx */ | ||
709 | .start = 0xec619000, | ||
710 | .end = 0xec61900b, | ||
711 | .flags = IORESOURCE_MEM, | ||
712 | }, | ||
713 | { | ||
714 | .name = "error_irq", | ||
715 | .start = gic_spi(181), | ||
716 | .end = gic_spi(181), | ||
717 | .flags = IORESOURCE_IRQ, | ||
718 | }, | ||
719 | { | ||
720 | /* IRQ for channels 0-5 */ | ||
721 | .start = gic_spi(175), | ||
722 | .end = gic_spi(180), | ||
723 | .flags = IORESOURCE_IRQ, | ||
724 | }, | ||
725 | }; | ||
726 | |||
727 | static struct platform_device mpdma0_device = { | ||
728 | .name = "sh-dma-engine", | ||
729 | .id = 1, | ||
730 | .resource = sh73a0_mpdma_resources, | ||
731 | .num_resources = ARRAY_SIZE(sh73a0_mpdma_resources), | ||
732 | .dev = { | ||
733 | .platform_data = &sh73a0_mpdma_platform_data, | ||
734 | }, | ||
735 | }; | ||
736 | |||
654 | static struct platform_device *sh73a0_early_devices[] __initdata = { | 737 | static struct platform_device *sh73a0_early_devices[] __initdata = { |
655 | &scif0_device, | 738 | &scif0_device, |
656 | &scif1_device, | 739 | &scif1_device, |
@@ -673,6 +756,7 @@ static struct platform_device *sh73a0_late_devices[] __initdata = { | |||
673 | &i2c3_device, | 756 | &i2c3_device, |
674 | &i2c4_device, | 757 | &i2c4_device, |
675 | &dma0_device, | 758 | &dma0_device, |
759 | &mpdma0_device, | ||
676 | }; | 760 | }; |
677 | 761 | ||
678 | #define SRCR2 0xe61580b0 | 762 | #define SRCR2 0xe61580b0 |