dma.c (9f30a04d768f64280dc0c40b730746e82f298d88) dma.c (731ec4d881935db567f13bb88903ab8416967548)
1/*
2 * OMAP2+ DMA driver
3 *
4 * Copyright (C) 2003 - 2008 Nokia Corporation
5 * Author: Juha Yrjölä <juha.yrjola@nokia.com>
6 * DMA channel linking for 1610 by Samuel Ortiz <samuel.ortiz@nokia.com>
7 * Graphics DMA and LCD DMA graphics tranformations
8 * by Imre Deak <imre.deak@nokia.com>

--- 14 unchanged lines hidden (view full) ---

23
24#include <linux/err.h>
25#include <linux/io.h>
26#include <linux/slab.h>
27#include <linux/module.h>
28#include <linux/init.h>
29#include <linux/device.h>
30#include <linux/dma-mapping.h>
1/*
2 * OMAP2+ DMA driver
3 *
4 * Copyright (C) 2003 - 2008 Nokia Corporation
5 * Author: Juha Yrjölä <juha.yrjola@nokia.com>
6 * DMA channel linking for 1610 by Samuel Ortiz <samuel.ortiz@nokia.com>
7 * Graphics DMA and LCD DMA graphics tranformations
8 * by Imre Deak <imre.deak@nokia.com>

--- 14 unchanged lines hidden (view full) ---

23
24#include <linux/err.h>
25#include <linux/io.h>
26#include <linux/slab.h>
27#include <linux/module.h>
28#include <linux/init.h>
29#include <linux/device.h>
30#include <linux/dma-mapping.h>
31#include <linux/dmaengine.h>
31#include <linux/of.h>
32#include <linux/omap-dma.h>
33
34#include "soc.h"
35#include "omap_hwmod.h"
36#include "omap_device.h"
37
38static enum omap_reg_offsets dma_common_ch_end;

--- 159 unchanged lines hidden (view full) ---

198 * spurious interrupts. This affects only secure devices.
199 */
200 if (cpu_is_omap34xx() && (omap_type() != OMAP2_DEVICE_TYPE_GP))
201 SET_DMA_ERRATA(DMA_ROMCODE_BUG);
202
203 return errata;
204}
205
32#include <linux/of.h>
33#include <linux/omap-dma.h>
34
35#include "soc.h"
36#include "omap_hwmod.h"
37#include "omap_device.h"
38
39static enum omap_reg_offsets dma_common_ch_end;

--- 159 unchanged lines hidden (view full) ---

