summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjake <jake@FreeBSD.org>2003-03-19 05:51:21 +0000
committerjake <jake@FreeBSD.org>2003-03-19 05:51:21 +0000
commita47fe0ac3a860fc961841840c88a63847d6c1ede (patch)
tree18c1b1d246999fe74d5ca7ecf73fac239a31d7c0
parent8e88e8da057497b66069752a6391f435c706b441 (diff)
downloadFreeBSD-src-a47fe0ac3a860fc961841840c88a63847d6c1ede.zip
FreeBSD-src-a47fe0ac3a860fc961841840c88a63847d6c1ede.tar.gz
- Set cpu_impl early in sparc64_init so that we can use it to detect
UltraSPARC III and higher cpus and do needed setup. - Disable the "system tick" interrupt for UltraSPARC III. This avoids an interrupt storm on startup since we're not prepared for these at all. This feature has questionable use anyway. - Clear tick on startup and then leave it alone.
-rw-r--r--sys/sparc64/sparc64/identcpu.c3
-rw-r--r--sys/sparc64/sparc64/locore.S1
-rw-r--r--sys/sparc64/sparc64/machdep.c6
-rw-r--r--sys/sparc64/sparc64/tick.c5
4 files changed, 12 insertions, 3 deletions
diff --git a/sys/sparc64/sparc64/identcpu.c b/sys/sparc64/sparc64/identcpu.c
index fcb8f52..a019202 100644
--- a/sys/sparc64/sparc64/identcpu.c
+++ b/sys/sparc64/sparc64/identcpu.c
@@ -47,8 +47,7 @@ cpu_identify(u_long vers, u_int freq, u_int id)
manus = NULL;
break;
}
- cpu_impl = VER_IMPL(vers);
- switch (cpu_impl) {
+ switch (VER_IMPL(vers)) {
case CPU_IMPL_SPARC64:
impls = "SPARC64";
break;
diff --git a/sys/sparc64/sparc64/locore.S b/sys/sparc64/sparc64/locore.S
index a098b9b..3d36be1 100644
--- a/sys/sparc64/sparc64/locore.S
+++ b/sys/sparc64/sparc64/locore.S
@@ -56,6 +56,7 @@ ENTRY(_start)
wrpr %g0, 0, %cleanwin
wrpr %g0, 0, %pil
wr %g0, 0, %fprs
+ wrpr %g0, 0, %tick
/*
* Get onto our per-cpu panic stack, which precedes the struct pcpu in
diff --git a/sys/sparc64/sparc64/machdep.c b/sys/sparc64/sparc64/machdep.c
index 2c0efd8..ba8f162 100644
--- a/sys/sparc64/sparc64/machdep.c
+++ b/sys/sparc64/sparc64/machdep.c
@@ -207,6 +207,12 @@ sparc64_init(caddr_t mdp, u_long o1, u_long o2, u_long o3, ofw_vec_t *vec)
kmdp = NULL;
/*
+ * Find out what kind of cpu we have first, for anything that changes
+ * behaviour.
+ */
+ cpu_impl = VER_IMPL(rdpr(ver));
+
+ /*
* Initialize openfirmware (needed for console).
*/
OF_init(vec);
diff --git a/sys/sparc64/sparc64/tick.c b/sys/sparc64/sparc64/tick.c
index f92fbb8..46c3b59 100644
--- a/sys/sparc64/sparc64/tick.c
+++ b/sys/sparc64/sparc64/tick.c
@@ -46,6 +46,7 @@
#include <machine/frame.h>
#include <machine/intr_machdep.h>
#include <machine/tick.h>
+#include <machine/ver.h>
#ifdef SMP
#include <machine/cpu.h>
#endif
@@ -137,6 +138,8 @@ tick_start_ap(void)
void
tick_stop(void)
{
- wrpr(tick, 0, 0);
+
+ if (cpu_impl >= CPU_IMPL_ULTRASPARCIII)
+ wr(asr24, 1L << 63, 0);
wr(asr23, 1L << 63, 0);
}
OpenPOWER on IntegriCloud