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.
This commit is contained in:
phx 2014-06-20 09:47:15 +00:00
parent 03f9b192f3
commit d08eccdb32
2 changed files with 8 additions and 8 deletions

View File

@ -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 @@ WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#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_attach(device_t parent, device_t self, void *aux)
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;

View File

@ -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 @@ WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#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_attach(device_t parent, device_t self, void *aux)
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;