mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] ARM: i.MX8M: don't reserve scratch space for other platforms
@ 2023-09-19  9:19 Ahmad Fatoum
  0 siblings, 0 replies; only message in thread
From: Ahmad Fatoum @ 2023-09-19  9:19 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

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




^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-09-19  9:21 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-19  9:19 [PATCH] ARM: i.MX8M: don't reserve scratch space for other platforms Ahmad Fatoum

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox