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

嵌入式开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

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

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

[复制链接]

5

主题

11

帖子

73

积分

注册会员

Rank: 2

积分
73
跳转到指定楼层
楼主
发表于 2018-1-30 11:01:43 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
本帖最后由 yyj 于 2018-1-30 11:01 编辑
$ a% }* s) ?) }" i* S4 z
  1. [code]EDMA sample test application
    + _3 |8 Y7 K8 g# k4 a  A5 p  P
  2. /*2 i1 w1 t5 Y0 X6 ]# I9 ?9 y
  3. * edma_test.c
    & c" V$ i( s8 q) I, X
  4. ** }  r4 c* t" M( n$ D+ C9 k3 K
  5. * brief  EDMA3 Test Application. i7 v2 v2 z, P$ w  l& Z
  6. ** N3 t" a2 l: @. k; `
  7. *   This file contains EDMA3 Test code.
    5 j+ Y# v6 d, I. O; V9 a. C; J5 t
  8. *
    0 O6 f+ Q& Z. x$ i& e) z
  9. *   NOTE: THIS FILE IS PROVIDED ONLY FOR INITIAL DEMO RELEASE AND MAY BE
    ; I1 A, g9 z& M( U6 H6 B! u. F
  10. *         REMOVED AFTER THE DEMO OR THE CONTENTS OF THIS FILE ARE SUBJECT1 a4 T4 S7 B2 [7 C2 i# a
  11. *         TO CHANGE.
    ' _. U) o7 y$ `$ l
  12. *
    ( _3 D& L+ Z+ O+ j1 f  v7 [
  13. * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/* x; {: f4 m" e5 D
  14. *! T& N" z& S6 I( A! u6 d/ D8 A
  15. * This program is free software; you can redistribute it and/or
    / L- [( r+ T3 R) L9 `6 I. p
  16. * modify it under the terms of the GNU General Public License as
    " f, e9 X1 k, B4 y7 t6 n
  17. * published by the Free Software Foundation version 2.
    , ?% p: {3 Y8 \2 C7 g, B3 L" s
  18. *3 L+ k1 \6 O1 ]( ?
  19. * This program is distributed "as is" WITHOUT ANY WARRANTY of any
    ) T" M4 |2 Z, I6 a. v& o
  20. * kind, whether express or implied; without even the implied warranty
    & K- E" |2 l  l3 C
  21. * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    7 r  m/ l1 Q" P, q8 q! X  M: @: `2 y
  22. * GNU General Public License for more details.5 o9 ^5 |; @1 p, f) m7 @. n
  23. */) Z0 ^% U3 j% k: t3 q& K" z" Y
  24. " R- E% V. H3 W3 N/ [
  25. #include <linux/module.h>* z: n/ ^; k0 E: n
  26. #include <linux/init.h>
    ' W7 F1 D1 @3 |: e% G6 m' W1 ]
  27. #include <linux/errno.h>+ H, i( X# s  M, \1 h% C# ~
  28. #include <linux/types.h>
    / c- c% ~- s1 ?4 M9 j0 t; q6 I' |
  29. #include <linux/interrupt.h>, l1 |5 H/ l  V% m
  30. #include <asm/io.h>( A9 X* {2 M- ], i
  31. #include <linux/moduleparam.h>
    ( z* l7 I+ C5 s' Y5 S2 `
  32. #include <linux/sysctl.h>  G. w% A2 m+ j) [: G- o) D; n
  33. #include <linux/mm.h>4 n4 ~8 l9 X7 |
  34. #include <linux/dma-mapping.h>
      ?5 K6 I% H" ]" D- M2 d: E
  35.   Y& g% F( O0 h; x( _
  36. #include <mach/memory.h>/ T- V( P3 k9 x
  37. #include <mach/hardware.h>4 m* f2 D" x" P1 ^7 a! y0 u. s
  38. #include <mach/irqs.h>
    % j9 w; m) ?2 v+ K' F2 h
  39. #include <asm/hardware/edma.h>
    0 m% p1 Q( T0 N% `! G
  40. & h  N) Y9 x9 g  z' t  b' K
  41. #undef EDMA3_DEBUG
    8 S; u" H8 L. m  _% I! ~
  42. /*#define EDMA3_DEBUG*/
    4 {! A* K2 @% `" q/ C

  43. % h. }; v( ~, [" R: }2 R
  44. #ifdef EDMA3_DEBUG
    ; h6 t  J1 S: Y! f7 c( q, H
  45. #define DMA_PRINTK(ARGS...)  printk(KERN_INFO "<%s>: ",__FUNCTION__);printk(ARGS)
    * O2 ~& V5 T2 i7 G
  46. #define DMA_FN_IN printk(KERN_INFO "[%s]: start\n", __FUNCTION__)" f. y1 {0 p7 b; n5 y* M
  47. #define DMA_FN_OUT printk(KERN_INFO "[%s]: end\n",__FUNCTION__)
    ' [; B( A+ H- Y4 W$ y
  48. #else
    / i- h+ p+ `6 _0 `! Q/ ~( V6 t
  49. #define DMA_PRINTK( x... )
    1 V& i3 M1 }+ S
  50. #define DMA_FN_IN
    ' Q0 N- C, p- m
  51. #define DMA_FN_OUT0 R2 o! F; j/ l
  52. #endif! b: b9 t  i' r2 m2 @5 G- ]
  53. 2 h  ^! Z2 F5 t2 H. {+ x2 C
  54. #define MAX_DMA_TRANSFER_IN_BYTES   (32768)( m7 t) P. n: u: [3 q" _3 y5 ~- `
  55. #define STATIC_SHIFT                3
    8 `8 h( T& |1 E& S, Y$ M# ?2 H
  56. #define TCINTEN_SHIFT               20
    $ h* P3 a0 l- ]" |& D( A9 ]' z
  57. #define ITCINTEN_SHIFT              21
    3 u5 z+ K1 w2 r; Q) P
  58. #define TCCHEN_SHIFT                22
    ' {' l3 B8 t5 n3 f: U6 H6 P, R* ?7 d  H
  59. #define ITCCHEN_SHIFT               231 M! `* o5 d7 a6 h5 {
  60. 7 h' I% R6 i1 U  G
  61. static volatile int irqraised1 = 0;% Q# r5 N4 y! X3 {
  62. static volatile int irqraised2 = 0;9 _; ^1 Y! z5 H5 A

  63. ) a% [, N8 V8 t0 @7 I
  64. int edma3_memtomemcpytest_dma(int acnt, int bcnt, int ccnt, int sync_mode, int event_queue);
    + Z& a+ P8 ^3 d1 u' u3 O
  65. int edma3_memtomemcpytest_dma_link(int acnt, int bcnt, int ccnt, int sync_mode, int event_queue);
    1 `/ [# i! c% i) S% U
  66. int edma3_memtomemcpytest_dma_chain(int acnt, int bcnt, int ccnt, int sync_mode, int event_queue);- @4 ~7 W( \# k/ s5 ?- U
  67. 3 q1 N0 }4 H# y- a. ~; D
  68. dma_addr_t dmaphyssrc1 = 0;
    # s# a; t$ M; H
  69. dma_addr_t dmaphyssrc2 = 0;
    6 [$ j9 f1 o4 \$ ~6 ~, f
  70. dma_addr_t dmaphysdest1 = 0;; _9 x: x1 A' F, T
  71. dma_addr_t dmaphysdest2 = 0;8 W8 {5 g& ~; i
  72. , ~7 z% \  q2 {8 p1 e
  73. char *dmabufsrc1 = NULL;
    0 {9 U  u6 B/ K. }; J
  74. char *dmabufsrc2 = NULL;) x2 k3 ?( w% S5 ?; Q
  75. char *dmabufdest1 = NULL;/ R4 g, d, T( A1 Q% `# b) Y, C
  76. char *dmabufdest2 = NULL;
    $ F; H/ ~: \9 {- G7 k) C+ Z

  77. ) S" v: X" D$ A5 e9 d4 j
  78. static int acnt = 512;8 C& W( e2 Q/ d2 j8 J
  79. static int bcnt = 8;
    ! p5 s# \/ H' w( N" {: g9 `; T  @
  80. static int ccnt = 8;; U' B" N( q0 H) M) n1 _

  81. 9 D1 b) Q7 p/ j# N1 e
  82. module_param(acnt, int, S_IRUGO);8 v( O3 v0 l2 `0 j+ T
  83. module_param(bcnt, int, S_IRUGO);6 U4 [  A$ S/ i, G  D- z* l/ N
  84. module_param(ccnt, int, S_IRUGO);
复制代码
" H$ D4 I8 w2 C; k' N/ r
/ v$ n  A0 X2 t3 p* b
      这是在TI上找到的一个针对Davanci处理器简单的EDMA3驱动程序测试例程的一部分,我在编译的过程中是用+ n8 x$ X) l1 f1 _! V" ^
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这个命令来链接库文件进行编译,但是报的错误特别多,我又试着一个函数一个函数往进加,仍然是很多错误。
4 K' t! }: c  \2 c2 ^     我想问一下如何用一个简单的程序来测试一下EDMA3的驱动。
1 |) O3 z  R6 J' n/ _9 [9 y7 Q+ r9 ?- y6 a8 `6 K' J
6 a9 [/ k* N! k" k
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 分享淘帖
回复

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2026-3-5 11:30 , Processed in 0.041964 second(s), 26 queries .

Powered by Discuz! X3.2

© 2001-2015 Comsenz Inc.

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