Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2c1a2a34 authored by Haavard Skinnemoen's avatar Haavard Skinnemoen
Browse files

[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: default avatarHaavard Skinnemoen <hskinnemoen@atmel.com>
parent d80e2bb1
Loading
Loading
Loading
Loading
+3 −14
Original line number Original line Diff line number Diff line
@@ -240,30 +240,19 @@ BUILDSTRING(l, u32)
static inline void memcpy_fromio(void * to, const volatile void __iomem *from,
static inline void memcpy_fromio(void * to, const volatile void __iomem *from,
				 unsigned long count)
				 unsigned long count)
{
{
	char *p = to;
	memcpy(to, (const void __force *)from, count);
	volatile const char __iomem *addr = from;

	while (count--)
		*p++ = readb(addr++);
}
}


static inline void  memcpy_toio(volatile void __iomem *to, const void * from,
static inline void  memcpy_toio(volatile void __iomem *to, const void * from,
				unsigned long count)
				unsigned long count)
{
{
	const char *p = from;
	memcpy((void __force *)to, from, count);
	volatile char __iomem *addr = to;

	while (count--)
		writeb(*p++, addr++);
}
}


static inline void memset_io(volatile void __iomem *addr, unsigned char val,
static inline void memset_io(volatile void __iomem *addr, unsigned char val,
			     unsigned long count)
			     unsigned long count)
{
{
	volatile char __iomem *p = addr;
	memset((void __force *)addr, val, count);

	while (count--)
		writeb(val, p++);
}
}


#define IO_SPACE_LIMIT	0xffffffff
#define IO_SPACE_LIMIT	0xffffffff