aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/parisc/Kconfig11
-rw-r--r--arch/parisc/mm/ioremap.c13
-rw-r--r--include/asm-parisc/io.h16
3 files changed, 22 insertions, 18 deletions
diff --git a/arch/parisc/Kconfig b/arch/parisc/Kconfig
index 6b3c50964ca9..fc5755d1db57 100644
--- a/arch/parisc/Kconfig
+++ b/arch/parisc/Kconfig
@@ -138,6 +138,17 @@ config 64BIT
138 enable this option otherwise. The 64bit kernel is significantly bigger 138 enable this option otherwise. The 64bit kernel is significantly bigger
139 and slower than the 32bit one. 139 and slower than the 32bit one.
140 140
141config HPPA_IOREMAP
142 bool "Enable IOREMAP functionality (EXPERIMENTAL)"
143 depends on EXPERIMENTAL
144 default n
145 help
146 Enable this option if you want to enable real IOREMAPPING on PA-RISC.
147 Currently we just "simulate" I/O remapping, and enabling this option
148 will just crash your machine.
149
150 Say N here, unless you are a real PA-RISC Linux kernel hacker.
151
141config SMP 152config SMP
142 bool "Symmetric multi-processing support" 153 bool "Symmetric multi-processing support"
143 ---help--- 154 ---help---
diff --git a/arch/parisc/mm/ioremap.c b/arch/parisc/mm/ioremap.c
index edd9a9559cba..028772144191 100644
--- a/arch/parisc/mm/ioremap.c
+++ b/arch/parisc/mm/ioremap.c
@@ -72,7 +72,7 @@ remap_area_pmd(pmd_t *pmd, unsigned long address, unsigned long size,
72 return 0; 72 return 0;
73} 73}
74 74
75#if USE_HPPA_IOREMAP 75#ifdef CONFIG_HPPA_IOREMAP
76static int 76static int
77remap_area_pages(unsigned long address, unsigned long phys_addr, 77remap_area_pages(unsigned long address, unsigned long phys_addr,
78 unsigned long size, unsigned long flags) 78 unsigned long size, unsigned long flags)
@@ -114,7 +114,7 @@ remap_area_pages(unsigned long address, unsigned long phys_addr,
114 114
115 return error; 115 return error;
116} 116}
117#endif /* USE_HPPA_IOREMAP */ 117#endif /* CONFIG_HPPA_IOREMAP */
118 118
119#ifdef CONFIG_DEBUG_IOREMAP 119#ifdef CONFIG_DEBUG_IOREMAP
120static unsigned long last = 0; 120static unsigned long last = 0;
@@ -154,8 +154,7 @@ EXPORT_SYMBOL(__raw_bad_addr);
154 */ 154 */
155void __iomem * __ioremap(unsigned long phys_addr, unsigned long size, unsigned long flags) 155void __iomem * __ioremap(unsigned long phys_addr, unsigned long size, unsigned long flags)
156{ 156{
157#if !(USE_HPPA_IOREMAP) 157#if !defined(CONFIG_HPPA_IOREMAP)
158
159 unsigned long end = phys_addr + size - 1; 158 unsigned long end = phys_addr + size - 1;
160 /* Support EISA addresses */ 159 /* Support EISA addresses */
161 if ((phys_addr >= 0x00080000 && end < 0x000fffff) 160 if ((phys_addr >= 0x00080000 && end < 0x000fffff)
@@ -222,10 +221,10 @@ void __iomem * __ioremap(unsigned long phys_addr, unsigned long size, unsigned l
222 221
223void iounmap(void __iomem *addr) 222void iounmap(void __iomem *addr)
224{ 223{
225#if !(USE_HPPA_IOREMAP) 224#ifdef CONFIG_HPPA_IOREMAP
226 return;
227#else
228 if (addr > high_memory) 225 if (addr > high_memory)
229 return vfree((void *) (PAGE_MASK & (unsigned long __force) addr)); 226 return vfree((void *) (PAGE_MASK & (unsigned long __force) addr));
227#else
228 return;
230#endif 229#endif
231} 230}
diff --git a/include/asm-parisc/io.h b/include/asm-parisc/io.h
index be0c7234a6da..2fb253255102 100644
--- a/include/asm-parisc/io.h
+++ b/include/asm-parisc/io.h
@@ -26,11 +26,7 @@ extern unsigned long parisc_vmerge_max_size;
26 */ 26 */
27 27
28#ifdef CONFIG_DEBUG_IOREMAP 28#ifdef CONFIG_DEBUG_IOREMAP
29#ifdef CONFIG_64BIT 29#define NYBBLE_SHIFT (BITS_PER_LONG - 4)
30#define NYBBLE_SHIFT 60
31#else
32#define NYBBLE_SHIFT 28
33#endif
34extern void gsc_bad_addr(unsigned long addr); 30extern void gsc_bad_addr(unsigned long addr);
35extern void __raw_bad_addr(const volatile void __iomem *addr); 31extern void __raw_bad_addr(const volatile void __iomem *addr);
36#define gsc_check_addr(addr) \ 32#define gsc_check_addr(addr) \
@@ -181,13 +177,11 @@ extern inline void * ioremap_nocache(unsigned long offset, unsigned long size)
181extern void iounmap(void __iomem *addr); 177extern void iounmap(void __iomem *addr);
182 178
183/* 179/*
184 * USE_HPPA_IOREMAP is the magic flag to enable or disable real ioremap() 180 * CONFIG_HPPA_IOREMAP is the magic flag to enable or disable real ioremap()
185 * functionality. It's currently disabled because it may not work on some 181 * functionality. It's currently disabled because it may not work on some
186 * machines. 182 * machines.
187 */ 183 */
188#define USE_HPPA_IOREMAP 0 184#ifdef CONFIG_HPPA_IOREMAP
189
190#if USE_HPPA_IOREMAP
191static inline unsigned char __raw_readb(const volatile void __iomem *addr) 185static inline unsigned char __raw_readb(const volatile void __iomem *addr)
192{ 186{
193 return (*(volatile unsigned char __force *) (addr)); 187 return (*(volatile unsigned char __force *) (addr));
@@ -221,7 +215,7 @@ static inline void __raw_writeq(unsigned long long b, volatile void __iomem *add
221{ 215{
222 *(volatile unsigned long long __force *) addr = b; 216 *(volatile unsigned long long __force *) addr = b;
223} 217}
224#else /* !USE_HPPA_IOREMAP */ 218#else /* !CONFIG_HPPA_IOREMAP */
225static inline unsigned char __raw_readb(const volatile void __iomem *addr) 219static inline unsigned char __raw_readb(const volatile void __iomem *addr)
226{ 220{
227 __raw_check_addr(addr); 221 __raw_check_addr(addr);
@@ -271,7 +265,7 @@ static inline void __raw_writeq(unsigned long long b, volatile void __iomem *add
271 265
272 gsc_writeq(b, (unsigned long) addr); 266 gsc_writeq(b, (unsigned long) addr);
273} 267}
274#endif /* !USE_HPPA_IOREMAP */ 268#endif /* !CONFIG_HPPA_IOREMAP */
275 269
276/* readb can never be const, so use __fswab instead of le*_to_cpu */ 270/* readb can never be const, so use __fswab instead of le*_to_cpu */
277#define readb(addr) __raw_readb(addr) 271#define readb(addr) __raw_readb(addr)