Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 2 May 2007 11:43:08 GMT
From:      Bruce M Simpson <bms@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 119147 for review
Message-ID:  <200705021143.l42Bh8cw082270@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=119147

Change 119147 by bms@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);
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200705021143.l42Bh8cw082270>