Source-Changes-HG archive

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

[src/trunk]: src/sys/arch mc146818's sc_flag indicates the time is stored in ...



details:   https://anonhg.NetBSD.org/src/rev/2c0e722a5338
branches:  trunk
changeset: 330062:2c0e722a5338
user:      phx <phx%NetBSD.org@localhost>
date:      Fri Jun 20 09:47:15 2014 +0000

description:
mc146818's sc_flag indicates the time is stored in binary format, not BCD.
So we should configure the chip's REGB for binary format as well.
This makes the BeBox RTC finally work reliable for me.

diffstat:

 sys/arch/bebox/isa/mcclock_isa.c     |  8 ++++----
 sys/arch/sandpoint/isa/mcclock_isa.c |  8 ++++----
 2 files changed, 8 insertions(+), 8 deletions(-)

diffs (60 lines):

diff -r 1c48492a84f1 -r 2c0e722a5338 sys/arch/bebox/isa/mcclock_isa.c
--- a/sys/arch/bebox/isa/mcclock_isa.c  Fri Jun 20 08:08:58 2014 +0000
+++ b/sys/arch/bebox/isa/mcclock_isa.c  Fri Jun 20 09:47:15 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mcclock_isa.c,v 1.5 2011/07/01 20:34:53 dyoung Exp $   */
+/*     $NetBSD: mcclock_isa.c,v 1.6 2014/06/20 09:47:15 phx Exp $      */
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -117,7 +117,7 @@
 */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: mcclock_isa.c,v 1.5 2011/07/01 20:34:53 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mcclock_isa.c,v 1.6 2014/06/20 09:47:15 phx Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -225,9 +225,9 @@
        mcclock_isa_write(sc, MC_REGA, MC_BASE_32_KHz | MC_RATE_1024_Hz);
 
        /*
-        * 24 Hour clock, no interrupts please.
+        * 24 Hour clock, binary-format, no auto-DST and no interrupts please.
         */
-       mcclock_isa_write(sc, MC_REGB, MC_REGB_24HR);
+       mcclock_isa_write(sc, MC_REGB, MC_REGB_24HR | MC_REGB_BINARY);
 
        sc->sc_year0 = 1900;
        sc->sc_flag = 0;
diff -r 1c48492a84f1 -r 2c0e722a5338 sys/arch/sandpoint/isa/mcclock_isa.c
--- a/sys/arch/sandpoint/isa/mcclock_isa.c      Fri Jun 20 08:08:58 2014 +0000
+++ b/sys/arch/sandpoint/isa/mcclock_isa.c      Fri Jun 20 09:47:15 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mcclock_isa.c,v 1.5 2011/07/01 19:16:41 dyoung Exp $   */
+/*     $NetBSD: mcclock_isa.c,v 1.6 2014/06/20 09:47:15 phx Exp $      */
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -117,7 +117,7 @@
 */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: mcclock_isa.c,v 1.5 2011/07/01 19:16:41 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mcclock_isa.c,v 1.6 2014/06/20 09:47:15 phx Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -225,9 +225,9 @@
        mcclock_isa_write(sc, MC_REGA, MC_BASE_32_KHz | MC_RATE_1024_Hz);
 
        /*
-        * 24 Hour clock, no interrupts please.
+        * 24 Hour clock, binary-format, no auto-DST and no interrupts please.
         */
-       mcclock_isa_write(sc, MC_REGB, MC_REGB_24HR);
+       mcclock_isa_write(sc, MC_REGB, MC_REGB_24HR | MC_REGB_BINARY);
 
        sc->sc_year0 = 1900;
        sc->sc_flag = 0;



Home | Main Index | Thread Index | Old Index