mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Michael Tretter <m.tretter@pengutronix.de>
To: Sascha Hauer <s.hauer@pengutronix.de>,
	 BAREBOX <barebox@lists.infradead.org>
Cc: Michael Tretter <m.tretter@pengutronix.de>
Subject: [PATCH] ARM: rockchip: cleanup iram handling
Date: Tue, 16 Sep 2025 10:02:02 +0200	[thread overview]
Message-ID: <20250916-rockchip-cleanup-iram-v1-1-e6797d08f8dc@pengutronix.de> (raw)

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>




             reply	other threads:[~2025-09-16  8:02 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-16  8:02 Michael Tretter [this message]
2025-09-18 14:21 ` 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=20250916-rockchip-cleanup-iram-v1-1-e6797d08f8dc@pengutronix.de \
    --to=m.tretter@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=s.hauer@pengutronix.de \
    /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