xref: /openbmc/linux/drivers/memory/tegra/mc.h (revision b78412b8)
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 static inline u32 mc_readl(struct tegra_mc *mc, unsigned long offset)
18 {
19 	return readl(mc->regs + offset);
20 }
21 
22 static inline void mc_writel(struct tegra_mc *mc, u32 value,
23 			     unsigned long offset)
24 {
25 	writel(value, mc->regs + offset);
26 }
27 
28 #ifdef CONFIG_ARCH_TEGRA_3x_SOC
29 extern const struct tegra_mc_soc tegra30_mc_soc;
30 #endif
31 
32 #ifdef CONFIG_ARCH_TEGRA_114_SOC
33 extern const struct tegra_mc_soc tegra114_mc_soc;
34 #endif
35 
36 #ifdef CONFIG_ARCH_TEGRA_124_SOC
37 extern const struct tegra_mc_soc tegra124_mc_soc;
38 #endif
39 
40 #ifdef CONFIG_ARCH_TEGRA_132_SOC
41 extern const struct tegra_mc_soc tegra132_mc_soc;
42 #endif
43 
44 #ifdef CONFIG_ARCH_TEGRA_210_SOC
45 extern const struct tegra_mc_soc tegra210_mc_soc;
46 #endif
47 
48 #endif /* MEMORY_TEGRA_MC_H */
49