blob: 501c339bada787d92824a1a68b228b089276916c [file] [log] [blame]
developer14f3fe32016-04-28 14:07:42 +08001/*
2 * Copyright (c) 2016, ARM Limited and Contributors. All rights reserved.
3 *
dp-armfa3cf0b2017-05-03 09:38:09 +01004 * SPDX-License-Identifier: BSD-3-Clause
developer14f3fe32016-04-28 14:07:42 +08005 */
6#ifndef __MTK_PLAT_COMMON_H__
7#define __MTK_PLAT_COMMON_H__
8#include <stdint.h>
9/*******************************************************************************
10 * Function and variable prototypes
11 ******************************************************************************/
12#define DEVINFO_SIZE 4
13#define LINUX_KERNEL_32 0
14#define SMC32_PARAM_MASK (0xFFFFFFFF)
15
16struct atf_arg_t {
17 unsigned int atf_magic;
18 unsigned int tee_support;
19 unsigned int tee_entry;
20 unsigned int tee_boot_arg_addr;
21 unsigned int hwuid[4]; /* HW Unique id for t-base used */
22 unsigned int HRID[2]; /* HW random id for t-base used */
23 unsigned int atf_log_port;
24 unsigned int atf_log_baudrate;
25 unsigned int atf_log_buf_start;
26 unsigned int atf_log_buf_size;
27 unsigned int atf_irq_num;
28 unsigned int devinfo[DEVINFO_SIZE];
29 unsigned int atf_aee_debug_buf_start;
30 unsigned int atf_aee_debug_buf_size;
31};
32
33struct kernel_info {
34 uint64_t pc;
35 uint64_t r0;
36 uint64_t r1;
37 uint64_t r2;
38 uint64_t k32_64;
39};
40
41struct mtk_bl_param_t {
42 uint64_t bootarg_loc;
43 uint64_t bootarg_size;
44 uint64_t bl33_start_addr;
45 uint64_t tee_info_addr;
46};
47
48/* Declarations for mtk_plat_common.c */
49uint32_t plat_get_spsr_for_bl32_entry(void);
50uint32_t plat_get_spsr_for_bl33_entry(void);
Masahiro Yamada5ac9d962018-04-19 01:18:48 +090051void clean_top_32b_of_param(uint32_t smc_fid, u_register_t *x1,
52 u_register_t *x2,
53 u_register_t *x3,
54 u_register_t *x4);
developer14f3fe32016-04-28 14:07:42 +080055void bl31_prepare_kernel_entry(uint64_t k32_64);
56void enable_ns_access_to_cpuectlr(void);
57void boot_to_kernel(uint64_t x1, uint64_t x2, uint64_t x3, uint64_t x4);
58uint64_t get_kernel_info_pc(void);
59uint64_t get_kernel_info_r0(void);
60uint64_t get_kernel_info_r1(void);
61uint64_t get_kernel_info_r2(void);
62
63extern struct atf_arg_t gteearg;
64#endif