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

嵌入式开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

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

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

[复制链接]

5

主题

11

帖子

73

积分

注册会员

Rank: 2

积分
73
跳转到指定楼层
楼主
发表于 2018-1-30 11:01:43 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
本帖最后由 yyj 于 2018-1-30 11:01 编辑 ! V. I! k2 G. J# k
  1. [code]EDMA sample test application7 ]' M& a9 b* ]
  2. /*2 s7 A8 Q% h; P) F: a: t
  3. * edma_test.c+ _# `* R% P$ F7 T# @& Z' n% s
  4. *
    ) X' c! X) w8 H# T* K
  5. * brief  EDMA3 Test Application- U5 D) |' f2 N3 k: s
  6. *# y( w" w0 L, v' e5 }
  7. *   This file contains EDMA3 Test code.
    % l  \+ X) x0 B' ?& s
  8. *
    ( U* {6 F. ^; b' W9 k1 Y
  9. *   NOTE: THIS FILE IS PROVIDED ONLY FOR INITIAL DEMO RELEASE AND MAY BE
    8 d( ~' u* T% W" o( D* @4 Y" Y1 h
  10. *         REMOVED AFTER THE DEMO OR THE CONTENTS OF THIS FILE ARE SUBJECT
    * C! R7 y0 z5 D
  11. *         TO CHANGE.7 ]7 `9 h- x- o
  12. *$ Y" |, w% P$ [$ _, x
  13. * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
    : ]+ X$ B6 k" q# F% t/ c
  14. *! Z8 e3 {5 E$ j: x4 i- q
  15. * This program is free software; you can redistribute it and/or
    9 r5 Q0 n; y; d
  16. * modify it under the terms of the GNU General Public License as
    # X$ ^3 T' t% q% a8 U, \. `
  17. * published by the Free Software Foundation version 2.5 G- U$ E8 H/ O; j- z; n
  18. *
    : o" A9 T+ v4 }4 N: N
  19. * This program is distributed "as is" WITHOUT ANY WARRANTY of any
    * a$ A8 u( y3 p+ Z, b' x
  20. * kind, whether express or implied; without even the implied warranty1 b' d; I+ I* C& X
  21. * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    / k( v# E( Y$ v8 |/ W* V8 K' ^
  22. * GNU General Public License for more details.& q' F! `& G- ?' F
  23. */, U1 ?2 _& _" Y- w( l( y% i+ O( l
  24. : i0 t6 X. p! K8 Y+ k% a
  25. #include <linux/module.h>
    : w; d7 d  ]/ D' C+ C$ y1 g, {1 s
  26. #include <linux/init.h>
    . t8 L2 p$ R! f/ p5 f( w' I
  27. #include <linux/errno.h>
    # ^  o) K/ H3 g2 M
  28. #include <linux/types.h>1 O, y/ f2 B+ k/ ]- U
  29. #include <linux/interrupt.h>
    2 a9 ^. k$ ^6 _9 ?2 S+ B3 r3 E6 ^& t2 P
  30. #include <asm/io.h>) \3 Y1 g" f% d+ Q% k8 g' ^/ y) Y
  31. #include <linux/moduleparam.h>1 j9 D/ b& \' \7 P/ y
  32. #include <linux/sysctl.h>+ s6 `9 l, j+ d" M$ ^& z
  33. #include <linux/mm.h>$ N4 Z8 L5 l5 A2 y
  34. #include <linux/dma-mapping.h>
    ! Z& Y! @8 R/ M. x4 o, Q* U% u( J

  35.   Y- r% {6 K5 j: |
  36. #include <mach/memory.h>: n- Z) j8 p5 T7 _( U7 H: ]! |; I
  37. #include <mach/hardware.h>/ L. B; ~2 m/ ^( c
  38. #include <mach/irqs.h>% P3 f. H1 B% {+ O
  39. #include <asm/hardware/edma.h>
    * l5 l9 F6 ?$ f# F( n' u
  40. " q! S9 U" x( D
  41. #undef EDMA3_DEBUG
      d6 T4 p& W( d
  42. /*#define EDMA3_DEBUG*/; b- u# g" {. v* R
  43. 2 R0 c& g8 [$ ^$ c
  44. #ifdef EDMA3_DEBUG
    8 M" s& o) ]7 I# i' Z0 \- Y
  45. #define DMA_PRINTK(ARGS...)  printk(KERN_INFO "<%s>: ",__FUNCTION__);printk(ARGS)$ t; j. A4 a3 y; z) }9 G3 |
  46. #define DMA_FN_IN printk(KERN_INFO "[%s]: start\n", __FUNCTION__), k8 s: _9 e& F  f" R5 a
  47. #define DMA_FN_OUT printk(KERN_INFO "[%s]: end\n",__FUNCTION__)& r4 Z5 x/ f$ h1 t& U: r; z0 l* b
  48. #else3 E4 y& Y* ~: T9 t5 O5 V
  49. #define DMA_PRINTK( x... )
    2 j! l8 [- R+ _7 ?- p
  50. #define DMA_FN_IN$ ^  y. C! h; h: t" Y" v' ]
  51. #define DMA_FN_OUT8 @% E' p1 s) v* o2 F
  52. #endif& a, G& x8 N/ d3 x8 `: `% x1 Q. X
  53. 4 o) a6 `3 O6 b
  54. #define MAX_DMA_TRANSFER_IN_BYTES   (32768)
    " K8 E- j6 X- Z7 j+ {
  55. #define STATIC_SHIFT                3+ B' A; V5 a* P' D
  56. #define TCINTEN_SHIFT               20$ i- T. z! c+ ]
  57. #define ITCINTEN_SHIFT              214 z8 Y0 s7 \: B: B8 z& b7 r4 B
  58. #define TCCHEN_SHIFT                22( d; h9 y! I. i2 Q9 ]
  59. #define ITCCHEN_SHIFT               23. M5 Q" B9 E* u# Q9 S! {

  60. # @+ ^& d# j) ]! j* |( D& z3 O
  61. static volatile int irqraised1 = 0;$ y  V/ ]) Q: R3 w6 |; J9 u
  62. static volatile int irqraised2 = 0;
    $ S9 F$ o% o; Y

  63. # Z- ^! z$ Y( \
  64. int edma3_memtomemcpytest_dma(int acnt, int bcnt, int ccnt, int sync_mode, int event_queue);# E  u' l- y: Z
  65. int edma3_memtomemcpytest_dma_link(int acnt, int bcnt, int ccnt, int sync_mode, int event_queue);
    . B: l5 N, K# Q* Q7 ?1 a# r
  66. int edma3_memtomemcpytest_dma_chain(int acnt, int bcnt, int ccnt, int sync_mode, int event_queue);
    / |+ x2 r9 l1 y8 d
  67. & `" |! f4 }3 i) V
  68. dma_addr_t dmaphyssrc1 = 0;# w( t- E4 @( l4 h$ o
  69. dma_addr_t dmaphyssrc2 = 0;
    ' X0 F2 D0 K7 ^; J# ~
  70. dma_addr_t dmaphysdest1 = 0;
    + X3 T) U4 k: u
  71. dma_addr_t dmaphysdest2 = 0;
    ; X$ B. ~1 @6 ~% R  D* h. o( |$ E
  72. 0 U1 x% C5 e: e! a6 p, A' r
  73. char *dmabufsrc1 = NULL;, W! r" A, X8 U) W  j- P' C
  74. char *dmabufsrc2 = NULL;
    7 _- J$ k( Z) Q# @- }" {
  75. char *dmabufdest1 = NULL;
    9 u- r3 S, ~$ r: ?) B
  76. char *dmabufdest2 = NULL;
    # V1 p. c$ ^" M4 u
  77. 1 i! H# B: G; r* L2 t# P
  78. static int acnt = 512;
    . n- c* W6 \0 s- X! o
  79. static int bcnt = 8;
    3 k) V% I& l$ |/ M5 u( n) o
  80. static int ccnt = 8;. x9 Q5 U2 X2 s( L' C% Y: k/ W* n
  81. * ^, l7 a: H% J
  82. module_param(acnt, int, S_IRUGO);
    : ?5 }  J' k( c- Y# r0 _
  83. module_param(bcnt, int, S_IRUGO);
    / s( r9 t  z5 X: f3 v
  84. module_param(ccnt, int, S_IRUGO);
复制代码
; O" m5 `% ?( x
. ]# W' f8 r* @4 }& c
      这是在TI上找到的一个针对Davanci处理器简单的EDMA3驱动程序测试例程的一部分,我在编译的过程中是用
% Z, c6 K/ R" a3 ~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这个命令来链接库文件进行编译,但是报的错误特别多,我又试着一个函数一个函数往进加,仍然是很多错误。. E& y. `" o) R, v3 j! J0 g. {
     我想问一下如何用一个简单的程序来测试一下EDMA3的驱动。
9 [& T# b" s( X
7 ]; ~7 S7 T: p( u
- \# F% [8 P7 L. W
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 分享淘帖
回复

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2026-1-25 10:23 , Processed in 0.038171 second(s), 25 queries .

Powered by Discuz! X3.2

© 2001-2015 Comsenz Inc.

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