io.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /*
  2. * linux/include/asm-arm/arch-shark/io.h
  3. *
  4. * by Alexander Schulz
  5. *
  6. * derived from:
  7. * linux/include/asm-arm/arch-ebsa110/io.h
  8. * Copyright (C) 1997,1998 Russell King
  9. */
  10. #ifndef __ASM_ARM_ARCH_IO_H
  11. #define __ASM_ARM_ARCH_IO_H
  12. #define IO_SPACE_LIMIT 0xffffffff
  13. /*
  14. * We use two different types of addressing - PC style addresses, and ARM
  15. * addresses. PC style accesses the PC hardware with the normal PC IO
  16. * addresses, eg 0x3f8 for serial#1. ARM addresses are 0x80000000+
  17. * and are translated to the start of IO.
  18. */
  19. #define __PORT_PCIO(x) (!((x) & 0x80000000))
  20. #define __io(a) ((void __iomem *)(PCIO_BASE + (a)))
  21. static inline unsigned int __ioaddr (unsigned int port) \
  22. { \
  23. if (__PORT_PCIO(port)) \
  24. return (unsigned int)(PCIO_BASE + (port)); \
  25. else \
  26. return (unsigned int)(IO_BASE + (port)); \
  27. }
  28. #define __mem_pci(addr) (addr)
  29. /*
  30. * Translated address IO functions
  31. *
  32. * IO address has already been translated to a virtual address
  33. */
  34. #define outb_t(v,p) \
  35. (*(volatile unsigned char *)(p) = (v))
  36. #define inb_t(p) \
  37. (*(volatile unsigned char *)(p))
  38. #define outl_t(v,p) \
  39. (*(volatile unsigned long *)(p) = (v))
  40. #define inl_t(p) \
  41. (*(volatile unsigned long *)(p))
  42. #endif