From 2b8cd5a6a2e094d03fb1de474486c6cef800eef8 Mon Sep 17 00:00:00 2001 From: Jake Burkholder Date: Wed, 19 Mar 2003 05:51:21 +0000 Subject: [PATCH] - 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. --- sys/sparc64/sparc64/identcpu.c | 3 +-- sys/sparc64/sparc64/locore.S | 1 + sys/sparc64/sparc64/machdep.c | 6 ++++++ sys/sparc64/sparc64/tick.c | 5 ++++- 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/sys/sparc64/sparc64/identcpu.c b/sys/sparc64/sparc64/identcpu.c index fcb8f5255b64..a0192026a07e 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 a098b9b3f067..3d36be11dbcf 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 2c0efd8c5f6b..ba8f162eb1c8 100644 --- a/sys/sparc64/sparc64/machdep.c +++ b/sys/sparc64/sparc64/machdep.c @@ -206,6 +206,12 @@ sparc64_init(caddr_t mdp, u_long o1, u_long o2, u_long o3, ofw_vec_t *vec) end = 0; 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). */ diff --git a/sys/sparc64/sparc64/tick.c b/sys/sparc64/sparc64/tick.c index f92fbb8bf29e..46c3b592f3d3 100644 --- a/sys/sparc64/sparc64/tick.c +++ b/sys/sparc64/sparc64/tick.c @@ -46,6 +46,7 @@ #include #include #include +#include #ifdef SMP #include #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); }