diff options
33 files changed, 329 insertions, 210 deletions
diff --git a/Documentation/devicetree/bindings/watchdog/nuvoton,npcm-wdt.txt b/Documentation/devicetree/bindings/watchdog/nuvoton,npcm-wdt.txt new file mode 100644 index 000000000000..6d593003c933 --- /dev/null +++ b/Documentation/devicetree/bindings/watchdog/nuvoton,npcm-wdt.txt | |||
@@ -0,0 +1,28 @@ | |||
1 | Nuvoton NPCM Watchdog | ||
2 | |||
3 | Nuvoton NPCM timer module provides five 24-bit timer counters, and a watchdog. | ||
4 | The watchdog supports a pre-timeout interrupt that fires 10ms before the | ||
5 | expiry. | ||
6 | |||
7 | Required properties: | ||
8 | - compatible : "nuvoton,npcm750-wdt" for NPCM750 (Poleg). | ||
9 | - reg : Offset and length of the register set for the device. | ||
10 | - interrupts : Contain the timer interrupt with flags for | ||
11 | falling edge. | ||
12 | |||
13 | Required clocking property, have to be one of: | ||
14 | - clocks : phandle of timer reference clock. | ||
15 | - clock-frequency : The frequency in Hz of the clock that drives the NPCM7xx | ||
16 | timer (usually 25000000). | ||
17 | |||
18 | Optional properties: | ||
19 | - timeout-sec : Contains the watchdog timeout in seconds | ||
20 | |||
21 | Example: | ||
22 | |||
23 | timer@f000801c { | ||
24 | compatible = "nuvoton,npcm750-wdt"; | ||
25 | interrupts = <GIC_SPI 47 IRQ_TYPE_LEVEL_HIGH>; | ||
26 | reg = <0xf000801c 0x4>; | ||
27 | clocks = <&clk NPCM7XX_CLK_TIMER>; | ||
28 | }; | ||
diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig index e873522fca2d..db96b92dbe69 100644 --- a/drivers/watchdog/Kconfig +++ b/drivers/watchdog/Kconfig | |||
@@ -514,6 +514,17 @@ config COH901327_WATCHDOG | |||
514 | This watchdog is used to reset the system and thus cannot be | 514 | This watchdog is used to reset the system and thus cannot be |
515 | compiled as a module. | 515 | compiled as a module. |
516 | 516 | ||
517 | config NPCM7XX_WATCHDOG | ||
518 | bool "Nuvoton NPCM750 watchdog" | ||
519 | depends on ARCH_NPCM || COMPILE_TEST | ||
520 | default y if ARCH_NPCM750 | ||
521 | select WATCHDOG_CORE | ||
522 | help | ||
523 | Say Y here to include Watchdog timer support for the | ||
524 | watchdog embedded into the NPCM7xx. | ||
525 | This watchdog is used to reset the system and thus cannot be | ||
526 | compiled as a module. | ||
527 | |||
517 | config TWL4030_WATCHDOG | 528 | config TWL4030_WATCHDOG |
518 | tristate "TWL4030 Watchdog" | 529 | tristate "TWL4030 Watchdog" |
519 | depends on TWL4030_CORE | 530 | depends on TWL4030_CORE |
diff --git a/drivers/watchdog/Makefile b/drivers/watchdog/Makefile index 0474d38aa854..97a5afb5cad2 100644 --- a/drivers/watchdog/Makefile +++ b/drivers/watchdog/Makefile | |||
@@ -61,6 +61,7 @@ obj-$(CONFIG_ORION_WATCHDOG) += orion_wdt.o | |||
61 | obj-$(CONFIG_SUNXI_WATCHDOG) += sunxi_wdt.o | 61 | obj-$(CONFIG_SUNXI_WATCHDOG) += sunxi_wdt.o |
62 | obj-$(CONFIG_RN5T618_WATCHDOG) += rn5t618_wdt.o | 62 | obj-$(CONFIG_RN5T618_WATCHDOG) += rn5t618_wdt.o |
63 | obj-$(CONFIG_COH901327_WATCHDOG) += coh901327_wdt.o | 63 | obj-$(CONFIG_COH901327_WATCHDOG) += coh901327_wdt.o |
64 | obj-$(CONFIG_NPCM7XX_WATCHDOG) += npcm_wdt.o | ||
64 | obj-$(CONFIG_STMP3XXX_RTC_WATCHDOG) += stmp3xxx_rtc_wdt.o | 65 | obj-$(CONFIG_STMP3XXX_RTC_WATCHDOG) += stmp3xxx_rtc_wdt.o |
65 | obj-$(CONFIG_NUC900_WATCHDOG) += nuc900_wdt.o | 66 | obj-$(CONFIG_NUC900_WATCHDOG) += nuc900_wdt.o |
66 | obj-$(CONFIG_TS4800_WATCHDOG) += ts4800_wdt.o | 67 | obj-$(CONFIG_TS4800_WATCHDOG) += ts4800_wdt.o |
diff --git a/drivers/watchdog/ar7_wdt.c b/drivers/watchdog/ar7_wdt.c index 6d5ae251e309..ee1ab12ab04f 100644 --- a/drivers/watchdog/ar7_wdt.c +++ b/drivers/watchdog/ar7_wdt.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0+ | ||
1 | /* | 2 | /* |
2 | * drivers/watchdog/ar7_wdt.c | 3 | * drivers/watchdog/ar7_wdt.c |
3 | * | 4 | * |
@@ -8,19 +9,6 @@ | |||
8 | * National Semiconductor SCx200 Watchdog support | 9 | * National Semiconductor SCx200 Watchdog support |
9 | * Copyright (c) 2001,2002 Christer Weinigel <wingel@nano-system.com> | 10 | * Copyright (c) 2001,2002 Christer Weinigel <wingel@nano-system.com> |
10 | * | 11 | * |
11 | * This program is free software; you can redistribute it and/or modify | ||
12 | * it under the terms of the GNU General Public License as published by | ||
13 | * the Free Software Foundation; either version 2 of the License, or | ||
14 | * (at your option) any later version. | ||
15 | * | ||
16 | * This program is distributed in the hope that it will be useful, | ||
17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
19 | * GNU General Public License for more details. | ||
20 | * | ||
21 | * You should have received a copy of the GNU General Public License | ||
22 | * along with this program; if not, write to the Free Software | ||
23 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
24 | */ | 12 | */ |
25 | 13 | ||
26 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | 14 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt |
diff --git a/drivers/watchdog/aspeed_wdt.c b/drivers/watchdog/aspeed_wdt.c index d1987d63b37c..a5b8eb21201f 100644 --- a/drivers/watchdog/aspeed_wdt.c +++ b/drivers/watchdog/aspeed_wdt.c | |||
@@ -46,6 +46,7 @@ MODULE_DEVICE_TABLE(of, aspeed_wdt_of_table); | |||
46 | #define WDT_RELOAD_VALUE 0x04 | 46 | #define WDT_RELOAD_VALUE 0x04 |
47 | #define WDT_RESTART 0x08 | 47 | #define WDT_RESTART 0x08 |
48 | #define WDT_CTRL 0x0C | 48 | #define WDT_CTRL 0x0C |
49 | #define WDT_CTRL_BOOT_SECONDARY BIT(7) | ||
49 | #define WDT_CTRL_RESET_MODE_SOC (0x00 << 5) | 50 | #define WDT_CTRL_RESET_MODE_SOC (0x00 << 5) |
50 | #define WDT_CTRL_RESET_MODE_FULL_CHIP (0x01 << 5) | 51 | #define WDT_CTRL_RESET_MODE_FULL_CHIP (0x01 << 5) |
51 | #define WDT_CTRL_RESET_MODE_ARM_CPU (0x10 << 5) | 52 | #define WDT_CTRL_RESET_MODE_ARM_CPU (0x10 << 5) |
@@ -158,6 +159,7 @@ static int aspeed_wdt_restart(struct watchdog_device *wdd, | |||
158 | { | 159 | { |
159 | struct aspeed_wdt *wdt = to_aspeed_wdt(wdd); | 160 | struct aspeed_wdt *wdt = to_aspeed_wdt(wdd); |
160 | 161 | ||
162 | wdt->ctrl &= ~WDT_CTRL_BOOT_SECONDARY; | ||
161 | aspeed_wdt_enable(wdt, 128 * WDT_RATE_1MHZ / 1000); | 163 | aspeed_wdt_enable(wdt, 128 * WDT_RATE_1MHZ / 1000); |
162 | 164 | ||
163 | mdelay(1000); | 165 | mdelay(1000); |
@@ -245,6 +247,8 @@ static int aspeed_wdt_probe(struct platform_device *pdev) | |||
245 | } | 247 | } |
246 | if (of_property_read_bool(np, "aspeed,external-signal")) | 248 | if (of_property_read_bool(np, "aspeed,external-signal")) |
247 | wdt->ctrl |= WDT_CTRL_WDT_EXT; | 249 | wdt->ctrl |= WDT_CTRL_WDT_EXT; |
250 | if (of_property_read_bool(np, "aspeed,alt-boot")) | ||
251 | wdt->ctrl |= WDT_CTRL_BOOT_SECONDARY; | ||
248 | 252 | ||
249 | if (readl(wdt->base + WDT_CTRL) & WDT_CTRL_ENABLE) { | 253 | if (readl(wdt->base + WDT_CTRL) & WDT_CTRL_ENABLE) { |
250 | /* | 254 | /* |
diff --git a/drivers/watchdog/at91rm9200_wdt.c b/drivers/watchdog/at91rm9200_wdt.c index e12a797cb820..b45fc0aee667 100644 --- a/drivers/watchdog/at91rm9200_wdt.c +++ b/drivers/watchdog/at91rm9200_wdt.c | |||
@@ -1,12 +1,9 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0+ | ||
1 | /* | 2 | /* |
2 | * Watchdog driver for Atmel AT91RM9200 (Thunder) | 3 | * Watchdog driver for Atmel AT91RM9200 (Thunder) |
3 | * | 4 | * |
4 | * Copyright (C) 2003 SAN People (Pty) Ltd | 5 | * Copyright (C) 2003 SAN People (Pty) Ltd |
5 | * | 6 | * |
6 | * This program is free software; you can redistribute it and/or | ||
7 | * modify it under the terms of the GNU General Public License | ||
8 | * as published by the Free Software Foundation; either version | ||
9 | * 2 of the License, or (at your option) any later version. | ||
10 | */ | 7 | */ |
11 | 8 | ||
12 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | 9 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt |
diff --git a/drivers/watchdog/at91sam9_wdt.c b/drivers/watchdog/at91sam9_wdt.c index 88c05d0448b2..f4050a229eb5 100644 --- a/drivers/watchdog/at91sam9_wdt.c +++ b/drivers/watchdog/at91sam9_wdt.c | |||
@@ -1,12 +1,9 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0+ | ||
1 | /* | 2 | /* |
2 | * Watchdog driver for Atmel AT91SAM9x processors. | 3 | * Watchdog driver for Atmel AT91SAM9x processors. |
3 | * | 4 | * |
4 | * Copyright (C) 2008 Renaud CERRATO r.cerrato@til-technologies.fr | 5 | * Copyright (C) 2008 Renaud CERRATO r.cerrato@til-technologies.fr |
5 | * | 6 | * |
6 | * This program is free software; you can redistribute it and/or | ||
7 | * modify it under the terms of the GNU General Public License | ||
8 | * as published by the Free Software Foundation; either version | ||
9 | * 2 of the License, or (at your option) any later version. | ||
10 | */ | 7 | */ |
11 | 8 | ||
12 | /* | 9 | /* |
diff --git a/drivers/watchdog/at91sam9_wdt.h b/drivers/watchdog/at91sam9_wdt.h index b79a83b467ce..390941c65eee 100644 --- a/drivers/watchdog/at91sam9_wdt.h +++ b/drivers/watchdog/at91sam9_wdt.h | |||
@@ -1,3 +1,4 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0+ */ | ||
1 | /* | 2 | /* |
2 | * drivers/watchdog/at91sam9_wdt.h | 3 | * drivers/watchdog/at91sam9_wdt.h |
3 | * | 4 | * |
@@ -7,10 +8,6 @@ | |||
7 | * Watchdog Timer (WDT) - System peripherals regsters. | 8 | * Watchdog Timer (WDT) - System peripherals regsters. |
8 | * Based on AT91SAM9261 datasheet revision D. | 9 | * Based on AT91SAM9261 datasheet revision D. |
9 | * | 10 | * |
10 | * This program is free software; you can redistribute it and/or modify | ||
11 | * it under the terms of the GNU General Public License as published by | ||
12 | * the Free Software Foundation; either version 2 of the License, or | ||
13 | * (at your option) any later version. | ||
14 | */ | 11 | */ |
15 | 12 | ||
16 | #ifndef AT91_WDT_H | 13 | #ifndef AT91_WDT_H |
diff --git a/drivers/watchdog/bcm2835_wdt.c b/drivers/watchdog/bcm2835_wdt.c index b339e0e67b4c..ed05514cc2dc 100644 --- a/drivers/watchdog/bcm2835_wdt.c +++ b/drivers/watchdog/bcm2835_wdt.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0+ | ||
1 | /* | 2 | /* |
2 | * Watchdog driver for Broadcom BCM2835 | 3 | * Watchdog driver for Broadcom BCM2835 |
3 | * | 4 | * |
@@ -7,10 +8,6 @@ | |||
7 | * | 8 | * |
8 | * Copyright (C) 2013 Lubomir Rintel <lkundrak@v3.sk> | 9 | * Copyright (C) 2013 Lubomir Rintel <lkundrak@v3.sk> |
9 | * | 10 | * |
10 | * This program is free software; you can redistribute it and/or modify it | ||
11 | * under the terms of the GNU General Public License as published by the | ||
12 | * Free Software Foundation; either version 2 of the License, or (at your | ||
13 | * option) any later version. | ||
14 | */ | 11 | */ |
15 | 12 | ||
16 | #include <linux/delay.h> | 13 | #include <linux/delay.h> |
diff --git a/drivers/watchdog/bcm47xx_wdt.c b/drivers/watchdog/bcm47xx_wdt.c index f41b756d6dd5..05425c1dfd4c 100644 --- a/drivers/watchdog/bcm47xx_wdt.c +++ b/drivers/watchdog/bcm47xx_wdt.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0+ | ||
1 | /* | 2 | /* |
2 | * Watchdog driver for Broadcom BCM47XX | 3 | * Watchdog driver for Broadcom BCM47XX |
3 | * | 4 | * |
@@ -5,10 +6,6 @@ | |||
5 | * Copyright (C) 2009 Matthieu CASTET <castet.matthieu@free.fr> | 6 | * Copyright (C) 2009 Matthieu CASTET <castet.matthieu@free.fr> |
6 | * Copyright (C) 2012-2013 Hauke Mehrtens <hauke@hauke-m.de> | 7 | * Copyright (C) 2012-2013 Hauke Mehrtens <hauke@hauke-m.de> |
7 | * | 8 | * |
8 | * This program is free software; you can redistribute it and/or | ||
9 | * modify it under the terms of the GNU General Public License | ||
10 | * as published by the Free Software Foundation; either version | ||
11 | * 2 of the License, or (at your option) any later version. | ||
12 | */ | 9 | */ |
13 | 10 | ||
14 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | 11 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt |
diff --git a/drivers/watchdog/bcm63xx_wdt.c b/drivers/watchdog/bcm63xx_wdt.c index 8555afc70f9b..d3c1113e774c 100644 --- a/drivers/watchdog/bcm63xx_wdt.c +++ b/drivers/watchdog/bcm63xx_wdt.c | |||
@@ -1,13 +1,10 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0+ | ||
1 | /* | 2 | /* |
2 | * Broadcom BCM63xx SoC watchdog driver | 3 | * Broadcom BCM63xx SoC watchdog driver |
3 | * | 4 | * |
4 | * Copyright (C) 2007, Miguel Gaio <miguel.gaio@efixo.com> | 5 | * Copyright (C) 2007, Miguel Gaio <miguel.gaio@efixo.com> |
5 | * Copyright (C) 2008, Florian Fainelli <florian@openwrt.org> | 6 | * Copyright (C) 2008, Florian Fainelli <florian@openwrt.org> |
6 | * | 7 | * |
7 | * This program is free software; you can redistribute it and/or | ||
8 | * modify it under the terms of the GNU General Public License | ||
9 | * as published by the Free Software Foundation; either version | ||
10 | * 2 of the License, or (at your option) any later version. | ||
11 | */ | 8 | */ |
12 | 9 | ||
13 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | 10 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt |
diff --git a/drivers/watchdog/bcm7038_wdt.c b/drivers/watchdog/bcm7038_wdt.c index f88f546e8050..ce3f646e8077 100644 --- a/drivers/watchdog/bcm7038_wdt.c +++ b/drivers/watchdog/bcm7038_wdt.c | |||
@@ -1,15 +1,7 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0+ | ||
1 | /* | 2 | /* |
2 | * Copyright (C) 2015 Broadcom Corporation | 3 | * Copyright (C) 2015 Broadcom Corporation |
3 | * | 4 | * |
4 | * This program is free software; you can redistribute it and/or | ||
5 | * modify it under the terms of the GNU General Public License | ||
6 | * as published by the Free Software Foundation; either version 2 | ||
7 | * of the License, or (at your option) any later version. | ||
8 | * | ||
9 | * This program is distributed in the hope that it will be useful, | ||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | * GNU General Public License for more details. | ||
13 | */ | 5 | */ |
14 | 6 | ||
15 | #include <linux/clk.h> | 7 | #include <linux/clk.h> |
@@ -235,6 +227,6 @@ module_platform_driver(bcm7038_wdt_driver); | |||
235 | module_param(nowayout, bool, 0); | 227 | module_param(nowayout, bool, 0); |
236 | MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" | 228 | MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" |
237 | __MODULE_STRING(WATCHDOG_NOWAYOUT) ")"); | 229 | __MODULE_STRING(WATCHDOG_NOWAYOUT) ")"); |
238 | MODULE_LICENSE("GPL v2"); | 230 | MODULE_LICENSE("GPL"); |
239 | MODULE_DESCRIPTION("Driver for Broadcom 7038 SoCs Watchdog"); | 231 | MODULE_DESCRIPTION("Driver for Broadcom 7038 SoCs Watchdog"); |
240 | MODULE_AUTHOR("Justin Chen"); | 232 | MODULE_AUTHOR("Justin Chen"); |
diff --git a/drivers/watchdog/bcm_kona_wdt.c b/drivers/watchdog/bcm_kona_wdt.c index a5775dfd8d5f..1462be9e6fc5 100644 --- a/drivers/watchdog/bcm_kona_wdt.c +++ b/drivers/watchdog/bcm_kona_wdt.c | |||
@@ -1,14 +1,7 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | /* | 2 | /* |
2 | * Copyright (C) 2013 Broadcom Corporation | 3 | * Copyright (C) 2013 Broadcom Corporation |
3 | * | 4 | * |
4 | * This program is free software; you can redistribute it and/or | ||
5 | * modify it under the terms of the GNU General Public License as | ||
6 | * published by the Free Software Foundation version 2. | ||
7 | * | ||
8 | * This program is distributed "as is" WITHOUT ANY WARRANTY of any | ||
9 | * kind, whether express or implied; without even the implied warranty | ||
10 | * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
11 | * GNU General Public License for more details. | ||
12 | */ | 5 | */ |
13 | 6 | ||
14 | #include <linux/debugfs.h> | 7 | #include <linux/debugfs.h> |
diff --git a/drivers/watchdog/cadence_wdt.c b/drivers/watchdog/cadence_wdt.c index 064cf7b6c1c5..3ec1f418837d 100644 --- a/drivers/watchdog/cadence_wdt.c +++ b/drivers/watchdog/cadence_wdt.c | |||
@@ -1,12 +1,9 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0+ | ||
1 | /* | 2 | /* |
2 | * Cadence WDT driver - Used by Xilinx Zynq | 3 | * Cadence WDT driver - Used by Xilinx Zynq |
3 | * | 4 | * |
4 | * Copyright (C) 2010 - 2014 Xilinx, Inc. | 5 | * Copyright (C) 2010 - 2014 Xilinx, Inc. |
5 | * | 6 | * |
6 | * This program is free software; you can redistribute it and/or | ||
7 | * modify it under the terms of the GNU General Public License | ||
8 | * as published by the Free Software Foundation; either version | ||
9 | * 2 of the License, or (at your option) any later version. | ||
10 | */ | 7 | */ |
11 | 8 | ||
12 | #include <linux/clk.h> | 9 | #include <linux/clk.h> |
diff --git a/drivers/watchdog/da9052_wdt.c b/drivers/watchdog/da9052_wdt.c index d6d5006efa71..e263bad99574 100644 --- a/drivers/watchdog/da9052_wdt.c +++ b/drivers/watchdog/da9052_wdt.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0+ | ||
1 | /* | 2 | /* |
2 | * System monitoring driver for DA9052 PMICs. | 3 | * System monitoring driver for DA9052 PMICs. |
3 | * | 4 | * |
@@ -5,11 +6,6 @@ | |||
5 | * | 6 | * |
6 | * Author: Anthony Olech <Anthony.Olech@diasemi.com> | 7 | * Author: Anthony Olech <Anthony.Olech@diasemi.com> |
7 | * | 8 | * |
8 | * This program is free software; you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU General Public License as published by | ||
10 | * the Free Software Foundation; either version 2 of the License, or | ||
11 | * (at your option) any later version. | ||
12 | * | ||
13 | */ | 9 | */ |
14 | 10 | ||
15 | #include <linux/module.h> | 11 | #include <linux/module.h> |
diff --git a/drivers/watchdog/da9055_wdt.c b/drivers/watchdog/da9055_wdt.c index 50bdd1022186..26a5b2984094 100644 --- a/drivers/watchdog/da9055_wdt.c +++ b/drivers/watchdog/da9055_wdt.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0+ | ||
1 | /* | 2 | /* |
2 | * System monitoring driver for DA9055 PMICs. | 3 | * System monitoring driver for DA9055 PMICs. |
3 | * | 4 | * |
@@ -5,11 +6,6 @@ | |||
5 | * | 6 | * |
6 | * Author: David Dajun Chen <dchen@diasemi.com> | 7 | * Author: David Dajun Chen <dchen@diasemi.com> |
7 | * | 8 | * |
8 | * This program is free software; you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU General Public License as published by | ||
10 | * the Free Software Foundation; either version 2 of the License, or | ||
11 | * (at your option) any later version. | ||
12 | * | ||
13 | */ | 9 | */ |
14 | 10 | ||
15 | #include <linux/module.h> | 11 | #include <linux/module.h> |
diff --git a/drivers/watchdog/da9062_wdt.c b/drivers/watchdog/da9062_wdt.c index 814dff6045a4..a001782bbfdb 100644 --- a/drivers/watchdog/da9062_wdt.c +++ b/drivers/watchdog/da9062_wdt.c | |||
@@ -1,16 +1,8 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0+ | ||
1 | /* | 2 | /* |
2 | * Watchdog device driver for DA9062 and DA9061 PMICs | 3 | * Watchdog device driver for DA9062 and DA9061 PMICs |
3 | * Copyright (C) 2015 Dialog Semiconductor Ltd. | 4 | * Copyright (C) 2015 Dialog Semiconductor Ltd. |
4 | * | 5 | * |
5 | * This program is free software; you can redistribute it and/or | ||
6 | * modify it under the terms of the GNU General Public License | ||
7 | * as published by the Free Software Foundation; either version 2 | ||
8 | * of the License, or (at your option) any later version. | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be useful, | ||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU General Public License for more details. | ||
14 | */ | 6 | */ |
15 | 7 | ||
16 | #include <linux/kernel.h> | 8 | #include <linux/kernel.h> |
diff --git a/drivers/watchdog/da9063_wdt.c b/drivers/watchdog/da9063_wdt.c index 2a20fc163ed0..b17ac1bb1f28 100644 --- a/drivers/watchdog/da9063_wdt.c +++ b/drivers/watchdog/da9063_wdt.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0+ | ||
1 | /* | 2 | /* |
2 | * Watchdog driver for DA9063 PMICs. | 3 | * Watchdog driver for DA9063 PMICs. |
3 | * | 4 | * |
@@ -5,10 +6,6 @@ | |||
5 | * | 6 | * |
6 | * Author: Mariusz Wojtasik <mariusz.wojtasik@diasemi.com> | 7 | * Author: Mariusz Wojtasik <mariusz.wojtasik@diasemi.com> |
7 | * | 8 | * |
8 | * This program is free software; you can redistribute it and/or modify it | ||
9 | * under the terms of the GNU General Public License as published by the | ||
10 | * Free Software Foundation; either version 2 of the License, or (at your | ||
11 | * option) any later version. | ||
12 | */ | 9 | */ |
13 | 10 | ||
14 | #include <linux/kernel.h> | 11 | #include <linux/kernel.h> |
diff --git a/drivers/watchdog/digicolor_wdt.c b/drivers/watchdog/digicolor_wdt.c index 5e4ef93caa02..a9e11df155b8 100644 --- a/drivers/watchdog/digicolor_wdt.c +++ b/drivers/watchdog/digicolor_wdt.c | |||
@@ -1,12 +1,9 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0+ | ||
1 | /* | 2 | /* |
2 | * Watchdog driver for Conexant Digicolor | 3 | * Watchdog driver for Conexant Digicolor |
3 | * | 4 | * |
4 | * Copyright (C) 2015 Paradox Innovation Ltd. | 5 | * Copyright (C) 2015 Paradox Innovation Ltd. |
5 | * | 6 | * |
6 | * This program is free software; you can redistribute it and/or modify it | ||
7 | * under the terms of the GNU General Public License as published by the | ||
8 | * Free Software Foundation; either version 2 of the License, or (at your | ||
9 | * option) any later version. | ||
10 | */ | 7 | */ |
11 | 8 | ||
12 | #include <linux/types.h> | 9 | #include <linux/types.h> |
diff --git a/drivers/watchdog/ebc-c384_wdt.c b/drivers/watchdog/ebc-c384_wdt.c index 2170b275ea01..4c4c8ce78021 100644 --- a/drivers/watchdog/ebc-c384_wdt.c +++ b/drivers/watchdog/ebc-c384_wdt.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | /* | 2 | /* |
2 | * Watchdog timer driver for the WinSystems EBC-C384 | 3 | * Watchdog timer driver for the WinSystems EBC-C384 |
3 | * Copyright (C) 2016 William Breathitt Gray | 4 | * Copyright (C) 2016 William Breathitt Gray |
diff --git a/drivers/watchdog/mei_wdt.c b/drivers/watchdog/mei_wdt.c index b8194b02abe0..8023cf28657a 100644 --- a/drivers/watchdog/mei_wdt.c +++ b/drivers/watchdog/mei_wdt.c | |||
@@ -1,15 +1,7 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | /* | 2 | /* |
2 | * Intel Management Engine Interface (Intel MEI) Linux driver | 3 | * Intel Management Engine Interface (Intel MEI) Linux driver |
3 | * Copyright (c) 2015, Intel Corporation. | 4 | * Copyright (c) 2015, Intel Corporation. |
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify it | ||
6 | * under the terms and conditions of the GNU General Public License, | ||
7 | * version 2, as published by the Free Software Foundation. | ||
8 | * | ||
9 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
12 | * more details. | ||
13 | */ | 5 | */ |
14 | 6 | ||
15 | #include <linux/module.h> | 7 | #include <linux/module.h> |
@@ -687,5 +679,5 @@ static struct mei_cl_driver mei_wdt_driver = { | |||
687 | module_mei_cl_driver(mei_wdt_driver); | 679 | module_mei_cl_driver(mei_wdt_driver); |
688 | 680 | ||
689 | MODULE_AUTHOR("Intel Corporation"); | 681 | MODULE_AUTHOR("Intel Corporation"); |
690 | MODULE_LICENSE("GPL"); | 682 | MODULE_LICENSE("GPL v2"); |
691 | MODULE_DESCRIPTION("Device driver for Intel MEI iAMT watchdog"); | 683 | MODULE_DESCRIPTION("Device driver for Intel MEI iAMT watchdog"); |
diff --git a/drivers/watchdog/mena21_wdt.c b/drivers/watchdog/mena21_wdt.c index 045201a6fdb3..25d5d2b8cfbe 100644 --- a/drivers/watchdog/mena21_wdt.c +++ b/drivers/watchdog/mena21_wdt.c | |||
@@ -1,11 +1,9 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0+ | ||
1 | /* | 2 | /* |
2 | * Watchdog driver for the A21 VME CPU Boards | 3 | * Watchdog driver for the A21 VME CPU Boards |
3 | * | 4 | * |
4 | * Copyright (C) 2013 MEN Mikro Elektronik Nuernberg GmbH | 5 | * Copyright (C) 2013 MEN Mikro Elektronik Nuernberg GmbH |
5 | * | 6 | * |
6 | * This program is free software; you can redistribute it and/or | ||
7 | * modify it under the terms of the GNU General Public License | ||
8 | * as published by the Free Software Foundation | ||
9 | */ | 7 | */ |
10 | #include <linux/module.h> | 8 | #include <linux/module.h> |
11 | #include <linux/moduleparam.h> | 9 | #include <linux/moduleparam.h> |
diff --git a/drivers/watchdog/meson_gxbb_wdt.c b/drivers/watchdog/meson_gxbb_wdt.c index 69a5a57f1446..69adeab3fde7 100644 --- a/drivers/watchdog/meson_gxbb_wdt.c +++ b/drivers/watchdog/meson_gxbb_wdt.c | |||
@@ -1,56 +1,8 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause | ||
1 | /* | 2 | /* |
2 | * This file is provided under a dual BSD/GPLv2 license. When using or | ||
3 | * redistributing this file, you may do so under either license. | ||
4 | * | ||
5 | * GPL LICENSE SUMMARY | ||
6 | * | ||
7 | * Copyright (c) 2016 BayLibre, SAS. | 3 | * Copyright (c) 2016 BayLibre, SAS. |
8 | * Author: Neil Armstrong <narmstrong@baylibre.com> | 4 | * Author: Neil Armstrong <narmstrong@baylibre.com> |
9 | * | 5 | * |
10 | * This program is free software; you can redistribute it and/or modify | ||
11 | * it under the terms of version 2 of the GNU General Public License as | ||
12 | * published by the Free Software Foundation. | ||
13 | * | ||
14 | * This program is distributed in the hope that it will be useful, but | ||
15 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
17 | * General Public License for more details. | ||
18 | * | ||
19 | * You should have received a copy of the GNU General Public License | ||
20 | * along with this program; if not, see <http://www.gnu.org/licenses/>. | ||
21 | * The full GNU General Public License is included in this distribution | ||
22 | * in the file called COPYING. | ||
23 | * | ||
24 | * BSD LICENSE | ||
25 | * | ||
26 | * Copyright (c) 2016 BayLibre, SAS. | ||
27 | * Author: Neil Armstrong <narmstrong@baylibre.com> | ||
28 | * | ||
29 | * Redistribution and use in source and binary forms, with or without | ||
30 | * modification, are permitted provided that the following conditions | ||
31 | * are met: | ||
32 | * | ||
33 | * * Redistributions of source code must retain the above copyright | ||
34 | * notice, this list of conditions and the following disclaimer. | ||
35 | * * Redistributions in binary form must reproduce the above copyright | ||
36 | * notice, this list of conditions and the following disclaimer in | ||
37 | * the documentation and/or other materials provided with the | ||
38 | * distribution. | ||
39 | * * Neither the name of Intel Corporation nor the names of its | ||
40 | * contributors may be used to endorse or promote products derived | ||
41 | * from this software without specific prior written permission. | ||
42 | * | ||
43 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
44 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
45 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
46 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
47 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
48 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ||
49 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
50 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
51 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
52 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
53 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
54 | */ | 6 | */ |
55 | #include <linux/clk.h> | 7 | #include <linux/clk.h> |
56 | #include <linux/err.h> | 8 | #include <linux/err.h> |
diff --git a/drivers/watchdog/mtk_wdt.c b/drivers/watchdog/mtk_wdt.c index fcdc10ec28a3..4baf64f21aa1 100644 --- a/drivers/watchdog/mtk_wdt.c +++ b/drivers/watchdog/mtk_wdt.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0+ | ||
1 | /* | 2 | /* |
2 | * Mediatek Watchdog Driver | 3 | * Mediatek Watchdog Driver |
3 | * | 4 | * |
@@ -5,16 +6,6 @@ | |||
5 | * | 6 | * |
6 | * Matthias Brugger <matthias.bgg@gmail.com> | 7 | * Matthias Brugger <matthias.bgg@gmail.com> |
7 | * | 8 | * |
8 | * This program is free software; you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU General Public License as published by | ||
10 | * the Free Software Foundation; either version 2 of the License, or | ||
11 | * (at your option) any later version. | ||
12 | * | ||
13 | * This program is distributed in the hope that it will be useful, | ||
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
16 | * GNU General Public License for more details. | ||
17 | * | ||
18 | * Based on sunxi_wdt.c | 9 | * Based on sunxi_wdt.c |
19 | */ | 10 | */ |
20 | 11 | ||
diff --git a/drivers/watchdog/mtx-1_wdt.c b/drivers/watchdog/mtx-1_wdt.c index ca360d204548..1fa7d2b32494 100644 --- a/drivers/watchdog/mtx-1_wdt.c +++ b/drivers/watchdog/mtx-1_wdt.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0+ | ||
1 | /* | 2 | /* |
2 | * Driver for the MTX-1 Watchdog. | 3 | * Driver for the MTX-1 Watchdog. |
3 | * | 4 | * |
@@ -6,16 +7,6 @@ | |||
6 | * http://www.4g-systems.biz | 7 | * http://www.4g-systems.biz |
7 | * | 8 | * |
8 | * (C) Copyright 2007 OpenWrt.org, Florian Fainelli <florian@openwrt.org> | 9 | * (C) Copyright 2007 OpenWrt.org, Florian Fainelli <florian@openwrt.org> |
9 | * | ||
10 | * This program is free software; you can redistribute it and/or | ||
11 | * modify it under the terms of the GNU General Public License | ||
12 | * as published by the Free Software Foundation; either version | ||
13 | * 2 of the License, or (at your option) any later version. | ||
14 | * | ||
15 | * Neither Michael Stickel nor 4G Systems admit liability nor provide | ||
16 | * warranty for any of this software. This material is provided | ||
17 | * "AS-IS" and at no charge. | ||
18 | * | ||
19 | * (c) Copyright 2005 4G Systems <info@4g-systems.biz> | 10 | * (c) Copyright 2005 4G Systems <info@4g-systems.biz> |
20 | * | 11 | * |
21 | * Release 0.01. | 12 | * Release 0.01. |
diff --git a/drivers/watchdog/npcm_wdt.c b/drivers/watchdog/npcm_wdt.c new file mode 100644 index 000000000000..0d4213652ecc --- /dev/null +++ b/drivers/watchdog/npcm_wdt.c | |||
@@ -0,0 +1,254 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
2 | // Copyright (c) 2018 Nuvoton Technology corporation. | ||
3 | // Copyright (c) 2018 IBM Corp. | ||
4 | |||
5 | #include <linux/bitops.h> | ||
6 | #include <linux/delay.h> | ||
7 | #include <linux/interrupt.h> | ||
8 | #include <linux/kernel.h> | ||
9 | #include <linux/module.h> | ||
10 | #include <linux/of_irq.h> | ||
11 | #include <linux/platform_device.h> | ||
12 | #include <linux/slab.h> | ||
13 | #include <linux/watchdog.h> | ||
14 | |||
15 | #define NPCM_WTCR 0x1C | ||
16 | |||
17 | #define NPCM_WTCLK (BIT(10) | BIT(11)) /* Clock divider */ | ||
18 | #define NPCM_WTE BIT(7) /* Enable */ | ||
19 | #define NPCM_WTIE BIT(6) /* Enable irq */ | ||
20 | #define NPCM_WTIS (BIT(4) | BIT(5)) /* Interval selection */ | ||
21 | #define NPCM_WTIF BIT(3) /* Interrupt flag*/ | ||
22 | #define NPCM_WTRF BIT(2) /* Reset flag */ | ||
23 | #define NPCM_WTRE BIT(1) /* Reset enable */ | ||
24 | #define NPCM_WTR BIT(0) /* Reset counter */ | ||
25 | |||
26 | /* | ||
27 | * Watchdog timeouts | ||
28 | * | ||
29 | * 170 msec: WTCLK=01 WTIS=00 VAL= 0x400 | ||
30 | * 670 msec: WTCLK=01 WTIS=01 VAL= 0x410 | ||
31 | * 1360 msec: WTCLK=10 WTIS=00 VAL= 0x800 | ||
32 | * 2700 msec: WTCLK=01 WTIS=10 VAL= 0x420 | ||
33 | * 5360 msec: WTCLK=10 WTIS=01 VAL= 0x810 | ||
34 | * 10700 msec: WTCLK=01 WTIS=11 VAL= 0x430 | ||
35 | * 21600 msec: WTCLK=10 WTIS=10 VAL= 0x820 | ||
36 | * 43000 msec: WTCLK=11 WTIS=00 VAL= 0xC00 | ||
37 | * 85600 msec: WTCLK=10 WTIS=11 VAL= 0x830 | ||
38 | * 172000 msec: WTCLK=11 WTIS=01 VAL= 0xC10 | ||
39 | * 687000 msec: WTCLK=11 WTIS=10 VAL= 0xC20 | ||
40 | * 2750000 msec: WTCLK=11 WTIS=11 VAL= 0xC30 | ||
41 | */ | ||
42 | |||
43 | struct npcm_wdt { | ||
44 | struct watchdog_device wdd; | ||
45 | void __iomem *reg; | ||
46 | }; | ||
47 | |||
48 | static inline struct npcm_wdt *to_npcm_wdt(struct watchdog_device *wdd) | ||
49 | { | ||
50 | return container_of(wdd, struct npcm_wdt, wdd); | ||
51 | } | ||
52 | |||
53 | static int npcm_wdt_ping(struct watchdog_device *wdd) | ||
54 | { | ||
55 | struct npcm_wdt *wdt = to_npcm_wdt(wdd); | ||
56 | u32 val; | ||
57 | |||
58 | val = readl(wdt->reg); | ||
59 | writel(val | NPCM_WTR, wdt->reg); | ||
60 | |||
61 | return 0; | ||
62 | } | ||
63 | |||
64 | static int npcm_wdt_start(struct watchdog_device *wdd) | ||
65 | { | ||
66 | struct npcm_wdt *wdt = to_npcm_wdt(wdd); | ||
67 | u32 val; | ||
68 | |||
69 | if (wdd->timeout < 2) | ||
70 | val = 0x800; | ||
71 | else if (wdd->timeout < 3) | ||
72 | val = 0x420; | ||
73 | else if (wdd->timeout < 6) | ||
74 | val = 0x810; | ||
75 | else if (wdd->timeout < 11) | ||
76 | val = 0x430; | ||
77 | else if (wdd->timeout < 22) | ||
78 | val = 0x820; | ||
79 | else if (wdd->timeout < 44) | ||
80 | val = 0xC00; | ||
81 | else if (wdd->timeout < 87) | ||
82 | val = 0x830; | ||
83 | else if (wdd->timeout < 173) | ||
84 | val = 0xC10; | ||
85 | else if (wdd->timeout < 688) | ||
86 | val = 0xC20; | ||
87 | else | ||
88 | val = 0xC30; | ||
89 | |||
90 | val |= NPCM_WTRE | NPCM_WTE | NPCM_WTR | NPCM_WTIE; | ||
91 | |||
92 | writel(val, wdt->reg); | ||
93 | |||
94 | return 0; | ||
95 | } | ||
96 | |||
97 | static int npcm_wdt_stop(struct watchdog_device *wdd) | ||
98 | { | ||
99 | struct npcm_wdt *wdt = to_npcm_wdt(wdd); | ||
100 | |||
101 | writel(0, wdt->reg); | ||
102 | |||
103 | return 0; | ||
104 | } | ||
105 | |||
106 | |||
107 | static int npcm_wdt_set_timeout(struct watchdog_device *wdd, | ||
108 | unsigned int timeout) | ||
109 | { | ||
110 | if (timeout < 2) | ||
111 | wdd->timeout = 1; | ||
112 | else if (timeout < 3) | ||
113 | wdd->timeout = 2; | ||
114 | else if (timeout < 6) | ||
115 | wdd->timeout = 5; | ||
116 | else if (timeout < 11) | ||
117 | wdd->timeout = 10; | ||
118 | else if (timeout < 22) | ||
119 | wdd->timeout = 21; | ||
120 | else if (timeout < 44) | ||
121 | wdd->timeout = 43; | ||
122 | else if (timeout < 87) | ||
123 | wdd->timeout = 86; | ||
124 | else if (timeout < 173) | ||
125 | wdd->timeout = 172; | ||
126 | else if (timeout < 688) | ||
127 | wdd->timeout = 687; | ||
128 | else | ||
129 | wdd->timeout = 2750; | ||
130 | |||
131 | if (watchdog_active(wdd)) | ||
132 | npcm_wdt_start(wdd); | ||
133 | |||
134 | return 0; | ||
135 | } | ||
136 | |||
137 | static irqreturn_t npcm_wdt_interrupt(int irq, void *data) | ||
138 | { | ||
139 | struct npcm_wdt *wdt = data; | ||
140 | |||
141 | watchdog_notify_pretimeout(&wdt->wdd); | ||
142 | |||
143 | return IRQ_HANDLED; | ||
144 | } | ||
145 | |||
146 | static int npcm_wdt_restart(struct watchdog_device *wdd, | ||
147 | unsigned long action, void *data) | ||
148 | { | ||
149 | struct npcm_wdt *wdt = to_npcm_wdt(wdd); | ||
150 | |||
151 | writel(NPCM_WTR | NPCM_WTRE | NPCM_WTE, wdt->reg); | ||
152 | udelay(1000); | ||
153 | |||
154 | return 0; | ||
155 | } | ||
156 | |||
157 | static bool npcm_is_running(struct watchdog_device *wdd) | ||
158 | { | ||
159 | struct npcm_wdt *wdt = to_npcm_wdt(wdd); | ||
160 | |||
161 | return readl(wdt->reg) & NPCM_WTE; | ||
162 | } | ||
163 | |||
164 | static const struct watchdog_info npcm_wdt_info = { | ||
165 | .identity = KBUILD_MODNAME, | ||
166 | .options = WDIOF_SETTIMEOUT | ||
167 | | WDIOF_KEEPALIVEPING | ||
168 | | WDIOF_MAGICCLOSE, | ||
169 | }; | ||
170 | |||
171 | static const struct watchdog_ops npcm_wdt_ops = { | ||
172 | .owner = THIS_MODULE, | ||
173 | .start = npcm_wdt_start, | ||
174 | .stop = npcm_wdt_stop, | ||
175 | .ping = npcm_wdt_ping, | ||
176 | .set_timeout = npcm_wdt_set_timeout, | ||
177 | .restart = npcm_wdt_restart, | ||
178 | }; | ||
179 | |||
180 | static int npcm_wdt_probe(struct platform_device *pdev) | ||
181 | { | ||
182 | struct device *dev = &pdev->dev; | ||
183 | struct npcm_wdt *wdt; | ||
184 | struct resource *res; | ||
185 | int irq; | ||
186 | int ret; | ||
187 | |||
188 | wdt = devm_kzalloc(&pdev->dev, sizeof(*wdt), GFP_KERNEL); | ||
189 | if (!wdt) | ||
190 | return -ENOMEM; | ||
191 | |||
192 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | ||
193 | wdt->reg = devm_ioremap_resource(dev, res); | ||
194 | if (IS_ERR(wdt->reg)) | ||
195 | return PTR_ERR(wdt->reg); | ||
196 | |||
197 | irq = platform_get_irq(pdev, 0); | ||
198 | if (irq < 0) | ||
199 | return irq; | ||
200 | |||
201 | wdt->wdd.info = &npcm_wdt_info; | ||
202 | wdt->wdd.ops = &npcm_wdt_ops; | ||
203 | wdt->wdd.min_timeout = 1; | ||
204 | wdt->wdd.max_timeout = 2750; | ||
205 | wdt->wdd.parent = dev; | ||
206 | |||
207 | wdt->wdd.timeout = 86; | ||
208 | watchdog_init_timeout(&wdt->wdd, 0, dev); | ||
209 | |||
210 | /* Ensure timeout is able to be represented by the hardware */ | ||
211 | npcm_wdt_set_timeout(&wdt->wdd, wdt->wdd.timeout); | ||
212 | |||
213 | if (npcm_is_running(&wdt->wdd)) { | ||
214 | /* Restart with the default or device-tree specified timeout */ | ||
215 | npcm_wdt_start(&wdt->wdd); | ||
216 | set_bit(WDOG_HW_RUNNING, &wdt->wdd.status); | ||
217 | } | ||
218 | |||
219 | ret = devm_request_irq(dev, irq, npcm_wdt_interrupt, 0, | ||
220 | "watchdog", wdt); | ||
221 | if (ret) | ||
222 | return ret; | ||
223 | |||
224 | ret = devm_watchdog_register_device(dev, &wdt->wdd); | ||
225 | if (ret) { | ||
226 | dev_err(dev, "failed to register watchdog\n"); | ||
227 | return ret; | ||
228 | } | ||
229 | |||
230 | dev_info(dev, "NPCM watchdog driver enabled\n"); | ||
231 | |||
232 | return 0; | ||
233 | } | ||
234 | |||
235 | #ifdef CONFIG_OF | ||
236 | static const struct of_device_id npcm_wdt_match[] = { | ||
237 | {.compatible = "nuvoton,npcm750-wdt"}, | ||
238 | {}, | ||
239 | }; | ||
240 | MODULE_DEVICE_TABLE(of, npcm_wdt_match); | ||
241 | #endif | ||
242 | |||
243 | static struct platform_driver npcm_wdt_driver = { | ||
244 | .probe = npcm_wdt_probe, | ||
245 | .driver = { | ||
246 | .name = "npcm-wdt", | ||
247 | .of_match_table = of_match_ptr(npcm_wdt_match), | ||
248 | }, | ||
249 | }; | ||
250 | module_platform_driver(npcm_wdt_driver); | ||
251 | |||
252 | MODULE_AUTHOR("Joel Stanley"); | ||
253 | MODULE_DESCRIPTION("Watchdog driver for NPCM"); | ||
254 | MODULE_LICENSE("GPL v2"); | ||
diff --git a/drivers/watchdog/of_xilinx_wdt.c b/drivers/watchdog/of_xilinx_wdt.c index 1cf286945b7a..4acbe05e27bb 100644 --- a/drivers/watchdog/of_xilinx_wdt.c +++ b/drivers/watchdog/of_xilinx_wdt.c | |||
@@ -1,13 +1,9 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0+ | ||
1 | /* | 2 | /* |
2 | * Watchdog Device Driver for Xilinx axi/xps_timebase_wdt | 3 | * Watchdog Device Driver for Xilinx axi/xps_timebase_wdt |
3 | * | 4 | * |
4 | * (C) Copyright 2013 - 2014 Xilinx, Inc. | 5 | * (C) Copyright 2013 - 2014 Xilinx, Inc. |
5 | * (C) Copyright 2011 (Alejandro Cabrera <aldaya@gmail.com>) | 6 | * (C) Copyright 2011 (Alejandro Cabrera <aldaya@gmail.com>) |
6 | * | ||
7 | * This program is free software; you can redistribute it and/or | ||
8 | * modify it under the terms of the GNU General Public License | ||
9 | * as published by the Free Software Foundation; either version | ||
10 | * 2 of the License, or (at your option) any later version. | ||
11 | */ | 7 | */ |
12 | 8 | ||
13 | #include <linux/clk.h> | 9 | #include <linux/clk.h> |
@@ -323,4 +319,4 @@ module_platform_driver(xwdt_driver); | |||
323 | 319 | ||
324 | MODULE_AUTHOR("Alejandro Cabrera <aldaya@gmail.com>"); | 320 | MODULE_AUTHOR("Alejandro Cabrera <aldaya@gmail.com>"); |
325 | MODULE_DESCRIPTION("Xilinx Watchdog driver"); | 321 | MODULE_DESCRIPTION("Xilinx Watchdog driver"); |
326 | MODULE_LICENSE("GPL v2"); | 322 | MODULE_LICENSE("GPL"); |
diff --git a/drivers/watchdog/st_lpc_wdt.c b/drivers/watchdog/st_lpc_wdt.c index e6100e447dd8..177829b379da 100644 --- a/drivers/watchdog/st_lpc_wdt.c +++ b/drivers/watchdog/st_lpc_wdt.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0+ | ||
1 | /* | 2 | /* |
2 | * ST's LPC Watchdog | 3 | * ST's LPC Watchdog |
3 | * | 4 | * |
@@ -5,11 +6,6 @@ | |||
5 | * | 6 | * |
6 | * Author: David Paris <david.paris@st.com> for STMicroelectronics | 7 | * Author: David Paris <david.paris@st.com> for STMicroelectronics |
7 | * Lee Jones <lee.jones@linaro.org> for STMicroelectronics | 8 | * Lee Jones <lee.jones@linaro.org> for STMicroelectronics |
8 | * | ||
9 | * This program is free software; you can redistribute it and/or | ||
10 | * modify it under the terms of the GNU General Public Licence | ||
11 | * as published by the Free Software Foundation; either version | ||
12 | * 2 of the Licence, or (at your option) any later version. | ||
13 | */ | 9 | */ |
14 | 10 | ||
15 | #include <linux/clk.h> | 11 | #include <linux/clk.h> |
diff --git a/drivers/watchdog/tangox_wdt.c b/drivers/watchdog/tangox_wdt.c index d5fcce062920..b1de8297fa40 100644 --- a/drivers/watchdog/tangox_wdt.c +++ b/drivers/watchdog/tangox_wdt.c | |||
@@ -1,11 +1,7 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0+ | ||
1 | /* | 2 | /* |
2 | * Copyright (C) 2015 Mans Rullgard <mans@mansr.com> | 3 | * Copyright (C) 2015 Mans Rullgard <mans@mansr.com> |
3 | * SMP86xx/SMP87xx Watchdog driver | 4 | * SMP86xx/SMP87xx Watchdog driver |
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify it | ||
6 | * under the terms of the GNU General Public License as published by the | ||
7 | * Free Software Foundation; either version 2 of the License, or (at your | ||
8 | * option) any later version. | ||
9 | */ | 5 | */ |
10 | 6 | ||
11 | #include <linux/bitops.h> | 7 | #include <linux/bitops.h> |
diff --git a/drivers/watchdog/tegra_wdt.c b/drivers/watchdog/tegra_wdt.c index 9403c08816e3..877dd39bd41f 100644 --- a/drivers/watchdog/tegra_wdt.c +++ b/drivers/watchdog/tegra_wdt.c | |||
@@ -1,14 +1,6 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | /* | 2 | /* |
2 | * Copyright (c) 2014, NVIDIA CORPORATION. All rights reserved. | 3 | * Copyright (c) 2014, NVIDIA CORPORATION. All rights reserved. |
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify it | ||
5 | * under the terms and conditions of the GNU General Public License, | ||
6 | * version 2, as published by the Free Software Foundation. | ||
7 | * | ||
8 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
9 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
10 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
11 | * more details. | ||
12 | */ | 4 | */ |
13 | 5 | ||
14 | #include <linux/kernel.h> | 6 | #include <linux/kernel.h> |
diff --git a/drivers/watchdog/uniphier_wdt.c b/drivers/watchdog/uniphier_wdt.c index 0e4f8d53ce3c..e20a7a459d69 100644 --- a/drivers/watchdog/uniphier_wdt.c +++ b/drivers/watchdog/uniphier_wdt.c | |||
@@ -1,18 +1,10 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
1 | /* | 2 | /* |
2 | * Watchdog driver for the UniPhier watchdog timer | 3 | * Watchdog driver for the UniPhier watchdog timer |
3 | * | 4 | * |
4 | * (c) Copyright 2014 Panasonic Corporation | 5 | * (c) Copyright 2014 Panasonic Corporation |
5 | * (c) Copyright 2016 Socionext Inc. | 6 | * (c) Copyright 2016 Socionext Inc. |
6 | * All rights reserved. | 7 | * All rights reserved. |
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU General Public License version 2 as | ||
10 | * published by the Free Software Foundation. | ||
11 | * | ||
12 | * This program is distributed in the hope that it will be useful, | ||
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
15 | * GNU General Public License for more details. | ||
16 | */ | 8 | */ |
17 | 9 | ||
18 | #include <linux/bitops.h> | 10 | #include <linux/bitops.h> |
diff --git a/drivers/watchdog/wm831x_wdt.c b/drivers/watchdog/wm831x_wdt.c index 1ddc1f742cd4..116c2f47b463 100644 --- a/drivers/watchdog/wm831x_wdt.c +++ b/drivers/watchdog/wm831x_wdt.c | |||
@@ -1,11 +1,8 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0+ | ||
1 | /* | 2 | /* |
2 | * Watchdog driver for the wm831x PMICs | 3 | * Watchdog driver for the wm831x PMICs |
3 | * | 4 | * |
4 | * Copyright (C) 2009 Wolfson Microelectronics | 5 | * Copyright (C) 2009 Wolfson Microelectronics |
5 | * | ||
6 | * This program is free software; you can redistribute it and/or | ||
7 | * modify it under the terms of the GNU General Public License | ||
8 | * as published by the Free Software Foundation | ||
9 | */ | 6 | */ |
10 | 7 | ||
11 | #include <linux/module.h> | 8 | #include <linux/module.h> |
diff --git a/drivers/watchdog/wm8350_wdt.c b/drivers/watchdog/wm8350_wdt.c index 4ab4b8347d45..33c62d51f00a 100644 --- a/drivers/watchdog/wm8350_wdt.c +++ b/drivers/watchdog/wm8350_wdt.c | |||
@@ -1,11 +1,8 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0+ | ||
1 | /* | 2 | /* |
2 | * Watchdog driver for the wm8350 | 3 | * Watchdog driver for the wm8350 |
3 | * | 4 | * |
4 | * Copyright (C) 2007, 2008 Wolfson Microelectronics <linux@wolfsonmicro.com> | 5 | * Copyright (C) 2007, 2008 Wolfson Microelectronics <linux@wolfsonmicro.com> |
5 | * | ||
6 | * This program is free software; you can redistribute it and/or | ||
7 | * modify it under the terms of the GNU General Public License | ||
8 | * as published by the Free Software Foundation | ||
9 | */ | 6 | */ |
10 | 7 | ||
11 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | 8 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt |