Devices: Make the RTC device reflect the use of BCD in its status registers.
authorGabe Black <gblack@eecs.umich.edu>
Wed, 25 Feb 2009 18:22:49 +0000 (10:22 -0800)
committerGabe Black <gblack@eecs.umich.edu>
Wed, 25 Feb 2009 18:22:49 +0000 (10:22 -0800)
src/dev/mc146818.cc

index 7b219e30c3f5a25341f316ee6a5c6e9834465a99..c01d945b3735597bc1d807484678a0da22a16ec0 100644 (file)
@@ -49,7 +49,9 @@ MC146818::MC146818(EventManager *em, const string &n, const struct tm time,
 {
     memset(clock_data, 0, sizeof(clock_data));
     stat_regA = RTCA_32768HZ | RTCA_1024HZ;
-    stat_regB = RTCB_PRDC_IE |RTCB_BIN | RTCB_24HR;
+    stat_regB = RTCB_PRDC_IE | RTCB_24HR;
+    if (!bcd)
+        stat_regB |= RTCB_BIN;
 
     year = time.tm_year;