Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 326437
b: refs/heads/master
c: 487748c
h: refs/heads/master
i:
  326435: 645ecd1
v: v3
  • Loading branch information
Linus Walleij committed Sep 5, 2012
1 parent 058589c commit def4d60
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 70adc3f32adc2fb90b0107c020678588e4cf9f51
refs/heads/master: 487748ca3eea6f951185b4c5d0b0c02eea4d053b
24 changes: 12 additions & 12 deletions trunk/arch/arm/mach-ks8695/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,11 @@ static unsigned long ks8695_gettimeoffset (void)
* interrupt. We solve this by ensuring that the counter has not
* reloaded between our two reads.
*/
elapsed = __raw_readl(KS8695_TMR_VA + KS8695_T1TC) + __raw_readl(KS8695_TMR_VA + KS8695_T1PD);
elapsed = readl_relaxed(KS8695_TMR_VA + KS8695_T1TC) + readl_relaxed(KS8695_TMR_VA + KS8695_T1PD);
do {
tick2 = elapsed;
intpending = __raw_readl(KS8695_IRQ_VA + KS8695_INTST) & (1 << KS8695_IRQ_TIMER1);
elapsed = __raw_readl(KS8695_TMR_VA + KS8695_T1TC) + __raw_readl(KS8695_TMR_VA + KS8695_T1PD);
intpending = readl_relaxed(KS8695_IRQ_VA + KS8695_INTST) & (1 << KS8695_IRQ_TIMER1);
elapsed = readl_relaxed(KS8695_TMR_VA + KS8695_T1TC) + readl_relaxed(KS8695_TMR_VA + KS8695_T1PD);
} while (elapsed > tick2);

/* Convert to number of ticks expired (not remaining) */
Expand Down Expand Up @@ -106,14 +106,14 @@ static void ks8695_timer_setup(void)
unsigned long tmcon;

/* disable timer1 */
tmcon = __raw_readl(KS8695_TMR_VA + KS8695_TMCON);
__raw_writel(tmcon & ~TMCON_T1EN, KS8695_TMR_VA + KS8695_TMCON);
tmcon = readl_relaxed(KS8695_TMR_VA + KS8695_TMCON);
writel_relaxed(tmcon & ~TMCON_T1EN, KS8695_TMR_VA + KS8695_TMCON);

__raw_writel(tmout / 2, KS8695_TMR_VA + KS8695_T1TC);
__raw_writel(tmout / 2, KS8695_TMR_VA + KS8695_T1PD);
writel_relaxed(tmout / 2, KS8695_TMR_VA + KS8695_T1TC);
writel_relaxed(tmout / 2, KS8695_TMR_VA + KS8695_T1PD);

/* re-enable timer1 */
__raw_writel(tmcon | TMCON_T1EN, KS8695_TMR_VA + KS8695_TMCON);
writel_relaxed(tmcon | TMCON_T1EN, KS8695_TMR_VA + KS8695_TMCON);
}

static void __init ks8695_timer_init (void)
Expand All @@ -138,12 +138,12 @@ void ks8695_restart(char mode, const char *cmd)
soft_restart(0);

/* disable timer0 */
reg = __raw_readl(KS8695_TMR_VA + KS8695_TMCON);
__raw_writel(reg & ~TMCON_T0EN, KS8695_TMR_VA + KS8695_TMCON);
reg = readl_relaxed(KS8695_TMR_VA + KS8695_TMCON);
writel_relaxed(reg & ~TMCON_T0EN, KS8695_TMR_VA + KS8695_TMCON);

/* enable watchdog mode */
__raw_writel((10 << 8) | T0TC_WATCHDOG, KS8695_TMR_VA + KS8695_T0TC);
writel_relaxed((10 << 8) | T0TC_WATCHDOG, KS8695_TMR_VA + KS8695_T0TC);

/* re-enable timer0 */
__raw_writel(reg | TMCON_T0EN, KS8695_TMR_VA + KS8695_TMCON);
writel_relaxed(reg | TMCON_T0EN, KS8695_TMR_VA + KS8695_TMCON);
}

0 comments on commit def4d60

Please sign in to comment.