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

嵌入式开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

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

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

[复制链接]

5

主题

11

帖子

73

积分

注册会员

Rank: 2

积分
73
跳转到指定楼层
楼主
发表于 2018-1-30 11:01:43 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
本帖最后由 yyj 于 2018-1-30 11:01 编辑
0 p: M1 L: L* B+ [9 S
  1. [code]EDMA sample test application3 [: H: d, i2 @- Q' r; N" E
  2. /*6 o9 K: D; x6 @3 t
  3. * edma_test.c
    3 l$ Z8 T: A( z0 H/ T
  4. *6 q9 Q% V2 q/ o7 T  z
  5. * brief  EDMA3 Test Application/ l1 Q% _) B: _; \6 S
  6. *
    ! d9 P% C2 q8 N/ e
  7. *   This file contains EDMA3 Test code.( \+ Z2 l! ~' f
  8. *, l1 E2 o  X: k3 K6 ]
  9. *   NOTE: THIS FILE IS PROVIDED ONLY FOR INITIAL DEMO RELEASE AND MAY BE
    / I% i* x/ S9 ~  z6 A* B' s: f
  10. *         REMOVED AFTER THE DEMO OR THE CONTENTS OF THIS FILE ARE SUBJECT2 z! k. r7 m/ w: W
  11. *         TO CHANGE.
    " H9 m- L, k1 j! p
  12. *
    4 W: i3 b$ D" e) y
  13. * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
    : H' A7 j6 N: ]  y
  14. *7 b8 E# q: w. h8 `$ [; W. Q
  15. * This program is free software; you can redistribute it and/or0 k  [# E2 X& f' ~4 h& v
  16. * modify it under the terms of the GNU General Public License as9 M% d  R1 Q8 b. j! a- |
  17. * published by the Free Software Foundation version 2.
    - Q- F7 Y+ i2 G. Q) I
  18. *1 _  I8 L8 {0 ^
  19. * This program is distributed "as is" WITHOUT ANY WARRANTY of any
    , H% |; w' y! n# P0 a
  20. * kind, whether express or implied; without even the implied warranty9 y2 x: Y. p# I3 c5 @) e. w
  21. * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the) f( U/ G+ p! e# {7 _
  22. * GNU General Public License for more details.
    % o! W. h; A5 p  O: w1 i* k) r
  23. */
    " m( |. b$ h* y8 \& y; m
  24. 1 p' {4 t2 P4 w- V
  25. #include <linux/module.h>% N- {$ E1 R3 ^3 K; ~1 V6 a
  26. #include <linux/init.h>
    1 [, z) W; j2 L/ i+ @
  27. #include <linux/errno.h>* O( ^4 X1 W( M/ G
  28. #include <linux/types.h>
    6 W. U- J2 S7 M; X0 @
  29. #include <linux/interrupt.h>
    * r& H7 ~5 p1 F7 H% Y9 B: R' x
  30. #include <asm/io.h>' s8 x  i/ c  d9 a2 U
  31. #include <linux/moduleparam.h>
    : p; }3 W" @7 M( c3 O. |/ U9 @
  32. #include <linux/sysctl.h>0 j" V  m* ^+ I4 I
  33. #include <linux/mm.h>
      Z3 K, j, l, Q
  34. #include <linux/dma-mapping.h>9 O8 D$ k2 ?& {0 o( E$ [5 e

  35. 2 Q. @& L8 T/ T' \8 G
  36. #include <mach/memory.h>
    0 Y+ u. D3 b* F. p9 \
  37. #include <mach/hardware.h>
    ! \& B# u+ U/ [  ]3 Y7 E; i. }& m
  38. #include <mach/irqs.h>
    ( W# |& _) R9 ^5 |3 G
  39. #include <asm/hardware/edma.h>) B: _+ m  W. [
  40. # b# |$ A/ V  |) e) z; C
  41. #undef EDMA3_DEBUG6 j  S* H' f; H/ ~, X
  42. /*#define EDMA3_DEBUG*/
    8 r+ u# k! n' c# w9 @0 W) y

  43. " j( {, `7 L. g) x+ L
  44. #ifdef EDMA3_DEBUG
    / Y3 v1 V; a1 @' D! M
  45. #define DMA_PRINTK(ARGS...)  printk(KERN_INFO "<%s>: ",__FUNCTION__);printk(ARGS)
    0 _, @( R( V+ I1 c
  46. #define DMA_FN_IN printk(KERN_INFO "[%s]: start\n", __FUNCTION__)4 Y% c3 ^: v  r8 z# f! j! F
  47. #define DMA_FN_OUT printk(KERN_INFO "[%s]: end\n",__FUNCTION__)  w4 T3 t' n2 N. b
  48. #else
      }7 D# |) R5 |. t2 I" i
  49. #define DMA_PRINTK( x... )) G7 i+ ?% e1 F$ M% j3 |
  50. #define DMA_FN_IN
    ( i# q7 ~2 v) I% r; E
  51. #define DMA_FN_OUT
    ) b+ }% Y5 \1 @3 z  w
  52. #endif
    ! C* `3 w( [2 U, {8 f

  53. # T( u9 Z: A) P/ k+ s+ S# g
  54. #define MAX_DMA_TRANSFER_IN_BYTES   (32768)
    / A. C' W$ p/ M
  55. #define STATIC_SHIFT                3
    " b( K1 E: Z: n0 ^% E  N) S
  56. #define TCINTEN_SHIFT               20
    % X2 `8 H# p+ `( h! ]' a. ^
  57. #define ITCINTEN_SHIFT              21
    6 Y1 U2 t" L- m7 n) V8 }8 X9 x
  58. #define TCCHEN_SHIFT                22
    6 z3 E9 e+ C) c6 Q, X' T7 r
  59. #define ITCCHEN_SHIFT               23" W: y9 O' @' g- G' n3 f

  60. / F; w8 B7 h; N8 h2 G0 A
  61. static volatile int irqraised1 = 0;, w- x7 ~9 [( {) U  Z+ C
  62. static volatile int irqraised2 = 0;% {* J4 q3 ^: x. h
  63. , B: o2 A4 l2 ~9 S$ j
  64. int edma3_memtomemcpytest_dma(int acnt, int bcnt, int ccnt, int sync_mode, int event_queue);
    1 \. q2 T* _) Y0 _* W
  65. int edma3_memtomemcpytest_dma_link(int acnt, int bcnt, int ccnt, int sync_mode, int event_queue);& J8 o) @8 x$ d: y
  66. int edma3_memtomemcpytest_dma_chain(int acnt, int bcnt, int ccnt, int sync_mode, int event_queue);! f+ p& b/ N* _5 o
  67. 8 U2 T0 E# C( X; w$ a  l7 n1 Y  M
  68. dma_addr_t dmaphyssrc1 = 0;4 o* W. @' I, }! R, y
  69. dma_addr_t dmaphyssrc2 = 0;/ S- ?* P# `$ B5 f1 H8 d
  70. dma_addr_t dmaphysdest1 = 0;
    ' u( t3 h) H3 s2 q) {2 \( T; I# l
  71. dma_addr_t dmaphysdest2 = 0;7 f( w- a5 m2 Q4 H& g2 I

  72. 7 M* ?* C+ }4 X+ q* B5 k* P6 t
  73. char *dmabufsrc1 = NULL;6 v3 L( ^7 p0 R5 ^5 a- C3 m6 b1 K/ Q
  74. char *dmabufsrc2 = NULL;
    9 m3 b4 V. C0 U& A. d
  75. char *dmabufdest1 = NULL;
    . s) h3 @4 W( A1 k
  76. char *dmabufdest2 = NULL;
    * _' _. b9 C3 V: \; }+ T) g( z  l
  77. / q* ]. |% K. X: i5 {1 e0 n
  78. static int acnt = 512;" x! ]4 l! n6 t5 g5 Y
  79. static int bcnt = 8;" P) G8 @  t6 P( Q
  80. static int ccnt = 8;: F. M3 Z/ _+ C, W2 p
  81. & W' q- U' \! `& i, s
  82. module_param(acnt, int, S_IRUGO);. j* Z4 e6 j4 P+ {4 m
  83. module_param(bcnt, int, S_IRUGO);
    ) d7 q) _# s4 p/ g4 [+ o% h" j- T
  84. module_param(ccnt, int, S_IRUGO);
复制代码

. s4 F& x* m' E! m) N4 O% t$ |0 @9 E/ J+ E$ n
      这是在TI上找到的一个针对Davanci处理器简单的EDMA3驱动程序测试例程的一部分,我在编译的过程中是用, Q  k$ L$ n, s$ e9 g. S; z
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这个命令来链接库文件进行编译,但是报的错误特别多,我又试着一个函数一个函数往进加,仍然是很多错误。9 f8 E. d2 l3 D1 w7 J* X9 M# d
     我想问一下如何用一个简单的程序来测试一下EDMA3的驱动。
; \: W9 e- n* @7 L
8 F; E) F& m& d: D; G2 }% D) i& E; [: t8 g9 C# q
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 分享淘帖
回复

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2026-4-8 06:26 , Processed in 0.038980 second(s), 25 queries .

Powered by Discuz! X3.2

© 2001-2015 Comsenz Inc.

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