aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Burton <paul.burton@imgtec.com>2016-09-19 17:21:28 -0400
committerRalf Baechle <ralf@linux-mips.org>2016-10-06 11:31:01 -0400
commit10b6ea0959de2c42b9f105c88b51a54c4dd961c2 (patch)
tree3d601ff11549784c6e1a07d6248ab8ed05e79530
parent97af8e1cb31870c6f4ca175d5eada7be5cc65e0f (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.dts12
-rw-r--r--arch/mips/configs/malta_defconfig2
-rw-r--r--arch/mips/configs/malta_kvm_defconfig2
-rw-r--r--arch/mips/configs/malta_kvm_guest_defconfig2
-rw-r--r--arch/mips/configs/malta_qemu_32r6_defconfig2
-rw-r--r--arch/mips/configs/maltaaprp_defconfig2
-rw-r--r--arch/mips/configs/maltasmvp_defconfig2
-rw-r--r--arch/mips/configs/maltasmvp_eva_defconfig2
-rw-r--r--arch/mips/configs/maltaup_defconfig2
-rw-r--r--arch/mips/configs/maltaup_xpa_defconfig2
-rw-r--r--arch/mips/mti-malta/malta-reset.c15
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
319CONFIG_SERIAL_8250=y 319CONFIG_SERIAL_8250=y
320CONFIG_SERIAL_8250_CONSOLE=y 320CONFIG_SERIAL_8250_CONSOLE=y
321CONFIG_POWER_RESET=y
322CONFIG_POWER_RESET_SYSCON=y
321# CONFIG_HWMON is not set 323# CONFIG_HWMON is not set
322CONFIG_FB=y 324CONFIG_FB=y
323CONFIG_FB_CIRRUS=y 325CONFIG_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
332CONFIG_SERIAL_8250=y 332CONFIG_SERIAL_8250=y
333CONFIG_SERIAL_8250_CONSOLE=y 333CONFIG_SERIAL_8250_CONSOLE=y
334CONFIG_POWER_RESET=y
335CONFIG_POWER_RESET_SYSCON=y
334# CONFIG_HWMON is not set 336# CONFIG_HWMON is not set
335CONFIG_FB=y 337CONFIG_FB=y
336CONFIG_FB_CIRRUS=y 338CONFIG_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
332CONFIG_SERIAL_8250=y 332CONFIG_SERIAL_8250=y
333CONFIG_SERIAL_8250_CONSOLE=y 333CONFIG_SERIAL_8250_CONSOLE=y
334CONFIG_POWER_RESET=y
335CONFIG_POWER_RESET_SYSCON=y
334# CONFIG_HWMON is not set 336# CONFIG_HWMON is not set
335CONFIG_FB=y 337CONFIG_FB=y
336CONFIG_FB_CIRRUS=y 338CONFIG_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
132CONFIG_SERIAL_8250=y 132CONFIG_SERIAL_8250=y
133CONFIG_SERIAL_8250_CONSOLE=y 133CONFIG_SERIAL_8250_CONSOLE=y
134CONFIG_HW_RANDOM=y 134CONFIG_HW_RANDOM=y
135CONFIG_POWER_RESET=y
136CONFIG_POWER_RESET_SYSCON=y
135# CONFIG_HWMON is not set 137# CONFIG_HWMON is not set
136CONFIG_FB=y 138CONFIG_FB=y
137CONFIG_FIRMWARE_EDID=y 139CONFIG_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
132CONFIG_SERIAL_8250=y 132CONFIG_SERIAL_8250=y
133CONFIG_SERIAL_8250_CONSOLE=y 133CONFIG_SERIAL_8250_CONSOLE=y
134CONFIG_HW_RANDOM=y 134CONFIG_HW_RANDOM=y
135CONFIG_POWER_RESET=y
136CONFIG_POWER_RESET_SYSCON=y
135# CONFIG_HWMON is not set 137# CONFIG_HWMON is not set
136CONFIG_VIDEO_OUTPUT_CONTROL=m 138CONFIG_VIDEO_OUTPUT_CONTROL=m
137CONFIG_FB=y 139CONFIG_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
134CONFIG_SERIAL_8250=y 134CONFIG_SERIAL_8250=y
135CONFIG_SERIAL_8250_CONSOLE=y 135CONFIG_SERIAL_8250_CONSOLE=y
136CONFIG_HW_RANDOM=y 136CONFIG_HW_RANDOM=y
137CONFIG_POWER_RESET=y
138CONFIG_POWER_RESET_SYSCON=y
137# CONFIG_HWMON is not set 139# CONFIG_HWMON is not set
138CONFIG_FB=y 140CONFIG_FB=y
139CONFIG_FIRMWARE_EDID=y 141CONFIG_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
137CONFIG_SERIAL_8250=y 137CONFIG_SERIAL_8250=y
138CONFIG_SERIAL_8250_CONSOLE=y 138CONFIG_SERIAL_8250_CONSOLE=y
139CONFIG_HW_RANDOM=y 139CONFIG_HW_RANDOM=y
140CONFIG_POWER_RESET=y
141CONFIG_POWER_RESET_SYSCON=y
140# CONFIG_HWMON is not set 142# CONFIG_HWMON is not set
141CONFIG_VIDEO_OUTPUT_CONTROL=m 143CONFIG_VIDEO_OUTPUT_CONTROL=m
142CONFIG_FB=y 144CONFIG_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
131CONFIG_SERIAL_8250=y 131CONFIG_SERIAL_8250=y
132CONFIG_SERIAL_8250_CONSOLE=y 132CONFIG_SERIAL_8250_CONSOLE=y
133CONFIG_HW_RANDOM=y 133CONFIG_HW_RANDOM=y
134CONFIG_POWER_RESET=y
135CONFIG_POWER_RESET_SYSCON=y
134# CONFIG_HWMON is not set 136# CONFIG_HWMON is not set
135CONFIG_VIDEO_OUTPUT_CONTROL=m 137CONFIG_VIDEO_OUTPUT_CONTROL=m
136CONFIG_FB=y 138CONFIG_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
327CONFIG_SERIAL_8250=y 327CONFIG_SERIAL_8250=y
328CONFIG_SERIAL_8250_CONSOLE=y 328CONFIG_SERIAL_8250_CONSOLE=y
329CONFIG_POWER_RESET=y
330CONFIG_POWER_RESET_SYSCON=y
329# CONFIG_HWMON is not set 331# CONFIG_HWMON is not set
330CONFIG_FB=y 332CONFIG_FB=y
331CONFIG_FB_CIRRUS=y 333CONFIG_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
18static 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
26static void mips_machine_halt(void) 16static 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
39static int __init mips_reboot_setup(void) 29static 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