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

嵌入式开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

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

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

[复制链接]

5

主题

11

帖子

73

积分

注册会员

Rank: 2

积分
73
跳转到指定楼层
楼主
发表于 2018-1-30 11:01:43 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
本帖最后由 yyj 于 2018-1-30 11:01 编辑 5 ^$ T0 m9 S# ]1 g& d$ R: w" L
  1. [code]EDMA sample test application
    - W9 F( ]% C5 T4 Q4 P
  2. /*, i4 u; s0 }% _, p& c, g
  3. * edma_test.c6 y7 F8 `* A9 H! A/ D
  4. *
    2 o/ Y* I, w7 Y* _+ T9 V
  5. * brief  EDMA3 Test Application; |/ q; U: p: }& T' z: m
  6. */ ^) X+ n9 c7 ?1 e: R
  7. *   This file contains EDMA3 Test code.  Y6 Y+ j) B; {+ H% K
  8. *
    ! G( G3 y" ?5 t5 S8 [& e+ S
  9. *   NOTE: THIS FILE IS PROVIDED ONLY FOR INITIAL DEMO RELEASE AND MAY BE9 U! a7 [/ a" ^) y$ Z1 y
  10. *         REMOVED AFTER THE DEMO OR THE CONTENTS OF THIS FILE ARE SUBJECT! m& F9 s8 C# `- S
  11. *         TO CHANGE.
    / \! G7 N+ [- d: J
  12. ** Z% o5 K! v& U9 S4 n. ^
  13. * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/& W# f& s( t7 t
  14. *$ u( h+ s( z# \' p- ~
  15. * This program is free software; you can redistribute it and/or
    . |+ `1 a& d# K4 Y+ G
  16. * modify it under the terms of the GNU General Public License as. t* [+ u! F/ Z+ M
  17. * published by the Free Software Foundation version 2.
    6 H: U( R. K) u$ s
  18. *
    $ e5 [6 z  \9 y8 x; c4 s. S) |
  19. * This program is distributed "as is" WITHOUT ANY WARRANTY of any. u% d9 Y) {7 ?
  20. * kind, whether express or implied; without even the implied warranty
    6 F" f! x1 Y1 M, W" P
  21. * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    / _; s  N# _8 G& X, C- `6 O  S, c
  22. * GNU General Public License for more details.
    # z9 T; M( }- q) o3 E' }; p/ x
  23. */1 f0 j: G4 O) P( c2 H
  24. " o  m2 y  ]; [, u! S7 Q
  25. #include <linux/module.h>
    4 Z* ~' o4 M: h2 ?' U) E- [
  26. #include <linux/init.h>
    # I) H. W, v4 z0 q: j; a. y1 c
  27. #include <linux/errno.h>
    $ B+ G- {7 F: ?. U% p" l* K* J3 Z  z' f
  28. #include <linux/types.h>; k( u/ |/ T( A* J
  29. #include <linux/interrupt.h>
    / H* W8 {# {' l3 _- L3 b
  30. #include <asm/io.h>+ w" t7 d: U) `+ v7 q# H
  31. #include <linux/moduleparam.h>% s1 m# X+ K9 [% G4 C* t: r
  32. #include <linux/sysctl.h>
    ( M& n7 a" s6 y' a# s4 Y4 q: c) x% g/ U
  33. #include <linux/mm.h>
    ( s7 R9 j/ j$ x& _% B9 s5 v
  34. #include <linux/dma-mapping.h>1 I, e* v* [/ F! F7 Q; k  D

  35. ( ]2 S6 U* ], [8 @
  36. #include <mach/memory.h>
    . L' i- n' d5 ^$ z9 o& A) k1 Q. m" N2 y
  37. #include <mach/hardware.h>& B9 U4 j, X( M+ G$ m: Z8 M
  38. #include <mach/irqs.h>5 ^& u$ N- [1 J, E1 }" Q# T
  39. #include <asm/hardware/edma.h>, p) g. o  S4 {) e( a- Z" Z

  40. % |# ]9 G* l( \3 X! K( p0 M6 L, t
  41. #undef EDMA3_DEBUG( H. p3 E, u) b
  42. /*#define EDMA3_DEBUG*/* n! F. z! \4 {- m

  43.   k  F3 g) i. o# R
  44. #ifdef EDMA3_DEBUG
    5 J, L2 i# H% r7 z" e
  45. #define DMA_PRINTK(ARGS...)  printk(KERN_INFO "<%s>: ",__FUNCTION__);printk(ARGS)
    ! @0 t( J1 J/ _  |# e
  46. #define DMA_FN_IN printk(KERN_INFO "[%s]: start\n", __FUNCTION__)
    1 E. m, r. _1 E4 Y; o/ U  d( A+ t
  47. #define DMA_FN_OUT printk(KERN_INFO "[%s]: end\n",__FUNCTION__)# y5 v6 w! c2 {
  48. #else
    1 i! d; a8 }6 F
  49. #define DMA_PRINTK( x... )0 W5 m2 m0 ~8 \2 c/ _$ ]5 a1 i
  50. #define DMA_FN_IN/ }6 }! R$ e% k7 b% b
  51. #define DMA_FN_OUT
    6 p% u4 t+ u8 A. t' Y1 [) u( d
  52. #endif/ t. E! x, m$ r6 H4 m8 T! h

  53. , k6 F" n& r. R( t0 `
  54. #define MAX_DMA_TRANSFER_IN_BYTES   (32768)5 e5 p( y* _3 U4 C( f8 v. R
  55. #define STATIC_SHIFT                3
    9 `) X. P5 O* D, L, J8 f1 R+ i& ?8 y
  56. #define TCINTEN_SHIFT               20' N' M0 x8 ~9 p  U* N; T" K' a7 X( y
  57. #define ITCINTEN_SHIFT              21
    " q4 }* k  ?# q: Z+ @  X" s1 ~
  58. #define TCCHEN_SHIFT                22
    ) \/ y1 p$ m* H6 o4 ?* d. u  m
  59. #define ITCCHEN_SHIFT               23
    8 Y6 c+ d3 _7 x; F  e5 s  R
  60. 0 M; k: P; ?( ~& a3 ]2 v) y1 S
  61. static volatile int irqraised1 = 0;6 ^# L% t+ n' U6 B; u) E
  62. static volatile int irqraised2 = 0;5 J; @# y% E& @. s

  63. ) K* u# {1 M# |! s/ ~
  64. int edma3_memtomemcpytest_dma(int acnt, int bcnt, int ccnt, int sync_mode, int event_queue);
    6 b5 W! t" C+ m: Y8 ~+ p
  65. int edma3_memtomemcpytest_dma_link(int acnt, int bcnt, int ccnt, int sync_mode, int event_queue);3 R- L* E1 x0 Y2 K8 Y' c$ F
  66. int edma3_memtomemcpytest_dma_chain(int acnt, int bcnt, int ccnt, int sync_mode, int event_queue);
    7 l7 o  h% E9 R* i( E! L2 P

  67. . C: i7 {$ x$ f$ W& @) b/ ^
  68. dma_addr_t dmaphyssrc1 = 0;
    # Z3 D' a% z7 f0 _2 k" V9 I* ?
  69. dma_addr_t dmaphyssrc2 = 0;
    6 I; w& l7 d) w4 }& Y, _4 a( \& f
  70. dma_addr_t dmaphysdest1 = 0;
    / ^- y' ^5 l$ M
  71. dma_addr_t dmaphysdest2 = 0;1 Y) F; R- c7 l# Y* J; A# ]0 a6 a
  72. ) O  W9 ?/ [" K1 y$ R
  73. char *dmabufsrc1 = NULL;( B' B3 w  r& L1 q) r
  74. char *dmabufsrc2 = NULL;& \' T) J4 S8 R5 d" f( e7 }- y
  75. char *dmabufdest1 = NULL;+ f( X  n) l; L. `% p8 ~
  76. char *dmabufdest2 = NULL;8 s9 r! V; ~% i5 S+ J( W$ q
  77. 3 p; q; R5 s- K, k
  78. static int acnt = 512;- k; l( r' O% d9 Q  A
  79. static int bcnt = 8;
    6 X7 ]% ~/ ^# F* B. Y
  80. static int ccnt = 8;
    3 U2 K2 L6 U  a$ E! g3 U9 E
  81. ! I" V( e: E9 ]
  82. module_param(acnt, int, S_IRUGO);
    & H1 r% p0 {" W3 U: M# M
  83. module_param(bcnt, int, S_IRUGO);4 X9 ~5 m2 C4 c0 W
  84. module_param(ccnt, int, S_IRUGO);
复制代码
' R0 b( y9 ]2 r- w% I+ k  F2 k

& x; R& j3 _  K: ^- Z7 I) z      这是在TI上找到的一个针对Davanci处理器简单的EDMA3驱动程序测试例程的一部分,我在编译的过程中是用( F- K4 m9 v  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这个命令来链接库文件进行编译,但是报的错误特别多,我又试着一个函数一个函数往进加,仍然是很多错误。
% [+ I0 Y- o, f$ h1 |; e- A     我想问一下如何用一个简单的程序来测试一下EDMA3的驱动。
2 @* I- r0 f+ i- y) Z; }: l- M. b. P. Q3 j. l
# u" L( }, [7 S9 p3 s; D
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 分享淘帖
回复

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2026-2-21 18:18 , Processed in 0.040345 second(s), 25 queries .

Powered by Discuz! X3.2

© 2001-2015 Comsenz Inc.

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