Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/sparc64/sparc64 sun4v: make cpu_initclocks() work o...



details:   https://anonhg.NetBSD.org/src/rev/621f7c32561a
branches:  trunk
changeset: 796577:621f7c32561a
user:      palle <palle%NetBSD.org@localhost>
date:      Tue Jun 10 18:27:41 2014 +0000

description:
sun4v: make cpu_initclocks() work on sun4v - %tick and %stick on sun4v systems are read-only. ok martin@

diffstat:

 sys/arch/sparc64/sparc64/clock.c |  15 +++++++++------
 sys/arch/sparc64/sparc64/cpu.c   |  16 ++++++++++------
 2 files changed, 19 insertions(+), 12 deletions(-)

diffs (110 lines):

diff -r ac33a6b1d9bb -r 621f7c32561a sys/arch/sparc64/sparc64/clock.c
--- a/sys/arch/sparc64/sparc64/clock.c  Tue Jun 10 17:19:48 2014 +0000
+++ b/sys/arch/sparc64/sparc64/clock.c  Tue Jun 10 18:27:41 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: clock.c,v 1.115 2014/04/30 00:09:29 mrg Exp $ */
+/*     $NetBSD: clock.c,v 1.116 2014/06/10 18:27:41 palle Exp $ */
 
 /*
  * Copyright (c) 1992, 1993
@@ -55,7 +55,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.115 2014/04/30 00:09:29 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.116 2014/06/10 18:27:41 palle Exp $");
 
 #include "opt_multiprocessor.h"
 
@@ -110,6 +110,7 @@
  *  no counter-timer    %tick           -               %tick
  *  US-IIe              STICK           -               STICK
  *  US-IIIi             %stick          -               %stick
+ *  sun4v               %stick          -               %stick
  *
  * US-IIe and US-IIIi could use %tick as statclock
  */
@@ -472,7 +473,8 @@
        }
 
        /* Initialize the %tick register */
-       settick(0);
+       if (CPU_ISSUN4U || CPU_ISSUN4US)
+               settick(0);
 
        /* Register timecounter "tick-counter" */
        tick_timecounter.tc_frequency = ci->ci_cpu_clockrate[0];
@@ -480,7 +482,7 @@
 
        /* Register timecounter "stick-counter" */
        if (ci->ci_system_clockrate[0] != 0) {
-               if (CPU_IS_HUMMINGBIRD()) {
+               if (CPU_ISSUN4U && CPU_IS_HUMMINGBIRD()) {
 #if NPSYCHO > 0
                        psycho_setstick(0);
                        stick2e_timecounter.tc_frequency =
@@ -488,7 +490,8 @@
                        tc_init(&stick2e_timecounter);
 #endif
                } else {
-                       setstick(0);
+                       if (CPU_ISSUN4U || CPU_ISSUN4US)
+                               setstick(0);
                        stick_timecounter.tc_frequency =
                            ci->ci_system_clockrate[0];
                        tc_init(&stick_timecounter);
@@ -513,7 +516,7 @@
 
                        /* We don't have a counter-timer -- use %tick */
                        tickintr_establish(PIL_CLOCK, tickintr);
-               } else if (CPU_IS_HUMMINGBIRD()) {
+               } else if (CPU_ISSUN4U && CPU_IS_HUMMINGBIRD()) {
 #if NPSYCHO > 0
                        aprint_normal("No counter-timer -- using STICK "
                            "at %luMHz as system clock.\n",
diff -r ac33a6b1d9bb -r 621f7c32561a sys/arch/sparc64/sparc64/cpu.c
--- a/sys/arch/sparc64/sparc64/cpu.c    Tue Jun 10 17:19:48 2014 +0000
+++ b/sys/arch/sparc64/sparc64/cpu.c    Tue Jun 10 18:27:41 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cpu.c,v 1.112 2014/06/08 17:33:24 palle Exp $ */
+/*     $NetBSD: cpu.c,v 1.113 2014/06/10 18:27:41 palle Exp $ */
 
 /*
  * Copyright (c) 1996
@@ -52,7 +52,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.112 2014/06/08 17:33:24 palle Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.113 2014/06/10 18:27:41 palle Exp $");
 
 #include "opt_multiprocessor.h"
 
@@ -562,9 +562,11 @@
                delay(1000);
                sync_tick = 1;
                membar_Sync();
-               settick(0);
+               if (CPU_ISSUN4U || CPU_ISSUN4US)
+                       settick(0);
                if (ci->ci_system_clockrate[0] != 0)
-                       setstick(0);
+                       if (CPU_ISSUN4U || CPU_ISSUN4US)
+                               setstick(0);
 
                setpstate(pstate);
 
@@ -592,9 +594,11 @@
        while (sync_tick == 0) {
                /* we do nothing here */
        }
-       settick(0);
+       if (CPU_ISSUN4U || CPU_ISSUN4US)
+               settick(0);
        if (curcpu()->ci_system_clockrate[0] != 0) {
-               setstick(0);
+               if (CPU_ISSUN4U || CPU_ISSUN4US)
+                       setstick(0);
                stickintr_establish(PIL_CLOCK, stickintr);
        } else {
                tickintr_establish(PIL_CLOCK, tickintr);



Home | Main Index | Thread Index | Old Index