xtensa: fix high memory/reserved memory collision
[cris-mirror.git] / include / soc / tegra / mc.h
blob233bae954970ac9af71c172b932ee9d56a4c9f84
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_group_soc {
55 const char *name;
56 const unsigned int *swgroups;
57 unsigned int num_swgroups;
60 struct tegra_smmu_soc {
61 const struct tegra_mc_client *clients;
62 unsigned int num_clients;
64 const struct tegra_smmu_swgroup *swgroups;
65 unsigned int num_swgroups;
67 const struct tegra_smmu_group_soc *groups;
68 unsigned int num_groups;
70 bool supports_round_robin_arbitration;
71 bool supports_request_limit;
73 unsigned int num_tlb_lines;
74 unsigned int num_asids;
77 struct tegra_mc;
78 struct tegra_smmu;
80 #ifdef CONFIG_TEGRA_IOMMU_SMMU
81 struct tegra_smmu *tegra_smmu_probe(struct device *dev,
82 const struct tegra_smmu_soc *soc,
83 struct tegra_mc *mc);
84 void tegra_smmu_remove(struct tegra_smmu *smmu);
85 #else
86 static inline struct tegra_smmu *
87 tegra_smmu_probe(struct device *dev, const struct tegra_smmu_soc *soc,
88 struct tegra_mc *mc)
90 return NULL;
93 static inline void tegra_smmu_remove(struct tegra_smmu *smmu)
96 #endif
98 struct tegra_mc_soc {
99 const struct tegra_mc_client *clients;
100 unsigned int num_clients;
102 const unsigned long *emem_regs;
103 unsigned int num_emem_regs;
105 unsigned int num_address_bits;
106 unsigned int atom_size;
108 u8 client_id_mask;
110 const struct tegra_smmu_soc *smmu;
113 struct tegra_mc {
114 struct device *dev;
115 struct tegra_smmu *smmu;
116 void __iomem *regs;
117 struct clk *clk;
118 int irq;
120 const struct tegra_mc_soc *soc;
121 unsigned long tick;
123 struct tegra_mc_timing *timings;
124 unsigned int num_timings;
127 void tegra_mc_write_emem_configuration(struct tegra_mc *mc, unsigned long rate);
128 unsigned int tegra_mc_get_emem_device_count(struct tegra_mc *mc);
130 #endif /* __SOC_TEGRA_MC_H__ */