<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">| pm-time1.patch
|
| Fix to allow S3C2410 timer tick to resume
|
| Files affected:
|   arch/arm/mach-s3c2410/time.c |   19 	16 +	3 -	0 !
|   1 files changed, 16 insertions(+), 3 deletions(-)
|
| Ben Dooks, Thu, 07 Oct 2004 15:13:34 +0100

--- linux-2.6.9-rc3-bk5-rmktimer/arch/arm/mach-s3c2410/time.c	2004-10-05 22:00:15.000000000 +0100
+++ linux-2.6.9-rc3-bk5-rmktimer-pm1/arch/arm/mach-s3c2410/time.c	2004-10-06 02:10:31.000000000 +0100
@@ -98,13 +98,15 @@
 	.handler	= s3c2410_timer_interrupt
 };
 
+static int timer_irq_setup;
+
 /*
  * Set up timer interrupt, and return the current time in seconds.
  *
  * Currently we only use timer4, as it is the only timer which has no
  * other function that can be exploited externally
  */
-static void __init s3c2410_timer_init (void)
+static void s3c2410_timer_init (void)
 {
 	unsigned long tcon;
 	unsigned long tcnt;
@@ -115,7 +117,7 @@
 
 	/* read the current timer configuration bits */
 
-	tcon = __raw_readl(S3C2410_TCON);
+	tcon  = __raw_readl(S3C2410_TCON);
 	tcfg1 = __raw_readl(S3C2410_TCFG1);
 	tcfg0 = __raw_readl(S3C2410_TCFG0);
 
@@ -124,6 +126,9 @@
 	if (machine_is_bast() || machine_is_vr1000()) {
 		timer_ticks_usec = 12;	      /* timer is at 12MHz */
 		tcnt = (timer_ticks_usec * (1000*1000)) / HZ;
+
+		tcfg1 &amp;= ~S3C2410_TCFG1_MUX4_MASK;
+		tcfg1 |= S3C2410_TCFG1_MUX4_TCLK1;		
 	}
 
 	/* for the h1940, we use the pclk from the core to generate
@@ -175,15 +180,23 @@
 	__raw_writel(tcnt, S3C2410_TCNTB(4));
 	__raw_writel(tcnt, S3C2410_TCMPB(4));
 
-	setup_irq(IRQ_TIMER4, &amp;s3c2410_timer_irq);
+	if (!timer_irq_setup) {
+		setup_irq(IRQ_TIMER4, &amp;s3c2410_timer_irq);
+		timer_irq_setup = 1;
+	}
 
 	/* start the timer running */
 	tcon |= S3C2410_TCON_T4START;
 	tcon &amp;= ~S3C2410_TCON_T4MANUALUPD;
 	__raw_writel(tcon, S3C2410_TCON);
+
+	printk("setup timer: done\n");
 }
 
+
+
 struct sys_timer s3c2410_timer = {
 	.init		= s3c2410_timer_init,
 	.offset		= s3c2410_gettimeoffset,
+	.resume		= s3c2410_timer_init,
 };
</pre></body></html>