io.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. #ifndef __ASM_AVR32_ARCH_AT32AP_IO_H
  2. #define __ASM_AVR32_ARCH_AT32AP_IO_H
  3. #include <linux/swab.h>
  4. #if defined(CONFIG_AP700X_32_BIT_SMC)
  5. # define __swizzle_addr_b(addr) (addr ^ 3UL)
  6. # define __swizzle_addr_w(addr) (addr ^ 2UL)
  7. # define __swizzle_addr_l(addr) (addr)
  8. # define ioswabb(a, x) (x)
  9. # define ioswabw(a, x) (x)
  10. # define ioswabl(a, x) (x)
  11. # define __mem_ioswabb(a, x) (x)
  12. # define __mem_ioswabw(a, x) swab16(x)
  13. # define __mem_ioswabl(a, x) swab32(x)
  14. #elif defined(CONFIG_AP700X_16_BIT_SMC)
  15. # define __swizzle_addr_b(addr) (addr ^ 1UL)
  16. # define __swizzle_addr_w(addr) (addr)
  17. # define __swizzle_addr_l(addr) (addr)
  18. # define ioswabb(a, x) (x)
  19. # define ioswabw(a, x) (x)
  20. # define ioswabl(a, x) swahw32(x)
  21. # define __mem_ioswabb(a, x) (x)
  22. # define __mem_ioswabw(a, x) swab16(x)
  23. # define __mem_ioswabl(a, x) swahb32(x)
  24. #else
  25. # define __swizzle_addr_b(addr) (addr)
  26. # define __swizzle_addr_w(addr) (addr)
  27. # define __swizzle_addr_l(addr) (addr)
  28. # define ioswabb(a, x) (x)
  29. # define ioswabw(a, x) swab16(x)
  30. # define ioswabl(a, x) swab32(x)
  31. # define __mem_ioswabb(a, x) (x)
  32. # define __mem_ioswabw(a, x) (x)
  33. # define __mem_ioswabl(a, x) (x)
  34. #endif
  35. #endif /* __ASM_AVR32_ARCH_AT32AP_IO_H */