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] ARM: i.MX8M: don't reserve scratch space for other platforms
Date: Tue, 19 Sep 2023 11:19:50 +0200	[thread overview]
Message-ID: <20230919091950.2004123-1-a.fatoum@pengutronix.de> (raw)

In multi(-platform-per-)arch setups, initcalls should check that they
apply to the correct SoCs and not run unconditionally. This was missed
for the scratchspace reservation initcall, so remedy that.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 arch/arm/mach-imx/romapi.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/arm/mach-imx/romapi.c b/arch/arm/mach-imx/romapi.c
index aef0ff0534c9..4e618a21eef7 100644
--- a/arch/arm/mach-imx/romapi.c
+++ b/arch/arm/mach-imx/romapi.c
@@ -6,6 +6,7 @@
 #include <asm/sections.h>
 #include <mach/imx/romapi.h>
 #include <mach/imx/atf.h>
+#include <mach/imx/generic.h>
 #include <mach/imx/imx8m-regs.h>
 #include <mach/imx/xload.h>
 #include <asm/barebox-arm.h>
@@ -88,6 +89,9 @@ const u32 *imx8m_get_bootrom_log(void)
 
 static int imx8m_reserve_scratch_area(void)
 {
+	if (!__imx_cpu_type)
+		return 0;
+
 	return PTR_ERR_OR_ZERO(request_sdram_region("scratch area",
 				    (ulong)arm_mem_scratch_get(),
 				    sizeof(struct imx_scratch_space)));
-- 
2.39.2




                 reply	other threads:[~2023-09-19  9:21 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20230919091950.2004123-1-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