element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Avnet Boards Forums
  • Products
  • Dev Tools
  • Avnet Boards Community
  • Avnet Boards Forums
  • More
  • Cancel
Avnet Boards Forums
Software Application Development Cannot access MM2S_LENGTH and S2MM_LENGTH of AXI DMA.
  • Forum
  • Documents
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Avnet Boards Forums to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Not Answered
  • Replies 1 reply
  • Subscribers 315 subscribers
  • Views 441 views
  • Users 0 members are here
Related

Cannot access MM2S_LENGTH and S2MM_LENGTH of AXI DMA.

Former Member
Former Member over 10 years ago

Hello. I am trying to develop a demo project of AXI DMA on Vivado v2014.4. An AXI DMA IP core was connected to the AXI ACP port of zynq. And the S_AXI_S2MM was connected with M_AXI_MM2S directly, so the DMA can receive the data sent by itself. The send and receive functions of AXI DMA have been successfully evaluated with a standalone program on SDK.

However, I failed in developing the Linux (3.17.0) driver of AXI DMA. To simplify the developing process, I did not use the AXI DMA driver provided by Xilinx, but tried to control the DMA by access its registers. The main part of the driver is as follows:

#define MM2S_DMACR 0x00
#define MM2S_DMASR 0x04
#define MM2S_SA 0x18
#define MM2S_LENGTH 0x28
#define S2MM_DMACR 0x30
#define S2MM_DMASR 0x34
#define S2MM_DA 0x48
#define S2MM_LENGTH 0x58



axi_dma_base_addr = (unsigned long)ioremap_nocache(AXI_DMA_PHY_ADDR,sizeof(u32)*24)u200B;

axi_dma_devp->tx_physical=virt_to_phys(axi_dma_devp->posMu_tx_dst);
axi_dma_devp->rx_physical=virt_to_phys(axi_dma_devp->result_rx_dst);

iowrite32(0x04, (void __iomem *)(axi_dma_base_addr + MM2S_DMACR));
while(ioread32((void __iomem *)(axi_dma_base_addr + MM2S_DMACR)) & 0x04);
iowrite32(0x04, (void __iomem *)(axi_dma_base_addr + S2MM_DMACR));
while(ioread32((void __iomem *)(axi_dma_base_addr + S2MM_DMACR)) & 0x04);
iowrite32(0x1001, (void __iomem *)(axi_dma_base_addr + MM2S_DMACR));
while(ioread32((void __iomem *)(axi_dma_base_addr + MM2S_DMASR)) & 0x01);
iowrite32(0x1001, (void __iomem *)(axi_dma_base_addr + S2MM_DMACR));
while(ioread32((void __iomem *)(axi_dma_base_addr + S2MM_DMASR)) & 0x01);
iowrite32(axi_dma_devp->tx_physical, (void __iomem *)(axi_dma_base_addr + MM2S_SA));
iowrite32(axi_dma_devp->rx_physical, (void __iomem *)(axi_dma_base_addr + S2MM_DA));
iowrite32(0x00000100, (void __iomem *)(axi_dma_base_addr + S2MM_LENGTH));
iowrite32(0x00000100, (void __iomem *)(axi_dma_base_addr + MM2S_LENGTH));

And the information returned from the kernel was:

S2MM_DMACR=0x11003
S2MM_DMASR=0x0
S2MM_DA=0x1cba9000
S2MM_LENGTH=0x0
MM2S_DMACR=0x11003
MM2S_DMASR=0x0
MM2S_SA=0x1cba8000
MM2S_LENGTH=0x0

It seemed that the driver failed to access the registers of MM2S_LENGTH and S2MM_LENGTH. So the send and receive operations did not start. The order of register operations in the driver is as same as that in the standalone program. But it did not work.

How can I solve this problem, thanks very much!

  • Sign in to reply
  • Cancel
  • Former Member
    0 Former Member over 10 years ago

    I have solved this problem. I set the "Width of Buffer Length Register", which is a parameter of AXI DMA, to 8 bits, but tried to transfer 1024 bytes data (11bits length). So the AXI DMA imited the length. That's the reason why the MM2S_LENGTH and S2MM_LENGTH cannot be accessed.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube