apbio.h 1019 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. /*
  2. * Copyright (C) 2010 NVIDIA Corporation.
  3. * Copyright (C) 2010 Google, Inc.
  4. *
  5. * This software is licensed under the terms of the GNU General Public
  6. * License version 2, as published by the Free Software Foundation, and
  7. * may be copied, distributed, and modified under those terms.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. */
  15. #ifndef __MACH_TEGRA_APBIO_H
  16. #define __MACH_TEGRA_APBIO_H
  17. #ifdef CONFIG_TEGRA_SYSTEM_DMA
  18. u32 tegra_apb_readl(unsigned long offset);
  19. void tegra_apb_writel(u32 value, unsigned long offset);
  20. #else
  21. #include <asm/io.h>
  22. #include <mach/io.h>
  23. static inline u32 tegra_apb_readl(unsigned long offset)
  24. {
  25. return readl(IO_TO_VIRT(offset));
  26. }
  27. static inline void tegra_apb_writel(u32 value, unsigned long offset)
  28. {
  29. writel(value, IO_TO_VIRT(offset));
  30. }
  31. #endif
  32. #endif