2 * linux/arch/arm/mach-integrator/time.c
4 * Copyright (C) 2000-2001 Deep Blue Solutions
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
10 #include <linux/kernel.h>
11 #include <linux/time.h>
12 #include <linux/init.h>
14 #include <asm/hardware.h>
17 #define RTC_DR (IO_ADDRESS(INTEGRATOR_RTC_BASE) + 0)
18 #define RTC_MR (IO_ADDRESS(INTEGRATOR_RTC_BASE) + 4)
19 #define RTC_STAT (IO_ADDRESS(INTEGRATOR_RTC_BASE) + 8)
20 #define RTC_EOI (IO_ADDRESS(INTEGRATOR_RTC_BASE) + 8)
21 #define RTC_LR (IO_ADDRESS(INTEGRATOR_RTC_BASE) + 12)
22 #define RTC_CR (IO_ADDRESS(INTEGRATOR_RTC_BASE) + 16)
24 #define RTC_CR_MIE 0x00000001
26 extern int (*set_rtc)(void);
28 static int integrator_set_rtc(void)
30 __raw_writel(xtime.tv_sec, RTC_LR);
34 static int integrator_rtc_init(void)
36 __raw_writel(0, RTC_CR);
37 __raw_writel(0, RTC_EOI);
39 xtime.tv_sec = __raw_readl(RTC_DR);
41 set_rtc = integrator_set_rtc;
46 __initcall(integrator_rtc_init);