mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH 4/4] ARM: i.MX8M: neuter initcalls when EFI booted
Date: Fri,  9 Aug 2024 16:17:55 +0200	[thread overview]
Message-ID: <20240809141755.312665-4-a.fatoum@pengutronix.de> (raw)
In-Reply-To: <20240809141755.312665-1-a.fatoum@pengutronix.de>

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@pengutronix.de>
---
 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




  parent reply	other threads:[~2024-08-09 14:19 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-09 14:17 [PATCH 1/4] ARM: add ARM32/ARM64 symbols for use in generic code Ahmad Fatoum
2024-08-09 14:17 ` [PATCH 2/4] efi: payload: force PBL_FULLY_PIC for ARM64 Ahmad Fatoum
2024-08-09 14:17 ` [PATCH 3/4] efi: payload: alert user if CONFIG_FS_EFI is missing Ahmad Fatoum
2024-08-09 14:17 ` Ahmad Fatoum [this message]
2024-08-14  9:14   ` [PATCH 4/4] ARM: i.MX8M: neuter initcalls when EFI booted Ahmad Fatoum
2024-08-14  9:13 ` (subset) [PATCH 1/4] ARM: add ARM32/ARM64 symbols for use in generic code Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240809141755.312665-4-a.fatoum@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox