diff options
author | Dale Rahn <drahn@cvs.openbsd.org> | 2006-06-15 20:42:54 +0000 |
---|---|---|
committer | Dale Rahn <drahn@cvs.openbsd.org> | 2006-06-15 20:42:54 +0000 |
commit | 2c15ca427f1b8c2586afd23dffb731d6822e24ba (patch) | |
tree | be35ed2f4f501d79c245564c703a49523e6d56b0 /sys/arch | |
parent | 43b6a19f9d68308bd22bfd92a700d07259650856 (diff) |
Ricoh rtc support for armish, driver from netbsd.
Diffstat (limited to 'sys/arch')
-rw-r--r-- | sys/arch/arm/xscale/i80321_timer.c | 18 | ||||
-rw-r--r-- | sys/arch/armish/conf/GENERIC | 3 | ||||
-rw-r--r-- | sys/arch/armish/conf/RAMDISK | 3 | ||||
-rw-r--r-- | sys/arch/armish/conf/files.armish | 3 |
4 files changed, 19 insertions, 8 deletions
diff --git a/sys/arch/arm/xscale/i80321_timer.c b/sys/arch/arm/xscale/i80321_timer.c index 59e5799e191..bccc5d37c3a 100644 --- a/sys/arch/arm/xscale/i80321_timer.c +++ b/sys/arch/arm/xscale/i80321_timer.c @@ -1,4 +1,4 @@ -/* $OpenBSD: i80321_timer.c,v 1.3 2006/06/01 18:46:05 drahn Exp $ */ +/* $OpenBSD: i80321_timer.c,v 1.4 2006/06/15 20:42:53 drahn Exp $ */ /* $NetBSD: i80321_timer.c,v 1.13 2005/12/24 20:06:52 perry Exp $ */ /* @@ -352,6 +352,7 @@ void inittodr(time_t base) { time_t deltat; + struct timeval rtctime; int badbase; if (base < (MINYEAR - 1970) * SECYR) { @@ -363,8 +364,8 @@ inittodr(time_t base) badbase = 0; if (todr_handle == NULL || -/* todr_gettime(todr_handle, &time) != 0 || */ - time.tv_sec == 0) { + todr_gettime(todr_handle, &rtctime) != 0 || + rtctime.tv_sec == 0) { /* * Believe the time in the file system for lack of * anything better, resetting the TODR. @@ -376,6 +377,9 @@ inittodr(time_t base) resettodr(); } goto bad; + } else { + time.tv_sec = rtctime.tv_sec; + time.tv_usec = rtctime.tv_usec; } if (!badbase) { @@ -404,12 +408,16 @@ inittodr(time_t base) void resettodr(void) { + struct timeval rtctime; if (time.tv_sec == 0) return; - if (todr_handle != NULL /* && */ - /* todr_settime(todr_handle, &time) != 0 */) + rtctime.tv_sec = time.tv_sec; + rtctime.tv_usec = time.tv_usec; + + if (todr_handle != NULL && + todr_settime(todr_handle, &rtctime) != 0) printf("resettodr: failed to set time\n"); } diff --git a/sys/arch/armish/conf/GENERIC b/sys/arch/armish/conf/GENERIC index 91d57187a67..e04a382e849 100644 --- a/sys/arch/armish/conf/GENERIC +++ b/sys/arch/armish/conf/GENERIC @@ -1,4 +1,4 @@ -# $OpenBSD: GENERIC,v 1.4 2006/06/15 20:38:01 drahn Exp $ +# $OpenBSD: GENERIC,v 1.5 2006/06/15 20:42:53 drahn Exp $ # # For further information on compiling OpenBSD kernels, see the config(8) # man page. @@ -45,6 +45,7 @@ gpio0 at iopxs0 iopiic* at iopxs? # I2C Controller Unit(s) iic0 at iopiic? iic1 at iopiic? +ricohrtc0 at iic? addr 0x32 # Ricoh RTC #iopwdog* at iopxs? # Watchdog timer pci0 at iopxs? bus ? # PCI/PCI-X support diff --git a/sys/arch/armish/conf/RAMDISK b/sys/arch/armish/conf/RAMDISK index 99425b669a2..f600b9562cd 100644 --- a/sys/arch/armish/conf/RAMDISK +++ b/sys/arch/armish/conf/RAMDISK @@ -1,4 +1,4 @@ -# $OpenBSD: RAMDISK,v 1.4 2006/06/15 20:38:01 drahn Exp $ +# $OpenBSD: RAMDISK,v 1.5 2006/06/15 20:42:53 drahn Exp $ # # For further information on compiling OpenBSD kernels, see the config(8) # man page. @@ -56,6 +56,7 @@ iopxs0 at mainbus? iopiic* at iopxs? # I2C Controller Unit(s) iic0 at iopiic? iic1 at iopiic? +ricohrtc0 at iic? addr 0x32 # Ricoh RTC #iopwdog* at iopxs? # Watchdog timer pci0 at iopxs? bus ? # PCI/PCI-X support diff --git a/sys/arch/armish/conf/files.armish b/sys/arch/armish/conf/files.armish index 8b06876d04c..3a11b52db40 100644 --- a/sys/arch/armish/conf/files.armish +++ b/sys/arch/armish/conf/files.armish @@ -1,4 +1,4 @@ -# $OpenBSD: files.armish,v 1.5 2006/06/10 03:53:08 drahn Exp $ +# $OpenBSD: files.armish,v 1.6 2006/06/15 20:42:53 drahn Exp $ maxpartitions 16 maxusers 2 8 64 @@ -9,6 +9,7 @@ major {rd = 18} file arch/arm/arm/conf.c file arch/armish/armish/armish_machdep.c +file dev/clock_subr.c file arch/armish/armish/autoconf.c file arch/arm/arm/disksubr.c disk |