From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH 3/5] ARM: i.MX8M: define imx8mX_scratch_space() helper
Date: Tue, 1 Nov 2022 19:06:41 +0100 [thread overview]
Message-ID: <20221101180643.244270-4-a.fatoum@pengutronix.de> (raw)
In-Reply-To: <20221101180643.244270-1-a.fatoum@pengutronix.de>
Now that we have a generic ARM scratch area and a way to find out where
it is, add new helper functions that return a pointer to this area.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
arch/arm/mach-imx/include/mach/xload.h | 11 +++++++++++
arch/arm/mach-imx/xload-common.c | 10 ++++++++++
2 files changed, 21 insertions(+)
diff --git a/arch/arm/mach-imx/include/mach/xload.h b/arch/arm/mach-imx/include/mach/xload.h
index 82bf663c4266..d19bedb9e84a 100644
--- a/arch/arm/mach-imx/include/mach/xload.h
+++ b/arch/arm/mach-imx/include/mach/xload.h
@@ -30,4 +30,15 @@ int piggydata_size(void);
extern unsigned char input_data[];
extern unsigned char input_data_end[];
+struct imx_scratch_space {
+ u32 bootrom_log[128];
+};
+
+struct imx_scratch_space *__imx8m_scratch_space(int ddr_buswidth);
+
+#define imx8mq_scratch_space() __imx8m_scratch_space(32)
+#define imx8mm_scratch_space() __imx8m_scratch_space(32)
+#define imx8mn_scratch_space() __imx8m_scratch_space(16)
+#define imx8mp_scratch_space() __imx8m_scratch_space(32)
+
#endif /* __MACH_XLOAD_H */
diff --git a/arch/arm/mach-imx/xload-common.c b/arch/arm/mach-imx/xload-common.c
index f4bcca1d1483..710dcc1ed909 100644
--- a/arch/arm/mach-imx/xload-common.c
+++ b/arch/arm/mach-imx/xload-common.c
@@ -4,6 +4,9 @@
#include <asm/sections.h>
#include <linux/sizes.h>
#include <mach/xload.h>
+#include <mach/esdctl.h>
+#include <mach/imx8m-regs.h>
+#include <asm/barebox-arm.h>
int imx_image_size(void)
{
@@ -16,3 +19,10 @@ int piggydata_size(void)
return input_data_end - input_data;
}
+struct imx_scratch_space *__imx8m_scratch_space(int ddr_buswidth)
+{
+ ulong endmem = MX8M_DDR_CSD1_BASE_ADDR +
+ imx8m_barebox_earlymem_size(ddr_buswidth);
+
+ return (void *)__arm_mem_scratch(endmem);
+}
--
2.30.2
next prev 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 ` [PATCH 2/5] ARM: i.MX8M: esdctl: export imx8m_barebox_earlymem_size Ahmad Fatoum
2022-11-01 18:06 ` Ahmad Fatoum [this message]
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-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