summaryrefslogtreecommitdiff
path: root/arch/arm/mach-vt8500/restart.c
diff options
context:
space:
mode:
authorTony Prisk <linux@prisktech.co.nz>2012-07-19 03:42:19 +1200
committerArnd Bergmann <arnd@arndb.de>2012-07-18 18:51:55 +0200
commit86cc0ef8abd25fab2c7c6a6a57faf5cd8503a15b (patch)
tree3eb611f52f3a75aced6915c944e03a4cf4f40850 /arch/arm/mach-vt8500/restart.c
parentc26abeb7b5ee571ff47a094ede2c84356229628a (diff)
downloadlinux-stable-86cc0ef8abd25fab2c7c6a6a57faf5cd8503a15b.tar.gz
ARM:vt8500: Convert to use .restart and remove arch_reset()
Removed system.h as it only contained an inline for arch_reset() Changed the existing board files to use .restart in there machine descriptions. Added device tree support for the restart controller. Device tree support for mach-vt8500 is still a work-in-progress. Signed-off-by: Tony Prisk <linux@prisktech.co.nz> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'arch/arm/mach-vt8500/restart.c')
-rw-r--r--arch/arm/mach-vt8500/restart.c54
1 files changed, 54 insertions, 0 deletions
diff --git a/arch/arm/mach-vt8500/restart.c b/arch/arm/mach-vt8500/restart.c
new file mode 100644
index 000000000000..497e89a5e130
--- /dev/null
+++ b/arch/arm/mach-vt8500/restart.c
@@ -0,0 +1,54 @@
+/* linux/arch/arm/mach-vt8500/restart.c
+ *
+ * Copyright (C) 2012 Tony Prisk <linux@prisktech.co.nz>
+ *
+ * This software is licensed under the terms of the GNU General Public
+ * License version 2, as published by the Free Software Foundation, and
+ * may be copied, distributed, and modified under those terms.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ */
+#include <asm/io.h>
+#include <linux/of.h>
+#include <linux/of_address.h>
+
+#define LEGACY_PMC_BASE 0xD8130000
+#define WMT_PRIZM_PMSR_REG 0x60
+
+static void __iomem *pmc_base;
+
+void wmt_setup_restart(void)
+{
+ struct device_node *np;
+
+ /*
+ * Check if Power Mgmt Controller node is present in device tree. If no
+ * device tree node, use the legacy PMSR value (valid for all current
+ * SoCs).
+ */
+ np = of_find_compatible_node(NULL, NULL, "wmt,prizm-pmc");
+ if (np) {
+ pmc_base = of_iomap(np, 0);
+
+ if (!pmc_base)
+ pr_err("%s:of_iomap(pmc) failed\n", __func__);
+
+ of_node_put(np);
+ } else {
+ pmc_base = ioremap(LEGACY_PMC_BASE, 0x1000);
+ if (!pmc_base) {
+ pr_err("%s:ioremap(rstc) failed\n", __func__);
+ return;
+ }
+ }
+}
+
+void wmt_restart(char mode, const char *cmd)
+{
+ if (pmc_base)
+ writel(1, pmc_base + WMT_PRIZM_PMSR_REG);
+}