summaryrefslogtreecommitdiff
path: root/arch/powerpc/kernel/setup-common.c
diff options
context:
space:
mode:
authorAndy Fleming <afleming@freescale.com>2011-12-08 07:20:27 (GMT)
committerScott Wood <scottwood@freescale.com>2014-07-30 00:26:20 (GMT)
commite16c8765533a155ebd3d7c36fc80440a03bbf46a (patch)
tree8e4c3ab9fd85d3a852889c13012017b5cf8770b7 /arch/powerpc/kernel/setup-common.c
parent7251a24e4d3acf2d7826e1c42fe84258c312a742 (diff)
downloadlinux-e16c8765533a155ebd3d7c36fc80440a03bbf46a.tar.xz
powerpc/e6500: Add support for hardware threads
The general idea is that each core will release all of its threads into the secondary thread startup code, which will eventually wait in the secondary core holding area, for the appropriate bit in the PACA to be set. The kick_cpu function pointer will set that bit in the PACA, and thus "release" the core/thread to boot. We also need to do a few things that U-Boot normally does for CPUs (like enable branch prediction). Signed-off-by: Andy Fleming <afleming@freescale.com> [scottwood@freescale.com: various changes, including only enabling threads if Linux wants to kick them] Signed-off-by: Scott Wood <scottwood@freescale.com>
Diffstat (limited to 'arch/powerpc/kernel/setup-common.c')
-rw-r--r--arch/powerpc/kernel/setup-common.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c
index e239df3..1bb4dcd 100644
--- a/arch/powerpc/kernel/setup-common.c
+++ b/arch/powerpc/kernel/setup-common.c
@@ -456,18 +456,20 @@ void __init smp_setup_cpu_maps(void)
intserv = of_get_property(dn, "ibm,ppc-interrupt-server#s",
&len);
if (intserv) {
- nthreads = len / sizeof(int);
DBG(" ibm,ppc-interrupt-server#s -> %d threads\n",
nthreads);
} else {
DBG(" no ibm,ppc-interrupt-server#s -> 1 thread\n");
- intserv = of_get_property(dn, "reg", NULL);
+ intserv = of_get_property(dn, "reg", &len);
if (!intserv) {
cpu_be = cpu_to_be32(cpu);
intserv = &cpu_be; /* assume logical == phys */
+ len = 4;
}
}
+ nthreads = len / sizeof(int);
+
for (j = 0; j < nthreads && cpu < nr_cpu_ids; j++) {
DBG(" thread %d -> cpu %d (hard id %d)\n",
j, cpu, be32_to_cpu(intserv[j]));