cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
5stones
Visitor
Visitor
256 Views
Registered: ‎09-13-2018

ZynqMP PS PCIE DMA register/descriptor setting

My goal is to use ZynqMP as an endpoint and to utilize its PCIe DMA to transfer the contents ZynqMP's DDR to the host PC's DRAM.

I found three documents(UG1087, UG1085, UG1228) for this job, but those documents are still lack of information.

I wish some experts who succeeded in the same goal could give me the answers about the questions below.

1. In ug1087(https://www.xilinx.com/html_docs/registers/ug1087/ug1087-zynq-ultrascale-registers.html), DMA_CHANNEL_SRC_Q_PTR_LO/DMA_CHANNEL_DST_Q_PTR_LO/DMA_CHANNEL_STAS_Q_PTR_LO/DMA_CHANNEL_STAD_Q_PTR_LO have the bit fields "read_attr" and "queue location." What I found in the source code(https://github.com/Xilinx/linux-xlnx/blob/master/drivers/dma/xilinx/xilinx_ps_pcie_platform.c) is:

  • "read_attr": 0 in endpoint, 2 in root dma 
  • "queue location": 0 in endpoint, 1 in root dma

I'm not sure if I understand correctly. Anyone who can confirm? 

 

2. In Figure 10-20 of UG1228, the format of DMA's descriptors has described as below, but it has no explanation about the bit field "Attributes" and "Location." 

UG1228_Page212.png

What I found in the source code(https://github.com/Xilinx/linux-xlnx/blob/master/drivers/dma/xilinx/xilinx_ps_pcie_platform.c) is:

  • "Attributes": 0x6 when Q is in AXI, 0x4 when Q is in PCIe
  • "Location": 0 if PCIe,1 if AXI
  • So, in my case that the ZynqMP endpoint transfers the data to the host PC, SRC_Q's Attributes should be 0x6 and DST_Q's Attributes should be 0x4.

I'm not sure if I understand correctly. Anyone who can confirm? 

 

3. In Figure 10-20 of UG1228, the format of DMA's STATUS descriptors has discrepancy with the source code(https://github.com/Xilinx/linux-xlnx/blob/master/drivers/dma/xilinx/xilinx_ps_pcie_platform.c). In the source code, status_flag_byte_count is located first, but, in Figure 10-20, user_handle and user_id is located first.

struct STATUS_DMA_DESCRIPTOR {
    u32 status_flag_byte_count;
    u16 user_handle;
    u16 user_id;
} __attribute__((__packed__));

Is there anyone who knows which is correct?

Tags (1)
0 Kudos
0 Replies