From: Philipp R. <pr...@pa...> - 2000-12-11 14:45:01
|
This should allow us to merge the DC RTC support nicely 2000-12-11 Philipp Rumpf <pr...@tu...> * arch/sh/kernel/rtc.c, include/asm-sh/rtc.h: New files. * arch/sh/config.in [CONFIG_SH_RTC]: made SH onchip RTC support conditional. * arch/sh/kernel/Makefile [CONFIG_SH_RTC]: Likewise. * arch/sh/kernel/mach_foobar.c, arch/sh/kernel/mach_se.c, arch/sh/kernel/mach_hp600.c, arch/sh/kernel/mach_unknown.c: Likewise. * arch/sh/kernel/time.c (get_timer_frequency): modified to work with non-standard RTCs. (do_timer_interrupt): Likewise. (set_rtc_time) (get_rtc_time): removed functions diff -urNx CVS linuxsh/kernel/arch/sh/config.in linux-aero/arch/sh/config.in --- linuxsh/kernel/arch/sh/config.in Fri Dec 8 13:30:10 2000 +++ linux-aero/arch/sh/config.in Mon Dec 11 05:12:10 2000 @@ -33,11 +33,18 @@ HP690 CONFIG_SH_HP690 \ CqREEK CONFIG_SH_CQREEK \ FOOBAR CONFIG_SH_FOOBAR \ + EC3104 CONFIG_SH_EC3104 \ BareCPU CONFIG_SH_UNKNOWN" Generic if [ "$CONFIG_SH_HP620" = "y" -o "$CONFIG_SH_HP680" = "y" -o \ "$CONFIG_SH_HP690" = "y" ]; then define_bool CONFIG_SH_HP600 y +fi + +if [ "$CONFIG_SH_DREAMCAST" = "y" ]; then + define_bool CONFIG_DREAMCAST_RTC y +else + define_bool CONFIG_SH_RTC y fi choice 'Processor type' \ diff -urNx CVS linuxsh/kernel/arch/sh/kernel/Makefile linux-aero/arch/sh/kernel/Makefile --- linuxsh/kernel/arch/sh/kernel/Makefile Fri Dec 8 13:30:11 2000 +++ linux-aero/arch/sh/kernel/Makefile Mon Dec 11 05:12:30 2000 @@ -20,6 +20,10 @@ O_OBJS += cf-enabler.o endif +ifdef CONFIG_SH_RTC +O_OBJS += rtc.o +endif + ifneq ($(CONFIG_SH_GENERIC)$(CONFIG_SH_HP600),) O_OBJS += mach_hp600.o io_hd64461.o endif diff -urNx CVS linuxsh/kernel/arch/sh/kernel/mach_foobar.c linux-aero/arch/sh/kernel/mach_foobar.c --- linuxsh/kernel/arch/sh/kernel/mach_foobar.c Mon Dec 11 06:30:04 2000 +++ linux-aero/arch/sh/kernel/mach_foobar.c Mon Dec 11 05:07:16 2000 @@ -16,6 +16,7 @@ #include <linux/init.h> #include <asm/machvec.h> +#include <asm/rtc.h> #include <asm/machvec_init.h> #include <asm/io.h> @@ -60,6 +61,9 @@ mv_writel: generic_writel, mv_irq_demux: hd64465_irq_demux, + + mv_rtc_gettimeofday: sh_rtc_gettimeofday, + mv_rtc_settimeofday: sh_rtc_settimeofday, mv_hw_hd64465: 1, }; diff -urNx CVS linuxsh/kernel/arch/sh/kernel/mach_hp600.c linux-aero/arch/sh/kernel/mach_hp600.c --- linuxsh/kernel/arch/sh/kernel/mach_hp600.c Mon Dec 11 06:30:04 2000 +++ linux-aero/arch/sh/kernel/mach_hp600.c Mon Dec 11 05:06:57 2000 @@ -12,6 +12,7 @@ #include <linux/init.h> #include <asm/machvec.h> +#include <asm/rtc.h> #include <asm/machvec_init.h> #include <asm/io_hd64461.h> @@ -57,6 +58,9 @@ mv_irq_demux: hd64461_irq_demux, + mv_rtc_gettimeofday: sh_rtc_gettimeofday, + mv_rtc_settimeofday: sh_rtc_settimeofday, + mv_hw_hp600: 1, mv_hw_hp620: 1, mv_hw_hd64461: 1, @@ -99,6 +103,9 @@ mv_irq_demux: hd64461_irq_demux, + mv_rtc_gettimeofday: sh_rtc_gettimeofday, + mv_rtc_settimeofday: sh_rtc_settimeofday, + mv_hw_hp600: 1, mv_hw_hp680: 1, mv_hw_hd64461: 1, @@ -140,6 +147,9 @@ mv_writel: generic_writel, mv_irq_demux: hd64461_irq_demux, + + mv_rtc_gettimeofday: sh_rtc_gettimeofday, + mv_rtc_settimeofday: sh_rtc_settimeofday, mv_hw_hp600: 1, mv_hw_hp690: 1, diff -urNx CVS linuxsh/kernel/arch/sh/kernel/mach_se.c linux-aero/arch/sh/kernel/mach_se.c --- linuxsh/kernel/arch/sh/kernel/mach_se.c Mon Dec 11 06:30:04 2000 +++ linux-aero/arch/sh/kernel/mach_se.c Mon Dec 11 05:07:46 2000 @@ -13,6 +13,7 @@ #include <linux/init.h> #include <asm/machvec.h> +#include <asm/rtc.h> #include <asm/machvec_init.h> #include <asm/io_se.h> @@ -74,6 +75,9 @@ #ifdef CONFIG_HEARTBEAT mv_heartbeat: heartbeat_se, #endif + + mv_rtc_gettimeofday: sh_rtc_gettimeofday, + mv_rtc_settimeofday: sh_rtc_settimeofday, mv_hw_se: 1, }; diff -urNx CVS linuxsh/kernel/arch/sh/kernel/mach_unknown.c linux-aero/arch/sh/kernel/mach_unknown.c --- linuxsh/kernel/arch/sh/kernel/mach_unknown.c Mon Dec 11 06:30:04 2000 +++ linux-aero/arch/sh/kernel/mach_unknown.c Mon Dec 11 05:08:17 2000 @@ -64,5 +64,8 @@ mv_iounmap: unknown_iounmap, mv_isa_port2addr: unknown_isa_port2addr, + + mv_rtc_gettimeofday: sh_rtc_gettimeofday, + mv_rtc_settimeofday: sh_rtc_settimeofday, }; ALIAS_MV(unknown) diff -urNx CVS linuxsh/kernel/arch/sh/kernel/rtc.c linux-aero/arch/sh/kernel/rtc.c --- linuxsh/kernel/arch/sh/kernel/rtc.c Wed Dec 31 16:00:00 1969 +++ linux-aero/arch/sh/kernel/rtc.c Mon Dec 11 05:28:51 2000 @@ -0,0 +1,178 @@ +/* + * linux/arch/sh/kernel/rtc.c -- SH3 / SH4 on-chip RTC support + * + * Copyright (C) 2000 Philipp Rumpf <pr...@tu...> + * Copyright (C) 1999 Tetsuya Okada & Niibe Yutaka + */ + +#include <linux/config.h> +#include <linux/init.h> +#include <linux/kernel.h> +#include <linux/time.h> + +#include <asm/io.h> +#include <asm/rtc.h> + +/* RCR1 Bits */ +#define RCR1_CF 0x80 /* Carry Flag */ +#define RCR1_CIE 0x10 /* Carry Interrupt Enable */ +#define RCR1_AIE 0x08 /* Alarm Interrupt Enable */ +#define RCR1_AF 0x01 /* Alarm Flag */ + +/* RCR2 Bits */ +#define RCR2_PEF 0x80 /* PEriodic interrupt Flag */ +#define RCR2_PESMASK 0x70 /* Periodic interrupt Set */ +#define RCR2_RTCEN 0x08 /* ENable RTC */ +#define RCR2_ADJ 0x04 /* ADJustment (30-second) */ +#define RCR2_RESET 0x02 /* Reset bit */ +#define RCR2_START 0x01 /* Start bit */ + + +#if defined(__sh3__) +/* SH-3 RTC */ +#define R64CNT 0xfffffec0 +#define RSECCNT 0xfffffec2 +#define RMINCNT 0xfffffec4 +#define RHRCNT 0xfffffec6 +#define RWKCNT 0xfffffec8 +#define RDAYCNT 0xfffffeca +#define RMONCNT 0xfffffecc +#define RYRCNT 0xfffffece +#define RSECAR 0xfffffed0 +#define RMINAR 0xfffffed2 +#define RHRAR 0xfffffed4 +#define RWKAR 0xfffffed6 +#define RDAYAR 0xfffffed8 +#define RMONAR 0xfffffeda +#define RCR1 0xfffffedc +#define RCR2 0xfffffede +#elif defined(__SH4__) +/* SH-4 RTC */ +#define R64CNT 0xffc80000 +#define RSECCNT 0xffc80004 +#define RMINCNT 0xffc80008 +#define RHRCNT 0xffc8000c +#define RWKCNT 0xffc80010 +#define RDAYCNT 0xffc80014 +#define RMONCNT 0xffc80018 +#define RYRCNT 0xffc8001c /* 16bit */ +#define RSECAR 0xffc80020 +#define RMINAR 0xffc80024 +#define RHRAR 0xffc80028 +#define RWKAR 0xffc8002c +#define RDAYAR 0xffc80030 +#define RMONAR 0xffc80034 +#define RCR1 0xffc80038 +#define RCR2 0xffc8003c +#endif + +#ifndef BCD_TO_BIN +#define BCD_TO_BIN(val) ((val)=((val)&15) + ((val)>>4)*10) +#endif + +#ifndef BIN_TO_BCD +#define BIN_TO_BCD(val) ((val)=(((val)/10)<<4) + (val)%10) +#endif + +void sh_rtc_gettimeofday(struct timeval *tv) +{ + unsigned int sec128, sec, min, hr, wk, day, mon, yr, yr100; + + again: + do { + ctrl_outb(0, RCR1); /* Clear CF-bit */ + sec128 = ctrl_inb(RSECCNT); + sec = ctrl_inb(RSECCNT); + min = ctrl_inb(RMINCNT); + hr = ctrl_inb(RHRCNT); + wk = ctrl_inb(RWKCNT); + day = ctrl_inb(RDAYCNT); + mon = ctrl_inb(RMONCNT); +#if defined(__SH4__) + yr = ctrl_inw(RYRCNT); + yr100 = (yr >> 8); + yr &= 0xff; +#else + yr = ctrl_inb(RYRCNT); + yr100 = (yr == 0x99) ? 0x19 : 0x20; +#endif + } while ((ctrl_inb(RCR1) & RCR1_CF) != 0); + + BCD_TO_BIN(yr100); + BCD_TO_BIN(yr); + BCD_TO_BIN(mon); + BCD_TO_BIN(day); + BCD_TO_BIN(hr); + BCD_TO_BIN(min); + BCD_TO_BIN(sec); + + if (yr > 99 || mon < 1 || mon > 12 || day > 31 || day < 1 || + hr > 23 || min > 59 || sec > 59) { + printk(KERN_ERR + "SH RTC: invalid value, resetting to 1 Jan 2000\n"); + ctrl_outb(RCR2_RESET, RCR2); /* Reset & Stop */ + ctrl_outb(0, RSECCNT); + ctrl_outb(0, RMINCNT); + ctrl_outb(0, RHRCNT); + ctrl_outb(6, RWKCNT); + ctrl_outb(1, RDAYCNT); + ctrl_outb(1, RMONCNT); +#if defined(__SH4__) + ctrl_outw(0x2000, RYRCNT); +#else + ctrl_outb(0, RYRCNT); +#endif + ctrl_outb(RCR2_RTCEN|RCR2_START, RCR2); /* Start */ + goto again; + } + + tv->tv_sec = mktime(yr100 * 100 + yr, mon, day, hr, min, sec); + tv->tv_usec = (sec128 * 1000000) / 128; +} + +static int set_rtc_time(unsigned long nowtime) +{ + extern int abs (int); + int retval = 0; + int real_seconds, real_minutes, cmos_minutes; + + ctrl_outb(RCR2_RESET, RCR2); /* Reset pre-scaler & stop RTC */ + + cmos_minutes = ctrl_inb(RMINCNT); + BCD_TO_BIN(cmos_minutes); + + /* + * since we're only adjusting minutes and seconds, + * don't interfere with hour overflow. This avoids + * messing with unknown time zones but requires your + * RTC not to be off by more than 15 minutes + */ + real_seconds = nowtime % 60; + real_minutes = nowtime / 60; + if (((abs(real_minutes - cmos_minutes) + 15)/30) & 1) + real_minutes += 30; /* correct for half hour time zone */ + real_minutes %= 60; + + if (abs(real_minutes - cmos_minutes) < 30) { + BIN_TO_BCD(real_seconds); + BIN_TO_BCD(real_minutes); + ctrl_outb(real_seconds, RSECCNT); + ctrl_outb(real_minutes, RMINCNT); + } else { + printk(KERN_WARNING + "set_rtc_time: can't update from %d to %d\n", + cmos_minutes, real_minutes); + retval = -1; + } + + ctrl_outb(RCR2_RTCEN|RCR2_START, RCR2); /* Start RTC */ + + return retval; +} + +int sh_rtc_settimeofday(const struct timeval *tv) +{ + return set_rtc_time(tv->tv_sec); +} + + diff -urNx CVS linuxsh/kernel/arch/sh/kernel/time.c linux-aero/arch/sh/kernel/time.c --- linuxsh/kernel/arch/sh/kernel/time.c Mon Dec 11 06:12:13 2000 +++ linux-aero/arch/sh/kernel/time.c Mon Dec 11 06:07:20 2000 @@ -28,6 +28,7 @@ #include <asm/irq.h> #include <asm/delay.h> #include <asm/machvec.h> +#include <asm/rtc.h> #include <linux/timex.h> #include <linux/irq.h> @@ -38,20 +39,6 @@ #define TMU0_TCR_CALIB 0x0000 -/* RCR1 Bits */ -#define RCR1_CF 0x80 /* Carry Flag */ -#define RCR1_CIE 0x10 /* Carry Interrupt Enable */ -#define RCR1_AIE 0x08 /* Alarm Interrupt Enable */ -#define RCR1_AF 0x01 /* Alarm Flag */ - -/* RCR2 Bits */ -#define RCR2_PEF 0x80 /* PEriodic interrupt Flag */ -#define RCR2_PESMASK 0x70 /* Periodic interrupt Set */ -#define RCR2_RTCEN 0x08 /* ENable RTC */ -#define RCR2_ADJ 0x04 /* ADJustment (30-second) */ -#define RCR2_RESET 0x02 /* Reset bit */ -#define RCR2_START 0x01 /* Start bit */ - #if defined(__sh3__) #define TMU_TOCR 0xfffffe90 /* Byte access */ #define TMU_TSTR 0xfffffe92 /* Byte access */ @@ -61,25 +48,6 @@ #define TMU0_TCR 0xfffffe9c /* Word access */ #define FRQCR 0xffffff80 - -/* SH-3 RTC */ -#define R64CNT 0xfffffec0 -#define RSECCNT 0xfffffec2 -#define RMINCNT 0xfffffec4 -#define RHRCNT 0xfffffec6 -#define RWKCNT 0xfffffec8 -#define RDAYCNT 0xfffffeca -#define RMONCNT 0xfffffecc -#define RYRCNT 0xfffffece -#define RSECAR 0xfffffed0 -#define RMINAR 0xfffffed2 -#define RHRAR 0xfffffed4 -#define RWKAR 0xfffffed6 -#define RDAYAR 0xfffffed8 -#define RMONAR 0xfffffeda -#define RCR1 0xfffffedc -#define RCR2 0xfffffede - #elif defined(__SH4__) #define TMU_TOCR 0xffd80000 /* Byte access */ #define TMU_TSTR 0xffd80004 /* Byte access */ @@ -89,32 +57,6 @@ #define TMU0_TCR 0xffd80010 /* Word access */ #define FRQCR 0xffc00000 - -/* SH-4 RTC */ -#define R64CNT 0xffc80000 -#define RSECCNT 0xffc80004 -#define RMINCNT 0xffc80008 -#define RHRCNT 0xffc8000c -#define RWKCNT 0xffc80010 -#define RDAYCNT 0xffc80014 -#define RMONCNT 0xffc80018 -#define RYRCNT 0xffc8001c /* 16bit */ -#define RSECAR 0xffc80020 -#define RMINAR 0xffc80024 -#define RHRAR 0xffc80028 -#define RWKAR 0xffc8002c -#define RDAYAR 0xffc80030 -#define RMONAR 0xffc80034 -#define RCR1 0xffc80038 -#define RCR2 0xffc8003c -#endif - -#ifndef BCD_TO_BIN -#define BCD_TO_BIN(val) ((val)=((val)&15) + ((val)>>4)*10) -#endif - -#ifndef BIN_TO_BCD -#define BIN_TO_BCD(val) ((val)=(((val)/10)<<4) + (val)%10) #endif extern rwlock_t xtime_lock; @@ -220,46 +162,6 @@ write_unlock_irq(&xtime_lock); } -static int set_rtc_time(unsigned long nowtime) -{ - extern int abs (int); - int retval = 0; - int real_seconds, real_minutes, cmos_minutes; - - ctrl_outb(RCR2_RESET, RCR2); /* Reset pre-scaler & stop RTC */ - - cmos_minutes = ctrl_inb(RMINCNT); - BCD_TO_BIN(cmos_minutes); - - /* - * since we're only adjusting minutes and seconds, - * don't interfere with hour overflow. This avoids - * messing with unknown time zones but requires your - * RTC not to be off by more than 15 minutes - */ - real_seconds = nowtime % 60; - real_minutes = nowtime / 60; - if (((abs(real_minutes - cmos_minutes) + 15)/30) & 1) - real_minutes += 30; /* correct for half hour time zone */ - real_minutes %= 60; - - if (abs(real_minutes - cmos_minutes) < 30) { - BIN_TO_BCD(real_seconds); - BIN_TO_BCD(real_minutes); - ctrl_outb(real_seconds, RSECCNT); - ctrl_outb(real_minutes, RMINCNT); - } else { - printk(KERN_WARNING - "set_rtc_time: can't update from %d to %d\n", - cmos_minutes, real_minutes); - retval = -1; - } - - ctrl_outb(RCR2_RTCEN|RCR2_START, RCR2); /* Start RTC */ - - return retval; -} - /* last time the RTC clock got updated */ static long last_rtc_update; @@ -289,7 +191,7 @@ xtime.tv_sec > last_rtc_update + 660 && xtime.tv_usec >= 500000 - ((unsigned) tick) / 2 && xtime.tv_usec <= 500000 + ((unsigned) tick) / 2) { - if (set_rtc_time(xtime.tv_sec) == 0) + if (sh_mv.mv_rtc_settimeofday(&xtime) == 0) last_rtc_update = xtime.tv_sec; else last_rtc_update = xtime.tv_sec - 600; /* do it again in 60 s */ @@ -322,64 +224,12 @@ write_unlock(&xtime_lock); } -static unsigned long get_rtc_time(void) -{ - unsigned int sec, min, hr, wk, day, mon, yr, yr100; - - again: - do { - ctrl_outb(0, RCR1); /* Clear CF-bit */ - sec = ctrl_inb(RSECCNT); - min = ctrl_inb(RMINCNT); - hr = ctrl_inb(RHRCNT); - wk = ctrl_inb(RWKCNT); - day = ctrl_inb(RDAYCNT); - mon = ctrl_inb(RMONCNT); -#if defined(__SH4__) - yr = ctrl_inw(RYRCNT); - yr100 = (yr >> 8); - yr &= 0xff; -#else - yr = ctrl_inb(RYRCNT); - yr100 = (yr == 0x99) ? 0x19 : 0x20; -#endif - } while ((ctrl_inb(RCR1) & RCR1_CF) != 0); - - BCD_TO_BIN(yr100); - BCD_TO_BIN(yr); - BCD_TO_BIN(mon); - BCD_TO_BIN(day); - BCD_TO_BIN(hr); - BCD_TO_BIN(min); - BCD_TO_BIN(sec); - - if (yr > 99 || mon < 1 || mon > 12 || day > 31 || day < 1 || - hr > 23 || min > 59 || sec > 59) { - printk(KERN_ERR - "SH RTC: invalid value, resetting to 1 Jan 2000\n"); - ctrl_outb(RCR2_RESET, RCR2); /* Reset & Stop */ - ctrl_outb(0, RSECCNT); - ctrl_outb(0, RMINCNT); - ctrl_outb(0, RHRCNT); - ctrl_outb(6, RWKCNT); - ctrl_outb(1, RDAYCNT); - ctrl_outb(1, RMONCNT); -#if defined(__SH4__) - ctrl_outw(0x2000, RYRCNT); -#else - ctrl_outb(0, RYRCNT); -#endif - ctrl_outb(RCR2_RTCEN|RCR2_START, RCR2); /* Start */ - goto again; - } - - return mktime(yr100 * 100 + yr, mon, day, hr, min, sec); -} - static unsigned int __init get_timer_frequency(void) { u32 freq; - u8 r64cnt; + struct timeval tv1, tv2; + unsigned long diff_usec; + unsigned long factor; /* Setup the timer: We don't want to generate interrupts, just * have it count down at its natural rate. @@ -390,22 +240,37 @@ ctrl_outl(0xffffffff, TMU0_TCOR); ctrl_outl(0xffffffff, TMU0_TCNT); - /* wait until the current 1/128th second is over */ - r64cnt = ctrl_inb(R64CNT); - while (ctrl_inb(R64CNT) == r64cnt); - + rtc_gettimeofday(&tv2); + + do { + rtc_gettimeofday(&tv1); + } while (tv1.tv_usec == tv2.tv_usec && tv1.tv_sec == tv2.tv_sec); + /* actually start the timer */ ctrl_outb(TMU_TSTR_INIT, TMU_TSTR); - /* wait 1/128th of a second */ - r64cnt = ctrl_inb(R64CNT); - while (ctrl_inb(R64CNT) == r64cnt); - + do { + rtc_gettimeofday(&tv2); + } while (tv1.tv_usec == tv2.tv_usec && tv1.tv_sec == tv2.tv_sec); + freq = 0xffffffff - ctrl_inl(TMU0_TCNT); - - freq *= 128; + if (tv2.tv_usec < tv1.tv_usec) { + tv2.tv_usec += 1000000; + tv2.tv_sec--; + } + + diff_usec = (tv2.tv_sec - tv1.tv_sec) * 1000000 + (tv2.tv_usec - tv1.tv_usec); + + /* this should work well if the RTC has a precision of n Hz, where + * n is an integer. I don't think we have to worry about the other + * cases. */ + factor = (1000000 + diff_usec/2) / diff_usec; + + if (factor * diff_usec > 1100000 || + factor * diff_usec < 900000) + panic("weird RTC (diff_usec %ld)", diff_usec); - return freq; + return freq * factor; } static struct irqaction irq0 = { timer_interrupt, SA_INTERRUPT, 0, "timer", NULL, NULL}; @@ -426,8 +291,7 @@ static int pfc_table[] = { 2, 3, 4, 6, 8, 2, 2, 2 }; #endif - xtime.tv_sec = get_rtc_time(); - xtime.tv_usec = 0; + rtc_gettimeofday(&xtime); setup_irq(TIMER_IRQ, &irq0); diff -urNx CVS linuxsh/kernel/include/asm-sh/machvec.h linux-aero/include/asm-sh/machvec.h --- linuxsh/kernel/include/asm-sh/machvec.h Fri Dec 8 13:32:58 2000 +++ linux-aero/include/asm-sh/machvec.h Mon Dec 11 04:59:49 2000 @@ -13,6 +13,8 @@ #include <linux/config.h> #include <linux/types.h> +struct timeval; + struct sh_machine_vector { const char *mv_name; @@ -61,6 +63,9 @@ void (*mv_heartbeat)(void); + void (*mv_rtc_gettimeofday)(struct timeval *tv); + int (*mv_rtc_settimeofday)(const struct timeval *tv); + unsigned int mv_hw_se : 1; unsigned int mv_hw_hp600 : 1; unsigned int mv_hw_hp620 : 1; diff -urNx CVS linuxsh/kernel/include/asm-sh/rtc.h linux-aero/include/asm-sh/rtc.h --- linuxsh/kernel/include/asm-sh/rtc.h Wed Dec 31 16:00:00 1969 +++ linux-aero/include/asm-sh/rtc.h Mon Dec 11 05:05:33 2000 @@ -0,0 +1,12 @@ +#ifndef _ASM_RTC_H +#define _ASM_RTC_H + +#include <asm/machvec.h> + +#define rtc_gettimeofday sh_mv.mv_rtc_gettimeofday +#define rtc_settimeofday sh_mv.mv_rtc_settimeofday + +extern void sh_rtc_gettimeofday(struct timeval *tv); +extern int sh_rtc_settimeofday(const struct timeval *tv); + +#endif /* _ASM_RTC_H */ |