diff options
| author | Jassi Brar <jassi.brar@samsung.com> | 2010-05-17 22:59:20 -0400 |
|---|---|---|
| committer | Ben Dooks <ben-linux@fluff.org> | 2010-05-18 05:00:12 -0400 |
| commit | d8b5065b75e87e87c2cbba984b3050e869b4b910 (patch) | |
| tree | 0f6f137ef740a51f6eb3f09af7891a86c9d3f299 | |
| parent | d800edebe33cac300ab1ff3b95e8a74d53e842d2 (diff) | |
S5P6440: DMA: Add platform devices for PL330 DMACs
Samsung's Soc S5P6440 has one PL330 DMAC.
Define and add the PL330 DMAC as platform device on the
S5P6440 platform.
Signed-off-by: Jassi Brar <jassi.brar@samsung.com>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
| -rw-r--r-- | arch/arm/mach-s5p6440/Kconfig | 1 | ||||
| -rw-r--r-- | arch/arm/mach-s5p6440/Makefile | 2 | ||||
| -rw-r--r-- | arch/arm/mach-s5p6440/dma.c | 105 | ||||
| -rw-r--r-- | arch/arm/mach-s5p6440/include/mach/dma.h | 26 | ||||
| -rw-r--r-- | arch/arm/mach-s5p6440/include/mach/map.h | 2 |
5 files changed, 135 insertions, 1 deletions
diff --git a/arch/arm/mach-s5p6440/Kconfig b/arch/arm/mach-s5p6440/Kconfig index 4c29ff8b07de..77aeffd17330 100644 --- a/arch/arm/mach-s5p6440/Kconfig +++ b/arch/arm/mach-s5p6440/Kconfig | |||
| @@ -9,6 +9,7 @@ if ARCH_S5P6440 | |||
| 9 | 9 | ||
| 10 | config CPU_S5P6440 | 10 | config CPU_S5P6440 |
| 11 | bool | 11 | bool |
| 12 | select S3C_PL330_DMA | ||
| 12 | help | 13 | help |
| 13 | Enable S5P6440 CPU support | 14 | Enable S5P6440 CPU support |
| 14 | 15 | ||
diff --git a/arch/arm/mach-s5p6440/Makefile b/arch/arm/mach-s5p6440/Makefile index 1ad894b1d3ab..3f243dd1ad14 100644 --- a/arch/arm/mach-s5p6440/Makefile +++ b/arch/arm/mach-s5p6440/Makefile | |||
| @@ -12,7 +12,7 @@ obj- := | |||
| 12 | 12 | ||
| 13 | # Core support for S5P6440 system | 13 | # Core support for S5P6440 system |
| 14 | 14 | ||
| 15 | obj-$(CONFIG_CPU_S5P6440) += cpu.o init.o clock.o gpio.o | 15 | obj-$(CONFIG_CPU_S5P6440) += cpu.o init.o clock.o gpio.o dma.o |
| 16 | 16 | ||
| 17 | # machine support | 17 | # machine support |
| 18 | 18 | ||
diff --git a/arch/arm/mach-s5p6440/dma.c b/arch/arm/mach-s5p6440/dma.c new file mode 100644 index 000000000000..07606ad57519 --- /dev/null +++ b/arch/arm/mach-s5p6440/dma.c | |||
| @@ -0,0 +1,105 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) 2010 Samsung Electronics Co. Ltd. | ||
| 3 | * Jaswinder Singh <jassi.brar@samsung.com> | ||
| 4 | * | ||
| 5 | * This program is free software; you can redistribute it and/or modify | ||
| 6 | * it under the terms of the GNU General Public License as published by | ||
| 7 | * the Free Software Foundation; either version 2 of the License, or | ||
| 8 | * (at your option) any later version. | ||
| 9 | * | ||
| 10 | * This program is distributed in the hope that it will be useful, | ||
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 13 | * GNU General Public License for more details. | ||
| 14 | * | ||
| 15 | * You should have received a copy of the GNU General Public License | ||
| 16 | * along with this program; if not, write to the Free Software | ||
| 17 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
| 18 | */ | ||
| 19 | |||
| 20 | #include <linux/platform_device.h> | ||
| 21 | #include <linux/dma-mapping.h> | ||
| 22 | |||
| 23 | #include <plat/devs.h> | ||
| 24 | #include <plat/irqs.h> | ||
| 25 | |||
| 26 | #include <mach/map.h> | ||
| 27 | #include <mach/irqs.h> | ||
| 28 | |||
| 29 | #include <plat/s3c-pl330-pdata.h> | ||
| 30 | |||
| 31 | static u64 dma_dmamask = DMA_BIT_MASK(32); | ||
| 32 | |||
| 33 | static struct resource s5p6440_pdma_resource[] = { | ||
| 34 | [0] = { | ||
| 35 | .start = S5P6440_PA_PDMA, | ||
| 36 | .end = S5P6440_PA_PDMA + SZ_4K, | ||
| 37 | .flags = IORESOURCE_MEM, | ||
| 38 | }, | ||
| 39 | [1] = { | ||
| 40 | .start = IRQ_DMA0, | ||
| 41 | .end = IRQ_DMA0, | ||
| 42 | .flags = IORESOURCE_IRQ, | ||
| 43 | }, | ||
| 44 | }; | ||
| 45 | |||
| 46 | static struct s3c_pl330_platdata s5p6440_pdma_pdata = { | ||
| 47 | .peri = { | ||
| 48 | [0] = DMACH_UART0_RX, | ||
| 49 | [1] = DMACH_UART0_TX, | ||
| 50 | [2] = DMACH_UART1_RX, | ||
| 51 | [3] = DMACH_UART1_TX, | ||
| 52 | [4] = DMACH_UART2_RX, | ||
| 53 | [5] = DMACH_UART2_TX, | ||
| 54 | [6] = DMACH_UART3_RX, | ||
| 55 | [7] = DMACH_UART3_TX, | ||
| 56 | [8] = DMACH_MAX, | ||
| 57 | [9] = DMACH_MAX, | ||
| 58 | [10] = DMACH_PCM0_TX, | ||
| 59 | [11] = DMACH_PCM0_RX, | ||
| 60 | [12] = DMACH_I2S0_TX, | ||
| 61 | [13] = DMACH_I2S0_RX, | ||
| 62 | [14] = DMACH_SPI0_TX, | ||
| 63 | [15] = DMACH_SPI0_RX, | ||
| 64 | [16] = DMACH_MAX, | ||
| 65 | [17] = DMACH_MAX, | ||
| 66 | [18] = DMACH_MAX, | ||
| 67 | [19] = DMACH_MAX, | ||
| 68 | [20] = DMACH_SPI1_TX, | ||
| 69 | [21] = DMACH_SPI1_RX, | ||
| 70 | [22] = DMACH_MAX, | ||
| 71 | [23] = DMACH_MAX, | ||
| 72 | [24] = DMACH_MAX, | ||
| 73 | [25] = DMACH_MAX, | ||
| 74 | [26] = DMACH_MAX, | ||
| 75 | [27] = DMACH_MAX, | ||
| 76 | [28] = DMACH_MAX, | ||
| 77 | [29] = DMACH_PWM, | ||
| 78 | [30] = DMACH_MAX, | ||
| 79 | [31] = DMACH_MAX, | ||
| 80 | }, | ||
| 81 | }; | ||
| 82 | |||
| 83 | static struct platform_device s5p6440_device_pdma = { | ||
| 84 | .name = "s3c-pl330", | ||
| 85 | .id = 1, | ||
| 86 | .num_resources = ARRAY_SIZE(s5p6440_pdma_resource), | ||
| 87 | .resource = s5p6440_pdma_resource, | ||
| 88 | .dev = { | ||
| 89 | .dma_mask = &dma_dmamask, | ||
| 90 | .coherent_dma_mask = DMA_BIT_MASK(32), | ||
| 91 | .platform_data = &s5p6440_pdma_pdata, | ||
| 92 | }, | ||
| 93 | }; | ||
| 94 | |||
| 95 | static struct platform_device *s5p6440_dmacs[] __initdata = { | ||
| 96 | &s5p6440_device_pdma, | ||
| 97 | }; | ||
| 98 | |||
| 99 | static int __init s5p6440_dma_init(void) | ||
| 100 | { | ||
| 101 | platform_add_devices(s5p6440_dmacs, ARRAY_SIZE(s5p6440_dmacs)); | ||
| 102 | |||
| 103 | return 0; | ||
| 104 | } | ||
| 105 | arch_initcall(s5p6440_dma_init); | ||
diff --git a/arch/arm/mach-s5p6440/include/mach/dma.h b/arch/arm/mach-s5p6440/include/mach/dma.h new file mode 100644 index 000000000000..81209eb1409b --- /dev/null +++ b/arch/arm/mach-s5p6440/include/mach/dma.h | |||
| @@ -0,0 +1,26 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) 2010 Samsung Electronics Co. Ltd. | ||
| 3 | * Jaswinder Singh <jassi.brar@samsung.com> | ||
| 4 | * | ||
| 5 | * This program is free software; you can redistribute it and/or modify | ||
| 6 | * it under the terms of the GNU General Public License as published by | ||
| 7 | * the Free Software Foundation; either version 2 of the License, or | ||
| 8 | * (at your option) any later version. | ||
| 9 | * | ||
| 10 | * This program is distributed in the hope that it will be useful, | ||
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 13 | * GNU General Public License for more details. | ||
| 14 | * | ||
| 15 | * You should have received a copy of the GNU General Public License | ||
| 16 | * along with this program; if not, write to the Free Software | ||
| 17 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
| 18 | */ | ||
| 19 | |||
| 20 | #ifndef __MACH_DMA_H | ||
| 21 | #define __MACH_DMA_H | ||
| 22 | |||
| 23 | /* This platform uses the common S3C DMA API driver for PL330 */ | ||
| 24 | #include <plat/s3c-dma-pl330.h> | ||
| 25 | |||
| 26 | #endif /* __MACH_DMA_H */ | ||
diff --git a/arch/arm/mach-s5p6440/include/mach/map.h b/arch/arm/mach-s5p6440/include/mach/map.h index 8924e5a4d6a6..0275784eb22f 100644 --- a/arch/arm/mach-s5p6440/include/mach/map.h +++ b/arch/arm/mach-s5p6440/include/mach/map.h | |||
| @@ -29,6 +29,8 @@ | |||
| 29 | #define S5P6440_PA_VIC0 (0xE4000000) | 29 | #define S5P6440_PA_VIC0 (0xE4000000) |
| 30 | #define S5P_PA_VIC0 S5P6440_PA_VIC0 | 30 | #define S5P_PA_VIC0 S5P6440_PA_VIC0 |
| 31 | 31 | ||
| 32 | #define S5P6440_PA_PDMA 0xE9000000 | ||
| 33 | |||
| 32 | #define S5P6440_PA_VIC1 (0xE4100000) | 34 | #define S5P6440_PA_VIC1 (0xE4100000) |
| 33 | #define S5P_PA_VIC1 S5P6440_PA_VIC1 | 35 | #define S5P_PA_VIC1 S5P6440_PA_VIC1 |
| 34 | 36 | ||