199 * spurious interrupts. This affects only secure devices.
200 */
201 if (cpu_is_omap34xx() && (omap_type() != OMAP2_DEVICE_TYPE_GP))
202 SET_DMA_ERRATA(DMA_ROMCODE_BUG);
203
204 return errata;
205}
206
207static const struct dma_slave_map omap24xx_sdma_map[] = {
208 { "omap-gpmc", "rxtx", SDMA_FILTER_PARAM(4) },
209 { "omap-aes", "tx", SDMA_FILTER_PARAM(9) },
210 { "omap-aes", "rx", SDMA_FILTER_PARAM(10) },
211 { "omap-sham", "rx", SDMA_FILTER_PARAM(13) },
212 { "omap2_mcspi.2", "tx0", SDMA_FILTER_PARAM(15) },
213 { "omap2_mcspi.2", "rx0", SDMA_FILTER_PARAM(16) },
214 { "omap-mcbsp.3", "tx", SDMA_FILTER_PARAM(17) },
215 { "omap-mcbsp.3", "rx", SDMA_FILTER_PARAM(18) },
216 { "omap-mcbsp.4", "tx", SDMA_FILTER_PARAM(19) },
217 { "omap-mcbsp.4", "rx", SDMA_FILTER_PARAM(20) },
218 { "omap-mcbsp.5", "tx", SDMA_FILTER_PARAM(21) },
219 { "omap-mcbsp.5", "rx", SDMA_FILTER_PARAM(22) },
220 { "omap2_mcspi.2", "tx1", SDMA_FILTER_PARAM(23) },
221 { "omap2_mcspi.2", "rx1", SDMA_FILTER_PARAM(24) },
222 { "omap_i2c.1", "tx", SDMA_FILTER_PARAM(27) },
223 { "omap_i2c.1", "rx", SDMA_FILTER_PARAM(28) },
224 { "omap_i2c.2", "tx", SDMA_FILTER_PARAM(29) },
225 { "omap_i2c.2", "rx", SDMA_FILTER_PARAM(30) },
226 { "omap-mcbsp.1", "tx", SDMA_FILTER_PARAM(31) },
227 { "omap-mcbsp.1", "rx", SDMA_FILTER_PARAM(32) },
228 { "omap-mcbsp.2", "tx", SDMA_FILTER_PARAM(33) },
229 { "omap-mcbsp.2", "rx", SDMA_FILTER_PARAM(34) },
230 { "omap2_mcspi.0", "tx0", SDMA_FILTER_PARAM(35) },
231 { "omap2_mcspi.0", "rx0", SDMA_FILTER_PARAM(36) },
232 { "omap2_mcspi.0", "tx1", SDMA_FILTER_PARAM(37) },
233 { "omap2_mcspi.0", "rx1", SDMA_FILTER_PARAM(38) },
234 { "omap2_mcspi.0", "tx2", SDMA_FILTER_PARAM(39) },
235 { "omap2_mcspi.0", "rx2", SDMA_FILTER_PARAM(40) },
236 { "omap2_mcspi.0", "tx3", SDMA_FILTER_PARAM(41) },
237 { "omap2_mcspi.0", "rx3", SDMA_FILTER_PARAM(42) },
238 { "omap2_mcspi.1", "tx0", SDMA_FILTER_PARAM(43) },
239 { "omap2_mcspi.1", "rx0", SDMA_FILTER_PARAM(44) },
240 { "omap2_mcspi.1", "tx1", SDMA_FILTER_PARAM(45) },
241 { "omap2_mcspi.1", "rx1", SDMA_FILTER_PARAM(46) },
242 { "omap_hsmmc.1", "tx", SDMA_FILTER_PARAM(47) },
243 { "omap_hsmmc.1", "rx", SDMA_FILTER_PARAM(48) },
244 { "omap_uart.0", "tx", SDMA_FILTER_PARAM(49) },
245 { "omap_uart.0", "rx", SDMA_FILTER_PARAM(50) },
246 { "omap_uart.1", "tx", SDMA_FILTER_PARAM(51) },
247 { "omap_uart.1", "rx", SDMA_FILTER_PARAM(52) },
248 { "omap_uart.2", "tx", SDMA_FILTER_PARAM(53) },
249 { "omap_uart.2", "rx", SDMA_FILTER_PARAM(54) },
250 { "omap_hsmmc.0", "tx", SDMA_FILTER_PARAM(61) },
251 { "omap_hsmmc.0", "rx", SDMA_FILTER_PARAM(62) },
252};
253
254static const struct dma_slave_map omap3xxx_sdma_map[] = {
255 { "omap-gpmc", "rxtx", SDMA_FILTER_PARAM(4) },
256 { "omap2_mcspi.2", "tx0", SDMA_FILTER_PARAM(15) },
257 { "omap2_mcspi.2", "rx0", SDMA_FILTER_PARAM(16) },
258 { "omap-mcbsp.3", "tx", SDMA_FILTER_PARAM(17) },
259 { "omap-mcbsp.3", "rx", SDMA_FILTER_PARAM(18) },
260 { "omap-mcbsp.4", "tx", SDMA_FILTER_PARAM(19) },
261 { "omap-mcbsp.4", "rx", SDMA_FILTER_PARAM(20) },
262 { "omap-mcbsp.5", "tx", SDMA_FILTER_PARAM(21) },
263 { "omap-mcbsp.5", "rx", SDMA_FILTER_PARAM(22) },
264 { "omap2_mcspi.2", "tx1", SDMA_FILTER_PARAM(23) },
265 { "omap2_mcspi.2", "rx1", SDMA_FILTER_PARAM(24) },
266 { "omap_i2c.3", "tx", SDMA_FILTER_PARAM(25) },
267 { "omap_i2c.3", "rx", SDMA_FILTER_PARAM(26) },
268 { "omap_i2c.1", "tx", SDMA_FILTER_PARAM(27) },
269 { "omap_i2c.1", "rx", SDMA_FILTER_PARAM(28) },
270 { "omap_i2c.2", "tx", SDMA_FILTER_PARAM(29) },
271 { "omap_i2c.2", "rx", SDMA_FILTER_PARAM(30) },
272 { "omap-mcbsp.1", "tx", SDMA_FILTER_PARAM(31) },
273 { "omap-mcbsp.1", "rx", SDMA_FILTER_PARAM(32) },
274 { "omap-mcbsp.2", "tx", SDMA_FILTER_PARAM(33) },
275 { "omap-mcbsp.2", "rx", SDMA_FILTER_PARAM(34) },
276 { "omap2_mcspi.0", "tx0", SDMA_FILTER_PARAM(35) },
277 { "omap2_mcspi.0", "rx0", SDMA_FILTER_PARAM(36) },
278 { "omap2_mcspi.0", "tx1", SDMA_FILTER_PARAM(37) },
279 { "omap2_mcspi.0", "rx1", SDMA_FILTER_PARAM(38) },
280 { "omap2_mcspi.0", "tx2", SDMA_FILTER_PARAM(39) },
281 { "omap2_mcspi.0", "rx2", SDMA_FILTER_PARAM(40) },
282 { "omap2_mcspi.0", "tx3", SDMA_FILTER_PARAM(41) },
283 { "omap2_mcspi.0", "rx3", SDMA_FILTER_PARAM(42) },
284 { "omap2_mcspi.1", "tx0", SDMA_FILTER_PARAM(43) },
285 { "omap2_mcspi.1", "rx0", SDMA_FILTER_PARAM(44) },
286 { "omap2_mcspi.1", "tx1", SDMA_FILTER_PARAM(45) },
287 { "omap2_mcspi.1", "rx1", SDMA_FILTER_PARAM(46) },
288 { "omap_hsmmc.1", "tx", SDMA_FILTER_PARAM(47) },
289 { "omap_hsmmc.1", "rx", SDMA_FILTER_PARAM(48) },
290 { "omap_uart.0", "tx", SDMA_FILTER_PARAM(49) },
291 { "omap_uart.0", "rx", SDMA_FILTER_PARAM(50) },
292 { "omap_uart.1", "tx", SDMA_FILTER_PARAM(51) },
293 { "omap_uart.1", "rx", SDMA_FILTER_PARAM(52) },
294 { "omap_uart.2", "tx", SDMA_FILTER_PARAM(53) },
295 { "omap_uart.2", "rx", SDMA_FILTER_PARAM(54) },
296 { "omap_hsmmc.0", "tx", SDMA_FILTER_PARAM(61) },
297 { "omap_hsmmc.0", "rx", SDMA_FILTER_PARAM(62) },
298 { "omap-aes", "tx", SDMA_FILTER_PARAM(65) },
299 { "omap-aes", "rx", SDMA_FILTER_PARAM(66) },
300 { "omap-sham", "rx", SDMA_FILTER_PARAM(69) },
301 { "omap2_mcspi.3", "tx0", SDMA_FILTER_PARAM(70) },
302 { "omap2_mcspi.3", "rx0", SDMA_FILTER_PARAM(71) },
303 { "omap_hsmmc.2", "tx", SDMA_FILTER_PARAM(77) },
304 { "omap_hsmmc.2", "rx", SDMA_FILTER_PARAM(78) },
305 { "omap_uart.3", "tx", SDMA_FILTER_PARAM(81) },
306 { "omap_uart.3", "rx", SDMA_FILTER_PARAM(82) },
307};
308
206static struct omap_system_dma_plat_info dma_plat_info __initdata = {
207 .reg_map = reg_map,
208 .channel_stride = 0x60,
209 .show_dma_caps = omap2_show_dma_caps,
210 .clear_dma = omap2_clear_dma,
211 .dma_write = dma_write,
212 .dma_read = dma_read,
213};

--- 12 unchanged lines hidden (view full) ---

226 struct omap_dma_dev_attr *d;
227 struct resource *mem;
228 char *name = "omap_dma_system";
229
230 p = dma_plat_info;
231 p.dma_attr = (struct omap_dma_dev_attr *)oh->dev_attr;
232 p.errata = configure_dma_errata();
233
309static struct omap_system_dma_plat_info dma_plat_info __initdata = {
310 .reg_map = reg_map,
311 .channel_stride = 0x60,
312 .show_dma_caps = omap2_show_dma_caps,
313 .clear_dma = omap2_clear_dma,
314 .dma_write = dma_write,
315 .dma_read = dma_read,
316};

--- 12 unchanged lines hidden (view full) ---

329 struct omap_dma_dev_attr *d;
330 struct resource *mem;
331 char *name = "omap_dma_system";
332
333 p = dma_plat_info;
334 p.dma_attr = (struct omap_dma_dev_attr *)oh->dev_attr;
335 p.errata = configure_dma_errata();
336
337 if (!of_have_populated_dt()) {
338 if (soc_is_omap24xx()) {
339 p.slave_map = omap24xx_sdma_map;
340 p.slavecnt = ARRAY_SIZE(omap24xx_sdma_map);
341 } else if (soc_is_omap34xx() || soc_is_omap3630()) {
342 p.slave_map = omap3xxx_sdma_map;
343 p.slavecnt = ARRAY_SIZE(omap3xxx_sdma_map);
344 } else {
345 pr_err("%s: The legacy DMA map is not provided!\n",
346 __func__);
347 return -ENODEV;
348 }
349 }
350
234 pdev = omap_device_build(name, 0, oh, &p, sizeof(p));
235 if (IS_ERR(pdev)) {
236 pr_err("%s: Can't build omap_device for %s:%s.\n",
237 __func__, name, oh->name);
238 return PTR_ERR(pdev);
239 }
240
241 omap_dma_dev_info.res = pdev->resource;

--- 51 unchanged lines hidden ---
351 pdev = omap_device_build(name, 0, oh, &p, sizeof(p));
352 if (IS_ERR(pdev)) {
353 pr_err("%s: Can't build omap_device for %s:%s.\n",
354 __func__, name, oh->name);
355 return PTR_ERR(pdev);
356 }
357
358 omap_dma_dev_info.res = pdev->resource;

--- 51 unchanged lines hidden ---