FROMLIST: dt-bindings: reserved-memory: Make DMA-BUF CMA heap DT-configurable

Document devicetree binding for chunk cma heap on dma heap framework.

The DMA chunk heap supports the bulk allocation of higher order pages.

The chunk heap's allocator allocates from the CMA area. It is optimized
to perform bulk allocation of higher order pages in an efficient manner.
For this purpose, the heap needs an exclusive CMA area that will only be
used for allocation by the heap. This is the reason why we need to use
the DT to create and configure a reserved memory region for use by the
chunk CMA heap driver. Since all allocation from DMA-BUF heaps happen
from the user-space, there is no other appropriate device-driver that
we can use to register the chunk CMA heap and configure the reserved
memory region for its use.

Bug: 170340257
Bug: 120293424
Link: https://lore.kernel.org/linux-mm/YAnM5PbNJZlk%2F%2FiX@google.com/T/#mf774abfe2712d22882e5c294904ef01b29eaeabd
Signed-off-by: Hyesoo Yu <hyesoo.yu@samsung.com>
Signed-off-by: Minchan Kim <minchan@kernel.org>
Signed-off-by: Hridya Valsaraju <hridya@google.com>
Signed-off-by: Minchan Kim <minchan@google.com>
Change-Id: I8cfdd72d847724719b6433831802b2bbee6263cb
This commit is contained in:
Hyesoo Yu
2020-12-22 22:10:07 -08:00
committed by Minchan Kim
parent 20512940b8
commit 2565b6ba29

View File

@@ -0,0 +1,56 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/reserved-memory/dma_heap_chunk.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Device tree binding for chunk heap on DMA HEAP FRAMEWORK
description: |
The DMA chunk heap is backed by the Contiguous Memory Allocator (CMA) and
supports bulk allocation of fixed size pages.
maintainers:
- Hyesoo Yu <hyesoo.yu@samsung.com>
- John Stultz <john.stultz@linaro.org>
- Minchan Kim <minchan@kernel.org>
- Hridya Valsaraju<hridya@google.com>
properties:
compatible:
enum:
- dma_heap,chunk
chunk-order:
description: |
order of pages that will get allocated from the chunk DMA heap.
maxItems: 1
size:
maxItems: 1
alignment:
maxItems: 1
required:
- compatible
- size
- alignment
- chunk-order
additionalProperties: false
examples:
- |
reserved-memory {
#address-cells = <2>;
#size-cells = <1>;
chunk_memory: chunk_memory {
compatible = "dma_heap,chunk";
size = <0x3000000>;
alignment = <0x0 0x00010000>;
chunk-order = <4>;
};
};