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

嵌入式开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

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

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

[复制链接]

5

主题

11

帖子

73

积分

注册会员

Rank: 2

积分
73
跳转到指定楼层
楼主
发表于 2018-1-30 11:01:43 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
本帖最后由 yyj 于 2018-1-30 11:01 编辑 2 ~/ @- {4 ?! }! x0 |
  1. [code]EDMA sample test application
    2 @5 {# b( i- t1 V. e* e) z# x+ ^' a
  2. /*7 a+ \) M5 g" z; u0 S0 J
  3. * edma_test.c/ {2 k* u# I  E7 p' M
  4. *
    0 {# @6 X1 O( R. z) i# h5 S
  5. * brief  EDMA3 Test Application
    : ~$ b7 k# ~# ^4 ]3 m4 ?) h' O4 ?
  6. *
    : y9 j8 L+ l% R* ]6 Y" _
  7. *   This file contains EDMA3 Test code.
    : J% b* {5 k6 n4 d' }0 S/ f$ ~
  8. *1 i4 l6 p0 k7 S6 p" m( _
  9. *   NOTE: THIS FILE IS PROVIDED ONLY FOR INITIAL DEMO RELEASE AND MAY BE
      g9 o1 b% U2 B8 u# _& p& Y$ {
  10. *         REMOVED AFTER THE DEMO OR THE CONTENTS OF THIS FILE ARE SUBJECT
    * s( ^: ]$ F, B3 y: T* X% U
  11. *         TO CHANGE.
    7 r" L5 E/ b: V. a, J- k
  12. *" d, e) J1 Y* o5 D: D$ b- o, c
  13. * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/4 P* E% O7 X3 c0 ]9 L0 {. ]6 Z# R8 k
  14. *1 z1 q' `5 |& E/ p) ]. G* e
  15. * This program is free software; you can redistribute it and/or
    + m9 d) x9 ]  h! A5 J
  16. * modify it under the terms of the GNU General Public License as
    1 K. U* j- \) z$ M
  17. * published by the Free Software Foundation version 2.
    8 H8 U/ U9 D! U/ e2 s
  18. *
      s8 f7 Y( |( H0 A' N4 @1 i
  19. * This program is distributed "as is" WITHOUT ANY WARRANTY of any+ j; T/ ?# l; f9 P
  20. * kind, whether express or implied; without even the implied warranty( N7 F& }% f0 E3 A  I& Y
  21. * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the, h9 A; L9 K1 k$ V: p/ f$ e
  22. * GNU General Public License for more details." c! ]; Z4 t) n, A
  23. */
    ( K7 R* R7 Y: f
  24. 5 m+ R# A% l- ~& p4 u
  25. #include <linux/module.h>
    ( T. I; U; ?+ f* s( {2 E) w
  26. #include <linux/init.h>/ z: H& f- \2 W4 r0 \+ C4 u. }
  27. #include <linux/errno.h>
    * W2 T7 |8 F/ |
  28. #include <linux/types.h>8 W" f" y- Z& @
  29. #include <linux/interrupt.h>
    * F- U1 J3 K6 d( S* j! R/ @
  30. #include <asm/io.h>* f) G5 Y; `- b- i6 S: M; F0 q
  31. #include <linux/moduleparam.h>
    % S- I* @8 Y$ ~! L1 J# x
  32. #include <linux/sysctl.h>
    ' i+ I& x" G/ r4 d  V. D/ A6 w
  33. #include <linux/mm.h>4 L( d' x8 s% Y/ G4 n+ }  h
  34. #include <linux/dma-mapping.h>; [" o0 q2 ^) R
  35.   a( z2 ^# ^# `+ l) L3 ]
  36. #include <mach/memory.h>
      v) w; ]5 ?4 S' `+ m& p0 c
  37. #include <mach/hardware.h>3 p$ w% r4 S6 \: O: z- ]
  38. #include <mach/irqs.h>+ G1 v! j- c0 m9 m4 Y
  39. #include <asm/hardware/edma.h>
    6 m& {1 ~* S( ~' n1 _

  40. ) a: ?. T9 M$ ~( i+ m8 s
  41. #undef EDMA3_DEBUG
    5 p3 |+ ]. `" S" m/ T
  42. /*#define EDMA3_DEBUG*/% g( i; q6 i0 n; q' u4 d; J% T: |' g

  43.   V% R' ^* m, O% o! ~/ e
  44. #ifdef EDMA3_DEBUG
      `8 b8 B2 I3 I& H6 \" O* w+ x: b$ u
  45. #define DMA_PRINTK(ARGS...)  printk(KERN_INFO "<%s>: ",__FUNCTION__);printk(ARGS)! y8 z' W7 h% w( e! L
  46. #define DMA_FN_IN printk(KERN_INFO "[%s]: start\n", __FUNCTION__)
    / }' q9 y% d) j- O# v2 `
  47. #define DMA_FN_OUT printk(KERN_INFO "[%s]: end\n",__FUNCTION__)
    , G: E/ f' j3 Z) ~
  48. #else
    # a1 z3 Q1 [5 w7 b
  49. #define DMA_PRINTK( x... )! D, k1 }: \  U9 O0 Z
  50. #define DMA_FN_IN7 ^- J6 A* M' W; [" j
  51. #define DMA_FN_OUT
    : d  M% e; W6 v% g! A5 T5 e8 k
  52. #endif9 S$ x1 M6 R6 I# T9 o
  53. - o) W" B% ]9 o4 v5 b& k0 o
  54. #define MAX_DMA_TRANSFER_IN_BYTES   (32768)" n7 B2 \' }6 O% ?; L+ A& O
  55. #define STATIC_SHIFT                3# G+ l7 Y. P1 I9 t! S
  56. #define TCINTEN_SHIFT               201 G1 p) p8 |9 R# l. m; ]
  57. #define ITCINTEN_SHIFT              21: M2 M4 r* f; [5 i; N
  58. #define TCCHEN_SHIFT                22
    4 p' H  b# T4 d
  59. #define ITCCHEN_SHIFT               239 I; J1 t$ n) F
  60. * M1 {( J5 }) E% S6 x9 l/ H
  61. static volatile int irqraised1 = 0;
    2 R$ @! v' d( J. Y. \9 ~
  62. static volatile int irqraised2 = 0;' w# Q3 d5 m/ B7 P/ l
  63. # `9 ]2 w9 X$ N, _- J8 j7 y6 j$ A
  64. int edma3_memtomemcpytest_dma(int acnt, int bcnt, int ccnt, int sync_mode, int event_queue);
    ) d. b0 e" C! A1 f* c
  65. int edma3_memtomemcpytest_dma_link(int acnt, int bcnt, int ccnt, int sync_mode, int event_queue);0 f9 R. U  v6 w# f" A
  66. int edma3_memtomemcpytest_dma_chain(int acnt, int bcnt, int ccnt, int sync_mode, int event_queue);$ c8 G0 G, e$ S5 I1 O
  67. 1 H, V9 c0 b4 h
  68. dma_addr_t dmaphyssrc1 = 0;( M2 |- O2 D5 D2 m
  69. dma_addr_t dmaphyssrc2 = 0;! W" v: P% A& j4 e
  70. dma_addr_t dmaphysdest1 = 0;
      a& X" j; }" Z* G
  71. dma_addr_t dmaphysdest2 = 0;
    & _+ w" P4 x  s8 H) M3 p9 X( m( H% m
  72. $ t  L4 @; A9 j, O, q1 ^
  73. char *dmabufsrc1 = NULL;5 y1 S  M. F6 ?! {- O! I+ S
  74. char *dmabufsrc2 = NULL;2 \4 t5 U! G4 ~
  75. char *dmabufdest1 = NULL;
    0 }+ G$ s4 @6 w/ f3 R, x
  76. char *dmabufdest2 = NULL;
    8 c; N. g* _9 H- I; \+ g
  77.   ~0 e6 q1 ]4 c, M
  78. static int acnt = 512;
    9 }# k1 f3 B% z8 b/ ^" ~
  79. static int bcnt = 8;
    : n1 {- d$ C6 v: t" v6 Q+ E4 Q
  80. static int ccnt = 8;  [/ |# Z" p4 C6 |
  81. ; `& Q5 I6 o3 @* H; v
  82. module_param(acnt, int, S_IRUGO);
    * }; f; v1 f4 E" k6 N
  83. module_param(bcnt, int, S_IRUGO);. [8 z- x; A! W6 A2 y* D+ f
  84. module_param(ccnt, int, S_IRUGO);
复制代码
+ Z; {% |$ \6 V/ ^+ y6 ^- o2 f
. O0 F$ ?+ i( P8 E; y- G( n
      这是在TI上找到的一个针对Davanci处理器简单的EDMA3驱动程序测试例程的一部分,我在编译的过程中是用1 W, P6 l1 K0 X+ n
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% j- W7 `' W
     我想问一下如何用一个简单的程序来测试一下EDMA3的驱动。+ z5 l5 W8 @# l" q  |3 e

+ C7 q. w' y5 `: b$ k7 k
8 i. @$ a2 X  `
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 分享淘帖
回复

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2026-4-3 08:48 , Processed in 0.038977 second(s), 25 queries .

Powered by Discuz! X3.2

© 2001-2015 Comsenz Inc.

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