From: James S. <jsi...@us...> - 2001-10-25 23:58:14
|
Update of /cvsroot/linux-mips/linux/arch/mips/cobalt In directory usw-pr-cvs1:/tmp/cvs-serv26823 Modified Files: Makefile setup.c Log Message: Migrated to new time. I even made a generic dallas PC sytle driver which also works with the old style drivers. Index: Makefile =================================================================== RCS file: /cvsroot/linux-mips/linux/arch/mips/cobalt/Makefile,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- Makefile 2001/10/24 18:53:29 1.6 +++ Makefile 2001/10/25 23:58:08 1.7 @@ -16,7 +16,7 @@ O_TARGET := cobalt.o -obj-y += rtc_qube.o irq.o int-handler.o pci_fixups.o pci_ops.o \ +obj-y += rtc_dallas.o rtc_qube.o irq.o int-handler.o pci_fixups.o pci_ops.o \ reset.o setup.o via.o promcon.o ide.o include $(TOPDIR)/Rules.make Index: setup.c =================================================================== RCS file: /cvsroot/linux-mips/linux/arch/mips/cobalt/setup.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- setup.c 2001/10/25 21:39:48 1.6 +++ setup.c 2001/10/25 23:58:08 1.7 @@ -18,6 +18,7 @@ #include <linux/ide.h> #include <asm/bootinfo.h> +#include <asm/time.h> #include <asm/io.h> #include <asm/irq.h> #include <asm/cobalt/cobalt.h> @@ -30,6 +31,8 @@ extern void cobalt_machine_halt(void); extern void cobalt_machine_power_off(void); +extern void rtc_dallas_init(unsigned long base); + extern struct rtc_ops cobalt_rtc_ops; extern struct ide_ops cobalt_ide_ops; @@ -84,8 +87,6 @@ VIA_PORT_WRITE(0xa1, 0x00); } -extern void (*board_time_init)(struct irqaction *irq); - #define GALILEO_T0_VAL 0xb4000850 #define GALILEO_TIMER_CTRL 0xb4000864 #define GALILEO_CPU_MASK 0xb4000c1c @@ -117,6 +118,20 @@ *((volatile unsigned long *) GALILEO_CPU_MASK) = (unsigned long) 0x00000100; } +static void __init cobalt_time_init(void) +{ + //mips_counter_frequency = 83000000; + + /* we have ds1396 RTC chip */ + rtc_dallas_init(0x70); + + /* optional: we don't have a good way to set RTC time, + * so we will hack here to set a time. In normal running. + * it should *not* be called becaues RTC will keep the correct time. + */ + /* rtc_set_time(mktime(2001, 10, 05, 17, 20, 0)); */ +} + int cobalt_serial_present; int cobalt_serial_type; int cobalt_is_raq; @@ -136,8 +151,10 @@ _machine_halt = cobalt_machine_halt; _machine_power_off = cobalt_machine_power_off; - board_time_init = cobalt_timer_setup; - rtc_ops = &cobalt_rtc_ops; + board_time_init = cobalt_time_init; + board_timer_setup = cobalt_timer_setup; + + rtc_ops = &cobalt_rtc_ops; #ifdef CONFIG_BLK_DEV_IDE ide_ops = &cobalt_ide_ops; #endif |