| /* SPDX-License-Identifier: GPL-2.0 */ |
| /* |
| * Copyright (c) 2021 MediaTek Inc. |
| */ |
| |
| #ifndef __TZ_CMA_ |
| #define __TZ_CMA_ |
| |
| #include "trustzone/kree/mem.h" |
| struct platform_device; |
| |
| #define MTEE_CMA_ENABLE_PARALLEL_ALLOC 1 |
| #define MTEE_CMA_CACHE_POLICY 1 |
| #define MTEE_CMA_DYNAMIC_MODE 1 |
| |
| int mtee_cma_init(struct platform_device *pdev); |
| bool mtee_cma_allocate(void); |
| bool mtee_cma_free(void); |
| bool mtee_cma_get_info(uint64_t *pa_base, uint64_t *size, uint8_t *dynamic_mode); |
| bool mtee_cma_map(uint64_t phy, uint64_t size); |
| bool mtee_cma_unmap(uint64_t phy, uint64_t size); |
| bool mtee_cma_preallocate_buffer_check(KREE_SECUREMEM_HANDLE cm_handle, uint32_t size, bool alloc); |
| |
| #endif |