diff options
author | Max Filippov <jcmvbkbc@gmail.com> | 2012-09-16 21:44:39 -0400 |
---|---|---|
committer | Chris Zankel <chris@zankel.net> | 2012-10-03 18:11:35 -0400 |
commit | 02f3774877382bac52972a677c2c5fbd3532a1a1 (patch) | |
tree | bf1616d9b12c1e3c8addec69787e9ff28e7a16b5 /arch/xtensa/include | |
parent | af42e970b6097a34cb2b93ec4c12c2a226b1d008 (diff) |
xtensa: fix ioremap
- fix ioremap_nocache to actually return non-cacheable address
- add explicit ioremap_cache
- fix KIO aperture checking arithmetic
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Chris Zankel <chris@zankel.net>
Diffstat (limited to 'arch/xtensa/include')
-rw-r--r-- | arch/xtensa/include/asm/io.h | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/arch/xtensa/include/asm/io.h b/arch/xtensa/include/asm/io.h index 4beb43c087d3..4f66dfc103a5 100644 --- a/arch/xtensa/include/asm/io.h +++ b/arch/xtensa/include/asm/io.h | |||
@@ -67,12 +67,12 @@ static inline void * phys_to_virt(unsigned long address) | |||
67 | * Return the virtual (cached) address for the specified bus memory. | 67 | * Return the virtual (cached) address for the specified bus memory. |
68 | * Note that we currently don't support any address outside the KIO segment. | 68 | * Note that we currently don't support any address outside the KIO segment. |
69 | */ | 69 | */ |
70 | 70 | static inline void __iomem *ioremap_nocache(unsigned long offset, | |
71 | static inline void *ioremap(unsigned long offset, unsigned long size) | 71 | unsigned long size) |
72 | { | 72 | { |
73 | #ifdef CONFIG_MMU | 73 | #ifdef CONFIG_MMU |
74 | if (offset >= XCHAL_KIO_PADDR | 74 | if (offset >= XCHAL_KIO_PADDR |
75 | && offset < XCHAL_KIO_PADDR + XCHAL_KIO_SIZE) | 75 | && offset - XCHAL_KIO_PADDR < XCHAL_KIO_SIZE) |
76 | return (void*)(offset-XCHAL_KIO_PADDR+XCHAL_KIO_BYPASS_VADDR); | 76 | return (void*)(offset-XCHAL_KIO_PADDR+XCHAL_KIO_BYPASS_VADDR); |
77 | else | 77 | else |
78 | BUG(); | 78 | BUG(); |
@@ -81,11 +81,12 @@ static inline void *ioremap(unsigned long offset, unsigned long size) | |||
81 | #endif | 81 | #endif |
82 | } | 82 | } |
83 | 83 | ||
84 | static inline void *ioremap_nocache(unsigned long offset, unsigned long size) | 84 | static inline void __iomem *ioremap_cache(unsigned long offset, |
85 | unsigned long size) | ||
85 | { | 86 | { |
86 | #ifdef CONFIG_MMU | 87 | #ifdef CONFIG_MMU |
87 | if (offset >= XCHAL_KIO_PADDR | 88 | if (offset >= XCHAL_KIO_PADDR |
88 | && offset < XCHAL_KIO_PADDR + XCHAL_KIO_SIZE) | 89 | && offset - XCHAL_KIO_PADDR < XCHAL_KIO_SIZE) |
89 | return (void*)(offset-XCHAL_KIO_PADDR+XCHAL_KIO_CACHED_VADDR); | 90 | return (void*)(offset-XCHAL_KIO_PADDR+XCHAL_KIO_CACHED_VADDR); |
90 | else | 91 | else |
91 | BUG(); | 92 | BUG(); |
@@ -94,7 +95,14 @@ static inline void *ioremap_nocache(unsigned long offset, unsigned long size) | |||
94 | #endif | 95 | #endif |
95 | } | 96 | } |
96 | 97 | ||
97 | static inline void iounmap(void *addr) | 98 | #define ioremap_wc ioremap_nocache |
99 | |||
100 | static inline void __iomem *ioremap(unsigned long offset, unsigned long size) | ||
101 | { | ||
102 | return ioremap_nocache(offset, size); | ||
103 | } | ||
104 | |||
105 | static inline void iounmap(volatile void __iomem *addr) | ||
98 | { | 106 | { |
99 | } | 107 | } |
100 | 108 | ||