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/netlogic/xlp/wakeup.c | |
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/netlogic/xlp/wakeup.c')
-rw-r--r-- | arch/mips/netlogic/xlp/wakeup.c | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/arch/mips/netlogic/xlp/wakeup.c b/arch/mips/netlogic/xlp/wakeup.c index 88ce38d096f0..cb9010642ac3 100644 --- a/arch/mips/netlogic/xlp/wakeup.c +++ b/arch/mips/netlogic/xlp/wakeup.c | |||
@@ -79,32 +79,38 @@ static int xlp_wakeup_core(uint64_t sysbase, int core) | |||
79 | 79 | ||
80 | static void xlp_enable_secondary_cores(const cpumask_t *wakeup_mask) | 80 | static void xlp_enable_secondary_cores(const cpumask_t *wakeup_mask) |
81 | { | 81 | { |
82 | uint64_t syspcibase, sysbase; | 82 | struct nlm_soc_info *nodep; |
83 | uint64_t syspcibase; | ||
83 | uint32_t syscoremask; | 84 | uint32_t syscoremask; |
84 | int core, n; | 85 | int core, n, cpu; |
85 | 86 | ||
86 | for (n = 0; n < 4; n++) { | 87 | for (n = 0; n < NLM_NR_NODES; n++) { |
87 | syspcibase = nlm_get_sys_pcibase(n); | 88 | syspcibase = nlm_get_sys_pcibase(n); |
88 | if (nlm_read_reg(syspcibase, 0) == 0xffffffff) | 89 | if (nlm_read_reg(syspcibase, 0) == 0xffffffff) |
89 | break; | 90 | break; |
90 | 91 | ||
91 | /* read cores in reset from SYS and account for boot cpu */ | 92 | /* read cores in reset from SYS and account for boot cpu */ |
92 | sysbase = nlm_get_sys_regbase(n); | 93 | nlm_node_init(n); |
93 | syscoremask = nlm_read_sys_reg(sysbase, SYS_CPU_RESET); | 94 | nodep = nlm_get_node(n); |
95 | syscoremask = nlm_read_sys_reg(nodep->sysbase, SYS_CPU_RESET); | ||
94 | if (n == 0) | 96 | if (n == 0) |
95 | syscoremask |= 1; | 97 | syscoremask |= 1; |
96 | 98 | ||
97 | for (core = 0; core < 8; core++) { | 99 | for (core = 0; core < NLM_CORES_PER_NODE; core++) { |
98 | /* see if the core exists */ | 100 | /* see if the core exists */ |
99 | if ((syscoremask & (1 << core)) == 0) | 101 | if ((syscoremask & (1 << core)) == 0) |
100 | continue; | 102 | continue; |
101 | 103 | ||
102 | /* see if at least the first thread is enabled */ | 104 | /* see if at least the first thread is enabled */ |
103 | if (!cpumask_test_cpu((n * 8 + core) * 4, wakeup_mask)) | 105 | cpu = (n * NLM_CORES_PER_NODE + core) |
106 | * NLM_THREADS_PER_CORE; | ||
107 | if (!cpumask_test_cpu(cpu, wakeup_mask)) | ||
104 | continue; | 108 | continue; |
105 | 109 | ||
106 | /* wake up the core */ | 110 | /* wake up the core */ |
107 | if (!xlp_wakeup_core(sysbase, core)) | 111 | if (xlp_wakeup_core(nodep->sysbase, core)) |
112 | nodep->coremask |= 1u << core; | ||
113 | else | ||
108 | pr_err("Failed to enable core %d\n", core); | 114 | pr_err("Failed to enable core %d\n", core); |
109 | } | 115 | } |
110 | } | 116 | } |