[PATCH 2.6.12-rc1-mm2] update VR41xx RTC support

2005-03-24 Thread Yoichi Yuasa
This patch updates NEC VR4100 series RTC support.

Yoichi

Signed-off-by: Yoichi Yuasa <[EMAIL PROTECTED]>

diff -urN -X dontdiff rc1-mm2-orig/arch/mips/vr41xx/common/Makefile 
rc1-mm2/arch/mips/vr41xx/common/Makefile
--- rc1-mm2-orig/arch/mips/vr41xx/common/Makefile   Fri Mar 25 00:42:00 2005
+++ rc1-mm2/arch/mips/vr41xx/common/MakefileFri Mar 25 00:53:32 2005
@@ -2,7 +2,7 @@
 # Makefile for common code of the NEC VR4100 series.
 #
 
-obj-y  += bcu.o cmu.o giu.o icu.o init.o int-handler.o 
ksyms.o pmu.o rtc.o
+obj-y  += bcu.o cmu.o giu.o icu.o init.o int-handler.o 
pmu.o
 obj-$(CONFIG_VRC4173)  += vrc4173.o
 
 EXTRA_AFLAGS := $(CFLAGS)
diff -urN -X dontdiff rc1-mm2-orig/arch/mips/vr41xx/common/ksyms.c 
rc1-mm2/arch/mips/vr41xx/common/ksyms.c
--- rc1-mm2-orig/arch/mips/vr41xx/common/ksyms.cFri Mar 25 00:42:00 2005
+++ rc1-mm2/arch/mips/vr41xx/common/ksyms.c Thu Jan  1 09:00:00 1970
@@ -1,30 +0,0 @@
-/*
- *   ksyms.c, Export NEC VR4100 series specific functions needed for loadable 
modules.
- *
- *  Copyright (C) 2003  Yoichi Yuasa <[EMAIL PROTECTED]>
- *  Copyright (C) 2005 Ralf Baechle ([EMAIL PROTECTED])
- *
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-#include 
-
-#include 
-
-EXPORT_SYMBOL(vr41xx_set_rtclong1_cycle);
-EXPORT_SYMBOL(vr41xx_read_rtclong1_counter);
-EXPORT_SYMBOL(vr41xx_set_rtclong2_cycle);
-EXPORT_SYMBOL(vr41xx_read_rtclong2_counter);
-EXPORT_SYMBOL(vr41xx_set_tclock_cycle);
-EXPORT_SYMBOL(vr41xx_read_tclock_counter);
diff -urN -X dontdiff rc1-mm2-orig/arch/mips/vr41xx/common/rtc.c 
rc1-mm2/arch/mips/vr41xx/common/rtc.c
--- rc1-mm2-orig/arch/mips/vr41xx/common/rtc.c  Wed Mar  2 16:38:34 2005
+++ rc1-mm2/arch/mips/vr41xx/common/rtc.c   Thu Jan  1 09:00:00 1970
@@ -1,321 +0,0 @@
-/*
- *  rtc.c, RTC(has only timer function) routines for NEC VR4100 series.
- *
- *  Copyright (C) 2003-2004  Yoichi Yuasa <[EMAIL PROTECTED]>
- *
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-#include 
-#include 
-#include 
-#include 
-
-#include 
-#include 
-#include 
-
-static uint32_t rtc1_base;
-static uint32_t rtc2_base;
-
-static uint64_t previous_elapsedtime;
-static unsigned int remainder_per_sec;
-static unsigned int cycles_per_sec;
-static unsigned int cycles_per_jiffy;
-static unsigned long epoch_time;
-
-#define CYCLES_PER_JIFFY   (CLOCK_TICK_RATE / HZ)
-#define REMAINDER_PER_SEC  (CLOCK_TICK_RATE - (CYCLES_PER_JIFFY * HZ))
-#define CYCLES_PER_100USEC ((CLOCK_TICK_RATE + (1 / 2)) / 1)
-
-#define ETIMELREG_TYPE1KSEG1ADDR(0x0bc0)
-#define TCLKLREG_TYPE1 KSEG1ADDR(0x0b0001c0)
-
-#define ETIMELREG_TYPE2KSEG1ADDR(0x0f000100)
-#define TCLKLREG_TYPE2 KSEG1ADDR(0x0f000120)
-
-/* RTC 1 registers */
-#define ETIMELREG  0x00
-#define ETIMEMREG  0x02
-#define ETIMEHREG  0x04
-/* RFU */
-#define ECMPLREG   0x08
-#define ECMPMREG   0x0a
-#define ECMPHREG   0x0c
-/* RFU */
-#define RTCL1LREG  0x10
-#define RTCL1HREG  0x12
-#define RTCL1CNTLREG   0x14
-#define RTCL1CNTHREG   0x16
-#define RTCL2LREG  0x18
-#define RTCL2HREG  0x1a
-#define RTCL2CNTLREG   0x1c
-#define RTCL2CNTHREG   0x1e
-
-/* RTC 2 registers */
-#define TCLKLREG   0x00
-#define TCLKHREG   0x02
-#define TCLKCNTLREG0x04
-#define TCLKCNTHREG0x06
-/* RFU */
-#define RTCINTREG  0x1e
- #define TCLOCK_INT0x08
- #define 

