public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] ARM: datacache always disabled when RAM extends to 0xFFFFFFFF
@ 2014-08-27  9:50 Jaccon Bastiaansen
  2014-08-27 19:24 ` Marek Vasut
  0 siblings, 1 reply; 2+ messages in thread
From: Jaccon Bastiaansen @ 2014-08-27  9:50 UTC (permalink / raw)
  To: u-boot

The dram_bank_mmu_setup() function contains a loop to configure the data
caching policy for each 1 Mbyte page of the RAM memory range. When RAM
extends to 0xFFFFFFFF, the RAM start address + the RAM size will equal
2^32. But because the RAM start address and RAM size are unsigned longs,
the result of this addition is zero. The loop is therefore not executed
and the datacache is effectively disabled.

Signed-off-by: Jaccon Bastiaansen <jaccon.bastiaansen@gmail.com>
---
 arch/arm/lib/cache-cp15.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/lib/cache-cp15.c b/arch/arm/lib/cache-cp15.c
index 5fdfdbf..dcd881f 100644
--- a/arch/arm/lib/cache-cp15.c
+++ b/arch/arm/lib/cache-cp15.c
@@ -69,7 +69,7 @@ __weak void dram_bank_mmu_setup(int bank)
 
 	debug("%s: bank: %d\n", __func__, bank);
 	for (i = bd->bi_dram[bank].start >> 20;
-	     i < (bd->bi_dram[bank].start + bd->bi_dram[bank].size) >> 20;
+	     i < ((u64)bd->bi_dram[bank].start + (u64)bd->bi_dram[bank].size) >> 20;
 	     i++) {
 #if defined(CONFIG_SYS_ARM_CACHE_WRITETHROUGH)
 		set_section_dcache(i, DCACHE_WRITETHROUGH);
-- 
1.7.9.5

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

* [U-Boot] [PATCH] ARM: datacache always disabled when RAM extends to 0xFFFFFFFF
  2014-08-27  9:50 [U-Boot] [PATCH] ARM: datacache always disabled when RAM extends to 0xFFFFFFFF Jaccon Bastiaansen
@ 2014-08-27 19:24 ` Marek Vasut
  0 siblings, 0 replies; 2+ messages in thread
From: Marek Vasut @ 2014-08-27 19:24 UTC (permalink / raw)
  To: u-boot

On Wednesday, August 27, 2014 at 11:50:55 AM, Jaccon Bastiaansen wrote:
> The dram_bank_mmu_setup() function contains a loop to configure the data
> caching policy for each 1 Mbyte page of the RAM memory range. When RAM
> extends to 0xFFFFFFFF, the RAM start address + the RAM size will equal
> 2^32. But because the RAM start address and RAM size are unsigned longs,
> the result of this addition is zero. The loop is therefore not executed
> and the datacache is effectively disabled.
> 
> Signed-off-by: Jaccon Bastiaansen <jaccon.bastiaansen@gmail.com>

Yeah, I sent similar patch [1] long ago. Albert, care to pick it please ?

[1] http://lists.denx.de/pipermail/u-boot/2014-August/185254.html

Best regards,
Marek Vasut

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

end of thread, other threads:[~2014-08-27 19:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-27  9:50 [U-Boot] [PATCH] ARM: datacache always disabled when RAM extends to 0xFFFFFFFF Jaccon Bastiaansen
2014-08-27 19:24 ` Marek Vasut

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