Reserved Memory Node and Shared DMA Pool Configuration in Device Tree

This Device Tree fragment defines a reserved memory node and configures a shared DMA pool within it.

reserved-memory {
	#address-cells = <1>;
	#size-cells = <1>;
	ranges;
	linux,cma {
		compatible = 'shared-dma-pool';
		reusable;
		size = <0x14000000>;
		linux,cma-default;
	};
};

Explanation of Each Line:

  1. 'reserved-memory': Defines a node representing a reserved memory region.
  2. #address-cells = <1>: Specifies that the node's address is defined using a single cell (32-bit).
  3. #size-cells = <1>: Specifies that the node's size is defined using a single cell (32-bit).
  4. ranges: Defines the address range of the reserved memory region.
  5. 'linux,cma': Defines a shared DMA pool within the reserved memory node.
  6. compatible = 'shared-dma-pool': Indicates the compatibility string for the shared DMA pool.
  7. reusable: Defines the shared DMA pool as reusable, allowing it to be allocated and freed dynamically.
  8. size = <0x14000000>: Defines the size of the shared DMA pool as 320MB (0x14000000 = 320 * 1024 * 1024).
  9. 'linux,cma-default': Identifies this shared DMA pool as the system's default CMA (Contiguous Memory Allocator) for allocating physically contiguous memory regions.

原文地址: https://www.cveoy.top/t/topic/n5R3 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录