OMAPL138如何在Linux下使用EDMA3驱动 - OMAP-L138 - 嵌入式开发者社区 - 51ele.net
设为首页收藏本站
点击跳转“创龙科技服务通”

嵌入式开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

查看: 12724|回复: 0
打印 上一主题 下一主题

[未解决] OMAPL138如何在Linux下使用EDMA3驱动

[复制链接]

5

主题

11

帖子

73

积分

注册会员

Rank: 2

积分
73
跳转到指定楼层
楼主
发表于 2018-1-30 11:01:43 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
本帖最后由 yyj 于 2018-1-30 11:01 编辑 1 [! ~# N" Y) U/ j
  1. [code]EDMA sample test application# X, m; E( i0 V. b4 a2 i
  2. /*1 ~; |: U' e1 G
  3. * edma_test.c* {7 N+ X1 k, j  S; p, S6 X! T- w6 @
  4. *# n" A. E% p& p* [# T: o
  5. * brief  EDMA3 Test Application
    " B: o4 M! r: U
  6. *  B- {# y6 j! t2 E$ x: C5 O$ k
  7. *   This file contains EDMA3 Test code.
    7 y0 M. g0 f6 x
  8. *( `7 x0 t1 x2 r: Z7 R2 B
  9. *   NOTE: THIS FILE IS PROVIDED ONLY FOR INITIAL DEMO RELEASE AND MAY BE
    ; p' R8 @9 {' Y# L
  10. *         REMOVED AFTER THE DEMO OR THE CONTENTS OF THIS FILE ARE SUBJECT; T% ~0 h( }$ H
  11. *         TO CHANGE., e# |+ q! Z2 F# }$ L: v
  12. *
    ; W! R5 E0 d6 F+ h9 p! |' D
  13. * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
    2 b1 T8 j* G: X$ R
  14. *
    & x5 @3 M. U. j
  15. * This program is free software; you can redistribute it and/or3 e% l9 P5 m/ _5 ]5 E6 @. y- @
  16. * modify it under the terms of the GNU General Public License as( h7 {2 o8 i: ^
  17. * published by the Free Software Foundation version 2.
    , l3 C1 E% ~' }9 q9 Y0 D' ]
  18. *
    0 `3 M+ t; k! T: Z* W
  19. * This program is distributed "as is" WITHOUT ANY WARRANTY of any
    $ Z# `6 H- p  n4 ]; I$ u2 v8 w
  20. * kind, whether express or implied; without even the implied warranty3 y- f( S9 L0 A) ~, N" U- T
  21. * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the6 F4 M( ]1 u4 e/ K, O
  22. * GNU General Public License for more details.
    9 @+ ?6 {- y$ H! @% y; |5 o: y
  23. */  F" L! p6 X  g) c4 p
  24. 6 T: n0 M. A7 e7 o: E0 U
  25. #include <linux/module.h>5 f6 x$ p( t0 h% ~
  26. #include <linux/init.h>
    3 f$ Y1 e7 I9 c, A8 @$ J
  27. #include <linux/errno.h>( F  h, U1 W7 i( }
  28. #include <linux/types.h>
    + {& L+ B4 C' h$ d- R
  29. #include <linux/interrupt.h>/ p( e2 ]2 d! K+ g3 T2 ?
  30. #include <asm/io.h>
    & a# Q9 e2 P+ G+ F$ _9 r
  31. #include <linux/moduleparam.h>
    $ o, q* X! K: P: t( W& x
  32. #include <linux/sysctl.h>
      v, x* y2 P0 Y, U; I3 G" H+ Y3 O
  33. #include <linux/mm.h>
      X0 F6 f: L; S
  34. #include <linux/dma-mapping.h>, u5 \- f& k5 R6 z
  35. 1 j. ?, M! E: [: O" b) ~; O
  36. #include <mach/memory.h>
    2 Q$ H6 c5 D* ^9 b, r$ ?
  37. #include <mach/hardware.h>; H- ]' I! _. F" f3 V5 G5 L, G
  38. #include <mach/irqs.h>: m  ~, N7 p0 s- W
  39. #include <asm/hardware/edma.h>% }9 Q7 K! b8 x7 P. D
  40. $ F: ]2 Z' i" C' `6 y5 d) b
  41. #undef EDMA3_DEBUG
    ; i0 `; H. t4 m' p- H# l! \- M
  42. /*#define EDMA3_DEBUG*/
    3 j; l  q. Q/ R  n7 o* O
  43. " `7 ]. r3 J+ _7 A+ ?* @! [
  44. #ifdef EDMA3_DEBUG
    7 h4 L& b: H5 [1 O; b9 q) N6 D
  45. #define DMA_PRINTK(ARGS...)  printk(KERN_INFO "<%s>: ",__FUNCTION__);printk(ARGS)# s+ [2 U7 T+ w- A
  46. #define DMA_FN_IN printk(KERN_INFO "[%s]: start\n", __FUNCTION__); [/ f0 t& [% C1 f' O
  47. #define DMA_FN_OUT printk(KERN_INFO "[%s]: end\n",__FUNCTION__): R/ r; C" v0 M2 K6 i6 _' t! u; Q% i
  48. #else
    $ ]% x9 }. P2 `" D3 R
  49. #define DMA_PRINTK( x... )% H* B* U+ e8 S: L
  50. #define DMA_FN_IN
    $ Q- d% m- s9 y2 @, W5 ~$ |
  51. #define DMA_FN_OUT8 A. d: A; P( m' F7 U8 \8 I
  52. #endif/ Z+ c& w% B6 x4 m
  53. 1 E$ D0 ?9 w* [( D
  54. #define MAX_DMA_TRANSFER_IN_BYTES   (32768)4 N! i! {" E9 C- \- a
  55. #define STATIC_SHIFT                3, W3 C5 n, G2 O1 v4 ~: W) D/ i
  56. #define TCINTEN_SHIFT               20
    4 m, o2 m+ n7 \
  57. #define ITCINTEN_SHIFT              217 W- s) x' y) ]7 U- l8 t
  58. #define TCCHEN_SHIFT                22
    0 N5 [( X1 U$ R/ J/ i! S
  59. #define ITCCHEN_SHIFT               23" l+ T& q8 @6 l& ^
  60. " o/ z0 g7 ~* I( g7 r( G! L
  61. static volatile int irqraised1 = 0;" }$ E( k' m- x) C0 I- [
  62. static volatile int irqraised2 = 0;
    # x: J$ h, R" k, \/ `
  63. 5 G- i# ~- f# O3 ?# z: e* @, m3 N
  64. int edma3_memtomemcpytest_dma(int acnt, int bcnt, int ccnt, int sync_mode, int event_queue);
    ; r. d" F* I. e5 L" H2 ?
  65. int edma3_memtomemcpytest_dma_link(int acnt, int bcnt, int ccnt, int sync_mode, int event_queue);
    $ K5 L1 E, g/ T
  66. int edma3_memtomemcpytest_dma_chain(int acnt, int bcnt, int ccnt, int sync_mode, int event_queue);0 |8 Z& N' X) L' B

  67. ( g. C! e# X, G+ v9 a6 i
  68. dma_addr_t dmaphyssrc1 = 0;
    + @% y7 p3 Y! y9 x8 I; K/ M7 ]
  69. dma_addr_t dmaphyssrc2 = 0;( ]2 g% J& x* @, N/ N1 C# m
  70. dma_addr_t dmaphysdest1 = 0;6 i1 }4 ~! d$ T
  71. dma_addr_t dmaphysdest2 = 0;3 T8 e8 Z! K+ C9 z) y6 Z7 I
  72. - E- j2 |3 a4 [9 F& G9 h: n
  73. char *dmabufsrc1 = NULL;
    * ?  v7 u7 T" j3 S' ]2 m
  74. char *dmabufsrc2 = NULL;
    + ^/ J) K+ Y: S; z! X
  75. char *dmabufdest1 = NULL;
    4 H' E- x: p5 b/ F3 [# Z0 Z
  76. char *dmabufdest2 = NULL;
    5 K8 {; i( t+ q9 W* G
  77. 7 r& o0 K% p4 E* W
  78. static int acnt = 512;1 K* x' I/ a. O* n7 Z  V$ L
  79. static int bcnt = 8;2 j% n$ w/ e& S
  80. static int ccnt = 8;
    ; A* `' X6 F* a/ D8 r" D8 l
  81. : Y8 I5 m$ h, ?
  82. module_param(acnt, int, S_IRUGO);4 O: X: a6 t9 w0 D, o
  83. module_param(bcnt, int, S_IRUGO);  V" q6 P  F4 f( w
  84. module_param(ccnt, int, S_IRUGO);
复制代码

: P" I7 s7 \. I7 |; Q4 c- z" E0 K& }5 c8 t
      这是在TI上找到的一个针对Davanci处理器简单的EDMA3驱动程序测试例程的一部分,我在编译的过程中是用
: ~8 x- f. p9 ~9 q1 U' K+ warm-none-linux-gnueabi-gcc  -I /home/tl/omapl138/linux-3.3/arch/arm/include -I /home/tl/omapl138/linux-3.3/include  EDMA3test.cpp -o EDMA3这个命令来链接库文件进行编译,但是报的错误特别多,我又试着一个函数一个函数往进加,仍然是很多错误。
( v. O# F& u$ z& ^: L     我想问一下如何用一个简单的程序来测试一下EDMA3的驱动。& S% B* X/ M+ v) x% C
0 j3 A* D+ _. o
( X- A+ V; v: X4 r7 C0 r
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 分享淘帖
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

点击跳转“创龙科技服务通”

QQ|手机版|小黑屋|嵌入式开发者社区 ( 粤ICP备15055271号

GMT+8, 2026-3-18 23:32 , Processed in 0.038511 second(s), 26 queries .

Powered by Discuz! X3.2

© 2001-2015 Comsenz Inc.

快速回复 返回顶部 返回列表