Using EDMA for PCIE in lS1043A

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Using EDMA for PCIE in lS1043A

289 Views
Naveenkumar_Muthusamy
Contributor IV

Hi all,

 

we are using 3 instances of Pcie in our system. as per our system needs we need to use DMA. we needs to know how to enable the DMA. 

how to enable? whether it needs to be added on Device tree or how it needs to be done?

we are usinf ls1043ardb board and we are using yocto-real-time-edge BSP,

 

i have checked device tree and there is no dma-ranges mentioned under any of the Pcie nodes.

below is the device tree under fsl-ls1043a.dtsi

"pcie1: pcie@3400000 {
compatible = "fsl,ls1043a-pcie";
reg = <0x00 0x03400000 0x0 0x00100000>, /* controller registers */
<0x40 0x00000000 0x0 0x00002000>; /* configuration space */
reg-names = "regs", "config";
interrupts = <GIC_SPI 117 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 118 IRQ_TYPE_LEVEL_HIGH>;
interrupt-names = "pme", "aer";
#address-cells = <3>;
#size-cells = <2>;
device_type = "pci";
iommu-map = <0 &smmu 0 1>; /* update by bootloader */
num-viewport = <6>;
bus-range = <0x0 0xff>;
ranges = <0x81000000 0x0 0x00000000 0x40 0x00010000 0x0 0x00010000 /* downstream I/O */
0x82000000 0x0 0x40000000 0x40 0x40000000 0x0 0x40000000>; /* non-prefetchable memory */
msi-parent = <&msi1>, <&msi2>, <&msi3>;
#interrupt-cells = <1>;
interrupt-map-mask = <0 0 0 7>;
interrupt-map = <0000 0 0 1 &gic 0 110 0x4>,
<0000 0 0 2 &gic 0 111 0x4>,
<0000 0 0 3 &gic 0 112 0x4>,
<0000 0 0 4 &gic 0 113 0x4>;
fsl,pcie-scfg = <&scfg 0>;
big-endian;
status = "okay";
};

pcie2: pcie@3500000 {
compatible = "fsl,ls1043a-pcie";
reg = <0x00 0x03500000 0x0 0x00100000>, /* controller registers */
<0x48 0x00000000 0x0 0x00002000>; /* configuration space */
reg-names = "regs", "config";
interrupts = <GIC_SPI 127 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 128 IRQ_TYPE_LEVEL_HIGH>;
interrupt-names = "pme", "aer";
#address-cells = <3>;
#size-cells = <2>;
device_type = "pci";
iommu-map = <0 &smmu 0 1>; /* update by bootloader */
num-viewport = <6>;
bus-range = <0x0 0xff>;
ranges = <0x81000000 0x0 0x00000000 0x48 0x00010000 0x0 0x00010000 /* downstream I/O */
0x82000000 0x0 0x40000000 0x48 0x40000000 0x0 0x40000000>; /* non-prefetchable memory */
msi-parent = <&msi1>, <&msi2>, <&msi3>;
#interrupt-cells = <1>;
interrupt-map-mask = <0 0 0 7>;
interrupt-map = <0000 0 0 1 &gic 0 120 0x4>,
<0000 0 0 2 &gic 0 121 0x4>,
<0000 0 0 3 &gic 0 122 0x4>,
<0000 0 0 4 &gic 0 123 0x4>;
fsl,pcie-scfg = <&scfg 1>;
big-endian;
status = "okay";
};

