From a47fe0ac3a860fc961841840c88a63847d6c1ede Mon Sep 17 00:00:00 2001 From: jake Date: Wed, 19 Mar 2003 05:51:21 +0000 Subject: - 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 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 #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); } -- cgit v1.1