Linux 2.6.25.3
[linux/fpc-iii.git] / include / asm-avr32 / arch-at32ap / io.h
blob4ec6abc68ea38084fae0a1d269f5fd53ebe34589
1 #ifndef __ASM_AVR32_ARCH_AT32AP_IO_H
2 #define __ASM_AVR32_ARCH_AT32AP_IO_H
4 /* For "bizarre" halfword swapping */
5 #include <linux/byteorder/swabb.h>
7 #if defined(CONFIG_AP700X_32_BIT_SMC)
8 # define __swizzle_addr_b(addr) (addr ^ 3UL)
9 # define __swizzle_addr_w(addr) (addr ^ 2UL)
10 # define __swizzle_addr_l(addr) (addr)
11 # define ioswabb(a, x) (x)
12 # define ioswabw(a, x) (x)
13 # define ioswabl(a, x) (x)
14 # define __mem_ioswabb(a, x) (x)
15 # define __mem_ioswabw(a, x) swab16(x)
16 # define __mem_ioswabl(a, x) swab32(x)
17 #elif defined(CONFIG_AP700X_16_BIT_SMC)
18 # define __swizzle_addr_b(addr) (addr ^ 1UL)
19 # define __swizzle_addr_w(addr) (addr)
20 # define __swizzle_addr_l(addr) (addr)
21 # define ioswabb(a, x) (x)
22 # define ioswabw(a, x) (x)
23 # define ioswabl(a, x) swahw32(x)
24 # define __mem_ioswabb(a, x) (x)
25 # define __mem_ioswabw(a, x) swab16(x)
26 # define __mem_ioswabl(a, x) swahb32(x)
27 #else
28 # define __swizzle_addr_b(addr) (addr)
29 # define __swizzle_addr_w(addr) (addr)
30 # define __swizzle_addr_l(addr) (addr)
31 # define ioswabb(a, x) (x)
32 # define ioswabw(a, x) swab16(x)
33 # define ioswabl(a, x) swab32(x)
34 # define __mem_ioswabb(a, x) (x)
35 # define __mem_ioswabw(a, x) (x)
36 # define __mem_ioswabl(a, x) (x)
37 #endif
39 #endif /* __ASM_AVR32_ARCH_AT32AP_IO_H */