From 1ce61cbbe7b351041b31c59cf7c5d8b056a199ec Mon Sep 17 00:00:00 2001 From: Thomas Chou Date: Tue, 27 Oct 2015 08:30:22 +0800 Subject: nios2: fix map_physmem to do real cache mapping Fix the map_physmem() to do real cache mapping. Signed-off-by: Thomas Chou Acked-by: Marek Vasut --- arch/nios2/include/asm/io.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'arch/nios2/include/asm/io.h') diff --git a/arch/nios2/include/asm/io.h b/arch/nios2/include/asm/io.h index e7da35b0c9..007df8d9ba 100644 --- a/arch/nios2/include/asm/io.h +++ b/arch/nios2/include/asm/io.h @@ -18,7 +18,7 @@ static inline void sync(void) * that can be used to access the memory range with the caching * properties specified by "flags". */ -#define MAP_NOCACHE (0) +#define MAP_NOCACHE (1) #define MAP_WRCOMBINE (0) #define MAP_WRBACK (0) #define MAP_WRTHROUGH (0) @@ -26,7 +26,11 @@ static inline void sync(void) static inline void * map_physmem(phys_addr_t paddr, unsigned long len, unsigned long flags) { - return (void *)paddr; + DECLARE_GLOBAL_DATA_PTR; + if (flags) + return (void *)(paddr | gd->arch.io_region_base); + else + return (void *)(paddr | gd->arch.mem_region_base); } /* -- cgit v1.2.1