Submit Search
Upload
Linux DMA Engine
•
3 likes
•
6,454 views
S
SysPlay eLearning Academy for You
Follow
DMA Management in Linux
Read less
Read more
Technology
Slideshow view
Report
Share
Slideshow view
Report
Share
1 of 23
Recommended
Linux dma engine
Linux dma engine
pradeep_tewani
I2c drivers
I2c drivers
pradeep_tewani
Embedded linux network device driver development
Embedded linux network device driver development
Amr Ali (ISTQB CTAL Full, CSM, ITIL Foundation)
Introduction to Linux Drivers
Introduction to Linux Drivers
Anil Kumar Pugalia
Network Drivers
Network Drivers
Anil Kumar Pugalia
DMA Survival Guide
DMA Survival Guide
Kernel TLV
The TCP/IP Stack in the Linux Kernel
The TCP/IP Stack in the Linux Kernel
Divye Kapoor
Interrupts
Interrupts
Anil Kumar Pugalia
Recommended
Linux dma engine
Linux dma engine
pradeep_tewani
I2c drivers
I2c drivers
pradeep_tewani
Embedded linux network device driver development
Embedded linux network device driver development
Amr Ali (ISTQB CTAL Full, CSM, ITIL Foundation)
Introduction to Linux Drivers
Introduction to Linux Drivers
Anil Kumar Pugalia
Network Drivers
Network Drivers
Anil Kumar Pugalia
DMA Survival Guide
DMA Survival Guide
Kernel TLV
The TCP/IP Stack in the Linux Kernel
The TCP/IP Stack in the Linux Kernel
Divye Kapoor
Interrupts
Interrupts
Anil Kumar Pugalia
Kernel Recipes 2019 - XDP closer integration with network stack
Kernel Recipes 2019 - XDP closer integration with network stack
Anne Nicolas
Board Bringup
Board Bringup
Anil Kumar Pugalia
Spi drivers
Spi drivers
pradeep_tewani
SPI Drivers
SPI Drivers
SysPlay eLearning Academy for You
Jagan Teki - U-boot from scratch
Jagan Teki - U-boot from scratch
linuxlab_conf
Linux Networking Explained
Linux Networking Explained
Thomas Graf
VLANs in the Linux Kernel
VLANs in the Linux Kernel
Kernel TLV
Detecting Silent Data Corruptions using Linux DMA Debug API
Detecting Silent Data Corruptions using Linux DMA Debug API
Samsung Open Source Group
The linux networking architecture
The linux networking architecture
hugo lu
Linux Serial Driver
Linux Serial Driver
艾鍗科技
Static partitioning virtualization on RISC-V
Static partitioning virtualization on RISC-V
RISC-V International
Linux MMAP & Ioremap introduction
Linux MMAP & Ioremap introduction
Gene Chang
Kernel Process Management
Kernel Process Management
pradeep_tewani
Arm device tree and linux device drivers
Arm device tree and linux device drivers
Houcheng Lin
Linux Network Stack
Linux Network Stack
Adrien Mahieux
Soc architecture and design
Soc architecture and design
Satya Harish
SR-IOV: The Key Enabling Technology for Fully Virtualized HPC Clusters
SR-IOV: The Key Enabling Technology for Fully Virtualized HPC Clusters
Glenn K. Lockwood
LAS16-200: SCMI - System Management and Control Interface
LAS16-200: SCMI - System Management and Control Interface
Linaro
I2C Drivers
I2C Drivers
SysPlay eLearning Academy for You
I2c drivers
I2c drivers
Pradeep Tewani
An Oracle approach to the Taxi Fare problem
An Oracle approach to the Taxi Fare problem
Jose Rodríguez
IBM Notes Traveler Best Practices
IBM Notes Traveler Best Practices
jayeshpar2006
More Related Content
What's hot
Kernel Recipes 2019 - XDP closer integration with network stack
Kernel Recipes 2019 - XDP closer integration with network stack
Anne Nicolas
Board Bringup
Board Bringup
Anil Kumar Pugalia
Spi drivers
Spi drivers
pradeep_tewani
SPI Drivers
SPI Drivers
SysPlay eLearning Academy for You
Jagan Teki - U-boot from scratch
Jagan Teki - U-boot from scratch
linuxlab_conf
Linux Networking Explained
Linux Networking Explained
Thomas Graf
VLANs in the Linux Kernel
VLANs in the Linux Kernel
Kernel TLV
Detecting Silent Data Corruptions using Linux DMA Debug API
Detecting Silent Data Corruptions using Linux DMA Debug API
Samsung Open Source Group
The linux networking architecture
The linux networking architecture
hugo lu
Linux Serial Driver
Linux Serial Driver
艾鍗科技
Static partitioning virtualization on RISC-V
Static partitioning virtualization on RISC-V
RISC-V International
Linux MMAP & Ioremap introduction
Linux MMAP & Ioremap introduction
Gene Chang
Kernel Process Management
Kernel Process Management
pradeep_tewani
Arm device tree and linux device drivers
Arm device tree and linux device drivers
Houcheng Lin
Linux Network Stack
Linux Network Stack
Adrien Mahieux
Soc architecture and design
Soc architecture and design
Satya Harish
SR-IOV: The Key Enabling Technology for Fully Virtualized HPC Clusters
SR-IOV: The Key Enabling Technology for Fully Virtualized HPC Clusters
Glenn K. Lockwood
LAS16-200: SCMI - System Management and Control Interface
LAS16-200: SCMI - System Management and Control Interface
Linaro
I2C Drivers
I2C Drivers
SysPlay eLearning Academy for You
I2c drivers
I2c drivers
Pradeep Tewani
What's hot
(20)
Kernel Recipes 2019 - XDP closer integration with network stack
Kernel Recipes 2019 - XDP closer integration with network stack
Board Bringup
Board Bringup
Spi drivers
Spi drivers
SPI Drivers
SPI Drivers
Jagan Teki - U-boot from scratch
Jagan Teki - U-boot from scratch
Linux Networking Explained
Linux Networking Explained
VLANs in the Linux Kernel
VLANs in the Linux Kernel
Detecting Silent Data Corruptions using Linux DMA Debug API
Detecting Silent Data Corruptions using Linux DMA Debug API
The linux networking architecture
The linux networking architecture
Linux Serial Driver
Linux Serial Driver
Static partitioning virtualization on RISC-V
Static partitioning virtualization on RISC-V
Linux MMAP & Ioremap introduction
Linux MMAP & Ioremap introduction
Kernel Process Management
Kernel Process Management
Arm device tree and linux device drivers
Arm device tree and linux device drivers
Linux Network Stack
Linux Network Stack
Soc architecture and design
Soc architecture and design
SR-IOV: The Key Enabling Technology for Fully Virtualized HPC Clusters
SR-IOV: The Key Enabling Technology for Fully Virtualized HPC Clusters
LAS16-200: SCMI - System Management and Control Interface
LAS16-200: SCMI - System Management and Control Interface
I2C Drivers
I2C Drivers
I2c drivers
I2c drivers
Similar to Linux DMA Engine
An Oracle approach to the Taxi Fare problem
An Oracle approach to the Taxi Fare problem
Jose Rodríguez
IBM Notes Traveler Best Practices
IBM Notes Traveler Best Practices
jayeshpar2006
Open mic on ibm notes traveler best practices
Open mic on ibm notes traveler best practices
a8us
IBM Streams V4.1 Integration with IBM Platform Symphony
IBM Streams V4.1 Integration with IBM Platform Symphony
lisanl
A d swincc03_create_project_pt
A d swincc03_create_project_pt
confidencial
SAP HANA SPS10- SAP HANA Platform Lifecycle Management
SAP HANA SPS10- SAP HANA Platform Lifecycle Management
SAP Technology
BOS K8S Meetup - Finetuning LLama 2 Model on GKE.pdf
BOS K8S Meetup - Finetuning LLama 2 Model on GKE.pdf
MichaelOLeary82
Camunda BPM 7.13 Webinar
Camunda BPM 7.13 Webinar
camunda services GmbH
Shared Memory Communications-Direct Memory Access (SMC-D) Overview
Shared Memory Communications-Direct Memory Access (SMC-D) Overview
zOSCommserver
November 2012 (New Tuner Admin feature)
November 2012 (New Tuner Admin feature)
CM-UG.com
Trouble shooting apachecloudstack
Trouble shooting apachecloudstack
Sailaja Sunil
Stackato Presentation Techzone 2013
Stackato Presentation Techzone 2013
Martin Kenneth Michalsky
Help, My Kafka is Broken! (Emma Humber & Gantigmaa Selenge, IBM) Kafka Summit...
Help, My Kafka is Broken! (Emma Humber & Gantigmaa Selenge, IBM) Kafka Summit...
HostedbyConfluent
Building Hadoop-as-a-Service with Pivotal Hadoop Distribution, Serengeti, & I...
Building Hadoop-as-a-Service with Pivotal Hadoop Distribution, Serengeti, & I...
EMC
Troubleshooting Apache Cloudstack
Troubleshooting Apache Cloudstack
Radhika Puthiyetath
Fast Kafka Apps! (Edoardo Comar and Mickael Maison, IBM) Kafka Summit London ...
Fast Kafka Apps! (Edoardo Comar and Mickael Maison, IBM) Kafka Summit London ...
confluent
SAP (in)security: Scrubbing SAP clean with SOAP
SAP (in)security: Scrubbing SAP clean with SOAP
Chris John Riley
Strategy and best practice for modern RPG
Strategy and best practice for modern RPG
Alemanalfredo
Helm Charts Security 101
Helm Charts Security 101
Deep Datta
Share point 2013’s distributed cache service 6.0 (1)
Share point 2013’s distributed cache service 6.0 (1)
Hexaware Technologies
Similar to Linux DMA Engine
(20)
An Oracle approach to the Taxi Fare problem
An Oracle approach to the Taxi Fare problem
IBM Notes Traveler Best Practices
IBM Notes Traveler Best Practices
Open mic on ibm notes traveler best practices
Open mic on ibm notes traveler best practices
IBM Streams V4.1 Integration with IBM Platform Symphony
IBM Streams V4.1 Integration with IBM Platform Symphony
A d swincc03_create_project_pt
A d swincc03_create_project_pt
SAP HANA SPS10- SAP HANA Platform Lifecycle Management
SAP HANA SPS10- SAP HANA Platform Lifecycle Management
BOS K8S Meetup - Finetuning LLama 2 Model on GKE.pdf
BOS K8S Meetup - Finetuning LLama 2 Model on GKE.pdf
Camunda BPM 7.13 Webinar
Camunda BPM 7.13 Webinar
Shared Memory Communications-Direct Memory Access (SMC-D) Overview
Shared Memory Communications-Direct Memory Access (SMC-D) Overview
November 2012 (New Tuner Admin feature)
November 2012 (New Tuner Admin feature)
Trouble shooting apachecloudstack
Trouble shooting apachecloudstack
Stackato Presentation Techzone 2013
Stackato Presentation Techzone 2013
Help, My Kafka is Broken! (Emma Humber & Gantigmaa Selenge, IBM) Kafka Summit...
Help, My Kafka is Broken! (Emma Humber & Gantigmaa Selenge, IBM) Kafka Summit...
Building Hadoop-as-a-Service with Pivotal Hadoop Distribution, Serengeti, & I...
Building Hadoop-as-a-Service with Pivotal Hadoop Distribution, Serengeti, & I...
Troubleshooting Apache Cloudstack
Troubleshooting Apache Cloudstack
Fast Kafka Apps! (Edoardo Comar and Mickael Maison, IBM) Kafka Summit London ...
Fast Kafka Apps! (Edoardo Comar and Mickael Maison, IBM) Kafka Summit London ...
SAP (in)security: Scrubbing SAP clean with SOAP
SAP (in)security: Scrubbing SAP clean with SOAP
Strategy and best practice for modern RPG
Strategy and best practice for modern RPG
Helm Charts Security 101
Helm Charts Security 101
Share point 2013’s distributed cache service 6.0 (1)
Share point 2013’s distributed cache service 6.0 (1)
More from SysPlay eLearning Academy for You
Linux Internals Part - 3
Linux Internals Part - 3
SysPlay eLearning Academy for You
Linux Internals Part - 2
Linux Internals Part - 2
SysPlay eLearning Academy for You
Linux Internals Part - 1
Linux Internals Part - 1
SysPlay eLearning Academy for You
Kernel Timing Management
Kernel Timing Management
SysPlay eLearning Academy for You
Understanding the BBB
Understanding the BBB
SysPlay eLearning Academy for You
POSIX Threads
POSIX Threads
SysPlay eLearning Academy for You
Cache Management
Cache Management
SysPlay eLearning Academy for You
SPI Drivers
SPI Drivers
SysPlay eLearning Academy for You
BeagleBone Black Bootloaders
BeagleBone Black Bootloaders
SysPlay eLearning Academy for You
Introduction to BeagleBone Black
Introduction to BeagleBone Black
SysPlay eLearning Academy for You
Introduction to BeagleBoard-xM
Introduction to BeagleBoard-xM
SysPlay eLearning Academy for You
Platform Drivers
Platform Drivers
SysPlay eLearning Academy for You
BeagleBone Black Bootloaders
BeagleBone Black Bootloaders
SysPlay eLearning Academy for You
BeagleBone Black Booting Process
BeagleBone Black Booting Process
SysPlay eLearning Academy for You
BeagleBoard-xM Bootloaders
BeagleBoard-xM Bootloaders
SysPlay eLearning Academy for You
BeagleBoard-xM Booting Process
BeagleBoard-xM Booting Process
SysPlay eLearning Academy for You
Serial Drivers
Serial Drivers
SysPlay eLearning Academy for You
Linux System
Linux System
SysPlay eLearning Academy for You
More from SysPlay eLearning Academy for You
(18)
Linux Internals Part - 3
Linux Internals Part - 3
Linux Internals Part - 2
Linux Internals Part - 2
Linux Internals Part - 1
Linux Internals Part - 1
Kernel Timing Management
Kernel Timing Management
Understanding the BBB
Understanding the BBB
POSIX Threads
POSIX Threads
Cache Management
Cache Management
SPI Drivers
SPI Drivers
BeagleBone Black Bootloaders
BeagleBone Black Bootloaders
Introduction to BeagleBone Black
Introduction to BeagleBone Black
Introduction to BeagleBoard-xM
Introduction to BeagleBoard-xM
Platform Drivers
Platform Drivers
BeagleBone Black Bootloaders
BeagleBone Black Bootloaders
BeagleBone Black Booting Process
BeagleBone Black Booting Process
BeagleBoard-xM Bootloaders
BeagleBoard-xM Bootloaders
BeagleBoard-xM Booting Process
BeagleBoard-xM Booting Process
Serial Drivers
Serial Drivers
Linux System
Linux System
Recently uploaded
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
Rafal Los
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
Puma Security, LLC
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
Allon Mureinik
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
Pixlogix Infotech
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Katpro Technologies
Slack Application Development 101 Slides
Slack Application Development 101 Slides
praypatel2
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
Pooja Nehwal
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
Gabriella Davis
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
ThousandEyes
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
Mark Billinghurst
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
Maria Levchenko
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
Radu Cotescu
Key Features Of Token Development (1).pptx
Key Features Of Token Development (1).pptx
LBM Solutions
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
Delhi Call girls
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Patryk Bandurski
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
Sinan KOZAK
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
HostedbyConfluent
How to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
naman860154
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
Neo4j
Recently uploaded
(20)
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Slack Application Development 101 Slides
Slack Application Development 101 Slides
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
Key Features Of Token Development (1).pptx
Key Features Of Token Development (1).pptx
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
How to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
Linux DMA Engine
1.
© 2019 SysPlay
Workshops <workshop@sysplay.in> All Rights Reserved. Linux DMA Engine
2.
2© 2019 SysPlay
Workshops <workshop@sysplay.in> All Rights Reserved. What to Expect? DMA Controllers Types of DMA Transfers Linux DMA Engine API Steps for DMA Transfer
3.
3© 2019 SysPlay
Workshops <workshop@sysplay.in> All Rights Reserved. DMA Controllers Descriptor Buffer DMA Controller Device Controller FIFO Request Line
4.
4© 2019 SysPlay
Workshops <workshop@sysplay.in> All Rights Reserved. Contiguous Memory DMA Device Controller RAM FIFO
5.
5© 2019 SysPlay
Workshops <workshop@sysplay.in> All Rights Reserved. Device Controller RAM Scatter Gather DMA FIFO
6.
6© 2019 SysPlay
Workshops <workshop@sysplay.in> All Rights Reserved. Scatter Gather Descriptors Source Destination Size Configuration Next Source Destination Size Configuration Next Source Destination Size Configuration Next End Interrupt
7.
7© 2019 SysPlay
Workshops <workshop@sysplay.in> All Rights Reserved. Cyclic Transfers Source Destination Size Configuration Next Source Destination Size Configuration Next Source Destination Size Configuration Next InterruptInterrupt Interrupt
8.
8© 2019 SysPlay
Workshops <workshop@sysplay.in> All Rights Reserved. DMA Controller with Peripherals RAM SPI Controller Audio Controller Network Controller Buffer Buffer Buffer DMA Controller FIFO FIFO FIFO
9.
9© 2019 SysPlay
Workshops <workshop@sysplay.in> All Rights Reserved. Linux DMA Engine The DMA Engine driver works as a layer on the top of SoC (e.g. TI) specific DMA driver using the slave DMA API The reason its called as slave is due to the fact that software initiates the DMA transactions to the DMA controller hardware rather than a hardware device with a integrated DMA initiating the transfer Drivers using the DMA Engine are referred to as a clients
10.
10© 2019 SysPlay
Workshops <workshop@sysplay.in> All Rights Reserved. Kernel Linux DMA Engine... SoC DMA Driver DMA Engine Driver Device Specific Driver Applicaton
11.
11© 2019 SysPlay
Workshops <workshop@sysplay.in> All Rights Reserved. Steps in DMA Transfer Allocate a DMA slave channel Set Slave & controller specific params Get a Descriptor for the transaction Submit the transaction to queue it in the DMA Start the Transaction Wait for it to complete
12.
12© 2019 SysPlay
Workshops <workshop@sysplay.in> All Rights Reserved. DMA channel Header: include/linux/dmaengine.h Data Structure: struct dma_chan { struct dma_device; dma_cookie_t cookie; chan_id; client_count; table_count; }
13.
13© 2019 SysPlay
Workshops <workshop@sysplay.in> All Rights Reserved. Allocate a DMA Channel Header: include/linux/dmaengine.h APIs: dma_caps_set(transaction_type, mask); struct dma_chan *dma_request_slave_channel(struct device *dev, const char *name);
14.
14© 2019 SysPlay
Workshops <workshop@sysplay.in> All Rights Reserved. Allocate a DMA Channel Example Set up the capabilities for the channel that will be requested dma_cap_mask_t mask; dma_cap_zero(mask); dma_cap_set(DMA_SLAVE | DMA_PRIVATE, mask); Request the DMA channel from the DMA engine chan = dma_request_channel(mask, NULL, NULL); Release the DMA channel dma_release_channel(chan);
15.
15© 2019 SysPlay
Workshops <workshop@sysplay.in> All Rights Reserved. Set DMA Slave & Controller Params DMA slave channel runtime configuration Data Structure: struct dma_slave_config { enum dma_transfer_direction direction; dma_addr_t src_addr; dma_addr_t dst_addr; enum dma_slave_buswidth src_addr_width; enum dma_slave_buswidth dst_addr_width; u32 src_maxburst; u32 dst_maxburst; bool device_fc; unsigned int slave_id; }; API: dmaengine_slave_config(dma_channel, dma_slave_config *);
16.
16© 2019 SysPlay
Workshops <workshop@sysplay.in> All Rights Reserved. Set Controller Params Example struct dma_slave_config cfg; cfg.src_addr = OMAP2_MCSPI_RX0; cfg.dst_addr = OMAP2_MCSPI_TX0; cfg.src_addr_width = width; cfg.dst_addr_width = width; cfg.src_maxburst = burst; cfg.dst_maxburst = burst; dmaengine_slave_config(dma_channel, cfg);
17.
17© 2019 SysPlay
Workshops <workshop@sysplay.in> All Rights Reserved. Prepare the Descriptor Descriptor is used to describe a DMA transaction struct dma_async_tx_descriptor *dmaengine_prep_slave_single(parameters); Parameters: struct dma_chan *chan dma_addr_t buff size_t len enum dma_transfer_direction dir unsigned long flags DMA_PREPARE_INTERRUPT, DMA_CTRL_ACK
18.
18© 2019 SysPlay
Workshops <workshop@sysplay.in> All Rights Reserved. Prepare a Descriptor & Setting the Callback Example Allocate a 1K buffer of cached contiguous memory char *buf = kmalloc(1024, GFP_KERNEL | GFP_DMA); Get the physical address for the buffer dma_buf = dma_map_single(device, buf, 1024, DMA_TO_DEVICE); Prepare the descriptor for the DMA transaction Enum dma_ctrl_flags flags = DMA_CTRL_ACK | DMA_PREP_INTERRUPT; chan_des = dma_engine_prep_slave_single(chan, dma_buf, 1024, DMA_MEM_TO_DEV, flags); Set up the callback function for the descriptor chan_des->callback = <callback when the transfer completes>; chan_des->callback_param = cmp;
19.
19© 2019 SysPlay
Workshops <workshop@sysplay.in> All Rights Reserved. Submit & Start the DMA Transaction The dmaengine_submit() function submits the descriptor to the DMA engine to be put into the pending queue The returned cookie can be used to check the progress The dma_sync_issue_pending() function is used to start the DMA transaction that was previously put in pending queue If the channel is idle, then the first transaction in queue is started and the subsequent transactions are queued up On completion of each in queue, the next in queue is started and a tasklet is triggered. The tasklet will then call the client driver completion callback routine for notification, if set
20.
20© 2019 SysPlay
Workshops <workshop@sysplay.in> All Rights Reserved. Submit & Start the Transaction Submit the descriptor to DMA engine dma_cookie_t dmaengine_submit(struct dma_async_tx_descriptor *desc); Start the transaction dma_async_issue_pending(struct dma_chan *chan);
21.
21© 2019 SysPlay
Workshops <workshop@sysplay.in> All Rights Reserved. References <kernel src tree>/Documentation/dmaengine/ client.txt External Video Reference https://www.xilinx.com/video/soc/linux-dma-in-device- drivers.html
22.
22© 2019 SysPlay
Workshops <workshop@sysplay.in> All Rights Reserved. What all have we learnt? DMA Controllers Types of DMA Transfers Linux DMA Engine API Steps for DMA Transfer
23.
23© 2019 SysPlay
Workshops <workshop@sysplay.in> All Rights Reserved. Any Queries?