Submit Search
Upload
Linux DMA Engine
•
3 likes
•
6,457 views
S
SysPlay eLearning Academy for You
Follow
DMA Management in Linux
Read less
Read more
Technology
Report
Share
Report
Share
1 of 23
Recommended
Linux dma engine
Linux dma engine
pradeep_tewani
Linux MMAP & Ioremap introduction
Linux MMAP & Ioremap introduction
Gene Chang
DPDK: Multi Architecture High Performance Packet Processing
DPDK: Multi Architecture High Performance Packet Processing
Michelle Holley
The linux networking architecture
The linux networking architecture
hugo lu
用Raspberry Pi 學Linux I2C Driver
用Raspberry Pi 學Linux I2C Driver
艾鍗科技
Linux Kernel MMC Storage driver Overview
Linux Kernel MMC Storage driver Overview
RajKumar Rampelli
VLANs in the Linux Kernel
VLANs in the Linux Kernel
Kernel TLV
Linux Ethernet device driver
Linux Ethernet device driver
艾鍗科技
Recommended
Linux dma engine
Linux dma engine
pradeep_tewani
Linux MMAP & Ioremap introduction
Linux MMAP & Ioremap introduction
Gene Chang
DPDK: Multi Architecture High Performance Packet Processing
DPDK: Multi Architecture High Performance Packet Processing
Michelle Holley
The linux networking architecture
The linux networking architecture
hugo lu
用Raspberry Pi 學Linux I2C Driver
用Raspberry Pi 學Linux I2C Driver
艾鍗科技
Linux Kernel MMC Storage driver Overview
Linux Kernel MMC Storage driver Overview
RajKumar Rampelli
VLANs in the Linux Kernel
VLANs in the Linux Kernel
Kernel TLV
Linux Ethernet device driver
Linux Ethernet device driver
艾鍗科技
XPDS16: Keeping coherency on ARM - Julien Grall, ARM
XPDS16: Keeping coherency on ARM - Julien Grall, ARM
The Linux Foundation
I2C Drivers
I2C Drivers
SysPlay eLearning Academy for You
Linux Network Stack
Linux Network Stack
Adrien Mahieux
Dpdk applications
Dpdk applications
Vipin Varghese
Linux SD/MMC device driver
Linux SD/MMC device driver
艾鍗科技
Building Network Functions with eBPF & BCC
Building Network Functions with eBPF & BCC
Kernel TLV
The TCP/IP Stack in the Linux Kernel
The TCP/IP Stack in the Linux Kernel
Divye Kapoor
Spi drivers
Spi drivers
pradeep_tewani
The Linux Block Layer - Built for Fast Storage
The Linux Block Layer - Built for Fast Storage
Kernel TLV
Linux on ARM 64-bit Architecture
Linux on ARM 64-bit Architecture
Ryo Jin
Linux kernel memory allocators
Linux kernel memory allocators
Hao-Ran Liu
Ixgbe internals
Ixgbe internals
SUSE Labs Taipei
Virtualization Support in ARMv8+
Virtualization Support in ARMv8+
Aananth C N
Linux 4.x Tracing: Performance Analysis with bcc/BPF
Linux 4.x Tracing: Performance Analysis with bcc/BPF
Brendan Gregg
DPDK & Layer 4 Packet Processing
DPDK & Layer 4 Packet Processing
Michelle Holley
Experience on porting HIGHMEM and KASAN to RISC-V at COSCUP 2020
Experience on porting HIGHMEM and KASAN to RISC-V at COSCUP 2020
Eric Lin
RISC-V Boot Process: One Step at a Time
RISC-V Boot Process: One Step at a Time
Atish Patra
Network Programming: Data Plane Development Kit (DPDK)
Network Programming: Data Plane Development Kit (DPDK)
Andriy Berestovskyy
twlkh-linux-vsyscall-and-vdso
twlkh-linux-vsyscall-and-vdso
Viller Hsiao
DPDK in Containers Hands-on Lab
DPDK in Containers Hands-on Lab
Michelle Holley
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
XPDS16: Keeping coherency on ARM - Julien Grall, ARM
XPDS16: Keeping coherency on ARM - Julien Grall, ARM
The Linux Foundation
I2C Drivers
I2C Drivers
SysPlay eLearning Academy for You
Linux Network Stack
Linux Network Stack
Adrien Mahieux
Dpdk applications
Dpdk applications
Vipin Varghese
Linux SD/MMC device driver
Linux SD/MMC device driver
艾鍗科技
Building Network Functions with eBPF & BCC
Building Network Functions with eBPF & BCC
Kernel TLV
The TCP/IP Stack in the Linux Kernel
The TCP/IP Stack in the Linux Kernel
Divye Kapoor
Spi drivers
Spi drivers
pradeep_tewani
The Linux Block Layer - Built for Fast Storage
The Linux Block Layer - Built for Fast Storage
Kernel TLV
Linux on ARM 64-bit Architecture
Linux on ARM 64-bit Architecture
Ryo Jin
Linux kernel memory allocators
Linux kernel memory allocators
Hao-Ran Liu
Ixgbe internals
Ixgbe internals
SUSE Labs Taipei
Virtualization Support in ARMv8+
Virtualization Support in ARMv8+
Aananth C N
Linux 4.x Tracing: Performance Analysis with bcc/BPF
Linux 4.x Tracing: Performance Analysis with bcc/BPF
Brendan Gregg
DPDK & Layer 4 Packet Processing
DPDK & Layer 4 Packet Processing
Michelle Holley
Experience on porting HIGHMEM and KASAN to RISC-V at COSCUP 2020
Experience on porting HIGHMEM and KASAN to RISC-V at COSCUP 2020
Eric Lin
RISC-V Boot Process: One Step at a Time
RISC-V Boot Process: One Step at a Time
Atish Patra
Network Programming: Data Plane Development Kit (DPDK)
Network Programming: Data Plane Development Kit (DPDK)
Andriy Berestovskyy
twlkh-linux-vsyscall-and-vdso
twlkh-linux-vsyscall-and-vdso
Viller Hsiao
DPDK in Containers Hands-on Lab
DPDK in Containers Hands-on Lab
Michelle Holley
What's hot
(20)
XPDS16: Keeping coherency on ARM - Julien Grall, ARM
XPDS16: Keeping coherency on ARM - Julien Grall, ARM
I2C Drivers
I2C Drivers
Linux Network Stack
Linux Network Stack
Dpdk applications
Dpdk applications
Linux SD/MMC device driver
Linux SD/MMC device driver
Building Network Functions with eBPF & BCC
Building Network Functions with eBPF & BCC
The TCP/IP Stack in the Linux Kernel
The TCP/IP Stack in the Linux Kernel
Spi drivers
Spi drivers
The Linux Block Layer - Built for Fast Storage
The Linux Block Layer - Built for Fast Storage
Linux on ARM 64-bit Architecture
Linux on ARM 64-bit Architecture
Linux kernel memory allocators
Linux kernel memory allocators
Ixgbe internals
Ixgbe internals
Virtualization Support in ARMv8+
Virtualization Support in ARMv8+
Linux 4.x Tracing: Performance Analysis with bcc/BPF
Linux 4.x Tracing: Performance Analysis with bcc/BPF
DPDK & Layer 4 Packet Processing
DPDK & Layer 4 Packet Processing
Experience on porting HIGHMEM and KASAN to RISC-V at COSCUP 2020
Experience on porting HIGHMEM and KASAN to RISC-V at COSCUP 2020
RISC-V Boot Process: One Step at a Time
RISC-V Boot Process: One Step at a Time
Network Programming: Data Plane Development Kit (DPDK)
Network Programming: Data Plane Development Kit (DPDK)
twlkh-linux-vsyscall-and-vdso
twlkh-linux-vsyscall-and-vdso
DPDK in Containers Hands-on Lab
DPDK in Containers Hands-on Lab
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
Detecting Silent Data Corruptions using Linux DMA Debug API
Detecting Silent Data Corruptions using Linux DMA Debug API
Samsung Open Source Group
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
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
Detecting Silent Data Corruptions using Linux DMA Debug API
Detecting Silent Data Corruptions using Linux DMA Debug API
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
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
SPI Drivers
SPI Drivers
SysPlay eLearning Academy for You
Linux System
Linux System
SysPlay eLearning Academy for You
More from SysPlay eLearning Academy for You
(19)
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
SPI Drivers
SPI Drivers
Linux System
Linux System
Recently uploaded
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
Pooja Nehwal
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
V3cube
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Neo4j
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
Anna Loughnan Colquhoun
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Roshan Dwivedi
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
hans926745
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
The Digital Insurer
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
Puma Security, LLC
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
debabhi2
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
Enterprise Knowledge
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Katpro Technologies
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
Martijn de Jong
Slack Application Development 101 Slides
Slack Application Development 101 Slides
praypatel2
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
naman860154
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
Delhi Call girls
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
How to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
naman860154
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Drew Madelung
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
Principled Technologies
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
Radu Cotescu
Recently uploaded
(20)
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
Slack Application Development 101 Slides
Slack Application Development 101 Slides
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
How to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
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?