CMA Size setting instructions for Yocto and Petalinux users:

Linux Drivers

Release Date
2023-07-22
  • Using kernel menuconfig option

    1. Run kernel menuconfig using below cmds
      1. peta-linux : "petalinux-config -c kernel"
      2. yocto: " bitbake -f virtual/kernel -c menuconfig"
    2. Go to Device Drivers→Generic Driver options→ DMA Contiguous Memory Allocator
    3. Set default contiguous memory size as per your preferred value depending upon your usecase
    4. Save the configuration, exit the menuconfig and build images
  • Using bootargs at uboot prompt

    1. During boot-up stop at uboot prompt by continuously pressing any key during bootup and set custom CMA size using below cmd
      • "setenv bootargs $bootargs cma=1500m"
      • boot
  • Using custom uEnv.txt for Yocto

    1. There is a custom uEnv.txt file being generated by yocto build at work/build/tmp/deploy/images/zcu106-zynqmp which can be edited to set custom cma size.
    2. Modify uEnv.txt bootargs option to set requried cma size as below
      • "bootargs=earlycon clk_ignore_unused root=/dev/mmcblk0p2 rw rootwait cma=1500m"
    3. Copy uEnv.txt having CMA boot args setting in boot partition (i.e the first partition) of sdcard and boot the board.