* [PATCH 42/51] ARM: mach-u300: use arm_arch_reset instead of arch_reset
From: Will Deacon @ 2011-10-28 14:44 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1319813059-8914-1-git-send-email-will.deacon@arm.com>
This patch updates mach-u300 to use arm_arch_reset instead of
arch_reset.
Signed-off-by: Will Deacon <will.deacon@arm.com>
---
arch/arm/mach-u300/Makefile | 2 +-
arch/arm/mach-u300/include/mach/system.h | 26 +-----------------
arch/arm/mach-u300/reset.c | 42 ++++++++++++++++++++++++++++++
3 files changed, 44 insertions(+), 26 deletions(-)
create mode 100644 arch/arm/mach-u300/reset.c
diff --git a/arch/arm/mach-u300/Makefile b/arch/arm/mach-u300/Makefile
index 8fd354a..599f4eb 100644
--- a/arch/arm/mach-u300/Makefile
+++ b/arch/arm/mach-u300/Makefile
@@ -2,7 +2,7 @@
# Makefile for the linux kernel, U300 machine.
#
-obj-y := core.o clock.o timer.o padmux.o
+obj-y := core.o clock.o timer.o padmux.o reset.o
obj-m :=
obj-n :=
obj- :=
diff --git a/arch/arm/mach-u300/include/mach/system.h b/arch/arm/mach-u300/include/mach/system.h
index 8daf136..0ddf3cd 100644
--- a/arch/arm/mach-u300/include/mach/system.h
+++ b/arch/arm/mach-u300/include/mach/system.h
@@ -8,35 +8,11 @@
* System shutdown and reset functions.
* Author: Linus Walleij <linus.walleij@stericsson.com>
*/
-#include <mach/hardware.h>
-#include <asm/io.h>
-#include <asm/hardware/vic.h>
-#include <asm/irq.h>
-
-/* Forward declare this function from the watchdog */
-void coh901327_watchdog_reset(void);
-
static inline void arch_idle(void)
{
cpu_do_idle();
}
-static void arch_reset(char mode, const char *cmd)
+static inline void arch_reset(char mode, const char *cmd)
{
- switch (mode) {
- case 's':
- case 'h':
- printk(KERN_CRIT "RESET: shutting down/rebooting system\n");
- /* Disable interrupts */
- local_irq_disable();
-#ifdef CONFIG_COH901327_WATCHDOG
- coh901327_watchdog_reset();
-#endif
- break;
- default:
- /* Do nothing */
- break;
- }
- /* Wait for system do die/reset. */
- while (1);
}
diff --git a/arch/arm/mach-u300/reset.c b/arch/arm/mach-u300/reset.c
new file mode 100644
index 0000000..607e7f8
--- /dev/null
+++ b/arch/arm/mach-u300/reset.c
@@ -0,0 +1,42 @@
+/*
+ * arch/arm/mach-u300/reset.c
+ */
+
+#include <linux/init.h>
+#include <linux/kernel.h>
+
+#include <mach/hardware.h>
+
+#include <asm/io.h>
+#include <asm/hardware/vic.h>
+#include <asm/irq.h>
+
+/* Forward declare this function from the watchdog */
+void coh901327_watchdog_reset(void);
+
+static void u300_arch_reset(char mode, const char *cmd)
+{
+ switch (mode) {
+ case 's':
+ case 'h':
+ printk(KERN_CRIT "RESET: shutting down/rebooting system\n");
+ /* Disable interrupts */
+ local_irq_disable();
+#ifdef CONFIG_COH901327_WATCHDOG
+ coh901327_watchdog_reset();
+#endif
+ break;
+ default:
+ /* Do nothing */
+ break;
+ }
+ /* Wait for system do die/reset. */
+ while (1);
+}
+
+static int __init u300_arch_reset_init(void)
+{
+ arm_arch_reset = u300_arch_reset;
+ return 0;
+}
+arch_initcall(u300_arch_reset_init);
--
1.7.4.1
^ permalink raw reply related
* [PATCH 41/51] ARM: mach-tegra: use arm_arch_reset instead of arch_reset
From: Will Deacon @ 2011-10-28 14:44 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1319813059-8914-1-git-send-email-will.deacon@arm.com>
This patch updates mach-tegra to use arm_arch_reset instead of
arch_reset.
Signed-off-by: Will Deacon <will.deacon@arm.com>
---
arch/arm/mach-tegra/common.c | 4 ++--
arch/arm/mach-tegra/include/mach/system.h | 6 +++---
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/arch/arm/mach-tegra/common.c b/arch/arm/mach-tegra/common.c
index d5e3f89..aaf85c6 100644
--- a/arch/arm/mach-tegra/common.c
+++ b/arch/arm/mach-tegra/common.c
@@ -31,8 +31,6 @@
#include "clock.h"
#include "fuse.h"
-void (*arch_reset)(char mode, const char *cmd) = tegra_assert_system_reset;
-
void tegra_assert_system_reset(char mode, const char *cmd)
{
void __iomem *reset = IO_ADDRESS(TEGRA_CLK_RESET_BASE + 0x04);
@@ -80,4 +78,6 @@ void __init tegra_init_early(void)
tegra_init_clock();
tegra_clk_init_from_table(common_clk_init_table);
tegra_init_cache();
+
+ arm_arch_reset = tegra_assert_system_reset;
}
diff --git a/arch/arm/mach-tegra/include/mach/system.h b/arch/arm/mach-tegra/include/mach/system.h
index 027c421..b87b8a4 100644
--- a/arch/arm/mach-tegra/include/mach/system.h
+++ b/arch/arm/mach-tegra/include/mach/system.h
@@ -21,9 +21,9 @@
#ifndef __MACH_TEGRA_SYSTEM_H
#define __MACH_TEGRA_SYSTEM_H
-#include <mach/iomap.h>
-
-extern void (*arch_reset)(char mode, const char *cmd);
+static inline void arch_reset(char mode, const char *cmd)
+{
+}
static inline void arch_idle(void)
{
--
1.7.4.1
^ permalink raw reply related
* [PATCH 40/51] ARM: mach-shmobile: use arm_arch_reset instead of arch_reset
From: Will Deacon @ 2011-10-28 14:44 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1319813059-8914-1-git-send-email-will.deacon@arm.com>
This patch updates mach-shmobile to use arm_arch_reset instead of
arch_reset.
Signed-off-by: Will Deacon <will.deacon@arm.com>
---
arch/arm/mach-shmobile/Makefile | 2 +-
arch/arm/mach-shmobile/include/mach/system.h | 1 -
arch/arm/mach-shmobile/reset.c | 18 ++++++++++++++++++
3 files changed, 19 insertions(+), 2 deletions(-)
create mode 100644 arch/arm/mach-shmobile/reset.c
diff --git a/arch/arm/mach-shmobile/Makefile b/arch/arm/mach-shmobile/Makefile
index 612b270..8f12b57 100644
--- a/arch/arm/mach-shmobile/Makefile
+++ b/arch/arm/mach-shmobile/Makefile
@@ -3,7 +3,7 @@
#
# Common objects
-obj-y := timer.o console.o clock.o pm_runtime.o
+obj-y := timer.o console.o clock.o pm_runtime.o reset.o
# CPU objects
obj-$(CONFIG_ARCH_SH7367) += setup-sh7367.o clock-sh7367.o intc-sh7367.o
diff --git a/arch/arm/mach-shmobile/include/mach/system.h b/arch/arm/mach-shmobile/include/mach/system.h
index 76a687e..4f2bea5 100644
--- a/arch/arm/mach-shmobile/include/mach/system.h
+++ b/arch/arm/mach-shmobile/include/mach/system.h
@@ -8,7 +8,6 @@ static inline void arch_idle(void)
static inline void arch_reset(char mode, const char *cmd)
{
- cpu_reset(0);
}
#endif
diff --git a/arch/arm/mach-shmobile/reset.c b/arch/arm/mach-shmobile/reset.c
new file mode 100644
index 0000000..ab53fb9
--- /dev/null
+++ b/arch/arm/mach-shmobile/reset.c
@@ -0,0 +1,18 @@
+/*
+ * arch/arm/mach-shmobile/reset.c
+ */
+
+#include <linux/init.h>
+#include <asm/proc-fns.h>
+
+static void shmobile_arch_reset(char mode, const char *cmd)
+{
+ cpu_reset(0);
+}
+
+static int __init shmobile_arch_reset_init(void)
+{
+ arm_arch_reset = shmobile_arch_reset;
+ return 0;
+}
+arch_initcall(shmobile_arch_reset_init);
--
1.7.4.1
^ permalink raw reply related
* [PATCH 39/51] ARM: mach-shark: use arm_arch_reset instead of arch_reset
From: Will Deacon @ 2011-10-28 14:44 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1319813059-8914-1-git-send-email-will.deacon@arm.com>
This patch updates mach-shark to use arm_arch_reset instead of
arch_reset.
Signed-off-by: Will Deacon <will.deacon@arm.com>
---
arch/arm/mach-shark/core.c | 5 ++++-
arch/arm/mach-shark/include/mach/system.h | 5 +++--
2 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/arch/arm/mach-shark/core.c b/arch/arm/mach-shark/core.c
index ac2873c..bbe4fc5 100644
--- a/arch/arm/mach-shark/core.c
+++ b/arch/arm/mach-shark/core.c
@@ -26,7 +26,7 @@
#define ROMCARD_SIZE 0x08000000
#define ROMCARD_START 0x10000000
-void arch_reset(char mode, const char *cmd)
+static void shark_arch_reset(char mode, const char *cmd)
{
short temp;
local_irq_disable();
@@ -97,6 +97,9 @@ static int __init shark_init(void)
ret = platform_device_register(&serial_device);
if (ret) printk(KERN_ERR "Unable to register Serial device: %d\n", ret);
}
+
+ arm_arch_reset = shark_arch_reset;
+
return 0;
}
diff --git a/arch/arm/mach-shark/include/mach/system.h b/arch/arm/mach-shark/include/mach/system.h
index 21c373b..2cc363a 100644
--- a/arch/arm/mach-shark/include/mach/system.h
+++ b/arch/arm/mach-shark/include/mach/system.h
@@ -6,8 +6,9 @@
#ifndef __ASM_ARCH_SYSTEM_H
#define __ASM_ARCH_SYSTEM_H
-/* Found in arch/mach-shark/core.c */
-extern void arch_reset(char mode, const char *cmd);
+static inline void arch_reset(char mode, const char *cmd)
+{
+}
static inline void arch_idle(void)
{
--
1.7.4.1
^ permalink raw reply related
* [PATCH 38/51] ARM: mach-sa1100: use arm_arch_reset instead of arch_reset
From: Will Deacon @ 2011-10-28 14:44 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1319813059-8914-1-git-send-email-will.deacon@arm.com>
This patch updates mach-sa1100 to use arm_arch_reset instead of
arch_reset.
Signed-off-by: Will Deacon <will.deacon@arm.com>
---
arch/arm/mach-sa1100/generic.c | 13 +++++++++++++
arch/arm/mach-sa1100/include/mach/system.h | 8 --------
2 files changed, 13 insertions(+), 8 deletions(-)
diff --git a/arch/arm/mach-sa1100/generic.c b/arch/arm/mach-sa1100/generic.c
index e21f347..fb49654 100644
--- a/arch/arm/mach-sa1100/generic.c
+++ b/arch/arm/mach-sa1100/generic.c
@@ -25,6 +25,7 @@
#include <asm/mach/flash.h>
#include <asm/irq.h>
#include <asm/gpio.h>
+#include <asm/proc-fns.h>
#include "generic.h"
@@ -126,6 +127,17 @@ static void sa1100_power_off(void)
PMCR = PMCR_SF;
}
+static void sa1100_arch_reset(char mode, const char *cmd)
+{
+ if (mode == 's') {
+ /* Jump into ROM at address 0 */
+ cpu_reset(0);
+ } else {
+ /* Use on-chip reset capability */
+ RSRR = RSRR_SWR;
+ }
+}
+
static void sa11x0_register_device(struct platform_device *dev, void *data)
{
int err;
@@ -351,6 +363,7 @@ static struct platform_device *sa11x0_devices[] __initdata = {
static int __init sa1100_init(void)
{
+ arm_arch_reset = sa1100_arch_reset;
pm_power_off = sa1100_power_off;
return platform_add_devices(sa11x0_devices, ARRAY_SIZE(sa11x0_devices));
}
diff --git a/arch/arm/mach-sa1100/include/mach/system.h b/arch/arm/mach-sa1100/include/mach/system.h
index ba9da9f..ac3bdb8 100644
--- a/arch/arm/mach-sa1100/include/mach/system.h
+++ b/arch/arm/mach-sa1100/include/mach/system.h
@@ -3,7 +3,6 @@
*
* Copyright (c) 1999 Nicolas Pitre <nico@fluxnic.net>
*/
-#include <mach/hardware.h>
static inline void arch_idle(void)
{
@@ -12,11 +11,4 @@ static inline void arch_idle(void)
static inline void arch_reset(char mode, const char *cmd)
{
- if (mode == 's') {
- /* Jump into ROM at address 0 */
- cpu_reset(0);
- } else {
- /* Use on-chip reset capability */
- RSRR = RSRR_SWR;
- }
}
--
1.7.4.1
^ permalink raw reply related
* [PATCH 37/51] ARM: mach-s3c64xx: use arm_arch_reset instead of arch_reset
From: Will Deacon @ 2011-10-28 14:44 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1319813059-8914-1-git-send-email-will.deacon@arm.com>
This patch updates mach-s3c64xx to use arm_arch_reset instead of
arch_reset.
Signed-off-by: Will Deacon <will.deacon@arm.com>
---
arch/arm/mach-s3c64xx/Makefile | 1 +
arch/arm/mach-s3c64xx/include/mach/system.h | 7 -------
arch/arm/mach-s3c64xx/reset.c | 26 ++++++++++++++++++++++++++
3 files changed, 27 insertions(+), 7 deletions(-)
create mode 100644 arch/arm/mach-s3c64xx/reset.c
diff --git a/arch/arm/mach-s3c64xx/Makefile b/arch/arm/mach-s3c64xx/Makefile
index 61b4034..ba2f2ac 100644
--- a/arch/arm/mach-s3c64xx/Makefile
+++ b/arch/arm/mach-s3c64xx/Makefile
@@ -14,6 +14,7 @@ obj- :=
obj-y += cpu.o
obj-y += clock.o
obj-y += gpiolib.o
+obj-y += reset.o
# Core support for S3C6400 system
diff --git a/arch/arm/mach-s3c64xx/include/mach/system.h b/arch/arm/mach-s3c64xx/include/mach/system.h
index 2e58cb7..51bc8eb 100644
--- a/arch/arm/mach-s3c64xx/include/mach/system.h
+++ b/arch/arm/mach-s3c64xx/include/mach/system.h
@@ -11,8 +11,6 @@
#ifndef __ASM_ARCH_SYSTEM_H
#define __ASM_ARCH_SYSTEM_H __FILE__
-#include <plat/watchdog-reset.h>
-
static void arch_idle(void)
{
/* nothing here yet */
@@ -20,11 +18,6 @@ static void arch_idle(void)
static void arch_reset(char mode, const char *cmd)
{
- if (mode != 's')
- arch_wdt_reset();
-
- /* if all else fails, or mode was for soft, jump to 0 */
- cpu_reset(0);
}
#endif /* __ASM_ARCH_IRQ_H */
diff --git a/arch/arm/mach-s3c64xx/reset.c b/arch/arm/mach-s3c64xx/reset.c
new file mode 100644
index 0000000..2ea710c
--- /dev/null
+++ b/arch/arm/mach-s3c64xx/reset.c
@@ -0,0 +1,26 @@
+/*
+ * arch/arm/mach-s3c64xx/reset.c
+ */
+
+#include <linux/delay.h>
+#include <linux/init.h>
+
+#include <plat/watchdog-reset.h>
+
+#include <asm/proc-fns.h>
+
+static void s3c64xx_arch_reset(char mode, const char *cmd)
+{
+ if (mode != 's')
+ arch_wdt_reset();
+
+ /* if all else fails, or mode was for soft, jump to 0 */
+ cpu_reset(0);
+}
+
+static int __init s3c64xx_arch_reset_init(void)
+{
+ arm_arch_reset = s3c64xx_arch_reset;
+ return 0;
+}
+arch_initcall(s3c64xx_arch_reset_init);
--
1.7.4.1
^ permalink raw reply related
* [PATCH 36/51] ARM: mach-rpc: use arm_arch_reset instead of arch_reset
From: Will Deacon @ 2011-10-28 14:44 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1319813059-8914-1-git-send-email-will.deacon@arm.com>
This patch updates mach-rpc to use arm_arch_reset instead of
arch_reset.
Signed-off-by: Will Deacon <will.deacon@arm.com>
---
arch/arm/mach-rpc/include/mach/system.h | 10 ----------
arch/arm/mach-rpc/riscpc.c | 14 ++++++++++++++
2 files changed, 14 insertions(+), 10 deletions(-)
diff --git a/arch/arm/mach-rpc/include/mach/system.h b/arch/arm/mach-rpc/include/mach/system.h
index 45c7b93..e9fb593 100644
--- a/arch/arm/mach-rpc/include/mach/system.h
+++ b/arch/arm/mach-rpc/include/mach/system.h
@@ -7,10 +7,6 @@
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
-#include <linux/io.h>
-#include <mach/hardware.h>
-#include <asm/hardware/iomd.h>
-
static inline void arch_idle(void)
{
cpu_do_idle();
@@ -18,10 +14,4 @@ static inline void arch_idle(void)
static inline void arch_reset(char mode, const char *cmd)
{
- iomd_writeb(0, IOMD_ROMCR0);
-
- /*
- * Jump into the ROM
- */
- cpu_reset(0);
}
diff --git a/arch/arm/mach-rpc/riscpc.c b/arch/arm/mach-rpc/riscpc.c
index 580b3c7..2d9ac6e 100644
--- a/arch/arm/mach-rpc/riscpc.c
+++ b/arch/arm/mach-rpc/riscpc.c
@@ -25,9 +25,12 @@
#include <asm/mach-types.h>
#include <mach/hardware.h>
#include <asm/page.h>
+#include <asm/proc-fns.h>
#include <asm/domain.h>
#include <asm/setup.h>
+#include <asm/hardware/iomd.h>
+
#include <asm/mach/map.h>
#include <asm/mach/arch.h>
#include <asm/mach/time.h>
@@ -206,9 +209,20 @@ static struct i2c_board_info i2c_rtc = {
I2C_BOARD_INFO("pcf8583", 0x50)
};
+static void rpc_arch_reset(char mode, const char *cmd)
+{
+ iomd_writeb(0, IOMD_ROMCR0);
+
+ /*
+ * Jump into the ROM
+ */
+ cpu_reset(0);
+}
+
static int __init rpc_init(void)
{
i2c_register_board_info(0, &i2c_rtc, 1);
+ arm_arch_reset = rpc_arch_reset;
return platform_add_devices(devs, ARRAY_SIZE(devs));
}
--
1.7.4.1
^ permalink raw reply related
* [PATCH 35/51] ARM: mach-realview: use arm_arch_reset instead of arch_reset
From: Will Deacon @ 2011-10-28 14:44 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1319813059-8914-1-git-send-email-will.deacon@arm.com>
This patch updates mach-realview to use arm_arch_reset instead of
arch_reset.
Signed-off-by: Will Deacon <will.deacon@arm.com>
---
arch/arm/mach-realview/core.c | 20 ++++++++++++++++++++
arch/arm/mach-realview/include/mach/system.h | 13 -------------
2 files changed, 20 insertions(+), 13 deletions(-)
diff --git a/arch/arm/mach-realview/core.c b/arch/arm/mach-realview/core.c
index 5c23450..96b6f75 100644
--- a/arch/arm/mach-realview/core.c
+++ b/arch/arm/mach-realview/core.c
@@ -534,3 +534,23 @@ void realview_fixup(struct machine_desc *mdesc, struct tag *tags, char **from,
meminfo->nr_banks = 1;
#endif
}
+
+void (*realview_reset)(char mode);
+
+static void realview_arch_reset(char mode, const char *cmd)
+{
+ /*
+ * To reset, we hit the on-board reset register
+ * in the system FPGA
+ */
+ if (realview_reset)
+ realview_reset(mode);
+ dsb();
+}
+
+static int __init realview_arch_reset_init(void)
+{
+ arm_arch_reset = realview_arch_reset;
+ return 0;
+}
+arch_initcall(realview_arch_reset_init);
diff --git a/arch/arm/mach-realview/include/mach/system.h b/arch/arm/mach-realview/include/mach/system.h
index 6657ff23..1630766 100644
--- a/arch/arm/mach-realview/include/mach/system.h
+++ b/arch/arm/mach-realview/include/mach/system.h
@@ -21,12 +21,6 @@
#ifndef __ASM_ARCH_SYSTEM_H
#define __ASM_ARCH_SYSTEM_H
-#include <linux/io.h>
-#include <mach/hardware.h>
-#include <mach/platform.h>
-
-void (*realview_reset)(char mode);
-
static inline void arch_idle(void)
{
/*
@@ -38,13 +32,6 @@ static inline void arch_idle(void)
static inline void arch_reset(char mode, const char *cmd)
{
- /*
- * To reset, we hit the on-board reset register
- * in the system FPGA
- */
- if (realview_reset)
- realview_reset(mode);
- dsb();
}
#endif
--
1.7.4.1
^ permalink raw reply related
* [PATCH 34/51] ARM: mach-pxa: use arm_arch_reset instead of arch_reset
From: Will Deacon @ 2011-10-28 14:44 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1319813059-8914-1-git-send-email-will.deacon@arm.com>
This patch updates mach-pxa to use arm_arch_reset instead of
arch_reset.
Signed-off-by: Will Deacon <will.deacon@arm.com>
---
arch/arm/mach-pxa/include/mach/system.h | 6 +++---
arch/arm/mach-pxa/reset.c | 8 +++++++-
2 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/arch/arm/mach-pxa/include/mach/system.h b/arch/arm/mach-pxa/include/mach/system.h
index d1fce8b..0687110 100644
--- a/arch/arm/mach-pxa/include/mach/system.h
+++ b/arch/arm/mach-pxa/include/mach/system.h
@@ -11,8 +11,6 @@
*/
#include <asm/proc-fns.h>
-#include "hardware.h"
-#include "pxa2xx-regs.h"
static inline void arch_idle(void)
{
@@ -20,4 +18,6 @@ static inline void arch_idle(void)
}
-void arch_reset(char mode, const char *cmd);
+static inline void arch_reset(char mode, const char *cmd)
+{
+}
diff --git a/arch/arm/mach-pxa/reset.c b/arch/arm/mach-pxa/reset.c
index 01e9d64..075598a 100644
--- a/arch/arm/mach-pxa/reset.c
+++ b/arch/arm/mach-pxa/reset.c
@@ -81,7 +81,7 @@ static void do_hw_reset(void)
OSMR3 = OSCR + 368640; /* ... in 100 ms */
}
-void arch_reset(char mode, const char *cmd)
+static void pxa_arch_reset(char mode, const char *cmd)
{
clear_reset_status(RESET_STATUS_ALL);
@@ -100,3 +100,9 @@ void arch_reset(char mode, const char *cmd)
}
}
+static int __init pxa_arch_reset_init(void)
+{
+ arm_arch_reset = pxa_arch_reset;
+ return 0;
+}
+arch_initcall(pxa_arch_reset_init);
--
1.7.4.1
^ permalink raw reply related
* [PATCH 33/51] ARM: mach-prima2: use arm_arch_reset instead of arch_reset
From: Will Deacon @ 2011-10-28 14:44 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1319813059-8914-1-git-send-email-will.deacon@arm.com>
This patch updates mach-prima2 to use arm_arch_reset instead of
arch_reset.
Signed-off-by: Will Deacon <will.deacon@arm.com>
---
arch/arm/mach-prima2/Makefile | 1 +
arch/arm/mach-prima2/include/mach/system.h | 6 ------
arch/arm/mach-prima2/reset.c | 22 ++++++++++++++++++++++
3 files changed, 23 insertions(+), 6 deletions(-)
create mode 100644 arch/arm/mach-prima2/reset.c
diff --git a/arch/arm/mach-prima2/Makefile b/arch/arm/mach-prima2/Makefile
index 7af7fc0..75a7127 100644
--- a/arch/arm/mach-prima2/Makefile
+++ b/arch/arm/mach-prima2/Makefile
@@ -2,6 +2,7 @@ obj-y := timer.o
obj-y += irq.o
obj-y += clock.o
obj-y += rstc.o
+obj-y += reset.o
obj-y += prima2.o
obj-$(CONFIG_DEBUG_LL) += lluart.o
obj-$(CONFIG_CACHE_L2X0) += l2x0.o
diff --git a/arch/arm/mach-prima2/include/mach/system.h b/arch/arm/mach-prima2/include/mach/system.h
index 0dbd257..1d14a77 100644
--- a/arch/arm/mach-prima2/include/mach/system.h
+++ b/arch/arm/mach-prima2/include/mach/system.h
@@ -9,11 +9,6 @@
#ifndef __MACH_SYSTEM_H__
#define __MACH_SYSTEM_H__
-#include <linux/bitops.h>
-#include <mach/hardware.h>
-
-#define SIRFSOC_SYS_RST_BIT BIT(31)
-
extern void __iomem *sirfsoc_rstc_base;
static inline void arch_idle(void)
@@ -23,7 +18,6 @@ static inline void arch_idle(void)
static inline void arch_reset(char mode, const char *cmd)
{
- writel(SIRFSOC_SYS_RST_BIT, sirfsoc_rstc_base);
}
#endif
diff --git a/arch/arm/mach-prima2/reset.c b/arch/arm/mach-prima2/reset.c
new file mode 100644
index 0000000..5473ae8
--- /dev/null
+++ b/arch/arm/mach-prima2/reset.c
@@ -0,0 +1,22 @@
+/*
+ * arch/arm/mach-prima2/reset.c
+ */
+
+#include <linux/init.h>
+#include <linux/bitops.h>
+#include <mach/hardware.h>
+#include <asm/system.h>
+
+#define SIRFSOC_SYS_RST_BIT BIT(31)
+
+static void prima2_arch_reset(char mode, const char *cmd)
+{
+ writel(SIRFSOC_SYS_RST_BIT, sirfsoc_rstc_base);
+}
+
+static int __init prima2_arch_reset_init(void)
+{
+ arm_arch_reset = prima2_arch_reset;
+ return 0;
+}
+arch_initcall(prima2_arch_reset_init);
--
1.7.4.1
^ permalink raw reply related
* [PATCH 32/51] ARM: mach-pnx4008: use arm_arch_reset instead of arch_reset
From: Will Deacon @ 2011-10-28 14:44 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1319813059-8914-1-git-send-email-will.deacon@arm.com>
This patch updates mach-pnx4008 to use arm_arch_reset instead of
arch_reset.
Signed-off-by: Will Deacon <will.deacon@arm.com>
---
arch/arm/mach-pnx4008/core.c | 6 ++++++
arch/arm/mach-pnx4008/include/mach/system.h | 5 -----
2 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/arch/arm/mach-pnx4008/core.c b/arch/arm/mach-pnx4008/core.c
index 6339975..7184172 100644
--- a/arch/arm/mach-pnx4008/core.c
+++ b/arch/arm/mach-pnx4008/core.c
@@ -32,6 +32,7 @@
#include <asm/mach-types.h>
#include <asm/pgtable.h>
#include <asm/page.h>
+#include <asm/proc-fns.h>
#include <asm/system.h>
#include <asm/mach/arch.h>
@@ -208,6 +209,10 @@ static struct platform_device *devices[] __initdata = {
&watchdog_device,
};
+static void pnx4008_arch_reset(char mode, const char *cmd)
+{
+ cpu_reset(0);
+}
extern void pnx4008_uart_init(void);
@@ -224,6 +229,7 @@ static void __init pnx4008_init(void)
spi_register_board_info(spi_board_info, ARRAY_SIZE(spi_board_info));
/* Switch on the UART clocks */
pnx4008_uart_init();
+ arm_arch_reset = pnx4008_arch_reset;
}
static struct map_desc pnx4008_io_desc[] __initdata = {
diff --git a/arch/arm/mach-pnx4008/include/mach/system.h b/arch/arm/mach-pnx4008/include/mach/system.h
index 5dda2bb..6710ed3 100644
--- a/arch/arm/mach-pnx4008/include/mach/system.h
+++ b/arch/arm/mach-pnx4008/include/mach/system.h
@@ -21,10 +21,6 @@
#ifndef __ASM_ARCH_SYSTEM_H
#define __ASM_ARCH_SYSTEM_H
-#include <linux/io.h>
-#include <mach/hardware.h>
-#include <mach/platform.h>
-
static void arch_idle(void)
{
cpu_do_idle();
@@ -32,7 +28,6 @@ static void arch_idle(void)
static inline void arch_reset(char mode, const char *cmd)
{
- cpu_reset(0);
}
#endif
--
1.7.4.1
^ permalink raw reply related
* [PATCH 31/51] ARM: mach-orion5x: use arm_arch_reset instead of arch_reset
From: Will Deacon @ 2011-10-28 14:43 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1319813059-8914-1-git-send-email-will.deacon@arm.com>
This patch updates mach-orion5x to use arm_arch_reset instead of
arch_reset.
Signed-off-by: Will Deacon <will.deacon@arm.com>
---
arch/arm/mach-orion5x/common.c | 17 +++++++++++++++++
arch/arm/mach-orion5x/include/mach/system.h | 8 --------
2 files changed, 17 insertions(+), 8 deletions(-)
diff --git a/arch/arm/mach-orion5x/common.c b/arch/arm/mach-orion5x/common.c
index 0ab531d..557e4eb 100644
--- a/arch/arm/mach-orion5x/common.c
+++ b/arch/arm/mach-orion5x/common.c
@@ -13,6 +13,7 @@
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/platform_device.h>
+#include <linux/delay.h>
#include <linux/dma-mapping.h>
#include <linux/serial_8250.h>
#include <linux/mbus.h>
@@ -268,6 +269,17 @@ static void __init orion5x_id(u32 *dev, u32 *rev, char **dev_name)
}
}
+static void orion5x_arch_reset(char mode, const char *cmd)
+{
+ /*
+ * Enable and issue soft reset
+ */
+ orion5x_setbits(RSTOUTn_MASK, (1 << 2));
+ orion5x_setbits(CPU_SOFT_RESET, 1);
+ mdelay(200);
+ orion5x_clrbits(CPU_SOFT_RESET, 1);
+}
+
void __init orion5x_init(void)
{
char *dev_name;
@@ -302,6 +314,11 @@ void __init orion5x_init(void)
* Register watchdog driver
*/
orion5x_wdt_init();
+
+ /*
+ * Assign reset hook.
+ */
+ arm_arch_reset = orion5x_arch_reset;
}
/*
diff --git a/arch/arm/mach-orion5x/include/mach/system.h b/arch/arm/mach-orion5x/include/mach/system.h
index a1d6e46..91a933c 100644
--- a/arch/arm/mach-orion5x/include/mach/system.h
+++ b/arch/arm/mach-orion5x/include/mach/system.h
@@ -20,14 +20,6 @@ static inline void arch_idle(void)
static inline void arch_reset(char mode, const char *cmd)
{
- /*
- * Enable and issue soft reset
- */
- orion5x_setbits(RSTOUTn_MASK, (1 << 2));
- orion5x_setbits(CPU_SOFT_RESET, 1);
- mdelay(200);
- orion5x_clrbits(CPU_SOFT_RESET, 1);
}
-
#endif
--
1.7.4.1
^ permalink raw reply related
* [PATCH 30/51] ARM: mach-nuc93x: use arm_arch_reset instead of arch_reset
From: Will Deacon @ 2011-10-28 14:43 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1319813059-8914-1-git-send-email-will.deacon@arm.com>
This patch updates mach-nuc93x to use arm_arch_reset instead of
arch_reset.
Signed-off-by: Will Deacon <will.deacon@arm.com>
---
arch/arm/mach-nuc93x/cpu.c | 12 ++++++++++++
arch/arm/mach-nuc93x/include/mach/system.h | 6 +-----
2 files changed, 13 insertions(+), 5 deletions(-)
diff --git a/arch/arm/mach-nuc93x/cpu.c b/arch/arm/mach-nuc93x/cpu.c
index f6ff5d8..ccd7818 100644
--- a/arch/arm/mach-nuc93x/cpu.c
+++ b/arch/arm/mach-nuc93x/cpu.c
@@ -28,6 +28,7 @@
#include <asm/mach/map.h>
#include <asm/mach/irq.h>
#include <asm/irq.h>
+#include <asm/proc-fns.h>
#include <mach/hardware.h>
#include <mach/regs-serial.h>
@@ -133,3 +134,14 @@ void __init nuc93x_init_clocks(void)
clks_register(nuc932_clkregs, ARRAY_SIZE(nuc932_clkregs));
}
+static void nuc93x_arch_reset(char mode, const char *cmd)
+{
+ cpu_reset(0);
+}
+
+static int __init nuc93x_arch_reset_init(void)
+{
+ arm_arch_reset = nuc93x_arch_reset;
+ return 0;
+}
+arch_initcall(nuc93x_arch_reset_init);
diff --git a/arch/arm/mach-nuc93x/include/mach/system.h b/arch/arm/mach-nuc93x/include/mach/system.h
index d26bd9a..a4d39a3 100644
--- a/arch/arm/mach-nuc93x/include/mach/system.h
+++ b/arch/arm/mach-nuc93x/include/mach/system.h
@@ -15,14 +15,10 @@
*
*/
-#include <asm/proc-fns.h>
-
static void arch_idle(void)
{
}
-static void arch_reset(char mode, const char *cmd)
+static inline void arch_reset(char mode, const char *cmd)
{
- cpu_reset(0);
}
-
--
1.7.4.1
^ permalink raw reply related
* [PATCH 29/51] ARM: mach-nomadik: use arm_arch_reset instead of arch_reset
From: Will Deacon @ 2011-10-28 14:43 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1319813059-8914-1-git-send-email-will.deacon@arm.com>
This patch updates mach-nomadik to use arm_arch_reset instead of
arch_reset.
Signed-off-by: Will Deacon <will.deacon@arm.com>
---
arch/arm/mach-nomadik/cpu-8815.c | 12 ++++++++++++
arch/arm/mach-nomadik/include/mach/system.h | 9 ---------
2 files changed, 12 insertions(+), 9 deletions(-)
diff --git a/arch/arm/mach-nomadik/cpu-8815.c b/arch/arm/mach-nomadik/cpu-8815.c
index ac58e3b..a9c2406 100644
--- a/arch/arm/mach-nomadik/cpu-8815.c
+++ b/arch/arm/mach-nomadik/cpu-8815.c
@@ -18,6 +18,7 @@
#include <linux/types.h>
#include <linux/init.h>
+#include <linux/io.h>
#include <linux/device.h>
#include <linux/amba/bus.h>
#include <linux/platform_device.h>
@@ -113,6 +114,16 @@ static struct amba_device *amba_devs[] __initdata = {
&cpu8815_amba_rng
};
+static void nmk_arch_reset(char mode, const char *cmd)
+{
+ void __iomem *src_rstsr = io_p2v(NOMADIK_SRC_BASE + 0x18);
+
+ /* FIXME: use egpio when implemented */
+
+ /* Write anything to Reset status register */
+ writel(1, src_rstsr);
+}
+
static int __init cpu8815_init(void)
{
int i;
@@ -120,6 +131,7 @@ static int __init cpu8815_init(void)
platform_add_devices(platform_devs, ARRAY_SIZE(platform_devs));
for (i = 0; i < ARRAY_SIZE(amba_devs); i++)
amba_device_register(amba_devs[i], &iomem_resource);
+ arm_arch_reset = nmk_arch_reset;
return 0;
}
arch_initcall(cpu8815_init);
diff --git a/arch/arm/mach-nomadik/include/mach/system.h b/arch/arm/mach-nomadik/include/mach/system.h
index 7119f68..16f59f6 100644
--- a/arch/arm/mach-nomadik/include/mach/system.h
+++ b/arch/arm/mach-nomadik/include/mach/system.h
@@ -20,9 +20,6 @@
#ifndef __ASM_ARCH_SYSTEM_H
#define __ASM_ARCH_SYSTEM_H
-#include <linux/io.h>
-#include <mach/hardware.h>
-
static inline void arch_idle(void)
{
/*
@@ -34,12 +31,6 @@ static inline void arch_idle(void)
static inline void arch_reset(char mode, const char *cmd)
{
- void __iomem *src_rstsr = io_p2v(NOMADIK_SRC_BASE + 0x18);
-
- /* FIXME: use egpio when implemented */
-
- /* Write anything to Reset status register */
- writel(1, src_rstsr);
}
#endif
--
1.7.4.1
^ permalink raw reply related
* [PATCH 28/51] ARM: mach-netx: use arm_arch_reset instead of arch_reset
From: Will Deacon @ 2011-10-28 14:43 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1319813059-8914-1-git-send-email-will.deacon@arm.com>
This patch updates mach-netx to use arm_arch_reset instead of
arch_reset.
Signed-off-by: Will Deacon <will.deacon@arm.com>
---
arch/arm/mach-netx/generic.c | 7 +++++++
arch/arm/mach-netx/include/mach/system.h | 6 ------
2 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/arch/arm/mach-netx/generic.c b/arch/arm/mach-netx/generic.c
index 00023b5..13ed7a3 100644
--- a/arch/arm/mach-netx/generic.c
+++ b/arch/arm/mach-netx/generic.c
@@ -180,8 +180,15 @@ void __init netx_init_irq(void)
irq_set_chained_handler(NETX_IRQ_HIF, netx_hif_demux_handler);
}
+static void netx_arch_reset(char mode, const char *cmd)
+{
+ writel(NETX_SYSTEM_RES_CR_FIRMW_RES_EN | NETX_SYSTEM_RES_CR_FIRMW_RES,
+ NETX_SYSTEM_RES_CR);
+}
+
static int __init netx_init(void)
{
+ arm_arch_reset = netx_arch_reset;
return platform_add_devices(devices, ARRAY_SIZE(devices));
}
diff --git a/arch/arm/mach-netx/include/mach/system.h b/arch/arm/mach-netx/include/mach/system.h
index dc7b4bc..83ae2b1 100644
--- a/arch/arm/mach-netx/include/mach/system.h
+++ b/arch/arm/mach-netx/include/mach/system.h
@@ -19,10 +19,6 @@
#ifndef __ASM_ARCH_SYSTEM_H
#define __ASM_ARCH_SYSTEM_H
-#include <linux/io.h>
-#include <mach/hardware.h>
-#include "netx-regs.h"
-
static inline void arch_idle(void)
{
cpu_do_idle();
@@ -30,8 +26,6 @@ static inline void arch_idle(void)
static inline void arch_reset(char mode, const char *cmd)
{
- writel(NETX_SYSTEM_RES_CR_FIRMW_RES_EN | NETX_SYSTEM_RES_CR_FIRMW_RES,
- NETX_SYSTEM_RES_CR);
}
#endif
--
1.7.4.1
^ permalink raw reply related
* [PATCH 27/51] ARM: mach-mxs: use arm_arch_reset instead of arch_reset
From: Will Deacon @ 2011-10-28 14:43 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1319813059-8914-1-git-send-email-will.deacon@arm.com>
This patch updates mach-mxs to use arm_arch_reset instead of
arch_reset.
Signed-off-by: Will Deacon <will.deacon@arm.com>
---
arch/arm/mach-mxs/include/mach/system.h | 4 +++-
arch/arm/mach-mxs/system.c | 4 +++-
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/arch/arm/mach-mxs/include/mach/system.h b/arch/arm/mach-mxs/include/mach/system.h
index 0e42823..bcd8989 100644
--- a/arch/arm/mach-mxs/include/mach/system.h
+++ b/arch/arm/mach-mxs/include/mach/system.h
@@ -22,6 +22,8 @@ static inline void arch_idle(void)
cpu_do_idle();
}
-void arch_reset(char mode, const char *cmd);
+static inline void arch_reset(char mode, const char *cmd)
+{
+}
#endif /* __MACH_MXS_SYSTEM_H__ */
diff --git a/arch/arm/mach-mxs/system.c b/arch/arm/mach-mxs/system.c
index 20ec3bd..add6428 100644
--- a/arch/arm/mach-mxs/system.c
+++ b/arch/arm/mach-mxs/system.c
@@ -42,7 +42,7 @@ static void __iomem *mxs_clkctrl_reset_addr;
/*
* Reset the system. It is called by machine_restart().
*/
-void arch_reset(char mode, const char *cmd)
+static void mxs_arch_reset(char mode, const char *cmd)
{
/* reset the chip */
__mxs_setl(MXS_CLKCTRL_RESET_CHIP, mxs_clkctrl_reset_addr);
@@ -68,6 +68,8 @@ static int __init mxs_arch_reset_init(void)
if (!IS_ERR(clk))
clk_enable(clk);
+ arm_arch_reset = mxs_arch_reset;
+
return 0;
}
core_initcall(mxs_arch_reset_init);
--
1.7.4.1
^ permalink raw reply related
* [PATCH 26/51] ARM: mach-msm: use arm_arch_reset instead of arch_reset
From: Will Deacon @ 2011-10-28 14:43 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1319813059-8914-1-git-send-email-will.deacon@arm.com>
This patch updates mach-msm to use arm_arch_reset instead of
arch_reset.
Signed-off-by: Will Deacon <will.deacon@arm.com>
---
arch/arm/mach-msm/include/mach/system.h | 6 ------
arch/arm/mach-msm/smd.c | 6 ++++++
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/arch/arm/mach-msm/include/mach/system.h b/arch/arm/mach-msm/include/mach/system.h
index d2e83f4..ab6590b 100644
--- a/arch/arm/mach-msm/include/mach/system.h
+++ b/arch/arm/mach-msm/include/mach/system.h
@@ -19,10 +19,4 @@ void arch_idle(void);
static inline void arch_reset(char mode, const char *cmd)
{
- for (;;) ; /* depends on IPC w/ other core */
}
-
-/* low level hardware reset hook -- for example, hitting the
- * PSHOLD line on the PMIC to hard reset the system
- */
-extern void (*msm_hw_reset_hook)(void);
diff --git a/arch/arm/mach-msm/smd.c b/arch/arm/mach-msm/smd.c
index 657be73..4f0e919 100644
--- a/arch/arm/mach-msm/smd.c
+++ b/arch/arm/mach-msm/smd.c
@@ -1029,8 +1029,14 @@ static struct platform_driver msm_smd_driver = {
},
};
+static void msm_arch_reset(char mode, const char *cmd)
+{
+ for (;;) ; /* depends on IPC w/ other core */
+}
+
static int __init msm_smd_init(void)
{
+ arm_arch_reset = msm_arch_reset;
return platform_driver_register(&msm_smd_driver);
}
--
1.7.4.1
^ permalink raw reply related
* [PATCH 25/51] ARM: mach-mv78xx0: use arm_arch_reset instead of arch_reset
From: Will Deacon @ 2011-10-28 14:43 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1319813059-8914-1-git-send-email-will.deacon@arm.com>
This patch updates mach-mv78xx0 to use arm_arch_reset instead of
arch_reset.
Signed-off-by: Will Deacon <will.deacon@arm.com>
---
arch/arm/mach-mv78xx0/common.c | 17 +++++++++++++++++
arch/arm/mach-mv78xx0/include/mach/system.h | 12 ------------
2 files changed, 17 insertions(+), 12 deletions(-)
diff --git a/arch/arm/mach-mv78xx0/common.c b/arch/arm/mach-mv78xx0/common.c
index 23d3980..c3d5dd4 100644
--- a/arch/arm/mach-mv78xx0/common.c
+++ b/arch/arm/mach-mv78xx0/common.c
@@ -375,6 +375,22 @@ static int __init is_l2_writethrough(void)
return !!(readl(CPU_CONTROL) & L2_WRITETHROUGH);
}
+static void mv78xx0_arch_reset(char mode, const char *cmd)
+{
+ /*
+ * Enable soft reset to assert RSTOUTn.
+ */
+ writel(SOFT_RESET_OUT_EN, RSTOUTn_MASK);
+
+ /*
+ * Assert soft reset.
+ */
+ writel(SOFT_RESET, SYSTEM_SOFT_RESET);
+
+ while (1)
+ ;
+}
+
void __init mv78xx0_init(void)
{
int core_index;
@@ -400,4 +416,5 @@ void __init mv78xx0_init(void)
#ifdef CONFIG_CACHE_FEROCEON_L2
feroceon_l2_init(is_l2_writethrough());
#endif
+ arm_arch_reset = mv78xx0_arch_reset;
}
diff --git a/arch/arm/mach-mv78xx0/include/mach/system.h b/arch/arm/mach-mv78xx0/include/mach/system.h
index 66e7ce4..1a41dc5 100644
--- a/arch/arm/mach-mv78xx0/include/mach/system.h
+++ b/arch/arm/mach-mv78xx0/include/mach/system.h
@@ -18,18 +18,6 @@ static inline void arch_idle(void)
static inline void arch_reset(char mode, const char *cmd)
{
- /*
- * Enable soft reset to assert RSTOUTn.
- */
- writel(SOFT_RESET_OUT_EN, RSTOUTn_MASK);
-
- /*
- * Assert soft reset.
- */
- writel(SOFT_RESET, SYSTEM_SOFT_RESET);
-
- while (1)
- ;
}
--
1.7.4.1
^ permalink raw reply related
* [PATCH 24/51] ARM: mach-mmp: use arm_arch_reset instead of arch_reset
From: Will Deacon @ 2011-10-28 14:43 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1319813059-8914-1-git-send-email-will.deacon@arm.com>
This patch updates mach-mmp to use arm_arch_reset instead of
arch_reset.
Signed-off-by: Will Deacon <will.deacon@arm.com>
---
arch/arm/mach-mmp/common.c | 16 ++++++++++++++++
arch/arm/mach-mmp/include/mach/system.h | 4 ----
2 files changed, 16 insertions(+), 4 deletions(-)
diff --git a/arch/arm/mach-mmp/common.c b/arch/arm/mach-mmp/common.c
index 0ec0ca8..1d3df64 100644
--- a/arch/arm/mach-mmp/common.c
+++ b/arch/arm/mach-mmp/common.c
@@ -13,6 +13,7 @@
#include <linux/module.h>
#include <asm/page.h>
+#include <asm/proc-fns.h>
#include <asm/mach/map.h>
#include <mach/addr-map.h>
#include <mach/cputype.h>
@@ -45,3 +46,18 @@ void __init mmp_map_io(void)
/* this is early, initialize mmp_chip_id here */
mmp_chip_id = __raw_readl(MMP_CHIPID);
}
+
+static void mmp_arch_reset(char mode, const char *cmd)
+{
+ if (cpu_is_pxa168())
+ cpu_reset(0xffff0000);
+ else
+ cpu_reset(0);
+}
+
+static int __init mmp_arch_reset_init(void)
+{
+ arm_arch_reset = mmp_arch_reset;
+ return 0;
+}
+arch_initcall(mmp_arch_reset_init);
diff --git a/arch/arm/mach-mmp/include/mach/system.h b/arch/arm/mach-mmp/include/mach/system.h
index 1a8a25e..b09c19a 100644
--- a/arch/arm/mach-mmp/include/mach/system.h
+++ b/arch/arm/mach-mmp/include/mach/system.h
@@ -18,9 +18,5 @@ static inline void arch_idle(void)
static inline void arch_reset(char mode, const char *cmd)
{
- if (cpu_is_pxa168())
- cpu_reset(0xffff0000);
- else
- cpu_reset(0);
}
#endif /* __ASM_MACH_SYSTEM_H */
--
1.7.4.1
^ permalink raw reply related
* [PATCH 23/51] ARM: mach-lpc32xx: use arm_arch_reset instead of arch_reset
From: Will Deacon @ 2011-10-28 14:43 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1319813059-8914-1-git-send-email-will.deacon@arm.com>
This patch updates mach-lpc32xx to use arm_arch_reset instead of
arch_reset.
Signed-off-by: Will Deacon <will.deacon@arm.com>
---
arch/arm/mach-lpc32xx/common.c | 30 +++++++++++++++++++++++++++
arch/arm/mach-lpc32xx/include/mach/system.h | 21 ------------------
2 files changed, 30 insertions(+), 21 deletions(-)
diff --git a/arch/arm/mach-lpc32xx/common.c b/arch/arm/mach-lpc32xx/common.c
index 205b2db..200bd51 100644
--- a/arch/arm/mach-lpc32xx/common.c
+++ b/arch/arm/mach-lpc32xx/common.c
@@ -311,3 +311,33 @@ void __init lpc32xx_map_io(void)
{
iotable_init(lpc32xx_io_desc, ARRAY_SIZE(lpc32xx_io_desc));
}
+
+static void lpc32xx_arch_reset(char mode, const char *cmd)
+{
+ switch (mode) {
+ case 's':
+ case 'h':
+ printk(KERN_CRIT "RESET: Rebooting system\n");
+
+ /* Disable interrupts */
+ local_irq_disable();
+
+ lpc32xx_watchdog_reset();
+ break;
+
+ default:
+ /* Do nothing */
+ break;
+ }
+
+ /* Wait for watchdog to reset system */
+ while (1)
+ ;
+}
+
+static int __init lpc32xx_arch_reset_init(void)
+{
+ arm_arch_reset = lpc32xx_arch_reset;
+ return 0;
+}
+arch_initcall(lpc32xx_arch_reset_init);
diff --git a/arch/arm/mach-lpc32xx/include/mach/system.h b/arch/arm/mach-lpc32xx/include/mach/system.h
index df3b0de..9c6cc0c 100644
--- a/arch/arm/mach-lpc32xx/include/mach/system.h
+++ b/arch/arm/mach-lpc32xx/include/mach/system.h
@@ -26,27 +26,6 @@ static void arch_idle(void)
static inline void arch_reset(char mode, const char *cmd)
{
- extern void lpc32xx_watchdog_reset(void);
-
- switch (mode) {
- case 's':
- case 'h':
- printk(KERN_CRIT "RESET: Rebooting system\n");
-
- /* Disable interrupts */
- local_irq_disable();
-
- lpc32xx_watchdog_reset();
- break;
-
- default:
- /* Do nothing */
- break;
- }
-
- /* Wait for watchdog to reset system */
- while (1)
- ;
}
#endif
--
1.7.4.1
^ permalink raw reply related
* [PATCH 22/51] ARM: mach-ks8695: use arm_arch_reset instead of arch_reset
From: Will Deacon @ 2011-10-28 14:43 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1319813059-8914-1-git-send-email-will.deacon@arm.com>
This patch updates mach-ks8695 to use arm_arch_reset instead of
arch_reset.
Signed-off-by: Will Deacon <will.deacon@arm.com>
---
arch/arm/mach-ks8695/Makefile | 2 +-
arch/arm/mach-ks8695/include/mach/system.h | 19 +---------------
arch/arm/mach-ks8695/reset.c | 33 ++++++++++++++++++++++++++++
3 files changed, 35 insertions(+), 19 deletions(-)
create mode 100644 arch/arm/mach-ks8695/reset.c
diff --git a/arch/arm/mach-ks8695/Makefile b/arch/arm/mach-ks8695/Makefile
index 7e3e816..c2dcdde 100644
--- a/arch/arm/mach-ks8695/Makefile
+++ b/arch/arm/mach-ks8695/Makefile
@@ -3,7 +3,7 @@
# Makefile for KS8695 architecture support
#
-obj-y := cpu.o irq.o time.o gpio.o devices.o
+obj-y := cpu.o irq.o time.o gpio.o devices.o reset.o
obj-m :=
obj-n :=
obj- :=
diff --git a/arch/arm/mach-ks8695/include/mach/system.h b/arch/arm/mach-ks8695/include/mach/system.h
index fb1dda9..b73ee70 100644
--- a/arch/arm/mach-ks8695/include/mach/system.h
+++ b/arch/arm/mach-ks8695/include/mach/system.h
@@ -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)
{
/*
@@ -27,22 +24,8 @@ static void arch_idle(void)
}
-static void arch_reset(char mode, const char *cmd)
+static inline void arch_reset(char mode, const char *cmd)
{
- unsigned int reg;
-
- if (mode == 's')
- cpu_reset(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
diff --git a/arch/arm/mach-ks8695/reset.c b/arch/arm/mach-ks8695/reset.c
new file mode 100644
index 0000000..911eb95
--- /dev/null
+++ b/arch/arm/mach-ks8695/reset.c
@@ -0,0 +1,33 @@
+/*
+ * arch/arm/mach-ks8695/reset.c
+ */
+
+#include <linux/init.h>
+#include <linux/io.h>
+#include <asm/proc-fns.h>
+#include <mach/regs-timer.h>
+
+static void ks8695_arch_reset(char mode, const char *cmd)
+{
+ unsigned int reg;
+
+ if (mode == 's')
+ cpu_reset(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);
+}
+
+static int __init ks8695_arch_reset_init(void)
+{
+ arm_arch_reset = ks8695_arch_reset;
+ return 0;
+}
+arch_initcall(ks8695_arch_reset_init);
--
1.7.4.1
^ permalink raw reply related
* [PATCH 21/51] ARM: mach-kirkwood: use arm_arch_reset instead of arch_reset
From: Will Deacon @ 2011-10-28 14:43 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1319813059-8914-1-git-send-email-will.deacon@arm.com>
This patch updates mach-kirkwood to use arm_arch_reset instead of
arch_reset.
Signed-off-by: Will Deacon <will.deacon@arm.com>
---
arch/arm/mach-kirkwood/common.c | 17 +++++++++++++++++
arch/arm/mach-kirkwood/include/mach/system.h | 14 --------------
2 files changed, 17 insertions(+), 14 deletions(-)
diff --git a/arch/arm/mach-kirkwood/common.c b/arch/arm/mach-kirkwood/common.c
index f3248cf..5fcfbde 100644
--- a/arch/arm/mach-kirkwood/common.c
+++ b/arch/arm/mach-kirkwood/common.c
@@ -448,6 +448,22 @@ static void __init kirkwood_l2_init(void)
#endif
}
+static void kirkwood_arch_reset(char mode, const char *cmd)
+{
+ /*
+ * Enable soft reset to assert RSTOUTn.
+ */
+ writel(SOFT_RESET_OUT_EN, RSTOUTn_MASK);
+
+ /*
+ * Assert soft reset.
+ */
+ writel(SOFT_RESET, SYSTEM_SOFT_RESET);
+
+ while (1)
+ ;
+}
+
void __init kirkwood_init(void)
{
printk(KERN_INFO "Kirkwood: %s, TCLK=%d.\n",
@@ -478,6 +494,7 @@ void __init kirkwood_init(void)
#ifdef CONFIG_KEXEC
kexec_reinit = kirkwood_enable_pcie;
#endif
+ arm_arch_reset = kirkwood_arch_reset;
}
static int __init kirkwood_clock_gate(void)
diff --git a/arch/arm/mach-kirkwood/include/mach/system.h b/arch/arm/mach-kirkwood/include/mach/system.h
index 7568e95..f094431 100644
--- a/arch/arm/mach-kirkwood/include/mach/system.h
+++ b/arch/arm/mach-kirkwood/include/mach/system.h
@@ -9,8 +9,6 @@
#ifndef __ASM_ARCH_SYSTEM_H
#define __ASM_ARCH_SYSTEM_H
-#include <mach/bridge-regs.h>
-
static inline void arch_idle(void)
{
cpu_do_idle();
@@ -18,18 +16,6 @@ static inline void arch_idle(void)
static inline void arch_reset(char mode, const char *cmd)
{
- /*
- * Enable soft reset to assert RSTOUTn.
- */
- writel(SOFT_RESET_OUT_EN, RSTOUTn_MASK);
-
- /*
- * Assert soft reset.
- */
- writel(SOFT_RESET, SYSTEM_SOFT_RESET);
-
- while (1)
- ;
}
--
1.7.4.1
^ permalink raw reply related
* [PATCH 20/51] ARM: mach-ixp4xx: use arm_arch_reset instead of arch_reset
From: Will Deacon @ 2011-10-28 14:43 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1319813059-8914-1-git-send-email-will.deacon@arm.com>
This patch updates mach-ixp4xx to use arm_arch_reset instead of
arch_reset.
Signed-off-by: Will Deacon <will.deacon@arm.com>
---
arch/arm/mach-ixp4xx/common.c | 22 ++++++++++++++++++++++
arch/arm/mach-ixp4xx/include/mach/system.h | 19 -------------------
2 files changed, 22 insertions(+), 19 deletions(-)
diff --git a/arch/arm/mach-ixp4xx/common.c b/arch/arm/mach-ixp4xx/common.c
index 0777257..9e38334 100644
--- a/arch/arm/mach-ixp4xx/common.c
+++ b/arch/arm/mach-ixp4xx/common.c
@@ -375,6 +375,26 @@ static struct platform_device *ixp46x_devices[] __initdata = {
unsigned long ixp4xx_exp_bus_size;
EXPORT_SYMBOL(ixp4xx_exp_bus_size);
+static void ixp4xx_arch_reset(char mode, const char *cmd)
+{
+ if ( 1 && mode == 's') {
+ /* Jump into ROM at address 0 */
+ cpu_reset(0);
+ } else {
+ /* Use on-chip reset capability */
+
+ /* set the "key" register to enable access to
+ * "timer" and "enable" registers
+ */
+ *IXP4XX_OSWK = IXP4XX_WDT_KEY;
+
+ /* write 0 to the timer register for an immediate reset */
+ *IXP4XX_OSWT = 0;
+
+ *IXP4XX_OSWE = IXP4XX_WDT_RESET_ENABLE | IXP4XX_WDT_COUNT_ENABLE;
+ }
+}
+
void __init ixp4xx_sys_init(void)
{
ixp4xx_exp_bus_size = SZ_16M;
@@ -397,6 +417,8 @@ void __init ixp4xx_sys_init(void)
printk("IXP4xx: Using %luMiB expansion bus window size\n",
ixp4xx_exp_bus_size >> 20);
+
+ arm_arch_reset = ixp4xx_arch_reset;
}
/*
diff --git a/arch/arm/mach-ixp4xx/include/mach/system.h b/arch/arm/mach-ixp4xx/include/mach/system.h
index 54c0af7..ed5964c 100644
--- a/arch/arm/mach-ixp4xx/include/mach/system.h
+++ b/arch/arm/mach-ixp4xx/include/mach/system.h
@@ -9,8 +9,6 @@
*
*/
-#include <mach/hardware.h>
-
static inline void arch_idle(void)
{
/* ixp4xx does not implement the XScale PWRMODE register,
@@ -24,21 +22,4 @@ static inline void arch_idle(void)
static inline void arch_reset(char mode, const char *cmd)
{
- if ( 1 && mode == 's') {
- /* Jump into ROM at address 0 */
- cpu_reset(0);
- } else {
- /* Use on-chip reset capability */
-
- /* set the "key" register to enable access to
- * "timer" and "enable" registers
- */
- *IXP4XX_OSWK = IXP4XX_WDT_KEY;
-
- /* write 0 to the timer register for an immediate reset */
- *IXP4XX_OSWT = 0;
-
- *IXP4XX_OSWE = IXP4XX_WDT_RESET_ENABLE | IXP4XX_WDT_COUNT_ENABLE;
- }
}
-
--
1.7.4.1
^ permalink raw reply related
* [PATCH 19/51] ARM: mach-ixp23xx: use arm_arch_reset instead of arch_reset
From: Will Deacon @ 2011-10-28 14:43 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1319813059-8914-1-git-send-email-will.deacon@arm.com>
This patch updates mach-ixp23xx to use arm_arch_reset instead of
arch_reset.
Signed-off-by: Will Deacon <will.deacon@arm.com>
---
arch/arm/mach-ixp23xx/core.c | 15 +++++++++++++++
arch/arm/mach-ixp23xx/include/mach/system.h | 12 ------------
2 files changed, 15 insertions(+), 12 deletions(-)
diff --git a/arch/arm/mach-ixp23xx/core.c b/arch/arm/mach-ixp23xx/core.c
index a1bee33..e72c089 100644
--- a/arch/arm/mach-ixp23xx/core.c
+++ b/arch/arm/mach-ixp23xx/core.c
@@ -32,6 +32,7 @@
#include <asm/types.h>
#include <asm/setup.h>
#include <asm/memory.h>
+#include <asm/mach-types.h>
#include <mach/hardware.h>
#include <asm/irq.h>
#include <asm/system.h>
@@ -439,8 +440,22 @@ static struct platform_device *ixp23xx_devices[] __initdata = {
&ixp23xx_uart,
};
+static void ixp23xx_arch_reset(char mode, const char *cmd)
+{
+ /* First try machine specific support */
+ if (machine_is_ixdp2351()) {
+ *IXDP2351_CPLD_RESET1_REG = IXDP2351_CPLD_RESET1_MAGIC;
+ (void) *IXDP2351_CPLD_RESET1_REG;
+ *IXDP2351_CPLD_RESET1_REG = IXDP2351_CPLD_RESET1_ENABLE;
+ }
+
+ /* Use on-chip reset capability */
+ *IXP23XX_RESET0 |= IXP23XX_RST_ALL;
+}
+
void __init ixp23xx_sys_init(void)
{
*IXP23XX_EXP_UNIT_FUSE |= 0xf;
platform_add_devices(ixp23xx_devices, ARRAY_SIZE(ixp23xx_devices));
+ arm_arch_reset = ixp23xx_arch_reset;
}
diff --git a/arch/arm/mach-ixp23xx/include/mach/system.h b/arch/arm/mach-ixp23xx/include/mach/system.h
index 8920ff2..4569003 100644
--- a/arch/arm/mach-ixp23xx/include/mach/system.h
+++ b/arch/arm/mach-ixp23xx/include/mach/system.h
@@ -8,9 +8,6 @@
* published by the Free Software Foundation.
*/
-#include <mach/hardware.h>
-#include <asm/mach-types.h>
-
static inline void arch_idle(void)
{
#if 0
@@ -21,13 +18,4 @@ static inline void arch_idle(void)
static inline void arch_reset(char mode, const char *cmd)
{
- /* First try machine specific support */
- if (machine_is_ixdp2351()) {
- *IXDP2351_CPLD_RESET1_REG = IXDP2351_CPLD_RESET1_MAGIC;
- (void) *IXDP2351_CPLD_RESET1_REG;
- *IXDP2351_CPLD_RESET1_REG = IXDP2351_CPLD_RESET1_ENABLE;
- }
-
- /* Use on-chip reset capability */
- *IXP23XX_RESET0 |= IXP23XX_RST_ALL;
}
--
1.7.4.1
^ permalink raw reply related
* [PATCH 18/51] ARM: mach-ixp2000: use arm_arch_reset instead of arch_reset
From: Will Deacon @ 2011-10-28 14:43 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1319813059-8914-1-git-send-email-will.deacon@arm.com>
This patch updates mach-ixp2000 to use arm_arch_reset instead of
arch_reset.
Signed-off-by: Will Deacon <will.deacon@arm.com>
---
arch/arm/mach-ixp2000/core.c | 38 +++++++++++++++++++++++++++
arch/arm/mach-ixp2000/include/mach/system.h | 30 ---------------------
2 files changed, 38 insertions(+), 30 deletions(-)
diff --git a/arch/arm/mach-ixp2000/core.c b/arch/arm/mach-ixp2000/core.c
index 4068166..59e987f 100644
--- a/arch/arm/mach-ixp2000/core.c
+++ b/arch/arm/mach-ixp2000/core.c
@@ -28,6 +28,7 @@
#include <asm/types.h>
#include <asm/setup.h>
+#include <asm/mach-types.h>
#include <asm/memory.h>
#include <mach/hardware.h>
#include <asm/irq.h>
@@ -514,3 +515,40 @@ void __init ixp2000_init_irq(void)
}
}
+static void ixp2000_arch_reset(char mode, const char *cmd)
+{
+ local_irq_disable();
+
+ /*
+ * Reset flash banking register so that we are pointing at
+ * RedBoot bank.
+ */
+ if (machine_is_ixdp2401()) {
+ ixp2000_reg_write(IXDP2X01_CPLD_FLASH_REG,
+ ((0 >> IXDP2X01_FLASH_WINDOW_BITS)
+ | IXDP2X01_CPLD_FLASH_INTERN));
+ ixp2000_reg_wrb(IXDP2X01_CPLD_RESET_REG, 0xffffffff);
+ }
+
+ /*
+ * On IXDP2801 we need to write this magic sequence to the CPLD
+ * to cause a complete reset of the CPU and all external devices
+ * and move the flash bank register back to 0.
+ */
+ if (machine_is_ixdp2801() || machine_is_ixdp28x5()) {
+ unsigned long reset_reg = *IXDP2X01_CPLD_RESET_REG;
+
+ reset_reg = 0x55AA0000 | (reset_reg & 0x0000FFFF);
+ ixp2000_reg_write(IXDP2X01_CPLD_RESET_REG, reset_reg);
+ ixp2000_reg_wrb(IXDP2X01_CPLD_RESET_REG, 0x80000000);
+ }
+
+ ixp2000_reg_wrb(IXP2000_RESET0, RSTALL);
+}
+
+static int __init ixp2000_arch_reset_init(void)
+{
+ arm_arch_reset = ixp2000_arch_reset;
+ return 0;
+}
+arch_initcall(ixp2000_arch_reset_init);
diff --git a/arch/arm/mach-ixp2000/include/mach/system.h b/arch/arm/mach-ixp2000/include/mach/system.h
index de37099..d79c7ad 100644
--- a/arch/arm/mach-ixp2000/include/mach/system.h
+++ b/arch/arm/mach-ixp2000/include/mach/system.h
@@ -9,9 +9,6 @@
* published by the Free Software Foundation.
*/
-#include <mach/hardware.h>
-#include <asm/mach-types.h>
-
static inline void arch_idle(void)
{
cpu_do_idle();
@@ -19,31 +16,4 @@ static inline void arch_idle(void)
static inline void arch_reset(char mode, const char *cmd)
{
- local_irq_disable();
-
- /*
- * Reset flash banking register so that we are pointing at
- * RedBoot bank.
- */
- if (machine_is_ixdp2401()) {
- ixp2000_reg_write(IXDP2X01_CPLD_FLASH_REG,
- ((0 >> IXDP2X01_FLASH_WINDOW_BITS)
- | IXDP2X01_CPLD_FLASH_INTERN));
- ixp2000_reg_wrb(IXDP2X01_CPLD_RESET_REG, 0xffffffff);
- }
-
- /*
- * On IXDP2801 we need to write this magic sequence to the CPLD
- * to cause a complete reset of the CPU and all external devices
- * and move the flash bank register back to 0.
- */
- if (machine_is_ixdp2801() || machine_is_ixdp28x5()) {
- unsigned long reset_reg = *IXDP2X01_CPLD_RESET_REG;
-
- reset_reg = 0x55AA0000 | (reset_reg & 0x0000FFFF);
- ixp2000_reg_write(IXDP2X01_CPLD_RESET_REG, reset_reg);
- ixp2000_reg_wrb(IXDP2X01_CPLD_RESET_REG, 0x80000000);
- }
-
- ixp2000_reg_wrb(IXP2000_RESET0, RSTALL);
}
--
1.7.4.1
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox