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

嵌入式开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

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

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

[复制链接]

5

主题

11

帖子

73

积分

注册会员

Rank: 2

积分
73
跳转到指定楼层
楼主
发表于 2018-1-30 11:01:43 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
本帖最后由 yyj 于 2018-1-30 11:01 编辑 4 z  u* ^8 W8 [8 c
  1. [code]EDMA sample test application- r+ X) b" U" J5 x  u
  2. /*& b- A9 d. v$ p+ u9 g8 C
  3. * edma_test.c
    # g7 v. n* ^" m6 ~
  4. *
    # ?  u4 H) Q, F. [, q- p
  5. * brief  EDMA3 Test Application
    , p0 T/ @/ J+ x$ E
  6. *0 P5 z5 Y* d) Z+ Y$ L
  7. *   This file contains EDMA3 Test code.' h( {  }1 X! D' M4 p
  8. *+ h& Z- a+ X* ]
  9. *   NOTE: THIS FILE IS PROVIDED ONLY FOR INITIAL DEMO RELEASE AND MAY BE2 C" H- g5 K9 R( m% K- ~  G
  10. *         REMOVED AFTER THE DEMO OR THE CONTENTS OF THIS FILE ARE SUBJECT. f, E! i9 g+ u) g; c
  11. *         TO CHANGE.
    ' Y3 @) J! l6 Q0 ~$ [( [) D
  12. *
    6 ]/ K: G6 n7 u5 k: r; W
  13. * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
    , ~+ `3 w8 ^9 e+ ]: Y
  14. *4 M3 E. g- W. Y! ~% w6 r* G# A; _
  15. * This program is free software; you can redistribute it and/or
    9 V9 p( h2 `  J
  16. * modify it under the terms of the GNU General Public License as1 D8 e9 @- f/ W7 F
  17. * published by the Free Software Foundation version 2.
    7 N" E" H  y! D, e2 h
  18. *4 H% `; W) h+ w; p1 l9 \
  19. * This program is distributed "as is" WITHOUT ANY WARRANTY of any0 \5 s9 P$ s6 {9 ?, n" x: F
  20. * kind, whether express or implied; without even the implied warranty
    / T  \7 r2 i! S- Q+ N/ D
  21. * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    3 c! a. x" p# B) O9 P% z* p8 i
  22. * GNU General Public License for more details.; ]" c3 s% H- x
  23. */
    + I% o' H( Y9 M
  24. + k! L6 r+ M4 E3 n- N" a# j
  25. #include <linux/module.h>3 O+ W2 X+ v( A/ C- o8 M8 l' @8 i
  26. #include <linux/init.h>
    % y, M$ y5 P7 E' n0 i/ k1 R
  27. #include <linux/errno.h>+ d; X5 \' @0 }) T1 O) P7 b' o
  28. #include <linux/types.h>! ~6 Y9 n5 {3 l0 @
  29. #include <linux/interrupt.h>, o8 E, B7 {" m1 e$ L* V0 ^
  30. #include <asm/io.h>& f) Y& f" y0 }# }9 _
  31. #include <linux/moduleparam.h>
    ! R* x* Y# S, X
  32. #include <linux/sysctl.h>
    * A% ?" e  K8 v' Y3 S
  33. #include <linux/mm.h>
    : a2 B: ~9 I/ w. I) W
  34. #include <linux/dma-mapping.h>
    * B: N$ h+ o3 y8 y% I% t6 B4 `" U
  35. 1 Q- r. ?, p6 O/ y! [" a+ p
  36. #include <mach/memory.h>
    % A, ?& c( ]. j+ v+ `; W
  37. #include <mach/hardware.h>
    ! _; O6 L* g/ [; O3 J- y5 {
  38. #include <mach/irqs.h>$ l% {* Q6 I0 ?$ t2 k
  39. #include <asm/hardware/edma.h>
    " q! n3 e* i4 U  c( }
  40. ! s3 t3 Q3 Q9 R" t: g1 K
  41. #undef EDMA3_DEBUG
    - M4 L1 [7 h. |; T4 t- e) |
  42. /*#define EDMA3_DEBUG*/
    * p; n4 k3 `  J

  43.   e: O# \; U4 C# H8 [! `( s
  44. #ifdef EDMA3_DEBUG2 [" L* ]4 z" H1 Z! r
  45. #define DMA_PRINTK(ARGS...)  printk(KERN_INFO "<%s>: ",__FUNCTION__);printk(ARGS)
    $ E# z0 K) x. B5 {. M
  46. #define DMA_FN_IN printk(KERN_INFO "[%s]: start\n", __FUNCTION__)$ j$ a$ O* ]! V: ]( o
  47. #define DMA_FN_OUT printk(KERN_INFO "[%s]: end\n",__FUNCTION__)8 ]2 \0 _) }' B2 e4 M$ }# l
  48. #else
    1 _  L$ U# t- D& P8 \2 F# |9 e
  49. #define DMA_PRINTK( x... )
    : V6 V( Q2 O- a# B/ z: }7 A  l
  50. #define DMA_FN_IN$ B8 S  h: {- G2 {, w  R# K
  51. #define DMA_FN_OUT
    6 t% A" Q# {& T4 g, j. E1 g
  52. #endif
      Q; x" _4 F! f2 Z% \
  53. : O0 ~8 }1 |- C+ C. T
  54. #define MAX_DMA_TRANSFER_IN_BYTES   (32768)
    9 s6 c" S6 ~+ r# L5 \
  55. #define STATIC_SHIFT                3' S: H; l  v; M  p. e
  56. #define TCINTEN_SHIFT               20
    ( ], H) C& H) w2 X' a- B2 a$ l
  57. #define ITCINTEN_SHIFT              21
    / T( G  K# F# o, @% W7 Q
  58. #define TCCHEN_SHIFT                22
    6 x8 H: h& I0 A4 L
  59. #define ITCCHEN_SHIFT               23" E8 F0 p  o) W, o1 S# R" `0 C
  60. 1 K2 l4 g3 d+ G4 ]' h0 O
  61. static volatile int irqraised1 = 0;
    * i- v, g. E1 Y; E, J, p6 Z# s
  62. static volatile int irqraised2 = 0;! \- R' f# ^  h4 n5 x
  63. 3 q# o, i' u" }; R
  64. int edma3_memtomemcpytest_dma(int acnt, int bcnt, int ccnt, int sync_mode, int event_queue);
    3 R7 J+ x) s0 ?5 d" v8 T
  65. int edma3_memtomemcpytest_dma_link(int acnt, int bcnt, int ccnt, int sync_mode, int event_queue);0 v! {3 A6 _9 p, U/ E
  66. int edma3_memtomemcpytest_dma_chain(int acnt, int bcnt, int ccnt, int sync_mode, int event_queue);0 Q* `6 r* d) i7 j
  67. - s; B8 o4 p8 U, B" K# L: ]
  68. dma_addr_t dmaphyssrc1 = 0;  o' P' q+ `' o. U; U/ u
  69. dma_addr_t dmaphyssrc2 = 0;! I- I3 C% k( s$ v+ _1 \
  70. dma_addr_t dmaphysdest1 = 0;
    1 `1 K9 C! X8 `( Q
  71. dma_addr_t dmaphysdest2 = 0;0 N( e5 ?1 I7 B1 E$ Z
  72. $ L7 q. c* a3 f  |7 ?  z; w
  73. char *dmabufsrc1 = NULL;
    - z% q/ a4 ~8 s7 j3 K/ c8 F; o, X  \
  74. char *dmabufsrc2 = NULL;
    1 O( M6 ~# B7 I1 Q
  75. char *dmabufdest1 = NULL;2 E! y* x& A$ o% k+ R4 Q( X
  76. char *dmabufdest2 = NULL;
    3 `* M, G( Y1 H4 H2 [! I
  77. : v2 W4 R/ R2 K* H" s
  78. static int acnt = 512;. t( s3 H6 }1 D) J1 z2 |
  79. static int bcnt = 8;
    7 w/ x3 h/ P; }; _0 V; Z
  80. static int ccnt = 8;
    9 h, @3 c0 A& h5 W. I2 @
  81. 0 R3 |  k' V+ T* E- L4 t
  82. module_param(acnt, int, S_IRUGO);0 K/ P8 O: z$ \" C6 @4 [/ K
  83. module_param(bcnt, int, S_IRUGO);
    5 q/ x. z% G% ~8 v) n! V
  84. module_param(ccnt, int, S_IRUGO);
复制代码
2 d" J$ v' I7 n0 H/ k% k( t

! y+ G: H0 j& f" D: {' b, m      这是在TI上找到的一个针对Davanci处理器简单的EDMA3驱动程序测试例程的一部分,我在编译的过程中是用; K7 h( \) ?, ^/ j& l
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这个命令来链接库文件进行编译,但是报的错误特别多,我又试着一个函数一个函数往进加,仍然是很多错误。* A; g( }# }* I
     我想问一下如何用一个简单的程序来测试一下EDMA3的驱动。
- a/ t3 V& |: W/ c1 m" C+ w8 i( P$ h( F

) d5 G" Y, N+ Q$ S2 i
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 分享淘帖
回复

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2026-1-17 22:17 , Processed in 0.038070 second(s), 25 queries .

Powered by Discuz! X3.2

© 2001-2015 Comsenz Inc.

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