diff mbox

[U-Boot,03/23] MIPS: Fix map_physmem for cached mappings

Message ID 20160926182917.27531-4-paul.burton@imgtec.com
State Accepted
Commit 6fd596a1aa57bd431263f45b0c57ee8ae6b2403c
Delegated to: Daniel Schwierzeck
Headers show

Commit Message

Paul Burton Sept. 26, 2016, 6:28 p.m. UTC
map_physmem should return a pointer that can be used by the CPU to
access the given memory - on MIPS simply returning the physical address
as it does prior to this patch doesn't achieve that. Instead return a
pointer to the memory within (c)kseg0, which matches up consistently
with the (c)kseg1 pointer that uncached mappings return via ioremap.

Signed-off-by: Paul Burton <paul.burton@imgtec.com>
---

 arch/mips/include/asm/io.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Daniel Schwierzeck Nov. 30, 2016, 3:22 p.m. UTC | #1
Am 26.09.2016 um 20:28 schrieb Paul Burton:
> map_physmem should return a pointer that can be used by the CPU to
> access the given memory - on MIPS simply returning the physical address
> as it does prior to this patch doesn't achieve that. Instead return a
> pointer to the memory within (c)kseg0, which matches up consistently
> with the (c)kseg1 pointer that uncached mappings return via ioremap.
> 
> Signed-off-by: Paul Burton <paul.burton@imgtec.com>
> ---
> 

applied to u-boot-mips, thanks!
diff mbox

Patch

diff --git a/arch/mips/include/asm/io.h b/arch/mips/include/asm/io.h
index 5b86386..ee7a592 100644
--- a/arch/mips/include/asm/io.h
+++ b/arch/mips/include/asm/io.h
@@ -501,7 +501,7 @@  map_physmem(phys_addr_t paddr, unsigned long len, unsigned long flags)
 	if (flags == MAP_NOCACHE)
 		return ioremap(paddr, len);
 
-	return (void *)paddr;
+	return (void *)CKSEG0ADDR(paddr);
 }
 
 /*