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

嵌入式开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

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

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

[复制链接]

5

主题

11

帖子

73

积分

注册会员

Rank: 2

积分
73
跳转到指定楼层
楼主
发表于 2018-1-30 11:01:43 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
本帖最后由 yyj 于 2018-1-30 11:01 编辑
+ e- P: a) {% f8 Z
  1. [code]EDMA sample test application- N) C+ B& A+ y, C
  2. /*6 k% t( j2 `- j# p  K/ W3 ]) T
  3. * edma_test.c& h# u# P* A6 U9 |& _
  4. *) Q& a; |2 e5 }  J
  5. * brief  EDMA3 Test Application
    $ E4 Y; p0 O7 U9 d5 N; b
  6. *
    3 i% W& X, g) _  n
  7. *   This file contains EDMA3 Test code.2 J& @, z1 `1 H2 r6 }" _
  8. *4 c! i5 o% a2 s/ C% T3 }, ^
  9. *   NOTE: THIS FILE IS PROVIDED ONLY FOR INITIAL DEMO RELEASE AND MAY BE
    ! n, L7 X, p' N4 A
  10. *         REMOVED AFTER THE DEMO OR THE CONTENTS OF THIS FILE ARE SUBJECT3 O, u) Y* F% R5 k; J/ M  u* q
  11. *         TO CHANGE.( ~" Y/ i: h# a, M" v/ A) [
  12. ** j- ~. f( J% Y7 Z  _; L4 p
  13. * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
      l; k- `8 K: R$ m0 E" y
  14. *
    - {( a" o- f1 j6 U) v
  15. * This program is free software; you can redistribute it and/or+ b% J) k( ]$ z9 O5 o
  16. * modify it under the terms of the GNU General Public License as( F: F& ^3 D# N9 _& z2 o8 z
  17. * published by the Free Software Foundation version 2.0 \* g4 f, S3 C
  18. *
    3 y' M0 `. v5 a% e" K6 v
  19. * This program is distributed "as is" WITHOUT ANY WARRANTY of any0 Z$ k. p) d5 L! M  L' t2 a
  20. * kind, whether express or implied; without even the implied warranty
    ; g) H5 H5 p0 j" x% s( |" I% F9 G
  21. * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the: z  f8 }1 O, q4 g  u
  22. * GNU General Public License for more details.
    2 P# J  A7 L8 C0 X
  23. */
    % X2 p1 u4 x; y/ ~  e

  24. 9 j* u# Y% T; e/ @5 k( V
  25. #include <linux/module.h>& k( C% v. p7 j& ~0 d- P& P
  26. #include <linux/init.h>
    $ q9 @+ z- P3 h9 M$ |4 ~! ?1 y! |
  27. #include <linux/errno.h>) w# E* L3 t! N1 C1 U+ x& F
  28. #include <linux/types.h>
    * j1 V) A$ l) {) S" `# p" N
  29. #include <linux/interrupt.h>
    4 }4 \) E  I$ a6 i, g/ g
  30. #include <asm/io.h>
    4 U$ f' }4 v, A0 u7 f
  31. #include <linux/moduleparam.h>
    5 b2 y. Q8 c/ B7 [% C8 d/ c% k
  32. #include <linux/sysctl.h>1 M, v1 p0 X) Q- n! M* m, |
  33. #include <linux/mm.h>3 U$ [: @- ^  I# c4 [) r* e
  34. #include <linux/dma-mapping.h>: F. L% `2 K- [

  35. * K/ i& k% q+ v* i2 C$ T3 ~
  36. #include <mach/memory.h>/ \) p0 j' |+ s/ R4 A
  37. #include <mach/hardware.h>
    " |2 ~* f7 r/ u; y
  38. #include <mach/irqs.h>) G6 V4 @9 H6 R& C5 E. h
  39. #include <asm/hardware/edma.h>
    5 [' N" K, w4 }0 _# D
  40. 8 Q, m' Y- [. S) m& v: @
  41. #undef EDMA3_DEBUG
    . E$ `3 c& H1 H) d. T
  42. /*#define EDMA3_DEBUG*/7 E5 A7 @$ B' r8 S

  43. " `: s( c) V5 c" f0 h/ h0 C+ r8 |
  44. #ifdef EDMA3_DEBUG; q+ W5 H! F- D% a2 q' v7 A# w
  45. #define DMA_PRINTK(ARGS...)  printk(KERN_INFO "<%s>: ",__FUNCTION__);printk(ARGS)& t/ P6 N0 ?- g& @
  46. #define DMA_FN_IN printk(KERN_INFO "[%s]: start\n", __FUNCTION__)/ T5 _- U" e) C" }+ Q# f
  47. #define DMA_FN_OUT printk(KERN_INFO "[%s]: end\n",__FUNCTION__)
    8 m. a  Q" V4 c1 X+ F
  48. #else( T# a- G) R* X4 [+ c! u' q7 H
  49. #define DMA_PRINTK( x... )6 A2 p2 q3 t# j7 {6 c; P; A4 b  M( i
  50. #define DMA_FN_IN4 {7 k* C4 o0 @5 E
  51. #define DMA_FN_OUT
    ) Z  Q/ X% J; h; G6 M
  52. #endif
    : F4 v- e2 C( s  a" X/ z# G  q
  53. & B7 o8 a+ q7 B' e+ f4 E. M
  54. #define MAX_DMA_TRANSFER_IN_BYTES   (32768)1 E$ c. `9 x6 t
  55. #define STATIC_SHIFT                3
    4 s' _5 ^' L0 j" C, j/ n+ {  w
  56. #define TCINTEN_SHIFT               207 r; y* K2 q# \7 |! r
  57. #define ITCINTEN_SHIFT              219 D3 P: Z+ u& b. a: F8 z( ]
  58. #define TCCHEN_SHIFT                22
    " I: w% e9 {3 m# E6 N
  59. #define ITCCHEN_SHIFT               23
    / [% x( ~6 J4 K) x, R  B
  60.   C5 A& G8 v/ j1 f/ G; y
  61. static volatile int irqraised1 = 0;( ^1 p# R$ q! o5 H0 P9 \; j% w
  62. static volatile int irqraised2 = 0;
    / j( S8 F4 c& R+ I' C( K" G: t5 h

  63. 1 M4 g) G/ |/ b' N
  64. int edma3_memtomemcpytest_dma(int acnt, int bcnt, int ccnt, int sync_mode, int event_queue);
    , ~" z3 l/ _! q. X$ U1 z& `3 V1 v
  65. int edma3_memtomemcpytest_dma_link(int acnt, int bcnt, int ccnt, int sync_mode, int event_queue);
    5 F  A% t8 f" Y" _3 z0 F) o5 v
  66. int edma3_memtomemcpytest_dma_chain(int acnt, int bcnt, int ccnt, int sync_mode, int event_queue);. E4 K) n. u% S/ `* ~7 U$ N: O" w, |2 g

  67. 3 _- J" L# ~) Z% F
  68. dma_addr_t dmaphyssrc1 = 0;' @/ [3 x9 E  J9 g$ r& y& g2 S# t! o
  69. dma_addr_t dmaphyssrc2 = 0;
    . }9 E8 t" L; Y; n7 R9 M
  70. dma_addr_t dmaphysdest1 = 0;2 l' [/ i9 @/ |, j7 Q7 U* ?
  71. dma_addr_t dmaphysdest2 = 0;; J$ ]' ^" H; b/ C) D% u/ A' h( R

  72. . w9 e. f. ?% }
  73. char *dmabufsrc1 = NULL;
    9 _) [. f$ Y$ u- I! I- B0 p
  74. char *dmabufsrc2 = NULL;
      y& c$ @4 W3 Y7 c1 F2 V" G
  75. char *dmabufdest1 = NULL;
    ) P: o* y. k/ y# A
  76. char *dmabufdest2 = NULL;. q) ?: B0 B4 K" j1 O0 s2 ?
  77. 1 x" l5 l3 I7 a9 _# a/ B, M
  78. static int acnt = 512;, o. a% @& c7 E5 s) ^8 `1 s" k# @
  79. static int bcnt = 8;
    " m6 p* r% j: ]9 O# Q
  80. static int ccnt = 8;" g, e. k; V; x3 }. k* {

  81.   r" y: n# Y5 G1 S* R& a8 I
  82. module_param(acnt, int, S_IRUGO);
    ' P7 B) r# M, x( G
  83. module_param(bcnt, int, S_IRUGO);
    9 P: N; v+ b# m# d% X
  84. module_param(ccnt, int, S_IRUGO);
复制代码
$ Z6 ^: B; A& u* v
0 t* w- T, n0 r" M
      这是在TI上找到的一个针对Davanci处理器简单的EDMA3驱动程序测试例程的一部分,我在编译的过程中是用1 a' L$ b& g. t& X
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这个命令来链接库文件进行编译,但是报的错误特别多,我又试着一个函数一个函数往进加,仍然是很多错误。1 h4 {' \2 y; b8 k4 u
     我想问一下如何用一个简单的程序来测试一下EDMA3的驱动。0 q4 ]" O% U( C  p1 d% |+ a
. K9 M- Y: ]: w0 Q, m
5 a- u- [. f9 a; p8 E5 |
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 分享淘帖
回复

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2026-1-25 14:07 , Processed in 0.041438 second(s), 26 queries .

Powered by Discuz! X3.2

© 2001-2015 Comsenz Inc.

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