diff options
author | Philipp Tomsich <philipp.tomsich@theobroma-systems.com> | 2018-01-02 23:16:43 +0300 |
---|---|---|
committer | Philipp Tomsich <philipp.tomsich@theobroma-systems.com> | 2018-01-03 16:26:57 +0300 |
commit | d21fb63d772d32373600abeb7afcb53033e087a7 (patch) | |
tree | 86fb058eba0abfbcfd6c622c114e05368891e44b /common/spl/spl_atf.c | |
parent | 224d261a16435389cc349b0e1640d489f117189d (diff) | |
download | u-boot-d21fb63d772d32373600abeb7afcb53033e087a7.tar.xz |
spl: atf: add SPL_ATF_NO_PLATFORM_PARAM option
While we expect to call a pointer to a valid FDT (or NULL) as the
platform parameter to an ATF, some ATF versions are not U-Boot aware
and have an insufficiently robust (or an overzealour) parameter
validation: either way, this may cause a hard-stop with uncooperative
ATF versions.
This change adds the option to suppress passing a platform parameter
and will always pass NULL.
Debug output from ATF w/ this option disabled (i.e. default):
INFO: plat_param_from_bl2: 0x291450
Debug output from ATF w/ this option enabled:
INFO: plat_param_from_bl2: 0
Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Tested-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
Diffstat (limited to 'common/spl/spl_atf.c')
-rw-r--r-- | common/spl/spl_atf.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/common/spl/spl_atf.c b/common/spl/spl_atf.c index 63557c01e8..a942de9964 100644 --- a/common/spl/spl_atf.c +++ b/common/spl/spl_atf.c @@ -144,6 +144,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 +159,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); } |