Linux 4.1.18
[linux/fpc-iii.git] / include / soc / tegra / mc.h
blobd298857cd8459bd8641db6b7792253ab9da76448
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 /* latency allowance */
24 struct tegra_mc_la {
25 unsigned int reg;
26 unsigned int shift;
27 unsigned int mask;
28 unsigned int def;
31 struct tegra_mc_client {
32 unsigned int id;
33 const char *name;
34 unsigned int swgroup;
36 unsigned int fifo_size;
38 struct tegra_smmu_enable smmu;
39 struct tegra_mc_la la;
42 struct tegra_smmu_swgroup {
43 unsigned int swgroup;
44 unsigned int reg;
47 struct tegra_smmu_ops {
48 void (*flush_dcache)(struct page *page, unsigned long offset,
49 size_t size);
52 struct tegra_smmu_soc {
53 const struct tegra_mc_client *clients;
54 unsigned int num_clients;
56 const struct tegra_smmu_swgroup *swgroups;
57 unsigned int num_swgroups;
59 bool supports_round_robin_arbitration;
60 bool supports_request_limit;
62 unsigned int num_tlb_lines;
63 unsigned int num_asids;
65 const struct tegra_smmu_ops *ops;
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 #else
76 static inline struct tegra_smmu *
77 tegra_smmu_probe(struct device *dev, const struct tegra_smmu_soc *soc,
78 struct tegra_mc *mc)
80 return NULL;
82 #endif
84 struct tegra_mc_soc {
85 const struct tegra_mc_client *clients;
86 unsigned int num_clients;
88 const unsigned int *emem_regs;
89 unsigned int num_emem_regs;
91 unsigned int num_address_bits;
92 unsigned int atom_size;
94 const struct tegra_smmu_soc *smmu;
97 struct tegra_mc {
98 struct device *dev;
99 struct tegra_smmu *smmu;
100 void __iomem *regs;
101 struct clk *clk;
102 int irq;
104 const struct tegra_mc_soc *soc;
105 unsigned long tick;
108 #endif /* __SOC_TEGRA_MC_H__ */