mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] ARM: rockchip: cleanup iram handling
@ 2025-09-16  8:02 Michael Tretter
  2025-09-18 14:21 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Michael Tretter @ 2025-09-16  8:02 UTC (permalink / raw)
  To: Sascha Hauer, BAREBOX; +Cc: Michael Tretter

struct rockchip_scratch_space has grown and gained additional fields.
While the scratch space for the iram is still at the start of the
rockchip_scratch_space, it is actually just one field in the scratch
space.

Explicitly store the iram to the iram field, and copy only the size of
the iram field instead of the entire scratch space.

Explicitly pass the iram field when the iram should be parsed.

Rename the field from irom to iram.

Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
---
 arch/arm/mach-rockchip/rk3568.c | 2 +-
 arch/arm/mach-rockchip/rk3576.c | 2 +-
 arch/arm/mach-rockchip/rk3588.c | 2 +-
 include/mach/rockchip/bootrom.h | 4 ++--
 4 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/arch/arm/mach-rockchip/rk3568.c b/arch/arm/mach-rockchip/rk3568.c
index 75b0824479fb8f774b0d41137b25ddf90ea9a3df..5019ea03366b658b5d3f07d845ac2bb901af0ac7 100644
--- a/arch/arm/mach-rockchip/rk3568.c
+++ b/arch/arm/mach-rockchip/rk3568.c
@@ -142,7 +142,7 @@ void rk3568_lowlevel_init(void)
 
 int rk3568_init(void)
 {
-	rockchip_parse_bootrom_iram(rockchip_scratch_space());
+	rockchip_parse_bootrom_iram(rockchip_scratch_space()->iram);
 
 	return 0;
 }
diff --git a/arch/arm/mach-rockchip/rk3576.c b/arch/arm/mach-rockchip/rk3576.c
index 320d0ec9a536aaa88b44f6e022d6ee990da4209b..28655a25269e466048addf5544d722945c942af2 100644
--- a/arch/arm/mach-rockchip/rk3576.c
+++ b/arch/arm/mach-rockchip/rk3576.c
@@ -14,7 +14,7 @@ void rk3576_lowlevel_init(void)
 
 int rk3576_init(void)
 {
-	rockchip_parse_bootrom_iram(rockchip_scratch_space());
+	rockchip_parse_bootrom_iram(rockchip_scratch_space()->iram);
 
 	return 0;
 }
diff --git a/arch/arm/mach-rockchip/rk3588.c b/arch/arm/mach-rockchip/rk3588.c
index 25f14812967f85b27c2a58564d904b33208f87c7..e0841154ed9ff1e37a1ac65c129d282d8e371ef6 100644
--- a/arch/arm/mach-rockchip/rk3588.c
+++ b/arch/arm/mach-rockchip/rk3588.c
@@ -14,7 +14,7 @@ void rk3588_lowlevel_init(void)
 
 int rk3588_init(void)
 {
-	rockchip_parse_bootrom_iram(rockchip_scratch_space());
+	rockchip_parse_bootrom_iram(rockchip_scratch_space()->iram);
 
 	return 0;
 }
diff --git a/include/mach/rockchip/bootrom.h b/include/mach/rockchip/bootrom.h
index 586008a78505943c968301a9ce90ed5e4aa9b18b..fc63e793783bc7706235fb01abdb6acd64c3afa6 100644
--- a/include/mach/rockchip/bootrom.h
+++ b/include/mach/rockchip/bootrom.h
@@ -11,7 +11,7 @@
 #include <pbl.h>
 
 struct rockchip_scratch_space {
-	u32 irom[16];
+	u32 iram[16];
 	struct optee_header optee_hdr;
 	/* FDT needs an 8 byte alignment */
 	u8 fdt[CONFIG_ARCH_ROCKCHIP_ATF_FDT_SIZE] __aligned(8);
@@ -23,7 +23,7 @@ extern struct rockchip_scratch_space *rk_scratch;
 static inline void rockchip_store_bootrom_iram(const void *iram)
 {
 	if (rk_scratch)
-		memcpy(rk_scratch, iram, sizeof(struct rockchip_scratch_space));
+		memcpy(rk_scratch->iram, iram, sizeof(rk_scratch->iram));
 }
 
 static inline const struct rockchip_scratch_space *rockchip_scratch_space(void)

---
base-commit: f3be3a8e9ae884bdfb116238e9049b1eb2759810
change-id: 20250916-rockchip-cleanup-iram-a3dae2333ec9

Best regards,
-- 
Michael Tretter <m.tretter@pengutronix.de>




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

* Re: [PATCH] ARM: rockchip: cleanup iram handling
  2025-09-16  8:02 [PATCH] ARM: rockchip: cleanup iram handling Michael Tretter
@ 2025-09-18 14:21 ` Sascha Hauer
  0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2025-09-18 14:21 UTC (permalink / raw)
  To: BAREBOX, Michael Tretter


On Tue, 16 Sep 2025 10:02:02 +0200, Michael Tretter wrote:
> struct rockchip_scratch_space has grown and gained additional fields.
> While the scratch space for the iram is still at the start of the
> rockchip_scratch_space, it is actually just one field in the scratch
> space.
> 
> Explicitly store the iram to the iram field, and copy only the size of
> the iram field instead of the entire scratch space.
> 
> [...]

Applied, thanks!

[1/1] ARM: rockchip: cleanup iram handling
      https://git.pengutronix.de/cgit/barebox/commit/?id=d20190702b61 (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:[~2025-09-18 14:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-09-16  8:02 [PATCH] ARM: rockchip: cleanup iram handling Michael Tretter
2025-09-18 14:21 ` Sascha Hauer

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