developer | 14f3fe3 | 2016-04-28 14:07:42 +0800 | [diff] [blame] | 1 | /* |
developer | 72bccc1 | 2022-06-26 21:50:32 +0800 | [diff] [blame] | 2 | * Copyright (c) 2016-2022, ARM Limited and Contributors. All rights reserved. |
developer | 14f3fe3 | 2016-04-28 14:07:42 +0800 | [diff] [blame] | 3 | * |
dp-arm | fa3cf0b | 2017-05-03 09:38:09 +0100 | [diff] [blame] | 4 | * SPDX-License-Identifier: BSD-3-Clause |
developer | 14f3fe3 | 2016-04-28 14:07:42 +0800 | [diff] [blame] | 5 | */ |
Antonio Nino Diaz | 5eb8837 | 2018-11-08 10:20:19 +0000 | [diff] [blame] | 6 | #ifndef MTK_PLAT_COMMON_H |
| 7 | #define MTK_PLAT_COMMON_H |
Antonio Nino Diaz | 42eef85 | 2018-09-24 17:15:54 +0100 | [diff] [blame] | 8 | |
developer | 14f3fe3 | 2016-04-28 14:07:42 +0800 | [diff] [blame] | 9 | #include <stdint.h> |
Antonio Nino Diaz | 42eef85 | 2018-09-24 17:15:54 +0100 | [diff] [blame] | 10 | |
Antonio Nino Diaz | e0f9063 | 2018-12-14 00:18:21 +0000 | [diff] [blame] | 11 | #include <common/bl_common.h> |
| 12 | #include <common/param_header.h> |
| 13 | |
developer | 14f3fe3 | 2016-04-28 14:07:42 +0800 | [diff] [blame] | 14 | /******************************************************************************* |
| 15 | * Function and variable prototypes |
| 16 | ******************************************************************************/ |
developer | 14f3fe3 | 2016-04-28 14:07:42 +0800 | [diff] [blame] | 17 | #define SMC32_PARAM_MASK (0xFFFFFFFF) |
| 18 | |
Hsin-Yi Wang | e0bf305 | 2020-08-27 13:48:48 +0800 | [diff] [blame] | 19 | #define JEDEC_MTK_BKID U(4) |
| 20 | #define JEDEC_MTK_MFID U(0x26) |
| 21 | |
Antonio Nino Diaz | 42eef85 | 2018-09-24 17:15:54 +0100 | [diff] [blame] | 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 | |
developer | 14f3fe3 | 2016-04-28 14:07:42 +0800 | [diff] [blame] | 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); |
Masahiro Yamada | 5ac9d96 | 2018-04-19 01:18:48 +0900 | [diff] [blame] | 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); |
developer | 14f3fe3 | 2016-04-28 14:07:42 +0800 | [diff] [blame] | 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; |
Antonio Nino Diaz | 5eb8837 | 2018-11-08 10:20:19 +0000 | [diff] [blame] | 47 | #endif /* MTK_PLAT_COMMON_H */ |