PERFORCE change 119147 for review
Bruce M Simpson
bms at FreeBSD.org
Wed May 2 11:43:09 UTC 2007
http://perforce.freebsd.org/chv.cgi?CH=119147
Change 119147 by bms at bms_anglepoise on 2007/05/02 11:42:20
Bring back plain old hardcoded clock value.
The Sentry5 doesn't have YAMON or the Motorola RTC.
Affected files ...
.. //depot/projects/mips2/src/sys/mips/mips/tick.c#11 edit
Differences ...
==== //depot/projects/mips2/src/sys/mips/mips/tick.c#11 (text+ko) ====
@@ -117,7 +117,7 @@
printf("Calibrating MIPS32 clock ... ");
do {
-#ifdef TICK_USE_YAMON_FREQ
+#if defined(TICK_USE_YAMON_FREQ)
/*
* Use the clock frequency specified in the environment
* variables providied to us by the YAMON monitor.
@@ -131,13 +131,12 @@
} else {
counter_freq = strtol(cp, (char **)NULL, 10) * 1000 ;
}
-#else
+#elif defined(TICK_USE_MALTA_RTC)
u_int64_t counterval[2];
/*
* Determine clock frequency from hardware.
*/
-#ifdef TICK_USE_MALTA_RTC
/* Set RTC to binary mode. */
writertc(RTC_STATUSB, (rtcin(RTC_STATUSB) | RTCSB_BCD));
@@ -146,19 +145,19 @@
;
while (((rtcin(RTC_STATUSA)& RTCSA_TUP) != 0))
;
-#endif
counterval[0] = mips_rd_count();
-#ifdef TICK_USE_MALTA_RTC
/* Busy-wait for falling edge of RTC update. */
while (((rtcin(RTC_STATUSA) & RTCSA_TUP) == 0))
;
while (((rtcin(RTC_STATUSA)& RTCSA_TUP) != 0))
;
-#endif
+ counterval[1] = mips_rd_count();
- counterval[1] = mips_rd_count();
counter_freq = counterval[1] - counterval[0];
+#else
+ printf("using hard-coded default clock of 10MHz\n");
+ counter_freq = 10000000;
#endif
} while (0);
More information about the p4-projects
mailing list