]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
MIPS: Loongson1: Add watchdog support for Loongson1 board
authorYang Ling <gnaygnil@gmail.com>
Sun, 4 Dec 2016 15:05:40 +0000 (23:05 +0800)
committerRalf Baechle <ralf@linux-mips.org>
Tue, 3 Jan 2017 15:34:42 +0000 (16:34 +0100)
The patch adds watchdog support for Loongson1 board.

Signed-off-by: Yang Ling <gnaygnil@gmail.com>
Cc: keguang.zhang@gmail.com
Cc: linux-mips@linux-mips.org
Cc: linux-kernel@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/14644/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
arch/mips/configs/loongson1b_defconfig
arch/mips/configs/loongson1c_defconfig
arch/mips/include/asm/mach-loongson32/platform.h
arch/mips/loongson32/common/platform.c
arch/mips/loongson32/ls1b/board.c
arch/mips/loongson32/ls1c/board.c

index c442f27685f4fd9338ea57cdc1d1a463a11eaf33..914c867887bd5d7f8569105c5757481de5f05512 100644 (file)
@@ -74,6 +74,10 @@ CONFIG_SERIAL_8250_CONSOLE=y
 CONFIG_GPIOLIB=y
 CONFIG_GPIO_LOONGSON1=y
 # CONFIG_HWMON is not set
+CONFIG_WATCHDOG=y
+CONFIG_WATCHDOG_NOWAYOUT=y
+CONFIG_WATCHDOG_SYSFS=y
+CONFIG_LOONGSON1_WDT=y
 # CONFIG_VGA_CONSOLE is not set
 CONFIG_HID_GENERIC=m
 CONFIG_USB_HID=m
index 2304d4165773083f5e477d6f89d7ee88ba03a30f..68e42eff908e2771a43ba66702738a6be40f892a 100644 (file)
@@ -75,6 +75,10 @@ CONFIG_SERIAL_8250_CONSOLE=y
 CONFIG_GPIOLIB=y
 CONFIG_GPIO_LOONGSON1=y
 # CONFIG_HWMON is not set
+CONFIG_WATCHDOG=y
+CONFIG_WATCHDOG_NOWAYOUT=y
+CONFIG_WATCHDOG_SYSFS=y
+CONFIG_LOONGSON1_WDT=y
 # CONFIG_VGA_CONSOLE is not set
 CONFIG_HID_GENERIC=m
 CONFIG_USB_HID=m
index 7adc313649395265c168178528d928d16b7483ac..8f8fa43ba095dd35a04a12cbc7af599c86ba9dda 100644 (file)
@@ -1,9 +1,9 @@
 /*
  * Copyright (c) 2011 Zhang, Keguang <keguang.zhang@gmail.com>
  *
- * This program is free software; you can redistribute it and/or modify it
- * under  the terms of the GNU General  Public License as published by the
- * Free Software Foundation;  either version 2 of the  License, or (at your
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
  * option) any later version.
  */
 
@@ -25,11 +25,12 @@ extern struct platform_device ls1x_gpio0_pdev;
 extern struct platform_device ls1x_gpio1_pdev;
 extern struct platform_device ls1x_nand_pdev;
 extern struct platform_device ls1x_rtc_pdev;
+extern struct platform_device ls1x_wdt_pdev;
 
 void __init ls1x_clk_init(void);
 void __init ls1x_dma_set_platdata(struct plat_ls1x_dma *pdata);
 void __init ls1x_nand_set_platdata(struct plat_ls1x_nand *pdata);
-void __init ls1x_serial_set_uartclk(struct platform_device *pdev);
 void __init ls1x_rtc_set_extclk(struct platform_device *pdev);
+void __init ls1x_serial_set_uartclk(struct platform_device *pdev);
 
 #endif /* __ASM_MACH_LOONGSON32_PLATFORM_H */
index 18c2959afe0799b781f465488d4f46646cbb19ff..a3dabe940b03ac699b3e4fd9f0ec83f64dece1b0 100644 (file)
@@ -356,3 +356,19 @@ struct platform_device ls1x_rtc_pdev = {
        .name           = "ls1x-rtc",
        .id             = -1,
 };
+
+/* Watchdog */
+static struct resource ls1x_wdt_resources[] = {
+       {
+               .start  = LS1X_WDT_BASE,
+               .end    = LS1X_WDT_BASE + SZ_16 - 1,
+               .flags  = IORESOURCE_MEM,
+       },
+};
+
+struct platform_device ls1x_wdt_pdev = {
+       .name           = "ls1x-wdt",
+       .id             = -1,
+       .num_resources  = ARRAY_SIZE(ls1x_wdt_resources),
+       .resource       = ls1x_wdt_resources,
+};
index 38a1d404be1b0268a3700ffbb304897b378668b0..01aceaace314d0f57fd8d82cc453eac499f8ca4f 100644 (file)
@@ -1,9 +1,9 @@
 /*
  * Copyright (c) 2011-2016 Zhang, Keguang <keguang.zhang@gmail.com>
  *
- * This program is free software; you can redistribute it and/or modify it
- * under  the terms of the GNU General  Public License as published by the
- * Free Software Foundation;  either version 2 of the  License, or (at your
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
  * option) any later version.
  */
 
@@ -72,6 +72,7 @@ static struct platform_device *ls1b_platform_devices[] __initdata = {
        &ls1x_gpio1_pdev,
        &ls1x_nand_pdev,
        &ls1x_rtc_pdev,
+       &ls1x_wdt_pdev,
 };
 
 static int __init ls1b_platform_init(void)
index a96bed5e3ea6025fe704fc951d4844250577ed3b..eb2d913c694fd9562dd2bde2fe8238397cdf3eff 100644 (file)
@@ -1,9 +1,9 @@
 /*
  * Copyright (c) 2016 Yang Ling <gnaygnil@gmail.com>
  *
- * This program is free software; you can redistribute it and/or modify it
- * under  the terms of the GNU General  Public License as published by the
- * Free Software Foundation;  either version 2 of the  License, or (at your
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
  * option) any later version.
  */
 
@@ -13,6 +13,7 @@ static struct platform_device *ls1c_platform_devices[] __initdata = {
        &ls1x_uart_pdev,
        &ls1x_eth0_pdev,
        &ls1x_rtc_pdev,
+       &ls1x_wdt_pdev,
 };
 
 static int __init ls1c_platform_init(void)