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 | |
| 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')
| -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 | ||||
| -rw-r--r-- | arch/mips/include/asm/netlogic/common.h | 18 |
3 files changed, 39 insertions, 18 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 */ | ||
diff --git a/arch/mips/include/asm/netlogic/common.h b/arch/mips/include/asm/netlogic/common.h index e6339d0904a3..c281f03eb312 100644 --- a/arch/mips/include/asm/netlogic/common.h +++ b/arch/mips/include/asm/netlogic/common.h | |||
| @@ -84,7 +84,6 @@ nlm_set_nmi_handler(void *handler) | |||
| 84 | */ | 84 | */ |
| 85 | void nlm_init_boot_cpu(void); | 85 | void nlm_init_boot_cpu(void); |
| 86 | unsigned int nlm_get_cpu_frequency(void); | 86 | unsigned int nlm_get_cpu_frequency(void); |
| 87 | void nlm_node_init(int node); | ||
| 88 | extern struct plat_smp_ops nlm_smp_ops; | 87 | extern struct plat_smp_ops nlm_smp_ops; |
| 89 | extern char nlm_reset_entry[], nlm_reset_entry_end[]; | 88 | extern char nlm_reset_entry[], nlm_reset_entry_end[]; |
| 90 | 89 | ||
| @@ -94,22 +93,6 @@ extern struct dma_map_ops nlm_swiotlb_dma_ops; | |||
| 94 | extern unsigned int nlm_threads_per_core; | 93 | extern unsigned int nlm_threads_per_core; |
| 95 | extern cpumask_t nlm_cpumask; | 94 | extern cpumask_t nlm_cpumask; |
| 96 | 95 | ||
| 97 | struct nlm_soc_info { | ||
| 98 | unsigned long coremask; /* cores enabled on the soc */ | ||
| 99 | unsigned long ebase; | ||
| 100 | uint64_t irqmask; | ||
| 101 | uint64_t sysbase; /* only for XLP */ | ||
| 102 | uint64_t picbase; | ||
| 103 | spinlock_t piclock; | ||
| 104 | }; | ||
| 105 | |||
| 106 | #define nlm_get_node(i) (&nlm_nodes[i]) | ||
| 107 | #ifdef CONFIG_CPU_XLR | ||
| 108 | #define nlm_current_node() (&nlm_nodes[0]) | ||
| 109 | #else | ||
| 110 | #define nlm_current_node() (&nlm_nodes[nlm_nodeid()]) | ||
| 111 | #endif | ||
| 112 | |||
| 113 | struct irq_data; | 96 | struct irq_data; |
| 114 | uint64_t nlm_pci_irqmask(int node); | 97 | uint64_t nlm_pci_irqmask(int node); |
| 115 | void nlm_setup_pic_irq(int node, int picirq, int irq, int irt); | 98 | void nlm_setup_pic_irq(int node, int picirq, int irq, int irt); |
| @@ -128,7 +111,6 @@ static inline int nlm_irq_to_xirq(int node, int irq) | |||
| 128 | return node * NR_IRQS / NLM_NR_NODES + irq; | 111 | return node * NR_IRQS / NLM_NR_NODES + irq; |
| 129 | } | 112 | } |
| 130 | 113 | ||
| 131 | extern struct nlm_soc_info nlm_nodes[NLM_NR_NODES]; | ||
| 132 | extern int nlm_cpu_ready[]; | 114 | extern int nlm_cpu_ready[]; |
| 133 | #endif | 115 | #endif |
| 134 | #endif /* _NETLOGIC_COMMON_H_ */ | 116 | #endif /* _NETLOGIC_COMMON_H_ */ |
