diff options
| author | thorpej <thorpej@NetBSD.org> | 2021-03-05 01:33:33 +0000 |
|---|---|---|
| committer | thorpej <thorpej@NetBSD.org> | 2021-03-05 01:33:33 +0000 |
| commit | bb4c98bdc2d01f2ea56077c756cd2ffdd181ea28 (patch) | |
| tree | 00bce3f2578254646b2aecd78f27b802c1198c94 /sys | |
| parent | daf6e4d3692a898263894feace55d34d26f2c57c (diff) | |
Move ofppc-specific CPU spinup code to ofppc/machdep.c
Diffstat (limited to 'sys')
| -rw-r--r-- | sys/arch/ofppc/ofppc/machdep.c | 28 | ||||
| -rw-r--r-- | sys/arch/powerpc/oea/ofwoea_machdep.c | 44 |
2 files changed, 36 insertions, 36 deletions
diff --git a/sys/arch/ofppc/ofppc/machdep.c b/sys/arch/ofppc/ofppc/machdep.c index 20dea44a5c1..50f53b70e1f 100644 --- a/sys/arch/ofppc/ofppc/machdep.c +++ b/sys/arch/ofppc/ofppc/machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.118 2021/02/27 02:52:49 thorpej Exp $ */ +/* $NetBSD: machdep.c,v 1.119 2021/03/05 01:33:33 thorpej Exp $ */ /*- * Copyright (c) 2007 The NetBSD Foundation, Inc. * All rights reserved. @@ -29,7 +29,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.118 2021/02/27 02:52:49 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.119 2021/03/05 01:33:33 thorpej Exp $"); #include "opt_ofwoea.h" @@ -159,6 +159,30 @@ initppc(u_int startkernel, u_int endkernel, char *args) } } +#if defined(MULTIPROCESSOR) + int l; + char cpupath[32]; + + extern void cpu_spinstart(u_int); + extern volatile u_int cpu_spinstart_ack; + + for (i = 1; i < CPU_MAXNUM; i++) { + snprintf(cpupath, sizeof(cpupath), "/cpus/@%x", i); + node = OF_finddevice(cpupath); + if (node <= 0) + continue; + aprint_verbose("Starting up CPU %d %s\n", i, cpupath); + OF_start_cpu(node, (u_int)cpu_spinstart, i); + for (l = 0; l < 100000000; l++) { + if (cpu_spinstart_ack == i) { + aprint_verbose("CPU %d spun up.\n", i); + break; + } + __asm volatile ("sync"); + } + } +#endif /* MULTIPROCESSOR */ + ofwoea_initppc(startkernel, endkernel, args); } diff --git a/sys/arch/powerpc/oea/ofwoea_machdep.c b/sys/arch/powerpc/oea/ofwoea_machdep.c index 8249659b627..f09ce2fb4c1 100644 --- a/sys/arch/powerpc/oea/ofwoea_machdep.c +++ b/sys/arch/powerpc/oea/ofwoea_machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: ofwoea_machdep.c,v 1.56 2021/02/27 02:52:48 thorpej Exp $ */ +/* $NetBSD: ofwoea_machdep.c,v 1.57 2021/03/05 01:33:33 thorpej Exp $ */ /*- * Copyright (c) 2007 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ofwoea_machdep.c,v 1.56 2021/02/27 02:52:48 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ofwoea_machdep.c,v 1.57 2021/03/05 01:33:33 thorpej Exp $"); #include "ksyms.h" #include "wsdisplay.h" @@ -139,9 +139,6 @@ extern uint32_t ticks_per_intr; static void restore_ofmap(void); static void set_timebase(void); -extern void cpu_spinstart(u_int); -extern volatile u_int cpu_spinstart_ack; - void ofwoea_initppc(u_int startkernel, u_int endkernel, char *args) { @@ -156,35 +153,6 @@ ofwoea_initppc(u_int startkernel, u_int endkernel, char *args) startsym = endsym = NULL; #endif - /* Initialize bus_space */ - ofwoea_bus_space_init(); - - ofwoea_consinit(); - - if (ofw_quiesce) - OF_quiesce(); - -#if defined(MULTIPROCESSOR) && defined(ofppc) - char cpupath[32]; - int i, l, node; - - for (i = 1; i < CPU_MAXNUM; i++) { - snprintf(cpupath, sizeof(cpupath), "/cpus/@%x", i); - node = OF_finddevice(cpupath); - if (node <= 0) - continue; - aprint_verbose("Starting up CPU %d %s\n", i, cpupath); - OF_start_cpu(node, (u_int)cpu_spinstart, i); - for (l = 0; l < 100000000; l++) { - if (cpu_spinstart_ack == i) { - aprint_verbose("CPU %d spun up.\n", i); - break; - } - __asm volatile ("sync"); - } - } -#endif - /* Parse the args string */ if (args) { strcpy(bootpath, args); @@ -204,6 +172,14 @@ ofwoea_initppc(u_int startkernel, u_int endkernel, char *args) bootpath[len] = 0; } + /* Initialize bus_space */ + ofwoea_bus_space_init(); + + ofwoea_consinit(); + + if (ofw_quiesce) + OF_quiesce(); + oea_init(pic_ext_intr); /* |
