Linux Driver Development (ii) use of-DMA (i) __linux

Source: Internet
Author: User
1 DMA ConceptsDMA as the name implies refers to the device and memory, memory and external storage devices for direct data read and write operations, without the need for CPU participation. 2 DMA PrincipleDMA transfer needs to be performed by DMA controller DMAC, when DMA transfer is required, the DMA controller emits a request to occupy the bus, and when the CPU responds to the DMA request, it temporarily abandons the control of the bus, and when the DMA transfer is over, Dmac sends the end command to the I/O interface. and return the bus control power to the CPU. A full DMA transfer process must pass through 4 steps of DMA request, DMA response, DMA transfer, and DMA completion.
3 DMA Transfer process
4 DMA Hardware control pins

In Linux driver development, several pins that use DMA to manipulate DMAC (DMA controllers) are described as follows:

1. Data bus: used for transmission;

2. Address bus select、read: Used to select the memory address;

3. Data transmission signal: MEMR for Memory read operation Signal, MEMW for memory write operation Signal, IOR for peripheral read operation Signal, IOW write operation signal for peripheral;

4.DRQ:DMA request signal, the peripheral to the DMA controller to request the operation of the DMA operation of the application signal;

5.DACK:DMA response signal, DMAC to respond to the DMA request operation of the peripheral;

6.HOLD: Bus request signal, DMAC to the CPU to temporarily occupy the bus signal;

7.HLDA: Bus response signal, the CPU to the DMAC issued to allow temporary control of the bus signal; 5 Drive Development DMA Usage-code writing framework

1.DMA Initialization: DMA channel request, DMA transfer Direction setting (Mem->mem, Mem->dev, DEV->MEM), DMA data transfer settings (one byte or multiple bytes per transmission);

2.DMA Source address and Destination address setting: The DMA source address is the physical address of the memory, and the DMA destination address is the physical address of the data register of the peripheral;

3.DMA transfer start function call;

4.DMA transfer End Function call;

OK, this chapter simply introduces the concept of DMA, and the following chapters will illustrate the use of DMA in drive development through the actual project code.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.