Sanitise includes across codebase
[project/bcm63xx/atf.git] / plat / mediatek / common / mtk_plat_common.h
1 /*
2 * Copyright (c) 2016-2018, 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 DEVINFO_SIZE 4
18 #define LINUX_KERNEL_32 0
19 #define SMC32_PARAM_MASK (0xFFFFFFFF)
20
21 struct atf_arg_t {
22 unsigned int atf_magic;
23 unsigned int tee_support;
24 unsigned int tee_entry;
25 unsigned int tee_boot_arg_addr;
26 unsigned int hwuid[4]; /* HW Unique id for t-base used */
27 unsigned int HRID[2]; /* HW random id for t-base used */
28 unsigned int atf_log_port;
29 unsigned int atf_log_baudrate;
30 unsigned int atf_log_buf_start;
31 unsigned int atf_log_buf_size;
32 unsigned int atf_irq_num;
33 unsigned int devinfo[DEVINFO_SIZE];
34 unsigned int atf_aee_debug_buf_start;
35 unsigned int atf_aee_debug_buf_size;
36 };
37
38 struct kernel_info {
39 uint64_t pc;
40 uint64_t r0;
41 uint64_t r1;
42 uint64_t r2;
43 uint64_t k32_64;
44 };
45
46 struct mtk_bl_param_t {
47 uint64_t bootarg_loc;
48 uint64_t bootarg_size;
49 uint64_t bl33_start_addr;
50 uint64_t tee_info_addr;
51 };
52
53 struct mtk_bl31_params {
54 param_header_t h;
55 image_info_t *bl31_image_info;
56 entry_point_info_t *bl32_ep_info;
57 image_info_t *bl32_image_info;
58 entry_point_info_t *bl33_ep_info;
59 image_info_t *bl33_image_info;
60 };
61
62 /* Declarations for mtk_plat_common.c */
63 uint32_t plat_get_spsr_for_bl32_entry(void);
64 uint32_t plat_get_spsr_for_bl33_entry(void);
65 void clean_top_32b_of_param(uint32_t smc_fid, u_register_t *x1,
66 u_register_t *x2,
67 u_register_t *x3,
68 u_register_t *x4);
69 void bl31_prepare_kernel_entry(uint64_t k32_64);
70 void enable_ns_access_to_cpuectlr(void);
71 void boot_to_kernel(uint64_t x1, uint64_t x2, uint64_t x3, uint64_t x4);
72 uint64_t get_kernel_info_pc(void);
73 uint64_t get_kernel_info_r0(void);
74 uint64_t get_kernel_info_r1(void);
75 uint64_t get_kernel_info_r2(void);
76
77 extern struct atf_arg_t gteearg;
78 #endif /* MTK_PLAT_COMMON_H */