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

嵌入式开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

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

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

[复制链接]

5

主题

11

帖子

73

积分

注册会员

Rank: 2

积分
73
跳转到指定楼层
楼主
发表于 2018-1-30 11:01:43 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
本帖最后由 yyj 于 2018-1-30 11:01 编辑 - u# E3 D5 c1 S2 c' q
  1. [code]EDMA sample test application
    % l0 F; l! L9 ]% R! I, Z; y
  2. /*" n1 W# ]/ N4 W0 Q! S% E& C" ]( s2 O
  3. * edma_test.c1 I6 ^  a5 S7 K
  4. *
    . ?" ~% Q# z0 J1 \2 U: n8 ]( v7 h9 P2 [
  5. * brief  EDMA3 Test Application3 Q" M: P( b( T1 f  N
  6. *0 }0 a/ T4 Z! s$ T# H' b% p* ~! V) k
  7. *   This file contains EDMA3 Test code.6 X' K1 O! Z/ }- r) h
  8. *
    9 g& s# f4 t! O# u, I4 ^! R
  9. *   NOTE: THIS FILE IS PROVIDED ONLY FOR INITIAL DEMO RELEASE AND MAY BE
    8 r& G1 S$ W6 l9 q3 A' E
  10. *         REMOVED AFTER THE DEMO OR THE CONTENTS OF THIS FILE ARE SUBJECT3 b" _8 C( |" M9 J
  11. *         TO CHANGE.
    ( u0 B/ Y6 X0 }
  12. *
    1 L9 q9 I0 n/ O# z! U' m
  13. * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
    & a4 |! v# W( i
  14. *6 {% j+ M- f" |+ V
  15. * This program is free software; you can redistribute it and/or
    ' e- \) X1 H/ Y8 K8 v' ]
  16. * modify it under the terms of the GNU General Public License as
    % u/ ]* K7 c* i" G$ y
  17. * published by the Free Software Foundation version 2.
    8 j% C9 u- }4 [; u7 a$ _
  18. *  _# v' _8 p' {8 {/ \+ F
  19. * This program is distributed "as is" WITHOUT ANY WARRANTY of any
    $ @: W/ t6 `: O' |. Y4 _
  20. * kind, whether express or implied; without even the implied warranty4 {, [/ Y  k& i+ l/ T1 C
  21. * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the; g) J- d* c+ p6 n, e8 c* l# q
  22. * GNU General Public License for more details.6 \% T. `. G! e2 w, ^& L% H
  23. */
    ! ~  r" L1 [/ V( y4 |4 Y: I$ L
  24.   Q4 [% Y8 C  ?: M, I1 h
  25. #include <linux/module.h>9 C, I1 q  j7 f) b! s" v1 Z: N
  26. #include <linux/init.h>& @8 ?# O& @4 u1 a& z/ g" U
  27. #include <linux/errno.h>, l  h( X9 n, |0 [
  28. #include <linux/types.h>
    ! _! i! ~7 v0 a1 Z8 e
  29. #include <linux/interrupt.h>
    9 k  z, y0 |, X1 S4 J
  30. #include <asm/io.h>7 `4 H. o' e, d" y' r7 u
  31. #include <linux/moduleparam.h>4 N: q$ w1 T' R
  32. #include <linux/sysctl.h>5 e' x: L: I! M5 \% n# G5 G
  33. #include <linux/mm.h>
    ( |& r) U6 `8 F8 A
  34. #include <linux/dma-mapping.h>
    4 i0 s& }) h, f% m* @
  35. 3 g) [. j# g& F& \* k
  36. #include <mach/memory.h>5 E- p" b, `! K! {' m
  37. #include <mach/hardware.h>
    ( H- ?' B0 a  q  y% u7 c( f. e
  38. #include <mach/irqs.h>: K2 V3 m5 G" P: b: z
  39. #include <asm/hardware/edma.h>  ^6 p$ E0 ^8 e4 B) a" H' e

  40.   g7 t" y8 X" E7 @5 X
  41. #undef EDMA3_DEBUG, s4 z3 J8 o' r1 T  `1 \
  42. /*#define EDMA3_DEBUG*/
    ! v& ^. L" ^% q) x

  43. / p9 j2 s) @# o$ j& @
  44. #ifdef EDMA3_DEBUG( B! x( Q7 p  d0 ?: V% ^
  45. #define DMA_PRINTK(ARGS...)  printk(KERN_INFO "<%s>: ",__FUNCTION__);printk(ARGS)% B4 ^- s: t  `
  46. #define DMA_FN_IN printk(KERN_INFO "[%s]: start\n", __FUNCTION__)4 K$ K+ r3 q: P3 b8 v- X3 D
  47. #define DMA_FN_OUT printk(KERN_INFO "[%s]: end\n",__FUNCTION__)) J7 S# J, c( M: M. u
  48. #else4 f" @. i& J2 Z9 t# B9 I
  49. #define DMA_PRINTK( x... )- g4 }* t- L2 b; l
  50. #define DMA_FN_IN
    ) P  W, }4 Y8 C
  51. #define DMA_FN_OUT& k# i4 n) S9 p7 a; u
  52. #endif  _- Y( p, l- u8 F% A
  53. ( j  Q  {* D1 S# A1 }; o, s- L
  54. #define MAX_DMA_TRANSFER_IN_BYTES   (32768)
    ; j/ `/ X( u4 x1 O& v9 f
  55. #define STATIC_SHIFT                3
    - S- m( R( B  u/ h6 W: _8 v
  56. #define TCINTEN_SHIFT               20
    2 v& O) p4 ?$ w5 D: ?, X/ m/ w
  57. #define ITCINTEN_SHIFT              21
    9 t7 M7 q: \2 C4 U
  58. #define TCCHEN_SHIFT                22( E8 B* B# K( B8 _
  59. #define ITCCHEN_SHIFT               23
    . L: p) J& q5 \$ r4 S! R. d

  60.   @4 {8 W* ]2 E6 ^
  61. static volatile int irqraised1 = 0;- D( V* @. t8 `' `% P8 N. ^
  62. static volatile int irqraised2 = 0;
    4 ^) g- z* t5 `8 e- J" V

  63. + K8 k$ Z) K2 g; X9 ]8 I
  64. int edma3_memtomemcpytest_dma(int acnt, int bcnt, int ccnt, int sync_mode, int event_queue);' f2 L4 n. P, p' ?+ w, b/ J1 Q
  65. int edma3_memtomemcpytest_dma_link(int acnt, int bcnt, int ccnt, int sync_mode, int event_queue);
    ! r* ^& y( e, |
  66. int edma3_memtomemcpytest_dma_chain(int acnt, int bcnt, int ccnt, int sync_mode, int event_queue);3 A* x# h- Q$ q/ _

  67. 7 y7 |9 V6 S9 T1 j% {1 x. _
  68. dma_addr_t dmaphyssrc1 = 0;3 W. v- B: e$ t1 Y, m! t
  69. dma_addr_t dmaphyssrc2 = 0;
    ) k& d3 S+ r/ B4 C) J+ k% l
  70. dma_addr_t dmaphysdest1 = 0;
      H+ I- _3 r$ W1 k! R3 F# @
  71. dma_addr_t dmaphysdest2 = 0;
    7 Z& E/ G4 g# N

  72. 5 {# P1 s3 h/ x- E  q6 P  H9 l
  73. char *dmabufsrc1 = NULL;( q  m/ h( Q. `3 l2 ]. o; R, b
  74. char *dmabufsrc2 = NULL;
    ) ?# j0 _# c* J& q  z% P/ L
  75. char *dmabufdest1 = NULL;
    ' g5 u0 Q1 W$ d0 o1 d1 h
  76. char *dmabufdest2 = NULL;4 a0 g! U6 w. ~# Z
  77. " T# Y; \" ]( |
  78. static int acnt = 512;  H' a! ]- Q8 [( M1 w. d  g1 ^
  79. static int bcnt = 8;) E8 E4 `% @0 P6 ^' c) Z
  80. static int ccnt = 8;
    9 D. v2 b* v- {8 f6 |
  81. / e$ U0 J% O) i& y
  82. module_param(acnt, int, S_IRUGO);
    ' @$ @* L2 k' z5 R+ L
  83. module_param(bcnt, int, S_IRUGO);4 d2 d+ W* B5 I) S
  84. module_param(ccnt, int, S_IRUGO);
复制代码
# S- @+ G1 v9 w, C

% V# E$ `' Z( U, I& q" d      这是在TI上找到的一个针对Davanci处理器简单的EDMA3驱动程序测试例程的一部分,我在编译的过程中是用
' Q5 d' [/ F. X, Earm-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这个命令来链接库文件进行编译,但是报的错误特别多,我又试着一个函数一个函数往进加,仍然是很多错误。
, S6 p2 R! u1 f3 `     我想问一下如何用一个简单的程序来测试一下EDMA3的驱动。. y' s  F( r& r. u3 o6 R0 E0 t

% r& p; F; ~/ T6 i7 [
" \' P6 q2 k: S5 g0 Z; a% M
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 分享淘帖
回复

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2026-1-15 09:24 , Processed in 0.039890 second(s), 26 queries .

Powered by Discuz! X3.2

© 2001-2015 Comsenz Inc.

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