10 #include <linux/types.h>
11 #include <linux/export.h>
16 #include <asm/pgtable.h>
18 #include <asm/ptrace.h>
28 static struct cbe_regs_map
37 static int cbe_regs_map_count;
39 static struct cbe_thread_map
43 struct cbe_regs_map *
regs;
44 unsigned int thread_id;
51 static struct cbe_regs_map *cbe_find_map(
struct device_node *np)
57 for (i = 0; i < cbe_regs_map_count; i++)
58 if (cbe_regs_maps[i].cpu_node == np ||
59 cbe_regs_maps[i].be_node == np)
60 return &cbe_regs_maps[
i];
76 np->
data = cbe_find_map(tmp_np);
83 struct cbe_regs_map *
map = cbe_find_map(np);
92 struct cbe_regs_map *
map = cbe_thread_map[
cpu].regs;
101 struct cbe_regs_map *
map = cbe_find_map(np);
104 return &map->pmd_shadow_regs;
109 struct cbe_regs_map *
map = cbe_thread_map[
cpu].regs;
112 return &map->pmd_shadow_regs;
117 struct cbe_regs_map *
map = cbe_find_map(np);
120 return map->iic_regs;
125 struct cbe_regs_map *
map = cbe_thread_map[
cpu].regs;
128 return map->iic_regs;
133 struct cbe_regs_map *
map = cbe_find_map(np);
136 return map->mic_tm_regs;
141 struct cbe_regs_map *
map = cbe_thread_map[
cpu].regs;
144 return map->mic_tm_regs;
150 return cbe_thread_map[
cpu].thread_id;
156 return cbe_thread_map[
cpu].cbe_id;
162 return cpumask_first(&cbe_local_mask[node]);
171 for_each_node_by_type (np,
"be") {
184 for (i=0; i<len; i++)
199 for_each_node_by_type(np,
"pervasive")
203 for_each_node_by_type(np,
"CBEA-Internal-Interrupt-Controller")
207 for_each_node_by_type(np,
"mic-tm")
213 const struct address_prop {
222 map->pmd_regs =
ioremap(prop->address, prop->len);
226 map->iic_regs =
ioremap(prop->address, prop->len);
230 map->mic_tm_regs =
ioremap(prop->address, prop->len);
238 unsigned int thread_id;
244 cbe_thread_map[
i].be_node = cbe_get_be_node(i);
245 cbe_thread_map[
i].thread_id = thread_id;
249 for_each_node_by_type(cpu,
"cpu") {
250 struct cbe_regs_map *
map;
253 cbe_id = cbe_regs_map_count++;
254 map = &cbe_regs_maps[cbe_id];
256 if (cbe_regs_map_count >
MAX_CBE) {
259 cbe_regs_map_count--;
266 struct cbe_thread_map *
thread = &cbe_thread_map[
i];
268 if (thread->cpu_node == cpu) {
270 thread->cbe_id = cbe_id;
271 map->be_node = thread->be_node;
272 cpumask_set_cpu(i, &cbe_local_mask[cbe_id]);
273 if(thread->thread_id == 0)
274 cpumask_set_cpu(i, &cbe_first_online_cpu);