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

嵌入式开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

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

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

[复制链接]

5

主题

11

帖子

73

积分

注册会员

Rank: 2

积分
73
跳转到指定楼层
楼主
发表于 2018-1-30 11:01:43 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
本帖最后由 yyj 于 2018-1-30 11:01 编辑
# v$ j4 U! u& G. M/ J% L) g; o2 M# m
  1. [code]EDMA sample test application9 `* M9 y% g  b  \! H5 y
  2. /*" Q; Q6 m" W! ^9 `! ]/ P9 @/ f/ }
  3. * edma_test.c2 E3 F6 B. z3 {" c
  4. *
    - h2 \2 I' Z1 g9 Q8 A  \
  5. * brief  EDMA3 Test Application% k2 M3 C1 b9 j* R' P* _* n
  6. *$ }1 C  ?/ }& n+ X; J1 T
  7. *   This file contains EDMA3 Test code.
    9 D$ ?% s$ `' e! h6 @
  8. *" k7 w4 H  U4 Q3 P6 d3 L; u
  9. *   NOTE: THIS FILE IS PROVIDED ONLY FOR INITIAL DEMO RELEASE AND MAY BE
      ~2 |/ m" ?+ O9 T* t$ q% Z9 W# k
  10. *         REMOVED AFTER THE DEMO OR THE CONTENTS OF THIS FILE ARE SUBJECT; c. p. x# X  d6 G
  11. *         TO CHANGE.
    " W4 U' W, F7 @( t
  12. *. L7 r' c) Y! E7 k% X0 b& a
  13. * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
    # e5 V: a  i- B, N
  14. *" b. `& V2 _5 v( z+ H; P. i& F2 U
  15. * This program is free software; you can redistribute it and/or
    & z- g. Z* m& W' O1 k
  16. * modify it under the terms of the GNU General Public License as! m; c5 z% q7 i7 B' n, C
  17. * published by the Free Software Foundation version 2.
    # j, d- \& ?8 L
  18. *
    7 ?1 a- T) M4 i4 ]6 D3 S1 W, x
  19. * This program is distributed "as is" WITHOUT ANY WARRANTY of any( C3 ^  v( z- P- `) u0 H
  20. * kind, whether express or implied; without even the implied warranty4 x: B  y/ q1 \$ w8 S9 Q3 ^4 j
  21. * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    ; r# Q# e! Y2 O, P' D
  22. * GNU General Public License for more details.
    & N- }4 C7 n/ v8 L, _' n# {
  23. */3 R' @; [" O& b/ s- }0 T
  24. - c& ]1 I! Y7 |4 {$ b3 q
  25. #include <linux/module.h>  ?9 k: x. k5 P7 u) H% X
  26. #include <linux/init.h>8 Y6 }4 V( P3 k8 p+ C2 U
  27. #include <linux/errno.h>8 j6 Z/ C' H3 r& W
  28. #include <linux/types.h>
    $ F) a3 j: I2 y# G* R; ^0 r% }1 `- C
  29. #include <linux/interrupt.h>
    7 {" k3 K! g" ], g0 g
  30. #include <asm/io.h>) z5 U, e. M$ ^( {2 a
  31. #include <linux/moduleparam.h>
    % G0 j4 q0 v6 N, c
  32. #include <linux/sysctl.h>
    7 H7 [5 n9 m, I+ t  r9 i' D# u
  33. #include <linux/mm.h>
    % x2 b: l. J1 s
  34. #include <linux/dma-mapping.h>
    " O8 w9 X! K5 x  s1 T% [) N: _! y
  35. * v( V' M$ {" t( j9 D# |
  36. #include <mach/memory.h>
    6 E9 j0 s" p* F
  37. #include <mach/hardware.h>
    6 V( k* Z$ J0 O9 T+ F5 P* o
  38. #include <mach/irqs.h>
    % E3 c# F* L, n5 W
  39. #include <asm/hardware/edma.h>
    % ~6 N2 Y' ^3 Y' g* F/ K. a
  40. 8 V/ q0 S8 [+ U# l  [
  41. #undef EDMA3_DEBUG; e4 P: O2 s6 G- A
  42. /*#define EDMA3_DEBUG*/
    - z& j" v9 g( F7 v( q& p. u

  43. ' ?: \1 x; w6 I: C3 ]6 N
  44. #ifdef EDMA3_DEBUG
    2 b/ L8 D" P2 z; R  w; G; U: q
  45. #define DMA_PRINTK(ARGS...)  printk(KERN_INFO "<%s>: ",__FUNCTION__);printk(ARGS)
    9 j5 B$ t3 a3 {' U7 g
  46. #define DMA_FN_IN printk(KERN_INFO "[%s]: start\n", __FUNCTION__)
    ; z; J2 h' `2 g5 c$ s' q/ o
  47. #define DMA_FN_OUT printk(KERN_INFO "[%s]: end\n",__FUNCTION__)
    $ S& S- n0 z1 m- B' l% F) }2 @; U
  48. #else
    ' @. E: W8 p& |& t7 z" Z
  49. #define DMA_PRINTK( x... )" a3 P8 e: E0 X5 I8 i
  50. #define DMA_FN_IN  I2 ^* t" L) N$ K7 W4 F$ _
  51. #define DMA_FN_OUT/ J( j, o. K% l1 L. l
  52. #endif
    . J& ^" ~+ J* h! u* h
  53. ) w2 R- g0 [7 }- R
  54. #define MAX_DMA_TRANSFER_IN_BYTES   (32768)- _4 c2 Y0 u3 h, l
  55. #define STATIC_SHIFT                39 ^. `7 C& N" T* l  _( q* g- j
  56. #define TCINTEN_SHIFT               200 Y9 }; \3 o9 i- K  K5 p
  57. #define ITCINTEN_SHIFT              21* a4 p2 Q. O/ h- }8 E6 Z/ B
  58. #define TCCHEN_SHIFT                22
    # A$ }- K+ n% b+ Q6 x( e( k  C
  59. #define ITCCHEN_SHIFT               23' R  d$ V$ A2 M1 X8 V
  60. & H& i2 Z4 ?" u3 T3 C6 j
  61. static volatile int irqraised1 = 0;) C: Y4 v" e8 L: O! }( V2 ]- q
  62. static volatile int irqraised2 = 0;
    - p8 c+ S; ]$ A$ W2 Z% n
  63. ( \+ Q! c% ]9 h& j) l. A' e
  64. int edma3_memtomemcpytest_dma(int acnt, int bcnt, int ccnt, int sync_mode, int event_queue);
    ' ?4 n  w( {) ]2 c
  65. int edma3_memtomemcpytest_dma_link(int acnt, int bcnt, int ccnt, int sync_mode, int event_queue);
    # n/ n, l+ k& e7 ?& [8 x
  66. int edma3_memtomemcpytest_dma_chain(int acnt, int bcnt, int ccnt, int sync_mode, int event_queue);7 N- T6 F8 k) j
  67. ( \+ w, \$ @5 g: G
  68. dma_addr_t dmaphyssrc1 = 0;  [, {: x. T; w, a
  69. dma_addr_t dmaphyssrc2 = 0;
    # a) x1 n  E8 X
  70. dma_addr_t dmaphysdest1 = 0;5 M- G- P1 Z% d, G$ y* k% E% }0 m4 a
  71. dma_addr_t dmaphysdest2 = 0;. H- b) `% n" y- T

  72. , r; W3 o: G* I5 n' j! T8 D
  73. char *dmabufsrc1 = NULL;
    4 f4 G) N& s) g7 a9 i
  74. char *dmabufsrc2 = NULL;
    : H* `- v7 Z) B
  75. char *dmabufdest1 = NULL;
    9 G8 ?3 N8 z7 F
  76. char *dmabufdest2 = NULL;+ i& @7 C7 m& f, B9 e, o
  77. ( J( H; }8 P4 o  _7 X. m
  78. static int acnt = 512;+ N$ |9 n) V- g9 ?# R. j
  79. static int bcnt = 8;( o- j3 T. o1 O" z  G
  80. static int ccnt = 8;! e7 t' N0 }2 Q) s( D) e- u) L" j
  81. # e( I4 F' ?+ |6 j9 |# ^
  82. module_param(acnt, int, S_IRUGO);% N9 w4 x( I+ z1 Y6 B/ L' K
  83. module_param(bcnt, int, S_IRUGO);9 T! Q; Y$ Y' \2 U$ i. Z
  84. module_param(ccnt, int, S_IRUGO);
复制代码

/ b" `* ^5 \5 @; m
  Z6 G0 p/ _; T6 \      这是在TI上找到的一个针对Davanci处理器简单的EDMA3驱动程序测试例程的一部分,我在编译的过程中是用% z: D6 z& P/ k% k
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这个命令来链接库文件进行编译,但是报的错误特别多,我又试着一个函数一个函数往进加,仍然是很多错误。
% i. F: t' x9 D2 F     我想问一下如何用一个简单的程序来测试一下EDMA3的驱动。, `  @- I# p6 M- e+ a9 V

- b$ a! y# @, u3 j
  U8 b* {1 U0 _  m- m
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 分享淘帖
回复

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2026-3-14 08:54 , Processed in 0.039962 second(s), 25 queries .

Powered by Discuz! X3.2

© 2001-2015 Comsenz Inc.

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