diff options
author | Jayachandran C <jchandra@broadcom.com> | 2012-10-31 08:01:39 -0400 |
---|---|---|
committer | John Crispin <blogic@openwrt.org> | 2012-11-09 05:37:19 -0500 |
commit | 77ae798f5b736dfdc692b86b393d9699052ac77a (patch) | |
tree | 040a68a1c544167364e4ca2b78e69179c397e4b2 /arch/mips/include/asm/netlogic/common.h | |
parent | 2a37b1ae443f20470a789b12a45cbc249c9e50a6 (diff) |
MIPS: Netlogic: Support for multi-chip configuration
Upto 4 Netlogic XLP SoCs can be connected over ICI links to form a
coherent multi-node system. Each SoC has its own set of on-chip
devices including PIC. To support this, add a per SoC stucture and
use it for the PIC and SYS block addresses instead of using global
variables.
Signed-off-by: Jayachandran C <jchandra@broadcom.com>
Patchwork: http://patchwork.linux-mips.org/patch/4469
Signed-off-by: John Crispin <blogic@openwrt.org>
Diffstat (limited to 'arch/mips/include/asm/netlogic/common.h')
-rw-r--r-- | arch/mips/include/asm/netlogic/common.h | 42 |
1 files changed, 37 insertions, 5 deletions
diff --git a/arch/mips/include/asm/netlogic/common.h b/arch/mips/include/asm/netlogic/common.h index fd735bcac3e6..2eb39fa02586 100644 --- a/arch/mips/include/asm/netlogic/common.h +++ b/arch/mips/include/asm/netlogic/common.h | |||
@@ -46,10 +46,10 @@ | |||
46 | 46 | ||
47 | #ifndef __ASSEMBLY__ | 47 | #ifndef __ASSEMBLY__ |
48 | #include <linux/cpumask.h> | 48 | #include <linux/cpumask.h> |
49 | #include <linux/spinlock.h> | ||
50 | #include <asm/irq.h> | ||
49 | 51 | ||
50 | struct irq_desc; | 52 | struct irq_desc; |
51 | extern struct plat_smp_ops nlm_smp_ops; | ||
52 | extern char nlm_reset_entry[], nlm_reset_entry_end[]; | ||
53 | void nlm_smp_function_ipi_handler(unsigned int irq, struct irq_desc *desc); | 53 | void nlm_smp_function_ipi_handler(unsigned int irq, struct irq_desc *desc); |
54 | void nlm_smp_resched_ipi_handler(unsigned int irq, struct irq_desc *desc); | 54 | void nlm_smp_resched_ipi_handler(unsigned int irq, struct irq_desc *desc); |
55 | void nlm_smp_irq_init(void); | 55 | void nlm_smp_irq_init(void); |
@@ -70,10 +70,42 @@ nlm_set_nmi_handler(void *handler) | |||
70 | * Misc. | 70 | * Misc. |
71 | */ | 71 | */ |
72 | unsigned int nlm_get_cpu_frequency(void); | 72 | unsigned int nlm_get_cpu_frequency(void); |
73 | void nlm_node_init(int node); | ||
74 | extern struct plat_smp_ops nlm_smp_ops; | ||
75 | extern char nlm_reset_entry[], nlm_reset_entry_end[]; | ||
73 | 76 | ||
74 | extern unsigned long nlm_common_ebase; | 77 | extern unsigned int nlm_threads_per_core; |
75 | extern int nlm_threads_per_core; | ||
76 | extern uint32_t nlm_coremask; | ||
77 | extern cpumask_t nlm_cpumask; | 78 | extern cpumask_t nlm_cpumask; |
79 | |||
80 | struct nlm_soc_info { | ||
81 | unsigned long coremask; /* cores enabled on the soc */ | ||
82 | unsigned long ebase; | ||
83 | uint64_t irqmask; | ||
84 | uint64_t sysbase; /* only for XLP */ | ||
85 | uint64_t picbase; | ||
86 | spinlock_t piclock; | ||
87 | }; | ||
88 | |||
89 | #define NLM_CORES_PER_NODE 8 | ||
90 | #define NLM_THREADS_PER_CORE 4 | ||
91 | #define NLM_CPUS_PER_NODE (NLM_CORES_PER_NODE * NLM_THREADS_PER_CORE) | ||
92 | #define nlm_get_node(i) (&nlm_nodes[i]) | ||
93 | #define NLM_NR_NODES 1 | ||
94 | #define nlm_current_node() (&nlm_nodes[0]) | ||
95 | |||
96 | struct irq_data; | ||
97 | uint64_t nlm_pci_irqmask(int node); | ||
98 | void nlm_set_pic_extra_ack(int node, int irq, void (*xack)(struct irq_data *)); | ||
99 | |||
100 | /* | ||
101 | * The NR_IRQs is divided between nodes, each of them has a separate irq space | ||
102 | */ | ||
103 | static inline int nlm_irq_to_xirq(int node, int irq) | ||
104 | { | ||
105 | return node * NR_IRQS / NLM_NR_NODES + irq; | ||
106 | } | ||
107 | |||
108 | extern struct nlm_soc_info nlm_nodes[NLM_NR_NODES]; | ||
109 | extern int nlm_cpu_ready[]; | ||
78 | #endif | 110 | #endif |
79 | #endif /* _NETLOGIC_COMMON_H_ */ | 111 | #endif /* _NETLOGIC_COMMON_H_ */ |