1 /* 2 * Copyright (c) 2016-2022, ARM Limited and Contributors. All rights reserved. 3 * 4 * SPDX-License-Identifier: BSD-3-Clause 5 */ 6 #ifndef MTK_PLAT_COMMON_H 7 #define MTK_PLAT_COMMON_H 8 9 #include <stdint.h> 10 11 #include <common/bl_common.h> 12 #include <common/param_header.h> 13 14 /******************************************************************************* 15 * Function and variable prototypes 16 ******************************************************************************/ 17 #define SMC32_PARAM_MASK (0xFFFFFFFF) 18 19 #define JEDEC_MTK_BKID U(4) 20 #define JEDEC_MTK_MFID U(0x26) 21 22 struct mtk_bl31_params { 23 param_header_t h; 24 image_info_t *bl31_image_info; 25 entry_point_info_t *bl32_ep_info; 26 image_info_t *bl32_image_info; 27 entry_point_info_t *bl33_ep_info; 28 image_info_t *bl33_image_info; 29 }; 30 31 /* Declarations for mtk_plat_common.c */ 32 uint32_t plat_get_spsr_for_bl32_entry(void); 33 uint32_t plat_get_spsr_for_bl33_entry(void); 34 void clean_top_32b_of_param(uint32_t smc_fid, u_register_t *x1, 35 u_register_t *x2, 36 u_register_t *x3, 37 u_register_t *x4); 38 void bl31_prepare_kernel_entry(uint64_t k32_64); 39 void enable_ns_access_to_cpuectlr(void); 40 void boot_to_kernel(uint64_t x1, uint64_t x2, uint64_t x3, uint64_t x4); 41 uint64_t get_kernel_info_pc(void); 42 uint64_t get_kernel_info_r0(void); 43 uint64_t get_kernel_info_r1(void); 44 uint64_t get_kernel_info_r2(void); 45 46 extern struct atf_arg_t gteearg; 47 #endif /* MTK_PLAT_COMMON_H */ 48