pcie3: pcie@3600000 {
compatible = "fsl,ls1043a-pcie";
reg = <0x00 0x03600000 0x0 0x00100000>, /* controller registers */
<0x50 0x00000000 0x0 0x00002000>; /* configuration space */
reg-names = "regs", "config";
interrupts = <GIC_SPI 161 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 162 IRQ_TYPE_LEVEL_HIGH>;
interrupt-names = "pme", "aer";
#address-cells = <3>;
#size-cells = <2>;
device_type = "pci";
iommu-map = <0 &smmu 0 1>; /* update by bootloader */
num-viewport = <6>;
bus-range = <0x0 0xff>;
ranges = <0x81000000 0x0 0x00000000 0x50 0x00010000 0x0 0x00010000 /* downstream I/O */
0x82000000 0x0 0x40000000 0x50 0x40000000 0x0 0x40000000>; /* non-prefetchable memory */
msi-parent = <&msi1>, <&msi2>, <&msi3>;
#interrupt-cells = <1>;
interrupt-map-mask = <0 0 0 7>;
interrupt-map = <0000 0 0 1 &gic 0 154 0x4>,
<0000 0 0 2 &gic 0 155 0x4>,
<0000 0 0 3 &gic 0 156 0x4>,
<0000 0 0 4 &gic 0 157 0x4>;
fsl,pcie-scfg = <&scfg 2>;
big-endian;
status = "okay";
}; "

so let me know how to do it.

#ls1043a 

0 Kudos
Reply
1 Reply

165 Views
LFGP
NXP TechSupport
NXP TechSupport

dear @Naveenkumar_Muthusamy 

The apps team has sent the below information:

For qDMA on ls1043a, there is no need to add a DMA range in pcie node, only the qDMA node in device tree is required.
To enable qDMA, refer to LSDKUG Chapter 7.2.11 "QDMA for platform with DPAA1" part for the necessary kernel configuration.
The customer can enable CONFIG_DMATEST=y and use the kernel dmatest to verify qDMA functionality. By default, the test performs memory-to-memory transfers. The test commands can be found in Chapter 7.2.11.
I will provide a patch for memory-to-pcie testing. Note the patch version may differ from the customer's kernel, so they need to port it accordingly. The user must assign a pcie physical address to qDMA, then qDMA will transfer the data from memory to pcie. From a DMA perspective, there is no difference between memory and pcie -- they are both treated as physical addresses.
The below commands are needed for memory-to-pcie transfer:
echo 0x4841800000 > /sys/module/dmatest/parameters/pci_phys_addr # need change to customer's pcie address
echo 1 > /sys/module/dmatest/parameters/dmatest_pcie
Then, follow the test procedure described in Chapter 7.2.11.
Once the test passes, the customer can refer to the interface usage in dmatest.c and integrated relevant code into their files.

review the attached file please.

BR

LFGP

