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

嵌入式开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

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

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

[复制链接]

5

主题

11

帖子

73

积分

注册会员

Rank: 2

积分
73
跳转到指定楼层
楼主
发表于 2018-1-30 11:01:43 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
本帖最后由 yyj 于 2018-1-30 11:01 编辑
5 A) r/ }2 M* q# y( \0 D2 X2 K( }
  1. [code]EDMA sample test application% W- d! Q' o: s9 I
  2. /*, e0 h4 V2 {/ U% ^
  3. * edma_test.c; e( a6 ^; w( m' E" i9 W5 e
  4. *
    * M' i3 X( g" _
  5. * brief  EDMA3 Test Application1 y9 g1 Y* m" C8 u% Y
  6. *
    9 M$ |+ B5 _$ R% B* m9 J' ?
  7. *   This file contains EDMA3 Test code.' g8 H" k5 B; I" h9 y  m
  8. *
    # d: b& C5 h: |+ V* I( Y
  9. *   NOTE: THIS FILE IS PROVIDED ONLY FOR INITIAL DEMO RELEASE AND MAY BE
    4 G3 i  z8 I* m* `* }7 ?
  10. *         REMOVED AFTER THE DEMO OR THE CONTENTS OF THIS FILE ARE SUBJECT
    ! E0 d  T, }7 o) B% c
  11. *         TO CHANGE.9 `% L3 r3 u) Z! c/ R3 c" v
  12. *+ v$ z& _' p# a1 E
  13. * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/3 P( U+ D0 Z5 D0 `' s
  14. *
    3 P7 K, Q5 M$ A$ ^& Y2 n+ |7 m  N/ M
  15. * This program is free software; you can redistribute it and/or& A7 w9 L) ]0 m7 I0 T6 _
  16. * modify it under the terms of the GNU General Public License as4 d2 x1 Z( {7 w' `- K$ Z& m5 D; l
  17. * published by the Free Software Foundation version 2.& R+ R$ q& A. k0 T* k
  18. *4 m1 _4 \2 q( [0 C
  19. * This program is distributed "as is" WITHOUT ANY WARRANTY of any
    6 E6 o" l  X3 x% R$ a3 e) |+ {! c7 T
  20. * kind, whether express or implied; without even the implied warranty
    ( c5 g7 f7 E" j4 g/ @
  21. * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    3 y5 E2 a# K) O2 P
  22. * GNU General Public License for more details.
    6 Y) T% t+ b- `8 i
  23. */
    4 L& {0 e* w9 a8 Y# n" @
  24. 7 C; `+ F8 H3 |6 y9 S6 T
  25. #include <linux/module.h>1 ~! V# K1 o" T& g7 a  T6 N
  26. #include <linux/init.h>: H9 M1 `  G9 x* {; A- v9 I
  27. #include <linux/errno.h>2 S! ^) ]# T$ |7 j* U0 K/ C
  28. #include <linux/types.h>
    5 t7 a8 g. Y; G" ]& e
  29. #include <linux/interrupt.h>
    , f0 W! a4 _4 _( x) g7 a
  30. #include <asm/io.h>
    4 @. i! M3 Z0 C9 r( Y# E) R0 T
  31. #include <linux/moduleparam.h>
    / `7 w1 B7 v  L% e/ P1 Q% k' f
  32. #include <linux/sysctl.h>( ^$ ]( G. [1 X' i) `* I$ S. X
  33. #include <linux/mm.h>
    : z" _; ?( e' f2 D5 ^
  34. #include <linux/dma-mapping.h>
      R- E2 }+ k4 ]1 m5 b) o
  35. 4 Q5 C- H+ G8 H% N/ ^( O7 f) |& Y6 @
  36. #include <mach/memory.h>
    2 _4 F, D# K, p/ ~
  37. #include <mach/hardware.h>6 V% K, @* F8 z& [. h0 ^$ C
  38. #include <mach/irqs.h>  y  Y& |/ [( H6 B  ~5 O
  39. #include <asm/hardware/edma.h>
    ' T) L# R, v/ [8 N% N* N

  40. 8 w* [1 v5 ~0 {
  41. #undef EDMA3_DEBUG( @5 M/ P7 d1 y9 G  E
  42. /*#define EDMA3_DEBUG*/! @- {  Q+ e# A: l, z! U5 |

  43. 4 Z+ y8 M/ ]" X: O5 Y; m2 K/ d
  44. #ifdef EDMA3_DEBUG3 F  F/ q, q+ Z- [
  45. #define DMA_PRINTK(ARGS...)  printk(KERN_INFO "<%s>: ",__FUNCTION__);printk(ARGS)9 I2 U5 F& L+ d: K; t
  46. #define DMA_FN_IN printk(KERN_INFO "[%s]: start\n", __FUNCTION__)
    6 q( T5 k8 J* i5 \3 a$ {
  47. #define DMA_FN_OUT printk(KERN_INFO "[%s]: end\n",__FUNCTION__)
    - S1 E" P1 u0 e' O3 N
  48. #else. J, M* Y7 P0 ?7 o2 ^* R0 N+ Q
  49. #define DMA_PRINTK( x... )
    ; K5 T& v2 i0 J/ H1 V, j  I# k9 r
  50. #define DMA_FN_IN5 T9 K& w) x5 [5 z, |
  51. #define DMA_FN_OUT6 j; q. a+ ?( B. n- Q  s: v
  52. #endif; a( D+ L$ g  K# ?

  53. 4 {) A6 i  i2 _0 ?" v8 O
  54. #define MAX_DMA_TRANSFER_IN_BYTES   (32768)6 G" M2 T4 C- d9 Z
  55. #define STATIC_SHIFT                36 q; n9 c$ S3 B- c" l( ^/ ^3 _% C
  56. #define TCINTEN_SHIFT               20
    # {& B4 ^5 [7 S! ?
  57. #define ITCINTEN_SHIFT              21) O0 H. X: C8 H9 B$ R
  58. #define TCCHEN_SHIFT                22
    6 Q2 a' C" K: D/ A
  59. #define ITCCHEN_SHIFT               23
    3 K" }, J) m- m* G
  60. # _; z# P9 M1 {, L- B0 d
  61. static volatile int irqraised1 = 0;0 u2 F; J! j5 |6 ~* u+ x% Z
  62. static volatile int irqraised2 = 0;
    ! y, Q2 R: b6 B* \: M4 M

  63. ; H; h' {0 ]8 [/ I
  64. int edma3_memtomemcpytest_dma(int acnt, int bcnt, int ccnt, int sync_mode, int event_queue);
    & H; ^5 e' `7 q" \" W) f& H
  65. int edma3_memtomemcpytest_dma_link(int acnt, int bcnt, int ccnt, int sync_mode, int event_queue);
    4 N- P( [% O+ ?
  66. int edma3_memtomemcpytest_dma_chain(int acnt, int bcnt, int ccnt, int sync_mode, int event_queue);
    1 G$ m6 B/ A4 n( S* p. E" @

  67. . O  R' n. w+ z
  68. dma_addr_t dmaphyssrc1 = 0;
    9 n4 S3 p; A: c8 f6 @
  69. dma_addr_t dmaphyssrc2 = 0;& c) u4 @5 a- V0 T: s2 U5 z
  70. dma_addr_t dmaphysdest1 = 0;" O: P* j9 y6 C2 h/ I+ R- f
  71. dma_addr_t dmaphysdest2 = 0;
      y! o# H; {" V3 |
  72. 8 w& w) B, v1 N2 d  ^0 D1 I
  73. char *dmabufsrc1 = NULL;$ w0 U4 p" T5 y8 n
  74. char *dmabufsrc2 = NULL;
    ( n& D( w) b; F) O
  75. char *dmabufdest1 = NULL;; [8 y6 H3 ^. z
  76. char *dmabufdest2 = NULL;
      ?0 ^2 c$ R- b( f. e
  77. ) r% E# l( ~; ]
  78. static int acnt = 512;' H. w# J* R5 v0 q
  79. static int bcnt = 8;8 q  U) _- C( a& [
  80. static int ccnt = 8;% C* `+ C0 ]( g, [7 i* e* \

  81. 4 k" l5 }8 ]3 j1 ]$ W2 t
  82. module_param(acnt, int, S_IRUGO);
    4 l% g) ]9 i0 t6 r  F6 H
  83. module_param(bcnt, int, S_IRUGO);5 G& @! v/ J6 b3 N( Q' i0 k2 q1 y
  84. module_param(ccnt, int, S_IRUGO);
复制代码
: |8 g2 h# |# S9 e- G* G9 G* r
7 |3 y/ D( n$ T) ?  U
      这是在TI上找到的一个针对Davanci处理器简单的EDMA3驱动程序测试例程的一部分,我在编译的过程中是用( a1 a( e' C! S  ^: 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: u; p( k& b. K% j* `3 i     我想问一下如何用一个简单的程序来测试一下EDMA3的驱动。
! G; v  `# ~& _5 ^  t, q3 y( k% u  M* T; p
0 S& G* e0 L2 d% P1 r& J5 W
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 分享淘帖
回复

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2026-3-31 16:49 , Processed in 0.038314 second(s), 25 queries .

Powered by Discuz! X3.2

© 2001-2015 Comsenz Inc.

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