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 2/5] ARM: i.MX8M: esdctl: export imx8m_barebox_earlymem_size
Date: Tue,  1 Nov 2022 19:06:40 +0100	[thread overview]
Message-ID: <20221101180643.244270-3-a.fatoum@pengutronix.de> (raw)
In-Reply-To: <20221101180643.244270-1-a.fatoum@pengutronix.de>

Board code will need to find out early endmem to use newly defined
scratch space, so factor out a new helper function to get earlymem size.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 arch/arm/mach-imx/esdctl.c              | 11 ++++++++---
 arch/arm/mach-imx/include/mach/esdctl.h |  3 +++
 2 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/arch/arm/mach-imx/esdctl.c b/arch/arm/mach-imx/esdctl.c
index a55ee06b8346..8de20ed42338 100644
--- a/arch/arm/mach-imx/esdctl.c
+++ b/arch/arm/mach-imx/esdctl.c
@@ -923,7 +923,7 @@ void __noreturn vf610_barebox_entry(void *boarddata)
 			  boarddata);
 }
 
-static void __noreturn imx8m_barebox_entry(void *boarddata, unsigned buswidth)
+resource_size_t imx8m_barebox_earlymem_size(unsigned buswidth)
 {
 	resource_size_t size;
 
@@ -937,8 +937,13 @@ static void __noreturn imx8m_barebox_entry(void *boarddata, unsigned buswidth)
 	 * pool placement. The rest of the system should be able to
 	 * detect and utilize full amount of memory.
 	 */
-	size = min_t(resource_size_t, SZ_4G - MX8M_DDR_CSD1_BASE_ADDR, size);
-	barebox_arm_entry(MX8M_DDR_CSD1_BASE_ADDR, size, boarddata);
+	return min_t(resource_size_t, SZ_4G - MX8M_DDR_CSD1_BASE_ADDR, size);
+}
+
+static void __noreturn imx8m_barebox_entry(void *boarddata, unsigned buswidth)
+{
+	barebox_arm_entry(MX8M_DDR_CSD1_BASE_ADDR,
+			  imx8m_barebox_earlymem_size(buswidth), boarddata);
 }
 
 void __noreturn imx8mm_barebox_entry(void *boarddata)
diff --git a/arch/arm/mach-imx/include/mach/esdctl.h b/arch/arm/mach-imx/include/mach/esdctl.h
index b0b531aed4a2..01533478cce8 100644
--- a/arch/arm/mach-imx/include/mach/esdctl.h
+++ b/arch/arm/mach-imx/include/mach/esdctl.h
@@ -131,6 +131,8 @@
 #define ESDCFGx_tRC_16			0x0000000f
 
 #ifndef __ASSEMBLY__
+#include <linux/types.h>
+
 void __noreturn imx1_barebox_entry(void *boarddata);
 void __noreturn imx25_barebox_entry(void *boarddata);
 void __noreturn imx27_barebox_entry(void *boarddata);
@@ -148,6 +150,7 @@ void __noreturn imx8mq_barebox_entry(void *boarddata);
 void __noreturn imx7d_barebox_entry(void *boarddata);
 #define imx6sx_barebox_entry(boarddata) imx6ul_barebox_entry(boarddata)
 void imx_esdctl_disable(void);
+resource_size_t imx8m_barebox_earlymem_size(unsigned buswidth);
 #endif
 
 #endif /* __MACH_ESDCTL_V2_H */
-- 
2.30.2




  parent reply	other threads:[~2022-11-01 18:08 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-01 18:06 [PATCH 0/5] ARM: i.MX8M: implement bootrom log viewing command Ahmad Fatoum
2022-11-01 18:06 ` [PATCH 1/5] ARM: asm: set aside new arm_mem_scratch space Ahmad Fatoum
2022-11-01 18:06 ` Ahmad Fatoum [this message]
2022-11-01 18:06 ` [PATCH 3/5] ARM: i.MX8M: define imx8mX_scratch_space() helper Ahmad Fatoum
2022-11-01 18:06 ` [PATCH 4/5] ARM: i.MX8M: support saving BootROM event log before clobbering OCRAM Ahmad Fatoum
2022-11-01 18:06 ` [PATCH 5/5] ARM: i.MX8M: implement bootrom log viewing command Ahmad Fatoum
2022-12-02  8:46 ` [PATCH 0/5] " 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=20221101180643.244270-3-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