Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch Move ofppc-specific CPU spinup code to ofppc/machdep.c



details:   https://anonhg.NetBSD.org/src/rev/3adda0f805d2
branches:  trunk
changeset: 953290:3adda0f805d2
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Fri Mar 05 01:33:33 2021 +0000

description:
Move ofppc-specific CPU spinup code to ofppc/machdep.c

diffstat:

 sys/arch/ofppc/ofppc/machdep.c        |  28 ++++++++++++++++++++-
 sys/arch/powerpc/oea/ofwoea_machdep.c |  44 +++++++---------------------------
 2 files changed, 36 insertions(+), 36 deletions(-)

diffs (128 lines):

diff -r 7e483902a6cd -r 3adda0f805d2 sys/arch/ofppc/ofppc/machdep.c
--- a/sys/arch/ofppc/ofppc/machdep.c    Fri Mar 05 01:31:43 2021 +0000
+++ b/sys/arch/ofppc/ofppc/machdep.c    Fri Mar 05 01:33:33 2021 +0000
@@ -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 @@
                }
        }
 
+#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 -r 7e483902a6cd -r 3adda0f805d2 sys/arch/powerpc/oea/ofwoea_machdep.c
--- a/sys/arch/powerpc/oea/ofwoea_machdep.c     Fri Mar 05 01:31:43 2021 +0000
+++ b/sys/arch/powerpc/oea/ofwoea_machdep.c     Fri Mar 05 01:33:33 2021 +0000
@@ -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 @@
 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 @@
            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 @@
                        bootpath[len] = 0;
        }
 
+       /* Initialize bus_space */
+       ofwoea_bus_space_init();
+
+       ofwoea_consinit();
+
+       if (ofw_quiesce)
+               OF_quiesce();
+
        oea_init(pic_ext_intr);
 
        /*



Home | Main Index | Thread Index | Old Index