summaryrefslogtreecommitdiff
path: root/arch/arm/mach-ks8695/time.c
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2012-01-05 13:25:15 +0000
committerRussell King <rmk+kernel@arm.linux.org.uk>2012-01-05 13:25:27 +0000
commit7b9dd47136c07ffd883aff6926c7b281e4c1eea4 (patch)
treeb835312e76fe323de3e1cbbb0d15fca5a3f7ef9c /arch/arm/mach-ks8695/time.c
parent2e0e943436912ffe0848ece58167edfe754edb96 (diff)
parent0575fb754dbfc32a01f297e778533340a533ec68 (diff)
Merge branch 'restart' into for-linus
Conflicts: arch/arm/mach-exynos/cpu.c The changes to arch/arm/mach-exynos/cpu.c were moved to mach-exynos/common.c.
Diffstat (limited to 'arch/arm/mach-ks8695/time.c')
-rw-r--r--arch/arm/mach-ks8695/time.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/arch/arm/mach-ks8695/time.c b/arch/arm/mach-ks8695/time.c
index 69c072c2c0f9..37dfcd5bd2ad 100644
--- a/arch/arm/mach-ks8695/time.c
+++ b/arch/arm/mach-ks8695/time.c
@@ -109,3 +109,21 @@ struct sys_timer ks8695_timer = {
.offset = ks8695_gettimeoffset,
.resume = ks8695_timer_setup,
};
+
+void ks8695_restart(char mode, const char *cmd)
+{
+ unsigned int reg;
+
+ if (mode == 's')
+ soft_restart(0);
+
+ /* disable timer0 */
+ reg = __raw_readl(KS8695_TMR_VA + KS8695_TMCON);
+ __raw_writel(reg & ~TMCON_T0EN, KS8695_TMR_VA + KS8695_TMCON);
+
+ /* enable watchdog mode */
+ __raw_writel((10 << 8) | T0TC_WATCHDOG, KS8695_TMR_VA + KS8695_T0TC);
+
+ /* re-enable timer0 */
+ __raw_writel(reg | TMCON_T0EN, KS8695_TMR_VA + KS8695_TMCON);
+}