Module Name: src
Committed By: matt
Date: Tue May 19 00:00:24 UTC 2015
Modified Files:
src/sys/arch/mips/mips: locore.S
Log Message:
u-boot on the ERLITE will call the kernel entry point on each cpu specified
in the coremask argument. Add code to deal with that.
To generate a diff of this commit:
cvs rdiff -u -r1.190 -r1.191 src/sys/arch/mips/mips/locore.S
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/arch/mips/mips/locore.S
diff -u src/sys/arch/mips/mips/locore.S:1.190 src/sys/arch/mips/mips/locore.S:1.191
--- src/sys/arch/mips/mips/locore.S:1.190 Fri Mar 1 18:25:47 2013
+++ src/sys/arch/mips/mips/locore.S Tue May 19 00:00:23 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: locore.S,v 1.190 2013/03/01 18:25:47 joerg Exp $ */
+/* $NetBSD: locore.S,v 1.191 2015/05/19 00:00:23 matt Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -91,6 +91,28 @@ _C_LABEL(kernel_text):
mtc0 zero, MIPS_COP_0_STATUS # Disable interrupts
COP0_SYNC
#endif
+#ifdef MIPS64_OCTEON
+ //
+ // U-boot on the erlite starts all cpus at the kernel entry point.
+ // Use EBASE to find our CPU number and if it's not 0, call
+ // octeon_cpu_spinup if MP or loop using the wait instruction since
+ // non-primary CPUs can't do anything useful.
+ //
+ mfc0 a0, $15, 1 # EBASE
+ COP0_SYNC
+ and a0, 0x1ff # get CPU number
+ beqz a0, 2f # normal startup if 0
+ nop
+#ifdef MULTIPROCESSOR
+ j _C_LABEL(octeon_cpu_spinup)
+ nop
+#else
+1: wait
+ b 1b
+ nop
+#endif /* MIPS64_OCTEON */
+2:
+#endif
/*
* Initialize stack and call machine startup.
*/