Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/evbppc/ev64260 Get CLOCKBASE from opt_ppcparam.h.



details:   https://anonhg.NetBSD.org/src/rev/7235f9e5948c
branches:  trunk
changeset: 544350:7235f9e5948c
user:      matt <matt%NetBSD.org@localhost>
date:      Mon Mar 17 23:24:41 2003 +0000

description:
Get CLOCKBASE from opt_ppcparam.h.

diffstat:

 sys/arch/evbppc/ev64260/clock.c |  19 ++++++++-----------
 1 files changed, 8 insertions(+), 11 deletions(-)

diffs (57 lines):

diff -r 4b6afbbe77ab -r 7235f9e5948c sys/arch/evbppc/ev64260/clock.c
--- a/sys/arch/evbppc/ev64260/clock.c   Mon Mar 17 23:23:47 2003 +0000
+++ b/sys/arch/evbppc/ev64260/clock.c   Mon Mar 17 23:24:41 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: clock.c,v 1.3 2003/03/16 08:12:26 matt Exp $   */
+/*     $NetBSD: clock.c,v 1.4 2003/03/17 23:24:41 matt Exp $   */
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -31,6 +31,7 @@
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+#include "opt_ppcparam.h"
 #include <sys/param.h>
 #include <sys/kernel.h>
 #include <sys/systm.h>
@@ -51,8 +52,8 @@
  * Initially we assume a processor with a bus frequency of 12.5 MHz.
  */
 u_long tbhz = 0;               /* global timebase ticks/sec */
-u_long ticks_per_sec = 12500000;
-u_long ns_per_tick = 80;
+u_long ticks_per_sec = 25000000;
+u_long ns_per_tick = 40;
 static long ticks_per_intr;
 
 #if NRTC > 0
@@ -321,24 +322,20 @@
 void
 calc_delayconst()
 {
-       int omsr;
-       
        /*
         * Get this info during autoconf?                               XXX
         */
-       tbhz = 100000000;               /* 100 MHz */
-       ticks_per_sec = tbhz / 4;       /* decr 1:4 */
-       if (tbhz == 0)
-               panic("AFW_tbhz");
+#ifdef CLOCKBASE
+       ticks_per_sec = CLOCKBASE / 4;  /* from config file */
+#endif
+       cpu_timebase = ticks_per_sec;
        /*
         * Should check for correct CPU here?           XXX
         */
-       omsr = extintr_disable();
        ns_per_tick = 1000000000 / ticks_per_sec;
        ticks_per_intr = ticks_per_sec / hz;
        curcpu()->ci_lasttb = mftb();
        __asm __volatile ("mtdec %0" :: "r"(ticks_per_intr));
-       extintr_restore(omsr);
 }
 
 /*



Home | Main Index | Thread Index | Old Index