Skip to content

Commit

Permalink
ARM: restart: iop3xx: use new restart hook
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Russell King committed Jan 5, 2012
1 parent 6338b66 commit bec92b1
Show file tree
Hide file tree
Showing 12 changed files with 38 additions and 21 deletions.
1 change: 1 addition & 0 deletions arch/arm/include/asm/hardware/iop3xx.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
1 change: 1 addition & 0 deletions arch/arm/mach-iop32x/em7210.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 1 addition & 0 deletions arch/arm/mach-iop32x/glantank.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
15 changes: 0 additions & 15 deletions arch/arm/mach-iop32x/include/mach/system.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,11 @@
* 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();
}

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);
}
2 changes: 2 additions & 0 deletions arch/arm/mach-iop32x/iq31244.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
1 change: 1 addition & 0 deletions arch/arm/mach-iop32x/iq80321.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
9 changes: 9 additions & 0 deletions arch/arm/mach-iop32x/n2100.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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
6 changes: 0 additions & 6 deletions arch/arm/mach-iop33x/include/mach/system.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,11 @@
* 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();
}

static inline void arch_reset(char mode, const char *cmd)
{
*IOP3XX_PCSR = 0x30;

/* Jump into ROM at address 0 */
soft_restart(0);
}
1 change: 1 addition & 0 deletions arch/arm/mach-iop33x/iq80331.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 1 addition & 0 deletions arch/arm/mach-iop33x/iq80332.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 2 additions & 0 deletions arch/arm/plat-iop/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
19 changes: 19 additions & 0 deletions arch/arm/plat-iop/restart.c
Original file line number Diff line number Diff line change
@@ -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);
}

0 comments on commit bec92b1

Please sign in to comment.