1
0
Fork 0

ARM: restart: iop3xx: use new restart hook

Hook these platforms restart code into the arm_pm_restart hook rather
than using arch_reset().

In doing so, we split out the n2100 platform specific restart handler
into the n2100 platform file.

Acked-by: Lennert Buytenhek <buytenh@wantstofly.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
hifive-unleashed-5.1
Russell King 2011-11-05 11:26:32 +00:00
parent 6338b66f8a
commit bec92b1ec6
12 changed files with 38 additions and 21 deletions

View File

@ -234,6 +234,7 @@ extern int iop3xx_get_init_atu(void);
void iop3xx_map_io(void);
void iop_init_cp6_handler(void);
void iop_init_time(unsigned long tickrate);
void iop3xx_restart(char, const char *);
static inline u32 read_tmr0(void)
{

View File

@ -208,4 +208,5 @@ MACHINE_START(EM7210, "Lanner EM7210")
.init_irq = iop32x_init_irq,
.timer = &em7210_timer,
.init_machine = em7210_init_machine,
.restart = iop3xx_restart,
MACHINE_END

View File

@ -212,4 +212,5 @@ MACHINE_START(GLANTANK, "GLAN Tank")
.init_irq = iop32x_init_irq,
.timer = &glantank_timer,
.init_machine = glantank_init_machine,
.restart = iop3xx_restart,
MACHINE_END

View File

@ -7,10 +7,6 @@
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
#include <asm/mach-types.h>
#include <asm/hardware/iop3xx.h>
#include <mach/n2100.h>
static inline void arch_idle(void)
{
cpu_do_idle();
@ -18,15 +14,4 @@ static inline void arch_idle(void)
static inline void arch_reset(char mode, const char *cmd)
{
if (machine_is_n2100()) {
gpio_line_set(N2100_HARDWARE_RESET, GPIO_LOW);
gpio_line_config(N2100_HARDWARE_RESET, GPIO_OUT);
while (1)
;
}
*IOP3XX_PCSR = 0x30;
/* Jump into ROM at address 0 */
soft_restart(0);
}

View File

@ -318,6 +318,7 @@ MACHINE_START(IQ31244, "Intel IQ31244")
.init_irq = iop32x_init_irq,
.timer = &iq31244_timer,
.init_machine = iq31244_init_machine,
.restart = iop3xx_restart,
MACHINE_END
/* There should have been an ep80219 machine identifier from the beginning.
@ -332,4 +333,5 @@ MACHINE_START(EP80219, "Intel EP80219")
.init_irq = iop32x_init_irq,
.timer = &iq31244_timer,
.init_machine = iq31244_init_machine,
.restart = iop3xx_restart,
MACHINE_END

View File

@ -191,4 +191,5 @@ MACHINE_START(IQ80321, "Intel IQ80321")
.init_irq = iop32x_init_irq,
.timer = &iq80321_timer,
.init_machine = iq80321_init_machine,
.restart = iop3xx_restart,
MACHINE_END

View File

@ -291,6 +291,14 @@ static void n2100_power_off(void)
;
}
static void n2100_restart(char mode, const char *cmd)
{
gpio_line_set(N2100_HARDWARE_RESET, GPIO_LOW);
gpio_line_config(N2100_HARDWARE_RESET, GPIO_OUT);
while (1)
;
}
static struct timer_list power_button_poll_timer;
@ -332,4 +340,5 @@ MACHINE_START(N2100, "Thecus N2100")
.init_irq = iop32x_init_irq,
.timer = &n2100_timer,
.init_machine = n2100_init_machine,
.restart = n2100_restart,
MACHINE_END

View File

@ -7,8 +7,6 @@
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
#include <asm/hardware/iop3xx.h>
static inline void arch_idle(void)
{
cpu_do_idle();
@ -16,8 +14,4 @@ static inline void arch_idle(void)
static inline void arch_reset(char mode, const char *cmd)
{
*IOP3XX_PCSR = 0x30;
/* Jump into ROM at address 0 */
soft_restart(0);
}

View File

@ -146,4 +146,5 @@ MACHINE_START(IQ80331, "Intel IQ80331")
.init_irq = iop33x_init_irq,
.timer = &iq80331_timer,
.init_machine = iq80331_init_machine,
.restart = iop3xx_restart,
MACHINE_END

View File

@ -146,4 +146,5 @@ MACHINE_START(IQ80332, "Intel IQ80332")
.init_irq = iop33x_init_irq,
.timer = &iq80332_timer,
.init_machine = iq80332_init_machine,
.restart = iop3xx_restart,
MACHINE_END

View File

@ -14,6 +14,7 @@ obj-$(CONFIG_ARCH_IOP32X) += io.o
obj-$(CONFIG_ARCH_IOP32X) += cp6.o
obj-$(CONFIG_ARCH_IOP32X) += adma.o
obj-$(CONFIG_ARCH_IOP32X) += pmu.o
obj-$(CONFIG_ARCH_IOP32X) += restart.o
# IOP33X
obj-$(CONFIG_ARCH_IOP33X) += gpio.o
@ -25,6 +26,7 @@ obj-$(CONFIG_ARCH_IOP33X) += io.o
obj-$(CONFIG_ARCH_IOP33X) += cp6.o
obj-$(CONFIG_ARCH_IOP33X) += adma.o
obj-$(CONFIG_ARCH_IOP33X) += pmu.o
obj-$(CONFIG_ARCH_IOP33X) += restart.o
# IOP13XX
obj-$(CONFIG_ARCH_IOP13XX) += cp6.o

View File

@ -0,0 +1,19 @@
/*
* restart.c
*
* Copyright (C) 2001 MontaVista Software, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
#include <asm/hardware/iop3xx.h>
#include <mach/hardware.h>
void iop3xx_restart(char mode, const char *cmd)
{
*IOP3XX_PCSR = 0x30;
/* Jump into ROM at address 0 */
soft_restart(0);
}