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

嵌入式开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

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

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

[复制链接]

5

主题

11

帖子

73

积分

注册会员

Rank: 2

积分
73
跳转到指定楼层
楼主
发表于 2018-1-30 11:01:43 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
本帖最后由 yyj 于 2018-1-30 11:01 编辑
0 c# Z0 h3 s4 N* J& Y) |: R
  1. [code]EDMA sample test application3 U" ^8 _6 b/ \/ W8 i, |' Y
  2. /*# a8 u& K* E+ `
  3. * edma_test.c$ H3 S8 q9 [  _5 f
  4. *
    $ a- J1 k2 m) K; O
  5. * brief  EDMA3 Test Application# N9 e. H) |  C3 h6 C6 B3 Y. F
  6. *
    , t- e3 C" G3 O; T! c
  7. *   This file contains EDMA3 Test code.
    + X, B; i* q8 ~7 p1 C& O# H, J; `
  8. ** Y5 R0 \. |: W1 h2 U% E+ X$ T/ ?  _
  9. *   NOTE: THIS FILE IS PROVIDED ONLY FOR INITIAL DEMO RELEASE AND MAY BE
    8 d9 M8 Z: k% p% s' ]. V: q1 Z
  10. *         REMOVED AFTER THE DEMO OR THE CONTENTS OF THIS FILE ARE SUBJECT
    % [0 a2 b- [: j; m3 i' K$ c
  11. *         TO CHANGE.
    8 m: V% y7 E: v" J% e
  12. *2 i- P/ v8 n  L# Q8 ]1 ^
  13. * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/  X- h4 T6 P0 v$ G. |$ |
  14. *
      V& ]) d/ X" I5 l
  15. * This program is free software; you can redistribute it and/or' u5 S- f; V( Q$ e4 A
  16. * modify it under the terms of the GNU General Public License as+ ~5 z) F/ A6 t' I, a
  17. * published by the Free Software Foundation version 2.
    7 |+ ]4 B1 e3 h; \
  18. *' M, w' f- T4 j2 z
  19. * This program is distributed "as is" WITHOUT ANY WARRANTY of any
    ) X- v( H$ X; Q" l
  20. * kind, whether express or implied; without even the implied warranty
    7 v% l% ?$ h, b3 G( _; l1 u
  21. * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    6 ~9 n+ {' {& h3 n% j
  22. * GNU General Public License for more details.
    ) f: n+ J1 {9 H8 a$ @' u  P1 ^$ h; q
  23. */0 A- ^0 u# P& K; D0 ~  y3 c

  24. - L, Z; q6 l+ k5 i9 V* G( c
  25. #include <linux/module.h>( E2 _; U7 U/ R$ F0 R- V; y2 a
  26. #include <linux/init.h>' A3 }4 a5 z/ l( C, i" O/ U4 [
  27. #include <linux/errno.h>' a0 n" T1 e! F' c2 x: w+ Z
  28. #include <linux/types.h>6 f( @: z5 g0 h! b& t7 c
  29. #include <linux/interrupt.h>
    1 a; w: D; t7 L7 ]# r7 s
  30. #include <asm/io.h>
    6 M  S9 g9 Y8 {7 w: E) n
  31. #include <linux/moduleparam.h>
    7 @0 ^. t( l. s" p0 }$ T0 x* v) M  h
  32. #include <linux/sysctl.h>1 |% h( z: m8 V5 S# s0 |9 h
  33. #include <linux/mm.h>6 Y" U; @% T, d5 _$ Q3 h' B' N
  34. #include <linux/dma-mapping.h>
    / [) Y  @; [6 Z6 c

  35. 3 t, K: K6 c8 P# U3 D3 i0 A' @
  36. #include <mach/memory.h># }# T5 a+ @9 c1 `- O3 z- ]: `6 V
  37. #include <mach/hardware.h>
    0 k) a! X$ y! M0 c
  38. #include <mach/irqs.h>7 X$ b* y' O1 u+ G' o: A: G
  39. #include <asm/hardware/edma.h>
    $ p0 X9 ]+ S! E/ {  @* i
  40. 5 o# J% W, i  t
  41. #undef EDMA3_DEBUG
    $ ~4 |2 E, n7 G( _' d6 O8 |( |/ p
  42. /*#define EDMA3_DEBUG*/
    5 G$ X% r% Z. t4 h2 Z8 ~
  43. - ^* L6 d: ?8 {9 d4 k2 S+ Q
  44. #ifdef EDMA3_DEBUG$ |' L6 k0 [0 C5 R& o- Z% M* {
  45. #define DMA_PRINTK(ARGS...)  printk(KERN_INFO "<%s>: ",__FUNCTION__);printk(ARGS)4 Q# ^  q2 a$ V+ Q. \
  46. #define DMA_FN_IN printk(KERN_INFO "[%s]: start\n", __FUNCTION__): l* N, c9 y$ _1 g
  47. #define DMA_FN_OUT printk(KERN_INFO "[%s]: end\n",__FUNCTION__)+ }% H3 v: ]' S6 Z5 {
  48. #else7 \% }  P! V# r- O
  49. #define DMA_PRINTK( x... )) A: d/ _% m8 x, [8 ^- ~
  50. #define DMA_FN_IN
    ' k0 K" Z- {3 U9 }  ?6 @- x3 H2 N% h* Y
  51. #define DMA_FN_OUT
    : `: w7 }( n" D6 S! d3 x
  52. #endif
    3 k, x1 t0 f1 Q+ ^  B$ a  ?
  53. 7 Q; E- S- ~0 I) I! }
  54. #define MAX_DMA_TRANSFER_IN_BYTES   (32768)
    # ~3 A$ b! U" C8 m0 l5 ?
  55. #define STATIC_SHIFT                3
    7 F" R2 a0 T' E
  56. #define TCINTEN_SHIFT               20
    9 ~) K. c  C" g* A+ D* c
  57. #define ITCINTEN_SHIFT              21
    * f' A7 ]! y9 }" v. P/ D
  58. #define TCCHEN_SHIFT                22
    4 A% w' U+ e! o2 r$ p
  59. #define ITCCHEN_SHIFT               23
    - t/ i; \( L* O
  60. , L1 a5 q5 ?& w/ B
  61. static volatile int irqraised1 = 0;3 i8 {% C4 q5 B
  62. static volatile int irqraised2 = 0;
    6 m! c+ `5 G* c$ c3 h; Y  @
  63. " B7 {2 t, w2 S! L/ T# w
  64. int edma3_memtomemcpytest_dma(int acnt, int bcnt, int ccnt, int sync_mode, int event_queue);
    1 P1 @% J& }* M8 p- g9 h
  65. int edma3_memtomemcpytest_dma_link(int acnt, int bcnt, int ccnt, int sync_mode, int event_queue);; V7 U4 e: @+ _0 m/ m5 i, ^. d6 a# H+ O
  66. int edma3_memtomemcpytest_dma_chain(int acnt, int bcnt, int ccnt, int sync_mode, int event_queue);
    / f+ D2 W3 g6 I2 C- X

  67.   A3 W5 }+ I( G0 a
  68. dma_addr_t dmaphyssrc1 = 0;/ Z& r+ N, T5 |/ L' c) q7 q/ F5 X
  69. dma_addr_t dmaphyssrc2 = 0;" N2 {8 n; {) a: E, j
  70. dma_addr_t dmaphysdest1 = 0;' O2 t7 }& s, F
  71. dma_addr_t dmaphysdest2 = 0;
    / q# N+ `  H* r9 @+ k9 V
  72.   u+ i& m2 c( q) ~4 |5 i7 \" S9 O
  73. char *dmabufsrc1 = NULL;
    - c$ ?# c; c% b, @: R
  74. char *dmabufsrc2 = NULL;+ \1 b, q7 o& X* B( M
  75. char *dmabufdest1 = NULL;# [+ S1 r5 z; C$ {+ o
  76. char *dmabufdest2 = NULL;
    3 D8 Z0 R% l: h# W; n
  77. / a4 u5 e/ q8 ]) v: q
  78. static int acnt = 512;
    2 ~$ v  ^' X4 m; U
  79. static int bcnt = 8;% ?/ A% }6 X. J
  80. static int ccnt = 8;
    . p0 Z. V5 K$ h. l7 M# x

  81. - l- g6 @% C) E7 a
  82. module_param(acnt, int, S_IRUGO);
    / ?" |. q, k; P' o
  83. module_param(bcnt, int, S_IRUGO);9 {/ H2 x& R3 o2 R) F4 B' d5 h
  84. module_param(ccnt, int, S_IRUGO);
复制代码

& Z( \8 j8 d, G0 ]5 ?; I# I* E
0 p) s; I# J5 \$ x" K% i7 O      这是在TI上找到的一个针对Davanci处理器简单的EDMA3驱动程序测试例程的一部分,我在编译的过程中是用
/ c( O0 ?% F( O1 Uarm-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这个命令来链接库文件进行编译,但是报的错误特别多,我又试着一个函数一个函数往进加,仍然是很多错误。
# U# k2 F0 p' \7 b4 ]8 U. Y     我想问一下如何用一个简单的程序来测试一下EDMA3的驱动。4 q; F  I, z  J- B5 c

; M- P& N% |" ?2 ~) [( N& N1 d4 x9 e; |/ `
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 分享淘帖
回复

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2026-3-1 13:41 , Processed in 0.042063 second(s), 25 queries .

Powered by Discuz! X3.2

© 2001-2015 Comsenz Inc.

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