1 /* 2 * Copyright (C) 2022 Huawei Technologies Co., Ltd. 3 * Licensed under the Mulan PSL v2. 4 * You can use this software according to the terms and conditions of the Mulan PSL v2. 5 * You may obtain a copy of Mulan PSL v2 at: 6 * http://license.coscl.org.cn/MulanPSL2 7 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR 8 * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR 9 * PURPOSE. 10 * See the Mulan PSL v2 for more details. 11 */ 12 #ifndef TEE_CONFIG_H 13 #define TEE_CONFIG_H 14 15 #include <ta_framework.h> 16 17 #define DEFAULT_STACK_SIZE 0x4000 18 #define DEFAULT_HEAP_SIZE 0x10000 19 20 #define DEFAULT_HIVCODEC_STACK_SIZE 0x800 21 #define DEFAULT_HIVCODEC_HEAP_SIZE 0x800 22 23 #define INVALID_DIE_ID_SIZE 0U 24 #define OTHER_DIE_ID_SIZE 20U 25 #define M_DIE_ID_SIZE 32U 26 #define DV_DIE_ID_SIZE 32U 27 #define DIE_ID_SIZE_MAX 32U /* This value should be equal to the largest DIE_ID_SIZE above */ 28 29 struct dynamic_mem_uuid_item { 30 uint32_t configid; 31 uint32_t size; 32 TEE_UUID uuid; 33 uint32_t ddr_sec_region; 34 }; 35 36 enum static_mem_tag { 37 MEM_TAG_MIN = 0, 38 PP_MEM_TAG = 1, /* general memory */ 39 PRI_PP_MEM_TAG = 2, /* private memory of ta */ 40 PT_MEM_TAG = 3, /* private page table of ta */ 41 MEM_TAG_MAX, 42 }; 43 44 struct rsv_mem_pool_uuid_item { 45 uint64_t paddr; 46 uint32_t size; 47 TEE_UUID uuid; 48 uint32_t type; 49 }; 50 51 typedef struct rsv_pt_mem_uuid_item rsv_pp_mem_uuid_item; 52 53 #define PATH_NAME_MAX (SERVICE_NAME_MAX + 5) 54 struct task_info_st { 55 TEE_UUID uuid; 56 char name[SERVICE_NAME_MAX]; 57 char path[PATH_NAME_MAX]; 58 int priority; 59 bool ta_64bit; 60 }; 61 62 #define MAX_LIB_NAME_LEN 32 63 struct drvlib_load_caller_info { 64 TEE_UUID uuid; 65 char name[MAX_LIB_NAME_LEN]; 66 }; 67 68 struct drv_frame_info { 69 const char *drv_name; 70 uint64_t sid; 71 uint32_t pid; 72 size_t stack_size; 73 size_t heap_size; 74 struct tee_uuid uuid; 75 bool is_elf; 76 }; 77 78 uint32_t get_product_service_property_num(void); 79 const struct ta_property *get_product_service_property_config(void); 80 81 uint32_t get_product_dynamic_ta_num(void); 82 83 uint32_t get_drv_frame_nums(void); 84 struct drv_frame_info *get_drv_frame_infos(void); 85 86 #endif 87