Lines Matching +full:cpu +full:- +full:core

2  * Copyright 2003-2011 NetLogic Microsystems, Inc. (NetLogic). All rights
39 #include <asm/asm-offsets.h>
46 #include <asm/netlogic/mips-extns.h>
48 #include <asm/netlogic/xlp-hal/iomap.h>
49 #include <asm/netlogic/xlp-hal/xlp.h>
50 #include <asm/netlogic/xlp-hal/pic.h>
51 #include <asm/netlogic/xlp-hal/sys.h>
53 static int xlp_wakeup_core(uint64_t sysbase, int node, int core) in xlp_wakeup_core() argument
58 coremask = (1 << core); in xlp_wakeup_core()
60 /* Enable CPU clock in case of 8xx/3xx */ in xlp_wakeup_core()
74 /* Remove CPU Reset */ in xlp_wakeup_core()
84 /* Poll for CPU to mark itself coherent on other type of XLP */ in xlp_wakeup_core()
88 } while ((value & coremask) != 0 && --count > 0); in xlp_wakeup_core()
93 static int wait_for_cpus(int cpu, int bootcpu) in wait_for_cpus() argument
102 if (cpu_ready[cpu + i] || (cpu + i) == bootcpu) in wait_for_cpus()
103 --notready; in wait_for_cpus()
104 } while (notready != 0 && --count > 0); in wait_for_cpus()
114 int core, n, cpu, ncores; in xlp_enable_secondary_cores() local
148 fusemask = nlm_read_sys_reg(nodep->sysbase, in xlp_enable_secondary_cores()
166 * cores are renumbered to range 0 .. nactive-1 in xlp_enable_secondary_cores()
168 syscoremask = (1 << hweight32(~fusemask & mask)) - 1; in xlp_enable_secondary_cores()
170 pr_info("Node %d - SYS/FUSE coremask %x\n", n, syscoremask); in xlp_enable_secondary_cores()
172 for (core = 0; core < ncores; core++) { in xlp_enable_secondary_cores()
173 /* we will be on node 0 core 0 */ in xlp_enable_secondary_cores()
174 if (n == 0 && core == 0) in xlp_enable_secondary_cores()
177 /* see if the core exists */ in xlp_enable_secondary_cores()
178 if ((syscoremask & (1 << core)) == 0) in xlp_enable_secondary_cores()
182 cpu = (n * ncores + core) * NLM_THREADS_PER_CORE; in xlp_enable_secondary_cores()
183 if (!cpumask_test_cpu(cpu, wakeup_mask)) in xlp_enable_secondary_cores()
186 /* wake up the core */ in xlp_enable_secondary_cores()
187 if (!xlp_wakeup_core(nodep->sysbase, n, core)) in xlp_enable_secondary_cores()
190 /* core is up */ in xlp_enable_secondary_cores()
191 nodep->coremask |= 1u << core; in xlp_enable_secondary_cores()
194 if (!wait_for_cpus(cpu, 0)) in xlp_enable_secondary_cores()
195 pr_err("Node %d : timeout core %d\n", n, core); in xlp_enable_secondary_cores()
203 * In case of u-boot, the secondaries are in reset in xlp_wakeup_secondary_cpus()
204 * first wakeup core 0 threads in xlp_wakeup_secondary_cpus()
208 pr_err("Node 0 : timeout core 0\n"); in xlp_wakeup_secondary_cpus()