io.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /*
  2. * linux/arch/unicore32/include/asm/io.h
  3. *
  4. * Code specific to PKUnity SoC and UniCore ISA
  5. *
  6. * Copyright (C) 2001-2010 GUAN Xue-tao
  7. *
  8. * This program is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License version 2 as
  10. * published by the Free Software Foundation.
  11. */
  12. #ifndef __UNICORE_IO_H__
  13. #define __UNICORE_IO_H__
  14. #ifdef __KERNEL__
  15. #include <asm/byteorder.h>
  16. #include <asm/memory.h>
  17. #include <asm/system.h>
  18. #define PCI_IOBASE PKUNITY_PCILIO_BASE
  19. #include <asm-generic/io.h>
  20. /*
  21. * __uc32_ioremap and __uc32_ioremap_cached takes CPU physical address.
  22. */
  23. extern void __iomem *__uc32_ioremap(unsigned long, size_t);
  24. extern void __iomem *__uc32_ioremap_cached(unsigned long, size_t);
  25. extern void __uc32_iounmap(volatile void __iomem *addr);
  26. /*
  27. * ioremap and friends.
  28. *
  29. * ioremap takes a PCI memory address, as specified in
  30. * Documentation/IO-mapping.txt.
  31. *
  32. */
  33. #define ioremap(cookie, size) __uc32_ioremap(cookie, size)
  34. #define ioremap_cached(cookie, size) __uc32_ioremap_cached(cookie, size)
  35. #define iounmap(cookie) __uc32_iounmap(cookie)
  36. /*
  37. * Convert a physical pointer to a virtual kernel pointer for /dev/mem
  38. * access
  39. */
  40. #undef xlate_dev_mem_ptr
  41. #define xlate_dev_mem_ptr(p) __va(p)
  42. #define HAVE_ARCH_PIO_SIZE
  43. #define PIO_OFFSET (unsigned int)(PCI_IOBASE)
  44. #define PIO_MASK (unsigned int)(IO_SPACE_LIMIT)
  45. #define PIO_RESERVED (PIO_OFFSET + PIO_MASK + 1)
  46. #endif /* __KERNEL__ */
  47. #endif /* __UNICORE_IO_H__ */