io.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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. #include <asm/hardware.h>
  13. #define IO_SPACE_LIMIT 0xffffffff
  14. /*
  15. * We use two different types of addressing - PC style addresses, and ARM
  16. * addresses. PC style accesses the PC hardware with the normal PC IO
  17. * addresses, eg 0x3f8 for serial#1. ARM addresses are 0x80000000+
  18. * and are translated to the start of IO.
  19. */
  20. #define __PORT_PCIO(x) (!((x) & 0x80000000))
  21. #define __io(a) ((void __iomem *)(PCIO_BASE + (a)))
  22. static inline unsigned int __ioaddr (unsigned int port) \
  23. { \
  24. if (__PORT_PCIO(port)) \
  25. return (unsigned int)(PCIO_BASE + (port)); \
  26. else \
  27. return (unsigned int)(IO_BASE + (port)); \
  28. }
  29. #define __mem_pci(addr) (addr)
  30. /*
  31. * Translated address IO functions
  32. *
  33. * IO address has already been translated to a virtual address
  34. */
  35. #define outb_t(v,p) \
  36. (*(volatile unsigned char *)(p) = (v))
  37. #define inb_t(p) \
  38. (*(volatile unsigned char *)(p))
  39. #define outl_t(v,p) \
  40. (*(volatile unsigned long *)(p) = (v))
  41. #define inl_t(p) \
  42. (*(volatile unsigned long *)(p))
  43. #endif