Antonio Nino Diaz | c41f206 | 2017-10-24 10:07:35 +0100 | [diff] [blame] | 1 | /* |
Antonio Nino Diaz | 35b37f0 | 2018-01-08 17:33:34 +0000 | [diff] [blame] | 2 | * Copyright (c) 2017-2018, ARM Limited and Contributors. All rights reserved. |
Antonio Nino Diaz | c41f206 | 2017-10-24 10:07:35 +0100 | [diff] [blame] | 3 | * |
| 4 | * SPDX-License-Identifier: BSD-3-Clause |
| 5 | */ |
| 6 | |
Antonio Nino Diaz | c41f206 | 2017-10-24 10:07:35 +0100 | [diff] [blame] | 7 | #include <assert.h> |
Antonio Nino Diaz | c41f206 | 2017-10-24 10:07:35 +0100 | [diff] [blame] | 8 | #include <errno.h> |
Antonio Nino Diaz | b5b585a | 2018-11-08 14:20:07 +0000 | [diff] [blame] | 9 | #include <string.h> |
Antonio Nino Diaz | e0f9063 | 2018-12-14 00:18:21 +0000 | [diff] [blame] | 10 | |
| 11 | #include <arch_helpers.h> |
| 12 | #include <bl31/bl31.h> |
| 13 | #include <bl31/ehf.h> |
| 14 | #include <bl31/interrupt_mgmt.h> |
| 15 | #include <common/debug.h> |
| 16 | #include <common/runtime_svc.h> |
| 17 | #include <lib/el3_runtime/context_mgmt.h> |
| 18 | #include <lib/smccc.h> |
| 19 | #include <lib/spinlock.h> |
| 20 | #include <lib/utils.h> |
| 21 | #include <lib/xlat_tables/xlat_tables_v2.h> |
| 22 | #include <plat/common/platform.h> |
| 23 | #include <services/sprt_svc.h> |
| 24 | #include <smccc_helpers.h> |
Antonio Nino Diaz | c41f206 | 2017-10-24 10:07:35 +0100 | [diff] [blame] | 25 | |
| 26 | #include "spm_private.h" |
Antonio Nino Diaz | 2ac9a44 | 2018-05-23 11:40:46 +0100 | [diff] [blame] | 27 | |
Antonio Nino Diaz | c41f206 | 2017-10-24 10:07:35 +0100 | [diff] [blame] | 28 | /******************************************************************************* |
| 29 | * Secure Partition context information. |
| 30 | ******************************************************************************/ |
Antonio Nino Diaz | 8cc23f9 | 2018-10-30 11:35:30 +0000 | [diff] [blame] | 31 | sp_context_t sp_ctx_array[PLAT_SPM_MAX_PARTITIONS]; |
| 32 | |
| 33 | /* Last Secure Partition last used by the CPU */ |
| 34 | sp_context_t *cpu_sp_ctx[PLATFORM_CORE_COUNT]; |
| 35 | |
| 36 | void spm_cpu_set_sp_ctx(unsigned int linear_id, sp_context_t *sp_ctx) |
| 37 | { |
| 38 | assert(linear_id < PLATFORM_CORE_COUNT); |
| 39 | |
| 40 | cpu_sp_ctx[linear_id] = sp_ctx; |
| 41 | } |
| 42 | |
| 43 | sp_context_t *spm_cpu_get_sp_ctx(unsigned int linear_id) |
| 44 | { |
| 45 | assert(linear_id < PLATFORM_CORE_COUNT); |
| 46 | |
| 47 | return cpu_sp_ctx[linear_id]; |
| 48 | } |
Antonio Nino Diaz | c41f206 | 2017-10-24 10:07:35 +0100 | [diff] [blame] | 49 | |
| 50 | /******************************************************************************* |
Antonio Nino Diaz | 44ef4eb | 2018-07-03 19:54:59 +0100 | [diff] [blame] | 51 | * Functions to keep track of how many requests a Secure Partition has received |
| 52 | * and hasn't finished. |
| 53 | ******************************************************************************/ |
| 54 | void spm_sp_request_increase(sp_context_t *sp_ctx) |
| 55 | { |
| 56 | spin_lock(&(sp_ctx->request_count_lock)); |
| 57 | sp_ctx->request_count++; |
| 58 | spin_unlock(&(sp_ctx->request_count_lock)); |
| 59 | } |
| 60 | |
| 61 | void spm_sp_request_decrease(sp_context_t *sp_ctx) |
| 62 | { |
| 63 | spin_lock(&(sp_ctx->request_count_lock)); |
| 64 | sp_ctx->request_count--; |
| 65 | spin_unlock(&(sp_ctx->request_count_lock)); |
| 66 | } |
| 67 | |
| 68 | /* Returns 0 if it was originally 0, -1 otherwise. */ |
| 69 | int spm_sp_request_increase_if_zero(sp_context_t *sp_ctx) |
| 70 | { |
| 71 | int ret = -1; |
| 72 | |
| 73 | spin_lock(&(sp_ctx->request_count_lock)); |
| 74 | if (sp_ctx->request_count == 0U) { |
| 75 | sp_ctx->request_count++; |
| 76 | ret = 0U; |
| 77 | } |
| 78 | spin_unlock(&(sp_ctx->request_count_lock)); |
| 79 | |
| 80 | return ret; |
| 81 | } |
| 82 | |
| 83 | /******************************************************************************* |
Antonio Nino Diaz | b5b585a | 2018-11-08 14:20:07 +0000 | [diff] [blame] | 84 | * This function returns a pointer to the context of the Secure Partition that |
| 85 | * handles the service specified by an UUID. It returns NULL if the UUID wasn't |
| 86 | * found. |
| 87 | ******************************************************************************/ |
| 88 | sp_context_t *spm_sp_get_by_uuid(const uint32_t (*svc_uuid)[4]) |
| 89 | { |
| 90 | unsigned int i; |
| 91 | |
| 92 | for (i = 0U; i < PLAT_SPM_MAX_PARTITIONS; i++) { |
| 93 | |
| 94 | sp_context_t *sp_ctx = &sp_ctx_array[i]; |
| 95 | |
| 96 | if (sp_ctx->is_present == 0) { |
| 97 | continue; |
| 98 | } |
| 99 | |
| 100 | struct sp_rd_sect_service *rdsvc; |
| 101 | |
| 102 | for (rdsvc = sp_ctx->rd.service; rdsvc != NULL; |
| 103 | rdsvc = rdsvc->next) { |
| 104 | uint32_t *rd_uuid = (uint32_t *)(rdsvc->uuid); |
| 105 | |
| 106 | if (memcmp(rd_uuid, svc_uuid, sizeof(rd_uuid)) == 0) { |
| 107 | return sp_ctx; |
| 108 | } |
| 109 | } |
| 110 | } |
| 111 | |
| 112 | return NULL; |
| 113 | } |
| 114 | |
| 115 | /******************************************************************************* |
Antonio Nino Diaz | c4f2752 | 2018-05-23 09:09:41 +0100 | [diff] [blame] | 116 | * Set state of a Secure Partition context. |
| 117 | ******************************************************************************/ |
| 118 | void sp_state_set(sp_context_t *sp_ptr, sp_state_t state) |
| 119 | { |
| 120 | spin_lock(&(sp_ptr->state_lock)); |
| 121 | sp_ptr->state = state; |
| 122 | spin_unlock(&(sp_ptr->state_lock)); |
| 123 | } |
| 124 | |
| 125 | /******************************************************************************* |
| 126 | * Wait until the state of a Secure Partition is the specified one and change it |
| 127 | * to the desired state. |
| 128 | ******************************************************************************/ |
| 129 | void sp_state_wait_switch(sp_context_t *sp_ptr, sp_state_t from, sp_state_t to) |
| 130 | { |
| 131 | int success = 0; |
| 132 | |
| 133 | while (success == 0) { |
| 134 | spin_lock(&(sp_ptr->state_lock)); |
| 135 | |
| 136 | if (sp_ptr->state == from) { |
| 137 | sp_ptr->state = to; |
| 138 | |
| 139 | success = 1; |
| 140 | } |
| 141 | |
| 142 | spin_unlock(&(sp_ptr->state_lock)); |
| 143 | } |
| 144 | } |
| 145 | |
| 146 | /******************************************************************************* |
| 147 | * Check if the state of a Secure Partition is the specified one and, if so, |
| 148 | * change it to the desired state. Returns 0 on success, -1 on error. |
| 149 | ******************************************************************************/ |
| 150 | int sp_state_try_switch(sp_context_t *sp_ptr, sp_state_t from, sp_state_t to) |
| 151 | { |
| 152 | int ret = -1; |
| 153 | |
| 154 | spin_lock(&(sp_ptr->state_lock)); |
| 155 | |
| 156 | if (sp_ptr->state == from) { |
| 157 | sp_ptr->state = to; |
| 158 | |
| 159 | ret = 0; |
| 160 | } |
| 161 | |
| 162 | spin_unlock(&(sp_ptr->state_lock)); |
| 163 | |
| 164 | return ret; |
| 165 | } |
| 166 | |
| 167 | /******************************************************************************* |
Antonio Nino Diaz | da50cd0 | 2018-06-15 16:21:01 +0100 | [diff] [blame] | 168 | * This function takes an SP context pointer and performs a synchronous entry |
| 169 | * into it. |
Antonio Nino Diaz | c41f206 | 2017-10-24 10:07:35 +0100 | [diff] [blame] | 170 | ******************************************************************************/ |
Antonio Nino Diaz | fb76396 | 2018-07-03 16:54:33 +0100 | [diff] [blame] | 171 | uint64_t spm_sp_synchronous_entry(sp_context_t *sp_ctx, int can_preempt) |
Antonio Nino Diaz | c41f206 | 2017-10-24 10:07:35 +0100 | [diff] [blame] | 172 | { |
Antonio Nino Diaz | da50cd0 | 2018-06-15 16:21:01 +0100 | [diff] [blame] | 173 | uint64_t rc; |
Antonio Nino Diaz | 8cc23f9 | 2018-10-30 11:35:30 +0000 | [diff] [blame] | 174 | unsigned int linear_id = plat_my_core_pos(); |
Antonio Nino Diaz | da50cd0 | 2018-06-15 16:21:01 +0100 | [diff] [blame] | 175 | |
Antonio Nino Diaz | 2ac9a44 | 2018-05-23 11:40:46 +0100 | [diff] [blame] | 176 | assert(sp_ctx != NULL); |
Antonio Nino Diaz | c41f206 | 2017-10-24 10:07:35 +0100 | [diff] [blame] | 177 | |
Antonio Nino Diaz | 2ac9a44 | 2018-05-23 11:40:46 +0100 | [diff] [blame] | 178 | /* Assign the context of the SP to this CPU */ |
Antonio Nino Diaz | 8cc23f9 | 2018-10-30 11:35:30 +0000 | [diff] [blame] | 179 | spm_cpu_set_sp_ctx(linear_id, sp_ctx); |
Antonio Nino Diaz | 2ac9a44 | 2018-05-23 11:40:46 +0100 | [diff] [blame] | 180 | cm_set_context(&(sp_ctx->cpu_ctx), SECURE); |
Antonio Nino Diaz | c41f206 | 2017-10-24 10:07:35 +0100 | [diff] [blame] | 181 | |
Antonio Nino Diaz | 2ac9a44 | 2018-05-23 11:40:46 +0100 | [diff] [blame] | 182 | /* Restore the context assigned above */ |
Antonio Nino Diaz | c41f206 | 2017-10-24 10:07:35 +0100 | [diff] [blame] | 183 | cm_el1_sysregs_context_restore(SECURE); |
| 184 | cm_set_next_eret_context(SECURE); |
| 185 | |
Antonio Nino Diaz | 2ac9a44 | 2018-05-23 11:40:46 +0100 | [diff] [blame] | 186 | /* Invalidate TLBs at EL1. */ |
| 187 | tlbivmalle1(); |
| 188 | dsbish(); |
Antonio Nino Diaz | da50cd0 | 2018-06-15 16:21:01 +0100 | [diff] [blame] | 189 | |
Antonio Nino Diaz | fb76396 | 2018-07-03 16:54:33 +0100 | [diff] [blame] | 190 | if (can_preempt == 1) { |
| 191 | enable_intr_rm_local(INTR_TYPE_NS, SECURE); |
| 192 | } else { |
| 193 | disable_intr_rm_local(INTR_TYPE_NS, SECURE); |
| 194 | } |
| 195 | |
Antonio Nino Diaz | da50cd0 | 2018-06-15 16:21:01 +0100 | [diff] [blame] | 196 | /* Enter Secure Partition */ |
| 197 | rc = spm_secure_partition_enter(&sp_ctx->c_rt_ctx); |
| 198 | |
| 199 | /* Save secure state */ |
| 200 | cm_el1_sysregs_context_save(SECURE); |
| 201 | |
| 202 | return rc; |
Antonio Nino Diaz | c41f206 | 2017-10-24 10:07:35 +0100 | [diff] [blame] | 203 | } |
| 204 | |
Antonio Nino Diaz | c41f206 | 2017-10-24 10:07:35 +0100 | [diff] [blame] | 205 | /******************************************************************************* |
Antonio Nino Diaz | da50cd0 | 2018-06-15 16:21:01 +0100 | [diff] [blame] | 206 | * This function returns to the place where spm_sp_synchronous_entry() was |
| 207 | * called originally. |
Antonio Nino Diaz | c41f206 | 2017-10-24 10:07:35 +0100 | [diff] [blame] | 208 | ******************************************************************************/ |
Antonio Nino Diaz | 8c83ad8 | 2018-11-08 14:21:19 +0000 | [diff] [blame] | 209 | __dead2 void spm_sp_synchronous_exit(uint64_t rc) |
Antonio Nino Diaz | c41f206 | 2017-10-24 10:07:35 +0100 | [diff] [blame] | 210 | { |
Antonio Nino Diaz | 8cc23f9 | 2018-10-30 11:35:30 +0000 | [diff] [blame] | 211 | /* Get context of the SP in use by this CPU. */ |
| 212 | unsigned int linear_id = plat_my_core_pos(); |
| 213 | sp_context_t *ctx = spm_cpu_get_sp_ctx(linear_id); |
Antonio Nino Diaz | da50cd0 | 2018-06-15 16:21:01 +0100 | [diff] [blame] | 214 | |
| 215 | /* |
| 216 | * The SPM must have initiated the original request through a |
| 217 | * synchronous entry into the secure partition. Jump back to the |
| 218 | * original C runtime context with the value of rc in x0; |
| 219 | */ |
| 220 | spm_secure_partition_exit(ctx->c_rt_ctx, rc); |
| 221 | |
| 222 | panic(); |
Antonio Nino Diaz | c41f206 | 2017-10-24 10:07:35 +0100 | [diff] [blame] | 223 | } |
| 224 | |
| 225 | /******************************************************************************* |
Antonio Nino Diaz | fb76396 | 2018-07-03 16:54:33 +0100 | [diff] [blame] | 226 | * This function is the handler registered for Non secure interrupts by the SPM. |
| 227 | * It validates the interrupt and upon success arranges entry into the normal |
| 228 | * world for handling the interrupt. |
| 229 | ******************************************************************************/ |
| 230 | static uint64_t spm_ns_interrupt_handler(uint32_t id, uint32_t flags, |
| 231 | void *handle, void *cookie) |
| 232 | { |
| 233 | /* Check the security state when the exception was generated */ |
| 234 | assert(get_interrupt_src_ss(flags) == SECURE); |
| 235 | |
| 236 | spm_sp_synchronous_exit(SPM_SECURE_PARTITION_PREEMPTED); |
| 237 | } |
| 238 | |
| 239 | /******************************************************************************* |
Antonio Nino Diaz | 2ac9a44 | 2018-05-23 11:40:46 +0100 | [diff] [blame] | 240 | * Jump to each Secure Partition for the first time. |
Antonio Nino Diaz | c41f206 | 2017-10-24 10:07:35 +0100 | [diff] [blame] | 241 | ******************************************************************************/ |
Antonio Nino Diaz | e881147 | 2018-04-17 15:10:18 +0100 | [diff] [blame] | 242 | static int32_t spm_init(void) |
Antonio Nino Diaz | c41f206 | 2017-10-24 10:07:35 +0100 | [diff] [blame] | 243 | { |
Antonio Nino Diaz | 8cc23f9 | 2018-10-30 11:35:30 +0000 | [diff] [blame] | 244 | uint64_t rc = 0; |
Antonio Nino Diaz | 2875931 | 2018-05-22 16:26:48 +0100 | [diff] [blame] | 245 | sp_context_t *ctx; |
Antonio Nino Diaz | c41f206 | 2017-10-24 10:07:35 +0100 | [diff] [blame] | 246 | |
Antonio Nino Diaz | 8cc23f9 | 2018-10-30 11:35:30 +0000 | [diff] [blame] | 247 | for (unsigned int i = 0U; i < PLAT_SPM_MAX_PARTITIONS; i++) { |
Antonio Nino Diaz | c41f206 | 2017-10-24 10:07:35 +0100 | [diff] [blame] | 248 | |
Antonio Nino Diaz | 8cc23f9 | 2018-10-30 11:35:30 +0000 | [diff] [blame] | 249 | ctx = &sp_ctx_array[i]; |
Antonio Nino Diaz | c41f206 | 2017-10-24 10:07:35 +0100 | [diff] [blame] | 250 | |
Antonio Nino Diaz | 8cc23f9 | 2018-10-30 11:35:30 +0000 | [diff] [blame] | 251 | if (ctx->is_present == 0) { |
| 252 | continue; |
| 253 | } |
| 254 | |
| 255 | INFO("Secure Partition %u init...\n", i); |
Antonio Nino Diaz | c41f206 | 2017-10-24 10:07:35 +0100 | [diff] [blame] | 256 | |
Antonio Nino Diaz | 8cc23f9 | 2018-10-30 11:35:30 +0000 | [diff] [blame] | 257 | ctx->state = SP_STATE_RESET; |
Antonio Nino Diaz | c41f206 | 2017-10-24 10:07:35 +0100 | [diff] [blame] | 258 | |
Antonio Nino Diaz | fb76396 | 2018-07-03 16:54:33 +0100 | [diff] [blame] | 259 | rc = spm_sp_synchronous_entry(ctx, 0); |
Antonio Nino Diaz | 8c83ad8 | 2018-11-08 14:21:19 +0000 | [diff] [blame] | 260 | if (rc != SPRT_YIELD_AARCH64) { |
| 261 | ERROR("Unexpected return value 0x%llx\n", rc); |
| 262 | panic(); |
| 263 | } |
Antonio Nino Diaz | c41f206 | 2017-10-24 10:07:35 +0100 | [diff] [blame] | 264 | |
Antonio Nino Diaz | 8cc23f9 | 2018-10-30 11:35:30 +0000 | [diff] [blame] | 265 | ctx->state = SP_STATE_IDLE; |
| 266 | |
| 267 | INFO("Secure Partition %u initialized.\n", i); |
| 268 | } |
Antonio Nino Diaz | c41f206 | 2017-10-24 10:07:35 +0100 | [diff] [blame] | 269 | |
Antonio Nino Diaz | 2ac9a44 | 2018-05-23 11:40:46 +0100 | [diff] [blame] | 270 | return rc; |
Antonio Nino Diaz | c41f206 | 2017-10-24 10:07:35 +0100 | [diff] [blame] | 271 | } |
| 272 | |
| 273 | /******************************************************************************* |
Antonio Nino Diaz | 2ac9a44 | 2018-05-23 11:40:46 +0100 | [diff] [blame] | 274 | * Initialize contexts of all Secure Partitions. |
Antonio Nino Diaz | c41f206 | 2017-10-24 10:07:35 +0100 | [diff] [blame] | 275 | ******************************************************************************/ |
| 276 | int32_t spm_setup(void) |
| 277 | { |
Antonio Nino Diaz | 840627f | 2018-11-27 08:36:02 +0000 | [diff] [blame] | 278 | int rc; |
Antonio Nino Diaz | 2875931 | 2018-05-22 16:26:48 +0100 | [diff] [blame] | 279 | sp_context_t *ctx; |
Antonio Nino Diaz | 840627f | 2018-11-27 08:36:02 +0000 | [diff] [blame] | 280 | void *sp_base, *rd_base; |
| 281 | size_t sp_size, rd_size; |
Antonio Nino Diaz | fb76396 | 2018-07-03 16:54:33 +0100 | [diff] [blame] | 282 | uint64_t flags = 0U; |
Antonio Nino Diaz | c41f206 | 2017-10-24 10:07:35 +0100 | [diff] [blame] | 283 | |
Antonio Nino Diaz | 2ac9a44 | 2018-05-23 11:40:46 +0100 | [diff] [blame] | 284 | /* Disable MMU at EL1 (initialized by BL2) */ |
| 285 | disable_mmu_icache_el1(); |
Antonio Nino Diaz | c41f206 | 2017-10-24 10:07:35 +0100 | [diff] [blame] | 286 | |
Antonio Nino Diaz | fb76396 | 2018-07-03 16:54:33 +0100 | [diff] [blame] | 287 | /* |
| 288 | * Non-blocking services can be interrupted by Non-secure interrupts. |
| 289 | * Register an interrupt handler for NS interrupts when generated while |
| 290 | * the CPU is in secure state. They are routed to EL3. |
| 291 | */ |
| 292 | set_interrupt_rm_flag(flags, SECURE); |
| 293 | |
| 294 | uint64_t rc_int = register_interrupt_type_handler(INTR_TYPE_NS, |
| 295 | spm_ns_interrupt_handler, flags); |
| 296 | if (rc_int) { |
| 297 | ERROR("SPM: Failed to register NS interrupt handler with rc = %llx\n", |
| 298 | rc_int); |
| 299 | panic(); |
| 300 | } |
| 301 | |
| 302 | /* |
| 303 | * Setup all Secure Partitions. |
| 304 | */ |
Antonio Nino Diaz | 8cc23f9 | 2018-10-30 11:35:30 +0000 | [diff] [blame] | 305 | unsigned int i = 0U; |
| 306 | |
| 307 | while (1) { |
| 308 | rc = plat_spm_sp_get_next_address(&sp_base, &sp_size, |
| 309 | &rd_base, &rd_size); |
| 310 | if (rc < 0) { |
| 311 | /* Reached the end of the package. */ |
| 312 | break; |
| 313 | } |
Antonio Nino Diaz | c41f206 | 2017-10-24 10:07:35 +0100 | [diff] [blame] | 314 | |
Antonio Nino Diaz | 8cc23f9 | 2018-10-30 11:35:30 +0000 | [diff] [blame] | 315 | if (i >= PLAT_SPM_MAX_PARTITIONS) { |
| 316 | ERROR("Too many partitions in the package.\n"); |
| 317 | panic(); |
| 318 | } |
Antonio Nino Diaz | c41f206 | 2017-10-24 10:07:35 +0100 | [diff] [blame] | 319 | |
Antonio Nino Diaz | 8cc23f9 | 2018-10-30 11:35:30 +0000 | [diff] [blame] | 320 | ctx = &sp_ctx_array[i]; |
Antonio Nino Diaz | 840627f | 2018-11-27 08:36:02 +0000 | [diff] [blame] | 321 | |
Antonio Nino Diaz | 8cc23f9 | 2018-10-30 11:35:30 +0000 | [diff] [blame] | 322 | assert(ctx->is_present == 0); |
Antonio Nino Diaz | c41f206 | 2017-10-24 10:07:35 +0100 | [diff] [blame] | 323 | |
Antonio Nino Diaz | 8cc23f9 | 2018-10-30 11:35:30 +0000 | [diff] [blame] | 324 | /* Initialize context of the SP */ |
| 325 | INFO("Secure Partition %u context setup start...\n", i); |
Antonio Nino Diaz | 840627f | 2018-11-27 08:36:02 +0000 | [diff] [blame] | 326 | |
Antonio Nino Diaz | 8cc23f9 | 2018-10-30 11:35:30 +0000 | [diff] [blame] | 327 | /* Assign translation tables context. */ |
| 328 | ctx->xlat_ctx_handle = spm_sp_xlat_context_alloc(); |
| 329 | |
| 330 | /* Save location of the image in physical memory */ |
| 331 | ctx->image_base = (uintptr_t)sp_base; |
| 332 | ctx->image_size = sp_size; |
| 333 | |
| 334 | rc = plat_spm_sp_rd_load(&ctx->rd, rd_base, rd_size); |
| 335 | if (rc < 0) { |
| 336 | ERROR("Error while loading RD blob.\n"); |
| 337 | panic(); |
| 338 | } |
| 339 | |
| 340 | spm_sp_setup(ctx); |
| 341 | |
| 342 | ctx->is_present = 1; |
| 343 | |
| 344 | INFO("Secure Partition %u setup done.\n", i); |
| 345 | |
| 346 | i++; |
Antonio Nino Diaz | 840627f | 2018-11-27 08:36:02 +0000 | [diff] [blame] | 347 | } |
| 348 | |
Antonio Nino Diaz | 8cc23f9 | 2018-10-30 11:35:30 +0000 | [diff] [blame] | 349 | if (i == 0U) { |
| 350 | ERROR("No present partitions in the package.\n"); |
| 351 | panic(); |
| 352 | } |
Antonio Nino Diaz | 2ac9a44 | 2018-05-23 11:40:46 +0100 | [diff] [blame] | 353 | |
| 354 | /* Register init function for deferred init. */ |
Antonio Nino Diaz | c41f206 | 2017-10-24 10:07:35 +0100 | [diff] [blame] | 355 | bl31_register_bl32_init(&spm_init); |
| 356 | |
Antonio Nino Diaz | c41f206 | 2017-10-24 10:07:35 +0100 | [diff] [blame] | 357 | return 0; |
| 358 | } |