X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=common%2Fspl%2Fspl_atf.c;h=4715f9d3719faced434616c5bd651563cf6be2f9;hb=a239b82dad03ad942aaf5fbbda672e882968488c;hp=63557c01e8c33417f13c1292bed11ed083a3def4;hpb=6e6cf015e7cdd7ca83a933320a81201972bd5e5e;p=platform%2Fkernel%2Fu-boot.git diff --git a/common/spl/spl_atf.c b/common/spl/spl_atf.c index 63557c0..4715f9d3 100644 --- a/common/spl/spl_atf.c +++ b/common/spl/spl_atf.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: BSD-3-Clause /* * Reference to the ARM TF Project, * plat/arm/common/arm_bl2_setup.c @@ -6,8 +7,6 @@ * Copyright (C) 2016 Rockchip Electronic Co.,Ltd * Written by Kever Yang * Copyright (C) 2017 Theobroma Systems Design und Consulting GmbH - * - * SPDX-License-Identifier: BSD-3-Clause */ #include @@ -46,17 +45,19 @@ static struct bl31_params *bl2_plat_get_bl31_params(uintptr_t bl33_entry) SET_PARAM_HEAD(bl2_to_bl31_params, ATF_PARAM_BL31, ATF_VERSION_1, 0); /* Fill BL31 related information */ + bl2_to_bl31_params->bl31_image_info = &bl31_params_mem.bl31_image_info; SET_PARAM_HEAD(bl2_to_bl31_params->bl31_image_info, ATF_PARAM_IMAGE_BINARY, ATF_VERSION_1, 0); /* Fill BL32 related information if it exists */ -#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, ATF_PARAM_EP, ATF_VERSION_1, 0); bl2_to_bl31_params->bl32_image_info = &bl31_params_mem.bl32_image_info; SET_PARAM_HEAD(bl2_to_bl31_params->bl32_image_info, ATF_PARAM_IMAGE_BINARY, ATF_VERSION_1, 0); +#ifndef BL32_BASE + bl2_to_bl31_params->bl32_ep_info->pc = 0; #endif /* BL32_BASE */ /* Fill BL33 related information */ @@ -144,6 +145,7 @@ void spl_invoke_atf(struct spl_image_info *spl_image) { uintptr_t bl33_entry = CONFIG_SYS_TEXT_BASE; void *blob = spl_image->fdt_addr; + uintptr_t platform_param = (uintptr_t)blob; int node; /* @@ -158,8 +160,17 @@ void spl_invoke_atf(struct spl_image_info *spl_image) bl33_entry = spl_fit_images_get_entry(blob, node); /* + * If ATF_NO_PLATFORM_PARAM is set, we override the platform + * parameter and always pass 0. This is a workaround for + * older ATF versions that have insufficiently robust (or + * overzealous) argument validation. + */ + if (CONFIG_IS_ENABLED(ATF_NO_PLATFORM_PARAM)) + platform_param = 0; + + /* * We don't provide a BL3-2 entry yet, but this will be possible * using similar logic. */ - bl31_entry(spl_image->entry_point, bl33_entry, (uintptr_t)blob); + bl31_entry(spl_image->entry_point, bl33_entry, platform_param); }