UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Observer django_
Observer
695 Views
Registered: ‎01-20-2019

ZCU106 cannot reserve 2048 MiB or more of CMA

hi,

i'm using ZCU106 and  petalinux 2018.2.

I used   "petalinux-config -c kernel"   to allocate a large region of CMA memory for DMA transfer test.

Reserving 1900MB works fine. But,when I trying to reserve 2048MB or more of CMA ,I'll get:

"cma: Failed to reserve 2048MiB" error message during linux boot.  

so,is there a limitation for reserve CMA memory larger than 2048MB or have some solutions? 

Best Regards.

 

Tags (2)
0 Kudos
3 Replies
Xilinx Employee
Xilinx Employee
650 Views
Registered: ‎05-15-2018

Re: ZCU106 cannot reserve 2048 MiB or more of CMA

Hi @django_ 

The reason for the failure is that the DDR memory for MPSOC is not contiguous and it includes 2 memory ranges (2 GB each), 0 - 0x8000_0000, and 0x8_0000_0000 - 0x8_8000_0000. Since the DDR itself is limited to two 2 GB blocks, CMA allocations will only be successful for sizes < 2 GB.

Best,

Shiril

---------------------------------------------------------------------------
Don’t forget to Reply, Kudo, and Accept as Solution.
---------------------------------------------------------------------------
0 Kudos
Observer django_
Observer
625 Views
Registered: ‎01-20-2019

Re: ZCU106 cannot reserve 2048 MiB or more of CMA

Thanks very much!@

I have changed it in the "system-user.dtsi",such as

QQ图片20190413130914.png

Then, successly reserved 3000Mib cma from the linux boot log.

When I use "cat /proc/iomem" ,i found the "0x8_0000_0000 - 0x8_1000_0000" was not applied.

QQ图片152.png

QQ图片232130413131626.png

Is there any wrong for my system-user.dtsi?

0 Kudos
Xilinx Employee
Xilinx Employee
592 Views
Registered: ‎05-15-2018

Re: ZCU106 cannot reserve 2048 MiB or more of CMA

Hi @django_ 

I tested your device tree on my zcu102 board, and as expected, the board did not boot up. In your device tree, your first bank of memory has a size 0xf000000 which is ca. 4 GB. If you take a look at Table 10-1 on p. 223 of https://www.xilinx.com/support/documentation/user_guides/ug1085-zynq-ultrascale-trm.pdf, you will see that the DDR_LOW range of addresses is from 0x0 to 0x7fff_ffff which is 2 GB. Since your device tree entry allocated more than this, other reserved memory areas (especially for the CSU, PSU, TCM, OCM) were stomped on, and caused a failure during Linux boot up. 

Could you run dmesg | grep cma on your board and post the output here? I'd like to see what area the cma memory is being allocated to, and how much memory you have available. Mine looks like this:

Capture.PNG   

From this figure, you can see that the two 'System RAM' areas obey the address map, and total up to ca. 4 GB of memory as expected. In theory, if you have more than 4 GB of DDR memory available, then you can allocate more than 2 GB chunks of CMA, but only in the DDR_HIGH address region (beyond 0x8_0000_0000). 

---------------------------------------------------------------------------
Don’t forget to Reply, Kudo, and Accept as Solution.
---------------------------------------------------------------------------
0 Kudos