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

嵌入式开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

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

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

[复制链接]

5

主题

11

帖子

73

积分

注册会员

Rank: 2

积分
73
跳转到指定楼层
楼主
发表于 2018-1-30 11:01:43 | 只看该作者 回帖奖励 |正序浏览 |阅读模式
本帖最后由 yyj 于 2018-1-30 11:01 编辑
& A& i. c/ h1 a$ X
  1. [code]EDMA sample test application" l9 b$ |3 q% N! I2 L- A4 D
  2. /*
    + e4 v3 I; A9 v# Z! D
  3. * edma_test.c
    9 H2 w& s* O( j
  4. */ G1 a  L) [% A( E( M7 `
  5. * brief  EDMA3 Test Application
    2 J5 ?5 C$ ^9 o, K1 y# P
  6. *
    ( G, E( ^8 F" m+ s, M
  7. *   This file contains EDMA3 Test code.; d+ l% A+ R" e- z' ]' O
  8. *
    9 U6 z/ v6 i' y1 Z7 c7 ^8 ^
  9. *   NOTE: THIS FILE IS PROVIDED ONLY FOR INITIAL DEMO RELEASE AND MAY BE' T7 r3 n: v6 I$ y
  10. *         REMOVED AFTER THE DEMO OR THE CONTENTS OF THIS FILE ARE SUBJECT1 I# d! n5 t1 y2 p4 h6 X0 g
  11. *         TO CHANGE./ j" ~" q) w1 I: E- N8 F
  12. *, e+ B) K* V9 b& ?' r
  13. * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
    * V- X& g" J, ~
  14. *8 i$ U. l6 l  X0 |9 @
  15. * This program is free software; you can redistribute it and/or
    " k# n- }5 U8 B: F( G+ V  q
  16. * modify it under the terms of the GNU General Public License as
    7 Y9 K  l$ I* B1 l1 ?
  17. * published by the Free Software Foundation version 2.& ]2 z1 P. E1 [* ~% A9 z) k2 \; S
  18. *
    + R% p5 N" A, X3 F% w
  19. * This program is distributed "as is" WITHOUT ANY WARRANTY of any
    % M7 ]8 V4 _; e* h4 h6 z7 W
  20. * kind, whether express or implied; without even the implied warranty9 ]( B5 x4 g3 _5 f; o
  21. * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the9 ]+ z5 U3 t! h
  22. * GNU General Public License for more details./ h# Y% R% Z" T. A& H* i* l
  23. */
    / C; H3 i' y% h: L
  24. . V2 `/ ]1 L4 Z1 Z6 A1 \
  25. #include <linux/module.h>
    0 ?8 |: h* S9 U7 K: |. _6 B
  26. #include <linux/init.h>9 O# A7 D: w4 [3 v* ]" A  g; r# z' H* \- O
  27. #include <linux/errno.h>
    9 F6 g, |5 a6 m' q" O9 g$ p5 ]: y# a
  28. #include <linux/types.h>
    , y8 _' g7 S5 T# v1 ^
  29. #include <linux/interrupt.h>
    " o8 I% p7 X! ]) U* t( n. v
  30. #include <asm/io.h>6 I" h- I" [, ^" c6 f) C* I
  31. #include <linux/moduleparam.h>" j9 b3 u) A& `3 W; f
  32. #include <linux/sysctl.h>
    + X& A% Q1 H5 L) z+ x
  33. #include <linux/mm.h>
    4 ]4 G9 L8 q6 n+ o, T0 N
  34. #include <linux/dma-mapping.h>) P( w9 @) k+ X3 ^8 M* i
  35. ) M, _8 Z0 l9 z1 o! x' O( z% @* d  |
  36. #include <mach/memory.h>
    0 j  I. B2 b4 Y  [
  37. #include <mach/hardware.h>  i8 T( |. s6 d8 A4 O' P( B2 B
  38. #include <mach/irqs.h>& W0 d; ]. i% o! ?6 U
  39. #include <asm/hardware/edma.h>
    # ?9 L) z; x5 `( s$ @5 w4 k9 S

  40.   V1 W) S4 }* n3 ~
  41. #undef EDMA3_DEBUG
    ( i& ?9 ^( B8 P2 r
  42. /*#define EDMA3_DEBUG*/. p' f) D: k. G" k; v: i6 B
  43. & T/ D# ?# b( Q, y& [2 F
  44. #ifdef EDMA3_DEBUG2 V* b; M) `6 S9 B4 w
  45. #define DMA_PRINTK(ARGS...)  printk(KERN_INFO "<%s>: ",__FUNCTION__);printk(ARGS); S; P8 c9 v6 \% @) o
  46. #define DMA_FN_IN printk(KERN_INFO "[%s]: start\n", __FUNCTION__)" n. T, O9 w, B7 r$ j1 }
  47. #define DMA_FN_OUT printk(KERN_INFO "[%s]: end\n",__FUNCTION__); j0 t9 X' f. m; Y1 j. f; N5 u# Z; q
  48. #else
    : k; @; s1 O: t1 h' d
  49. #define DMA_PRINTK( x... )+ \- N0 r) k5 Q: t5 x: n' V) v
  50. #define DMA_FN_IN% X2 l7 J  o$ T. u; _- |& ?0 p- w
  51. #define DMA_FN_OUT# e1 I4 {2 r( Z6 ^+ h
  52. #endif
    6 \& e6 [+ i& S
  53. 2 ^8 I1 X" g+ K; E
  54. #define MAX_DMA_TRANSFER_IN_BYTES   (32768)& F4 V/ m6 V4 ?, b  i: u6 n; N7 y
  55. #define STATIC_SHIFT                3) l3 O/ e) n( b' T' x# V
  56. #define TCINTEN_SHIFT               20
    5 `+ H) H2 m5 M7 ^
  57. #define ITCINTEN_SHIFT              21( r8 g/ |8 {! N" O/ M1 C( Q
  58. #define TCCHEN_SHIFT                22, Q/ a2 E# {. y9 R, F
  59. #define ITCCHEN_SHIFT               23# j% w7 p" E8 q: W1 M

  60. 4 T+ a: x/ i* h) K' G
  61. static volatile int irqraised1 = 0;" \5 v& L" k$ ~5 f2 Y& p# ~
  62. static volatile int irqraised2 = 0;
    ' h/ B5 @& H( Q

  63. $ P% ?, T7 o* o$ ?- |* E2 x$ m
  64. int edma3_memtomemcpytest_dma(int acnt, int bcnt, int ccnt, int sync_mode, int event_queue);
    " \; H4 D' y4 c5 k! ]9 S2 v
  65. int edma3_memtomemcpytest_dma_link(int acnt, int bcnt, int ccnt, int sync_mode, int event_queue);
    1 F9 a" B) g. \) T# P, |- ^8 Z
  66. int edma3_memtomemcpytest_dma_chain(int acnt, int bcnt, int ccnt, int sync_mode, int event_queue);8 `( ^4 H5 K5 K) X" d% z1 p7 \' _

  67. - Q% P& N3 h' h% F' [4 z( h
  68. dma_addr_t dmaphyssrc1 = 0;
    & ]( U' C# S- L( Y
  69. dma_addr_t dmaphyssrc2 = 0;  D5 ^2 t1 h" E. q7 {6 R- B
  70. dma_addr_t dmaphysdest1 = 0;
    - v, H: L. n$ R* M( t
  71. dma_addr_t dmaphysdest2 = 0;
    9 j! e; C1 U. q/ d3 s: D0 ?& y/ i. P
  72. 7 m% r: u) X* h( j* |0 T6 N! g
  73. char *dmabufsrc1 = NULL;
    2 |7 d* g5 ~5 v* f' _& i* |
  74. char *dmabufsrc2 = NULL;
    : ?7 |, j6 k9 r: B& H
  75. char *dmabufdest1 = NULL;
    - u7 Y0 [% t5 e* l& }% Y$ F5 V
  76. char *dmabufdest2 = NULL;
    : s, E( ?; A' G/ J) c
  77. 0 m9 d, s' x' _+ b' x+ C
  78. static int acnt = 512;
    $ u6 c( s- B6 h# g& B0 f* Z( k
  79. static int bcnt = 8;
      n) ?( |1 w& b2 W( b. W" P3 v
  80. static int ccnt = 8;
    ! o: b' |- d  W" `! L+ m$ I
  81. : s3 Z' j6 G  F5 d$ F" o2 G
  82. module_param(acnt, int, S_IRUGO);% a; W7 v) x5 ]" w5 x2 B
  83. module_param(bcnt, int, S_IRUGO);
    ) h- k0 C# A4 ~4 N3 s7 K  i
  84. module_param(ccnt, int, S_IRUGO);
复制代码

, ]8 o* r6 U! M- n: \6 {: D
* [5 l1 T9 D  W9 A      这是在TI上找到的一个针对Davanci处理器简单的EDMA3驱动程序测试例程的一部分,我在编译的过程中是用
* Z0 Z4 X' @! i* Karm-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这个命令来链接库文件进行编译,但是报的错误特别多,我又试着一个函数一个函数往进加,仍然是很多错误。/ u- E6 c; b$ e- S# A5 p2 M
     我想问一下如何用一个简单的程序来测试一下EDMA3的驱动。
9 J! A$ K4 ^( m6 w1 Z1 k. ?/ L' Q0 M& B! X& K

/ M8 m* y  s) _- Y4 u
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 分享淘帖
回复

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2026-1-28 13:15 , Processed in 0.039973 second(s), 26 queries .

Powered by Discuz! X3.2

© 2001-2015 Comsenz Inc.

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