mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] ARM: i.MX: drop explicit reservation of scratch area
@ 2024-08-14  9:38 Ahmad Fatoum
  2024-08-14 10:39 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Ahmad Fatoum @ 2024-08-14  9:38 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

The scratch area is just some unused space between top of stack and end
of early memory / start of OP-TEE. There's nothing i.MX specific about
it, except that we use it to store the bootrom log.

The initcall reserving the scratch area was added to avoid barebox
proper overwriting it later on during boot.

Since commit 59289e3d8cc3 ("memory: add support for requesting barebox
area as a whole"), the scratch area is reserved as part of the barebox
memory region, so it's unnecessary to keep around SoC-specific code
for its reservation, so let's just drop it.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
Alternative to https://lore.barebox.org/barebox/22b84d30-0f41-4592-ad89-1a8c8b6c5308@pengutronix.de/T/#u
The SoC initcall change there is wrong and I will tackle that later.
---
 arch/arm/mach-imx/scratch.c | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/arch/arm/mach-imx/scratch.c b/arch/arm/mach-imx/scratch.c
index b7280ff60952..e4e2d25969f0 100644
--- a/arch/arm/mach-imx/scratch.c
+++ b/arch/arm/mach-imx/scratch.c
@@ -92,11 +92,3 @@ const struct optee_header *imx_scratch_get_optee_hdr(void)
 
 	return &scratch->optee_hdr;
 }
-
-static int imx8m_reserve_scratch_area(void)
-{
-	return request_barebox_region("scratch area",
-				      (ulong)arm_mem_scratch_get(),
-				      sizeof(struct imx_scratch_space)) ? 0 : -EINVAL;
-}
-device_initcall(imx8m_reserve_scratch_area);
-- 
2.39.2




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

* Re: [PATCH] ARM: i.MX: drop explicit reservation of scratch area
  2024-08-14  9:38 [PATCH] ARM: i.MX: drop explicit reservation of scratch area Ahmad Fatoum
@ 2024-08-14 10:39 ` Sascha Hauer
  0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2024-08-14 10:39 UTC (permalink / raw)
  To: barebox, Ahmad Fatoum


On Wed, 14 Aug 2024 11:38:24 +0200, Ahmad Fatoum wrote:
> The scratch area is just some unused space between top of stack and end
> of early memory / start of OP-TEE. There's nothing i.MX specific about
> it, except that we use it to store the bootrom log.
> 
> The initcall reserving the scratch area was added to avoid barebox
> proper overwriting it later on during boot.
> 
> [...]

Applied, thanks!

[1/1] ARM: i.MX: drop explicit reservation of scratch area
      https://git.pengutronix.de/cgit/barebox/commit/?id=68e794593178 (link may not be stable)

Best regards,
-- 
Sascha Hauer <s.hauer@pengutronix.de>




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

end of thread, other threads:[~2024-08-14 10:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-08-14  9:38 [PATCH] ARM: i.MX: drop explicit reservation of scratch area Ahmad Fatoum
2024-08-14 10:39 ` Sascha Hauer

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