Skip to content

Commit

Permalink
ARM: restart: ks8695: use new restart hook
Browse files Browse the repository at this point in the history
Hook these platforms restart code into the new restart hook rather
than using arch_reset().

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
  • Loading branch information
Russell King committed Jan 5, 2012
1 parent cb15dff commit 114c19b
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 17 deletions.
1 change: 1 addition & 0 deletions arch/arm/mach-ks8695/board-acs5k.c
Original file line number Diff line number Diff line change
Expand Up @@ -228,4 +228,5 @@ MACHINE_START(ACS5K, "Brivo Systems LLC ACS-5000 Master board")
.init_irq = ks8695_init_irq,
.init_machine = acs5k_init,
.timer = &ks8695_timer,
.restart = ks8695_restart,
MACHINE_END
1 change: 1 addition & 0 deletions arch/arm/mach-ks8695/board-dsm320.c
Original file line number Diff line number Diff line change
Expand Up @@ -126,4 +126,5 @@ MACHINE_START(DSM320, "D-Link DSM-320 Wireless Media Player")
.init_irq = ks8695_init_irq,
.init_machine = dsm320_init,
.timer = &ks8695_timer,
.restart = ks8695_restart,
MACHINE_END
1 change: 1 addition & 0 deletions arch/arm/mach-ks8695/board-micrel.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,5 @@ MACHINE_START(KS8695, "KS8695 Centaur Development Board")
.init_irq = ks8695_init_irq,
.init_machine = micrel_init,
.timer = &ks8695_timer,
.restart = ks8695_restart,
MACHINE_END
1 change: 1 addition & 0 deletions arch/arm/mach-ks8695/generic.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@

extern __init void ks8695_map_io(void);
extern __init void ks8695_init_irq(void);
extern void ks8695_restart(char, const char *);
extern struct sys_timer ks8695_timer;
17 changes: 0 additions & 17 deletions arch/arm/mach-ks8695/include/mach/system.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@
#ifndef __ASM_ARCH_SYSTEM_H
#define __ASM_ARCH_SYSTEM_H

#include <linux/io.h>
#include <mach/regs-timer.h>

static void arch_idle(void)
{
/*
Expand All @@ -29,20 +26,6 @@ static void arch_idle(void)

static void arch_reset(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);
}

#endif
18 changes: 18 additions & 0 deletions arch/arm/mach-ks8695/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

0 comments on commit 114c19b

Please sign in to comment.