diff options
author | Linus Walleij <linus.walleij@stericsson.com> | 2010-05-27 18:21:26 -0400 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2010-05-27 18:21:26 -0400 |
commit | 7b8ddb06e54ad98edeb7951f317aee4d1feda9d6 (patch) | |
tree | c18c268a0bf1b9eaeb5825d3e84bb3617c6c5fdb /arch/arm/mach-ux500/devices-db8500.c | |
parent | b3040e40675ec2c43542331cd30d4ee3dae797e8 (diff) |
DMAENGINE: DMA40 U8500 platform configuration
This completes the DMA40 support with the platform-specific
configuration for U8500/DB8500.
Signed-off-by: Linus Walleij <linus.walleij@stericsson.com>
Acked-by: Srinidhi Kasagar <srinidhi.kasagar@stericsson.com>
Reviewed-by: Alessandro Rubini <rubini@unipv.it>
Cc: STEricsson_nomadik_linux@list.st.com
Acked-by: Russell King <rmk+kernel@arm.linux.org.uk>
[fixed up dma40_{tx|rx}_map declaration/initialization]
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'arch/arm/mach-ux500/devices-db8500.c')
-rw-r--r-- | arch/arm/mach-ux500/devices-db8500.c | 109 |
1 files changed, 109 insertions, 0 deletions
diff --git a/arch/arm/mach-ux500/devices-db8500.c b/arch/arm/mach-ux500/devices-db8500.c index 20334236afce..822903421943 100644 --- a/arch/arm/mach-ux500/devices-db8500.c +++ b/arch/arm/mach-ux500/devices-db8500.c | |||
@@ -12,9 +12,13 @@ | |||
12 | #include <linux/gpio.h> | 12 | #include <linux/gpio.h> |
13 | #include <linux/amba/bus.h> | 13 | #include <linux/amba/bus.h> |
14 | 14 | ||
15 | #include <plat/ste_dma40.h> | ||
16 | |||
15 | #include <mach/hardware.h> | 17 | #include <mach/hardware.h> |
16 | #include <mach/setup.h> | 18 | #include <mach/setup.h> |
17 | 19 | ||
20 | #include "ste-dma40-db8500.h" | ||
21 | |||
18 | static struct nmk_gpio_platform_data u8500_gpio_data[] = { | 22 | static struct nmk_gpio_platform_data u8500_gpio_data[] = { |
19 | GPIO_DATA("GPIO-0-31", 0), | 23 | GPIO_DATA("GPIO-0-31", 0), |
20 | GPIO_DATA("GPIO-32-63", 32), /* 37..63 not routed to pin */ | 24 | GPIO_DATA("GPIO-32-63", 32), /* 37..63 not routed to pin */ |
@@ -105,3 +109,108 @@ struct platform_device u8500_i2c4_device = { | |||
105 | .resource = u8500_i2c4_resources, | 109 | .resource = u8500_i2c4_resources, |
106 | .num_resources = ARRAY_SIZE(u8500_i2c4_resources), | 110 | .num_resources = ARRAY_SIZE(u8500_i2c4_resources), |
107 | }; | 111 | }; |
112 | |||
113 | static struct resource dma40_resources[] = { | ||
114 | [0] = { | ||
115 | .start = U8500_DMA_BASE, | ||
116 | .end = U8500_DMA_BASE + SZ_4K - 1, | ||
117 | .flags = IORESOURCE_MEM, | ||
118 | .name = "base", | ||
119 | }, | ||
120 | [1] = { | ||
121 | .start = U8500_DMA_LCPA_BASE, | ||
122 | .end = U8500_DMA_LCPA_BASE + SZ_4K - 1, | ||
123 | .flags = IORESOURCE_MEM, | ||
124 | .name = "lcpa", | ||
125 | }, | ||
126 | [2] = { | ||
127 | .start = U8500_DMA_LCLA_BASE, | ||
128 | .end = U8500_DMA_LCLA_BASE + 16 * 1024 - 1, | ||
129 | .flags = IORESOURCE_MEM, | ||
130 | .name = "lcla", | ||
131 | }, | ||
132 | [3] = { | ||
133 | .start = IRQ_DMA, | ||
134 | .end = IRQ_DMA, | ||
135 | .flags = IORESOURCE_IRQ} | ||
136 | }; | ||
137 | |||
138 | /* Default configuration for physcial memcpy */ | ||
139 | struct stedma40_chan_cfg dma40_memcpy_conf_phy = { | ||
140 | .channel_type = (STEDMA40_CHANNEL_IN_PHY_MODE | | ||
141 | STEDMA40_LOW_PRIORITY_CHANNEL | | ||
142 | STEDMA40_PCHAN_BASIC_MODE), | ||
143 | .dir = STEDMA40_MEM_TO_MEM, | ||
144 | |||
145 | .src_info.endianess = STEDMA40_LITTLE_ENDIAN, | ||
146 | .src_info.data_width = STEDMA40_BYTE_WIDTH, | ||
147 | .src_info.psize = STEDMA40_PSIZE_PHY_1, | ||
148 | |||
149 | .dst_info.endianess = STEDMA40_LITTLE_ENDIAN, | ||
150 | .dst_info.data_width = STEDMA40_BYTE_WIDTH, | ||
151 | .dst_info.psize = STEDMA40_PSIZE_PHY_1, | ||
152 | |||
153 | }; | ||
154 | /* Default configuration for logical memcpy */ | ||
155 | struct stedma40_chan_cfg dma40_memcpy_conf_log = { | ||
156 | .channel_type = (STEDMA40_CHANNEL_IN_LOG_MODE | | ||
157 | STEDMA40_LOW_PRIORITY_CHANNEL | | ||
158 | STEDMA40_LCHAN_SRC_LOG_DST_LOG | | ||
159 | STEDMA40_NO_TIM_FOR_LINK), | ||
160 | .dir = STEDMA40_MEM_TO_MEM, | ||
161 | |||
162 | .src_info.endianess = STEDMA40_LITTLE_ENDIAN, | ||
163 | .src_info.data_width = STEDMA40_BYTE_WIDTH, | ||
164 | .src_info.psize = STEDMA40_PSIZE_LOG_1, | ||
165 | |||
166 | .dst_info.endianess = STEDMA40_LITTLE_ENDIAN, | ||
167 | .dst_info.data_width = STEDMA40_BYTE_WIDTH, | ||
168 | .dst_info.psize = STEDMA40_PSIZE_LOG_1, | ||
169 | |||
170 | }; | ||
171 | |||
172 | /* | ||
173 | * Mapping between destination event lines and physical device address. | ||
174 | * The event line is tied to a device and therefor the address is constant. | ||
175 | */ | ||
176 | static const dma_addr_t dma40_tx_map[STEDMA40_NR_DEV]; | ||
177 | |||
178 | /* Mapping between source event lines and physical device address */ | ||
179 | static const dma_addr_t dma40_rx_map[STEDMA40_NR_DEV]; | ||
180 | |||
181 | /* Reserved event lines for memcpy only */ | ||
182 | static int dma40_memcpy_event[] = { | ||
183 | STEDMA40_MEMCPY_TX_1, | ||
184 | STEDMA40_MEMCPY_TX_2, | ||
185 | STEDMA40_MEMCPY_TX_3, | ||
186 | STEDMA40_MEMCPY_TX_4, | ||
187 | }; | ||
188 | |||
189 | static struct stedma40_platform_data dma40_plat_data = { | ||
190 | .dev_len = STEDMA40_NR_DEV, | ||
191 | .dev_rx = dma40_rx_map, | ||
192 | .dev_tx = dma40_tx_map, | ||
193 | .memcpy = dma40_memcpy_event, | ||
194 | .memcpy_len = ARRAY_SIZE(dma40_memcpy_event), | ||
195 | .memcpy_conf_phy = &dma40_memcpy_conf_phy, | ||
196 | .memcpy_conf_log = &dma40_memcpy_conf_log, | ||
197 | .llis_per_log = 8, | ||
198 | }; | ||
199 | |||
200 | struct platform_device u8500_dma40_device = { | ||
201 | .dev = { | ||
202 | .platform_data = &dma40_plat_data, | ||
203 | }, | ||
204 | .name = "dma40", | ||
205 | .id = 0, | ||
206 | .num_resources = ARRAY_SIZE(dma40_resources), | ||
207 | .resource = dma40_resources | ||
208 | }; | ||
209 | |||
210 | void dma40_u8500ed_fixup(void) | ||
211 | { | ||
212 | dma40_plat_data.memcpy = NULL; | ||
213 | dma40_plat_data.memcpy_len = 0; | ||
214 | dma40_resources[0].start = U8500_DMA_BASE_ED; | ||
215 | dma40_resources[0].end = U8500_DMA_BASE_ED + SZ_4K - 1; | ||
216 | } | ||