Jorge Ramirez-Ortiz | bf084dc | 2018-09-23 09:36:13 +0200 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2016-2017, ARM Limited and Contributors. All rights reserved. |
| 3 | * |
| 4 | * SPDX-License-Identifier: BSD-3-Clause |
| 5 | */ |
| 6 | |
Jorge Ramirez-Ortiz | bf084dc | 2018-09-23 09:36:13 +0200 | [diff] [blame] | 7 | #include <platform_def.h> |
Antonio Nino Diaz | e0f9063 | 2018-12-14 00:18:21 +0000 | [diff] [blame] | 8 | |
| 9 | #include <common/bl_common.h> |
| 10 | #include <common/desc_image_load.h> |
| 11 | #include <lib/xlat_tables/xlat_tables_defs.h> |
| 12 | #include <plat/common/platform.h> |
Jorge Ramirez-Ortiz | bf084dc | 2018-09-23 09:36:13 +0200 | [diff] [blame] | 13 | |
| 14 | #if (RCAR_BL33_EXECUTION_EL != 0) && (RCAR_BL33_EXECUTION_EL != 1) |
| 15 | #error |
| 16 | #endif |
| 17 | |
| 18 | #if (RCAR_BL33_EXECUTION_EL == 0) |
| 19 | #define BL33_MODE MODE_EL1 |
| 20 | #else |
| 21 | #define BL33_MODE MODE_EL2 |
| 22 | #endif |
| 23 | |
Marek Vasut | 93c85fc | 2018-10-02 20:45:18 +0200 | [diff] [blame] | 24 | extern uint64_t fdt_blob[PAGE_SIZE_4KB / sizeof(uint64_t)]; |
| 25 | |
Jorge Ramirez-Ortiz | bf084dc | 2018-09-23 09:36:13 +0200 | [diff] [blame] | 26 | static bl_mem_params_node_t bl2_mem_params_descs[] = { |
| 27 | { |
| 28 | .image_id = BL31_IMAGE_ID, |
| 29 | |
| 30 | SET_STATIC_PARAM_HEAD(ep_info, PARAM_EP, VERSION_2, |
| 31 | entry_point_info_t, SECURE | EXECUTABLE | EP_FIRST_EXE), |
| 32 | .ep_info.spsr = SPSR_64(MODE_EL3, |
| 33 | MODE_SP_ELX, DISABLE_ALL_EXCEPTIONS), |
| 34 | .ep_info.pc = BL31_BASE, |
| 35 | |
| 36 | |
| 37 | SET_STATIC_PARAM_HEAD(image_info, PARAM_EP, VERSION_2, |
| 38 | image_info_t, IMAGE_ATTRIB_PLAT_SETUP), |
| 39 | .image_info.image_max_size = BL31_LIMIT - BL31_BASE, |
| 40 | .image_info.image_base = BL31_BASE, |
| 41 | |
| 42 | # ifdef BL32_BASE |
| 43 | .next_handoff_image_id = BL32_IMAGE_ID, |
| 44 | # else |
| 45 | .next_handoff_image_id = BL33_IMAGE_ID, |
| 46 | # endif |
| 47 | }, |
| 48 | # ifdef BL32_BASE |
| 49 | { |
| 50 | .image_id = BL32_IMAGE_ID, |
| 51 | |
| 52 | SET_STATIC_PARAM_HEAD(ep_info, PARAM_EP, VERSION_2, |
| 53 | entry_point_info_t, SECURE | EXECUTABLE), |
| 54 | .ep_info.pc = BL32_BASE, |
| 55 | .ep_info.spsr = 0, |
| 56 | |
| 57 | SET_STATIC_PARAM_HEAD(image_info, PARAM_EP, VERSION_2, |
| 58 | image_info_t, 0), |
| 59 | .image_info.image_max_size = BL32_LIMIT - BL32_BASE, |
| 60 | .image_info.image_base = BL32_BASE, |
| 61 | |
| 62 | .next_handoff_image_id = BL33_IMAGE_ID, |
| 63 | }, |
| 64 | #endif |
| 65 | { |
| 66 | .image_id = BL33_IMAGE_ID, |
| 67 | |
| 68 | SET_STATIC_PARAM_HEAD(ep_info, PARAM_EP, VERSION_2, |
| 69 | entry_point_info_t, NON_SECURE | EXECUTABLE), |
| 70 | .ep_info.spsr = SPSR_64(BL33_MODE, MODE_SP_ELX, |
| 71 | DISABLE_ALL_EXCEPTIONS), |
| 72 | .ep_info.pc = BL33_BASE, |
| 73 | #ifdef RCAR_BL33_ARG0 |
| 74 | .ep_info.args.arg0 = RCAR_BL33_ARG0, |
| 75 | #endif |
Marek Vasut | faea3fb | 2018-12-13 22:08:24 +0100 | [diff] [blame] | 76 | .ep_info.args.arg1 = (uintptr_t)fdt_blob, |
Jorge Ramirez-Ortiz | bf084dc | 2018-09-23 09:36:13 +0200 | [diff] [blame] | 77 | SET_STATIC_PARAM_HEAD(image_info, PARAM_EP, VERSION_2, |
| 78 | image_info_t, 0), |
| 79 | .image_info.image_max_size = |
| 80 | (uint32_t) (DRAM_LIMIT - BL33_BASE), |
| 81 | .image_info.image_base = BL33_BASE, |
| 82 | |
| 83 | .next_handoff_image_id = INVALID_IMAGE_ID, |
| 84 | } |
| 85 | }; |
| 86 | |
| 87 | REGISTER_BL_IMAGE_DESCS(bl2_mem_params_descs) |