blob: a6d1a1af1a42d1de3a2858c55dc6b974800990f4 [file] [log] [blame]
Sandrine Bailleux798140d2014-07-17 16:06:39 +01001/*
2 * Copyright (c) 2014, ARM Limited and Contributors. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are met:
6 *
7 * Redistributions of source code must retain the above copyright notice, this
8 * list of conditions and the following disclaimer.
9 *
10 * Redistributions in binary form must reproduce the above copyright notice,
11 * this list of conditions and the following disclaimer in the documentation
12 * and/or other materials provided with the distribution.
13 *
14 * Neither the name of ARM nor the names of its contributors may be used
15 * to endorse or promote products derived from this software without specific
16 * prior written permission.
17 *
18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
22 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28 * POSSIBILITY OF SUCH DAMAGE.
29 */
30
31#ifndef __JUNO_PRIVATE_H__
32#define __JUNO_PRIVATE_H__
33
34#include <bl_common.h>
35#include <platform_def.h>
36#include <stdint.h>
37
38/*******************************************************************************
39 * Forward declarations
40 ******************************************************************************/
41struct plat_pm_ops;
42struct meminfo;
43struct bl31_params;
44struct image_info;
45struct entry_point_info;
46
47/*******************************************************************************
48 * This structure represents the superset of information that is passed to
49 * BL3-1 e.g. while passing control to it from BL2 which is bl31_params
50 * and other platform specific params
51 ******************************************************************************/
52typedef struct bl2_to_bl31_params_mem {
53 struct bl31_params bl31_params;
54 struct image_info bl31_image_info;
55 struct image_info bl32_image_info;
56 struct image_info bl33_image_info;
57 struct entry_point_info bl33_ep_info;
58 struct entry_point_info bl32_ep_info;
59 struct entry_point_info bl31_ep_info;
60} bl2_to_bl31_params_mem_t;
61
62/*******************************************************************************
63 * Function and variable prototypes
64 ******************************************************************************/
65void bl1_plat_arch_setup(void);
66void bl2_plat_arch_setup(void);
67void bl31_plat_arch_setup(void);
68int platform_setup_pm(const struct plat_pm_ops **plat_ops);
69unsigned int platform_get_core_pos(unsigned long mpidr);
70void configure_mmu_el1(unsigned long total_base,
71 unsigned long total_size,
72 unsigned long ro_start,
73 unsigned long ro_limit,
74 unsigned long coh_start,
75 unsigned long coh_limit);
76void configure_mmu_el3(unsigned long total_base,
77 unsigned long total_size,
78 unsigned long ro_start,
79 unsigned long ro_limit,
80 unsigned long coh_start,
81 unsigned long coh_limit);
82void plat_report_exception(unsigned long type);
83unsigned long plat_get_ns_image_entrypoint(void);
84unsigned long platform_get_stack(unsigned long mpidr);
85uint64_t plat_get_syscnt_freq(void);
Juan Castillob3286c02014-10-20 12:29:58 +010086void plat_gic_init(void);
Sandrine Bailleux798140d2014-07-17 16:06:39 +010087
88/* Declarations for plat_topology.c */
89int plat_setup_topology(void);
90int plat_get_max_afflvl(void);
91unsigned int plat_get_aff_count(unsigned int aff_lvl, unsigned long mpidr);
92unsigned int plat_get_aff_state(unsigned int aff_lvl, unsigned long mpidr);
93
94/* Declarations for plat_io_storage.c */
95void io_setup(void);
96int plat_get_image_source(const char *image_name,
97 uintptr_t *dev_handle,
98 uintptr_t *image_spec);
99
100/*
101 * Before calling this function BL2 is loaded in memory and its entrypoint
102 * is set by load_image. This is a placeholder for the platform to change
103 * the entrypoint of BL2 and set SPSR and security state.
104 * On Juno we are only setting the security state, entrypoint
105 */
106void bl1_plat_set_bl2_ep_info(struct image_info *image,
107 struct entry_point_info *ep);
108
109/*
110 * Before calling this function BL3-1 is loaded in memory and its entrypoint
111 * is set by load_image. This is a placeholder for the platform to change
112 * the entrypoint of BL3-1 and set SPSR and security state.
113 * On Juno we are only setting the security state, entrypoint
114 */
115void bl2_plat_set_bl31_ep_info(struct image_info *image,
116 struct entry_point_info *ep);
117
118/*
119 * Before calling this function BL3-2 is loaded in memory and its entrypoint
120 * is set by load_image. This is a placeholder for the platform to change
121 * the entrypoint of BL3-2 and set SPSR and security state.
122 * On Juno we are only setting the security state, entrypoint
123 */
124void bl2_plat_set_bl32_ep_info(struct image_info *image,
125 struct entry_point_info *ep);
126
127/*
128 * Before calling this function BL3-3 is loaded in memory and its entrypoint
129 * is set by load_image. This is a placeholder for the platform to change
130 * the entrypoint of BL3-3 and set SPSR and security state.
131 * On Juno we are only setting the security state, entrypoint
132 */
133void bl2_plat_set_bl33_ep_info(struct image_info *image,
134 struct entry_point_info *ep);
135
136/* Gets the memory layout for BL3-2 */
137void bl2_plat_get_bl32_meminfo(struct meminfo *mem_info);
138
139/* Gets the memory layout for BL3-3 */
140void bl2_plat_get_bl33_meminfo(struct meminfo *mem_info);
141
142#endif /* __JUNO_PRIVATE_H__ */