Skip to contentSkip to conversation

arm: mach-k3: use CFG_MAX_MEM_SIZE

PATCH In review Bryan Brattlof 2 participants 2 messages Apr 25, 2025 – May 3, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arm: mach-k3: use CFG_MAX_MEM_SIZE

Rather than hard coding the maximum memory size, lets just define the CFG_MAX_MEM_SIZE so get_effective_memsize() will return the correct value without modification.

---
 arch/arm/mach-k3/common.c | 4 ----
 arch/arm/mach-k3/common.h | 3 +++
 2 files changed, 3 insertions(+), 4 deletions(-)
arch/arm/mach-k3/common.c +0 -4
index fa8cd93d66485..fc230f180d0e6 100644
@@ -228,10 +228,6 @@ void spl_enable_cache(void)
 	gd->arch.tlb_size = PGTABLE_SIZE;
 
 	gd->ram_top += get_effective_memsize();
-	/* keep ram_top in the 32-bit address space */
-	if (gd->ram_top >= 0x100000000)
-		gd->ram_top = (phys_addr_t)0x100000000;
-
 	gd->relocaddr = gd->ram_top;
 
 	ret = spl_reserve_video_from_ram_top();
arch/arm/mach-k3/common.h +3 -0
index 2ec60c7879ad8..02c74731feab8 100644
@@ -10,6 +10,9 @@
 #include <asm/hardware.h>
 #include <mach/security.h>
 
+/* keep ram_top in the 32-bit address space */
+#define CFG_MAX_MEM_MAPPED		0x100000000
+
 #define K3_FIREWALL_BACKGROUND_BIT (8)
 
 struct fwl_data {

---
base-commit: 9d3f1ebaf8751f0287b5d02158cc706435f8fb19
change-id: 20250425-effective-memory-8d8d9e44a72a

Best regards,

Signature · 1 line
Bryan Brattlof <[email protected]>
#1 lore raw
Quoted 5 lines · Bryan Brattlof

Rather than hard coding the maximum memory size, lets just define the CFG_MAX_MEM_SIZE so get_effective_memsize() will return the correct value without modification.

Applied to u-boot/master, thanks!

[1/1] arm: mach-k3: use CFG_MAX_MEM_SIZE

      commit: 78c0f7e3eb0dc96df163cd5ec51de80a28fb31e7
Signature · 1 line
Tom