When enabling EFI payload support in a build that has i.MX boards enabled, booting the EFI payload reports some failed initcalls. Disable them if we don't probe from device tree or aren't on an i.MX system. Signed-off-by: Ahmad Fatoum <a.fatoum@xxxxxxxxxxxxxx> --- arch/arm/mach-imx/imx.c | 11 ++++++----- arch/arm/mach-imx/scratch.c | 4 ++++ 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/arch/arm/mach-imx/imx.c b/arch/arm/mach-imx/imx.c index f3491c6df7fa..2522ce04e6f5 100644 --- a/arch/arm/mach-imx/imx.c +++ b/arch/arm/mach-imx/imx.c @@ -89,11 +89,12 @@ static int imx_init(void) struct device_node *root; root = of_get_root_node(); - if (root) { - __imx_cpu_type = imx_soc_from_dt(); - if (!__imx_cpu_type) - return 0; - } + if (!root) + return 0; + + __imx_cpu_type = imx_soc_from_dt(); + if (!__imx_cpu_type) + return 0; /* * Don't add new SoCs to this list, instead use the new diff --git a/arch/arm/mach-imx/scratch.c b/arch/arm/mach-imx/scratch.c index b7280ff60952..e12d3401a854 100644 --- a/arch/arm/mach-imx/scratch.c +++ b/arch/arm/mach-imx/scratch.c @@ -8,6 +8,7 @@ #include <mach/imx/imx9-regs.h> #include <mach/imx/esdctl.h> #include <mach/imx/scratch.h> +#include <mach/imx/generic.h> #include <memory.h> #include <tee/optee.h> #include <pbl.h> @@ -95,6 +96,9 @@ const struct optee_header *imx_scratch_get_optee_hdr(void) static int imx8m_reserve_scratch_area(void) { + if (!__imx_cpu_type) + return 0; + return request_barebox_region("scratch area", (ulong)arm_mem_scratch_get(), sizeof(struct imx_scratch_space)) ? 0 : -EINVAL; -- 2.39.2