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

嵌入式开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

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

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

[复制链接]

5

主题

11

帖子

73

积分

注册会员

Rank: 2

积分
73
跳转到指定楼层
楼主
发表于 2018-1-30 11:01:43 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
本帖最后由 yyj 于 2018-1-30 11:01 编辑
4 E9 e$ Q, Y% J0 H
  1. [code]EDMA sample test application+ F/ ~. F- R4 a; {$ m7 t' v  S) A
  2. /*
    9 t$ X* D9 U8 K5 g& E; V
  3. * edma_test.c
    6 N: H  g. M3 y4 p# h
  4. *9 N' i$ k$ q2 l7 t
  5. * brief  EDMA3 Test Application. i! {( O7 ^, j' P( y! F" |
  6. *
    5 J* p9 c# t6 k# H# q4 d. M3 k) r
  7. *   This file contains EDMA3 Test code.) W3 Q1 a" f* l
  8. *
    . u) h! x7 Y' O' G. f, K3 r$ R
  9. *   NOTE: THIS FILE IS PROVIDED ONLY FOR INITIAL DEMO RELEASE AND MAY BE' t1 s1 |+ [! z* N/ {6 R
  10. *         REMOVED AFTER THE DEMO OR THE CONTENTS OF THIS FILE ARE SUBJECT
    ( {2 P# t$ h9 ~, y  ]# I! Q
  11. *         TO CHANGE.& O0 u( m) G( ?. p
  12. *
    1 c2 S! ?2 {7 X! F7 q# r% K
  13. * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
    ( r5 N% V4 x) Q6 a. G2 I4 y
  14. *, _( {* P; @! f7 z! k! [& x! ^1 c
  15. * This program is free software; you can redistribute it and/or$ V. L2 h" j0 n. _2 s. K
  16. * modify it under the terms of the GNU General Public License as$ {2 w2 f, K, J0 T4 N
  17. * published by the Free Software Foundation version 2.0 `, `. q7 h, C0 P6 k4 ^. t
  18. *
    # y0 A, o* j! `" v. z
  19. * This program is distributed "as is" WITHOUT ANY WARRANTY of any3 w  ^8 k' i/ O9 u; X& t' u4 J- ^: Y
  20. * kind, whether express or implied; without even the implied warranty# _7 N6 f! q0 ~9 Z7 S: x( y
  21. * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    ! `4 b" y/ ]3 G. E& X! f
  22. * GNU General Public License for more details.
    1 t2 l* @8 b* t2 }2 ?
  23. */
    - r9 d. P1 y! s9 H

  24. 2 T) V3 ?% ~2 n" B/ \
  25. #include <linux/module.h>) P  x2 J6 [7 e' ?
  26. #include <linux/init.h>
    2 _  T7 r5 S' n6 C. S6 `
  27. #include <linux/errno.h>% l3 G9 ?  P8 w: D# I8 Y  d
  28. #include <linux/types.h>
    5 V7 t/ o4 r3 l" ]
  29. #include <linux/interrupt.h>5 l) N3 M3 s, `, i
  30. #include <asm/io.h>
    7 o! g3 P7 A8 G6 y
  31. #include <linux/moduleparam.h>$ t5 z# p- H/ w1 B
  32. #include <linux/sysctl.h>' X' f2 l7 m" t: x4 q( O. R
  33. #include <linux/mm.h>8 X; i3 M. i" \  S. Z
  34. #include <linux/dma-mapping.h>5 j# Z4 N; G. o

  35. , g9 V) c- ~9 M$ A5 _$ G
  36. #include <mach/memory.h>* y& k' q. [" M+ V( i
  37. #include <mach/hardware.h>1 S, Z  m4 j: y
  38. #include <mach/irqs.h>8 v( ]; N$ E, r* |% C5 ~3 i
  39. #include <asm/hardware/edma.h>
    4 Z) x& d! j, V; x) j3 K7 y

  40. # Q. J! R1 Y. j: O+ k0 s$ d9 i; n
  41. #undef EDMA3_DEBUG
    ; e0 Q7 `* t4 B2 M
  42. /*#define EDMA3_DEBUG*/- y# F4 N1 d% Z8 ~

  43. % E' h0 X' o! e! ?+ I! T
  44. #ifdef EDMA3_DEBUG
    : J4 N: }3 u1 R; d% Z; D7 V
  45. #define DMA_PRINTK(ARGS...)  printk(KERN_INFO "<%s>: ",__FUNCTION__);printk(ARGS): M5 y1 Q, g7 u9 X3 k
  46. #define DMA_FN_IN printk(KERN_INFO "[%s]: start\n", __FUNCTION__)+ N/ M3 m# g7 m5 W# D% |
  47. #define DMA_FN_OUT printk(KERN_INFO "[%s]: end\n",__FUNCTION__)2 B$ x* }% h/ D& S
  48. #else) j- H/ `5 t. R& v9 X4 g- D6 ^' b# c
  49. #define DMA_PRINTK( x... )
    ! ]3 |" y! N0 g5 T4 V! [8 |# z' q, _
  50. #define DMA_FN_IN
      y4 A) `+ L3 J9 A; a
  51. #define DMA_FN_OUT
    5 T; b4 t  `) {
  52. #endif1 j8 @3 g- l) ~7 C
  53. ; L  P+ V. K' D/ w
  54. #define MAX_DMA_TRANSFER_IN_BYTES   (32768)
    * n* N: _9 {1 K3 Q* f/ r7 @6 w4 R
  55. #define STATIC_SHIFT                3: v0 Q3 b# \9 @. w& u! V8 a
  56. #define TCINTEN_SHIFT               20. Q* l+ w" k8 s& [/ N
  57. #define ITCINTEN_SHIFT              21
    2 \. d" b/ E+ Z* s; B+ j5 G2 Q
  58. #define TCCHEN_SHIFT                22- U$ d- P7 M8 n& m  r  I; z
  59. #define ITCCHEN_SHIFT               23
    2 t3 Q: x! w( a3 s. r
  60. & ?3 h) V: \' A- z' k" R, p
  61. static volatile int irqraised1 = 0;
    ! A$ i+ |8 Z$ O7 I  ^# T8 {# y
  62. static volatile int irqraised2 = 0;# h# h! ]: q# h+ T- Z$ Q

  63. 2 i% k% I$ ?/ S6 P: a6 D$ }2 v
  64. int edma3_memtomemcpytest_dma(int acnt, int bcnt, int ccnt, int sync_mode, int event_queue);
    / v9 d+ G0 x. l9 x
  65. int edma3_memtomemcpytest_dma_link(int acnt, int bcnt, int ccnt, int sync_mode, int event_queue);0 _, b& o/ o" R
  66. int edma3_memtomemcpytest_dma_chain(int acnt, int bcnt, int ccnt, int sync_mode, int event_queue);/ j& U! f2 ?* ]7 z! K. L5 t  p
  67. ; Q0 o1 X0 X) u. j9 H' P# U
  68. dma_addr_t dmaphyssrc1 = 0;
    ' u; m) ?" c( a" _  X  ~
  69. dma_addr_t dmaphyssrc2 = 0;1 W' i5 [( k" q6 \0 X  |1 g
  70. dma_addr_t dmaphysdest1 = 0;' x! D+ y/ l0 x  ^% t  j0 j
  71. dma_addr_t dmaphysdest2 = 0;
    * J% I/ P% J" m3 @! A3 {

  72. * d  H2 J9 E3 e* f  D2 N" Z- ^) A0 D
  73. char *dmabufsrc1 = NULL;; |" k4 R- r6 @( l% v
  74. char *dmabufsrc2 = NULL;" _" D* ~; H2 x6 D! T, T1 ~
  75. char *dmabufdest1 = NULL;4 ?: o9 _, z- h% v" g
  76. char *dmabufdest2 = NULL;$ R4 G7 N: o9 f2 i2 Y( B
  77. 5 x5 A3 Y8 u3 E5 P$ T
  78. static int acnt = 512;
    , V: D7 o9 T. I% u" z
  79. static int bcnt = 8;
    4 G6 q; M1 P% A9 ^& v) H. M
  80. static int ccnt = 8;
    6 O6 B0 t: F2 I$ w

  81. 2 q0 X+ q/ f+ f% {
  82. module_param(acnt, int, S_IRUGO);9 [  v4 {3 H% m
  83. module_param(bcnt, int, S_IRUGO);
    - V9 ?! l% j# v! u( _5 t5 A
  84. module_param(ccnt, int, S_IRUGO);
复制代码

: n8 e1 S/ ?# D+ [, S2 l/ N$ J: c$ K+ P3 r; o
      这是在TI上找到的一个针对Davanci处理器简单的EDMA3驱动程序测试例程的一部分,我在编译的过程中是用6 a( c7 ]7 j5 t- G
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 A; n. T6 z2 z  C7 {- T" A     我想问一下如何用一个简单的程序来测试一下EDMA3的驱动。
% _! W; z0 n( K
" y; \3 F! {, ?! t' [) d. d/ H
! y- L  L- ~4 Q# ]0 A2 x
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 分享淘帖
回复

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2026-3-12 15:19 , Processed in 0.043869 second(s), 25 queries .

Powered by Discuz! X3.2

© 2001-2015 Comsenz Inc.

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