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

嵌入式开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

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

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

[复制链接]

5

主题

11

帖子

73

积分

注册会员

Rank: 2

积分
73
跳转到指定楼层
楼主
发表于 2018-1-30 11:01:43 | 只看该作者 回帖奖励 |正序浏览 |阅读模式
本帖最后由 yyj 于 2018-1-30 11:01 编辑
3 N$ ^! n& a( r% j; U
  1. [code]EDMA sample test application, Z, O* J9 }+ f& {
  2. /*
    / w7 G1 X8 L& J% e$ a8 `% o% f
  3. * edma_test.c% C0 k6 T" p0 u7 G6 W1 l$ K
  4. *9 @0 q& T0 @' Y4 t# x0 N" ~
  5. * brief  EDMA3 Test Application' ?2 V+ W; w$ `
  6. *
    ( b, y9 `/ ~8 K% e1 x7 e4 O) u4 P
  7. *   This file contains EDMA3 Test code.5 b% H% }* a$ m
  8. *
    * |4 B# ?  A: {& O
  9. *   NOTE: THIS FILE IS PROVIDED ONLY FOR INITIAL DEMO RELEASE AND MAY BE
    . W. u5 l8 p8 f
  10. *         REMOVED AFTER THE DEMO OR THE CONTENTS OF THIS FILE ARE SUBJECT& i* M+ D; V& ]% W3 s
  11. *         TO CHANGE.
    2 n, a  P5 ]! k' P. J( A0 H8 \" [
  12. *; c* `$ D1 |3 m. [- {" }
  13. * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
    : I8 ]9 m' k0 Z; q& N* z9 [
  14. *
    6 b) q& n# P& P' W+ q9 E$ V! G3 Z
  15. * This program is free software; you can redistribute it and/or
    - e3 H! N% J2 n. Y$ p! b
  16. * modify it under the terms of the GNU General Public License as% S# j; ~1 Y2 |: Y. n" Z
  17. * published by the Free Software Foundation version 2.2 }: L7 r2 D& w. q5 L8 u& z
  18. *
    4 o7 B8 f/ K* z8 w. k1 M
  19. * This program is distributed "as is" WITHOUT ANY WARRANTY of any
    1 x( Z; |% ]/ H- Z5 j2 y0 U. a
  20. * kind, whether express or implied; without even the implied warranty
    / S7 k. f2 V/ N+ X: |$ M
  21. * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    & o3 P; m4 N. R' |6 q* z% b) d
  22. * GNU General Public License for more details.2 Y1 n) T+ U, O5 A# ?
  23. */1 R9 h+ Y# s5 r
  24. # B! K: W$ R" `. \5 `) G
  25. #include <linux/module.h>
    ' T+ C4 d8 X4 Z7 r; ]- O
  26. #include <linux/init.h>* }; l7 W2 \6 ^4 r0 g" O) u
  27. #include <linux/errno.h>
    * e) ?/ j4 A2 f' l) i) P
  28. #include <linux/types.h>
    $ h  Y, j$ K0 w
  29. #include <linux/interrupt.h>
    ; F( Z; G4 z6 d
  30. #include <asm/io.h>
    : z' W9 E6 l2 R5 O8 t
  31. #include <linux/moduleparam.h>7 P5 }! k6 v* J- ~/ k
  32. #include <linux/sysctl.h>
    ! h& s/ J9 g' h1 o- b5 F5 o; ~  f
  33. #include <linux/mm.h>, d6 n* K$ M! g
  34. #include <linux/dma-mapping.h>
    % r3 w. a; h, {6 W8 E

  35. % }3 C, r+ p; ~; |
  36. #include <mach/memory.h>
    ' Q5 y3 _& M- u  h# b4 R) H8 R
  37. #include <mach/hardware.h>" [6 v  U& [: s. J" U6 U
  38. #include <mach/irqs.h>5 O: s+ }9 V; s' y
  39. #include <asm/hardware/edma.h>; O8 m; K: V: q  g0 ~& K
  40. & _- G4 O8 g$ D' O+ ~% _
  41. #undef EDMA3_DEBUG* ^1 y3 u( e- [$ W* {
  42. /*#define EDMA3_DEBUG*/
    0 Y" ^7 V* h: i) J$ K

  43. $ q9 N& ?5 z& m7 B% s5 Y
  44. #ifdef EDMA3_DEBUG+ i' S7 @; B1 j
  45. #define DMA_PRINTK(ARGS...)  printk(KERN_INFO "<%s>: ",__FUNCTION__);printk(ARGS)7 X1 b- k7 C. k* K
  46. #define DMA_FN_IN printk(KERN_INFO "[%s]: start\n", __FUNCTION__)
    # k+ S( u6 [5 H7 i# K. L" T, E
  47. #define DMA_FN_OUT printk(KERN_INFO "[%s]: end\n",__FUNCTION__)
    + ~$ D+ t, E* b
  48. #else/ G6 j9 c, A1 l# G' a! A/ g
  49. #define DMA_PRINTK( x... )
    + d/ U: w; Z/ U# t4 Z
  50. #define DMA_FN_IN% H* h" _. B+ `7 p+ ~. c
  51. #define DMA_FN_OUT
    3 n3 n  c4 c" L( m4 V1 Z
  52. #endif
    : W5 q% Z( N9 q" q. c: N6 x
  53. % ^' S8 x4 k* s& N9 P
  54. #define MAX_DMA_TRANSFER_IN_BYTES   (32768)& L3 S1 W: a) S4 V& j8 ?* Y, y% D1 h
  55. #define STATIC_SHIFT                3
    3 `3 r( O1 J6 c- X+ f5 Z
  56. #define TCINTEN_SHIFT               203 Y8 D% S+ ^- f- r8 l% _
  57. #define ITCINTEN_SHIFT              21
    0 B8 w* I. V! d7 a
  58. #define TCCHEN_SHIFT                22
    $ }6 `% q9 M" R9 T) z: S0 z1 Y# C& h
  59. #define ITCCHEN_SHIFT               238 l# P) F) |) c

  60. 0 E* p, I7 M6 H7 s: v( A3 A) U
  61. static volatile int irqraised1 = 0;, l! z9 ?# x/ o3 @* H
  62. static volatile int irqraised2 = 0;6 n  H+ a( w" S: p3 |
  63. % g1 d) Z) d. |; X/ E- |* k3 t
  64. int edma3_memtomemcpytest_dma(int acnt, int bcnt, int ccnt, int sync_mode, int event_queue);
    : ?0 t1 c9 G( K" \: F; e$ O3 K, e
  65. int edma3_memtomemcpytest_dma_link(int acnt, int bcnt, int ccnt, int sync_mode, int event_queue);
    - l2 {% H! Q4 \( S6 f7 c
  66. int edma3_memtomemcpytest_dma_chain(int acnt, int bcnt, int ccnt, int sync_mode, int event_queue);* d4 o! b1 j* u+ @& z: D

  67. ; B+ Q" ]8 L% K7 I7 g
  68. dma_addr_t dmaphyssrc1 = 0;1 i% x* D$ Y* l) h2 D0 d/ H$ w
  69. dma_addr_t dmaphyssrc2 = 0;! K  q5 s* L% I. D; V, y! A5 U
  70. dma_addr_t dmaphysdest1 = 0;
    - R: D, C9 T. b9 c  }- ~% I
  71. dma_addr_t dmaphysdest2 = 0;+ g5 h" }2 D' x5 h0 e
  72. # e9 V* L- O6 {8 ]$ E' M
  73. char *dmabufsrc1 = NULL;
    / G9 ~- V, i. R! b) b
  74. char *dmabufsrc2 = NULL;6 X' T: I$ M" n2 K) t2 Z; \
  75. char *dmabufdest1 = NULL;0 J# N! H- {3 d8 G% ?
  76. char *dmabufdest2 = NULL;
    . D0 F5 t% Z4 v8 C; O5 j

  77. ) \2 v6 |' x1 z( v- t& ?6 C6 D
  78. static int acnt = 512;: Q* _' |/ Z, T6 {" Z
  79. static int bcnt = 8;
    . k4 J% j$ F* Z, ]+ F& T) W' d
  80. static int ccnt = 8;2 E. Q, m, V' x4 `9 Q; k
  81. * ~' Z/ P$ n( Q2 m* g
  82. module_param(acnt, int, S_IRUGO);& g' u5 \' {/ q- G
  83. module_param(bcnt, int, S_IRUGO);  v" V" T& y) O4 s
  84. module_param(ccnt, int, S_IRUGO);
复制代码
+ J' o8 M. F/ @5 \) ?' q
5 S, N9 G, u$ P( r# t) s
      这是在TI上找到的一个针对Davanci处理器简单的EDMA3驱动程序测试例程的一部分,我在编译的过程中是用2 h# s5 \# i) U" |( U
arm-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这个命令来链接库文件进行编译,但是报的错误特别多,我又试着一个函数一个函数往进加,仍然是很多错误。
2 L3 M- x& K) n9 q& e+ {     我想问一下如何用一个简单的程序来测试一下EDMA3的驱动。6 m5 c3 T5 z4 W/ u# @- p
1 p  L5 L* {' C7 @
2 b4 |# @+ w6 w" T+ R0 q2 }
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 分享淘帖
回复

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2026-2-25 04:43 , Processed in 0.041729 second(s), 26 queries .

Powered by Discuz! X3.2

© 2001-2015 Comsenz Inc.

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