Subject: Still some problems with RTC
To: None <port-next68k@netbsd.org>
From: Cory Bajus <cbajus@mts.net>
List: port-next68k
Date: 04/09/2006 09:48:44
The changes I posted earlier for dealing with the MCS1850 RTC (including
a fix suggested by Timm Wetzel) have been committed to HEAD (thanks
christos).  However, there still seems to be some problems writing to the
counter registers.  Writing to RTC_CNTR3 (the LSB) works fine but any
attempts to write to the other three counter registers only seems to
invert the previously stored value.  Here is a patch to enable (and fix)
the debug code - I'm interested to hear if others experience the same
behavior.

Thanks,
Cory.

Index: rtc.c
===================================================================
RCS file: /cvsroot/src/sys/arch/next68k/next68k/rtc.c,v
retrieving revision 1.13
diff -u -r1.13 rtc.c
--- rtc.c       15 Mar 2006 15:39:26 -0000      1.13
+++ rtc.c       9 Apr 2006 14:31:46 -0000
@@ -54,7 +54,7 @@
 #include <next68k/dev/clockreg.h>
 #include <next68k/dev/intiovar.h>
 
-/* #define RTC_DEBUG */
+#define RTC_DEBUG
 
 u_char new_clock;
 volatile u_int *scr2 = (u_int *)NEXT_P_SCR2; /* will get memory mapped in rtc_init */
@@ -296,7 +296,7 @@
        rtc_write(RTC_CONTROL,rtc_read(RTC_CONTROL) & ~RTC_START);
 
 #ifdef RTC_DEBUG
-       printf("Setting RTC to 0x%08x.  Regs before:\n",secs);
+       printf("Setting RTC to 0x%08x.  Regs before:\n", (unsigned int)secs);
        rtc_print();
 #endif
 
@@ -335,7 +335,7 @@
        }
 
 #ifdef RTC_DEBUG
-       printf("Regs after:\n",secs);
+       printf("Regs after:\n");
        rtc_print();
 #endif