MIPS: SEAD3: Reset via generic syscon-reboot driver & DT
authorPaul Burton <paul.burton@imgtec.com>
Fri, 26 Aug 2016 14:17:43 +0000 (15:17 +0100)
committerRalf Baechle <ralf@linux-mips.org>
Tue, 4 Oct 2016 23:31:20 +0000 (01:31 +0200)
Remove the SEAD3 implementation of _machine_restart & instead make use
of the generic syscon-reboot driver probed via device tree.

Signed-off-by: Paul Burton <paul.burton@imgtec.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/14056/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
arch/mips/boot/dts/mti/sead3.dts
arch/mips/configs/sead3_defconfig
arch/mips/mti-sead3/sead3-reset.c

index 0159450418edf8d3b7db8f531c9ff69672e8800c..047ff7aa5c21e71b9d827751a6d198b3ec3b5802 100644 (file)
                };
        };
 
+       fpga_regs: system-controller@1f000000 {
+               compatible = "mti,sead3-fpga", "syscon", "simple-mfd";
+               reg = <0x1f000000 0x200>;
+
+               reboot {
+                       compatible = "syscon-reboot";
+                       regmap = <&fpga_regs>;
+                       offset = <0x50>;
+                       mask = <0x4d>;
+               };
+       };
+
        system-controller@1f000200 {
                compatible = "mti,sead3-cpld", "syscon", "simple-mfd";
                reg = <0x1f000200 0x300>;
index e1c6582ac7108d6671d2eb60db8f37dd299200bf..055af307265227291a5bf8a580d00b7d98a352a5 100644 (file)
@@ -80,8 +80,9 @@ CONFIG_I2C=y
 CONFIG_I2C_CHARDEV=y
 # CONFIG_I2C_HELPER_AUTO is not set
 CONFIG_SPI=y
+CONFIG_POWER_RESET=y
+CONFIG_POWER_RESET_SYSCON=y
 CONFIG_SENSORS_ADT7475=y
-CONFIG_MFD_SYSCON=y
 CONFIG_BACKLIGHT_LCD_SUPPORT=y
 CONFIG_LCD_CLASS_DEVICE=y
 CONFIG_BACKLIGHT_CLASS_DEVICE=y
index e6fb24414a70e14249f8a669d6c66349bf0792be..8f548f02eb4938c761ec256f9874b72c015927d0 100644 (file)
 #define SOFTRES_REG    0x1f000050
 #define GORESET                0x4d
 
-static void mips_machine_restart(char *command)
-{
-       unsigned int __iomem *softres_reg =
-               ioremap(SOFTRES_REG, sizeof(unsigned int));
-
-       __raw_writel(GORESET, softres_reg);
-}
-
 static void mips_machine_halt(void)
 {
        unsigned int __iomem *softres_reg =
@@ -31,7 +23,6 @@ static void mips_machine_halt(void)
 
 static int __init mips_reboot_setup(void)
 {
-       _machine_restart = mips_machine_restart;
        _machine_halt = mips_machine_halt;
        pm_power_off = mips_machine_halt;