From 5ad0de14e9a87406a34352efffb3140478b6041f Mon Sep 17 00:00:00 2001 From: Victor Chong Date: Thu, 14 Sep 2017 01:22:14 +0900 Subject: [PATCH 1/2] hikey*: Fix typo Signed-off-by: Victor Chong --- plat/hisilicon/hikey/hikey_bl2_setup.c | 2 +- plat/hisilicon/hikey960/hikey960_bl2_setup.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/plat/hisilicon/hikey/hikey_bl2_setup.c b/plat/hisilicon/hikey/hikey_bl2_setup.c index 968da9bd63..86c205d38b 100644 --- a/plat/hisilicon/hikey/hikey_bl2_setup.c +++ b/plat/hisilicon/hikey/hikey_bl2_setup.c @@ -244,7 +244,7 @@ bl31_params_t *bl2_plat_get_bl31_params(void) VERSION_1, 0); /* Fill BL3-2 related information if it exists */ -#if BL32_BASE +#ifdef BL32_BASE bl2_to_bl31_params->bl32_ep_info = &bl31_params_mem.bl32_ep_info; SET_PARAM_HEAD(bl2_to_bl31_params->bl32_ep_info, PARAM_EP, VERSION_1, 0); diff --git a/plat/hisilicon/hikey960/hikey960_bl2_setup.c b/plat/hisilicon/hikey960/hikey960_bl2_setup.c index b8d7f9e9ed..b50ed87f0c 100644 --- a/plat/hisilicon/hikey960/hikey960_bl2_setup.c +++ b/plat/hisilicon/hikey960/hikey960_bl2_setup.c @@ -91,7 +91,7 @@ bl31_params_t *bl2_plat_get_bl31_params(void) VERSION_1, 0); /* Fill BL3-2 related information if it exists */ -#if BL32_BASE +#ifdef BL32_BASE bl2_to_bl31_params->bl32_ep_info = &bl31_params_mem.bl32_ep_info; SET_PARAM_HEAD(bl2_to_bl31_params->bl32_ep_info, PARAM_EP, VERSION_1, 0); From fe116c65f56184d728c999a15b2c4123175c7120 Mon Sep 17 00:00:00 2001 From: Victor Chong Date: Thu, 14 Sep 2017 01:27:19 +0900 Subject: [PATCH 2/2] hikey*: Undef BL32_BASE when building without SPD Otherwise, BL2 tries to load a BL32 image and triggers assert(result == 0) in plat_get_image_source() in hikey{960}_io_storage.c in a debug build, or displays ERROR: BL2: Failed to load image in a release build. Signed-off-by: Victor Chong --- plat/hisilicon/hikey/include/platform_def.h | 7 +++++++ plat/hisilicon/hikey960/include/platform_def.h | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/plat/hisilicon/hikey/include/platform_def.h b/plat/hisilicon/hikey/include/platform_def.h index 0c736ab131..01806542d8 100644 --- a/plat/hisilicon/hikey/include/platform_def.h +++ b/plat/hisilicon/hikey/include/platform_def.h @@ -135,6 +135,13 @@ #error "Currently unsupported HIKEY_TSP_LOCATION_ID value" #endif +/* BL32 is mandatory in AArch32 */ +#ifndef AARCH32 +#ifdef SPD_none +#undef BL32_BASE +#endif /* SPD_none */ +#endif + #define NS_BL1U_BASE (BL2_BASE) #define NS_BL1U_SIZE (0x00010000) #define NS_BL1U_LIMIT (NS_BL1U_BASE + NS_BL1U_SIZE) diff --git a/plat/hisilicon/hikey960/include/platform_def.h b/plat/hisilicon/hikey960/include/platform_def.h index 2fae666bf4..202952c5ea 100644 --- a/plat/hisilicon/hikey960/include/platform_def.h +++ b/plat/hisilicon/hikey960/include/platform_def.h @@ -94,6 +94,13 @@ #error "Currently unsupported HIKEY960_TSP_LOCATION_ID value" #endif +/* BL32 is mandatory in AArch32 */ +#ifndef AARCH32 +#ifdef SPD_none +#undef BL32_BASE +#endif /* SPD_none */ +#endif + #define NS_BL1U_BASE (BL31_LIMIT) /* 1AC9_8000 */ #define NS_BL1U_SIZE (0x00100000) #define NS_BL1U_LIMIT (NS_BL1U_BASE + NS_BL1U_SIZE)