ARM: restart: iop3xx: use new restart hook
authorRussell King <rmk+kernel@arm.linux.org.uk>
Sat, 5 Nov 2011 11:26:32 +0000 (11:26 +0000)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Thu, 5 Jan 2012 12:57:13 +0000 (12:57 +0000)
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>
12 files changed:
arch/arm/include/asm/hardware/iop3xx.h
arch/arm/mach-iop32x/em7210.c
arch/arm/mach-iop32x/glantank.c
arch/arm/mach-iop32x/include/mach/system.h
arch/arm/mach-iop32x/iq31244.c
arch/arm/mach-iop32x/iq80321.c
arch/arm/mach-iop32x/n2100.c
arch/arm/mach-iop33x/include/mach/system.h
arch/arm/mach-iop33x/iq80331.c
arch/arm/mach-iop33x/iq80332.c
arch/arm/plat-iop/Makefile
arch/arm/plat-iop/restart.c [new file with mode: 0644]

index 5daea2961d48b42f34102697149ab505ea558b1e..077c32326c638755d5e195e1a5a9b09edfff2538 100644 (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)
 {
index 4325055d4e197cfd807d9f4b278b3476de83255f..24069e03fdc1d632154b3bf489461fbfde5621d2 100644 (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
index 0edc880205778a22eabc6850a37a4770a7e46a54..204e1d1cd7666f679742d8ace9d113c3bce34b11 100644 (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
index b4f83e5973b297df59cd36df8ef2daff62366d9e..44e46f2d57f41b5dc83a5a7d54035a4458971ddb 100644 (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);
 }
index 9e7aaccfeba0d6e1a0390d12bf6e7980733eeb6f..3eb642af1cdc261c1a43cb613b987078ed3b3823 100644 (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
index 53ea86f649dde55333a78c5f1481d062bdb93285..2ec724b58a2c109545600acb824e68b59563679e 100644 (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
index d7269279968c5522cfbc7e176329ef53d0f15dd6..6b6d55912444a4e6498465b87102b39bbb557722 100644 (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
index 86d1b20dd692e879d08a395e03e9a7b07d7a4664..696d88c0ef3150060b0552e07dee258323e154cf 100644 (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);
 }
index 9e14ccc56f8e405050f33851c864091be0f72906..abce934f38166069e535b37c921bf7e8c6925dab 100644 (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
index 09c899a2523f7a16b5dbbe8d857f3096722c5de6..7513559e25bbeed2c40b0ae2735731c164b37661 100644 (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
index 69b09c1cec8bc9f12b173a9d5a47421790f34589..f5aebfec4f2ad4c971b1e729878b82b2bba5c344 100644 (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
diff --git a/arch/arm/plat-iop/restart.c b/arch/arm/plat-iop/restart.c
new file mode 100644 (file)
index 0000000..6a85a0c
--- /dev/null
@@ -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);
+}
This page took 0.033202 seconds and 5 git commands to generate.