diff options
author | Haojian Zhuang <haojian.zhuang@linaro.org> | 2014-05-13 05:11:28 -0400 |
---|---|---|
committer | Olof Johansson <olof@lixom.net> | 2014-07-31 01:32:21 -0400 |
commit | 4a9b37371822c6b47fdd87118e4f91b5ebc70b6f (patch) | |
tree | d8f574cf2bbf95cb24cd483c08a87917c460cfba /arch/arm/mach-hisi | |
parent | 75a4795a1d1bccb2e7c7def1be50b32cd1389b6e (diff) |
power: reset: move hisilicon reboot code
Move reboot code from hisilicon platform driver into reset driver.
Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org>
Acked-by: Wei Xu <xuwei5@hisilicon.com>
Signed-off-by: Olof Johansson <olof@lixom.net>
Diffstat (limited to 'arch/arm/mach-hisi')
-rw-r--r-- | arch/arm/mach-hisi/Kconfig | 3 | ||||
-rw-r--r-- | arch/arm/mach-hisi/hisilicon.c | 33 |
2 files changed, 3 insertions, 33 deletions
diff --git a/arch/arm/mach-hisi/Kconfig b/arch/arm/mach-hisi/Kconfig index 90fdbb4ae00a..984882943f77 100644 --- a/arch/arm/mach-hisi/Kconfig +++ b/arch/arm/mach-hisi/Kconfig | |||
@@ -4,6 +4,9 @@ config ARCH_HISI | |||
4 | select ARM_AMBA | 4 | select ARM_AMBA |
5 | select ARM_GIC | 5 | select ARM_GIC |
6 | select ARM_TIMER_SP804 | 6 | select ARM_TIMER_SP804 |
7 | select POWER_RESET | ||
8 | select POWER_RESET_HISI | ||
9 | select POWER_SUPPLY | ||
7 | 10 | ||
8 | if ARCH_HISI | 11 | if ARCH_HISI |
9 | 12 | ||
diff --git a/arch/arm/mach-hisi/hisilicon.c b/arch/arm/mach-hisi/hisilicon.c index 2bfbe3f1392d..7996c6b74339 100644 --- a/arch/arm/mach-hisi/hisilicon.c +++ b/arch/arm/mach-hisi/hisilicon.c | |||
@@ -14,10 +14,6 @@ | |||
14 | #include <linux/clk-provider.h> | 14 | #include <linux/clk-provider.h> |
15 | #include <linux/clocksource.h> | 15 | #include <linux/clocksource.h> |
16 | #include <linux/irqchip.h> | 16 | #include <linux/irqchip.h> |
17 | #include <linux/of_address.h> | ||
18 | #include <linux/of_platform.h> | ||
19 | |||
20 | #include <asm/proc-fns.h> | ||
21 | 17 | ||
22 | #include <asm/mach/arch.h> | 18 | #include <asm/mach/arch.h> |
23 | #include <asm/mach/map.h> | 19 | #include <asm/mach/map.h> |
@@ -51,32 +47,6 @@ static void __init hi3620_map_io(void) | |||
51 | iotable_init(hi3620_io_desc, ARRAY_SIZE(hi3620_io_desc)); | 47 | iotable_init(hi3620_io_desc, ARRAY_SIZE(hi3620_io_desc)); |
52 | } | 48 | } |
53 | 49 | ||
54 | static void hi3xxx_restart(enum reboot_mode mode, const char *cmd) | ||
55 | { | ||
56 | struct device_node *np; | ||
57 | void __iomem *base; | ||
58 | int offset; | ||
59 | |||
60 | np = of_find_compatible_node(NULL, NULL, "hisilicon,sysctrl"); | ||
61 | if (!np) { | ||
62 | pr_err("failed to find hisilicon,sysctrl node\n"); | ||
63 | return; | ||
64 | } | ||
65 | base = of_iomap(np, 0); | ||
66 | if (!base) { | ||
67 | pr_err("failed to map address in hisilicon,sysctrl node\n"); | ||
68 | return; | ||
69 | } | ||
70 | if (of_property_read_u32(np, "reboot-offset", &offset) < 0) { | ||
71 | pr_err("failed to find reboot-offset property\n"); | ||
72 | return; | ||
73 | } | ||
74 | writel_relaxed(0xdeadbeef, base + offset); | ||
75 | |||
76 | while (1) | ||
77 | cpu_do_idle(); | ||
78 | } | ||
79 | |||
80 | static const char *hi3xxx_compat[] __initconst = { | 50 | static const char *hi3xxx_compat[] __initconst = { |
81 | "hisilicon,hi3620-hi4511", | 51 | "hisilicon,hi3620-hi4511", |
82 | NULL, | 52 | NULL, |
@@ -86,7 +56,6 @@ DT_MACHINE_START(HI3620, "Hisilicon Hi3620 (Flattened Device Tree)") | |||
86 | .map_io = hi3620_map_io, | 56 | .map_io = hi3620_map_io, |
87 | .dt_compat = hi3xxx_compat, | 57 | .dt_compat = hi3xxx_compat, |
88 | .smp = smp_ops(hi3xxx_smp_ops), | 58 | .smp = smp_ops(hi3xxx_smp_ops), |
89 | .restart = hi3xxx_restart, | ||
90 | MACHINE_END | 59 | MACHINE_END |
91 | 60 | ||
92 | static const char *hix5hd2_compat[] __initconst = { | 61 | static const char *hix5hd2_compat[] __initconst = { |
@@ -96,7 +65,5 @@ static const char *hix5hd2_compat[] __initconst = { | |||
96 | 65 | ||
97 | DT_MACHINE_START(HIX5HD2_DT, "Hisilicon HIX5HD2 (Flattened Device Tree)") | 66 | DT_MACHINE_START(HIX5HD2_DT, "Hisilicon HIX5HD2 (Flattened Device Tree)") |
98 | .dt_compat = hix5hd2_compat, | 67 | .dt_compat = hix5hd2_compat, |
99 | .init_late = hi3xxx_init_late, | ||
100 | .smp = smp_ops(hix5hd2_smp_ops), | 68 | .smp = smp_ops(hix5hd2_smp_ops), |
101 | .restart = hi3xxx_restart, | ||
102 | MACHINE_END | 69 | MACHINE_END |