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

嵌入式开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

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

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

[复制链接]

5

主题

11

帖子

73

积分

注册会员

Rank: 2

积分
73
跳转到指定楼层
楼主
发表于 2018-1-30 11:01:43 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
本帖最后由 yyj 于 2018-1-30 11:01 编辑 , i0 v; p  e( i; {3 h$ E. o) C
  1. [code]EDMA sample test application9 w$ I& k2 F: e
  2. /*  ]$ O/ e& w" K8 z  c# U$ G
  3. * edma_test.c* [& T3 p6 |4 k# n& c
  4. *
    : q$ H3 M1 Y2 y& u
  5. * brief  EDMA3 Test Application$ a6 \% O( r, i
  6. */ d. w- i: c/ P0 i
  7. *   This file contains EDMA3 Test code.- T  |6 L9 z% ?" I9 R4 z
  8. *3 A3 d1 m# q3 f8 U# J
  9. *   NOTE: THIS FILE IS PROVIDED ONLY FOR INITIAL DEMO RELEASE AND MAY BE4 k6 S% h; Z- Z
  10. *         REMOVED AFTER THE DEMO OR THE CONTENTS OF THIS FILE ARE SUBJECT5 r) d: G! X# L# H( x, j8 {
  11. *         TO CHANGE.
    : R! e! h& H2 ]. l
  12. *
    . B: s9 w8 i6 ^# e3 a9 \* y9 f
  13. * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
    ( p8 E  x: d5 M; ]4 P
  14. *2 O/ g5 z+ ~+ u$ f# `+ J4 m+ Z/ M) ]
  15. * This program is free software; you can redistribute it and/or
    3 |5 m+ A; v$ {) K2 [* f9 ]
  16. * modify it under the terms of the GNU General Public License as
    2 N7 h) V% ?7 i' y
  17. * published by the Free Software Foundation version 2.
    ! L" v1 l3 \+ E' r+ [* @
  18. *9 `2 V/ d( w' Z
  19. * This program is distributed "as is" WITHOUT ANY WARRANTY of any
    8 @& y% G, u( ~: V$ `; |6 v
  20. * kind, whether express or implied; without even the implied warranty& r2 u" o/ }( h) a% m' _1 W
  21. * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the, N1 Q. K+ e5 P+ A3 V
  22. * GNU General Public License for more details.' i, ?% I! h; a4 q1 Z1 z
  23. */; L7 V; H9 u. p3 x% j

  24. + |- s, O) `, }
  25. #include <linux/module.h>5 i5 |! U3 _3 }% H5 g( ^9 x
  26. #include <linux/init.h>
    8 P- r, N7 c( v
  27. #include <linux/errno.h>
    " w6 H4 Y  l+ b7 o
  28. #include <linux/types.h>. c. P; C: l' F) `
  29. #include <linux/interrupt.h>
    5 U3 D0 `; c9 E! Q
  30. #include <asm/io.h>& K$ i5 l4 u/ i' Y
  31. #include <linux/moduleparam.h>, m6 o+ e( }" J7 _2 w+ _1 A# l7 j
  32. #include <linux/sysctl.h>
    ; F* m' S2 m$ L# V
  33. #include <linux/mm.h>: m6 R/ N& h) Z: U# f- s
  34. #include <linux/dma-mapping.h>
      P5 d- G2 P4 f( a- I. g' q
  35. ) X! L9 v# b4 A7 x1 Z
  36. #include <mach/memory.h>
    7 F. {. k& y7 G, B, @
  37. #include <mach/hardware.h>: R8 G6 {) X: P8 R6 m
  38. #include <mach/irqs.h>% O! s  o$ R; U1 @9 h- @. t" h6 H5 V
  39. #include <asm/hardware/edma.h>
    ! y# f% q  r: I! z
  40. ( ^/ E; |; ^) O" |+ \
  41. #undef EDMA3_DEBUG
    : b( b$ v2 ]( b0 E
  42. /*#define EDMA3_DEBUG*/
    6 P: j" T5 \% a

  43. ! z: f- u% I3 p- C1 G
  44. #ifdef EDMA3_DEBUG) H7 s9 m$ H5 q0 F. a3 `8 a$ ~7 P
  45. #define DMA_PRINTK(ARGS...)  printk(KERN_INFO "<%s>: ",__FUNCTION__);printk(ARGS)8 r* J+ ^6 s% K! ]$ e
  46. #define DMA_FN_IN printk(KERN_INFO "[%s]: start\n", __FUNCTION__)
    6 |1 e6 |  ]# T7 C7 i3 K
  47. #define DMA_FN_OUT printk(KERN_INFO "[%s]: end\n",__FUNCTION__)5 y6 h$ m. H$ O' V9 t+ D( Y9 x2 l2 x
  48. #else  I( j7 H! R# B/ E6 c
  49. #define DMA_PRINTK( x... )
    ' X  M6 F2 B+ Q$ k* V( V
  50. #define DMA_FN_IN. q# m! A8 D: }2 Y
  51. #define DMA_FN_OUT# n1 W8 X: F. T& F$ U
  52. #endif- |( v8 l6 g# N- B1 n2 p" @
  53. " q$ P; c) u" r. s! Q1 A+ w
  54. #define MAX_DMA_TRANSFER_IN_BYTES   (32768)
    ; b; D# \7 G4 B7 \
  55. #define STATIC_SHIFT                3
    5 U' |0 ?: l3 Y
  56. #define TCINTEN_SHIFT               20- R6 j# j: o+ G
  57. #define ITCINTEN_SHIFT              21
    9 a" b! n! E# s/ `8 p% k( o9 E* t4 T. P
  58. #define TCCHEN_SHIFT                22* a  m, @; u9 Q- u
  59. #define ITCCHEN_SHIFT               23) Q, P9 E) M+ m

  60. 7 m0 Z) A2 |( a( {1 j8 J" i' j; }
  61. static volatile int irqraised1 = 0;. ?) r' |& i, D* \0 s, Z
  62. static volatile int irqraised2 = 0;
    & I  X5 Y" ?3 I% i% b$ n. P
  63. - Q% G1 H$ D+ s
  64. int edma3_memtomemcpytest_dma(int acnt, int bcnt, int ccnt, int sync_mode, int event_queue);
    . N2 x# T4 d+ f
  65. int edma3_memtomemcpytest_dma_link(int acnt, int bcnt, int ccnt, int sync_mode, int event_queue);
    4 X$ X7 q' M. x5 |/ }
  66. int edma3_memtomemcpytest_dma_chain(int acnt, int bcnt, int ccnt, int sync_mode, int event_queue);' z; f. q# C. f3 D3 B  d. U

  67. 1 q6 }8 P* e% @
  68. dma_addr_t dmaphyssrc1 = 0;
    4 l0 v/ T' p4 F- u0 W+ L
  69. dma_addr_t dmaphyssrc2 = 0;
    - i, q  \4 z7 @5 w2 w
  70. dma_addr_t dmaphysdest1 = 0;
    3 W5 c! b  s. ]) Q& K
  71. dma_addr_t dmaphysdest2 = 0;
    6 o. b8 Q( _/ p, M% ]4 C' v

  72. / n0 q% s9 ~! q
  73. char *dmabufsrc1 = NULL;! a! d1 D5 q5 Z# D- Z
  74. char *dmabufsrc2 = NULL;$ H2 ^( a) j- j: X5 p; [; @
  75. char *dmabufdest1 = NULL;
    - ~5 K# R' y/ H. i) V; g" r, D
  76. char *dmabufdest2 = NULL;
    " H$ C8 v5 v- K1 f9 I8 L" z6 Y! v
  77. 2 A" V/ e* o# [- n" \0 Y9 b' n4 ~
  78. static int acnt = 512;1 L# E+ C. k- z; V6 n
  79. static int bcnt = 8;
    9 e/ P2 }9 W, k* }- L
  80. static int ccnt = 8;
    ' O$ V; L" K( \4 K, [5 S5 \

  81. , [; S: o8 }" Y9 k& Q, l
  82. module_param(acnt, int, S_IRUGO);0 i- R9 B4 R. y6 |& K
  83. module_param(bcnt, int, S_IRUGO);! r9 a& `) ?$ v
  84. module_param(ccnt, int, S_IRUGO);
复制代码

2 _8 o  o- t9 D! R/ l; Z5 y0 _# `9 e* K- q2 c
      这是在TI上找到的一个针对Davanci处理器简单的EDMA3驱动程序测试例程的一部分,我在编译的过程中是用
1 e1 e# h) T+ L+ j+ x0 zarm-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这个命令来链接库文件进行编译,但是报的错误特别多,我又试着一个函数一个函数往进加,仍然是很多错误。5 j$ j+ w. u& H( Q
     我想问一下如何用一个简单的程序来测试一下EDMA3的驱动。6 e$ c2 k, X# a
0 u1 T6 Q4 h& X. f5 f; O$ W
* c/ `* M% y) g0 X
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 分享淘帖
回复

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2026-2-10 09:33 , Processed in 0.041481 second(s), 25 queries .

Powered by Discuz! X3.2

© 2001-2015 Comsenz Inc.

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