mirror of
https://github.com/ARM-software/arm-trusted-firmware.git
synced 2025-04-19 02:54:24 +00:00
Merge pull request #103 from athoelke:dh/tf-issues#68-v3
This commit is contained in:
commit
b3bcbcf1de
3 changed files with 37 additions and 31 deletions
|
@ -134,32 +134,34 @@ void bl2_main(void)
|
||||||
bl2_plat_set_bl33_ep_info(bl2_to_bl31_params->bl33_image_info,
|
bl2_plat_set_bl33_ep_info(bl2_to_bl31_params->bl33_image_info,
|
||||||
bl2_to_bl31_params->bl33_ep_info);
|
bl2_to_bl31_params->bl33_ep_info);
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef BL32_BASE
|
||||||
/*
|
/*
|
||||||
* Load the BL32 image if there's one. It is upto to platform
|
* Load the BL32 image if there's one. It is upto to platform
|
||||||
* to specify where BL32 should be loaded if it exists. It
|
* to specify where BL32 should be loaded if it exists. It
|
||||||
* could create space in the secure sram or point to a
|
* could create space in the secure sram or point to a
|
||||||
* completely different memory. A zero size indicates that the
|
* completely different memory.
|
||||||
* platform does not want to load a BL32 image.
|
*
|
||||||
|
* If a platform does not want to attempt to load BL3-2 image
|
||||||
|
* it must leave BL32_BASE undefined
|
||||||
*/
|
*/
|
||||||
bl2_plat_get_bl32_meminfo(&bl32_mem_info);
|
bl2_plat_get_bl32_meminfo(&bl32_mem_info);
|
||||||
if (bl32_mem_info.total_size) {
|
e = load_image(&bl32_mem_info,
|
||||||
e = load_image(&bl32_mem_info,
|
BL32_IMAGE_NAME,
|
||||||
BL32_IMAGE_NAME,
|
bl32_mem_info.attr & LOAD_MASK,
|
||||||
bl32_mem_info.attr &
|
BL32_BASE,
|
||||||
LOAD_MASK,
|
bl2_to_bl31_params->bl32_image_info,
|
||||||
BL32_BASE,
|
bl2_to_bl31_params->bl32_ep_info);
|
||||||
bl2_to_bl31_params->bl32_image_info,
|
|
||||||
bl2_to_bl31_params->bl32_ep_info);
|
|
||||||
|
|
||||||
/* Halt if failed to load normal world firmware. */
|
/* Issue a diagnostic if no Secure Payload could be loaded */
|
||||||
if (e) {
|
if (e) {
|
||||||
WARN("Failed to load BL3-2.\n");
|
WARN("Failed to load BL3-2.\n");
|
||||||
} else {
|
} else {
|
||||||
bl2_plat_set_bl32_ep_info(
|
bl2_plat_set_bl32_ep_info(
|
||||||
bl2_to_bl31_params->bl32_image_info,
|
bl2_to_bl31_params->bl32_image_info,
|
||||||
bl2_to_bl31_params->bl32_ep_info);
|
bl2_to_bl31_params->bl32_ep_info);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
#endif /* BL32_BASE */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Run BL31 via an SMC to BL1. Information on how to pass control to
|
* Run BL31 via an SMC to BL1. Information on how to pass control to
|
||||||
|
|
|
@ -555,23 +555,24 @@ using the `platform_is_primary_cpu()` function. BL1 passed control to BL2 at
|
||||||
if the platform wants to restrict the amount of memory visible to BL3-1.
|
if the platform wants to restrict the amount of memory visible to BL3-1.
|
||||||
Details of this function are given below.
|
Details of this function are given below.
|
||||||
|
|
||||||
4. Loading the BL3-2 binary image (if present) in platform provided memory
|
4. (Optional) Loading the BL3-2 binary image (if present) from platform
|
||||||
using semi-hosting. To load the BL3-2 image, BL2 makes use of the
|
provided non-volatile storage. To load the BL3-2 image, BL2 makes use of
|
||||||
`bl32_meminfo` field in the `bl31_args` structure to which a pointer is
|
the `bl32_meminfo` field in the `bl31_args` structure to which a pointer is
|
||||||
returned by the `bl2_get_bl31_args_ptr()` function. The platform also
|
returned by the `bl2_get_bl31_args_ptr()` function. The platform also
|
||||||
defines the address in memory where BL3-2 is loaded through the constant
|
defines the address in memory where BL3-2 is loaded through the optional
|
||||||
`BL32_BASE`. BL2 uses this information to determine if there is enough
|
constant `BL32_BASE`. BL2 uses this information to determine if there is
|
||||||
memory to load the BL3-2 image.
|
enough memory to load the BL3-2 image. If `BL32_BASE` is not defined then
|
||||||
|
this and the following two steps are not performed.
|
||||||
|
|
||||||
5. Arranging to pass control to the BL3-2 image (if present) that has been
|
5. (Optional) Arranging to pass control to the BL3-2 image (if present) that
|
||||||
pre-loaded at `BL32_BASE`. BL2 populates an `el_change_info` structure
|
has been pre-loaded at `BL32_BASE`. BL2 populates an `el_change_info`
|
||||||
in memory provided by the platform with information about how BL3-1 should
|
structure in memory provided by the platform with information about how
|
||||||
pass control to the BL3-2 image. This structure follows the
|
BL3-1 should pass control to the BL3-2 image. This structure follows the
|
||||||
`el_change_info` structure populated for the normal world BL image in 2.
|
`el_change_info` structure populated for the normal world BL image in 2.
|
||||||
above.
|
above.
|
||||||
|
|
||||||
6. Populating a `meminfo` structure with the following information in
|
6. (Optional) Populating a `meminfo` structure with the following information
|
||||||
memory that is accessible by BL3-1 immediately upon entry.
|
in memory that is accessible by BL3-1 immediately upon entry.
|
||||||
|
|
||||||
meminfo.total_base = Base address of memory visible to BL3-2
|
meminfo.total_base = Base address of memory visible to BL3-2
|
||||||
meminfo.total_size = Size of memory visible to BL3-2
|
meminfo.total_size = Size of memory visible to BL3-2
|
||||||
|
@ -581,7 +582,7 @@ using the `platform_is_primary_cpu()` function. BL1 passed control to BL2 at
|
||||||
BL3-2
|
BL3-2
|
||||||
|
|
||||||
BL2 populates this information in the `bl32_meminfo` field of the pointer
|
BL2 populates this information in the `bl32_meminfo` field of the pointer
|
||||||
returned by the `bl2_get_bl31_args_ptr() function.
|
returned by the `bl2_get_bl31_args_ptr()` function.
|
||||||
|
|
||||||
The following functions must be implemented by the platform port to enable BL2
|
The following functions must be implemented by the platform port to enable BL2
|
||||||
to perform the above tasks.
|
to perform the above tasks.
|
||||||
|
|
|
@ -65,7 +65,10 @@ typedef struct {
|
||||||
static const plat_fip_name_uuid_t name_uuid[] = {
|
static const plat_fip_name_uuid_t name_uuid[] = {
|
||||||
{BL2_IMAGE_NAME, UUID_TRUSTED_BOOT_FIRMWARE_BL2},
|
{BL2_IMAGE_NAME, UUID_TRUSTED_BOOT_FIRMWARE_BL2},
|
||||||
{BL31_IMAGE_NAME, UUID_EL3_RUNTIME_FIRMWARE_BL31},
|
{BL31_IMAGE_NAME, UUID_EL3_RUNTIME_FIRMWARE_BL31},
|
||||||
|
#ifdef BL32_IMAGE_NAME
|
||||||
|
/* BL3-2 is optional in the platform */
|
||||||
{BL32_IMAGE_NAME, UUID_SECURE_PAYLOAD_BL32},
|
{BL32_IMAGE_NAME, UUID_SECURE_PAYLOAD_BL32},
|
||||||
|
#endif /* BL32_IMAGE_NAME */
|
||||||
{BL33_IMAGE_NAME, UUID_NON_TRUSTED_FIRMWARE_BL33},
|
{BL33_IMAGE_NAME, UUID_NON_TRUSTED_FIRMWARE_BL33},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue