blob: 6b94b57641b909f1cb51bff94808f0451d8058be [file] [log] [blame]
developer72bccc12022-06-26 21:50:32 +08001/*
2 * Copyright (c) 2022, Mediatek Inc. All rights reserved.
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
7#ifndef COLD_BOOT_H
8#define COLD_BOOT_H
9
10#include <stdint.h>
11
12/*******************************************************************************
13 * Function and variable prototypes
14 ******************************************************************************/
15#define LINUX_KERNEL_32 (0)
16#define LINUX_KERNEL_64 (1)
17#define DEVINFO_SIZE (4)
18
19struct atf_arg_t {
20 uint32_t atf_magic;
21 uint32_t tee_support;
22 uint64_t tee_entry;
23 uint64_t tee_boot_arg_addr;
24 uint32_t hwuid[4]; /* HW Unique id for t-base used */
25 uint32_t HRID[8]; /* HW random id for t-base used */
26 uint32_t devinfo[DEVINFO_SIZE];
27};
28
29struct mtk_bl31_fw_config {
30 void *from_bl2; /* MTK boot tag */
31 void *soc_fw_config;
32 void *hw_config;
33 void *reserved;
34};
35
36enum {
37 BOOT_ARG_FROM_BL2,
38 BOOT_ARG_SOC_FW_CONFIG,
39 BOOT_ARG_HW_CONFIG,
40 BOOT_ARG_RESERVED
41};
42
43struct kernel_info {
44 uint64_t pc;
45 uint64_t r0;
46 uint64_t r1;
47 uint64_t r2;
48 uint64_t k32_64;
49};
50
51struct mtk_bl_param_t {
52 uint64_t bootarg_loc;
53 uint64_t bootarg_size;
54 uint64_t bl33_start_addr;
55 uint64_t atf_arg_addr;
56};
57
58void *get_mtk_bl31_fw_config(int index);
59bool is_el1_2nd_bootloader(void);
60
61#endif /* COLD_BOOT_H */