blob: 0dac03a9dfdfc1b1233f96b2b6cd94a88b03fcbc [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);
86
87/* Declarations for plat_gic.c */
88uint32_t ic_get_pending_interrupt_id(void);
89uint32_t ic_get_pending_interrupt_type(void);
90uint32_t ic_acknowledge_interrupt(void);
91uint32_t ic_get_interrupt_type(uint32_t id);
92void ic_end_of_interrupt(uint32_t id);
93void gic_cpuif_deactivate(unsigned int gicc_base);
94void gic_cpuif_setup(unsigned int gicc_base);
95void gic_pcpu_distif_setup(unsigned int gicd_base);
96void gic_setup(void);
97uint32_t plat_interrupt_type_to_line(uint32_t type, uint32_t security_state);
98
99/* Declarations for plat_topology.c */
100int plat_setup_topology(void);
101int plat_get_max_afflvl(void);
102unsigned int plat_get_aff_count(unsigned int aff_lvl, unsigned long mpidr);
103unsigned int plat_get_aff_state(unsigned int aff_lvl, unsigned long mpidr);
104
105/* Declarations for plat_io_storage.c */
106void io_setup(void);
107int plat_get_image_source(const char *image_name,
108 uintptr_t *dev_handle,
109 uintptr_t *image_spec);
110
111/*
112 * Before calling this function BL2 is loaded in memory and its entrypoint
113 * is set by load_image. This is a placeholder for the platform to change
114 * the entrypoint of BL2 and set SPSR and security state.
115 * On Juno we are only setting the security state, entrypoint
116 */
117void bl1_plat_set_bl2_ep_info(struct image_info *image,
118 struct entry_point_info *ep);
119
120/*
121 * Before calling this function BL3-1 is loaded in memory and its entrypoint
122 * is set by load_image. This is a placeholder for the platform to change
123 * the entrypoint of BL3-1 and set SPSR and security state.
124 * On Juno we are only setting the security state, entrypoint
125 */
126void bl2_plat_set_bl31_ep_info(struct image_info *image,
127 struct entry_point_info *ep);
128
129/*
130 * Before calling this function BL3-2 is loaded in memory and its entrypoint
131 * is set by load_image. This is a placeholder for the platform to change
132 * the entrypoint of BL3-2 and set SPSR and security state.
133 * On Juno we are only setting the security state, entrypoint
134 */
135void bl2_plat_set_bl32_ep_info(struct image_info *image,
136 struct entry_point_info *ep);
137
138/*
139 * Before calling this function BL3-3 is loaded in memory and its entrypoint
140 * is set by load_image. This is a placeholder for the platform to change
141 * the entrypoint of BL3-3 and set SPSR and security state.
142 * On Juno we are only setting the security state, entrypoint
143 */
144void bl2_plat_set_bl33_ep_info(struct image_info *image,
145 struct entry_point_info *ep);
146
147/* Gets the memory layout for BL3-2 */
148void bl2_plat_get_bl32_meminfo(struct meminfo *mem_info);
149
150/* Gets the memory layout for BL3-3 */
151void bl2_plat_get_bl33_meminfo(struct meminfo *mem_info);
152
153#endif /* __JUNO_PRIVATE_H__ */