diff options
author | Tony Prisk <linux@prisktech.co.nz> | 2012-07-18 11:42:19 -0400 |
---|---|---|
committer | Arnd Bergmann <arnd@arndb.de> | 2012-07-18 12:51:55 -0400 |
commit | 86cc0ef8abd25fab2c7c6a6a57faf5cd8503a15b (patch) | |
tree | 3eb611f52f3a75aced6915c944e03a4cf4f40850 /arch/arm/mach-vt8500 | |
parent | c26abeb7b5ee571ff47a094ede2c84356229628a (diff) |
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')
-rw-r--r-- | arch/arm/mach-vt8500/Makefile | 2 | ||||
-rw-r--r-- | arch/arm/mach-vt8500/bv07.c | 3 | ||||
-rw-r--r-- | arch/arm/mach-vt8500/include/mach/restart.h | 17 | ||||
-rw-r--r-- | arch/arm/mach-vt8500/include/mach/system.h | 13 | ||||
-rw-r--r-- | arch/arm/mach-vt8500/restart.c | 54 | ||||
-rw-r--r-- | arch/arm/mach-vt8500/wm8505_7in.c | 4 |
6 files changed, 78 insertions, 15 deletions
diff --git a/arch/arm/mach-vt8500/Makefile b/arch/arm/mach-vt8500/Makefile index 81aedb7c893c..54e69973f39b 100644 --- a/arch/arm/mach-vt8500/Makefile +++ b/arch/arm/mach-vt8500/Makefile | |||
@@ -1,4 +1,4 @@ | |||
1 | obj-y += devices.o gpio.o irq.o timer.o | 1 | obj-y += devices.o gpio.o irq.o timer.o restart.o |
2 | 2 | ||
3 | obj-$(CONFIG_VTWM_VERSION_VT8500) += devices-vt8500.o | 3 | obj-$(CONFIG_VTWM_VERSION_VT8500) += devices-vt8500.o |
4 | obj-$(CONFIG_VTWM_VERSION_WM8505) += devices-wm8505.o | 4 | obj-$(CONFIG_VTWM_VERSION_WM8505) += devices-wm8505.o |
diff --git a/arch/arm/mach-vt8500/bv07.c b/arch/arm/mach-vt8500/bv07.c index a464c7584411..f9fbeb2d10e9 100644 --- a/arch/arm/mach-vt8500/bv07.c +++ b/arch/arm/mach-vt8500/bv07.c | |||
@@ -23,6 +23,7 @@ | |||
23 | 23 | ||
24 | #include <asm/mach-types.h> | 24 | #include <asm/mach-types.h> |
25 | #include <asm/mach/arch.h> | 25 | #include <asm/mach/arch.h> |
26 | #include <mach/restart.h> | ||
26 | 27 | ||
27 | #include "devices.h" | 28 | #include "devices.h" |
28 | 29 | ||
@@ -62,6 +63,7 @@ void __init bv07_init(void) | |||
62 | else | 63 | else |
63 | printk(KERN_ERR "PMC Hibernation register could not be remapped, not enabling power off!\n"); | 64 | printk(KERN_ERR "PMC Hibernation register could not be remapped, not enabling power off!\n"); |
64 | 65 | ||
66 | wmt_setup_restart(); | ||
65 | vt8500_set_resources(); | 67 | vt8500_set_resources(); |
66 | platform_add_devices(devices, ARRAY_SIZE(devices)); | 68 | platform_add_devices(devices, ARRAY_SIZE(devices)); |
67 | vt8500_gpio_init(); | 69 | vt8500_gpio_init(); |
@@ -69,6 +71,7 @@ void __init bv07_init(void) | |||
69 | 71 | ||
70 | MACHINE_START(BV07, "Benign BV07 Mini Netbook") | 72 | MACHINE_START(BV07, "Benign BV07 Mini Netbook") |
71 | .atag_offset = 0x100, | 73 | .atag_offset = 0x100, |
74 | .restart = wmt_restart, | ||
72 | .reserve = vt8500_reserve_mem, | 75 | .reserve = vt8500_reserve_mem, |
73 | .map_io = vt8500_map_io, | 76 | .map_io = vt8500_map_io, |
74 | .init_irq = vt8500_init_irq, | 77 | .init_irq = vt8500_init_irq, |
diff --git a/arch/arm/mach-vt8500/include/mach/restart.h b/arch/arm/mach-vt8500/include/mach/restart.h new file mode 100644 index 000000000000..89f9b787d2a0 --- /dev/null +++ b/arch/arm/mach-vt8500/include/mach/restart.h | |||
@@ -0,0 +1,17 @@ | |||
1 | /* linux/arch/arm/mach-vt8500/restart.h | ||
2 | * | ||
3 | * Copyright (C) 2012 Tony Prisk <linux@prisktech.co.nz> | ||
4 | * | ||
5 | * This software is licensed under the terms of the GNU General Public | ||
6 | * License version 2, as published by the Free Software Foundation, and | ||
7 | * may be copied, distributed, and modified under those terms. | ||
8 | * | ||
9 | * This program is distributed in the hope that it will be useful, | ||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | * GNU General Public License for more details. | ||
13 | * | ||
14 | */ | ||
15 | |||
16 | void wmt_setup_restart(void); | ||
17 | void wmt_restart(char mode, const char *cmd); | ||
diff --git a/arch/arm/mach-vt8500/include/mach/system.h b/arch/arm/mach-vt8500/include/mach/system.h deleted file mode 100644 index 58fa8010ee61..000000000000 --- a/arch/arm/mach-vt8500/include/mach/system.h +++ /dev/null | |||
@@ -1,13 +0,0 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-vt8500/include/mach/system.h | ||
3 | * | ||
4 | */ | ||
5 | #include <asm/io.h> | ||
6 | |||
7 | /* PM Software Reset request register */ | ||
8 | #define VT8500_PMSR_VIRT 0xf8130060 | ||
9 | |||
10 | static inline void arch_reset(char mode, const char *cmd) | ||
11 | { | ||
12 | writel(1, VT8500_PMSR_VIRT); | ||
13 | } | ||
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 @@ | |||
1 | /* linux/arch/arm/mach-vt8500/restart.c | ||
2 | * | ||
3 | * Copyright (C) 2012 Tony Prisk <linux@prisktech.co.nz> | ||
4 | * | ||
5 | * This software is licensed under the terms of the GNU General Public | ||
6 | * License version 2, as published by the Free Software Foundation, and | ||
7 | * may be copied, distributed, and modified under those terms. | ||
8 | * | ||
9 | * This program is distributed in the hope that it will be useful, | ||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | * GNU General Public License for more details. | ||
13 | * | ||
14 | */ | ||
15 | #include <asm/io.h> | ||
16 | #include <linux/of.h> | ||
17 | #include <linux/of_address.h> | ||
18 | |||
19 | #define LEGACY_PMC_BASE 0xD8130000 | ||
20 | #define WMT_PRIZM_PMSR_REG 0x60 | ||
21 | |||
22 | static void __iomem *pmc_base; | ||
23 | |||
24 | void wmt_setup_restart(void) | ||
25 | { | ||
26 | struct device_node *np; | ||
27 | |||
28 | /* | ||
29 | * Check if Power Mgmt Controller node is present in device tree. If no | ||
30 | * device tree node, use the legacy PMSR value (valid for all current | ||
31 | * SoCs). | ||
32 | */ | ||
33 | np = of_find_compatible_node(NULL, NULL, "wmt,prizm-pmc"); | ||
34 | if (np) { | ||
35 | pmc_base = of_iomap(np, 0); | ||
36 | |||
37 | if (!pmc_base) | ||
38 | pr_err("%s:of_iomap(pmc) failed\n", __func__); | ||
39 | |||
40 | of_node_put(np); | ||
41 | } else { | ||
42 | pmc_base = ioremap(LEGACY_PMC_BASE, 0x1000); | ||
43 | if (!pmc_base) { | ||
44 | pr_err("%s:ioremap(rstc) failed\n", __func__); | ||
45 | return; | ||
46 | } | ||
47 | } | ||
48 | } | ||
49 | |||
50 | void wmt_restart(char mode, const char *cmd) | ||
51 | { | ||
52 | if (pmc_base) | ||
53 | writel(1, pmc_base + WMT_PRIZM_PMSR_REG); | ||
54 | } | ||
diff --git a/arch/arm/mach-vt8500/wm8505_7in.c b/arch/arm/mach-vt8500/wm8505_7in.c index cf910a956080..db19886caf7c 100644 --- a/arch/arm/mach-vt8500/wm8505_7in.c +++ b/arch/arm/mach-vt8500/wm8505_7in.c | |||
@@ -23,6 +23,7 @@ | |||
23 | 23 | ||
24 | #include <asm/mach-types.h> | 24 | #include <asm/mach-types.h> |
25 | #include <asm/mach/arch.h> | 25 | #include <asm/mach/arch.h> |
26 | #include <mach/restart.h> | ||
26 | 27 | ||
27 | #include "devices.h" | 28 | #include "devices.h" |
28 | 29 | ||
@@ -61,7 +62,7 @@ void __init wm8505_7in_init(void) | |||
61 | pm_power_off = &vt8500_power_off; | 62 | pm_power_off = &vt8500_power_off; |
62 | else | 63 | else |
63 | printk(KERN_ERR "PMC Hibernation register could not be remapped, not enabling power off!\n"); | 64 | printk(KERN_ERR "PMC Hibernation register could not be remapped, not enabling power off!\n"); |
64 | 65 | wmt_setup_restart(); | |
65 | wm8505_set_resources(); | 66 | wm8505_set_resources(); |
66 | platform_add_devices(devices, ARRAY_SIZE(devices)); | 67 | platform_add_devices(devices, ARRAY_SIZE(devices)); |
67 | vt8500_gpio_init(); | 68 | vt8500_gpio_init(); |
@@ -69,6 +70,7 @@ void __init wm8505_7in_init(void) | |||
69 | 70 | ||
70 | MACHINE_START(WM8505_7IN_NETBOOK, "WM8505 7-inch generic netbook") | 71 | MACHINE_START(WM8505_7IN_NETBOOK, "WM8505 7-inch generic netbook") |
71 | .atag_offset = 0x100, | 72 | .atag_offset = 0x100, |
73 | .restart = wmt_restart, | ||
72 | .reserve = wm8505_reserve_mem, | 74 | .reserve = wm8505_reserve_mem, |
73 | .map_io = wm8505_map_io, | 75 | .map_io = wm8505_map_io, |
74 | .init_irq = wm8505_init_irq, | 76 | .init_irq = wm8505_init_irq, |