Commit 2a1e0866 authored by Hadi Asyrafi's avatar Hadi Asyrafi Committed by Abdul Halim, Muhammad Hadi Asyrafi
Browse files

intel: agilex: Enable uboot BL31 loading



This patch enables uboot's spl entrypoint to BL31 and also handles
secondary cpus state during cold boot.
Signed-off-by: default avatarHadi Asyrafi <muhammad.hadi.asyrafi.abdul.halim@intel.com>
Change-Id: Ib70ec91a3ad09a568cb66e7c1e23a2b3e460746c
parent b012454d
...@@ -11,8 +11,10 @@ ...@@ -11,8 +11,10 @@
#include <common/bl_common.h> #include <common/bl_common.h>
#include <drivers/arm/gicv2.h> #include <drivers/arm/gicv2.h>
#include <drivers/ti/uart/uart_16550.h> #include <drivers/ti/uart/uart_16550.h>
#include <lib/mmio.h>
#include <lib/xlat_tables/xlat_tables.h> #include <lib/xlat_tables/xlat_tables.h>
#include "socfpga_private.h"
static entry_point_info_t bl32_image_ep_info; static entry_point_info_t bl32_image_ep_info;
static entry_point_info_t bl33_image_ep_info; static entry_point_info_t bl33_image_ep_info;
...@@ -44,23 +46,33 @@ void bl31_early_platform_setup2(u_register_t arg0, u_register_t arg1, ...@@ -44,23 +46,33 @@ void bl31_early_platform_setup2(u_register_t arg0, u_register_t arg1,
void *from_bl2 = (void *) arg0; void *from_bl2 = (void *) arg0;
bl_params_t *params_from_bl2 = (bl_params_t *)from_bl2; bl_params_t *params_from_bl2 = (bl_params_t *)from_bl2;
assert(params_from_bl2 != NULL); assert(params_from_bl2 != NULL);
assert(params_from_bl2->h.type == PARAM_BL_PARAMS);
assert(params_from_bl2->h.version >= VERSION_2);
/* /*
* Copy BL32 (if populated by BL31) and BL33 entry point information. * Copy BL32 (if populated by BL31) and BL33 entry point information.
* They are stored in Secure RAM, in BL31's address space. * They are stored in Secure RAM, in BL31's address space.
*/ */
bl_params_node_t *bl_params = params_from_bl2->head; if (params_from_bl2->h.type == PARAM_BL_PARAMS &&
params_from_bl2->h.version >= VERSION_2) {
bl_params_node_t *bl_params = params_from_bl2->head;
while (bl_params) {
if (bl_params->image_id == BL33_IMAGE_ID)
bl33_image_ep_info = *bl_params->ep_info;
while (bl_params) { bl_params = bl_params->next_params_info;
if (bl_params->image_id == BL33_IMAGE_ID) }
bl33_image_ep_info = *bl_params->ep_info; } else {
struct socfpga_bl31_params *arg_from_bl2 =
(struct socfpga_bl31_params *) from_bl2;
bl_params = bl_params->next_params_info; assert(arg_from_bl2->h.type == PARAM_BL31);
assert(arg_from_bl2->h.version >= VERSION_1);
bl32_image_ep_info = *arg_from_bl2->bl32_ep_info;
bl33_image_ep_info = *arg_from_bl2->bl33_ep_info;
} }
SET_SECURITY_STATE(bl33_image_ep_info.h.attr, NON_SECURE); SET_SECURITY_STATE(bl33_image_ep_info.h.attr, NON_SECURE);
} }
...@@ -91,6 +103,10 @@ void bl31_platform_setup(void) ...@@ -91,6 +103,10 @@ void bl31_platform_setup(void)
gicv2_distif_init(); gicv2_distif_init();
gicv2_pcpu_distif_init(); gicv2_pcpu_distif_init();
gicv2_cpuif_enable(); gicv2_cpuif_enable();
/* Signal secondary CPUs to jump to BL31 (BL2 = U-boot SPL) */
mmio_write_64(PLAT_CPU_RELEASE_ADDR,
(uint64_t)plat_secondary_cpus_bl31_entry);
} }
const mmap_region_t plat_agilex_mmap[] = { const mmap_region_t plat_agilex_mmap[] = {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment