io.h 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /*
  2. * arch/arm/mach-tegra/include/mach/io.h
  3. *
  4. * Copyright (C) 2010 Google, Inc.
  5. *
  6. * Author:
  7. * Colin Cross <ccross@google.com>
  8. * Erik Gilling <konkers@google.com>
  9. *
  10. * This software is licensed under the terms of the GNU General Public
  11. * License version 2, as published by the Free Software Foundation, and
  12. * may be copied, distributed, and modified under those terms.
  13. *
  14. * This program is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. * GNU General Public License for more details.
  18. *
  19. */
  20. #ifndef __MACH_TEGRA_IO_H
  21. #define __MACH_TEGRA_IO_H
  22. #define IO_SPACE_LIMIT 0xffff
  23. #ifndef __ASSEMBLER__
  24. #ifdef CONFIG_TEGRA_PCI
  25. extern void __iomem *tegra_pcie_io_base;
  26. static inline void __iomem *__io(unsigned long addr)
  27. {
  28. return tegra_pcie_io_base + (addr & IO_SPACE_LIMIT);
  29. }
  30. #else
  31. static inline void __iomem *__io(unsigned long addr)
  32. {
  33. return (void __iomem *)addr;
  34. }
  35. #endif
  36. #define __io(a) __io(a)
  37. #endif
  38. #endif