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

嵌入式开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

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

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

[复制链接]

5

主题

11

帖子

73

积分

注册会员

Rank: 2

积分
73
跳转到指定楼层
楼主
发表于 2018-1-30 11:01:43 | 只看该作者 回帖奖励 |正序浏览 |阅读模式
本帖最后由 yyj 于 2018-1-30 11:01 编辑
, p0 W' @! c/ |
  1. [code]EDMA sample test application' H: ^9 s6 n4 k0 ?) I
  2. /*6 A- b6 a+ l( n, ^& U
  3. * edma_test.c) E2 S% q. z! I0 X6 M
  4. */ q7 a% M3 S! H
  5. * brief  EDMA3 Test Application
    3 V0 P! C, q2 a6 k, _+ |
  6. *4 D. c! ]" ~- \
  7. *   This file contains EDMA3 Test code.
    / ^. N; X. l" j" e" K& b' ?, ?
  8. *  S; s, J) R2 N- s( b+ N$ r5 F
  9. *   NOTE: THIS FILE IS PROVIDED ONLY FOR INITIAL DEMO RELEASE AND MAY BE
    / E2 S( v4 a2 q2 a: _' U; [
  10. *         REMOVED AFTER THE DEMO OR THE CONTENTS OF THIS FILE ARE SUBJECT. o" O1 l/ w7 a# n0 g
  11. *         TO CHANGE.
    * b7 O1 F4 L9 s  `3 }
  12. *
    5 x" z% ?6 c5 K- c$ [
  13. * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/: E8 g7 B* C/ G, l5 _0 N% J( I
  14. *
    , C+ L- ~1 H5 H. Q3 r- \  h2 x4 Z
  15. * This program is free software; you can redistribute it and/or) m6 n& b% O: F. J
  16. * modify it under the terms of the GNU General Public License as! r) m# k# ~/ a
  17. * published by the Free Software Foundation version 2.
    # p$ g% ?/ M- B" @2 B
  18. *' ?8 M$ Z6 B+ H
  19. * This program is distributed "as is" WITHOUT ANY WARRANTY of any: [/ |2 Z9 w: U) F5 ?5 j2 y1 `8 M* f
  20. * kind, whether express or implied; without even the implied warranty/ S: t  ~' [: p: y  d, r
  21. * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the% J8 P' N( r' r8 q
  22. * GNU General Public License for more details.2 r+ |" ]2 L: K" `6 v! E8 i
  23. */: X5 Y7 x- e9 o8 y
  24. % H/ e) j' a- _) |, C; b1 O7 x
  25. #include <linux/module.h>. T5 d  Y- u' L
  26. #include <linux/init.h>% t: k" u1 n0 L
  27. #include <linux/errno.h>
    $ S' S- [% B% y" M( ]" d
  28. #include <linux/types.h>" ^/ _9 j% X2 Y5 W! D5 u
  29. #include <linux/interrupt.h>1 @3 m! B* a7 j
  30. #include <asm/io.h>& K* `0 Q% c( I0 ?% _' I! K
  31. #include <linux/moduleparam.h>
    . L; C) @0 ^1 ]
  32. #include <linux/sysctl.h>
    , R) a, O- A/ @1 @6 }
  33. #include <linux/mm.h>
    & t5 w5 _! j4 P! U, i
  34. #include <linux/dma-mapping.h>9 s- U! y  w( U6 z  p& ]: F
  35. ! m# P1 c1 ]2 E: ~+ p. c  B- D
  36. #include <mach/memory.h>7 w+ X5 u2 F" _$ s" W: V  R
  37. #include <mach/hardware.h>
    ; ]9 w. e0 Q% d% c# p
  38. #include <mach/irqs.h>1 b% e9 ^3 ?9 ?( n: Q6 V6 C0 p
  39. #include <asm/hardware/edma.h># Q* _$ C# d9 C3 r$ x% J

  40. ) l  C9 D2 `$ t9 H
  41. #undef EDMA3_DEBUG. |/ l: d) v6 }5 P( o  H
  42. /*#define EDMA3_DEBUG*/5 }7 N3 ?7 n: e( a, |
  43. 0 ~9 h: m% v! o" c
  44. #ifdef EDMA3_DEBUG' S' R8 |2 U" |' d6 ~
  45. #define DMA_PRINTK(ARGS...)  printk(KERN_INFO "<%s>: ",__FUNCTION__);printk(ARGS)
    % C) t1 ]% G# ?  i8 k9 U% G- w
  46. #define DMA_FN_IN printk(KERN_INFO "[%s]: start\n", __FUNCTION__)
    2 Y# ~4 i9 |# n2 s. K1 i
  47. #define DMA_FN_OUT printk(KERN_INFO "[%s]: end\n",__FUNCTION__)
    5 J" h7 R" e1 _
  48. #else
    " y2 u: e+ A: B
  49. #define DMA_PRINTK( x... )- G: M/ M/ w9 @$ Y
  50. #define DMA_FN_IN
    0 n, g0 H/ {) h1 Y; B, A1 p
  51. #define DMA_FN_OUT+ L( Y$ a0 n! H7 R- k
  52. #endif
    & ~5 D4 Y3 h" l8 ?4 M7 ~

  53. ! H6 G. r  }# b( E3 i8 p' p
  54. #define MAX_DMA_TRANSFER_IN_BYTES   (32768)
    2 [, u, M0 j" t( b, ^' I2 o
  55. #define STATIC_SHIFT                3$ p, |: g: S( F
  56. #define TCINTEN_SHIFT               20
    " e) X* ]  \4 V3 @2 k+ L
  57. #define ITCINTEN_SHIFT              21
    : k0 R9 A9 o7 T& k
  58. #define TCCHEN_SHIFT                22
    & q0 G; L  k& q' j7 D9 M+ Q
  59. #define ITCCHEN_SHIFT               23
    , {. x, p4 l- `7 ~- w* w

  60. " |! E( @( P. w, p
  61. static volatile int irqraised1 = 0;, L% e# K# D9 f+ h+ m) t) {
  62. static volatile int irqraised2 = 0;
    0 g+ v, c, V# ~' I2 I
  63. 5 P2 c# A  O/ B& s6 ^6 }
  64. int edma3_memtomemcpytest_dma(int acnt, int bcnt, int ccnt, int sync_mode, int event_queue);
    5 s. \4 a. y3 n) G# _
  65. int edma3_memtomemcpytest_dma_link(int acnt, int bcnt, int ccnt, int sync_mode, int event_queue);
    7 X2 h3 k+ }! ^; d) P( b" ^4 p& {
  66. int edma3_memtomemcpytest_dma_chain(int acnt, int bcnt, int ccnt, int sync_mode, int event_queue);
    % T% y9 ]% F, M0 x% E$ n% {: Z- J
  67. ( c) a4 Q$ i. f
  68. dma_addr_t dmaphyssrc1 = 0;
    & R, Y  d" W7 Y& ?: q9 B' o8 e. {
  69. dma_addr_t dmaphyssrc2 = 0;+ b; W8 N7 V4 _- n
  70. dma_addr_t dmaphysdest1 = 0;* Y& t5 _- _* j3 q- o4 d. r5 {+ r* c
  71. dma_addr_t dmaphysdest2 = 0;
    0 i" j$ {. {- j
  72. ; Z, ?0 s+ Y) n& p2 X& I6 n( Z
  73. char *dmabufsrc1 = NULL;3 y, }& U: z4 B+ D# Z4 \! u, M
  74. char *dmabufsrc2 = NULL;1 S( `- f! N/ L0 F
  75. char *dmabufdest1 = NULL;
    2 e0 E- v0 [" o( S8 T5 a$ K
  76. char *dmabufdest2 = NULL;  ~6 O* W  K+ t- c: }* c
  77. 8 e9 e% ]/ J# H. A
  78. static int acnt = 512;
    % X. g- i8 P2 q) S
  79. static int bcnt = 8;
    ! @) |: ]: D! x& t
  80. static int ccnt = 8;
    9 D2 T9 L& u1 D7 C1 z: S% _

  81. ) `9 t/ u9 L8 u
  82. module_param(acnt, int, S_IRUGO);: O2 F1 \! |6 E  T1 Q
  83. module_param(bcnt, int, S_IRUGO);
    $ [9 M/ e3 s  v, B" y8 _* Y
  84. module_param(ccnt, int, S_IRUGO);
复制代码
$ Q9 J$ Y' h6 ?0 [* S

3 ]) d, O7 _+ {1 p( V& C      这是在TI上找到的一个针对Davanci处理器简单的EDMA3驱动程序测试例程的一部分,我在编译的过程中是用0 h. b3 ^0 M- `
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这个命令来链接库文件进行编译,但是报的错误特别多,我又试着一个函数一个函数往进加,仍然是很多错误。% y; x; b% i( @0 j, p& ]
     我想问一下如何用一个简单的程序来测试一下EDMA3的驱动。, c; l+ ^7 }7 r' M5 P2 j" c  d& y

2 F7 v4 w5 d3 I4 i2 n" r) `) n
( |4 A9 I7 p  Y. r" Q- y  U9 e
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 分享淘帖
回复

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2026-3-1 20:41 , Processed in 0.038889 second(s), 26 queries .

Powered by Discuz! X3.2

© 2001-2015 Comsenz Inc.

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