summaryrefslogtreecommitdiff
path: root/arch/nios2/include/asm
diff options
context:
space:
mode:
authorThomas Chou <thomas@wytron.com.tw>2015-10-27 08:30:22 +0800
committerThomas Chou <thomas@wytron.com.tw>2015-11-06 09:14:11 +0800
commit1ce61cbbe7b351041b31c59cf7c5d8b056a199ec (patch)
tree51894d18e724457d06e036c1a62ef4f2f14381a7 /arch/nios2/include/asm
parented02c532be690b3d0c3e15c81531785a788fd949 (diff)
downloadu-boot-imx-1ce61cbbe7b351041b31c59cf7c5d8b056a199ec.zip
u-boot-imx-1ce61cbbe7b351041b31c59cf7c5d8b056a199ec.tar.gz
u-boot-imx-1ce61cbbe7b351041b31c59cf7c5d8b056a199ec.tar.bz2
nios2: fix map_physmem to do real cache mapping
Fix the map_physmem() to do real cache mapping. Signed-off-by: Thomas Chou <thomas@wytron.com.tw> Acked-by: Marek Vasut <marex@denx.de>
Diffstat (limited to 'arch/nios2/include/asm')
-rw-r--r--arch/nios2/include/asm/global_data.h1
-rw-r--r--arch/nios2/include/asm/io.h8
2 files changed, 7 insertions, 2 deletions
diff --git a/arch/nios2/include/asm/global_data.h b/arch/nios2/include/asm/global_data.h
index d6a2cfa..9f3bd00 100644
--- a/arch/nios2/include/asm/global_data.h
+++ b/arch/nios2/include/asm/global_data.h
@@ -18,6 +18,7 @@ struct arch_global_data {
int has_initda;
int has_mmu;
u32 io_region_base;
+ u32 mem_region_base;
};
#include <asm-generic/global_data.h>
diff --git a/arch/nios2/include/asm/io.h b/arch/nios2/include/asm/io.h
index e7da35b..007df8d 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);
}
/*