blob: 3b124c789377c6ea75adf013076f30e140600742 [file] [log] [blame]
Jorge Ramirez-Ortizbf084dc2018-09-23 09:36:13 +02001/*
2 * Copyright (c) 2016-2017, ARM Limited and Contributors. All rights reserved.
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
Jorge Ramirez-Ortizbf084dc2018-09-23 09:36:13 +02007#include <platform_def.h>
Antonio Nino Diaze0f90632018-12-14 00:18:21 +00008
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-Ortizbf084dc2018-09-23 09:36:13 +020013
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 Vasut93c85fc2018-10-02 20:45:18 +020024extern uint64_t fdt_blob[PAGE_SIZE_4KB / sizeof(uint64_t)];
25
Jorge Ramirez-Ortizbf084dc2018-09-23 09:36:13 +020026static 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 Vasutfaea3fb2018-12-13 22:08:24 +010076 .ep_info.args.arg1 = (uintptr_t)fdt_blob,
Jorge Ramirez-Ortizbf084dc2018-09-23 09:36:13 +020077 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
87REGISTER_BL_IMAGE_DESCS(bl2_mem_params_descs)