I have some limitations when using a DMA on a ZCU111. I can’t allocate all the memory I need in my buffers when I use “allocate” function.
After some research, I find this : " This buffer is allocated inside the kernel space using xlnk driver. The maximum allocatable memory is defined at kernel build time using the CMA memory parameters. For Pynq-Z1 kernel, it is specified as 128MB. " (pynq.xlnk — Python productivity for Zynq (Pynq) v1.0).
Check under Petalinux Kernel Config. There was a tutorial here a while ago by Peter showing how to port to a new board. If I recall correctly is under the same settings as DMA APF.
Device Drivers->Generic Driver Options->Size in Mega Bytes(1024)
Device Drivers->Staging drivers (ON)->Xilinx APF Accelerator driver (ON)->Xilinx APF DMA engines support (ON)
I found a “temporary” solution. You need to follow this guide : PYNQ SD Card — Python productivity for Zynq (Pynq) and launch the kernel compilation. In an other terminal look for kernel configuration file and stop the compilation. Edit the file and start again the compilation.
WHen It’s finish you can copy the kernel file in your sd card.
It’s not “clean”, but I don’t know how to configure the kernel when you are using Pynq. If someone know, I’m very interested.
After you have the boot_files built (run make boot_files or run make), the petalinux_project folder should appear in your sdbuild/build/ folder, you can go inside and run petalinux-config -c kernel.
I’m having similar issues with the ZC702 board. For once I can’t set CMA to anything higher than 256MB when building petalinux and even when setting CMA to 256MB I still can only allocate 128MB with ‘allocate’.
I’ve used pynq_z1_v2.6.0 to build the SD image and then swapped the BOOT.BIN, boot.scr and image.ub that were built using 2020.1 version of Vitis, petalinux for ZC702 BSP. After enabling Xilinx APF DMA engines under Device Drivers I changed the CMA size to 1024 (ZC702 has 1GB DDR) under Library Routines->Size in Mega Bytes. When built I can see that it fails to reserve CMA of more than 256MB when booting up. Tried 1024MB, 512MB etc and nothing works above 256MB. Am I getting it right that since ZC702 has 4 separate DDR chips, each 256Mx8bit, you cannot reserve more than 256MB for CMA?
Another issue is when kernel has been configured to 256MB of CMA I cannot use more than 128MB when using ‘allocate’.