mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 1/3] ARM: i.MX8M: esdctl: limit i.MX8MP early memory size
@ 2023-02-06 21:00 Lucas Stach
  2023-02-06 21:00 ` [PATCH 2/3] ARM: i.MX8M: esdctl: use common compatible to detect i.MX8M* DDRC Lucas Stach
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Lucas Stach @ 2023-02-06 21:00 UTC (permalink / raw)
  To: barebox

Limit detected early memory size to 1GB on i.MX8MP, as the default DT
has a reserved memory region at 0x92400000, which will conflict with
our malloc area in some configurations. Until we can properly parse
and exclude the reserved memory regions in the PBL, just avoid getting
near that DRAM address by limiting the detected size.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
---
 arch/arm/mach-imx/esdctl.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/arch/arm/mach-imx/esdctl.c b/arch/arm/mach-imx/esdctl.c
index a704250297bb..043de477a77d 100644
--- a/arch/arm/mach-imx/esdctl.c
+++ b/arch/arm/mach-imx/esdctl.c
@@ -947,7 +947,17 @@ void __noreturn imx8mn_barebox_entry(void *boarddata)
 
 void __noreturn imx8mp_barebox_entry(void *boarddata)
 {
-	imx8m_barebox_entry(boarddata, 32);
+	/*
+	 * Limit detected early memory size to 1GB on i.MX8MP, as the default
+	 * DT has a reserved memory region at 0x92400000, which will conflict
+	 * with our malloc area in some configurations. Until we can properly
+	 * parse and exclude the reserved memory regions in the PBL, just avoid
+	 * getting near that DRAM address by limiting the detected size.
+	 */
+	barebox_arm_entry(MX8M_DDR_CSD1_BASE_ADDR,
+			  min_t(resource_size_t, SZ_1G,
+				imx8m_barebox_earlymem_size(32)),
+			  boarddata);
 }
 
 void __noreturn imx8mq_barebox_entry(void *boarddata)
-- 
2.39.1




^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2023-02-08  8:27 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-06 21:00 [PATCH 1/3] ARM: i.MX8M: esdctl: limit i.MX8MP early memory size Lucas Stach
2023-02-06 21:00 ` [PATCH 2/3] ARM: i.MX8M: esdctl: use common compatible to detect i.MX8M* DDRC Lucas Stach
2023-02-07 10:24   ` Marco Felsch
2023-02-07 10:31     ` Lucas Stach
2023-02-06 21:00 ` [PATCH 3/3] ARM: dts: i.MX8MP: add DDRC compatibles Lucas Stach
2023-02-08  8:20 ` [PATCH 1/3] ARM: i.MX8M: esdctl: limit i.MX8MP early memory size Sascha Hauer
2023-02-08  8:26   ` Sascha Hauer

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