简体   繁体   中英

Linux dma device driver dma_request_channel fails

I'm trying to write a platform driver that interfaces with the DMA on an embedded system. We are using the Zedboard and Xilinx's AXI DMA IP. However, I believe our errors are related to the Linux kernel.

To get a tx/rx channel for the DMA, linux provides the dma_request_channel function. This function uses a filter and a filter parameter that needs to match the DMA. This function gets a list of all the DMA's available in the system and uses the filter to match it to the one we want. However, it would seem that this is not able to get all the available DMA's but only one. ARM cores come with their own PL330 hard IP DMA . That is the only one it sees.

The kernel code is oh so convoluted to understand that I am stuck in the list header file here

Could someone explain what LIST_HEAD_INIT does? What C syntax is that?

Do I need to to something do have the hardware peripheral become visible to the OS? I thought the device tree takes care of that and we have included it in the device tree. We can also get the base address of this by using the get_platform_resources API.

Could someone explain what LIST_HEAD_INIT does? What C syntax is that?

LIST_HEAD_INIT is a macro which initializes the members of struct list_head in LIST_HEAD macro.

#define LIST_HEAD_INIT(name) { &(name), &(name) }

#define LIST_HEAD(name) \
          struct list_head name = LIST_HEAD_INIT(name) 

//Taken from scripts/kconfig/list.h    
struct list_head {
          struct list_head *next, *prev;
  };

Here both prev and next is initialized with same member.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM