aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-avr32
diff options
context:
space:
mode:
authorHaavard Skinnemoen <hskinnemoen@atmel.com>2007-03-07 04:40:44 -0500
committerHaavard Skinnemoen <hskinnemoen@atmel.com>2007-04-27 07:44:15 -0400
commit2c1a2a3441a754a9b5a8e7184071154f8a9bd61b (patch)
treea11527d9a32495d800c949e9616b82c5c25aba5f /include/asm-avr32
parentd80e2bb12606906fd0b5b5592f519852de8b0113 (diff)
[AVR32] Use memcpy/memset in memcpy_{from,to}_io and memset_io
Using readb/writeb to implement these breaks NOR flash support. I can't see any reason why regular memcpy and memset shouldn't work. Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
Diffstat (limited to 'include/asm-avr32')
-rw-r--r--include/asm-avr32/io.h17
1 files changed, 3 insertions, 14 deletions
diff --git a/include/asm-avr32/io.h b/include/asm-avr32/io.h
index 27b1523d42e0..e30d4b3bd836 100644
--- a/include/asm-avr32/io.h
+++ b/include/asm-avr32/io.h
@@ -240,30 +240,19 @@ BUILDSTRING(l, u32)
240static inline void memcpy_fromio(void * to, const volatile void __iomem *from, 240static inline void memcpy_fromio(void * to, const volatile void __iomem *from,
241 unsigned long count) 241 unsigned long count)
242{ 242{
243 char *p = to; 243 memcpy(to, (const void __force *)from, count);
244 volatile const char __iomem *addr = from;
245
246 while (count--)
247 *p++ = readb(addr++);
248} 244}
249 245
250static inline void memcpy_toio(volatile void __iomem *to, const void * from, 246static inline void memcpy_toio(volatile void __iomem *to, const void * from,
251 unsigned long count) 247 unsigned long count)
252{ 248{
253 const char *p = from; 249 memcpy((void __force *)to, from, count);
254 volatile char __iomem *addr = to;
255
256 while (count--)
257 writeb(*p++, addr++);
258} 250}
259 251
260static inline void memset_io(volatile void __iomem *addr, unsigned char val, 252static inline void memset_io(volatile void __iomem *addr, unsigned char val,
261 unsigned long count) 253 unsigned long count)
262{ 254{
263 volatile char __iomem *p = addr; 255 memset((void __force *)addr, val, count);
264
265 while (count--)
266 writeb(val, p++);
267} 256}
268 257
269#define IO_SPACE_LIMIT 0xffffffff 258#define IO_SPACE_LIMIT 0xffffffff