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

嵌入式开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

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

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

[复制链接]

5

主题

11

帖子

73

积分

注册会员

Rank: 2

积分
73
跳转到指定楼层
楼主
发表于 2018-1-30 11:01:43 | 只看该作者 回帖奖励 |正序浏览 |阅读模式
本帖最后由 yyj 于 2018-1-30 11:01 编辑 / U* f4 T! G9 s; l# ~8 E  R
  1. [code]EDMA sample test application' x7 j& |" c4 J/ R6 N
  2. /*
    6 t, h( J* ~7 p: T9 ?
  3. * edma_test.c
    $ ^' E6 {# F' n- A9 H( }2 n
  4. *
    # t' u( o* R! l$ z. V  R
  5. * brief  EDMA3 Test Application
    5 G- [) G' n& w0 T0 x1 W
  6. *
    ( m; A% n# p- b: K. f6 p
  7. *   This file contains EDMA3 Test code.0 u$ R0 a7 [$ Y& L: ]
  8. *& d( `, a# l3 F2 N9 s. E7 u
  9. *   NOTE: THIS FILE IS PROVIDED ONLY FOR INITIAL DEMO RELEASE AND MAY BE
    ) I( K  ]& M8 P- W
  10. *         REMOVED AFTER THE DEMO OR THE CONTENTS OF THIS FILE ARE SUBJECT5 W2 h1 [2 `9 d. I0 X) H
  11. *         TO CHANGE.% ^0 u' h: g0 M- Z
  12. *
    9 g& ~( a+ n, Y! D
  13. * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/4 v( g( w- ^! _. k  p
  14. *4 j5 |7 w# e# z! l8 K4 e$ _
  15. * This program is free software; you can redistribute it and/or
    7 _7 e6 [7 G% v
  16. * modify it under the terms of the GNU General Public License as
    - B% X% L  x0 K2 j$ F. v. Y& o( [( U
  17. * published by the Free Software Foundation version 2.
    . t3 t8 @0 h3 j( A' n& E
  18. *
    1 M& ]9 R7 v  m! c" Q  Q% ~% ?. h
  19. * This program is distributed "as is" WITHOUT ANY WARRANTY of any
    1 g  o/ f) S6 ]$ e) d3 }
  20. * kind, whether express or implied; without even the implied warranty
    2 V2 |3 A0 L6 E; R6 C8 S
  21. * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the5 {$ F8 I! `% y9 Z* W
  22. * GNU General Public License for more details.
    - b& k) Y* ?+ b1 T; {
  23. */
    $ O- r. }7 V* i! _6 A4 T

  24. - T# K; K9 J- ^2 n/ t
  25. #include <linux/module.h>
      r+ p1 |! W" j+ L
  26. #include <linux/init.h>! T% e$ _  d) j8 c
  27. #include <linux/errno.h>5 i& m) g& k; H+ z& Q
  28. #include <linux/types.h>
    0 f- o7 R2 K" q
  29. #include <linux/interrupt.h>. k  Z: G* K7 l4 J% b/ M& T# S
  30. #include <asm/io.h>
    ' p" w1 m, [' h
  31. #include <linux/moduleparam.h>' ?) W& K8 o$ k
  32. #include <linux/sysctl.h>" j9 U( y, A% c3 A
  33. #include <linux/mm.h>4 b9 F. R* a' R, S
  34. #include <linux/dma-mapping.h>
    4 I1 f% {0 f" w

  35. ( H3 u# H, K7 e: a, v
  36. #include <mach/memory.h>, Y4 M8 H# p0 d/ Y. j
  37. #include <mach/hardware.h>
    " b- v& P: F! n# |
  38. #include <mach/irqs.h>
    + h" p" `- K/ l, z1 U- z0 v
  39. #include <asm/hardware/edma.h>
    " k* @: {; p9 }5 G5 L2 P. P

  40. / G' G  H$ A4 Q
  41. #undef EDMA3_DEBUG! i/ z7 f8 @- z& C4 d5 L* C. g
  42. /*#define EDMA3_DEBUG*/
    6 n" S1 z9 @. M( H* {
  43. 7 a  h- @0 M  e1 d
  44. #ifdef EDMA3_DEBUG, R0 X  K* b6 w) t, D% i
  45. #define DMA_PRINTK(ARGS...)  printk(KERN_INFO "<%s>: ",__FUNCTION__);printk(ARGS)( I$ M# v+ K+ q
  46. #define DMA_FN_IN printk(KERN_INFO "[%s]: start\n", __FUNCTION__)
    " W: O0 J2 H2 I$ b
  47. #define DMA_FN_OUT printk(KERN_INFO "[%s]: end\n",__FUNCTION__)' i" \' Y- S( I7 [+ [0 w
  48. #else4 K! i3 B) W* t
  49. #define DMA_PRINTK( x... )2 s, n. ?8 A4 X& ^2 t  f# B
  50. #define DMA_FN_IN! |4 @3 x) y' F4 U5 Q
  51. #define DMA_FN_OUT( w/ H' ?7 I( H& J" v; Z$ A
  52. #endif
    : @+ Z- Z6 r7 G! P
  53. % i- w2 F0 R0 e: T$ _0 T
  54. #define MAX_DMA_TRANSFER_IN_BYTES   (32768): |. ~4 R/ ~. u0 V+ y8 A
  55. #define STATIC_SHIFT                3! p  _4 k# Y* O4 W4 @
  56. #define TCINTEN_SHIFT               20
    4 H& I7 P, x: {* M6 l
  57. #define ITCINTEN_SHIFT              21
    1 N4 k  u4 q+ e3 S4 v! d' ^
  58. #define TCCHEN_SHIFT                225 t: W( t) _, x2 l# o& K
  59. #define ITCCHEN_SHIFT               23) K; `0 [& c; ]8 @
  60. * {4 V5 d+ E! d
  61. static volatile int irqraised1 = 0;. b9 L" ?2 [: ^: I3 T3 M4 v! y
  62. static volatile int irqraised2 = 0;
    3 s! ^& ~% f( R) H& D

  63. 7 A: H. _" C, ~% \) _
  64. int edma3_memtomemcpytest_dma(int acnt, int bcnt, int ccnt, int sync_mode, int event_queue);
    . y/ ^; g% T8 a" \) j* @, u* P8 ^
  65. int edma3_memtomemcpytest_dma_link(int acnt, int bcnt, int ccnt, int sync_mode, int event_queue);5 Y; q, M$ ]" U7 W
  66. int edma3_memtomemcpytest_dma_chain(int acnt, int bcnt, int ccnt, int sync_mode, int event_queue);5 h1 p* R! y( t2 o7 e4 n

  67. $ `+ \& _. ~6 i3 B% O' S
  68. dma_addr_t dmaphyssrc1 = 0;
    2 V/ x) z, y& d- T
  69. dma_addr_t dmaphyssrc2 = 0;
    - `; V; j* k. F2 V' E
  70. dma_addr_t dmaphysdest1 = 0;
    5 f. q' K- X0 X  E  Z: E
  71. dma_addr_t dmaphysdest2 = 0;/ c! M3 s+ X* f3 Y; c

  72. + B. l. a% Q$ a6 K- T
  73. char *dmabufsrc1 = NULL;3 J' m* f# p  s& d! H1 `. V7 Z+ U9 y
  74. char *dmabufsrc2 = NULL;; O( j( k2 h. B/ _. @7 L1 v6 r
  75. char *dmabufdest1 = NULL;
    : H( I& I6 I! X% o0 W
  76. char *dmabufdest2 = NULL;) U3 \0 g; y( U* ]

  77. - v9 P# f$ ?% W
  78. static int acnt = 512;
    8 H; g: v0 o: C& Q
  79. static int bcnt = 8;
    # O+ |/ k# b: w) q: G( L
  80. static int ccnt = 8;' ^& C% ^! `) B" @2 I# }

  81. # Z. Y4 M6 N4 I" L4 m& X' S4 _
  82. module_param(acnt, int, S_IRUGO);
    ; n: c7 b9 J/ z! ?. g4 I3 |
  83. module_param(bcnt, int, S_IRUGO);5 Y: D& C$ ]* T& t
  84. module_param(ccnt, int, S_IRUGO);
复制代码

, _! T- @2 E+ W! c) [+ k3 m
# A2 N) j/ v5 Y& g2 K, z8 g      这是在TI上找到的一个针对Davanci处理器简单的EDMA3驱动程序测试例程的一部分,我在编译的过程中是用
1 N% e% F8 U- M# o8 [' D# {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这个命令来链接库文件进行编译,但是报的错误特别多,我又试着一个函数一个函数往进加,仍然是很多错误。
+ B( }  D, T9 K# B9 Y# o( x     我想问一下如何用一个简单的程序来测试一下EDMA3的驱动。; {5 a, I* W( }1 `: D

- Z7 b- K5 v/ v' {* p
! A1 W& Q( l! R8 ^
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 分享淘帖
回复

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2026-3-7 12:36 , Processed in 0.041086 second(s), 26 queries .

Powered by Discuz! X3.2

© 2001-2015 Comsenz Inc.

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