mc.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /*
  2. * Copyright (C) 2014 NVIDIA CORPORATION. All rights reserved.
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License version 2 as
  6. * published by the Free Software Foundation.
  7. */
  8. #ifndef MEMORY_TEGRA_MC_H
  9. #define MEMORY_TEGRA_MC_H
  10. #include <linux/io.h>
  11. #include <linux/types.h>
  12. #include <soc/tegra/mc.h>
  13. #define MC_INT_DECERR_MTS (1 << 16)
  14. #define MC_INT_SECERR_SEC (1 << 13)
  15. #define MC_INT_DECERR_VPR (1 << 12)
  16. #define MC_INT_INVALID_APB_ASID_UPDATE (1 << 11)
  17. #define MC_INT_INVALID_SMMU_PAGE (1 << 10)
  18. #define MC_INT_ARBITRATION_EMEM (1 << 9)
  19. #define MC_INT_SECURITY_VIOLATION (1 << 8)
  20. #define MC_INT_INVALID_GART_PAGE (1 << 7)
  21. #define MC_INT_DECERR_EMEM (1 << 6)
  22. static inline u32 mc_readl(struct tegra_mc *mc, unsigned long offset)
  23. {
  24. if (mc->regs2 && offset >= 0x24)
  25. return readl(mc->regs2 + offset - 0x3c);
  26. return readl(mc->regs + offset);
  27. }
  28. static inline void mc_writel(struct tegra_mc *mc, u32 value,
  29. unsigned long offset)
  30. {
  31. if (mc->regs2 && offset >= 0x24)
  32. return writel(value, mc->regs2 + offset - 0x3c);
  33. writel(value, mc->regs + offset);
  34. }
  35. extern const struct tegra_mc_reset_ops terga_mc_reset_ops_common;
  36. #ifdef CONFIG_ARCH_TEGRA_2x_SOC
  37. extern const struct tegra_mc_soc tegra20_mc_soc;
  38. #endif
  39. #ifdef CONFIG_ARCH_TEGRA_3x_SOC
  40. extern const struct tegra_mc_soc tegra30_mc_soc;
  41. #endif
  42. #ifdef CONFIG_ARCH_TEGRA_114_SOC
  43. extern const struct tegra_mc_soc tegra114_mc_soc;
  44. #endif
  45. #ifdef CONFIG_ARCH_TEGRA_124_SOC
  46. extern const struct tegra_mc_soc tegra124_mc_soc;
  47. #endif
  48. #ifdef CONFIG_ARCH_TEGRA_132_SOC
  49. extern const struct tegra_mc_soc tegra132_mc_soc;
  50. #endif
  51. #ifdef CONFIG_ARCH_TEGRA_210_SOC
  52. extern const struct tegra_mc_soc tegra210_mc_soc;
  53. #endif
  54. #endif /* MEMORY_TEGRA_MC_H */