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

嵌入式开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

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

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

[复制链接]

5

主题

11

帖子

73

积分

注册会员

Rank: 2

积分
73
跳转到指定楼层
楼主
发表于 2018-1-30 11:01:43 | 只看该作者 回帖奖励 |正序浏览 |阅读模式
本帖最后由 yyj 于 2018-1-30 11:01 编辑 & d4 ?$ S7 X4 A$ t
  1. [code]EDMA sample test application
    3 ?  ]4 ^0 _+ z$ _! E' d0 J, ~
  2. /*& j% R* h  m4 q! |) Q. l
  3. * edma_test.c9 [% {. s, ]4 p6 o* ~/ ?- |
  4. *+ V: c0 z; @- W* S5 `) L
  5. * brief  EDMA3 Test Application7 P  O( I0 Q7 @9 K' e( F  ?3 A/ v2 V
  6. *! x, I# X$ j, b. o5 F
  7. *   This file contains EDMA3 Test code.
    5 R) F" o: m  ~6 w7 \* b8 ?
  8. *
    3 v& k3 |- n$ H! t( A
  9. *   NOTE: THIS FILE IS PROVIDED ONLY FOR INITIAL DEMO RELEASE AND MAY BE
    ) l; ]" z7 {! ~' X
  10. *         REMOVED AFTER THE DEMO OR THE CONTENTS OF THIS FILE ARE SUBJECT+ V! B4 b  @4 n7 A5 ^
  11. *         TO CHANGE.; c3 @; j: b! l& a1 p+ ~/ c
  12. *
    4 m( u2 I; C& W+ f5 K
  13. * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/7 u8 U' D/ {3 Q1 c2 F! X9 Y( ]3 I
  14. *# U  ^. f4 u: @3 S) O2 P3 P3 G
  15. * This program is free software; you can redistribute it and/or
    . S" ]4 n' `5 t9 H
  16. * modify it under the terms of the GNU General Public License as/ y/ H" F$ Z$ q% j/ {
  17. * published by the Free Software Foundation version 2.
    : v' n! M, q; L  k2 H5 p; J& v
  18. *, j+ Y6 Y" F# V% d0 G; U* A
  19. * This program is distributed "as is" WITHOUT ANY WARRANTY of any
    % @( p' J- o; @- A% m& D/ V
  20. * kind, whether express or implied; without even the implied warranty4 x9 B( {6 i+ _$ }6 A
  21. * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    7 N8 x2 j6 w' W% A: y- J
  22. * GNU General Public License for more details.
    0 ]" R, \& N4 h
  23. */5 i0 A4 y% N* y* b+ t/ j2 }3 m
  24. ; k; w! J; C) y# y& m* y
  25. #include <linux/module.h>+ M# O) Z$ `' {4 z5 b  P
  26. #include <linux/init.h>
    ! W+ l$ o4 h& O, e4 {4 C4 M
  27. #include <linux/errno.h>
    7 L# [- s' n/ x2 d
  28. #include <linux/types.h>( g# }9 J  W) v- P/ u7 J2 P$ c- M
  29. #include <linux/interrupt.h>
    ( ?. ?  d% [3 J
  30. #include <asm/io.h>) N+ d, ]3 F3 S
  31. #include <linux/moduleparam.h>" z3 a" W, o# f* p
  32. #include <linux/sysctl.h>
    $ c4 l5 q! ]3 k* D% J# G( d! K5 S
  33. #include <linux/mm.h>" {% i: H  z. t* q! ?
  34. #include <linux/dma-mapping.h>
    ! Z; I2 M4 ?3 Y. {; }
  35. 1 [$ G5 f" F8 e( w4 R" r7 u; ~
  36. #include <mach/memory.h>
    4 j4 `3 \0 \. Z
  37. #include <mach/hardware.h>
    - e3 f) E, j, b9 m4 W5 U' G' U8 Q
  38. #include <mach/irqs.h>
    , I) a' K9 U$ g) p. p
  39. #include <asm/hardware/edma.h>
    * G  |' o( e8 K8 v

  40. / m2 n: d. L- N) C1 G
  41. #undef EDMA3_DEBUG
    9 e+ g, F) y0 y" o, d% }
  42. /*#define EDMA3_DEBUG*/
    - Q8 d# D/ Z3 }

  43. & B% F/ `$ P$ w' L. i
  44. #ifdef EDMA3_DEBUG
    1 X% t4 R" x- t+ ?& C
  45. #define DMA_PRINTK(ARGS...)  printk(KERN_INFO "<%s>: ",__FUNCTION__);printk(ARGS)$ Y6 H6 ?" X7 ~8 z) h! f2 }3 R
  46. #define DMA_FN_IN printk(KERN_INFO "[%s]: start\n", __FUNCTION__)
    9 S% N* U* K7 t, U) C0 R
  47. #define DMA_FN_OUT printk(KERN_INFO "[%s]: end\n",__FUNCTION__)5 i1 j/ G+ {! h/ c) I2 ~6 l' s9 p% O
  48. #else
    7 D" w4 s& ]) R: J# g
  49. #define DMA_PRINTK( x... )2 c+ l1 F3 l6 C/ ?; w
  50. #define DMA_FN_IN2 f0 |" S8 h2 j* `
  51. #define DMA_FN_OUT
    0 [' P- L5 j, f
  52. #endif) T: n0 _/ M& }0 `/ d. Z
  53. ! }! }( H# g, p0 r. \" W
  54. #define MAX_DMA_TRANSFER_IN_BYTES   (32768)
    1 ]  n; u, B. Y& U! @. q
  55. #define STATIC_SHIFT                3  J! l4 E, U( E, L
  56. #define TCINTEN_SHIFT               202 _2 [5 w7 q- k1 K( d( Q
  57. #define ITCINTEN_SHIFT              21
    7 g+ C- c7 E% i. @) L$ n, L. |" b
  58. #define TCCHEN_SHIFT                22! |, l7 Q* M* _& \9 a/ O
  59. #define ITCCHEN_SHIFT               238 D* `/ s) {# o2 B  L6 x0 b
  60. 4 w( r/ L2 l7 [% _! R' t- V* S* c
  61. static volatile int irqraised1 = 0;
    5 P! `9 {; Z0 ]3 k, B8 \
  62. static volatile int irqraised2 = 0;3 c6 F0 _, ]+ U9 ~: I* t
  63. 9 x3 }* d' P) l4 V
  64. int edma3_memtomemcpytest_dma(int acnt, int bcnt, int ccnt, int sync_mode, int event_queue);
    # p* N  d3 U. n( R$ H$ ^- _
  65. int edma3_memtomemcpytest_dma_link(int acnt, int bcnt, int ccnt, int sync_mode, int event_queue);7 h; C7 a; Y6 ]1 k+ o/ W
  66. int edma3_memtomemcpytest_dma_chain(int acnt, int bcnt, int ccnt, int sync_mode, int event_queue);! ~# \! ], k! d9 l1 O: Z' S
  67. 8 v$ U/ k! G" M" G
  68. dma_addr_t dmaphyssrc1 = 0;& R7 N: m, i  @6 {3 G& g0 r
  69. dma_addr_t dmaphyssrc2 = 0;0 j$ N+ g: w2 |' [" Q5 d
  70. dma_addr_t dmaphysdest1 = 0;
    $ B: V' ^6 ~$ l+ a1 Q" g) m
  71. dma_addr_t dmaphysdest2 = 0;* v2 H5 }( v/ d- I- [  b+ z+ J
  72. * }& u( q3 G+ S
  73. char *dmabufsrc1 = NULL;
    5 A( f0 ?5 c# x/ m6 ^# k4 G* B
  74. char *dmabufsrc2 = NULL;5 r! V( ~9 @. E+ }( {' p
  75. char *dmabufdest1 = NULL;6 j/ P2 _. o1 E4 y, w
  76. char *dmabufdest2 = NULL;
    7 j9 ^: u6 S3 ]/ Q7 i
  77. ; g6 A" J- q. d3 @: {% D1 R
  78. static int acnt = 512;
    * U6 F3 b7 j+ A3 j( _6 B! c# S6 j8 t8 P
  79. static int bcnt = 8;
    4 Z( V% K! J" ^6 y. [6 p: B* [- M
  80. static int ccnt = 8;
      ]0 _. D( Z" l0 K+ E6 }' ?& F$ s
  81. " D+ f, j: V/ I, [  q  W
  82. module_param(acnt, int, S_IRUGO);/ @/ B# w5 b. b8 C; u  i
  83. module_param(bcnt, int, S_IRUGO);
    * b, q+ ?: ]) o9 C* L) C% \, u
  84. module_param(ccnt, int, S_IRUGO);
复制代码
! k6 f% h. I4 I$ Y& o

. n( {  L4 x% _8 T0 ~3 O8 O      这是在TI上找到的一个针对Davanci处理器简单的EDMA3驱动程序测试例程的一部分,我在编译的过程中是用
$ ]& W& I4 q2 f# Xarm-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这个命令来链接库文件进行编译,但是报的错误特别多,我又试着一个函数一个函数往进加,仍然是很多错误。
, l7 K$ _9 j+ q6 r8 \     我想问一下如何用一个简单的程序来测试一下EDMA3的驱动。
" ?' F8 f' F$ g$ N7 @2 o/ @0 E3 p, O. w

1 H9 U( Q6 {) x! B
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 分享淘帖
回复

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2026-2-12 01:58 , Processed in 0.038108 second(s), 26 queries .

Powered by Discuz! X3.2

© 2001-2015 Comsenz Inc.

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