no-map for the carved out regions in the DTSI, making them inaccessible to the kernel.
Configurable carved-out regions are defined in the arch/arm64/boot/dts/qcom/kodiak.dtsi file under the reserved-memory node.
For Qualcomm SoCs, see the SoC-specific Qualcomm DTSI files to get this information.
Contiguous memory allocator
Qualcomm Linux distribution supports CMA to allocate large physically contiguous memory. CMA reserves a large physically contiguous memory area at boot time and provides physically continuous memory to CMA allocation. When not in use, CMA memory is available to the kernel buddy allocator for movable allocations. To change the size of the default CMA region, runcma=size_in_MB in the kernel command-line arguments. For more information on how to use the kernel parameter, see the following example:
reserved-memory node with a shared-dma-pool compatible tag indicating the CMA region:
Supported heaps
The following table lists the heaps that are supported by default on the Qualcomm Linux distribution: Table: Default supported heapsUse DMA-BUF heaps
DMA-BUF heaps are supported on the Qualcomm Linux distribution to assign custom CMA heaps. With DMA-BUF heaps, a device file is present for each heap in the/dev/dma_heap file system. Apart from the system heap and the common CMA reserved heap, you can create your own CMA-type DMA-BUF heaps.
The following is a sample program that demonstrates how to use the DMA-BUF system heap created by the Qualcomm Linux kernel in /dev/dma_heap/system:
Configure ZRAM as a swap device
ZRAM is a compressed swap mechanism that creates a virtual block device in RAM. ZRAM is enabled as a module within the kernel defconfig. ZRAM is configured in the Yocto build in therecipes-extended/zram/zram/zram-swap-init-update file.
To enable or configure ZRAM, do the following:
Extend the memory map
To extend the memory map, adjust the addresses and sizes of memory regions in a DTSI file. Use the following information to extend the carved out regions: Add the carved out region in thearch/arm64/boot/dts/qcom/<SoC>-<board>-<variant>.dts file in the reserved-memory node using the following syntax:
- None of the regions should overlap. If you must increase a region size, shift all other subsequent regions, and configure them in the device tree to avoid overlapping.
- The kernel expects all memory region boundaries defined for kernel usage to be 1 MB.
- Existing carved out regions are protected by trusted firmware from kernel access. Decreasing their size or deleting them may result in an external abort, leading to a kernel crash.
arch/arm64/boot/dts/qcom/<SoC>-<board>-<variant>.dts file under reserved-memory node, use the following syntax:

