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

嵌入式开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

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

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

[复制链接]

5

主题

11

帖子

73

积分

注册会员

Rank: 2

积分
73
跳转到指定楼层
楼主
发表于 2018-1-30 11:01:43 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
本帖最后由 yyj 于 2018-1-30 11:01 编辑
, a8 [+ R% h8 D0 s/ j2 [- r) F
  1. [code]EDMA sample test application7 p2 }7 {; d' H; p) m$ y7 [& X
  2. /*% m% K) f6 d- C, y/ r7 H
  3. * edma_test.c+ F7 V3 R1 S* _5 n4 h
  4. *4 n8 W+ B  r/ q6 M- G
  5. * brief  EDMA3 Test Application: j* [2 d) G2 d$ p! v3 `! O" f+ p
  6. */ ~( q; @" c, M2 E- _$ j
  7. *   This file contains EDMA3 Test code.
    / P% b* q% e; C5 Y  ?4 [
  8. *
    , s% Q# r: v. L. Q3 d
  9. *   NOTE: THIS FILE IS PROVIDED ONLY FOR INITIAL DEMO RELEASE AND MAY BE
    2 H8 N; N% T  m
  10. *         REMOVED AFTER THE DEMO OR THE CONTENTS OF THIS FILE ARE SUBJECT" f% C; O. F6 J% n7 w) L+ V
  11. *         TO CHANGE.
    & a8 `+ ]0 Z* h/ c5 p& v! e
  12. *
    9 v' X8 _7 P$ Q, h- W8 m+ k5 J
  13. * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/2 J% ?* g/ o" y9 k) d
  14. *
    * {% n' V2 d( @8 K# Y: G
  15. * This program is free software; you can redistribute it and/or
    7 P$ ~; f& c5 x7 p1 r
  16. * modify it under the terms of the GNU General Public License as
    : b7 E! ~3 A0 N5 Y, h  P
  17. * published by the Free Software Foundation version 2.0 x- q( R4 M* B9 g- ]+ D$ r: T1 Q
  18. *
    : O: z% n$ M' k) n
  19. * This program is distributed "as is" WITHOUT ANY WARRANTY of any
    ) S8 ~. n# t: h, F9 F- g9 r
  20. * kind, whether express or implied; without even the implied warranty) B( j+ O) N0 |" C5 r2 X0 \
  21. * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    - P) p" \( \3 \& ~' j; {
  22. * GNU General Public License for more details.
    7 r+ o/ V' S$ f
  23. */) x; b5 m  t% _. S4 N

  24. & \5 G, @! }) ]0 P4 p( C
  25. #include <linux/module.h>" F# W! m7 T/ |/ k5 i. L& P* ~
  26. #include <linux/init.h>( L+ m: F9 {- Y) e1 \0 W
  27. #include <linux/errno.h>$ l# e; {; H. [  G
  28. #include <linux/types.h>5 ~1 i  Q! }8 ?& S$ l( V
  29. #include <linux/interrupt.h>, F. T2 Y: M9 U' P
  30. #include <asm/io.h>( L. I( k' Q* O; ]
  31. #include <linux/moduleparam.h>
    1 R( j# h1 j8 \; P( o4 l8 r4 ^
  32. #include <linux/sysctl.h>% Q# o! k, ~8 U, O0 O
  33. #include <linux/mm.h>
    1 w% f' V; X; K0 }# ?
  34. #include <linux/dma-mapping.h>, `- G7 b  {- H( }% s$ O3 U

  35. , I) }4 ^# d3 P8 {/ H
  36. #include <mach/memory.h>
    0 G8 h' D1 W8 }5 F3 k# a
  37. #include <mach/hardware.h>
    2 w+ {; p' x; i7 K
  38. #include <mach/irqs.h>. v: J0 k" b2 B/ D
  39. #include <asm/hardware/edma.h>
    ; ?4 y/ U$ l4 ]+ `- [! a

  40. ) w9 ?, w1 O" x. ]
  41. #undef EDMA3_DEBUG" t+ O6 [; E5 k# E# o
  42. /*#define EDMA3_DEBUG*/4 m# d; q* N4 O

  43. ! f8 H5 X; X& t% i! i1 t5 {( i: i
  44. #ifdef EDMA3_DEBUG* G! }  j8 Q, I0 _
  45. #define DMA_PRINTK(ARGS...)  printk(KERN_INFO "<%s>: ",__FUNCTION__);printk(ARGS)2 w- n# u: m% `- q2 ^
  46. #define DMA_FN_IN printk(KERN_INFO "[%s]: start\n", __FUNCTION__)' F* |- g9 s, q7 U
  47. #define DMA_FN_OUT printk(KERN_INFO "[%s]: end\n",__FUNCTION__)
    " N, K) O' E- w' X( t2 d
  48. #else
    1 w/ \7 x7 x8 o8 ~' |3 X1 c
  49. #define DMA_PRINTK( x... )% t/ C! G- E, D; l/ O. m! T: T( [8 \
  50. #define DMA_FN_IN0 h7 L* I5 t5 O& z+ x/ L
  51. #define DMA_FN_OUT
    - h1 a  @4 P& s) }6 H: v
  52. #endif
    + J/ |# \+ ]. F6 z$ {+ k+ R$ y
  53. - Q# M2 C. S. o2 ?& t# e
  54. #define MAX_DMA_TRANSFER_IN_BYTES   (32768)
    $ e5 X' K8 f' B5 K  c' m# W8 f
  55. #define STATIC_SHIFT                3) S6 `9 J$ f: _2 }3 I' Q
  56. #define TCINTEN_SHIFT               20
      j& q" N' Z0 G; E; h5 e
  57. #define ITCINTEN_SHIFT              21
    ) _) W1 L  _( Q, m/ t6 y( o
  58. #define TCCHEN_SHIFT                22: D! P6 |7 O0 H8 W
  59. #define ITCCHEN_SHIFT               23# F2 k  Q# I! k$ O1 y# C8 M5 X1 L/ \
  60. : _3 s* _& _/ K: N- E3 y
  61. static volatile int irqraised1 = 0;8 n- ^* {5 x% O( i4 q
  62. static volatile int irqraised2 = 0;
    5 M8 ?7 s) B+ z: [8 |1 Q' g, j

  63. - k+ j; ^' R/ S1 h8 ^, e  [. M4 v
  64. int edma3_memtomemcpytest_dma(int acnt, int bcnt, int ccnt, int sync_mode, int event_queue);- _' f  l$ O; C# H" S
  65. int edma3_memtomemcpytest_dma_link(int acnt, int bcnt, int ccnt, int sync_mode, int event_queue);
    / a/ U$ j5 G, g$ j0 b
  66. int edma3_memtomemcpytest_dma_chain(int acnt, int bcnt, int ccnt, int sync_mode, int event_queue);( z: O: R0 O8 R! R; \" L- [4 L7 P

  67.   N; X- A2 C; h- X7 L; x
  68. dma_addr_t dmaphyssrc1 = 0;0 {/ w/ T$ ~8 G! E: S3 k
  69. dma_addr_t dmaphyssrc2 = 0;
    % G6 y6 Q2 ^- p3 N3 _
  70. dma_addr_t dmaphysdest1 = 0;
    2 H9 J- O) T1 h' n' A* V6 Y
  71. dma_addr_t dmaphysdest2 = 0;
    ) O  E3 X1 l- n1 p0 S
  72. 0 E$ F) ]0 T, Z5 w; A" t
  73. char *dmabufsrc1 = NULL;
    $ v2 k! O6 V) q- Q9 ]
  74. char *dmabufsrc2 = NULL;2 a; Q& G: y0 h' C2 P
  75. char *dmabufdest1 = NULL;
    8 N' _1 s/ {4 F5 c
  76. char *dmabufdest2 = NULL;
    1 [/ d; ]  v( _( c2 T$ H
  77. 8 R0 i& v; ~, P' W0 q
  78. static int acnt = 512;! a/ ?4 [$ @! U, b6 ]6 P* g
  79. static int bcnt = 8;
    4 o8 d8 \" j( m; c0 I2 C
  80. static int ccnt = 8;; h  J: g4 ~% ]( g# |$ m

  81. $ ^  X$ U' ?$ d' ^; o; X
  82. module_param(acnt, int, S_IRUGO);
    3 |0 L& W( U% ~- K
  83. module_param(bcnt, int, S_IRUGO);
    " P  X, F( U1 m3 Z. o" L
  84. module_param(ccnt, int, S_IRUGO);
复制代码
2 j0 \: O5 F' E7 w  l! r
: M% B9 U# l) s0 u/ H- Y" ]
      这是在TI上找到的一个针对Davanci处理器简单的EDMA3驱动程序测试例程的一部分,我在编译的过程中是用
, Q; M/ Q) J& ]2 Aarm-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这个命令来链接库文件进行编译,但是报的错误特别多,我又试着一个函数一个函数往进加,仍然是很多错误。
) r! |! i5 }" o* v) Y6 @     我想问一下如何用一个简单的程序来测试一下EDMA3的驱动。
  {; V! W! z' R9 Q& A( T9 m2 P; e1 U$ ]1 ]3 i5 ]1 R2 Z: j- U. z
# X( y6 Y' {' x
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 分享淘帖
回复

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2026-7-16 16:27 , Processed in 0.039790 second(s), 26 queries .

Powered by Discuz! X3.2

© 2001-2015 Comsenz Inc.

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