blob: 4c14b9d1057c4944dc03eaf31c179987919fe4cf [file] [log] [blame]
developer14f3fe32016-04-28 14:07:42 +08001/*
developer72bccc12022-06-26 21:50:32 +08002 * Copyright (c) 2016-2022, ARM Limited and Contributors. All rights reserved.
developer14f3fe32016-04-28 14:07:42 +08003 *
dp-armfa3cf0b2017-05-03 09:38:09 +01004 * SPDX-License-Identifier: BSD-3-Clause
developer14f3fe32016-04-28 14:07:42 +08005 */
Antonio Nino Diaz5eb88372018-11-08 10:20:19 +00006#ifndef MTK_PLAT_COMMON_H
7#define MTK_PLAT_COMMON_H
Antonio Nino Diaz42eef852018-09-24 17:15:54 +01008
developer14f3fe32016-04-28 14:07:42 +08009#include <stdint.h>
Antonio Nino Diaz42eef852018-09-24 17:15:54 +010010
Antonio Nino Diaze0f90632018-12-14 00:18:21 +000011#include <common/bl_common.h>
12#include <common/param_header.h>
13
developer14f3fe32016-04-28 14:07:42 +080014/*******************************************************************************
15 * Function and variable prototypes
16 ******************************************************************************/
developer14f3fe32016-04-28 14:07:42 +080017#define SMC32_PARAM_MASK (0xFFFFFFFF)
18
Hsin-Yi Wange0bf3052020-08-27 13:48:48 +080019#define JEDEC_MTK_BKID U(4)
20#define JEDEC_MTK_MFID U(0x26)
21
Antonio Nino Diaz42eef852018-09-24 17:15:54 +010022struct 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
developer14f3fe32016-04-28 14:07:42 +080031/* Declarations for mtk_plat_common.c */
32uint32_t plat_get_spsr_for_bl32_entry(void);
33uint32_t plat_get_spsr_for_bl33_entry(void);
Masahiro Yamada5ac9d962018-04-19 01:18:48 +090034void 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);
developer14f3fe32016-04-28 14:07:42 +080038void bl31_prepare_kernel_entry(uint64_t k32_64);
39void enable_ns_access_to_cpuectlr(void);
40void boot_to_kernel(uint64_t x1, uint64_t x2, uint64_t x3, uint64_t x4);
41uint64_t get_kernel_info_pc(void);
42uint64_t get_kernel_info_r0(void);
43uint64_t get_kernel_info_r1(void);
44uint64_t get_kernel_info_r2(void);
45
46extern struct atf_arg_t gteearg;
Antonio Nino Diaz5eb88372018-11-08 10:20:19 +000047#endif /* MTK_PLAT_COMMON_H */