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

嵌入式开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

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

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

[复制链接]

5

主题

11

帖子

73

积分

注册会员

Rank: 2

积分
73
跳转到指定楼层
楼主
发表于 2018-1-30 11:01:43 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
本帖最后由 yyj 于 2018-1-30 11:01 编辑
7 ?7 O" w7 k% w- i- k! B
  1. [code]EDMA sample test application/ n; v/ x  C% [
  2. /*
    6 S; W5 }' a- t5 h
  3. * edma_test.c
    + T0 j( t% y4 @# B
  4. *  t& M! @% q5 ?0 B* S* Q
  5. * brief  EDMA3 Test Application
    3 M/ f. d& }1 v  l$ [& Q2 q
  6. *
    ) q& x4 K; C$ i
  7. *   This file contains EDMA3 Test code.2 f8 z/ d! d7 f0 g) a. R- t" v
  8. *
    # n  p4 q- G  @( M: [
  9. *   NOTE: THIS FILE IS PROVIDED ONLY FOR INITIAL DEMO RELEASE AND MAY BE
    % ^% ^& {* }8 c- Z0 E/ x
  10. *         REMOVED AFTER THE DEMO OR THE CONTENTS OF THIS FILE ARE SUBJECT9 i% x/ ]+ L; m/ W! Z( [
  11. *         TO CHANGE.3 J* S% h7 {( \; _, u
  12. *
    / T5 S8 W/ x- U/ T
  13. * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/* D/ ]+ E/ Y/ I+ g  g' {) G2 V$ O
  14. *
    0 w' r: E2 y7 n. ~# Q
  15. * This program is free software; you can redistribute it and/or1 ~. k. o, B* R- X) w
  16. * modify it under the terms of the GNU General Public License as
    ) t4 O, t" S3 s& i4 \
  17. * published by the Free Software Foundation version 2.! E, I! |! ?0 G  D
  18. *: o, q. K% Z. `! |, V
  19. * This program is distributed "as is" WITHOUT ANY WARRANTY of any8 L  V" P7 ^- F6 F3 p
  20. * kind, whether express or implied; without even the implied warranty, r- o4 K0 x2 E0 \! o
  21. * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    0 I1 x6 b& ]4 h1 }2 z7 w+ y+ S
  22. * GNU General Public License for more details.. C2 X! Y7 I, n& M: B
  23. */
    $ m2 Z# M: h) G  K5 ~, V
  24. ; g- z* T* O2 ?+ _4 W
  25. #include <linux/module.h>
    ' h+ S- Q" q) z$ z  g" r' e
  26. #include <linux/init.h>' ?# E- `( U4 |* T  ]8 {
  27. #include <linux/errno.h>
    $ ?. F, n& ?9 m3 M3 S
  28. #include <linux/types.h>5 ]: f7 @& L+ O  K7 a. ~+ z
  29. #include <linux/interrupt.h>1 U1 K6 ]& X( @5 x& {& M5 p0 [
  30. #include <asm/io.h>
    ! x! ^9 U' {, P6 u
  31. #include <linux/moduleparam.h>. G" \2 I, H" |. Q
  32. #include <linux/sysctl.h>: O8 b4 M& K- U; a
  33. #include <linux/mm.h>
    " m9 K- _0 B) ?% f. C1 p
  34. #include <linux/dma-mapping.h>0 W5 ^! f3 e0 O: s" ]  i% b
  35. " G, q- Q5 B" u2 _$ a; ?
  36. #include <mach/memory.h>  {: ]6 b' z1 W7 {! I7 a# y1 [# @
  37. #include <mach/hardware.h>; D. Z" P) _) _  W
  38. #include <mach/irqs.h>
    & S3 Y. D/ P1 f/ J' F" i) v6 V
  39. #include <asm/hardware/edma.h>1 m+ H: L& N4 `+ j8 T

  40. ; N7 [1 s3 X5 W! k( f& d0 o
  41. #undef EDMA3_DEBUG1 H& L% V, G! C8 C( c3 q
  42. /*#define EDMA3_DEBUG*/5 [# g( w2 V$ g" b8 z3 l
  43. 6 e0 O/ U( C( Y% d. B1 m
  44. #ifdef EDMA3_DEBUG" q" U" t5 q8 p$ }4 z! L6 S) Y
  45. #define DMA_PRINTK(ARGS...)  printk(KERN_INFO "<%s>: ",__FUNCTION__);printk(ARGS)
    4 ~6 M$ c6 q: {  W9 ?9 h
  46. #define DMA_FN_IN printk(KERN_INFO "[%s]: start\n", __FUNCTION__)" y$ ~6 x- t: Z6 i- F
  47. #define DMA_FN_OUT printk(KERN_INFO "[%s]: end\n",__FUNCTION__)
    6 D9 n0 Y" ]* }& G+ z2 w. o& ~
  48. #else
    ! Y- c. r! _) l1 ^/ \
  49. #define DMA_PRINTK( x... )
    # x* ?! e# r4 W" H3 o  _+ v9 a! \
  50. #define DMA_FN_IN
    $ ~) o% t4 x7 [; \8 y& X
  51. #define DMA_FN_OUT. _7 I/ D2 W9 {2 r: E
  52. #endif
    $ Y9 ]- E1 Z7 d/ Y& f8 T5 Z; K
  53. 2 l+ @3 K# k. T4 E
  54. #define MAX_DMA_TRANSFER_IN_BYTES   (32768)" z& X; \% t. q+ f% s8 T
  55. #define STATIC_SHIFT                3
    3 }1 ?  j* Y& X6 V1 U2 E; ?% E- w$ J
  56. #define TCINTEN_SHIFT               20& {; B# p1 z3 S" Y& P
  57. #define ITCINTEN_SHIFT              21
    1 {' ]9 Q4 i" J" P* V; {
  58. #define TCCHEN_SHIFT                228 b# c  n. z3 V( V7 r
  59. #define ITCCHEN_SHIFT               23
    2 U$ t& Q# T  y1 X$ H

  60. ' R$ _+ g8 L3 J) A3 o. L( G
  61. static volatile int irqraised1 = 0;+ n" G/ h0 J) T4 w& h! f
  62. static volatile int irqraised2 = 0;
    7 |& K& D5 N2 R' s4 U! e6 [  m

  63. - U( w' M# O. N, u
  64. int edma3_memtomemcpytest_dma(int acnt, int bcnt, int ccnt, int sync_mode, int event_queue);
    % @; }) N" y, P5 K) t+ _
  65. int edma3_memtomemcpytest_dma_link(int acnt, int bcnt, int ccnt, int sync_mode, int event_queue);
    & ], F$ H; x: c0 j, z' G2 Q
  66. int edma3_memtomemcpytest_dma_chain(int acnt, int bcnt, int ccnt, int sync_mode, int event_queue);4 U) Y" J' l5 p7 I2 i9 K% T
  67. 3 q' k9 \# X1 `& l5 M2 E
  68. dma_addr_t dmaphyssrc1 = 0;
    5 m- H. d% f' V- P
  69. dma_addr_t dmaphyssrc2 = 0;
    * f. u/ K  Z! f1 Q  }/ B: F
  70. dma_addr_t dmaphysdest1 = 0;# W; Q+ c* K9 N& L- I# c$ x. k
  71. dma_addr_t dmaphysdest2 = 0;
    1 o) x: A" n' n4 R0 \' n: ?" w

  72. * B6 U' s/ V& i& ~* i+ X
  73. char *dmabufsrc1 = NULL;2 q4 _; G7 z, ~! K5 a; u0 ]
  74. char *dmabufsrc2 = NULL;' O: M  u. }+ X
  75. char *dmabufdest1 = NULL;
    / ~5 ^5 Z# {. K  g; ~
  76. char *dmabufdest2 = NULL;
    " v( f( [( v, l  W
  77. / B, Q' ?" L  M2 D
  78. static int acnt = 512;) y/ c( p0 T% E9 c2 q# {: i
  79. static int bcnt = 8;
    & z  c3 O; A( N0 b
  80. static int ccnt = 8;  x+ M' ^) l( N# p- E1 |
  81. / ?5 o$ d. d  B: t3 J" E! h
  82. module_param(acnt, int, S_IRUGO);7 H' h# k7 S( B$ Q4 p( n! V4 M+ R
  83. module_param(bcnt, int, S_IRUGO);5 I3 K+ ?. V( @+ s+ k8 b! e
  84. module_param(ccnt, int, S_IRUGO);
复制代码
. D3 I) k5 V6 K2 ], K* B- A
1 T0 s. B  U+ s; n
      这是在TI上找到的一个针对Davanci处理器简单的EDMA3驱动程序测试例程的一部分,我在编译的过程中是用
9 C4 V/ p2 n2 @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这个命令来链接库文件进行编译,但是报的错误特别多,我又试着一个函数一个函数往进加,仍然是很多错误。: t4 d# Y1 M$ o
     我想问一下如何用一个简单的程序来测试一下EDMA3的驱动。
% _; a. Q3 T" N& v$ e- E3 y0 g0 `9 T; o5 Q
( \, Z6 R. k2 U: Y+ J& k7 s
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 分享淘帖
回复

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2026-11-8 07:16 , Processed in 0.040142 second(s), 26 queries .

Powered by Discuz! X3.2

© 2001-2015 Comsenz Inc.

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