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

Source: Internet
Author: User

1 DMA ConceptsDMA, by definition, refers to the direct data-to-read operation between the device and memory, memory, and external storage devices without the need for CPU involvement. 2 DMA Principle DMA transmission needs to be carried out by the DMA controller DMAC, when the DMA transfer is required, the DMA controller will make a request to occupy the bus, when the CPU responds to the DMA request, temporarily abandon the control of the bus, when the DMA transfer is over, Dmac will i/ The O interface issues an end command and returns the bus control to the CPU.a full DMA transfer process must be 4 steps through DMA request, DMA response, DMA transfer, DMA termination.
3 DMA Transfer process
4 DMA Hardware control Pins

In Linux drive development, several pins that use DMA to operate the DMAC (DMA controller) are described below:

1. Data bus: Used for transmission of information;

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

3. Data transmission signal: MEMR is the memory read operation signal, MEMW is the memory write operation signal, the IOR is the peripheral reading operation Signal, IOW writes the operation signal for the peripheral;

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

5.DACK:DMA response Signal, DMAC the DMA request operation of the responding peripheral;

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

7.HLDA: Bus response signal, the CPU to DMAC issued to allow the temporary control of the bus signal;

5 DMA usage in drive development-code Authoring Framework

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

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

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 driver development through the actual project code.

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

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.