diff options
author | Antonio Nino Diaz <antonio.ninodiaz@arm.com> | 2016-02-15 14:53:10 +0000 |
---|---|---|
committer | Antonio Nino Diaz <antonio.ninodiaz@arm.com> | 2016-03-02 16:12:54 +0000 |
commit | cf2c8a33e02029d9b15f4b428b1ddd0ec4e687a4 (patch) | |
tree | 86e022c44a9076f7547ef04c3d0c23a5d7ae525f /bl2 | |
parent | 85320724af73d0015d2cb0e99d59c292290b6ce5 (diff) |
Enable preloaded BL33 alternative boot flow
Enable alternative boot flow where BL2 does not load BL33 from
non-volatile storage, and BL31 hands execution over to a preloaded
BL33.
The flag used to enable this bootflow is BL33_BASE, which must hold
the entrypoint address of the BL33 image. The User Guide has been
updated with an example of how to use this option with a bootwrapped
kernel.
Change-Id: I48087421a7b0636ac40dca7d457d745129da474f
Diffstat (limited to 'bl2')
-rw-r--r-- | bl2/bl2_main.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/bl2/bl2_main.c b/bl2/bl2_main.c index 9ff75d29..73781dd0 100644 --- a/bl2/bl2_main.c +++ b/bl2/bl2_main.c @@ -169,6 +169,7 @@ static int load_bl32(bl31_params_t *bl2_to_bl31_params) return e; } +#ifndef BL33_BASE /******************************************************************************* * Load the BL33 image. * The bl2_to_bl31_params param will be updated with the relevant BL33 @@ -199,6 +200,8 @@ static int load_bl33(bl31_params_t *bl2_to_bl31_params) return e; } +#endif /* BL33_BASE */ + #endif /* EL3_PAYLOAD_BASE */ /******************************************************************************* @@ -253,7 +256,7 @@ void bl2_main(void) * bl31_params_t structure makes sense in the context of EL3 payloads. * This will be refined in the future. */ - VERBOSE("BL2: Populating the entrypoint info for the EL3 payload\n"); + INFO("BL2: Populating the entrypoint info for the EL3 payload\n"); bl31_ep_info->pc = EL3_PAYLOAD_BASE; bl31_ep_info->args.arg0 = (unsigned long) bl2_to_bl31_params; bl2_plat_set_bl31_ep_info(NULL, bl31_ep_info); @@ -274,11 +277,22 @@ void bl2_main(void) } } +#ifdef BL33_BASE + /* + * In this case, don't load the BL33 image as it's already loaded in + * memory. Update BL33 entrypoint information. + */ + INFO("BL2: Populating the entrypoint info for the preloaded BL33\n"); + bl2_to_bl31_params->bl33_ep_info->pc = BL33_BASE; + bl2_plat_set_bl33_ep_info(NULL, bl2_to_bl31_params->bl33_ep_info); +#else e = load_bl33(bl2_to_bl31_params); if (e) { ERROR("Failed to load BL33 (%i)\n", e); plat_error_handler(e); } +#endif /* BL33_BASE */ + #endif /* EL3_PAYLOAD_BASE */ /* Flush the params to be passed to memory */ |