diff options
author | Paul Burton <paul.burton@imgtec.com> | 2016-09-19 17:21:28 -0400 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2016-10-06 11:31:01 -0400 |
commit | 10b6ea0959de2c42b9f105c88b51a54c4dd961c2 (patch) | |
tree | 3d601ff11549784c6e1a07d6248ab8ed05e79530 | |
parent | 97af8e1cb31870c6f4ca175d5eada7be5cc65e0f (diff) |
MIPS: Malta: Use syscon-reboot driver to reboot
Make use of the generic syscon-reboot driver to reboot the Malta board,
reducing the amount of platform code it requires.
Signed-off-by: Paul Burton <paul.burton@imgtec.com>
Cc: Stephan Linz <linz@li-pro.net>
Cc: Jacek Anaszewski <j.anaszewski@samsung.com>
Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Cc: Rob Herring <robh+dt@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: linux-mips@linux-mips.org
Cc: devicetree@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/14279/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
-rw-r--r-- | arch/mips/boot/dts/mti/malta.dts | 12 | ||||
-rw-r--r-- | arch/mips/configs/malta_defconfig | 2 | ||||
-rw-r--r-- | arch/mips/configs/malta_kvm_defconfig | 2 | ||||
-rw-r--r-- | arch/mips/configs/malta_kvm_guest_defconfig | 2 | ||||
-rw-r--r-- | arch/mips/configs/malta_qemu_32r6_defconfig | 2 | ||||
-rw-r--r-- | arch/mips/configs/maltaaprp_defconfig | 2 | ||||
-rw-r--r-- | arch/mips/configs/maltasmvp_defconfig | 2 | ||||
-rw-r--r-- | arch/mips/configs/maltasmvp_eva_defconfig | 2 | ||||
-rw-r--r-- | arch/mips/configs/maltaup_defconfig | 2 | ||||
-rw-r--r-- | arch/mips/configs/maltaup_xpa_defconfig | 2 | ||||
-rw-r--r-- | arch/mips/mti-malta/malta-reset.c | 15 |
11 files changed, 32 insertions, 13 deletions
diff --git a/arch/mips/boot/dts/mti/malta.dts b/arch/mips/boot/dts/mti/malta.dts index 48783b13f889..f604a272d91d 100644 --- a/arch/mips/boot/dts/mti/malta.dts +++ b/arch/mips/boot/dts/mti/malta.dts | |||
@@ -81,6 +81,18 @@ | |||
81 | }; | 81 | }; |
82 | }; | 82 | }; |
83 | 83 | ||
84 | fpga_regs: system-controller@1f000000 { | ||
85 | compatible = "mti,malta-fpga", "syscon", "simple-mfd"; | ||
86 | reg = <0x1f000000 0x1000>; | ||
87 | |||
88 | reboot { | ||
89 | compatible = "syscon-reboot"; | ||
90 | regmap = <&fpga_regs>; | ||
91 | offset = <0x500>; | ||
92 | mask = <0x4d>; | ||
93 | }; | ||
94 | }; | ||
95 | |||
84 | isa { | 96 | isa { |
85 | compatible = "isa"; | 97 | compatible = "isa"; |
86 | #address-cells = <2>; | 98 | #address-cells = <2>; |
diff --git a/arch/mips/configs/malta_defconfig b/arch/mips/configs/malta_defconfig index d5d4816a1dd8..58d43f3c348d 100644 --- a/arch/mips/configs/malta_defconfig +++ b/arch/mips/configs/malta_defconfig | |||
@@ -318,6 +318,8 @@ CONFIG_LIBERTAS=m | |||
318 | # CONFIG_SERIO_I8042 is not set | 318 | # CONFIG_SERIO_I8042 is not set |
319 | CONFIG_SERIAL_8250=y | 319 | CONFIG_SERIAL_8250=y |
320 | CONFIG_SERIAL_8250_CONSOLE=y | 320 | CONFIG_SERIAL_8250_CONSOLE=y |
321 | CONFIG_POWER_RESET=y | ||
322 | CONFIG_POWER_RESET_SYSCON=y | ||
321 | # CONFIG_HWMON is not set | 323 | # CONFIG_HWMON is not set |
322 | CONFIG_FB=y | 324 | CONFIG_FB=y |
323 | CONFIG_FB_CIRRUS=y | 325 | CONFIG_FB_CIRRUS=y |
diff --git a/arch/mips/configs/malta_kvm_defconfig b/arch/mips/configs/malta_kvm_defconfig index ef6ef24c6213..c8f7e2835840 100644 --- a/arch/mips/configs/malta_kvm_defconfig +++ b/arch/mips/configs/malta_kvm_defconfig | |||
@@ -331,6 +331,8 @@ CONFIG_LIBERTAS=m | |||
331 | # CONFIG_SERIO_I8042 is not set | 331 | # CONFIG_SERIO_I8042 is not set |
332 | CONFIG_SERIAL_8250=y | 332 | CONFIG_SERIAL_8250=y |
333 | CONFIG_SERIAL_8250_CONSOLE=y | 333 | CONFIG_SERIAL_8250_CONSOLE=y |
334 | CONFIG_POWER_RESET=y | ||
335 | CONFIG_POWER_RESET_SYSCON=y | ||
334 | # CONFIG_HWMON is not set | 336 | # CONFIG_HWMON is not set |
335 | CONFIG_FB=y | 337 | CONFIG_FB=y |
336 | CONFIG_FB_CIRRUS=y | 338 | CONFIG_FB_CIRRUS=y |
diff --git a/arch/mips/configs/malta_kvm_guest_defconfig b/arch/mips/configs/malta_kvm_guest_defconfig index 3a49a770eb41..d2f54e55356c 100644 --- a/arch/mips/configs/malta_kvm_guest_defconfig +++ b/arch/mips/configs/malta_kvm_guest_defconfig | |||
@@ -331,6 +331,8 @@ CONFIG_LIBERTAS=m | |||
331 | # CONFIG_SERIO_I8042 is not set | 331 | # CONFIG_SERIO_I8042 is not set |
332 | CONFIG_SERIAL_8250=y | 332 | CONFIG_SERIAL_8250=y |
333 | CONFIG_SERIAL_8250_CONSOLE=y | 333 | CONFIG_SERIAL_8250_CONSOLE=y |
334 | CONFIG_POWER_RESET=y | ||
335 | CONFIG_POWER_RESET_SYSCON=y | ||
334 | # CONFIG_HWMON is not set | 336 | # CONFIG_HWMON is not set |
335 | CONFIG_FB=y | 337 | CONFIG_FB=y |
336 | CONFIG_FB_CIRRUS=y | 338 | CONFIG_FB_CIRRUS=y |
diff --git a/arch/mips/configs/malta_qemu_32r6_defconfig b/arch/mips/configs/malta_qemu_32r6_defconfig index 65f140e1e872..cbf37dd0c490 100644 --- a/arch/mips/configs/malta_qemu_32r6_defconfig +++ b/arch/mips/configs/malta_qemu_32r6_defconfig | |||
@@ -132,6 +132,8 @@ CONFIG_LEGACY_PTY_COUNT=4 | |||
132 | CONFIG_SERIAL_8250=y | 132 | CONFIG_SERIAL_8250=y |
133 | CONFIG_SERIAL_8250_CONSOLE=y | 133 | CONFIG_SERIAL_8250_CONSOLE=y |
134 | CONFIG_HW_RANDOM=y | 134 | CONFIG_HW_RANDOM=y |
135 | CONFIG_POWER_RESET=y | ||
136 | CONFIG_POWER_RESET_SYSCON=y | ||
135 | # CONFIG_HWMON is not set | 137 | # CONFIG_HWMON is not set |
136 | CONFIG_FB=y | 138 | CONFIG_FB=y |
137 | CONFIG_FIRMWARE_EDID=y | 139 | CONFIG_FIRMWARE_EDID=y |
diff --git a/arch/mips/configs/maltaaprp_defconfig b/arch/mips/configs/maltaaprp_defconfig index 799c4338fd5e..35f6ba260df8 100644 --- a/arch/mips/configs/maltaaprp_defconfig +++ b/arch/mips/configs/maltaaprp_defconfig | |||
@@ -132,6 +132,8 @@ CONFIG_LEGACY_PTY_COUNT=16 | |||
132 | CONFIG_SERIAL_8250=y | 132 | CONFIG_SERIAL_8250=y |
133 | CONFIG_SERIAL_8250_CONSOLE=y | 133 | CONFIG_SERIAL_8250_CONSOLE=y |
134 | CONFIG_HW_RANDOM=y | 134 | CONFIG_HW_RANDOM=y |
135 | CONFIG_POWER_RESET=y | ||
136 | CONFIG_POWER_RESET_SYSCON=y | ||
135 | # CONFIG_HWMON is not set | 137 | # CONFIG_HWMON is not set |
136 | CONFIG_VIDEO_OUTPUT_CONTROL=m | 138 | CONFIG_VIDEO_OUTPUT_CONTROL=m |
137 | CONFIG_FB=y | 139 | CONFIG_FB=y |
diff --git a/arch/mips/configs/maltasmvp_defconfig b/arch/mips/configs/maltasmvp_defconfig index ac0eb4daf101..900f14543eeb 100644 --- a/arch/mips/configs/maltasmvp_defconfig +++ b/arch/mips/configs/maltasmvp_defconfig | |||
@@ -134,6 +134,8 @@ CONFIG_LEGACY_PTY_COUNT=4 | |||
134 | CONFIG_SERIAL_8250=y | 134 | CONFIG_SERIAL_8250=y |
135 | CONFIG_SERIAL_8250_CONSOLE=y | 135 | CONFIG_SERIAL_8250_CONSOLE=y |
136 | CONFIG_HW_RANDOM=y | 136 | CONFIG_HW_RANDOM=y |
137 | CONFIG_POWER_RESET=y | ||
138 | CONFIG_POWER_RESET_SYSCON=y | ||
137 | # CONFIG_HWMON is not set | 139 | # CONFIG_HWMON is not set |
138 | CONFIG_FB=y | 140 | CONFIG_FB=y |
139 | CONFIG_FIRMWARE_EDID=y | 141 | CONFIG_FIRMWARE_EDID=y |
diff --git a/arch/mips/configs/maltasmvp_eva_defconfig b/arch/mips/configs/maltasmvp_eva_defconfig index 31846000530f..8e2738b5e180 100644 --- a/arch/mips/configs/maltasmvp_eva_defconfig +++ b/arch/mips/configs/maltasmvp_eva_defconfig | |||
@@ -137,6 +137,8 @@ CONFIG_LEGACY_PTY_COUNT=4 | |||
137 | CONFIG_SERIAL_8250=y | 137 | CONFIG_SERIAL_8250=y |
138 | CONFIG_SERIAL_8250_CONSOLE=y | 138 | CONFIG_SERIAL_8250_CONSOLE=y |
139 | CONFIG_HW_RANDOM=y | 139 | CONFIG_HW_RANDOM=y |
140 | CONFIG_POWER_RESET=y | ||
141 | CONFIG_POWER_RESET_SYSCON=y | ||
140 | # CONFIG_HWMON is not set | 142 | # CONFIG_HWMON is not set |
141 | CONFIG_VIDEO_OUTPUT_CONTROL=m | 143 | CONFIG_VIDEO_OUTPUT_CONTROL=m |
142 | CONFIG_FB=y | 144 | CONFIG_FB=y |
diff --git a/arch/mips/configs/maltaup_defconfig b/arch/mips/configs/maltaup_defconfig index a79107da0675..6dc4e309a691 100644 --- a/arch/mips/configs/maltaup_defconfig +++ b/arch/mips/configs/maltaup_defconfig | |||
@@ -131,6 +131,8 @@ CONFIG_LEGACY_PTY_COUNT=16 | |||
131 | CONFIG_SERIAL_8250=y | 131 | CONFIG_SERIAL_8250=y |
132 | CONFIG_SERIAL_8250_CONSOLE=y | 132 | CONFIG_SERIAL_8250_CONSOLE=y |
133 | CONFIG_HW_RANDOM=y | 133 | CONFIG_HW_RANDOM=y |
134 | CONFIG_POWER_RESET=y | ||
135 | CONFIG_POWER_RESET_SYSCON=y | ||
134 | # CONFIG_HWMON is not set | 136 | # CONFIG_HWMON is not set |
135 | CONFIG_VIDEO_OUTPUT_CONTROL=m | 137 | CONFIG_VIDEO_OUTPUT_CONTROL=m |
136 | CONFIG_FB=y | 138 | CONFIG_FB=y |
diff --git a/arch/mips/configs/maltaup_xpa_defconfig b/arch/mips/configs/maltaup_xpa_defconfig index 62e05eb3bb54..3d0d9cb9673f 100644 --- a/arch/mips/configs/maltaup_xpa_defconfig +++ b/arch/mips/configs/maltaup_xpa_defconfig | |||
@@ -326,6 +326,8 @@ CONFIG_LIBERTAS=m | |||
326 | # CONFIG_SERIO_I8042 is not set | 326 | # CONFIG_SERIO_I8042 is not set |
327 | CONFIG_SERIAL_8250=y | 327 | CONFIG_SERIAL_8250=y |
328 | CONFIG_SERIAL_8250_CONSOLE=y | 328 | CONFIG_SERIAL_8250_CONSOLE=y |
329 | CONFIG_POWER_RESET=y | ||
330 | CONFIG_POWER_RESET_SYSCON=y | ||
329 | # CONFIG_HWMON is not set | 331 | # CONFIG_HWMON is not set |
330 | CONFIG_FB=y | 332 | CONFIG_FB=y |
331 | CONFIG_FB_CIRRUS=y | 333 | CONFIG_FB_CIRRUS=y |
diff --git a/arch/mips/mti-malta/malta-reset.c b/arch/mips/mti-malta/malta-reset.c index 2fd2cc2c5034..04d6b9c8a946 100644 --- a/arch/mips/mti-malta/malta-reset.c +++ b/arch/mips/mti-malta/malta-reset.c | |||
@@ -8,21 +8,11 @@ | |||
8 | */ | 8 | */ |
9 | #include <linux/io.h> | 9 | #include <linux/io.h> |
10 | #include <linux/pm.h> | 10 | #include <linux/pm.h> |
11 | #include <linux/reboot.h> | ||
11 | 12 | ||
12 | #include <asm/reboot.h> | 13 | #include <asm/reboot.h> |
13 | #include <asm/mach-malta/malta-pm.h> | 14 | #include <asm/mach-malta/malta-pm.h> |
14 | 15 | ||
15 | #define SOFTRES_REG 0x1f000500 | ||
16 | #define GORESET 0x42 | ||
17 | |||
18 | static void mips_machine_restart(char *command) | ||
19 | { | ||
20 | unsigned int __iomem *softres_reg = | ||
21 | ioremap(SOFTRES_REG, sizeof(unsigned int)); | ||
22 | |||
23 | __raw_writel(GORESET, softres_reg); | ||
24 | } | ||
25 | |||
26 | static void mips_machine_halt(void) | 16 | static void mips_machine_halt(void) |
27 | { | 17 | { |
28 | while (true); | 18 | while (true); |
@@ -33,12 +23,11 @@ static void mips_machine_power_off(void) | |||
33 | mips_pm_suspend(PIIX4_FUNC3IO_PMCNTRL_SUS_TYP_SOFF); | 23 | mips_pm_suspend(PIIX4_FUNC3IO_PMCNTRL_SUS_TYP_SOFF); |
34 | 24 | ||
35 | pr_info("Failed to power down, resetting\n"); | 25 | pr_info("Failed to power down, resetting\n"); |
36 | mips_machine_restart(NULL); | 26 | machine_restart(NULL); |
37 | } | 27 | } |
38 | 28 | ||
39 | static int __init mips_reboot_setup(void) | 29 | static int __init mips_reboot_setup(void) |
40 | { | 30 | { |
41 | _machine_restart = mips_machine_restart; | ||
42 | _machine_halt = mips_machine_halt; | 31 | _machine_halt = mips_machine_halt; |
43 | pm_power_off = mips_machine_power_off; | 32 | pm_power_off = mips_machine_power_off; |
44 | 33 | ||