diff options
author | Jayachandran C <jchandra@broadcom.com> | 2013-12-21 06:22:14 -0500 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2014-01-24 16:39:47 -0500 |
commit | ce59d0f7fec6fa4e7a6c484308e25bad8a6caa39 (patch) | |
tree | 111c2a78eb3a952c9c0efe2895649fe6baec5ef1 /arch/mips/include/asm/mach-netlogic | |
parent | c24a8a7a99885d5b986f38f6631f69e7794a3e5e (diff) |
MIPS: Netlogic: Add topology.h for XLP family
Add mach-netlogic/topology.h which contains XLP cpu number to core and
node mapping.
Signed-off-by: Jayachandran C <jchandra@broadcom.com>
Signed-off-by: John Crispin <blogic@openwrt.org>
Patchwork: http://patchwork.linux-mips.org/patch/6271/
Diffstat (limited to 'arch/mips/include/asm/mach-netlogic')
-rw-r--r-- | arch/mips/include/asm/mach-netlogic/multi-node.h | 19 | ||||
-rw-r--r-- | arch/mips/include/asm/mach-netlogic/topology.h | 20 |
2 files changed, 39 insertions, 0 deletions
diff --git a/arch/mips/include/asm/mach-netlogic/multi-node.h b/arch/mips/include/asm/mach-netlogic/multi-node.h index d62fc773f4d7..b3d91e0c10dd 100644 --- a/arch/mips/include/asm/mach-netlogic/multi-node.h +++ b/arch/mips/include/asm/mach-netlogic/multi-node.h | |||
@@ -51,4 +51,23 @@ | |||
51 | #define NLM_THREADS_PER_CORE 4 | 51 | #define NLM_THREADS_PER_CORE 4 |
52 | #define NLM_CPUS_PER_NODE (NLM_CORES_PER_NODE * NLM_THREADS_PER_CORE) | 52 | #define NLM_CPUS_PER_NODE (NLM_CORES_PER_NODE * NLM_THREADS_PER_CORE) |
53 | 53 | ||
54 | struct nlm_soc_info { | ||
55 | unsigned long coremask; /* cores enabled on the soc */ | ||
56 | unsigned long ebase; /* not used now */ | ||
57 | uint64_t irqmask; /* EIMR for the node */ | ||
58 | uint64_t sysbase; /* only for XLP - sys block base */ | ||
59 | uint64_t picbase; /* PIC block base */ | ||
60 | spinlock_t piclock; /* lock for PIC access */ | ||
61 | cpumask_t cpumask; /* logical cpu mask for node */ | ||
62 | }; | ||
63 | |||
64 | extern struct nlm_soc_info nlm_nodes[NLM_NR_NODES]; | ||
65 | #define nlm_get_node(i) (&nlm_nodes[i]) | ||
66 | #ifdef CONFIG_CPU_XLR | ||
67 | #define nlm_current_node() (&nlm_nodes[0]) | ||
68 | #else | ||
69 | #define nlm_current_node() (&nlm_nodes[nlm_nodeid()]) | ||
70 | #endif | ||
71 | void nlm_node_init(int node); | ||
72 | |||
54 | #endif | 73 | #endif |
diff --git a/arch/mips/include/asm/mach-netlogic/topology.h b/arch/mips/include/asm/mach-netlogic/topology.h new file mode 100644 index 000000000000..0da99fa11c38 --- /dev/null +++ b/arch/mips/include/asm/mach-netlogic/topology.h | |||
@@ -0,0 +1,20 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 2013 Broadcom Corporation | ||
7 | */ | ||
8 | #ifndef _ASM_MACH_NETLOGIC_TOPOLOGY_H | ||
9 | #define _ASM_MACH_NETLOGIC_TOPOLOGY_H | ||
10 | |||
11 | #include <asm/mach-netlogic/multi-node.h> | ||
12 | |||
13 | #define topology_physical_package_id(cpu) cpu_to_node(cpu) | ||
14 | #define topology_core_id(cpu) (cpu_logical_map(cpu) / NLM_THREADS_PER_CORE) | ||
15 | #define topology_thread_cpumask(cpu) (&cpu_sibling_map[cpu]) | ||
16 | #define topology_core_cpumask(cpu) cpumask_of_node(cpu_to_node(cpu)) | ||
17 | |||
18 | #include <asm-generic/topology.h> | ||
19 | |||
20 | #endif /* _ASM_MACH_NETLOGIC_TOPOLOGY_H */ | ||