[PATCH 2.6.11-mm1] mips: add spare timer init
From: Yoichi Yuasa
Date: Sun Mar 06 2005 - 18:30:05 EST
This patch adds spare timer initialization for NEC VR41xx.
Yoichi
Signed-off-by: Yoichi Yuasa <yuasa@xxxxxxxxxxxxxx>
diff -urN -X dontdiff a-orig/arch/mips/vr41xx/common/init.c a/arch/mips/vr41xx/common/init.c
--- a-orig/arch/mips/vr41xx/common/init.c Thu Mar 3 07:26:49 2005
+++ a/arch/mips/vr41xx/common/init.c Thu Mar 3 07:30:17 2005
@@ -19,9 +19,11 @@
*/
#include <linux/init.h>
#include <linux/ioport.h>
+#include <linux/irq.h>
#include <linux/string.h>
#include <asm/bootinfo.h>
+#include <asm/time.h>
#include <asm/vr41xx/vr41xx.h>
#define IO_MEM_RESOURCE_START 0UL
@@ -33,6 +35,29 @@
iomem_resource.end = IO_MEM_RESOURCE_END;
}
+static void __init setup_timer_frequency(void)
+{
+ unsigned long tclock;
+
+ tclock = vr41xx_get_tclock_frequency();
+ if (current_cpu_data.processor_id == PRID_VR4131_REV2_0 ||
+ current_cpu_data.processor_id == PRID_VR4131_REV2_1)
+ mips_hpt_frequency = tclock / 2;
+ else
+ mips_hpt_frequency = tclock / 4;
+}
+
+static void __init setup_timer_irq(struct irqaction *irq)
+{
+ setup_irq(TIMER_IRQ, irq);
+}
+
+static void __init timer_init(void)
+{
+ board_time_init = setup_timer_frequency;
+ board_timer_setup = setup_timer_irq;
+}
+
void __init prom_init(void)
{
int argc, i;
@@ -48,6 +73,8 @@
}
vr41xx_calculate_clock_frequency();
+
+ timer_init();
iomem_resource_init();
}
diff -urN -X dontdiff a-orig/include/asm-mips/vr41xx/vr41xx.h a/include/asm-mips/vr41xx/vr41xx.h
--- a-orig/include/asm-mips/vr41xx/vr41xx.h Thu Mar 3 07:26:49 2005
+++ a/include/asm-mips/vr41xx/vr41xx.h Thu Mar 3 07:29:10 2005
@@ -84,7 +84,7 @@
#define INT2_CASCADE_IRQ MIPS_CPU_IRQ(4)
#define INT3_CASCADE_IRQ MIPS_CPU_IRQ(5)
#define INT4_CASCADE_IRQ MIPS_CPU_IRQ(6)
-#define MIPS_COUNTER_IRQ MIPS_CPU_IRQ(7)
+#define TIMER_IRQ MIPS_CPU_IRQ(7)
/* SYINT1 Interrupt Numbers */
#define SYSINT1_IRQ_BASE 8
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/