With the freerunnnig mode, set 0 (=256count) not 0xff (=255count)

in Timer-D.  It fixes the clock ticked faster when timecounter uses
"mfp" (as default choice).  It was introduced in rev 1.24 in 2006.
Thanks tsutsui@ for many comments.
Should be pulled up to netbsd-6 and netbsd-5.
This commit is contained in:
isaki 2012-05-22 04:03:03 +00:00
parent 95a363c914
commit 24ce0eb54d
1 changed files with 3 additions and 3 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: clock.c,v 1.33 2011/02/08 20:20:26 rmind Exp $ */
/* $NetBSD: clock.c,v 1.34 2012/05/22 04:03:03 isaki Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@ -39,7 +39,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.33 2011/02/08 20:20:26 rmind Exp $");
__KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.34 2012/05/22 04:03:03 isaki Exp $");
#include "clock.h"
@ -143,7 +143,7 @@ cpu_initclocks(void)
mfp_set_tcdr(CLOCKS_PER_SEC / hz);
mfp_bit_set_ierb(MFP_INTR_TIMER_C);
mfp_set_tddr(0xff); /* maximum free run -- only 8 bits wide */
mfp_set_tddr(0); /* maximum free run -- only 8 bits wide */
mfp_set_tcdcr(mfp_get_tcdcr() | 0x07); /* 1/200 prescaler */
tc_init(&tc);