writeback: safer lock nesting
[linux/fpc-iii.git] / include / soc / tegra / mc.h
blob44202ff897fd93a75e7bc7029d9733ffff2b20ec
1 /*
2 * Copyright (C) 2014 NVIDIA Corporation
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 */
9 #ifndef __SOC_TEGRA_MC_H__
10 #define __SOC_TEGRA_MC_H__
12 #include <linux/types.h>
14 struct clk;
15 struct device;
16 struct page;
18 struct tegra_smmu_enable {
19 unsigned int reg;
20 unsigned int bit;
23 struct tegra_mc_timing {
24 unsigned long rate;
26 u32 *emem_data;
29 /* latency allowance */
30 struct tegra_mc_la {
31 unsigned int reg;
32 unsigned int shift;
33 unsigned int mask;
34 unsigned int def;
37 struct tegra_mc_client {
38 unsigned int id;
39 const char *name;
40 unsigned int swgroup;
42 unsigned int fifo_size;
44 struct tegra_smmu_enable smmu;
45 struct tegra_mc_la la;
48 struct tegra_smmu_swgroup {
49 const char *name;
50 unsigned int swgroup;
51 unsigned int reg;
54 struct tegra_smmu_soc {
55 const struct tegra_mc_client *clients;
56 unsigned int num_clients;
58 const struct tegra_smmu_swgroup *swgroups;
59 unsigned int num_swgroups;
61 bool supports_round_robin_arbitration;
62 bool supports_request_limit;
64 unsigned int num_tlb_lines;
65 unsigned int num_asids;
68 struct tegra_mc;
69 struct tegra_smmu;
71 #ifdef CONFIG_TEGRA_IOMMU_SMMU
72 struct tegra_smmu *tegra_smmu_probe(struct device *dev,
73 const struct tegra_smmu_soc *soc,
74 struct tegra_mc *mc);
75 void tegra_smmu_remove(struct tegra_smmu *smmu);
76 #else
77 static inline struct tegra_smmu *
78 tegra_smmu_probe(struct device *dev, const struct tegra_smmu_soc *soc,
79 struct tegra_mc *mc)
81 return NULL;
84 static inline void tegra_smmu_remove(struct tegra_smmu *smmu)
87 #endif
89 struct tegra_mc_soc {
90 const struct tegra_mc_client *clients;
91 unsigned int num_clients;
93 const unsigned long *emem_regs;
94 unsigned int num_emem_regs;
96 unsigned int num_address_bits;
97 unsigned int atom_size;
99 u8 client_id_mask;
101 const struct tegra_smmu_soc *smmu;
104 struct tegra_mc {
105 struct device *dev;
106 struct tegra_smmu *smmu;
107 void __iomem *regs;
108 struct clk *clk;
109 int irq;
111 const struct tegra_mc_soc *soc;
112 unsigned long tick;
114 struct tegra_mc_timing *timings;
115 unsigned int num_timings;
118 void tegra_mc_write_emem_configuration(struct tegra_mc *mc, unsigned long rate);
119 unsigned int tegra_mc_get_emem_device_count(struct tegra_mc *mc);
121 #endif /* __SOC_TEGRA_MC_H__ */