[PATCH 2.6.12-rc1-mm2] update VR41xx RTC support

2005-03-24 Thread Yoichi Yuasa
This patch updates NEC VR4100 series RTC support.

Yoichi

Signed-off-by: Yoichi Yuasa [EMAIL PROTECTED]

diff -urN -X dontdiff rc1-mm2-orig/arch/mips/vr41xx/common/Makefile 
rc1-mm2/arch/mips/vr41xx/common/Makefile
--- rc1-mm2-orig/arch/mips/vr41xx/common/Makefile   Fri Mar 25 00:42:00 2005
+++ rc1-mm2/arch/mips/vr41xx/common/MakefileFri Mar 25 00:53:32 2005
@@ -2,7 +2,7 @@
 # Makefile for common code of the NEC VR4100 series.
 #
 
-obj-y  += bcu.o cmu.o giu.o icu.o init.o int-handler.o 
ksyms.o pmu.o rtc.o
+obj-y  += bcu.o cmu.o giu.o icu.o init.o int-handler.o 
pmu.o
 obj-$(CONFIG_VRC4173)  += vrc4173.o
 
 EXTRA_AFLAGS := $(CFLAGS)
diff -urN -X dontdiff rc1-mm2-orig/arch/mips/vr41xx/common/ksyms.c 
rc1-mm2/arch/mips/vr41xx/common/ksyms.c
--- rc1-mm2-orig/arch/mips/vr41xx/common/ksyms.cFri Mar 25 00:42:00 2005
+++ rc1-mm2/arch/mips/vr41xx/common/ksyms.c Thu Jan  1 09:00:00 1970
@@ -1,30 +0,0 @@
-/*
- *   ksyms.c, Export NEC VR4100 series specific functions needed for loadable 
modules.
- *
- *  Copyright (C) 2003  Yoichi Yuasa [EMAIL PROTECTED]
- *  Copyright (C) 2005 Ralf Baechle ([EMAIL PROTECTED])
- *
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-#include linux/module.h
-
-#include asm/vr41xx/vr41xx.h
-
-EXPORT_SYMBOL(vr41xx_set_rtclong1_cycle);
-EXPORT_SYMBOL(vr41xx_read_rtclong1_counter);
-EXPORT_SYMBOL(vr41xx_set_rtclong2_cycle);
-EXPORT_SYMBOL(vr41xx_read_rtclong2_counter);
-EXPORT_SYMBOL(vr41xx_set_tclock_cycle);
-EXPORT_SYMBOL(vr41xx_read_tclock_counter);
diff -urN -X dontdiff rc1-mm2-orig/arch/mips/vr41xx/common/rtc.c 
rc1-mm2/arch/mips/vr41xx/common/rtc.c
--- rc1-mm2-orig/arch/mips/vr41xx/common/rtc.c  Wed Mar  2 16:38:34 2005
+++ rc1-mm2/arch/mips/vr41xx/common/rtc.c   Thu Jan  1 09:00:00 1970
@@ -1,321 +0,0 @@
-/*
- *  rtc.c, RTC(has only timer function) routines for NEC VR4100 series.
- *
- *  Copyright (C) 2003-2004  Yoichi Yuasa [EMAIL PROTECTED]
- *
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-#include linux/init.h
-#include linux/irq.h
-#include linux/smp.h
-#include linux/types.h
-
-#include asm/io.h
-#include asm/time.h
-#include asm/vr41xx/vr41xx.h
-
-static uint32_t rtc1_base;
-static uint32_t rtc2_base;
-
-static uint64_t previous_elapsedtime;
-static unsigned int remainder_per_sec;
-static unsigned int cycles_per_sec;
-static unsigned int cycles_per_jiffy;
-static unsigned long epoch_time;
-
-#define CYCLES_PER_JIFFY   (CLOCK_TICK_RATE / HZ)
-#define REMAINDER_PER_SEC  (CLOCK_TICK_RATE - (CYCLES_PER_JIFFY * HZ))
-#define CYCLES_PER_100USEC ((CLOCK_TICK_RATE + (1 / 2)) / 1)
-
-#define ETIMELREG_TYPE1KSEG1ADDR(0x0bc0)
-#define TCLKLREG_TYPE1 KSEG1ADDR(0x0b0001c0)
-
-#define ETIMELREG_TYPE2KSEG1ADDR(0x0f000100)
-#define TCLKLREG_TYPE2 KSEG1ADDR(0x0f000120)
-
-/* RTC 1 registers */
-#define ETIMELREG  0x00
-#define ETIMEMREG  0x02
-#define ETIMEHREG  0x04
-/* RFU */
-#define ECMPLREG   0x08
-#define ECMPMREG   0x0a
-#define ECMPHREG   0x0c
-/* RFU */
-#define RTCL1LREG  0x10
-#define RTCL1HREG  0x12
-#define RTCL1CNTLREG   0x14
-#define RTCL1CNTHREG   0x16
-#define RTCL2LREG  0x18
-#define RTCL2HREG  0x1a
-#define RTCL2CNTLREG   0x1c
-#define RTCL2CNTHREG   0x1e
-
-/* RTC 2 registers */
-#define TCLKLREG   0x00
-#define TCLKHREG   0x02
-#define TCLKCNTLREG0x04
-#define TCLKCNTHREG