Skip to contentSkip to conversation

powerpc/mpc85xx: Fix DDR TLB mapping leftover

PATCH Superseded York Sun 2 participants 2 messages Nov 25, 2014 – Nov 26, 2014 PowerPC

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

York Sun

author
#0 lore raw

PATCH 1/1 powerpc/mpc85xx: Fix DDR TLB mapping leftover

Commit f29f804a93e87c17670607641d120f431a3b0633 generalized the TLB mapping function, but made the DDR mapping leftover size to zero, causing the message not printed.

CC Alexander Graf <[email protected]>
CC Scott Wood <[email protected]>
---
 arch/powerpc/cpu/mpc85xx/tlb.c |   11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)
arch/powerpc/cpu/mpc85xx/tlb.c +7 -4
index 129ec66..4f0f7d5 100644
@@ -299,12 +299,15 @@ unsigned int setup_ddr_tlbs_phys(phys_addr_t p_addr,
 {
 	unsigned int ram_tlb_address = (unsigned int)CONFIG_SYS_DDR_SDRAM_BASE;
 	u64 memsize = (u64)memsize_in_meg << 20;
+	u64 size;
 
-	memsize = min(memsize, CONFIG_MAX_MEM_MAPPED);
-	memsize = tlb_map_range(ram_tlb_address, p_addr, memsize, TLB_MAP_RAM);
+	size = min(memsize, CONFIG_MAX_MEM_MAPPED);
+	size = tlb_map_range(ram_tlb_address, p_addr, size, TLB_MAP_RAM);
 
-	if (memsize)
-		print_size(memsize, " left unmapped\n");
+	if ((size) || (memsize > CONFIG_MAX_MEM_MAPPED)) {
+		print_size(memsize - CONFIG_MAX_MEM_MAPPED + size,
+			   " left unmapped\n");
+	}
 
 	return memsize_in_meg;
 }
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH 1/1 powerpc/mpc85xx: Fix DDR TLB mapping leftover

Quoted 19 lines · York Sun

Commit f29f804a93e87c17670607641d120f431a3b0633 generalized the TLB mapping function, but made the DDR mapping leftover size to zero, causing the message not printed.

CC Alexander Graf <[email protected]>
CC Scott Wood <[email protected]>
---
 arch/powerpc/cpu/mpc85xx/tlb.c |   11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)
arch/powerpc/cpu/mpc85xx/tlb.c +0 -0
index 129ec66..4f0f7d5 100644
@@ -299,12 +299,15 @@ unsigned int setup_ddr_tlbs_phys(phys_addr_t p_addr,
 {
 	unsigned int ram_tlb_address = (unsigned int)CONFIG_SYS_DDR_SDRAM_BASE;
 	u64 memsize = (u64)memsize_in_meg << 20;

arch/powerpc/cpu/mpc85xx/tlb.c unsigned int setup_ddr_tlbs_phys(phys_addr_t p_addr, · line 307

Quoted 10 lines
arch/powerpc/cpu/mpc85xx/tlb.c +4 -4
+	u64 size;
 
-	memsize = min(memsize, CONFIG_MAX_MEM_MAPPED);
-	memsize = tlb_map_range(ram_tlb_address, p_addr, memsize, TLB_MAP_RAM);
+	size = min(memsize, CONFIG_MAX_MEM_MAPPED);
+	size = tlb_map_range(ram_tlb_address, p_addr, size, TLB_MAP_RAM);
 
-	if (memsize)
-		print_size(memsize, " left unmapped\n");
+	if ((size) || (memsize > CONFIG_MAX_MEM_MAPPED)) {

Unnecessary parentheses

-Scott