2007-02-12 23:28:56 +08:00
|
|
|
#ifndef __ASM_AVR32_ARCH_AT32AP_IO_H
|
|
|
|
#define __ASM_AVR32_ARCH_AT32AP_IO_H
|
|
|
|
|
|
|
|
/* For "bizarre" halfword swapping */
|
|
|
|
#include <linux/byteorder/swabb.h>
|
|
|
|
|
2007-10-29 22:28:07 +08:00
|
|
|
#if defined(CONFIG_AP700X_32_BIT_SMC)
|
2007-02-12 23:28:56 +08:00
|
|
|
# define __swizzle_addr_b(addr) (addr ^ 3UL)
|
|
|
|
# define __swizzle_addr_w(addr) (addr ^ 2UL)
|
|
|
|
# define __swizzle_addr_l(addr) (addr)
|
|
|
|
# define ioswabb(a, x) (x)
|
|
|
|
# define ioswabw(a, x) (x)
|
|
|
|
# define ioswabl(a, x) (x)
|
|
|
|
# define __mem_ioswabb(a, x) (x)
|
|
|
|
# define __mem_ioswabw(a, x) swab16(x)
|
|
|
|
# define __mem_ioswabl(a, x) swab32(x)
|
2007-10-29 22:28:07 +08:00
|
|
|
#elif defined(CONFIG_AP700X_16_BIT_SMC)
|
2007-02-12 23:28:56 +08:00
|
|
|
# define __swizzle_addr_b(addr) (addr ^ 1UL)
|
|
|
|
# define __swizzle_addr_w(addr) (addr)
|
|
|
|
# define __swizzle_addr_l(addr) (addr)
|
|
|
|
# define ioswabb(a, x) (x)
|
|
|
|
# define ioswabw(a, x) (x)
|
|
|
|
# define ioswabl(a, x) swahw32(x)
|
|
|
|
# define __mem_ioswabb(a, x) (x)
|
|
|
|
# define __mem_ioswabw(a, x) swab16(x)
|
|
|
|
# define __mem_ioswabl(a, x) swahb32(x)
|
|
|
|
#else
|
|
|
|
# define __swizzle_addr_b(addr) (addr)
|
|
|
|
# define __swizzle_addr_w(addr) (addr)
|
|
|
|
# define __swizzle_addr_l(addr) (addr)
|
|
|
|
# define ioswabb(a, x) (x)
|
|
|
|
# define ioswabw(a, x) swab16(x)
|
|
|
|
# define ioswabl(a, x) swab32(x)
|
|
|
|
# define __mem_ioswabb(a, x) (x)
|
|
|
|
# define __mem_ioswabw(a, x) (x)
|
|
|
|
# define __mem_ioswabl(a, x) (x)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif /* __ASM_AVR32_ARCH_AT32AP_IO_H */
|