xref: /openbmc/linux/drivers/memory/tegra/mc.h (revision ae213c44)
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 
9 #ifndef MEMORY_TEGRA_MC_H
10 #define MEMORY_TEGRA_MC_H
11 
12 #include <linux/io.h>
13 #include <linux/types.h>
14 
15 #include <soc/tegra/mc.h>
16 
17 #define MC_INT_DECERR_MTS (1 << 16)
18 #define MC_INT_SECERR_SEC (1 << 13)
19 #define MC_INT_DECERR_VPR (1 << 12)
20 #define MC_INT_INVALID_APB_ASID_UPDATE (1 << 11)
21 #define MC_INT_INVALID_SMMU_PAGE (1 << 10)
22 #define MC_INT_ARBITRATION_EMEM (1 << 9)
23 #define MC_INT_SECURITY_VIOLATION (1 << 8)
24 #define MC_INT_INVALID_GART_PAGE (1 << 7)
25 #define MC_INT_DECERR_EMEM (1 << 6)
26 
27 static inline u32 mc_readl(struct tegra_mc *mc, unsigned long offset)
28 {
29 	return readl_relaxed(mc->regs + offset);
30 }
31 
32 static inline void mc_writel(struct tegra_mc *mc, u32 value,
33 			     unsigned long offset)
34 {
35 	writel_relaxed(value, mc->regs + offset);
36 }
37 
38 extern const struct tegra_mc_reset_ops tegra_mc_reset_ops_common;
39 
40 #ifdef CONFIG_ARCH_TEGRA_2x_SOC
41 extern const struct tegra_mc_soc tegra20_mc_soc;
42 #endif
43 
44 #ifdef CONFIG_ARCH_TEGRA_3x_SOC
45 extern const struct tegra_mc_soc tegra30_mc_soc;
46 #endif
47 
48 #ifdef CONFIG_ARCH_TEGRA_114_SOC
49 extern const struct tegra_mc_soc tegra114_mc_soc;
50 #endif
51 
52 #ifdef CONFIG_ARCH_TEGRA_124_SOC
53 extern const struct tegra_mc_soc tegra124_mc_soc;
54 #endif
55 
56 #ifdef CONFIG_ARCH_TEGRA_132_SOC
57 extern const struct tegra_mc_soc tegra132_mc_soc;
58 #endif
59 
60 #ifdef CONFIG_ARCH_TEGRA_210_SOC
61 extern const struct tegra_mc_soc tegra210_mc_soc;
62 #endif
63 
64 #endif /* MEMORY_TEGRA_MC_H */
65