0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-2197962%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EUsing%20EDMA%20for%20PCIE%20in%20lS1043A%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2197962%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%20all%2C%3C%2FP%3E%3CBR%20%2F%3E%3CP%3Ewe%20are%20using%203%20instances%20of%20Pcie%20in%20our%20system.%20as%20per%20our%20system%20needs%20we%20need%20to%20use%20DMA.%20we%20needs%20to%20know%20how%20to%20enable%20the%20DMA.%26nbsp%3B%3C%2FP%3E%3CP%3Ehow%20to%20enable%3F%20whether%20it%20needs%20to%20be%20added%20on%20Device%20tree%20or%20how%20it%20needs%20to%20be%20done%3F%3C%2FP%3E%3CP%3Ewe%20are%20usinf%20ls1043ardb%20board%20and%20we%20are%20using%20yocto-real-time-edge%20BSP%2C%3C%2FP%3E%3CBR%20%2F%3E%3CP%3Ei%20have%20checked%20device%20tree%20and%20there%20is%20no%20dma-ranges%20mentioned%20under%20any%20of%20the%20Pcie%20nodes.%3C%2FP%3E%3CP%3Ebelow%20is%20the%20device%20tree%20under%20fsl-ls1043a.dtsi%3C%2FP%3E%3CP%3E%22pcie1%3A%20pcie%403400000%20%7B%3CBR%20%2F%3Ecompatible%20%3D%20%22fsl%2Cls1043a-pcie%22%3B%3CBR%20%2F%3Ereg%20%3D%20%26lt%3B0x00%200x03400000%200x0%200x00100000%26gt%3B%2C%20%2F*%20controller%20registers%20*%2F%3CBR%20%2F%3E%26lt%3B0x40%200x00000000%200x0%200x00002000%26gt%3B%3B%20%2F*%20configuration%20space%20*%2F%3CBR%20%2F%3Ereg-names%20%3D%20%22regs%22%2C%20%22config%22%3B%3CBR%20%2F%3Einterrupts%20%3D%20%3CGIC_SPI%20117%3D%22%22%20irq_type_level_high%3D%22%22%3E%2C%3CBR%20%2F%3E%3CGIC_SPI%20118%3D%22%22%20irq_type_level_high%3D%22%22%3E%3B%3CBR%20%2F%3Einterrupt-names%20%3D%20%22pme%22%2C%20%22aer%22%3B%3CBR%20%2F%3E%23address-cells%20%3D%20%26lt%3B3%26gt%3B%3B%3CBR%20%2F%3E%23size-cells%20%3D%20%26lt%3B2%26gt%3B%3B%3CBR%20%2F%3Edevice_type%20%3D%20%22pci%22%3B%3CBR%20%2F%3Eiommu-map%20%3D%20%26lt%3B0%20%26amp%3Bsmmu%200%201%26gt%3B%3B%20%2F*%20update%20by%20bootloader%20*%2F%3CBR%20%2F%3Enum-viewport%20%3D%20%26lt%3B6%26gt%3B%3B%3CBR%20%2F%3Ebus-range%20%3D%20%26lt%3B0x0%200xff%26gt%3B%3B%3CBR%20%2F%3Eranges%20%3D%20%26lt%3B0x81000000%200x0%200x00000000%200x40%200x00010000%200x0%200x00010000%20%2F*%20downstream%20I%2FO%20*%2F%3CBR%20%2F%3E0x82000000%200x0%200x40000000%200x40%200x40000000%200x0%200x40000000%26gt%3B%3B%20%2F*%20non-prefetchable%20memory%20*%2F%3CBR%20%2F%3Emsi-parent%20%3D%20%26lt%3B%26amp%3Bmsi1%26gt%3B%2C%20%26lt%3B%26amp%3Bmsi2%26gt%3B%2C%20%26lt%3B%26amp%3Bmsi3%26gt%3B%3B%3CBR%20%2F%3E%23interrupt-cells%20%3D%20%26lt%3B1%26gt%3B%3B%3CBR%20%2F%3Einterrupt-map-mask%20%3D%20%26lt%3B0%200%200%207%26gt%3B%3B%3CBR%20%2F%3Einterrupt-map%20%3D%20%26lt%3B0000%200%200%201%20%26amp%3Bgic%200%20110%200x4%26gt%3B%2C%3CBR%20%2F%3E%26lt%3B0000%200%200%202%20%26amp%3Bgic%200%20111%200x4%26gt%3B%2C%3CBR%20%2F%3E%26lt%3B0000%200%200%203%20%26amp%3Bgic%200%20112%200x4%26gt%3B%2C%3CBR%20%2F%3E%26lt%3B0000%200%200%204%20%26amp%3Bgic%200%20113%200x4%26gt%3B%3B%3CBR%20%2F%3Efsl%2Cpcie-scfg%20%3D%20%26lt%3B%26amp%3Bscfg%200%26gt%3B%3B%3CBR%20%2F%3Ebig-endian%3B%3CBR%20%2F%3Estatus%20%3D%20%22okay%22%3B%3CBR%20%2F%3E%7D%3B%3C%2FGIC_SPI%3E%3C%2FGIC_SPI%3E%3C%2FP%3E%3CP%3Epcie2%3A%20pcie%403500000%20%7B%3CBR%20%2F%3Ecompatible%20%3D%20%22fsl%2Cls1043a-pcie%22%3B%3CBR%20%2F%3Ereg%20%3D%20%26lt%3B0x00%200x03500000%200x0%200x00100000%26gt%3B%2C%20%2F*%20controller%20registers%20*%2F%3CBR%20%2F%3E%26lt%3B0x48%200x00000000%200x0%200x00002000%26gt%3B%3B%20%2F*%20configuration%20space%20*%2F%3CBR%20%2F%3Ereg-names%20%3D%20%22regs%22%2C%20%22config%22%3B%3CBR%20%2F%3Einterrupts%20%3D%20%3CGIC_SPI%20127%3D%22%22%20irq_type_level_high%3D%22%22%3E%2C%3CBR%20%2F%3E%3CGIC_SPI%20128%3D%22%22%20irq_type_level_high%3D%22%22%3E%3B%3CBR%20%2F%3Einterrupt-names%20%3D%20%22pme%22%2C%20%22aer%22%3B%3CBR%20%2F%3E%23address-cells%20%3D%20%26lt%3B3%26gt%3B%3B%3CBR%20%2F%3E%23size-cells%20%3D%20%26lt%3B2%26gt%3B%3B%3CBR%20%2F%3Edevice_type%20%3D%20%22pci%22%3B%3CBR%20%2F%3Eiommu-map%20%3D%20%26lt%3B0%20%26amp%3Bsmmu%200%201%26gt%3B%3B%20%2F*%20update%20by%20bootloader%20*%2F%3CBR%20%2F%3Enum-viewport%20%3D%20%26lt%3B6%26gt%3B%3B%3CBR%20%2F%3Ebus-range%20%3D%20%26lt%3B0x0%200xff%26gt%3B%3B%3CBR%20%2F%3Eranges%20%3D%20%26lt%3B0x81000000%200x0%200x00000000%200x48%200x00010000%200x0%200x00010000%20%2F*%20downstream%20I%2FO%20*%2F%3CBR%20%2F%3E0x82000000%200x0%200x40000000%200x48%200x40000000%200x0%200x40000000%26gt%3B%3B%20%2F*%20non-prefetchable%20memory%20*%2F%3CBR%20%2F%3Emsi-parent%20%3D%20%26lt%3B%26amp%3Bmsi1%26gt%3B%2C%20%26lt%3B%26amp%3Bmsi2%26gt%3B%2C%20%26lt%3B%26amp%3Bmsi3%26gt%3B%3B%3CBR%20%2F%3E%23interrupt-cells%20%3D%20%26lt%3B1%26gt%3B%3B%3CBR%20%2F%3Einterrupt-map-mask%20%3D%20%26lt%3B0%200%200%207%26gt%3B%3B%3CBR%20%2F%3Einterrupt-map%20%3D%20%26lt%3B0000%200%200%201%20%26amp%3Bgic%200%20120%200x4%26gt%3B%2C%3CBR%20%2F%3E%26lt%3B0000%200%200%202%20%26amp%3Bgic%200%20121%200x4%26gt%3B%2C%3CBR%20%2F%3E%26lt%3B0000%200%200%203%20%26amp%3Bgic%200%20122%200x4%26gt%3B%2C%3CBR%20%2F%3E%26lt%3B0000%200%200%204%20%26amp%3Bgic%200%20123%200x4%26gt%3B%3B%3CBR%20%2F%3Efsl%2Cpcie-scfg%20%3D%20%26lt%3B%26amp%3Bscfg%201%26gt%3B%3B%3CBR%20%2F%3Ebig-endian%3B%3CBR%20%2F%3Estatus%20%3D%20%22okay%22%3B%3CBR%20%2F%3E%7D%3B%3C%2FGIC_SPI%3E%3C%2FGIC_SPI%3E%3C%2FP%3E%3CP%3Epcie3%3A%20pcie%403600000%20%7B%3CBR%20%2F%3Ecompatible%20%3D%20%22fsl%2Cls1043a-pcie%22%3B%3CBR%20%2F%3Ereg%20%3D%20%26lt%3B0x00%200x03600000%200x0%200x00100000%26gt%3B%2C%20%2F*%20controller%20registers%20*%2F%3CBR%20%2F%3E%26lt%3B0x50%200x00000000%200x0%200x00002000%26gt%3B%3B%20%2F*%20configuration%20space%20*%2F%3CBR%20%2F%3Ereg-names%20%3D%20%22regs%22%2C%20%22config%22%3B%3CBR%20%2F%3Einterrupts%20%3D%20%3CGIC_SPI%20161%3D%22%22%20irq_type_level_high%3D%22%22%3E%2C%3CBR%20%2F%3E%3CGIC_SPI%20162%3D%22%22%20irq_type_level_high%3D%22%22%3E%3B%3CBR%20%2F%3Einterrupt-names%20%3D%20%22pme%22%2C%20%22aer%22%3B%3CBR%20%2F%3E%23address-cells%20%3D%20%26lt%3B3%26gt%3B%3B%3CBR%20%2F%3E%23size-cells%20%3D%20%26lt%3B2%26gt%3B%3B%3CBR%20%2F%3Edevice_type%20%3D%20%22pci%22%3B%3CBR%20%2F%3Eiommu-map%20%3D%20%26lt%3B0%20%26amp%3Bsmmu%200%201%26gt%3B%3B%20%2F*%20update%20by%20bootloader%20*%2F%3CBR%20%2F%3Enum-viewport%20%3D%20%26lt%3B6%26gt%3B%3B%3CBR%20%2F%3Ebus-range%20%3D%20%26lt%3B0x0%200xff%26gt%3B%3B%3CBR%20%2F%3Eranges%20%3D%20%26lt%3B0x81000000%200x0%200x00000000%200x50%200x00010000%200x0%200x00010000%20%2F*%20downstream%20I%2FO%20*%2F%3CBR%20%2F%3E0x82000000%200x0%200x40000000%200x50%200x40000000%200x0%200x40000000%26gt%3B%3B%20%2F*%20non-prefetchable%20memory%20*%2F%3CBR%20%2F%3Emsi-parent%20%3D%20%26lt%3B%26amp%3Bmsi1%26gt%3B%2C%20%26lt%3B%26amp%3Bmsi2%26gt%3B%2C%20%26lt%3B%26amp%3Bmsi3%26gt%3B%3B%3CBR%20%2F%3E%23interrupt-cells%20%3D%20%26lt%3B1%26gt%3B%3B%3CBR%20%2F%3Einterrupt-map-mask%20%3D%20%26lt%3B0%200%200%207%26gt%3B%3B%3CBR%20%2F%3Einterrupt-map%20%3D%20%26lt%3B0000%200%200%201%20%26amp%3Bgic%200%20154%200x4%26gt%3B%2C%3CBR%20%2F%3E%26lt%3B0000%200%200%202%20%26amp%3Bgic%200%20155%200x4%26gt%3B%2C%3CBR%20%2F%3E%26lt%3B0000%200%200%203%20%26amp%3Bgic%200%20156%200x4%26gt%3B%2C%3CBR%20%2F%3E%26lt%3B0000%200%200%204%20%26amp%3Bgic%200%20157%200x4%26gt%3B%3B%3CBR%20%2F%3Efsl%2Cpcie-scfg%20%3D%20%26lt%3B%26amp%3Bscfg%202%26gt%3B%3B%3CBR%20%2F%3Ebig-endian%3B%3CBR%20%2F%3Estatus%20%3D%20%22okay%22%3B%3CBR%20%2F%3E%7D%3B%20%22%3C%2FGIC_SPI%3E%3C%2FGIC_SPI%3E%3C%2FP%3E%3CP%3Eso%20let%20me%20know%20how%20to%20do%20it.%3C%2FP%3E%3CP%3E%23ls1043a%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E