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

嵌入式开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

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

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

[复制链接]

5

主题

11

帖子

73

积分

注册会员

Rank: 2

积分
73
跳转到指定楼层
楼主
发表于 2018-1-30 11:01:43 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
本帖最后由 yyj 于 2018-1-30 11:01 编辑
0 h; p' F% M9 V- @/ w
  1. [code]EDMA sample test application/ ]/ E, C9 W  Q0 v
  2. /*& o3 b- r" }  K7 u" {' p
  3. * edma_test.c
    ) N8 J- Z# q9 H: m5 X% s
  4. *
    - G+ E" ]0 O; K1 S6 @) q
  5. * brief  EDMA3 Test Application
    ' n& |- R5 O, T/ h( C) R
  6. *
    ; A! b4 s4 ~) T' O% ~. E3 f
  7. *   This file contains EDMA3 Test code.
    + }& U) d/ X- d& z$ P6 V! c/ U
  8. *
    * m+ F7 w' u# x
  9. *   NOTE: THIS FILE IS PROVIDED ONLY FOR INITIAL DEMO RELEASE AND MAY BE
    # G! n2 O' l0 N
  10. *         REMOVED AFTER THE DEMO OR THE CONTENTS OF THIS FILE ARE SUBJECT5 v$ P. i/ H: U! ~0 R
  11. *         TO CHANGE.4 K6 {% V, k( Y# e: \6 e6 @: e, f
  12. *& G; r+ Y1 O) @5 v8 p& v' c: `
  13. * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/! R& B8 `1 k6 z' R% v. c
  14. *$ Y2 ^, L( |* v
  15. * This program is free software; you can redistribute it and/or. y, ]9 S; X7 x% ?. D6 X
  16. * modify it under the terms of the GNU General Public License as+ s3 y- P2 d1 O2 L. k7 C
  17. * published by the Free Software Foundation version 2.: }* o+ h  l1 z+ D1 o% ?9 S
  18. *
    1 j% c# c$ s! H) J- A
  19. * This program is distributed "as is" WITHOUT ANY WARRANTY of any
    6 }; ]3 l  K1 G  u
  20. * kind, whether express or implied; without even the implied warranty
    . [1 n9 a6 E3 T, s( E/ f. s" `) I
  21. * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    ' N8 W/ C% z0 s& g/ ]5 H' I$ J  m' ]
  22. * GNU General Public License for more details.
    7 d- p, l; F4 B; Y6 g2 l
  23. */8 H; X. x3 y) d& [; r8 ]" X
  24. ! \' D# D' P6 _  y( x
  25. #include <linux/module.h>
    . C; X6 P2 x8 v3 Z& @
  26. #include <linux/init.h>
    " ^+ W' o# y4 G& D! S' h: R, L
  27. #include <linux/errno.h>% J( U5 l, Q7 \3 k. n. G) N
  28. #include <linux/types.h>9 x6 s6 J5 W( f7 a0 r. o& L' Y
  29. #include <linux/interrupt.h>5 ]9 J0 D: O$ P
  30. #include <asm/io.h>" B( O- Y8 j9 V( K7 y
  31. #include <linux/moduleparam.h>& n$ i3 v& p3 U" m
  32. #include <linux/sysctl.h>/ {1 J, P9 b1 y# r
  33. #include <linux/mm.h>
    4 O% P9 L4 f5 O( `0 K. Y2 K3 \
  34. #include <linux/dma-mapping.h>
    - n3 s- p9 {" {6 A1 m

  35. 8 o5 L% b7 q) c( x
  36. #include <mach/memory.h>+ ]4 V& S9 s2 G" s5 E9 |3 Y# E
  37. #include <mach/hardware.h>
    & H0 L) D6 Q0 \
  38. #include <mach/irqs.h>2 {, W: `6 m9 [6 h3 @
  39. #include <asm/hardware/edma.h>) Z. U& T, `, k; ^$ B) }1 q( c
  40. / y+ Z  f& \, a# W
  41. #undef EDMA3_DEBUG
    8 A0 }) n! m; j' k0 X
  42. /*#define EDMA3_DEBUG*/! a6 y+ {) U' x6 k3 @; w& B9 a
  43. + Y, d% h; {  i$ a# H0 C
  44. #ifdef EDMA3_DEBUG& Q% Z/ x/ @# B% T* F
  45. #define DMA_PRINTK(ARGS...)  printk(KERN_INFO "<%s>: ",__FUNCTION__);printk(ARGS)2 r. P1 d+ ~5 f( U4 K
  46. #define DMA_FN_IN printk(KERN_INFO "[%s]: start\n", __FUNCTION__)
    2 [1 S: P2 k% Y# A0 P/ V, L
  47. #define DMA_FN_OUT printk(KERN_INFO "[%s]: end\n",__FUNCTION__), f) Q8 U$ b3 r$ B6 f6 W( N
  48. #else, B) `; c- h8 o: o8 h
  49. #define DMA_PRINTK( x... )
    ; J) T% L4 d7 t8 J
  50. #define DMA_FN_IN
    2 D- T6 _7 l* y( F
  51. #define DMA_FN_OUT8 i0 A7 j7 U3 C. J
  52. #endif8 Z: M  L' W' }2 }( i% c; ]; W( o3 _6 K

  53. , e5 W8 N* V7 r) J% E4 S2 m
  54. #define MAX_DMA_TRANSFER_IN_BYTES   (32768)
    # k# g& I6 c: Y' V9 t
  55. #define STATIC_SHIFT                3
    % H) A1 t+ a- A4 b3 x. k
  56. #define TCINTEN_SHIFT               202 ^+ l( C; A6 j6 v
  57. #define ITCINTEN_SHIFT              21+ h% M2 V2 J' Z6 Q% c( N
  58. #define TCCHEN_SHIFT                22
    4 @5 g, Z: }; F4 _6 u: o) K* C
  59. #define ITCCHEN_SHIFT               232 L/ U2 o. ~' c  d1 f2 }6 t4 s1 y
  60. 3 C1 |# L8 R  d/ Y/ k' \
  61. static volatile int irqraised1 = 0;
    5 X% u* `4 x, ^8 k/ z( W3 V
  62. static volatile int irqraised2 = 0;
    ( u6 _! X' B1 e2 X2 Z' Y  [

  63. 4 ?8 y6 H3 `* @* w+ g
  64. int edma3_memtomemcpytest_dma(int acnt, int bcnt, int ccnt, int sync_mode, int event_queue);
    ( R5 K& T% a/ y
  65. int edma3_memtomemcpytest_dma_link(int acnt, int bcnt, int ccnt, int sync_mode, int event_queue);9 ~; z  _  u6 X
  66. int edma3_memtomemcpytest_dma_chain(int acnt, int bcnt, int ccnt, int sync_mode, int event_queue);
    $ c9 B  Y* ~/ P4 V

  67. ! f# w, E6 l' I3 O9 A
  68. dma_addr_t dmaphyssrc1 = 0;" G3 c  v( Y! D9 T2 G
  69. dma_addr_t dmaphyssrc2 = 0;& g& Q) f+ g$ i7 T0 g& o; \+ q) N
  70. dma_addr_t dmaphysdest1 = 0;, G' m+ c* b8 W3 B5 P% E# x
  71. dma_addr_t dmaphysdest2 = 0;  J, K  d( a1 q" h, G
  72. 5 A6 G7 l7 C) K4 ~$ u% c/ o7 n
  73. char *dmabufsrc1 = NULL;
    / o9 X; e! I  c. c* P
  74. char *dmabufsrc2 = NULL;
    - y+ Q7 l0 S5 i0 ~4 x
  75. char *dmabufdest1 = NULL;
    2 M4 j4 e3 [& s' w. {
  76. char *dmabufdest2 = NULL;/ H2 o6 ?" h' j

  77. 9 y3 R6 O& e% o' V
  78. static int acnt = 512;
    8 M: o  ^6 @& O% d/ L
  79. static int bcnt = 8;0 @9 k# v% |7 s. |! h3 U) u
  80. static int ccnt = 8;- s* U5 m- J* a  p2 O
  81. ' Q8 P) X9 ~: `# P8 J
  82. module_param(acnt, int, S_IRUGO);. H$ I- k; c& x8 J8 o) K1 s4 G; E
  83. module_param(bcnt, int, S_IRUGO);
    9 O# `' [6 F  ]" w" Y
  84. module_param(ccnt, int, S_IRUGO);
复制代码
2 T5 i; {6 |. f$ K& H
& F- I+ J" o' A" l  I& J  L3 d
      这是在TI上找到的一个针对Davanci处理器简单的EDMA3驱动程序测试例程的一部分,我在编译的过程中是用! @& O  x" g1 F; h* c
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这个命令来链接库文件进行编译,但是报的错误特别多,我又试着一个函数一个函数往进加,仍然是很多错误。: B3 ?+ Z7 i2 }. S& g& z, }
     我想问一下如何用一个简单的程序来测试一下EDMA3的驱动。
& M: D- M& U6 S; D/ w1 u' m
* s0 j: o& U2 U& H$ R" [
4 `4 `  R) s5 v, s, X9 z
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 分享淘帖
回复

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2026-2-3 04:40 , Processed in 0.040967 second(s), 26 queries .

Powered by Discuz! X3.2

© 2001-2015 Comsenz Inc.

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