Sandrine Bailleux | 798140d | 2014-07-17 16:06:39 +0100 | [diff] [blame] | 1 | /* |
| 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 | ******************************************************************************/ |
| 41 | struct plat_pm_ops; |
| 42 | struct meminfo; |
| 43 | struct bl31_params; |
| 44 | struct image_info; |
| 45 | struct 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 | ******************************************************************************/ |
| 52 | typedef 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 | ******************************************************************************/ |
| 65 | void bl1_plat_arch_setup(void); |
| 66 | void bl2_plat_arch_setup(void); |
| 67 | void bl31_plat_arch_setup(void); |
| 68 | int platform_setup_pm(const struct plat_pm_ops **plat_ops); |
| 69 | unsigned int platform_get_core_pos(unsigned long mpidr); |
| 70 | void 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); |
| 76 | void 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); |
| 82 | void plat_report_exception(unsigned long type); |
| 83 | unsigned long plat_get_ns_image_entrypoint(void); |
| 84 | unsigned long platform_get_stack(unsigned long mpidr); |
| 85 | uint64_t plat_get_syscnt_freq(void); |
| 86 | |
| 87 | /* Declarations for plat_gic.c */ |
| 88 | uint32_t ic_get_pending_interrupt_id(void); |
| 89 | uint32_t ic_get_pending_interrupt_type(void); |
| 90 | uint32_t ic_acknowledge_interrupt(void); |
| 91 | uint32_t ic_get_interrupt_type(uint32_t id); |
| 92 | void ic_end_of_interrupt(uint32_t id); |
| 93 | void gic_cpuif_deactivate(unsigned int gicc_base); |
| 94 | void gic_cpuif_setup(unsigned int gicc_base); |
| 95 | void gic_pcpu_distif_setup(unsigned int gicd_base); |
| 96 | void gic_setup(void); |
| 97 | uint32_t plat_interrupt_type_to_line(uint32_t type, uint32_t security_state); |
| 98 | |
| 99 | /* Declarations for plat_topology.c */ |
| 100 | int plat_setup_topology(void); |
| 101 | int plat_get_max_afflvl(void); |
| 102 | unsigned int plat_get_aff_count(unsigned int aff_lvl, unsigned long mpidr); |
| 103 | unsigned int plat_get_aff_state(unsigned int aff_lvl, unsigned long mpidr); |
| 104 | |
| 105 | /* Declarations for plat_io_storage.c */ |
| 106 | void io_setup(void); |
| 107 | int plat_get_image_source(const char *image_name, |
| 108 | uintptr_t *dev_handle, |
| 109 | uintptr_t *image_spec); |
| 110 | |
Juan Castillo | 6b672f5 | 2014-09-04 14:43:09 +0100 | [diff] [blame] | 111 | /* Declarations for security.c */ |
| 112 | void plat_security_setup(void); |
| 113 | |
Sandrine Bailleux | 798140d | 2014-07-17 16:06:39 +0100 | [diff] [blame] | 114 | /* |
| 115 | * Before calling this function BL2 is loaded in memory and its entrypoint |
| 116 | * is set by load_image. This is a placeholder for the platform to change |
| 117 | * the entrypoint of BL2 and set SPSR and security state. |
| 118 | * On Juno we are only setting the security state, entrypoint |
| 119 | */ |
| 120 | void bl1_plat_set_bl2_ep_info(struct image_info *image, |
| 121 | struct entry_point_info *ep); |
| 122 | |
| 123 | /* |
| 124 | * Before calling this function BL3-1 is loaded in memory and its entrypoint |
| 125 | * is set by load_image. This is a placeholder for the platform to change |
| 126 | * the entrypoint of BL3-1 and set SPSR and security state. |
| 127 | * On Juno we are only setting the security state, entrypoint |
| 128 | */ |
| 129 | void bl2_plat_set_bl31_ep_info(struct image_info *image, |
| 130 | struct entry_point_info *ep); |
| 131 | |
| 132 | /* |
| 133 | * Before calling this function BL3-2 is loaded in memory and its entrypoint |
| 134 | * is set by load_image. This is a placeholder for the platform to change |
| 135 | * the entrypoint of BL3-2 and set SPSR and security state. |
| 136 | * On Juno we are only setting the security state, entrypoint |
| 137 | */ |
| 138 | void bl2_plat_set_bl32_ep_info(struct image_info *image, |
| 139 | struct entry_point_info *ep); |
| 140 | |
| 141 | /* |
| 142 | * Before calling this function BL3-3 is loaded in memory and its entrypoint |
| 143 | * is set by load_image. This is a placeholder for the platform to change |
| 144 | * the entrypoint of BL3-3 and set SPSR and security state. |
| 145 | * On Juno we are only setting the security state, entrypoint |
| 146 | */ |
| 147 | void bl2_plat_set_bl33_ep_info(struct image_info *image, |
| 148 | struct entry_point_info *ep); |
| 149 | |
| 150 | /* Gets the memory layout for BL3-2 */ |
| 151 | void bl2_plat_get_bl32_meminfo(struct meminfo *mem_info); |
| 152 | |
| 153 | /* Gets the memory layout for BL3-3 */ |
| 154 | void bl2_plat_get_bl33_meminfo(struct meminfo *mem_info); |
| 155 | |
| 156 | #endif /* __JUNO_PRIVATE_H__ */ |