All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/5] watchdog: remove obsolete drivers
@ 2021-01-20 16:27 ` Arnd Bergmann
  0 siblings, 0 replies; 38+ messages in thread
From: Arnd Bergmann @ 2021-01-20 16:27 UTC (permalink / raw)
  To: linux-arm-kernel, linux-kernel, linux-watchdog, Guenter Roeck
  Cc: Wim Van Sebroeck, Arnd Bergmann

From: Arnd Bergmann <arnd@arndb.de>

A few Arm platforms are getting removed in v5.12, this removes
the corresponding watchdog drivers.

Link: https://lore.kernel.org/linux-arm-kernel/20210120124812.2800027-1-arnd@kernel.org/T/


Arnd Bergmann (5):
  watchdog: remove sirf prima driver
  watchdog: remove sirf atlas driver
  watchdog: remove zte zx driver
  watchdog: remove tango driver
  watchdog: remove coh901 driver

 .../bindings/watchdog/sirfsoc_wdt.txt         |  18 -
 .../watchdog/stericsson-coh901327.txt         |  19 -
 .../bindings/watchdog/zte,zx2967-wdt.txt      |  32 --
 drivers/watchdog/Kconfig                      |  52 ---
 drivers/watchdog/Makefile                     |   5 -
 drivers/watchdog/atlas7_wdt.c                 | 221 ----------
 drivers/watchdog/coh901327_wdt.c              | 408 ------------------
 drivers/watchdog/sirfsoc_wdt.c                | 216 ----------
 drivers/watchdog/tangox_wdt.c                 | 209 ---------
 drivers/watchdog/zx2967_wdt.c                 | 279 ------------
 10 files changed, 1459 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/watchdog/sirfsoc_wdt.txt
 delete mode 100644 Documentation/devicetree/bindings/watchdog/stericsson-coh901327.txt
 delete mode 100644 Documentation/devicetree/bindings/watchdog/zte,zx2967-wdt.txt
 delete mode 100644 drivers/watchdog/atlas7_wdt.c
 delete mode 100644 drivers/watchdog/coh901327_wdt.c
 delete mode 100644 drivers/watchdog/sirfsoc_wdt.c
 delete mode 100644 drivers/watchdog/tangox_wdt.c
 delete mode 100644 drivers/watchdog/zx2967_wdt.c

-- 
2.29.2


^ permalink raw reply	[flat|nested] 38+ messages in thread

* [PATCH 0/5] watchdog: remove obsolete drivers
@ 2021-01-20 16:27 ` Arnd Bergmann
  0 siblings, 0 replies; 38+ messages in thread
From: Arnd Bergmann @ 2021-01-20 16:27 UTC (permalink / raw)
  To: linux-arm-kernel, linux-kernel, linux-watchdog, Guenter Roeck
  Cc: Wim Van Sebroeck, Arnd Bergmann

From: Arnd Bergmann <arnd@arndb.de>

A few Arm platforms are getting removed in v5.12, this removes
the corresponding watchdog drivers.

Link: https://lore.kernel.org/linux-arm-kernel/20210120124812.2800027-1-arnd@kernel.org/T/


Arnd Bergmann (5):
  watchdog: remove sirf prima driver
  watchdog: remove sirf atlas driver
  watchdog: remove zte zx driver
  watchdog: remove tango driver
  watchdog: remove coh901 driver

 .../bindings/watchdog/sirfsoc_wdt.txt         |  18 -
 .../watchdog/stericsson-coh901327.txt         |  19 -
 .../bindings/watchdog/zte,zx2967-wdt.txt      |  32 --
 drivers/watchdog/Kconfig                      |  52 ---
 drivers/watchdog/Makefile                     |   5 -
 drivers/watchdog/atlas7_wdt.c                 | 221 ----------
 drivers/watchdog/coh901327_wdt.c              | 408 ------------------
 drivers/watchdog/sirfsoc_wdt.c                | 216 ----------
 drivers/watchdog/tangox_wdt.c                 | 209 ---------
 drivers/watchdog/zx2967_wdt.c                 | 279 ------------
 10 files changed, 1459 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/watchdog/sirfsoc_wdt.txt
 delete mode 100644 Documentation/devicetree/bindings/watchdog/stericsson-coh901327.txt
 delete mode 100644 Documentation/devicetree/bindings/watchdog/zte,zx2967-wdt.txt
 delete mode 100644 drivers/watchdog/atlas7_wdt.c
 delete mode 100644 drivers/watchdog/coh901327_wdt.c
 delete mode 100644 drivers/watchdog/sirfsoc_wdt.c
 delete mode 100644 drivers/watchdog/tangox_wdt.c
 delete mode 100644 drivers/watchdog/zx2967_wdt.c

-- 
2.29.2


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [PATCH 1/5] watchdog: remove sirf prima driver
  2021-01-20 16:27 ` Arnd Bergmann
@ 2021-01-20 16:27   ` Arnd Bergmann
  -1 siblings, 0 replies; 38+ messages in thread
From: Arnd Bergmann @ 2021-01-20 16:27 UTC (permalink / raw)
  To: linux-arm-kernel, linux-kernel, linux-watchdog, Guenter Roeck
  Cc: Wim Van Sebroeck, Arnd Bergmann, Barry Song

From: Arnd Bergmann <arnd@arndb.de>

The CSR SiRF prima2/atlas platforms are getting removed, so this driver
is no longer needed.

Cc: Barry Song <baohua@kernel.org>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 .../bindings/watchdog/sirfsoc_wdt.txt         |  18 --
 drivers/watchdog/Kconfig                      |  10 -
 drivers/watchdog/Makefile                     |   1 -
 drivers/watchdog/sirfsoc_wdt.c                | 216 ------------------
 4 files changed, 245 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/watchdog/sirfsoc_wdt.txt
 delete mode 100644 drivers/watchdog/sirfsoc_wdt.c

diff --git a/Documentation/devicetree/bindings/watchdog/sirfsoc_wdt.txt b/Documentation/devicetree/bindings/watchdog/sirfsoc_wdt.txt
deleted file mode 100644
index 0dce5e3100b4..000000000000
--- a/Documentation/devicetree/bindings/watchdog/sirfsoc_wdt.txt
+++ /dev/null
@@ -1,18 +0,0 @@
-SiRFSoC Timer and Watchdog Timer(WDT) Controller
-
-Required properties:
-- compatible: "sirf,prima2-tick"
-- reg: Address range of tick timer/WDT register set
-- interrupts: interrupt number to the cpu
-
-Optional properties:
-- timeout-sec : Contains the watchdog timeout in seconds
-
-Example:
-
-timer@b0020000 {
-	compatible = "sirf,prima2-tick";
-	reg = <0xb0020000 0x1000>;
-	interrupts = <0>;
-	timeout-sec = <30>;
-};
diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
index 7ff941e71b79..88f4827849e4 100644
--- a/drivers/watchdog/Kconfig
+++ b/drivers/watchdog/Kconfig
@@ -788,16 +788,6 @@ config MOXART_WDT
 	  To compile this driver as a module, choose M here: the
 	  module will be called moxart_wdt.
 
-config SIRFSOC_WATCHDOG
-	tristate "SiRFSOC watchdog"
-	depends on HAS_IOMEM
-	depends on ARCH_SIRF || COMPILE_TEST
-	select WATCHDOG_CORE
-	default y
-	help
-	  Support for CSR SiRFprimaII and SiRFatlasVI watchdog. When
-	  the watchdog triggers the system will be reset.
-
 config ST_LPC_WATCHDOG
 	tristate "STMicroelectronics LPC Watchdog"
 	depends on ARCH_STI || COMPILE_TEST
diff --git a/drivers/watchdog/Makefile b/drivers/watchdog/Makefile
index 5c74ee19d441..1741ed3c6ce6 100644
--- a/drivers/watchdog/Makefile
+++ b/drivers/watchdog/Makefile
@@ -73,7 +73,6 @@ obj-$(CONFIG_UX500_WATCHDOG) += ux500_wdt.o
 obj-$(CONFIG_RETU_WATCHDOG) += retu_wdt.o
 obj-$(CONFIG_BCM2835_WDT) += bcm2835_wdt.o
 obj-$(CONFIG_MOXART_WDT) += moxart_wdt.o
-obj-$(CONFIG_SIRFSOC_WATCHDOG) += sirfsoc_wdt.o
 obj-$(CONFIG_ST_LPC_WATCHDOG) += st_lpc_wdt.o
 obj-$(CONFIG_QCOM_WDT) += qcom-wdt.o
 obj-$(CONFIG_BCM_KONA_WDT) += bcm_kona_wdt.o
diff --git a/drivers/watchdog/sirfsoc_wdt.c b/drivers/watchdog/sirfsoc_wdt.c
deleted file mode 100644
index 734cf2966ecb..000000000000
--- a/drivers/watchdog/sirfsoc_wdt.c
+++ /dev/null
@@ -1,216 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0-or-later
-/*
- * Watchdog driver for CSR SiRFprimaII and SiRFatlasVI
- *
- * Copyright (c) 2013 Cambridge Silicon Radio Limited, a CSR plc group company.
- */
-
-#include <linux/module.h>
-#include <linux/watchdog.h>
-#include <linux/platform_device.h>
-#include <linux/moduleparam.h>
-#include <linux/of.h>
-#include <linux/io.h>
-#include <linux/uaccess.h>
-
-#define CLOCK_FREQ	1000000
-
-#define SIRFSOC_TIMER_COUNTER_LO	0x0000
-#define SIRFSOC_TIMER_MATCH_0		0x0008
-#define SIRFSOC_TIMER_INT_EN		0x0024
-#define SIRFSOC_TIMER_WATCHDOG_EN	0x0028
-#define SIRFSOC_TIMER_LATCH		0x0030
-#define SIRFSOC_TIMER_LATCHED_LO	0x0034
-
-#define SIRFSOC_TIMER_WDT_INDEX		5
-
-#define SIRFSOC_WDT_MIN_TIMEOUT		30		/* 30 secs */
-#define SIRFSOC_WDT_MAX_TIMEOUT		(10 * 60)	/* 10 mins */
-#define SIRFSOC_WDT_DEFAULT_TIMEOUT	30		/* 30 secs */
-
-static unsigned int timeout;
-static bool nowayout = WATCHDOG_NOWAYOUT;
-
-module_param(timeout, uint, 0);
-module_param(nowayout, bool, 0);
-
-MODULE_PARM_DESC(timeout, "Default watchdog timeout (in seconds)");
-MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default="
-			__MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
-
-static void __iomem *sirfsoc_wdt_base(struct watchdog_device *wdd)
-{
-	return (void __iomem __force *)watchdog_get_drvdata(wdd);
-}
-
-static unsigned int sirfsoc_wdt_gettimeleft(struct watchdog_device *wdd)
-{
-	u32 counter, match;
-	void __iomem *wdt_base;
-	int time_left;
-
-	wdt_base = sirfsoc_wdt_base(wdd);
-	counter = readl(wdt_base + SIRFSOC_TIMER_COUNTER_LO);
-	match = readl(wdt_base +
-		SIRFSOC_TIMER_MATCH_0 + (SIRFSOC_TIMER_WDT_INDEX << 2));
-
-	time_left = match - counter;
-
-	return time_left / CLOCK_FREQ;
-}
-
-static int sirfsoc_wdt_updatetimeout(struct watchdog_device *wdd)
-{
-	u32 counter, timeout_ticks;
-	void __iomem *wdt_base;
-
-	timeout_ticks = wdd->timeout * CLOCK_FREQ;
-	wdt_base = sirfsoc_wdt_base(wdd);
-
-	/* Enable the latch before reading the LATCH_LO register */
-	writel(1, wdt_base + SIRFSOC_TIMER_LATCH);
-
-	/* Set the TO value */
-	counter = readl(wdt_base + SIRFSOC_TIMER_LATCHED_LO);
-
-	counter += timeout_ticks;
-
-	writel(counter, wdt_base +
-		SIRFSOC_TIMER_MATCH_0 + (SIRFSOC_TIMER_WDT_INDEX << 2));
-
-	return 0;
-}
-
-static int sirfsoc_wdt_enable(struct watchdog_device *wdd)
-{
-	void __iomem *wdt_base = sirfsoc_wdt_base(wdd);
-	sirfsoc_wdt_updatetimeout(wdd);
-
-	/*
-	 * NOTE: If interrupt is not enabled
-	 * then WD-Reset doesn't get generated at all.
-	 */
-	writel(readl(wdt_base + SIRFSOC_TIMER_INT_EN)
-		| (1 << SIRFSOC_TIMER_WDT_INDEX),
-		wdt_base + SIRFSOC_TIMER_INT_EN);
-	writel(1, wdt_base + SIRFSOC_TIMER_WATCHDOG_EN);
-
-	return 0;
-}
-
-static int sirfsoc_wdt_disable(struct watchdog_device *wdd)
-{
-	void __iomem *wdt_base = sirfsoc_wdt_base(wdd);
-
-	writel(0, wdt_base + SIRFSOC_TIMER_WATCHDOG_EN);
-	writel(readl(wdt_base + SIRFSOC_TIMER_INT_EN)
-		& (~(1 << SIRFSOC_TIMER_WDT_INDEX)),
-		wdt_base + SIRFSOC_TIMER_INT_EN);
-
-	return 0;
-}
-
-static int sirfsoc_wdt_settimeout(struct watchdog_device *wdd, unsigned int to)
-{
-	wdd->timeout = to;
-	sirfsoc_wdt_updatetimeout(wdd);
-
-	return 0;
-}
-
-#define OPTIONS (WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING | WDIOF_MAGICCLOSE)
-
-static const struct watchdog_info sirfsoc_wdt_ident = {
-	.options          =     OPTIONS,
-	.firmware_version =	0,
-	.identity         =	"SiRFSOC Watchdog",
-};
-
-static const struct watchdog_ops sirfsoc_wdt_ops = {
-	.owner = THIS_MODULE,
-	.start = sirfsoc_wdt_enable,
-	.stop = sirfsoc_wdt_disable,
-	.get_timeleft = sirfsoc_wdt_gettimeleft,
-	.ping = sirfsoc_wdt_updatetimeout,
-	.set_timeout = sirfsoc_wdt_settimeout,
-};
-
-static struct watchdog_device sirfsoc_wdd = {
-	.info = &sirfsoc_wdt_ident,
-	.ops = &sirfsoc_wdt_ops,
-	.timeout = SIRFSOC_WDT_DEFAULT_TIMEOUT,
-	.min_timeout = SIRFSOC_WDT_MIN_TIMEOUT,
-	.max_timeout = SIRFSOC_WDT_MAX_TIMEOUT,
-};
-
-static int sirfsoc_wdt_probe(struct platform_device *pdev)
-{
-	struct device *dev = &pdev->dev;
-	int ret;
-	void __iomem *base;
-
-	base = devm_platform_ioremap_resource(pdev, 0);
-	if (IS_ERR(base))
-		return PTR_ERR(base);
-
-	watchdog_set_drvdata(&sirfsoc_wdd, (__force void *)base);
-
-	watchdog_init_timeout(&sirfsoc_wdd, timeout, dev);
-	watchdog_set_nowayout(&sirfsoc_wdd, nowayout);
-	sirfsoc_wdd.parent = dev;
-
-	watchdog_stop_on_reboot(&sirfsoc_wdd);
-	watchdog_stop_on_unregister(&sirfsoc_wdd);
-	ret = devm_watchdog_register_device(dev, &sirfsoc_wdd);
-	if (ret)
-		return ret;
-
-	platform_set_drvdata(pdev, &sirfsoc_wdd);
-
-	return 0;
-}
-
-#ifdef	CONFIG_PM_SLEEP
-static int sirfsoc_wdt_suspend(struct device *dev)
-{
-	return 0;
-}
-
-static int sirfsoc_wdt_resume(struct device *dev)
-{
-	struct watchdog_device *wdd = dev_get_drvdata(dev);
-
-	/*
-	 * NOTE: Since timer controller registers settings are saved
-	 * and restored back by the timer-prima2.c, so we need not
-	 * update WD settings except refreshing timeout.
-	 */
-	sirfsoc_wdt_updatetimeout(wdd);
-
-	return 0;
-}
-#endif
-
-static SIMPLE_DEV_PM_OPS(sirfsoc_wdt_pm_ops,
-		sirfsoc_wdt_suspend, sirfsoc_wdt_resume);
-
-static const struct of_device_id sirfsoc_wdt_of_match[] = {
-	{ .compatible = "sirf,prima2-tick"},
-	{},
-};
-MODULE_DEVICE_TABLE(of, sirfsoc_wdt_of_match);
-
-static struct platform_driver sirfsoc_wdt_driver = {
-	.driver = {
-		.name = "sirfsoc-wdt",
-		.pm = &sirfsoc_wdt_pm_ops,
-		.of_match_table	= sirfsoc_wdt_of_match,
-	},
-	.probe = sirfsoc_wdt_probe,
-};
-module_platform_driver(sirfsoc_wdt_driver);
-
-MODULE_DESCRIPTION("SiRF SoC watchdog driver");
-MODULE_AUTHOR("Xianglong Du <Xianglong.Du@csr.com>");
-MODULE_LICENSE("GPL v2");
-MODULE_ALIAS("platform:sirfsoc-wdt");
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [PATCH 1/5] watchdog: remove sirf prima driver
@ 2021-01-20 16:27   ` Arnd Bergmann
  0 siblings, 0 replies; 38+ messages in thread
From: Arnd Bergmann @ 2021-01-20 16:27 UTC (permalink / raw)
  To: linux-arm-kernel, linux-kernel, linux-watchdog, Guenter Roeck
  Cc: Barry Song, Wim Van Sebroeck, Arnd Bergmann

From: Arnd Bergmann <arnd@arndb.de>

The CSR SiRF prima2/atlas platforms are getting removed, so this driver
is no longer needed.

Cc: Barry Song <baohua@kernel.org>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 .../bindings/watchdog/sirfsoc_wdt.txt         |  18 --
 drivers/watchdog/Kconfig                      |  10 -
 drivers/watchdog/Makefile                     |   1 -
 drivers/watchdog/sirfsoc_wdt.c                | 216 ------------------
 4 files changed, 245 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/watchdog/sirfsoc_wdt.txt
 delete mode 100644 drivers/watchdog/sirfsoc_wdt.c

diff --git a/Documentation/devicetree/bindings/watchdog/sirfsoc_wdt.txt b/Documentation/devicetree/bindings/watchdog/sirfsoc_wdt.txt
deleted file mode 100644
index 0dce5e3100b4..000000000000
--- a/Documentation/devicetree/bindings/watchdog/sirfsoc_wdt.txt
+++ /dev/null
@@ -1,18 +0,0 @@
-SiRFSoC Timer and Watchdog Timer(WDT) Controller
-
-Required properties:
-- compatible: "sirf,prima2-tick"
-- reg: Address range of tick timer/WDT register set
-- interrupts: interrupt number to the cpu
-
-Optional properties:
-- timeout-sec : Contains the watchdog timeout in seconds
-
-Example:
-
-timer@b0020000 {
-	compatible = "sirf,prima2-tick";
-	reg = <0xb0020000 0x1000>;
-	interrupts = <0>;
-	timeout-sec = <30>;
-};
diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
index 7ff941e71b79..88f4827849e4 100644
--- a/drivers/watchdog/Kconfig
+++ b/drivers/watchdog/Kconfig
@@ -788,16 +788,6 @@ config MOXART_WDT
 	  To compile this driver as a module, choose M here: the
 	  module will be called moxart_wdt.
 
-config SIRFSOC_WATCHDOG
-	tristate "SiRFSOC watchdog"
-	depends on HAS_IOMEM
-	depends on ARCH_SIRF || COMPILE_TEST
-	select WATCHDOG_CORE
-	default y
-	help
-	  Support for CSR SiRFprimaII and SiRFatlasVI watchdog. When
-	  the watchdog triggers the system will be reset.
-
 config ST_LPC_WATCHDOG
 	tristate "STMicroelectronics LPC Watchdog"
 	depends on ARCH_STI || COMPILE_TEST
diff --git a/drivers/watchdog/Makefile b/drivers/watchdog/Makefile
index 5c74ee19d441..1741ed3c6ce6 100644
--- a/drivers/watchdog/Makefile
+++ b/drivers/watchdog/Makefile
@@ -73,7 +73,6 @@ obj-$(CONFIG_UX500_WATCHDOG) += ux500_wdt.o
 obj-$(CONFIG_RETU_WATCHDOG) += retu_wdt.o
 obj-$(CONFIG_BCM2835_WDT) += bcm2835_wdt.o
 obj-$(CONFIG_MOXART_WDT) += moxart_wdt.o
-obj-$(CONFIG_SIRFSOC_WATCHDOG) += sirfsoc_wdt.o
 obj-$(CONFIG_ST_LPC_WATCHDOG) += st_lpc_wdt.o
 obj-$(CONFIG_QCOM_WDT) += qcom-wdt.o
 obj-$(CONFIG_BCM_KONA_WDT) += bcm_kona_wdt.o
diff --git a/drivers/watchdog/sirfsoc_wdt.c b/drivers/watchdog/sirfsoc_wdt.c
deleted file mode 100644
index 734cf2966ecb..000000000000
--- a/drivers/watchdog/sirfsoc_wdt.c
+++ /dev/null
@@ -1,216 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0-or-later
-/*
- * Watchdog driver for CSR SiRFprimaII and SiRFatlasVI
- *
- * Copyright (c) 2013 Cambridge Silicon Radio Limited, a CSR plc group company.
- */
-
-#include <linux/module.h>
-#include <linux/watchdog.h>
-#include <linux/platform_device.h>
-#include <linux/moduleparam.h>
-#include <linux/of.h>
-#include <linux/io.h>
-#include <linux/uaccess.h>
-
-#define CLOCK_FREQ	1000000
-
-#define SIRFSOC_TIMER_COUNTER_LO	0x0000
-#define SIRFSOC_TIMER_MATCH_0		0x0008
-#define SIRFSOC_TIMER_INT_EN		0x0024
-#define SIRFSOC_TIMER_WATCHDOG_EN	0x0028
-#define SIRFSOC_TIMER_LATCH		0x0030
-#define SIRFSOC_TIMER_LATCHED_LO	0x0034
-
-#define SIRFSOC_TIMER_WDT_INDEX		5
-
-#define SIRFSOC_WDT_MIN_TIMEOUT		30		/* 30 secs */
-#define SIRFSOC_WDT_MAX_TIMEOUT		(10 * 60)	/* 10 mins */
-#define SIRFSOC_WDT_DEFAULT_TIMEOUT	30		/* 30 secs */
-
-static unsigned int timeout;
-static bool nowayout = WATCHDOG_NOWAYOUT;
-
-module_param(timeout, uint, 0);
-module_param(nowayout, bool, 0);
-
-MODULE_PARM_DESC(timeout, "Default watchdog timeout (in seconds)");
-MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default="
-			__MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
-
-static void __iomem *sirfsoc_wdt_base(struct watchdog_device *wdd)
-{
-	return (void __iomem __force *)watchdog_get_drvdata(wdd);
-}
-
-static unsigned int sirfsoc_wdt_gettimeleft(struct watchdog_device *wdd)
-{
-	u32 counter, match;
-	void __iomem *wdt_base;
-	int time_left;
-
-	wdt_base = sirfsoc_wdt_base(wdd);
-	counter = readl(wdt_base + SIRFSOC_TIMER_COUNTER_LO);
-	match = readl(wdt_base +
-		SIRFSOC_TIMER_MATCH_0 + (SIRFSOC_TIMER_WDT_INDEX << 2));
-
-	time_left = match - counter;
-
-	return time_left / CLOCK_FREQ;
-}
-
-static int sirfsoc_wdt_updatetimeout(struct watchdog_device *wdd)
-{
-	u32 counter, timeout_ticks;
-	void __iomem *wdt_base;
-
-	timeout_ticks = wdd->timeout * CLOCK_FREQ;
-	wdt_base = sirfsoc_wdt_base(wdd);
-
-	/* Enable the latch before reading the LATCH_LO register */
-	writel(1, wdt_base + SIRFSOC_TIMER_LATCH);
-
-	/* Set the TO value */
-	counter = readl(wdt_base + SIRFSOC_TIMER_LATCHED_LO);
-
-	counter += timeout_ticks;
-
-	writel(counter, wdt_base +
-		SIRFSOC_TIMER_MATCH_0 + (SIRFSOC_TIMER_WDT_INDEX << 2));
-
-	return 0;
-}
-
-static int sirfsoc_wdt_enable(struct watchdog_device *wdd)
-{
-	void __iomem *wdt_base = sirfsoc_wdt_base(wdd);
-	sirfsoc_wdt_updatetimeout(wdd);
-
-	/*
-	 * NOTE: If interrupt is not enabled
-	 * then WD-Reset doesn't get generated at all.
-	 */
-	writel(readl(wdt_base + SIRFSOC_TIMER_INT_EN)
-		| (1 << SIRFSOC_TIMER_WDT_INDEX),
-		wdt_base + SIRFSOC_TIMER_INT_EN);
-	writel(1, wdt_base + SIRFSOC_TIMER_WATCHDOG_EN);
-
-	return 0;
-}
-
-static int sirfsoc_wdt_disable(struct watchdog_device *wdd)
-{
-	void __iomem *wdt_base = sirfsoc_wdt_base(wdd);
-
-	writel(0, wdt_base + SIRFSOC_TIMER_WATCHDOG_EN);
-	writel(readl(wdt_base + SIRFSOC_TIMER_INT_EN)
-		& (~(1 << SIRFSOC_TIMER_WDT_INDEX)),
-		wdt_base + SIRFSOC_TIMER_INT_EN);
-
-	return 0;
-}
-
-static int sirfsoc_wdt_settimeout(struct watchdog_device *wdd, unsigned int to)
-{
-	wdd->timeout = to;
-	sirfsoc_wdt_updatetimeout(wdd);
-
-	return 0;
-}
-
-#define OPTIONS (WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING | WDIOF_MAGICCLOSE)
-
-static const struct watchdog_info sirfsoc_wdt_ident = {
-	.options          =     OPTIONS,
-	.firmware_version =	0,
-	.identity         =	"SiRFSOC Watchdog",
-};
-
-static const struct watchdog_ops sirfsoc_wdt_ops = {
-	.owner = THIS_MODULE,
-	.start = sirfsoc_wdt_enable,
-	.stop = sirfsoc_wdt_disable,
-	.get_timeleft = sirfsoc_wdt_gettimeleft,
-	.ping = sirfsoc_wdt_updatetimeout,
-	.set_timeout = sirfsoc_wdt_settimeout,
-};
-
-static struct watchdog_device sirfsoc_wdd = {
-	.info = &sirfsoc_wdt_ident,
-	.ops = &sirfsoc_wdt_ops,
-	.timeout = SIRFSOC_WDT_DEFAULT_TIMEOUT,
-	.min_timeout = SIRFSOC_WDT_MIN_TIMEOUT,
-	.max_timeout = SIRFSOC_WDT_MAX_TIMEOUT,
-};
-
-static int sirfsoc_wdt_probe(struct platform_device *pdev)
-{
-	struct device *dev = &pdev->dev;
-	int ret;
-	void __iomem *base;
-
-	base = devm_platform_ioremap_resource(pdev, 0);
-	if (IS_ERR(base))
-		return PTR_ERR(base);
-
-	watchdog_set_drvdata(&sirfsoc_wdd, (__force void *)base);
-
-	watchdog_init_timeout(&sirfsoc_wdd, timeout, dev);
-	watchdog_set_nowayout(&sirfsoc_wdd, nowayout);
-	sirfsoc_wdd.parent = dev;
-
-	watchdog_stop_on_reboot(&sirfsoc_wdd);
-	watchdog_stop_on_unregister(&sirfsoc_wdd);
-	ret = devm_watchdog_register_device(dev, &sirfsoc_wdd);
-	if (ret)
-		return ret;
-
-	platform_set_drvdata(pdev, &sirfsoc_wdd);
-
-	return 0;
-}
-
-#ifdef	CONFIG_PM_SLEEP
-static int sirfsoc_wdt_suspend(struct device *dev)
-{
-	return 0;
-}
-
-static int sirfsoc_wdt_resume(struct device *dev)
-{
-	struct watchdog_device *wdd = dev_get_drvdata(dev);
-
-	/*
-	 * NOTE: Since timer controller registers settings are saved
-	 * and restored back by the timer-prima2.c, so we need not
-	 * update WD settings except refreshing timeout.
-	 */
-	sirfsoc_wdt_updatetimeout(wdd);
-
-	return 0;
-}
-#endif
-
-static SIMPLE_DEV_PM_OPS(sirfsoc_wdt_pm_ops,
-		sirfsoc_wdt_suspend, sirfsoc_wdt_resume);
-
-static const struct of_device_id sirfsoc_wdt_of_match[] = {
-	{ .compatible = "sirf,prima2-tick"},
-	{},
-};
-MODULE_DEVICE_TABLE(of, sirfsoc_wdt_of_match);
-
-static struct platform_driver sirfsoc_wdt_driver = {
-	.driver = {
-		.name = "sirfsoc-wdt",
-		.pm = &sirfsoc_wdt_pm_ops,
-		.of_match_table	= sirfsoc_wdt_of_match,
-	},
-	.probe = sirfsoc_wdt_probe,
-};
-module_platform_driver(sirfsoc_wdt_driver);
-
-MODULE_DESCRIPTION("SiRF SoC watchdog driver");
-MODULE_AUTHOR("Xianglong Du <Xianglong.Du@csr.com>");
-MODULE_LICENSE("GPL v2");
-MODULE_ALIAS("platform:sirfsoc-wdt");
-- 
2.29.2


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [PATCH 2/5] watchdog: remove sirf atlas driver
  2021-01-20 16:27 ` Arnd Bergmann
@ 2021-01-20 16:27   ` Arnd Bergmann
  -1 siblings, 0 replies; 38+ messages in thread
From: Arnd Bergmann @ 2021-01-20 16:27 UTC (permalink / raw)
  To: linux-arm-kernel, linux-kernel, linux-watchdog, Guenter Roeck
  Cc: Wim Van Sebroeck, Arnd Bergmann, Barry Song

From: Arnd Bergmann <arnd@arndb.de>

The CSR SiRF prima2/atlas platforms are getting removed, so this driver
is no longer needed.

Cc: Barry Song <baohua@kernel.org>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/watchdog/Kconfig      |  10 --
 drivers/watchdog/Makefile     |   1 -
 drivers/watchdog/atlas7_wdt.c | 221 ----------------------------------
 3 files changed, 232 deletions(-)
 delete mode 100644 drivers/watchdog/atlas7_wdt.c

diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
index 88f4827849e4..5559e4325f6a 100644
--- a/drivers/watchdog/Kconfig
+++ b/drivers/watchdog/Kconfig
@@ -890,16 +890,6 @@ config LPC18XX_WATCHDOG
 	  To compile this driver as a module, choose M here: the
 	  module will be called lpc18xx_wdt.
 
-config ATLAS7_WATCHDOG
-	tristate "CSRatlas7 watchdog"
-	depends on ARCH_ATLAS7 || COMPILE_TEST
-	help
-	  Say Y here to include Watchdog timer support for the watchdog
-	  existing on the CSRatlas7 series platforms.
-
-	  To compile this driver as a module, choose M here: the
-	  module will be called atlas7_wdt.
-
 config RENESAS_WDT
 	tristate "Renesas WDT Watchdog"
 	depends on ARCH_RENESAS || COMPILE_TEST
diff --git a/drivers/watchdog/Makefile b/drivers/watchdog/Makefile
index 1741ed3c6ce6..40b94403c487 100644
--- a/drivers/watchdog/Makefile
+++ b/drivers/watchdog/Makefile
@@ -83,7 +83,6 @@ obj-$(CONFIG_MEDIATEK_WATCHDOG) += mtk_wdt.o
 obj-$(CONFIG_DIGICOLOR_WATCHDOG) += digicolor_wdt.o
 obj-$(CONFIG_LPC18XX_WATCHDOG) += lpc18xx_wdt.o
 obj-$(CONFIG_BCM7038_WDT) += bcm7038_wdt.o
-obj-$(CONFIG_ATLAS7_WATCHDOG) += atlas7_wdt.o
 obj-$(CONFIG_RENESAS_WDT) += renesas_wdt.o
 obj-$(CONFIG_RENESAS_RZAWDT) += rza_wdt.o
 obj-$(CONFIG_ASPEED_WATCHDOG) += aspeed_wdt.o
diff --git a/drivers/watchdog/atlas7_wdt.c b/drivers/watchdog/atlas7_wdt.c
deleted file mode 100644
index 9bfe650d802f..000000000000
--- a/drivers/watchdog/atlas7_wdt.c
+++ /dev/null
@@ -1,221 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0-only
-/*
- * Watchdog driver for CSR Atlas7
- *
- * Copyright (c) 2015 Cambridge Silicon Radio Limited, a CSR plc group company.
- */
-
-#include <linux/clk.h>
-#include <linux/io.h>
-#include <linux/module.h>
-#include <linux/moduleparam.h>
-#include <linux/of.h>
-#include <linux/platform_device.h>
-#include <linux/watchdog.h>
-
-#define ATLAS7_TIMER_WDT_INDEX		5
-#define ATLAS7_WDT_DEFAULT_TIMEOUT	20
-
-#define ATLAS7_WDT_CNT_CTRL	(0 + 4 * ATLAS7_TIMER_WDT_INDEX)
-#define ATLAS7_WDT_CNT_MATCH	(0x18 + 4 * ATLAS7_TIMER_WDT_INDEX)
-#define ATLAS7_WDT_CNT		(0x48 +  4 * ATLAS7_TIMER_WDT_INDEX)
-#define ATLAS7_WDT_CNT_EN	(BIT(0) | BIT(1))
-#define ATLAS7_WDT_EN		0x64
-
-static unsigned int timeout = ATLAS7_WDT_DEFAULT_TIMEOUT;
-static bool nowayout = WATCHDOG_NOWAYOUT;
-
-module_param(timeout, uint, 0);
-module_param(nowayout, bool, 0);
-
-MODULE_PARM_DESC(timeout, "Default watchdog timeout (in seconds)");
-MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default="
-			__MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
-
-struct atlas7_wdog {
-	struct device *dev;
-	void __iomem *base;
-	unsigned long tick_rate;
-	struct clk *clk;
-};
-
-static unsigned int atlas7_wdt_gettimeleft(struct watchdog_device *wdd)
-{
-	struct atlas7_wdog *wdt = watchdog_get_drvdata(wdd);
-	u32 counter, match, delta;
-
-	counter = readl(wdt->base + ATLAS7_WDT_CNT);
-	match = readl(wdt->base + ATLAS7_WDT_CNT_MATCH);
-	delta = match - counter;
-
-	return  delta / wdt->tick_rate;
-}
-
-static int atlas7_wdt_ping(struct watchdog_device *wdd)
-{
-	struct atlas7_wdog *wdt = watchdog_get_drvdata(wdd);
-	u32 counter, match, delta;
-
-	counter = readl(wdt->base + ATLAS7_WDT_CNT);
-	delta = wdd->timeout * wdt->tick_rate;
-	match = counter + delta;
-
-	writel(match, wdt->base + ATLAS7_WDT_CNT_MATCH);
-
-	return 0;
-}
-
-static int atlas7_wdt_enable(struct watchdog_device *wdd)
-{
-	struct atlas7_wdog *wdt = watchdog_get_drvdata(wdd);
-
-	atlas7_wdt_ping(wdd);
-
-	writel(readl(wdt->base + ATLAS7_WDT_CNT_CTRL) | ATLAS7_WDT_CNT_EN,
-	      wdt->base + ATLAS7_WDT_CNT_CTRL);
-	writel(1, wdt->base + ATLAS7_WDT_EN);
-
-	return 0;
-}
-
-static int atlas7_wdt_disable(struct watchdog_device *wdd)
-{
-	struct atlas7_wdog *wdt = watchdog_get_drvdata(wdd);
-
-	writel(0, wdt->base + ATLAS7_WDT_EN);
-	writel(readl(wdt->base + ATLAS7_WDT_CNT_CTRL) & ~ATLAS7_WDT_CNT_EN,
-	      wdt->base + ATLAS7_WDT_CNT_CTRL);
-
-	return 0;
-}
-
-static int atlas7_wdt_settimeout(struct watchdog_device *wdd, unsigned int to)
-{
-	wdd->timeout = to;
-
-	return 0;
-}
-
-#define OPTIONS (WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING | WDIOF_MAGICCLOSE)
-
-static const struct watchdog_info atlas7_wdt_ident = {
-	.options = OPTIONS,
-	.firmware_version = 0,
-	.identity = "atlas7 Watchdog",
-};
-
-static const struct watchdog_ops atlas7_wdt_ops = {
-	.owner = THIS_MODULE,
-	.start = atlas7_wdt_enable,
-	.stop = atlas7_wdt_disable,
-	.get_timeleft = atlas7_wdt_gettimeleft,
-	.ping = atlas7_wdt_ping,
-	.set_timeout = atlas7_wdt_settimeout,
-};
-
-static struct watchdog_device atlas7_wdd = {
-	.info = &atlas7_wdt_ident,
-	.ops = &atlas7_wdt_ops,
-	.timeout = ATLAS7_WDT_DEFAULT_TIMEOUT,
-};
-
-static const struct of_device_id atlas7_wdt_ids[] = {
-	{ .compatible = "sirf,atlas7-tick"},
-	{}
-};
-
-static void atlas7_clk_disable_unprepare(void *data)
-{
-	clk_disable_unprepare(data);
-}
-
-static int atlas7_wdt_probe(struct platform_device *pdev)
-{
-	struct device *dev = &pdev->dev;
-	struct atlas7_wdog *wdt;
-	struct clk *clk;
-	int ret;
-
-	wdt = devm_kzalloc(dev, sizeof(*wdt), GFP_KERNEL);
-	if (!wdt)
-		return -ENOMEM;
-	wdt->base = devm_platform_ioremap_resource(pdev, 0);
-	if (IS_ERR(wdt->base))
-		return PTR_ERR(wdt->base);
-
-	clk = devm_clk_get(dev, NULL);
-	if (IS_ERR(clk))
-		return PTR_ERR(clk);
-	ret = clk_prepare_enable(clk);
-	if (ret) {
-		dev_err(dev, "clk enable failed\n");
-		return ret;
-	}
-	ret = devm_add_action_or_reset(dev, atlas7_clk_disable_unprepare, clk);
-	if (ret)
-		return ret;
-
-	/* disable watchdog hardware */
-	writel(0, wdt->base + ATLAS7_WDT_CNT_CTRL);
-
-	wdt->tick_rate = clk_get_rate(clk);
-	if (!wdt->tick_rate)
-		return -EINVAL;
-
-	wdt->clk = clk;
-	atlas7_wdd.min_timeout = 1;
-	atlas7_wdd.max_timeout = UINT_MAX / wdt->tick_rate;
-
-	watchdog_init_timeout(&atlas7_wdd, 0, dev);
-	watchdog_set_nowayout(&atlas7_wdd, nowayout);
-
-	watchdog_set_drvdata(&atlas7_wdd, wdt);
-	platform_set_drvdata(pdev, &atlas7_wdd);
-
-	watchdog_stop_on_reboot(&atlas7_wdd);
-	watchdog_stop_on_unregister(&atlas7_wdd);
-	return devm_watchdog_register_device(dev, &atlas7_wdd);
-}
-
-static int __maybe_unused atlas7_wdt_suspend(struct device *dev)
-{
-	/*
-	 * NOTE:timer controller registers settings are saved
-	 * and restored back by the timer-atlas7.c
-	 */
-	return 0;
-}
-
-static int __maybe_unused atlas7_wdt_resume(struct device *dev)
-{
-	struct watchdog_device *wdd = dev_get_drvdata(dev);
-
-	/*
-	 * NOTE: Since timer controller registers settings are saved
-	 * and restored back by the timer-atlas7.c, so we need not
-	 * update WD settings except refreshing timeout.
-	 */
-	atlas7_wdt_ping(wdd);
-
-	return 0;
-}
-
-static SIMPLE_DEV_PM_OPS(atlas7_wdt_pm_ops,
-		atlas7_wdt_suspend, atlas7_wdt_resume);
-
-MODULE_DEVICE_TABLE(of, atlas7_wdt_ids);
-
-static struct platform_driver atlas7_wdt_driver = {
-	.driver = {
-		.name = "atlas7-wdt",
-		.pm = &atlas7_wdt_pm_ops,
-		.of_match_table	= atlas7_wdt_ids,
-	},
-	.probe = atlas7_wdt_probe,
-};
-module_platform_driver(atlas7_wdt_driver);
-
-MODULE_DESCRIPTION("CSRatlas7 watchdog driver");
-MODULE_AUTHOR("Guo Zeng <Guo.Zeng@csr.com>");
-MODULE_LICENSE("GPL v2");
-MODULE_ALIAS("platform:atlas7-wdt");
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [PATCH 2/5] watchdog: remove sirf atlas driver
@ 2021-01-20 16:27   ` Arnd Bergmann
  0 siblings, 0 replies; 38+ messages in thread
From: Arnd Bergmann @ 2021-01-20 16:27 UTC (permalink / raw)
  To: linux-arm-kernel, linux-kernel, linux-watchdog, Guenter Roeck
  Cc: Barry Song, Wim Van Sebroeck, Arnd Bergmann

From: Arnd Bergmann <arnd@arndb.de>

The CSR SiRF prima2/atlas platforms are getting removed, so this driver
is no longer needed.

Cc: Barry Song <baohua@kernel.org>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/watchdog/Kconfig      |  10 --
 drivers/watchdog/Makefile     |   1 -
 drivers/watchdog/atlas7_wdt.c | 221 ----------------------------------
 3 files changed, 232 deletions(-)
 delete mode 100644 drivers/watchdog/atlas7_wdt.c

diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
index 88f4827849e4..5559e4325f6a 100644
--- a/drivers/watchdog/Kconfig
+++ b/drivers/watchdog/Kconfig
@@ -890,16 +890,6 @@ config LPC18XX_WATCHDOG
 	  To compile this driver as a module, choose M here: the
 	  module will be called lpc18xx_wdt.
 
-config ATLAS7_WATCHDOG
-	tristate "CSRatlas7 watchdog"
-	depends on ARCH_ATLAS7 || COMPILE_TEST
-	help
-	  Say Y here to include Watchdog timer support for the watchdog
-	  existing on the CSRatlas7 series platforms.
-
-	  To compile this driver as a module, choose M here: the
-	  module will be called atlas7_wdt.
-
 config RENESAS_WDT
 	tristate "Renesas WDT Watchdog"
 	depends on ARCH_RENESAS || COMPILE_TEST
diff --git a/drivers/watchdog/Makefile b/drivers/watchdog/Makefile
index 1741ed3c6ce6..40b94403c487 100644
--- a/drivers/watchdog/Makefile
+++ b/drivers/watchdog/Makefile
@@ -83,7 +83,6 @@ obj-$(CONFIG_MEDIATEK_WATCHDOG) += mtk_wdt.o
 obj-$(CONFIG_DIGICOLOR_WATCHDOG) += digicolor_wdt.o
 obj-$(CONFIG_LPC18XX_WATCHDOG) += lpc18xx_wdt.o
 obj-$(CONFIG_BCM7038_WDT) += bcm7038_wdt.o
-obj-$(CONFIG_ATLAS7_WATCHDOG) += atlas7_wdt.o
 obj-$(CONFIG_RENESAS_WDT) += renesas_wdt.o
 obj-$(CONFIG_RENESAS_RZAWDT) += rza_wdt.o
 obj-$(CONFIG_ASPEED_WATCHDOG) += aspeed_wdt.o
diff --git a/drivers/watchdog/atlas7_wdt.c b/drivers/watchdog/atlas7_wdt.c
deleted file mode 100644
index 9bfe650d802f..000000000000
--- a/drivers/watchdog/atlas7_wdt.c
+++ /dev/null
@@ -1,221 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0-only
-/*
- * Watchdog driver for CSR Atlas7
- *
- * Copyright (c) 2015 Cambridge Silicon Radio Limited, a CSR plc group company.
- */
-
-#include <linux/clk.h>
-#include <linux/io.h>
-#include <linux/module.h>
-#include <linux/moduleparam.h>
-#include <linux/of.h>
-#include <linux/platform_device.h>
-#include <linux/watchdog.h>
-
-#define ATLAS7_TIMER_WDT_INDEX		5
-#define ATLAS7_WDT_DEFAULT_TIMEOUT	20
-
-#define ATLAS7_WDT_CNT_CTRL	(0 + 4 * ATLAS7_TIMER_WDT_INDEX)
-#define ATLAS7_WDT_CNT_MATCH	(0x18 + 4 * ATLAS7_TIMER_WDT_INDEX)
-#define ATLAS7_WDT_CNT		(0x48 +  4 * ATLAS7_TIMER_WDT_INDEX)
-#define ATLAS7_WDT_CNT_EN	(BIT(0) | BIT(1))
-#define ATLAS7_WDT_EN		0x64
-
-static unsigned int timeout = ATLAS7_WDT_DEFAULT_TIMEOUT;
-static bool nowayout = WATCHDOG_NOWAYOUT;
-
-module_param(timeout, uint, 0);
-module_param(nowayout, bool, 0);
-
-MODULE_PARM_DESC(timeout, "Default watchdog timeout (in seconds)");
-MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default="
-			__MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
-
-struct atlas7_wdog {
-	struct device *dev;
-	void __iomem *base;
-	unsigned long tick_rate;
-	struct clk *clk;
-};
-
-static unsigned int atlas7_wdt_gettimeleft(struct watchdog_device *wdd)
-{
-	struct atlas7_wdog *wdt = watchdog_get_drvdata(wdd);
-	u32 counter, match, delta;
-
-	counter = readl(wdt->base + ATLAS7_WDT_CNT);
-	match = readl(wdt->base + ATLAS7_WDT_CNT_MATCH);
-	delta = match - counter;
-
-	return  delta / wdt->tick_rate;
-}
-
-static int atlas7_wdt_ping(struct watchdog_device *wdd)
-{
-	struct atlas7_wdog *wdt = watchdog_get_drvdata(wdd);
-	u32 counter, match, delta;
-
-	counter = readl(wdt->base + ATLAS7_WDT_CNT);
-	delta = wdd->timeout * wdt->tick_rate;
-	match = counter + delta;
-
-	writel(match, wdt->base + ATLAS7_WDT_CNT_MATCH);
-
-	return 0;
-}
-
-static int atlas7_wdt_enable(struct watchdog_device *wdd)
-{
-	struct atlas7_wdog *wdt = watchdog_get_drvdata(wdd);
-
-	atlas7_wdt_ping(wdd);
-
-	writel(readl(wdt->base + ATLAS7_WDT_CNT_CTRL) | ATLAS7_WDT_CNT_EN,
-	      wdt->base + ATLAS7_WDT_CNT_CTRL);
-	writel(1, wdt->base + ATLAS7_WDT_EN);
-
-	return 0;
-}
-
-static int atlas7_wdt_disable(struct watchdog_device *wdd)
-{
-	struct atlas7_wdog *wdt = watchdog_get_drvdata(wdd);
-
-	writel(0, wdt->base + ATLAS7_WDT_EN);
-	writel(readl(wdt->base + ATLAS7_WDT_CNT_CTRL) & ~ATLAS7_WDT_CNT_EN,
-	      wdt->base + ATLAS7_WDT_CNT_CTRL);
-
-	return 0;
-}
-
-static int atlas7_wdt_settimeout(struct watchdog_device *wdd, unsigned int to)
-{
-	wdd->timeout = to;
-
-	return 0;
-}
-
-#define OPTIONS (WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING | WDIOF_MAGICCLOSE)
-
-static const struct watchdog_info atlas7_wdt_ident = {
-	.options = OPTIONS,
-	.firmware_version = 0,
-	.identity = "atlas7 Watchdog",
-};
-
-static const struct watchdog_ops atlas7_wdt_ops = {
-	.owner = THIS_MODULE,
-	.start = atlas7_wdt_enable,
-	.stop = atlas7_wdt_disable,
-	.get_timeleft = atlas7_wdt_gettimeleft,
-	.ping = atlas7_wdt_ping,
-	.set_timeout = atlas7_wdt_settimeout,
-};
-
-static struct watchdog_device atlas7_wdd = {
-	.info = &atlas7_wdt_ident,
-	.ops = &atlas7_wdt_ops,
-	.timeout = ATLAS7_WDT_DEFAULT_TIMEOUT,
-};
-
-static const struct of_device_id atlas7_wdt_ids[] = {
-	{ .compatible = "sirf,atlas7-tick"},
-	{}
-};
-
-static void atlas7_clk_disable_unprepare(void *data)
-{
-	clk_disable_unprepare(data);
-}
-
-static int atlas7_wdt_probe(struct platform_device *pdev)
-{
-	struct device *dev = &pdev->dev;
-	struct atlas7_wdog *wdt;
-	struct clk *clk;
-	int ret;
-
-	wdt = devm_kzalloc(dev, sizeof(*wdt), GFP_KERNEL);
-	if (!wdt)
-		return -ENOMEM;
-	wdt->base = devm_platform_ioremap_resource(pdev, 0);
-	if (IS_ERR(wdt->base))
-		return PTR_ERR(wdt->base);
-
-	clk = devm_clk_get(dev, NULL);
-	if (IS_ERR(clk))
-		return PTR_ERR(clk);
-	ret = clk_prepare_enable(clk);
-	if (ret) {
-		dev_err(dev, "clk enable failed\n");
-		return ret;
-	}
-	ret = devm_add_action_or_reset(dev, atlas7_clk_disable_unprepare, clk);
-	if (ret)
-		return ret;
-
-	/* disable watchdog hardware */
-	writel(0, wdt->base + ATLAS7_WDT_CNT_CTRL);
-
-	wdt->tick_rate = clk_get_rate(clk);
-	if (!wdt->tick_rate)
-		return -EINVAL;
-
-	wdt->clk = clk;
-	atlas7_wdd.min_timeout = 1;
-	atlas7_wdd.max_timeout = UINT_MAX / wdt->tick_rate;
-
-	watchdog_init_timeout(&atlas7_wdd, 0, dev);
-	watchdog_set_nowayout(&atlas7_wdd, nowayout);
-
-	watchdog_set_drvdata(&atlas7_wdd, wdt);
-	platform_set_drvdata(pdev, &atlas7_wdd);
-
-	watchdog_stop_on_reboot(&atlas7_wdd);
-	watchdog_stop_on_unregister(&atlas7_wdd);
-	return devm_watchdog_register_device(dev, &atlas7_wdd);
-}
-
-static int __maybe_unused atlas7_wdt_suspend(struct device *dev)
-{
-	/*
-	 * NOTE:timer controller registers settings are saved
-	 * and restored back by the timer-atlas7.c
-	 */
-	return 0;
-}
-
-static int __maybe_unused atlas7_wdt_resume(struct device *dev)
-{
-	struct watchdog_device *wdd = dev_get_drvdata(dev);
-
-	/*
-	 * NOTE: Since timer controller registers settings are saved
-	 * and restored back by the timer-atlas7.c, so we need not
-	 * update WD settings except refreshing timeout.
-	 */
-	atlas7_wdt_ping(wdd);
-
-	return 0;
-}
-
-static SIMPLE_DEV_PM_OPS(atlas7_wdt_pm_ops,
-		atlas7_wdt_suspend, atlas7_wdt_resume);
-
-MODULE_DEVICE_TABLE(of, atlas7_wdt_ids);
-
-static struct platform_driver atlas7_wdt_driver = {
-	.driver = {
-		.name = "atlas7-wdt",
-		.pm = &atlas7_wdt_pm_ops,
-		.of_match_table	= atlas7_wdt_ids,
-	},
-	.probe = atlas7_wdt_probe,
-};
-module_platform_driver(atlas7_wdt_driver);
-
-MODULE_DESCRIPTION("CSRatlas7 watchdog driver");
-MODULE_AUTHOR("Guo Zeng <Guo.Zeng@csr.com>");
-MODULE_LICENSE("GPL v2");
-MODULE_ALIAS("platform:atlas7-wdt");
-- 
2.29.2


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [PATCH 3/5] watchdog: remove zte zx driver
  2021-01-20 16:27 ` Arnd Bergmann
@ 2021-01-20 16:27   ` Arnd Bergmann
  -1 siblings, 0 replies; 38+ messages in thread
From: Arnd Bergmann @ 2021-01-20 16:27 UTC (permalink / raw)
  To: linux-arm-kernel, linux-kernel, linux-watchdog, Guenter Roeck
  Cc: Wim Van Sebroeck, Arnd Bergmann, Jun Nie, Shawn Guo

From: Arnd Bergmann <arnd@arndb.de>

The zte zx platform is getting removed, so this driver is no
longer needed.

Cc: Jun Nie <jun.nie@linaro.org>
Cc: Shawn Guo <shawnguo@kernel.org>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 .../bindings/watchdog/zte,zx2967-wdt.txt      |  32 --
 drivers/watchdog/Kconfig                      |  10 -
 drivers/watchdog/Makefile                     |   1 -
 drivers/watchdog/zx2967_wdt.c                 | 279 ------------------
 4 files changed, 322 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/watchdog/zte,zx2967-wdt.txt
 delete mode 100644 drivers/watchdog/zx2967_wdt.c

diff --git a/Documentation/devicetree/bindings/watchdog/zte,zx2967-wdt.txt b/Documentation/devicetree/bindings/watchdog/zte,zx2967-wdt.txt
deleted file mode 100644
index 06ce67766756..000000000000
--- a/Documentation/devicetree/bindings/watchdog/zte,zx2967-wdt.txt
+++ /dev/null
@@ -1,32 +0,0 @@
-ZTE zx2967 Watchdog timer
-
-Required properties:
-
-- compatible : should be one of the following.
-       * zte,zx296718-wdt
-- reg : Specifies base physical address and size of the registers.
-- clocks : Pairs of phandle and specifier referencing the controller's clocks.
-- resets : Reference to the reset controller controlling the watchdog
-           controller.
-
-Optional properties:
-
-- timeout-sec : Contains the watchdog timeout in seconds.
-- zte,wdt-reset-sysctrl : Directs how to reset system by the watchdog.
-	if we don't want to restart system when watchdog been triggered,
-	it's not required, vice versa.
-	It should include following fields.
-	  * phandle of aon-sysctrl.
-	  * offset of register that be written, should be 0xb0.
-	  * configure value that be written to aon-sysctrl.
-	  * bit mask, corresponding bits will be affected.
-
-Example:
-
-wdt: watchdog@1465000 {
-	compatible = "zte,zx296718-wdt";
-	reg = <0x1465000 0x1000>;
-	clocks = <&topcrm WDT_WCLK>;
-	resets = <&toprst 35>;
-	zte,wdt-reset-sysctrl = <&aon_sysctrl 0xb0 1 0x115>;
-};
diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
index 5559e4325f6a..c36f8233f60b 100644
--- a/drivers/watchdog/Kconfig
+++ b/drivers/watchdog/Kconfig
@@ -919,16 +919,6 @@ config ASPEED_WATCHDOG
 	  To compile this driver as a module, choose M here: the
 	  module will be called aspeed_wdt.
 
-config ZX2967_WATCHDOG
-	tristate "ZTE zx2967 SoCs watchdog support"
-	depends on ARCH_ZX
-	select WATCHDOG_CORE
-	help
-	  Say Y here to include support for the watchdog timer
-	  in ZTE zx2967 SoCs.
-	  To compile this driver as a module, choose M here: the
-	  module will be called zx2967_wdt.
-
 config STM32_WATCHDOG
 	tristate "STM32 Independent WatchDoG (IWDG) support"
 	depends on ARCH_STM32
diff --git a/drivers/watchdog/Makefile b/drivers/watchdog/Makefile
index 40b94403c487..7a95b280cd9f 100644
--- a/drivers/watchdog/Makefile
+++ b/drivers/watchdog/Makefile
@@ -86,7 +86,6 @@ obj-$(CONFIG_BCM7038_WDT) += bcm7038_wdt.o
 obj-$(CONFIG_RENESAS_WDT) += renesas_wdt.o
 obj-$(CONFIG_RENESAS_RZAWDT) += rza_wdt.o
 obj-$(CONFIG_ASPEED_WATCHDOG) += aspeed_wdt.o
-obj-$(CONFIG_ZX2967_WATCHDOG) += zx2967_wdt.o
 obj-$(CONFIG_STM32_WATCHDOG) += stm32_iwdg.o
 obj-$(CONFIG_UNIPHIER_WATCHDOG) += uniphier_wdt.o
 obj-$(CONFIG_RTD119X_WATCHDOG) += rtd119x_wdt.o
diff --git a/drivers/watchdog/zx2967_wdt.c b/drivers/watchdog/zx2967_wdt.c
deleted file mode 100644
index bf183e73671a..000000000000
--- a/drivers/watchdog/zx2967_wdt.c
+++ /dev/null
@@ -1,279 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0-only
-/*
- * watchdog driver for ZTE's zx2967 family
- *
- * Copyright (C) 2017 ZTE Ltd.
- *
- * Author: Baoyou Xie <baoyou.xie@linaro.org>
- */
-
-#include <linux/clk.h>
-#include <linux/io.h>
-#include <linux/mfd/syscon.h>
-#include <linux/module.h>
-#include <linux/of_address.h>
-#include <linux/platform_device.h>
-#include <linux/regmap.h>
-#include <linux/reset.h>
-#include <linux/watchdog.h>
-
-#define ZX2967_WDT_CFG_REG			0x4
-#define ZX2967_WDT_LOAD_REG			0x8
-#define ZX2967_WDT_REFRESH_REG			0x18
-#define ZX2967_WDT_START_REG			0x1c
-
-#define ZX2967_WDT_REFRESH_MASK			GENMASK(5, 0)
-
-#define ZX2967_WDT_CFG_DIV(n)			((((n) & 0xff) - 1) << 8)
-#define ZX2967_WDT_START_EN			0x1
-
-/*
- * Hardware magic number.
- * When watchdog reg is written, the lowest 16 bits are valid, but
- * the highest 16 bits should be always this number.
- */
-#define ZX2967_WDT_WRITEKEY			(0x1234 << 16)
-#define ZX2967_WDT_VAL_MASK			GENMASK(15, 0)
-
-#define ZX2967_WDT_DIV_DEFAULT			16
-#define ZX2967_WDT_DEFAULT_TIMEOUT		32
-#define ZX2967_WDT_MIN_TIMEOUT			1
-#define ZX2967_WDT_MAX_TIMEOUT			524
-#define ZX2967_WDT_MAX_COUNT			0xffff
-
-#define ZX2967_WDT_CLK_FREQ			0x8000
-
-#define ZX2967_WDT_FLAG_REBOOT_MON		BIT(0)
-
-struct zx2967_wdt {
-	struct watchdog_device	wdt_device;
-	void __iomem		*reg_base;
-	struct clk		*clock;
-};
-
-static inline u32 zx2967_wdt_readl(struct zx2967_wdt *wdt, u16 reg)
-{
-	return readl_relaxed(wdt->reg_base + reg);
-}
-
-static inline void zx2967_wdt_writel(struct zx2967_wdt *wdt, u16 reg, u32 val)
-{
-	writel_relaxed(val | ZX2967_WDT_WRITEKEY, wdt->reg_base + reg);
-}
-
-static void zx2967_wdt_refresh(struct zx2967_wdt *wdt)
-{
-	u32 val;
-
-	val = zx2967_wdt_readl(wdt, ZX2967_WDT_REFRESH_REG);
-	/*
-	 * Bit 4-5, 1 and 2: refresh config info
-	 * Bit 2-3, 1 and 2: refresh counter
-	 * Bit 0-1, 1 and 2: refresh int-value
-	 * we shift each group value between 1 and 2 to refresh all data.
-	 */
-	val ^= ZX2967_WDT_REFRESH_MASK;
-	zx2967_wdt_writel(wdt, ZX2967_WDT_REFRESH_REG,
-			  val & ZX2967_WDT_VAL_MASK);
-}
-
-static int
-zx2967_wdt_set_timeout(struct watchdog_device *wdd, unsigned int timeout)
-{
-	struct zx2967_wdt *wdt = watchdog_get_drvdata(wdd);
-	unsigned int divisor = ZX2967_WDT_DIV_DEFAULT;
-	u32 count;
-
-	count = timeout * ZX2967_WDT_CLK_FREQ;
-	if (count > divisor * ZX2967_WDT_MAX_COUNT)
-		divisor = DIV_ROUND_UP(count, ZX2967_WDT_MAX_COUNT);
-	count = DIV_ROUND_UP(count, divisor);
-	zx2967_wdt_writel(wdt, ZX2967_WDT_CFG_REG,
-			ZX2967_WDT_CFG_DIV(divisor) & ZX2967_WDT_VAL_MASK);
-	zx2967_wdt_writel(wdt, ZX2967_WDT_LOAD_REG,
-			count & ZX2967_WDT_VAL_MASK);
-	zx2967_wdt_refresh(wdt);
-	wdd->timeout =  (count * divisor) / ZX2967_WDT_CLK_FREQ;
-
-	return 0;
-}
-
-static void __zx2967_wdt_start(struct zx2967_wdt *wdt)
-{
-	u32 val;
-
-	val = zx2967_wdt_readl(wdt, ZX2967_WDT_START_REG);
-	val |= ZX2967_WDT_START_EN;
-	zx2967_wdt_writel(wdt, ZX2967_WDT_START_REG,
-			val & ZX2967_WDT_VAL_MASK);
-}
-
-static void __zx2967_wdt_stop(struct zx2967_wdt *wdt)
-{
-	u32 val;
-
-	val = zx2967_wdt_readl(wdt, ZX2967_WDT_START_REG);
-	val &= ~ZX2967_WDT_START_EN;
-	zx2967_wdt_writel(wdt, ZX2967_WDT_START_REG,
-			val & ZX2967_WDT_VAL_MASK);
-}
-
-static int zx2967_wdt_start(struct watchdog_device *wdd)
-{
-	struct zx2967_wdt *wdt = watchdog_get_drvdata(wdd);
-
-	zx2967_wdt_set_timeout(wdd, wdd->timeout);
-	__zx2967_wdt_start(wdt);
-
-	return 0;
-}
-
-static int zx2967_wdt_stop(struct watchdog_device *wdd)
-{
-	struct zx2967_wdt *wdt = watchdog_get_drvdata(wdd);
-
-	__zx2967_wdt_stop(wdt);
-
-	return 0;
-}
-
-static int zx2967_wdt_keepalive(struct watchdog_device *wdd)
-{
-	struct zx2967_wdt *wdt = watchdog_get_drvdata(wdd);
-
-	zx2967_wdt_refresh(wdt);
-
-	return 0;
-}
-
-#define ZX2967_WDT_OPTIONS \
-	(WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING | WDIOF_MAGICCLOSE)
-static const struct watchdog_info zx2967_wdt_ident = {
-	.options          =     ZX2967_WDT_OPTIONS,
-	.identity         =	"zx2967 watchdog",
-};
-
-static const struct watchdog_ops zx2967_wdt_ops = {
-	.owner = THIS_MODULE,
-	.start = zx2967_wdt_start,
-	.stop = zx2967_wdt_stop,
-	.ping = zx2967_wdt_keepalive,
-	.set_timeout = zx2967_wdt_set_timeout,
-};
-
-static void zx2967_wdt_reset_sysctrl(struct device *dev)
-{
-	int ret;
-	void __iomem *regmap;
-	unsigned int offset, mask, config;
-	struct of_phandle_args out_args;
-
-	ret = of_parse_phandle_with_fixed_args(dev->of_node,
-			"zte,wdt-reset-sysctrl", 3, 0, &out_args);
-	if (ret)
-		return;
-
-	offset = out_args.args[0];
-	config = out_args.args[1];
-	mask = out_args.args[2];
-
-	regmap = syscon_node_to_regmap(out_args.np);
-	if (IS_ERR(regmap)) {
-		of_node_put(out_args.np);
-		return;
-	}
-
-	regmap_update_bits(regmap, offset, mask, config);
-	of_node_put(out_args.np);
-}
-
-static void zx2967_clk_disable_unprepare(void *data)
-{
-	clk_disable_unprepare(data);
-}
-
-static int zx2967_wdt_probe(struct platform_device *pdev)
-{
-	struct device *dev = &pdev->dev;
-	struct zx2967_wdt *wdt;
-	int ret;
-	struct reset_control *rstc;
-
-	wdt = devm_kzalloc(dev, sizeof(*wdt), GFP_KERNEL);
-	if (!wdt)
-		return -ENOMEM;
-
-	platform_set_drvdata(pdev, wdt);
-
-	wdt->wdt_device.info = &zx2967_wdt_ident;
-	wdt->wdt_device.ops = &zx2967_wdt_ops;
-	wdt->wdt_device.timeout = ZX2967_WDT_DEFAULT_TIMEOUT;
-	wdt->wdt_device.max_timeout = ZX2967_WDT_MAX_TIMEOUT;
-	wdt->wdt_device.min_timeout = ZX2967_WDT_MIN_TIMEOUT;
-	wdt->wdt_device.parent = dev;
-
-	wdt->reg_base = devm_platform_ioremap_resource(pdev, 0);
-	if (IS_ERR(wdt->reg_base))
-		return PTR_ERR(wdt->reg_base);
-
-	zx2967_wdt_reset_sysctrl(dev);
-
-	wdt->clock = devm_clk_get(dev, NULL);
-	if (IS_ERR(wdt->clock)) {
-		dev_err(dev, "failed to find watchdog clock source\n");
-		return PTR_ERR(wdt->clock);
-	}
-
-	ret = clk_prepare_enable(wdt->clock);
-	if (ret < 0) {
-		dev_err(dev, "failed to enable clock\n");
-		return ret;
-	}
-	ret = devm_add_action_or_reset(dev, zx2967_clk_disable_unprepare,
-				       wdt->clock);
-	if (ret)
-		return ret;
-	clk_set_rate(wdt->clock, ZX2967_WDT_CLK_FREQ);
-
-	rstc = devm_reset_control_get_exclusive(dev, NULL);
-	if (IS_ERR(rstc)) {
-		dev_err(dev, "failed to get rstc");
-		return PTR_ERR(rstc);
-	}
-
-	reset_control_assert(rstc);
-	reset_control_deassert(rstc);
-
-	watchdog_set_drvdata(&wdt->wdt_device, wdt);
-	watchdog_init_timeout(&wdt->wdt_device,
-			ZX2967_WDT_DEFAULT_TIMEOUT, dev);
-	watchdog_set_nowayout(&wdt->wdt_device, WATCHDOG_NOWAYOUT);
-
-	ret = devm_watchdog_register_device(dev, &wdt->wdt_device);
-	if (ret)
-		return ret;
-
-	dev_info(dev, "watchdog enabled (timeout=%d sec, nowayout=%d)",
-		 wdt->wdt_device.timeout, WATCHDOG_NOWAYOUT);
-
-	return 0;
-}
-
-static const struct of_device_id zx2967_wdt_match[] = {
-	{ .compatible = "zte,zx296718-wdt", },
-	{}
-};
-MODULE_DEVICE_TABLE(of, zx2967_wdt_match);
-
-static struct platform_driver zx2967_wdt_driver = {
-	.probe		= zx2967_wdt_probe,
-	.driver		= {
-		.name	= "zx2967-wdt",
-		.of_match_table	= of_match_ptr(zx2967_wdt_match),
-	},
-};
-module_platform_driver(zx2967_wdt_driver);
-
-MODULE_AUTHOR("Baoyou Xie <baoyou.xie@linaro.org>");
-MODULE_DESCRIPTION("ZTE zx2967 Watchdog Device Driver");
-MODULE_LICENSE("GPL v2");
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [PATCH 3/5] watchdog: remove zte zx driver
@ 2021-01-20 16:27   ` Arnd Bergmann
  0 siblings, 0 replies; 38+ messages in thread
From: Arnd Bergmann @ 2021-01-20 16:27 UTC (permalink / raw)
  To: linux-arm-kernel, linux-kernel, linux-watchdog, Guenter Roeck
  Cc: Jun Nie, Wim Van Sebroeck, Shawn Guo, Arnd Bergmann

From: Arnd Bergmann <arnd@arndb.de>

The zte zx platform is getting removed, so this driver is no
longer needed.

Cc: Jun Nie <jun.nie@linaro.org>
Cc: Shawn Guo <shawnguo@kernel.org>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 .../bindings/watchdog/zte,zx2967-wdt.txt      |  32 --
 drivers/watchdog/Kconfig                      |  10 -
 drivers/watchdog/Makefile                     |   1 -
 drivers/watchdog/zx2967_wdt.c                 | 279 ------------------
 4 files changed, 322 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/watchdog/zte,zx2967-wdt.txt
 delete mode 100644 drivers/watchdog/zx2967_wdt.c

diff --git a/Documentation/devicetree/bindings/watchdog/zte,zx2967-wdt.txt b/Documentation/devicetree/bindings/watchdog/zte,zx2967-wdt.txt
deleted file mode 100644
index 06ce67766756..000000000000
--- a/Documentation/devicetree/bindings/watchdog/zte,zx2967-wdt.txt
+++ /dev/null
@@ -1,32 +0,0 @@
-ZTE zx2967 Watchdog timer
-
-Required properties:
-
-- compatible : should be one of the following.
-       * zte,zx296718-wdt
-- reg : Specifies base physical address and size of the registers.
-- clocks : Pairs of phandle and specifier referencing the controller's clocks.
-- resets : Reference to the reset controller controlling the watchdog
-           controller.
-
-Optional properties:
-
-- timeout-sec : Contains the watchdog timeout in seconds.
-- zte,wdt-reset-sysctrl : Directs how to reset system by the watchdog.
-	if we don't want to restart system when watchdog been triggered,
-	it's not required, vice versa.
-	It should include following fields.
-	  * phandle of aon-sysctrl.
-	  * offset of register that be written, should be 0xb0.
-	  * configure value that be written to aon-sysctrl.
-	  * bit mask, corresponding bits will be affected.
-
-Example:
-
-wdt: watchdog@1465000 {
-	compatible = "zte,zx296718-wdt";
-	reg = <0x1465000 0x1000>;
-	clocks = <&topcrm WDT_WCLK>;
-	resets = <&toprst 35>;
-	zte,wdt-reset-sysctrl = <&aon_sysctrl 0xb0 1 0x115>;
-};
diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
index 5559e4325f6a..c36f8233f60b 100644
--- a/drivers/watchdog/Kconfig
+++ b/drivers/watchdog/Kconfig
@@ -919,16 +919,6 @@ config ASPEED_WATCHDOG
 	  To compile this driver as a module, choose M here: the
 	  module will be called aspeed_wdt.
 
-config ZX2967_WATCHDOG
-	tristate "ZTE zx2967 SoCs watchdog support"
-	depends on ARCH_ZX
-	select WATCHDOG_CORE
-	help
-	  Say Y here to include support for the watchdog timer
-	  in ZTE zx2967 SoCs.
-	  To compile this driver as a module, choose M here: the
-	  module will be called zx2967_wdt.
-
 config STM32_WATCHDOG
 	tristate "STM32 Independent WatchDoG (IWDG) support"
 	depends on ARCH_STM32
diff --git a/drivers/watchdog/Makefile b/drivers/watchdog/Makefile
index 40b94403c487..7a95b280cd9f 100644
--- a/drivers/watchdog/Makefile
+++ b/drivers/watchdog/Makefile
@@ -86,7 +86,6 @@ obj-$(CONFIG_BCM7038_WDT) += bcm7038_wdt.o
 obj-$(CONFIG_RENESAS_WDT) += renesas_wdt.o
 obj-$(CONFIG_RENESAS_RZAWDT) += rza_wdt.o
 obj-$(CONFIG_ASPEED_WATCHDOG) += aspeed_wdt.o
-obj-$(CONFIG_ZX2967_WATCHDOG) += zx2967_wdt.o
 obj-$(CONFIG_STM32_WATCHDOG) += stm32_iwdg.o
 obj-$(CONFIG_UNIPHIER_WATCHDOG) += uniphier_wdt.o
 obj-$(CONFIG_RTD119X_WATCHDOG) += rtd119x_wdt.o
diff --git a/drivers/watchdog/zx2967_wdt.c b/drivers/watchdog/zx2967_wdt.c
deleted file mode 100644
index bf183e73671a..000000000000
--- a/drivers/watchdog/zx2967_wdt.c
+++ /dev/null
@@ -1,279 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0-only
-/*
- * watchdog driver for ZTE's zx2967 family
- *
- * Copyright (C) 2017 ZTE Ltd.
- *
- * Author: Baoyou Xie <baoyou.xie@linaro.org>
- */
-
-#include <linux/clk.h>
-#include <linux/io.h>
-#include <linux/mfd/syscon.h>
-#include <linux/module.h>
-#include <linux/of_address.h>
-#include <linux/platform_device.h>
-#include <linux/regmap.h>
-#include <linux/reset.h>
-#include <linux/watchdog.h>
-
-#define ZX2967_WDT_CFG_REG			0x4
-#define ZX2967_WDT_LOAD_REG			0x8
-#define ZX2967_WDT_REFRESH_REG			0x18
-#define ZX2967_WDT_START_REG			0x1c
-
-#define ZX2967_WDT_REFRESH_MASK			GENMASK(5, 0)
-
-#define ZX2967_WDT_CFG_DIV(n)			((((n) & 0xff) - 1) << 8)
-#define ZX2967_WDT_START_EN			0x1
-
-/*
- * Hardware magic number.
- * When watchdog reg is written, the lowest 16 bits are valid, but
- * the highest 16 bits should be always this number.
- */
-#define ZX2967_WDT_WRITEKEY			(0x1234 << 16)
-#define ZX2967_WDT_VAL_MASK			GENMASK(15, 0)
-
-#define ZX2967_WDT_DIV_DEFAULT			16
-#define ZX2967_WDT_DEFAULT_TIMEOUT		32
-#define ZX2967_WDT_MIN_TIMEOUT			1
-#define ZX2967_WDT_MAX_TIMEOUT			524
-#define ZX2967_WDT_MAX_COUNT			0xffff
-
-#define ZX2967_WDT_CLK_FREQ			0x8000
-
-#define ZX2967_WDT_FLAG_REBOOT_MON		BIT(0)
-
-struct zx2967_wdt {
-	struct watchdog_device	wdt_device;
-	void __iomem		*reg_base;
-	struct clk		*clock;
-};
-
-static inline u32 zx2967_wdt_readl(struct zx2967_wdt *wdt, u16 reg)
-{
-	return readl_relaxed(wdt->reg_base + reg);
-}
-
-static inline void zx2967_wdt_writel(struct zx2967_wdt *wdt, u16 reg, u32 val)
-{
-	writel_relaxed(val | ZX2967_WDT_WRITEKEY, wdt->reg_base + reg);
-}
-
-static void zx2967_wdt_refresh(struct zx2967_wdt *wdt)
-{
-	u32 val;
-
-	val = zx2967_wdt_readl(wdt, ZX2967_WDT_REFRESH_REG);
-	/*
-	 * Bit 4-5, 1 and 2: refresh config info
-	 * Bit 2-3, 1 and 2: refresh counter
-	 * Bit 0-1, 1 and 2: refresh int-value
-	 * we shift each group value between 1 and 2 to refresh all data.
-	 */
-	val ^= ZX2967_WDT_REFRESH_MASK;
-	zx2967_wdt_writel(wdt, ZX2967_WDT_REFRESH_REG,
-			  val & ZX2967_WDT_VAL_MASK);
-}
-
-static int
-zx2967_wdt_set_timeout(struct watchdog_device *wdd, unsigned int timeout)
-{
-	struct zx2967_wdt *wdt = watchdog_get_drvdata(wdd);
-	unsigned int divisor = ZX2967_WDT_DIV_DEFAULT;
-	u32 count;
-
-	count = timeout * ZX2967_WDT_CLK_FREQ;
-	if (count > divisor * ZX2967_WDT_MAX_COUNT)
-		divisor = DIV_ROUND_UP(count, ZX2967_WDT_MAX_COUNT);
-	count = DIV_ROUND_UP(count, divisor);
-	zx2967_wdt_writel(wdt, ZX2967_WDT_CFG_REG,
-			ZX2967_WDT_CFG_DIV(divisor) & ZX2967_WDT_VAL_MASK);
-	zx2967_wdt_writel(wdt, ZX2967_WDT_LOAD_REG,
-			count & ZX2967_WDT_VAL_MASK);
-	zx2967_wdt_refresh(wdt);
-	wdd->timeout =  (count * divisor) / ZX2967_WDT_CLK_FREQ;
-
-	return 0;
-}
-
-static void __zx2967_wdt_start(struct zx2967_wdt *wdt)
-{
-	u32 val;
-
-	val = zx2967_wdt_readl(wdt, ZX2967_WDT_START_REG);
-	val |= ZX2967_WDT_START_EN;
-	zx2967_wdt_writel(wdt, ZX2967_WDT_START_REG,
-			val & ZX2967_WDT_VAL_MASK);
-}
-
-static void __zx2967_wdt_stop(struct zx2967_wdt *wdt)
-{
-	u32 val;
-
-	val = zx2967_wdt_readl(wdt, ZX2967_WDT_START_REG);
-	val &= ~ZX2967_WDT_START_EN;
-	zx2967_wdt_writel(wdt, ZX2967_WDT_START_REG,
-			val & ZX2967_WDT_VAL_MASK);
-}
-
-static int zx2967_wdt_start(struct watchdog_device *wdd)
-{
-	struct zx2967_wdt *wdt = watchdog_get_drvdata(wdd);
-
-	zx2967_wdt_set_timeout(wdd, wdd->timeout);
-	__zx2967_wdt_start(wdt);
-
-	return 0;
-}
-
-static int zx2967_wdt_stop(struct watchdog_device *wdd)
-{
-	struct zx2967_wdt *wdt = watchdog_get_drvdata(wdd);
-
-	__zx2967_wdt_stop(wdt);
-
-	return 0;
-}
-
-static int zx2967_wdt_keepalive(struct watchdog_device *wdd)
-{
-	struct zx2967_wdt *wdt = watchdog_get_drvdata(wdd);
-
-	zx2967_wdt_refresh(wdt);
-
-	return 0;
-}
-
-#define ZX2967_WDT_OPTIONS \
-	(WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING | WDIOF_MAGICCLOSE)
-static const struct watchdog_info zx2967_wdt_ident = {
-	.options          =     ZX2967_WDT_OPTIONS,
-	.identity         =	"zx2967 watchdog",
-};
-
-static const struct watchdog_ops zx2967_wdt_ops = {
-	.owner = THIS_MODULE,
-	.start = zx2967_wdt_start,
-	.stop = zx2967_wdt_stop,
-	.ping = zx2967_wdt_keepalive,
-	.set_timeout = zx2967_wdt_set_timeout,
-};
-
-static void zx2967_wdt_reset_sysctrl(struct device *dev)
-{
-	int ret;
-	void __iomem *regmap;
-	unsigned int offset, mask, config;
-	struct of_phandle_args out_args;
-
-	ret = of_parse_phandle_with_fixed_args(dev->of_node,
-			"zte,wdt-reset-sysctrl", 3, 0, &out_args);
-	if (ret)
-		return;
-
-	offset = out_args.args[0];
-	config = out_args.args[1];
-	mask = out_args.args[2];
-
-	regmap = syscon_node_to_regmap(out_args.np);
-	if (IS_ERR(regmap)) {
-		of_node_put(out_args.np);
-		return;
-	}
-
-	regmap_update_bits(regmap, offset, mask, config);
-	of_node_put(out_args.np);
-}
-
-static void zx2967_clk_disable_unprepare(void *data)
-{
-	clk_disable_unprepare(data);
-}
-
-static int zx2967_wdt_probe(struct platform_device *pdev)
-{
-	struct device *dev = &pdev->dev;
-	struct zx2967_wdt *wdt;
-	int ret;
-	struct reset_control *rstc;
-
-	wdt = devm_kzalloc(dev, sizeof(*wdt), GFP_KERNEL);
-	if (!wdt)
-		return -ENOMEM;
-
-	platform_set_drvdata(pdev, wdt);
-
-	wdt->wdt_device.info = &zx2967_wdt_ident;
-	wdt->wdt_device.ops = &zx2967_wdt_ops;
-	wdt->wdt_device.timeout = ZX2967_WDT_DEFAULT_TIMEOUT;
-	wdt->wdt_device.max_timeout = ZX2967_WDT_MAX_TIMEOUT;
-	wdt->wdt_device.min_timeout = ZX2967_WDT_MIN_TIMEOUT;
-	wdt->wdt_device.parent = dev;
-
-	wdt->reg_base = devm_platform_ioremap_resource(pdev, 0);
-	if (IS_ERR(wdt->reg_base))
-		return PTR_ERR(wdt->reg_base);
-
-	zx2967_wdt_reset_sysctrl(dev);
-
-	wdt->clock = devm_clk_get(dev, NULL);
-	if (IS_ERR(wdt->clock)) {
-		dev_err(dev, "failed to find watchdog clock source\n");
-		return PTR_ERR(wdt->clock);
-	}
-
-	ret = clk_prepare_enable(wdt->clock);
-	if (ret < 0) {
-		dev_err(dev, "failed to enable clock\n");
-		return ret;
-	}
-	ret = devm_add_action_or_reset(dev, zx2967_clk_disable_unprepare,
-				       wdt->clock);
-	if (ret)
-		return ret;
-	clk_set_rate(wdt->clock, ZX2967_WDT_CLK_FREQ);
-
-	rstc = devm_reset_control_get_exclusive(dev, NULL);
-	if (IS_ERR(rstc)) {
-		dev_err(dev, "failed to get rstc");
-		return PTR_ERR(rstc);
-	}
-
-	reset_control_assert(rstc);
-	reset_control_deassert(rstc);
-
-	watchdog_set_drvdata(&wdt->wdt_device, wdt);
-	watchdog_init_timeout(&wdt->wdt_device,
-			ZX2967_WDT_DEFAULT_TIMEOUT, dev);
-	watchdog_set_nowayout(&wdt->wdt_device, WATCHDOG_NOWAYOUT);
-
-	ret = devm_watchdog_register_device(dev, &wdt->wdt_device);
-	if (ret)
-		return ret;
-
-	dev_info(dev, "watchdog enabled (timeout=%d sec, nowayout=%d)",
-		 wdt->wdt_device.timeout, WATCHDOG_NOWAYOUT);
-
-	return 0;
-}
-
-static const struct of_device_id zx2967_wdt_match[] = {
-	{ .compatible = "zte,zx296718-wdt", },
-	{}
-};
-MODULE_DEVICE_TABLE(of, zx2967_wdt_match);
-
-static struct platform_driver zx2967_wdt_driver = {
-	.probe		= zx2967_wdt_probe,
-	.driver		= {
-		.name	= "zx2967-wdt",
-		.of_match_table	= of_match_ptr(zx2967_wdt_match),
-	},
-};
-module_platform_driver(zx2967_wdt_driver);
-
-MODULE_AUTHOR("Baoyou Xie <baoyou.xie@linaro.org>");
-MODULE_DESCRIPTION("ZTE zx2967 Watchdog Device Driver");
-MODULE_LICENSE("GPL v2");
-- 
2.29.2


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [PATCH 4/5] watchdog: remove tango driver
  2021-01-20 16:27 ` Arnd Bergmann
@ 2021-01-20 16:27   ` Arnd Bergmann
  -1 siblings, 0 replies; 38+ messages in thread
From: Arnd Bergmann @ 2021-01-20 16:27 UTC (permalink / raw)
  To: linux-arm-kernel, linux-kernel, linux-watchdog, Guenter Roeck
  Cc: Wim Van Sebroeck, Arnd Bergmann, Marc Gonzalez, Mans Rullgard

From: Arnd Bergmann <arnd@arndb.de>

The tango platform is getting removed, so the driver is no
longer needed.

Cc: Marc Gonzalez <marc.w.gonzalez@free.fr>
Cc: Mans Rullgard <mans@mansr.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/watchdog/Kconfig      |  11 --
 drivers/watchdog/Makefile     |   1 -
 drivers/watchdog/tangox_wdt.c | 209 ----------------------------------
 3 files changed, 221 deletions(-)
 delete mode 100644 drivers/watchdog/tangox_wdt.c

diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
index c36f8233f60b..10efbb351f14 100644
--- a/drivers/watchdog/Kconfig
+++ b/drivers/watchdog/Kconfig
@@ -254,17 +254,6 @@ config MENZ069_WATCHDOG
 	  This driver can also be built as a module. If so the module
 	  will be called menz069_wdt.
 
-config TANGOX_WATCHDOG
-	tristate "Sigma Designs SMP86xx/SMP87xx watchdog"
-	select WATCHDOG_CORE
-	depends on ARCH_TANGO || COMPILE_TEST
-	depends on HAS_IOMEM
-	help
-	  Support for the watchdog in Sigma Designs SMP86xx (tango3)
-	  and SMP87xx (tango4) family chips.
-
-	  This driver can be built as a module. The module name is tangox_wdt.
-
 config WDAT_WDT
 	tristate "ACPI Watchdog Action Table (WDAT)"
 	depends on ACPI
diff --git a/drivers/watchdog/Makefile b/drivers/watchdog/Makefile
index 7a95b280cd9f..1ff40d6a027f 100644
--- a/drivers/watchdog/Makefile
+++ b/drivers/watchdog/Makefile
@@ -210,7 +210,6 @@ obj-$(CONFIG_DA9055_WATCHDOG) += da9055_wdt.o
 obj-$(CONFIG_DA9062_WATCHDOG) += da9062_wdt.o
 obj-$(CONFIG_DA9063_WATCHDOG) += da9063_wdt.o
 obj-$(CONFIG_GPIO_WATCHDOG)	+= gpio_wdt.o
-obj-$(CONFIG_TANGOX_WATCHDOG) += tangox_wdt.o
 obj-$(CONFIG_WDAT_WDT) += wdat_wdt.o
 obj-$(CONFIG_WM831X_WATCHDOG) += wm831x_wdt.o
 obj-$(CONFIG_WM8350_WATCHDOG) += wm8350_wdt.o
diff --git a/drivers/watchdog/tangox_wdt.c b/drivers/watchdog/tangox_wdt.c
deleted file mode 100644
index 1afb0e9d808c..000000000000
--- a/drivers/watchdog/tangox_wdt.c
+++ /dev/null
@@ -1,209 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0+
-/*
- *  Copyright (C) 2015 Mans Rullgard <mans@mansr.com>
- *  SMP86xx/SMP87xx Watchdog driver
- */
-
-#include <linux/bitops.h>
-#include <linux/clk.h>
-#include <linux/delay.h>
-#include <linux/io.h>
-#include <linux/kernel.h>
-#include <linux/module.h>
-#include <linux/moduleparam.h>
-#include <linux/mod_devicetable.h>
-#include <linux/platform_device.h>
-#include <linux/watchdog.h>
-
-#define DEFAULT_TIMEOUT 30
-
-static bool nowayout = WATCHDOG_NOWAYOUT;
-module_param(nowayout, bool, 0);
-MODULE_PARM_DESC(nowayout,
-		 "Watchdog cannot be stopped once started (default="
-		 __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
-
-static unsigned int timeout;
-module_param(timeout, int, 0);
-MODULE_PARM_DESC(timeout, "Watchdog timeout");
-
-/*
- * Counter counts down from programmed value.  Reset asserts when
- * the counter reaches 1.
- */
-#define WD_COUNTER		0
-
-#define WD_CONFIG		4
-#define WD_CONFIG_XTAL_IN	BIT(0)
-#define WD_CONFIG_DISABLE	BIT(31)
-
-struct tangox_wdt_device {
-	struct watchdog_device wdt;
-	void __iomem *base;
-	unsigned long clk_rate;
-	struct clk *clk;
-};
-
-static int tangox_wdt_set_timeout(struct watchdog_device *wdt,
-				  unsigned int new_timeout)
-{
-	wdt->timeout = new_timeout;
-
-	return 0;
-}
-
-static int tangox_wdt_start(struct watchdog_device *wdt)
-{
-	struct tangox_wdt_device *dev = watchdog_get_drvdata(wdt);
-	u32 ticks;
-
-	ticks = 1 + wdt->timeout * dev->clk_rate;
-	writel(ticks, dev->base + WD_COUNTER);
-
-	return 0;
-}
-
-static int tangox_wdt_stop(struct watchdog_device *wdt)
-{
-	struct tangox_wdt_device *dev = watchdog_get_drvdata(wdt);
-
-	writel(0, dev->base + WD_COUNTER);
-
-	return 0;
-}
-
-static unsigned int tangox_wdt_get_timeleft(struct watchdog_device *wdt)
-{
-	struct tangox_wdt_device *dev = watchdog_get_drvdata(wdt);
-	u32 count;
-
-	count = readl(dev->base + WD_COUNTER);
-
-	if (!count)
-		return 0;
-
-	return (count - 1) / dev->clk_rate;
-}
-
-static const struct watchdog_info tangox_wdt_info = {
-	.options  = WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING | WDIOF_MAGICCLOSE,
-	.identity = "tangox watchdog",
-};
-
-static int tangox_wdt_restart(struct watchdog_device *wdt,
-			      unsigned long action, void *data)
-{
-	struct tangox_wdt_device *dev = watchdog_get_drvdata(wdt);
-
-	writel(1, dev->base + WD_COUNTER);
-
-	return 0;
-}
-
-static const struct watchdog_ops tangox_wdt_ops = {
-	.start		= tangox_wdt_start,
-	.stop		= tangox_wdt_stop,
-	.set_timeout	= tangox_wdt_set_timeout,
-	.get_timeleft	= tangox_wdt_get_timeleft,
-	.restart	= tangox_wdt_restart,
-};
-
-static void tangox_clk_disable_unprepare(void *data)
-{
-	clk_disable_unprepare(data);
-}
-
-static int tangox_wdt_probe(struct platform_device *pdev)
-{
-	struct tangox_wdt_device *dev;
-	u32 config;
-	int err;
-
-	dev = devm_kzalloc(&pdev->dev, sizeof(*dev), GFP_KERNEL);
-	if (!dev)
-		return -ENOMEM;
-
-	dev->base = devm_platform_ioremap_resource(pdev, 0);
-	if (IS_ERR(dev->base))
-		return PTR_ERR(dev->base);
-
-	dev->clk = devm_clk_get(&pdev->dev, NULL);
-	if (IS_ERR(dev->clk))
-		return PTR_ERR(dev->clk);
-
-	err = clk_prepare_enable(dev->clk);
-	if (err)
-		return err;
-	err = devm_add_action_or_reset(&pdev->dev,
-				       tangox_clk_disable_unprepare, dev->clk);
-	if (err)
-		return err;
-
-	dev->clk_rate = clk_get_rate(dev->clk);
-	if (!dev->clk_rate)
-		return -EINVAL;
-
-	dev->wdt.parent = &pdev->dev;
-	dev->wdt.info = &tangox_wdt_info;
-	dev->wdt.ops = &tangox_wdt_ops;
-	dev->wdt.timeout = DEFAULT_TIMEOUT;
-	dev->wdt.min_timeout = 1;
-	dev->wdt.max_hw_heartbeat_ms = (U32_MAX - 1) / dev->clk_rate;
-
-	watchdog_init_timeout(&dev->wdt, timeout, &pdev->dev);
-	watchdog_set_nowayout(&dev->wdt, nowayout);
-	watchdog_set_drvdata(&dev->wdt, dev);
-
-	/*
-	 * Deactivate counter if disable bit is set to avoid
-	 * accidental reset.
-	 */
-	config = readl(dev->base + WD_CONFIG);
-	if (config & WD_CONFIG_DISABLE)
-		writel(0, dev->base + WD_COUNTER);
-
-	writel(WD_CONFIG_XTAL_IN, dev->base + WD_CONFIG);
-
-	/*
-	 * Mark as active and restart with configured timeout if
-	 * already running.
-	 */
-	if (readl(dev->base + WD_COUNTER)) {
-		set_bit(WDOG_HW_RUNNING, &dev->wdt.status);
-		tangox_wdt_start(&dev->wdt);
-	}
-
-	watchdog_set_restart_priority(&dev->wdt, 128);
-
-	watchdog_stop_on_unregister(&dev->wdt);
-	err = devm_watchdog_register_device(&pdev->dev, &dev->wdt);
-	if (err)
-		return err;
-
-	platform_set_drvdata(pdev, dev);
-
-	dev_info(&pdev->dev, "SMP86xx/SMP87xx watchdog registered\n");
-
-	return 0;
-}
-
-static const struct of_device_id tangox_wdt_dt_ids[] = {
-	{ .compatible = "sigma,smp8642-wdt" },
-	{ .compatible = "sigma,smp8759-wdt" },
-	{ }
-};
-MODULE_DEVICE_TABLE(of, tangox_wdt_dt_ids);
-
-static struct platform_driver tangox_wdt_driver = {
-	.probe	= tangox_wdt_probe,
-	.driver	= {
-		.name		= "tangox-wdt",
-		.of_match_table	= tangox_wdt_dt_ids,
-	},
-};
-
-module_platform_driver(tangox_wdt_driver);
-
-MODULE_AUTHOR("Mans Rullgard <mans@mansr.com>");
-MODULE_DESCRIPTION("SMP86xx/SMP87xx Watchdog driver");
-MODULE_LICENSE("GPL");
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [PATCH 4/5] watchdog: remove tango driver
@ 2021-01-20 16:27   ` Arnd Bergmann
  0 siblings, 0 replies; 38+ messages in thread
From: Arnd Bergmann @ 2021-01-20 16:27 UTC (permalink / raw)
  To: linux-arm-kernel, linux-kernel, linux-watchdog, Guenter Roeck
  Cc: Wim Van Sebroeck, Mans Rullgard, Arnd Bergmann, Marc Gonzalez

From: Arnd Bergmann <arnd@arndb.de>

The tango platform is getting removed, so the driver is no
longer needed.

Cc: Marc Gonzalez <marc.w.gonzalez@free.fr>
Cc: Mans Rullgard <mans@mansr.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/watchdog/Kconfig      |  11 --
 drivers/watchdog/Makefile     |   1 -
 drivers/watchdog/tangox_wdt.c | 209 ----------------------------------
 3 files changed, 221 deletions(-)
 delete mode 100644 drivers/watchdog/tangox_wdt.c

diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
index c36f8233f60b..10efbb351f14 100644
--- a/drivers/watchdog/Kconfig
+++ b/drivers/watchdog/Kconfig
@@ -254,17 +254,6 @@ config MENZ069_WATCHDOG
 	  This driver can also be built as a module. If so the module
 	  will be called menz069_wdt.
 
-config TANGOX_WATCHDOG
-	tristate "Sigma Designs SMP86xx/SMP87xx watchdog"
-	select WATCHDOG_CORE
-	depends on ARCH_TANGO || COMPILE_TEST
-	depends on HAS_IOMEM
-	help
-	  Support for the watchdog in Sigma Designs SMP86xx (tango3)
-	  and SMP87xx (tango4) family chips.
-
-	  This driver can be built as a module. The module name is tangox_wdt.
-
 config WDAT_WDT
 	tristate "ACPI Watchdog Action Table (WDAT)"
 	depends on ACPI
diff --git a/drivers/watchdog/Makefile b/drivers/watchdog/Makefile
index 7a95b280cd9f..1ff40d6a027f 100644
--- a/drivers/watchdog/Makefile
+++ b/drivers/watchdog/Makefile
@@ -210,7 +210,6 @@ obj-$(CONFIG_DA9055_WATCHDOG) += da9055_wdt.o
 obj-$(CONFIG_DA9062_WATCHDOG) += da9062_wdt.o
 obj-$(CONFIG_DA9063_WATCHDOG) += da9063_wdt.o
 obj-$(CONFIG_GPIO_WATCHDOG)	+= gpio_wdt.o
-obj-$(CONFIG_TANGOX_WATCHDOG) += tangox_wdt.o
 obj-$(CONFIG_WDAT_WDT) += wdat_wdt.o
 obj-$(CONFIG_WM831X_WATCHDOG) += wm831x_wdt.o
 obj-$(CONFIG_WM8350_WATCHDOG) += wm8350_wdt.o
diff --git a/drivers/watchdog/tangox_wdt.c b/drivers/watchdog/tangox_wdt.c
deleted file mode 100644
index 1afb0e9d808c..000000000000
--- a/drivers/watchdog/tangox_wdt.c
+++ /dev/null
@@ -1,209 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0+
-/*
- *  Copyright (C) 2015 Mans Rullgard <mans@mansr.com>
- *  SMP86xx/SMP87xx Watchdog driver
- */
-
-#include <linux/bitops.h>
-#include <linux/clk.h>
-#include <linux/delay.h>
-#include <linux/io.h>
-#include <linux/kernel.h>
-#include <linux/module.h>
-#include <linux/moduleparam.h>
-#include <linux/mod_devicetable.h>
-#include <linux/platform_device.h>
-#include <linux/watchdog.h>
-
-#define DEFAULT_TIMEOUT 30
-
-static bool nowayout = WATCHDOG_NOWAYOUT;
-module_param(nowayout, bool, 0);
-MODULE_PARM_DESC(nowayout,
-		 "Watchdog cannot be stopped once started (default="
-		 __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
-
-static unsigned int timeout;
-module_param(timeout, int, 0);
-MODULE_PARM_DESC(timeout, "Watchdog timeout");
-
-/*
- * Counter counts down from programmed value.  Reset asserts when
- * the counter reaches 1.
- */
-#define WD_COUNTER		0
-
-#define WD_CONFIG		4
-#define WD_CONFIG_XTAL_IN	BIT(0)
-#define WD_CONFIG_DISABLE	BIT(31)
-
-struct tangox_wdt_device {
-	struct watchdog_device wdt;
-	void __iomem *base;
-	unsigned long clk_rate;
-	struct clk *clk;
-};
-
-static int tangox_wdt_set_timeout(struct watchdog_device *wdt,
-				  unsigned int new_timeout)
-{
-	wdt->timeout = new_timeout;
-
-	return 0;
-}
-
-static int tangox_wdt_start(struct watchdog_device *wdt)
-{
-	struct tangox_wdt_device *dev = watchdog_get_drvdata(wdt);
-	u32 ticks;
-
-	ticks = 1 + wdt->timeout * dev->clk_rate;
-	writel(ticks, dev->base + WD_COUNTER);
-
-	return 0;
-}
-
-static int tangox_wdt_stop(struct watchdog_device *wdt)
-{
-	struct tangox_wdt_device *dev = watchdog_get_drvdata(wdt);
-
-	writel(0, dev->base + WD_COUNTER);
-
-	return 0;
-}
-
-static unsigned int tangox_wdt_get_timeleft(struct watchdog_device *wdt)
-{
-	struct tangox_wdt_device *dev = watchdog_get_drvdata(wdt);
-	u32 count;
-
-	count = readl(dev->base + WD_COUNTER);
-
-	if (!count)
-		return 0;
-
-	return (count - 1) / dev->clk_rate;
-}
-
-static const struct watchdog_info tangox_wdt_info = {
-	.options  = WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING | WDIOF_MAGICCLOSE,
-	.identity = "tangox watchdog",
-};
-
-static int tangox_wdt_restart(struct watchdog_device *wdt,
-			      unsigned long action, void *data)
-{
-	struct tangox_wdt_device *dev = watchdog_get_drvdata(wdt);
-
-	writel(1, dev->base + WD_COUNTER);
-
-	return 0;
-}
-
-static const struct watchdog_ops tangox_wdt_ops = {
-	.start		= tangox_wdt_start,
-	.stop		= tangox_wdt_stop,
-	.set_timeout	= tangox_wdt_set_timeout,
-	.get_timeleft	= tangox_wdt_get_timeleft,
-	.restart	= tangox_wdt_restart,
-};
-
-static void tangox_clk_disable_unprepare(void *data)
-{
-	clk_disable_unprepare(data);
-}
-
-static int tangox_wdt_probe(struct platform_device *pdev)
-{
-	struct tangox_wdt_device *dev;
-	u32 config;
-	int err;
-
-	dev = devm_kzalloc(&pdev->dev, sizeof(*dev), GFP_KERNEL);
-	if (!dev)
-		return -ENOMEM;
-
-	dev->base = devm_platform_ioremap_resource(pdev, 0);
-	if (IS_ERR(dev->base))
-		return PTR_ERR(dev->base);
-
-	dev->clk = devm_clk_get(&pdev->dev, NULL);
-	if (IS_ERR(dev->clk))
-		return PTR_ERR(dev->clk);
-
-	err = clk_prepare_enable(dev->clk);
-	if (err)
-		return err;
-	err = devm_add_action_or_reset(&pdev->dev,
-				       tangox_clk_disable_unprepare, dev->clk);
-	if (err)
-		return err;
-
-	dev->clk_rate = clk_get_rate(dev->clk);
-	if (!dev->clk_rate)
-		return -EINVAL;
-
-	dev->wdt.parent = &pdev->dev;
-	dev->wdt.info = &tangox_wdt_info;
-	dev->wdt.ops = &tangox_wdt_ops;
-	dev->wdt.timeout = DEFAULT_TIMEOUT;
-	dev->wdt.min_timeout = 1;
-	dev->wdt.max_hw_heartbeat_ms = (U32_MAX - 1) / dev->clk_rate;
-
-	watchdog_init_timeout(&dev->wdt, timeout, &pdev->dev);
-	watchdog_set_nowayout(&dev->wdt, nowayout);
-	watchdog_set_drvdata(&dev->wdt, dev);
-
-	/*
-	 * Deactivate counter if disable bit is set to avoid
-	 * accidental reset.
-	 */
-	config = readl(dev->base + WD_CONFIG);
-	if (config & WD_CONFIG_DISABLE)
-		writel(0, dev->base + WD_COUNTER);
-
-	writel(WD_CONFIG_XTAL_IN, dev->base + WD_CONFIG);
-
-	/*
-	 * Mark as active and restart with configured timeout if
-	 * already running.
-	 */
-	if (readl(dev->base + WD_COUNTER)) {
-		set_bit(WDOG_HW_RUNNING, &dev->wdt.status);
-		tangox_wdt_start(&dev->wdt);
-	}
-
-	watchdog_set_restart_priority(&dev->wdt, 128);
-
-	watchdog_stop_on_unregister(&dev->wdt);
-	err = devm_watchdog_register_device(&pdev->dev, &dev->wdt);
-	if (err)
-		return err;
-
-	platform_set_drvdata(pdev, dev);
-
-	dev_info(&pdev->dev, "SMP86xx/SMP87xx watchdog registered\n");
-
-	return 0;
-}
-
-static const struct of_device_id tangox_wdt_dt_ids[] = {
-	{ .compatible = "sigma,smp8642-wdt" },
-	{ .compatible = "sigma,smp8759-wdt" },
-	{ }
-};
-MODULE_DEVICE_TABLE(of, tangox_wdt_dt_ids);
-
-static struct platform_driver tangox_wdt_driver = {
-	.probe	= tangox_wdt_probe,
-	.driver	= {
-		.name		= "tangox-wdt",
-		.of_match_table	= tangox_wdt_dt_ids,
-	},
-};
-
-module_platform_driver(tangox_wdt_driver);
-
-MODULE_AUTHOR("Mans Rullgard <mans@mansr.com>");
-MODULE_DESCRIPTION("SMP86xx/SMP87xx Watchdog driver");
-MODULE_LICENSE("GPL");
-- 
2.29.2


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [PATCH 5/5] watchdog: remove coh901 driver
  2021-01-20 16:27 ` Arnd Bergmann
@ 2021-01-20 16:27   ` Arnd Bergmann
  -1 siblings, 0 replies; 38+ messages in thread
From: Arnd Bergmann @ 2021-01-20 16:27 UTC (permalink / raw)
  To: linux-arm-kernel, linux-kernel, linux-watchdog, Guenter Roeck
  Cc: Wim Van Sebroeck, Arnd Bergmann, Linus Walleij

From: Arnd Bergmann <arnd@arndb.de>

The ST-Ericsson U300 platform is getting removed, so this driver is no
longer needed.

Cc: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 .../watchdog/stericsson-coh901327.txt         |  19 -
 drivers/watchdog/Kconfig                      |  11 -
 drivers/watchdog/Makefile                     |   1 -
 drivers/watchdog/coh901327_wdt.c              | 408 ------------------
 4 files changed, 439 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/watchdog/stericsson-coh901327.txt
 delete mode 100644 drivers/watchdog/coh901327_wdt.c

diff --git a/Documentation/devicetree/bindings/watchdog/stericsson-coh901327.txt b/Documentation/devicetree/bindings/watchdog/stericsson-coh901327.txt
deleted file mode 100644
index 8ffb88e39e76..000000000000
--- a/Documentation/devicetree/bindings/watchdog/stericsson-coh901327.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-ST-Ericsson COH 901 327 Watchdog timer
-
-Required properties:
-- compatible: must be "stericsson,coh901327".
-- reg: physical base address of the controller and length of memory mapped
-  region.
-- interrupts: the interrupt used for the watchdog timeout warning.
-
-Optional properties:
-- timeout-sec: contains the watchdog timeout in seconds.
-
-Example:
-
-watchdog: watchdog@c0012000 {
-	compatible = "stericsson,coh901327";
-	reg = <0xc0012000 0x1000>;
-	interrupts = <3>;
-	timeout-sec = <60>;
-};
diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
index 10efbb351f14..3b73735b0c8b 100644
--- a/drivers/watchdog/Kconfig
+++ b/drivers/watchdog/Kconfig
@@ -619,17 +619,6 @@ config SUNXI_WATCHDOG
 	  To compile this driver as a module, choose M here: the
 	  module will be called sunxi_wdt.
 
-config COH901327_WATCHDOG
-	bool "ST-Ericsson COH 901 327 watchdog"
-	depends on ARCH_U300 || (ARM && COMMON_CLK && COMPILE_TEST)
-	default y if MACH_U300
-	select WATCHDOG_CORE
-	help
-	  Say Y here to include Watchdog timer support for the
-	  watchdog embedded into the ST-Ericsson U300 series platforms.
-	  This watchdog is used to reset the system and thus cannot be
-	  compiled as a module.
-
 config NPCM7XX_WATCHDOG
 	tristate "Nuvoton NPCM750 watchdog"
 	depends on ARCH_NPCM || COMPILE_TEST
diff --git a/drivers/watchdog/Makefile b/drivers/watchdog/Makefile
index 1ff40d6a027f..1685dbc70a15 100644
--- a/drivers/watchdog/Makefile
+++ b/drivers/watchdog/Makefile
@@ -61,7 +61,6 @@ obj-$(CONFIG_K3_RTI_WATCHDOG) += rti_wdt.o
 obj-$(CONFIG_ORION_WATCHDOG) += orion_wdt.o
 obj-$(CONFIG_SUNXI_WATCHDOG) += sunxi_wdt.o
 obj-$(CONFIG_RN5T618_WATCHDOG) += rn5t618_wdt.o
-obj-$(CONFIG_COH901327_WATCHDOG) += coh901327_wdt.o
 obj-$(CONFIG_NPCM7XX_WATCHDOG) += npcm_wdt.o
 obj-$(CONFIG_STMP3XXX_RTC_WATCHDOG) += stmp3xxx_rtc_wdt.o
 obj-$(CONFIG_TS4800_WATCHDOG) += ts4800_wdt.o
diff --git a/drivers/watchdog/coh901327_wdt.c b/drivers/watchdog/coh901327_wdt.c
deleted file mode 100644
index 260c50b08483..000000000000
--- a/drivers/watchdog/coh901327_wdt.c
+++ /dev/null
@@ -1,408 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/*
- * coh901327_wdt.c
- *
- * Copyright (C) 2008-2009 ST-Ericsson AB
- * Watchdog driver for the ST-Ericsson AB COH 901 327 IP core
- * Author: Linus Walleij <linus.walleij@stericsson.com>
- */
-#include <linux/moduleparam.h>
-#include <linux/mod_devicetable.h>
-#include <linux/types.h>
-#include <linux/watchdog.h>
-#include <linux/interrupt.h>
-#include <linux/pm.h>
-#include <linux/platform_device.h>
-#include <linux/io.h>
-#include <linux/bitops.h>
-#include <linux/clk.h>
-#include <linux/delay.h>
-#include <linux/err.h>
-
-#define DRV_NAME "WDOG COH 901 327"
-
-/*
- * COH 901 327 register definitions
- */
-
-/* WDOG_FEED Register 32bit (-/W) */
-#define U300_WDOG_FR							0x00
-#define U300_WDOG_FR_FEED_RESTART_TIMER					0xFEEDU
-/* WDOG_TIMEOUT Register 32bit (R/W) */
-#define U300_WDOG_TR							0x04
-#define U300_WDOG_TR_TIMEOUT_MASK					0x7FFFU
-/* WDOG_DISABLE1 Register 32bit (-/W) */
-#define U300_WDOG_D1R							0x08
-#define U300_WDOG_D1R_DISABLE1_DISABLE_TIMER				0x2BADU
-/* WDOG_DISABLE2 Register 32bit (R/W) */
-#define U300_WDOG_D2R							0x0C
-#define U300_WDOG_D2R_DISABLE2_DISABLE_TIMER				0xCAFEU
-#define U300_WDOG_D2R_DISABLE_STATUS_DISABLED				0xDABEU
-#define U300_WDOG_D2R_DISABLE_STATUS_ENABLED				0x0000U
-/* WDOG_STATUS Register 32bit (R/W) */
-#define U300_WDOG_SR							0x10
-#define U300_WDOG_SR_STATUS_TIMED_OUT					0xCFE8U
-#define U300_WDOG_SR_STATUS_NORMAL					0x0000U
-#define U300_WDOG_SR_RESET_STATUS_RESET					0xE8B4U
-/* WDOG_COUNT Register 32bit (R/-) */
-#define U300_WDOG_CR							0x14
-#define U300_WDOG_CR_VALID_IND						0x8000U
-#define U300_WDOG_CR_VALID_STABLE					0x0000U
-#define U300_WDOG_CR_COUNT_VALUE_MASK					0x7FFFU
-/* WDOG_JTAGOVR Register 32bit (R/W) */
-#define U300_WDOG_JOR							0x18
-#define U300_WDOG_JOR_JTAG_MODE_IND					0x0002U
-#define U300_WDOG_JOR_JTAG_WATCHDOG_ENABLE				0x0001U
-/* WDOG_RESTART Register 32bit (-/W) */
-#define U300_WDOG_RR							0x1C
-#define U300_WDOG_RR_RESTART_VALUE_RESUME				0xACEDU
-/* WDOG_IRQ_EVENT Register 32bit (R/W) */
-#define U300_WDOG_IER							0x20
-#define U300_WDOG_IER_WILL_BARK_IRQ_EVENT_IND				0x0001U
-#define U300_WDOG_IER_WILL_BARK_IRQ_ACK_ENABLE				0x0001U
-/* WDOG_IRQ_MASK Register 32bit (R/W) */
-#define U300_WDOG_IMR							0x24
-#define U300_WDOG_IMR_WILL_BARK_IRQ_ENABLE				0x0001U
-/* WDOG_IRQ_FORCE Register 32bit (R/W) */
-#define U300_WDOG_IFR							0x28
-#define U300_WDOG_IFR_WILL_BARK_IRQ_FORCE_ENABLE			0x0001U
-
-/* Default timeout in seconds = 1 minute */
-#define U300_WDOG_DEFAULT_TIMEOUT					60
-
-static unsigned int margin;
-static int irq;
-static void __iomem *virtbase;
-static struct device *parent;
-
-static struct clk *clk;
-
-/*
- * Enabling and disabling functions.
- */
-static void coh901327_enable(u16 timeout)
-{
-	u16 val;
-	unsigned long freq;
-	unsigned long delay_ns;
-
-	/* Restart timer if it is disabled */
-	val = readw(virtbase + U300_WDOG_D2R);
-	if (val == U300_WDOG_D2R_DISABLE_STATUS_DISABLED)
-		writew(U300_WDOG_RR_RESTART_VALUE_RESUME,
-		       virtbase + U300_WDOG_RR);
-	/* Acknowledge any pending interrupt so it doesn't just fire off */
-	writew(U300_WDOG_IER_WILL_BARK_IRQ_ACK_ENABLE,
-	       virtbase + U300_WDOG_IER);
-	/*
-	 * The interrupt is cleared in the 32 kHz clock domain.
-	 * Wait 3 32 kHz cycles for it to take effect
-	 */
-	freq = clk_get_rate(clk);
-	delay_ns = DIV_ROUND_UP(1000000000, freq); /* Freq to ns and round up */
-	delay_ns = 3 * delay_ns; /* Wait 3 cycles */
-	ndelay(delay_ns);
-	/* Enable the watchdog interrupt */
-	writew(U300_WDOG_IMR_WILL_BARK_IRQ_ENABLE, virtbase + U300_WDOG_IMR);
-	/* Activate the watchdog timer */
-	writew(timeout, virtbase + U300_WDOG_TR);
-	/* Start the watchdog timer */
-	writew(U300_WDOG_FR_FEED_RESTART_TIMER, virtbase + U300_WDOG_FR);
-	/*
-	 * Extra read so that this change propagate in the watchdog.
-	 */
-	(void) readw(virtbase + U300_WDOG_CR);
-	val = readw(virtbase + U300_WDOG_D2R);
-	if (val != U300_WDOG_D2R_DISABLE_STATUS_ENABLED)
-		dev_err(parent,
-			"%s(): watchdog not enabled! D2R value %04x\n",
-			__func__, val);
-}
-
-static void coh901327_disable(void)
-{
-	u16 val;
-
-	/* Disable the watchdog interrupt if it is active */
-	writew(0x0000U, virtbase + U300_WDOG_IMR);
-	/* If the watchdog is currently enabled, attempt to disable it */
-	val = readw(virtbase + U300_WDOG_D2R);
-	if (val != U300_WDOG_D2R_DISABLE_STATUS_DISABLED) {
-		writew(U300_WDOG_D1R_DISABLE1_DISABLE_TIMER,
-		       virtbase + U300_WDOG_D1R);
-		writew(U300_WDOG_D2R_DISABLE2_DISABLE_TIMER,
-		       virtbase + U300_WDOG_D2R);
-		/* Write this twice (else problems occur) */
-		writew(U300_WDOG_D2R_DISABLE2_DISABLE_TIMER,
-		       virtbase + U300_WDOG_D2R);
-	}
-	val = readw(virtbase + U300_WDOG_D2R);
-	if (val != U300_WDOG_D2R_DISABLE_STATUS_DISABLED)
-		dev_err(parent,
-			"%s(): watchdog not disabled! D2R value %04x\n",
-			__func__, val);
-}
-
-static int coh901327_start(struct watchdog_device *wdt_dev)
-{
-	coh901327_enable(wdt_dev->timeout * 100);
-	return 0;
-}
-
-static int coh901327_stop(struct watchdog_device *wdt_dev)
-{
-	coh901327_disable();
-	return 0;
-}
-
-static int coh901327_ping(struct watchdog_device *wdd)
-{
-	/* Feed the watchdog */
-	writew(U300_WDOG_FR_FEED_RESTART_TIMER,
-	       virtbase + U300_WDOG_FR);
-	return 0;
-}
-
-static int coh901327_settimeout(struct watchdog_device *wdt_dev,
-				unsigned int time)
-{
-	wdt_dev->timeout = time;
-	/* Set new timeout value */
-	writew(time * 100, virtbase + U300_WDOG_TR);
-	/* Feed the dog */
-	writew(U300_WDOG_FR_FEED_RESTART_TIMER,
-	       virtbase + U300_WDOG_FR);
-	return 0;
-}
-
-static unsigned int coh901327_gettimeleft(struct watchdog_device *wdt_dev)
-{
-	u16 val;
-
-	/* Read repeatedly until the value is stable! */
-	val = readw(virtbase + U300_WDOG_CR);
-	while (val & U300_WDOG_CR_VALID_IND)
-		val = readw(virtbase + U300_WDOG_CR);
-	val &= U300_WDOG_CR_COUNT_VALUE_MASK;
-	if (val != 0)
-		val /= 100;
-
-	return val;
-}
-
-/*
- * This interrupt occurs 10 ms before the watchdog WILL bark.
- */
-static irqreturn_t coh901327_interrupt(int irq, void *data)
-{
-	u16 val;
-
-	/*
-	 * Ack IRQ? If this occurs we're FUBAR anyway, so
-	 * just acknowledge, disable the interrupt and await the imminent end.
-	 * If you at some point need a host of callbacks to be called
-	 * when the system is about to watchdog-reset, add them here!
-	 *
-	 * NOTE: on future versions of this IP-block, it will be possible
-	 * to prevent a watchdog reset by feeding the watchdog at this
-	 * point.
-	 */
-	val = readw(virtbase + U300_WDOG_IER);
-	if (val == U300_WDOG_IER_WILL_BARK_IRQ_EVENT_IND)
-		writew(U300_WDOG_IER_WILL_BARK_IRQ_ACK_ENABLE,
-		       virtbase + U300_WDOG_IER);
-	writew(0x0000U, virtbase + U300_WDOG_IMR);
-	dev_crit(parent, "watchdog is barking!\n");
-	return IRQ_HANDLED;
-}
-
-static const struct watchdog_info coh901327_ident = {
-	.options = WDIOF_CARDRESET | WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING,
-	.identity = DRV_NAME,
-};
-
-static const struct watchdog_ops coh901327_ops = {
-	.owner = THIS_MODULE,
-	.start = coh901327_start,
-	.stop = coh901327_stop,
-	.ping = coh901327_ping,
-	.set_timeout = coh901327_settimeout,
-	.get_timeleft = coh901327_gettimeleft,
-};
-
-static struct watchdog_device coh901327_wdt = {
-	.info = &coh901327_ident,
-	.ops = &coh901327_ops,
-	/*
-	 * Max timeout is 327 since the 10ms
-	 * timeout register is max
-	 * 0x7FFF = 327670ms ~= 327s.
-	 */
-	.min_timeout = 1,
-	.max_timeout = 327,
-	.timeout = U300_WDOG_DEFAULT_TIMEOUT,
-};
-
-static int __init coh901327_probe(struct platform_device *pdev)
-{
-	struct device *dev = &pdev->dev;
-	int ret;
-	u16 val;
-
-	parent = dev;
-
-	virtbase = devm_platform_ioremap_resource(pdev, 0);
-	if (IS_ERR(virtbase))
-		return PTR_ERR(virtbase);
-
-	clk = clk_get(dev, NULL);
-	if (IS_ERR(clk)) {
-		ret = PTR_ERR(clk);
-		dev_err(dev, "could not get clock\n");
-		return ret;
-	}
-	ret = clk_prepare_enable(clk);
-	if (ret) {
-		dev_err(dev, "could not prepare and enable clock\n");
-		goto out_no_clk_enable;
-	}
-
-	val = readw(virtbase + U300_WDOG_SR);
-	switch (val) {
-	case U300_WDOG_SR_STATUS_TIMED_OUT:
-		dev_info(dev, "watchdog timed out since last chip reset!\n");
-		coh901327_wdt.bootstatus |= WDIOF_CARDRESET;
-		/* Status will be cleared below */
-		break;
-	case U300_WDOG_SR_STATUS_NORMAL:
-		dev_info(dev, "in normal status, no timeouts have occurred.\n");
-		break;
-	default:
-		dev_info(dev, "contains an illegal status code (%08x)\n", val);
-		break;
-	}
-
-	val = readw(virtbase + U300_WDOG_D2R);
-	switch (val) {
-	case U300_WDOG_D2R_DISABLE_STATUS_DISABLED:
-		dev_info(dev, "currently disabled.\n");
-		break;
-	case U300_WDOG_D2R_DISABLE_STATUS_ENABLED:
-		dev_info(dev, "currently enabled! (disabling it now)\n");
-		coh901327_disable();
-		break;
-	default:
-		dev_err(dev, "contains an illegal enable/disable code (%08x)\n",
-			val);
-		break;
-	}
-
-	/* Reset the watchdog */
-	writew(U300_WDOG_SR_RESET_STATUS_RESET, virtbase + U300_WDOG_SR);
-
-	irq = platform_get_irq(pdev, 0);
-	if (request_irq(irq, coh901327_interrupt, 0,
-			DRV_NAME " Bark", pdev)) {
-		ret = -EIO;
-		goto out_no_irq;
-	}
-
-	watchdog_init_timeout(&coh901327_wdt, margin, dev);
-
-	coh901327_wdt.parent = dev;
-	ret = watchdog_register_device(&coh901327_wdt);
-	if (ret)
-		goto out_no_wdog;
-
-	dev_info(dev, "initialized. (timeout=%d sec)\n",
-			coh901327_wdt.timeout);
-	return 0;
-
-out_no_wdog:
-	free_irq(irq, pdev);
-out_no_irq:
-	clk_disable_unprepare(clk);
-out_no_clk_enable:
-	clk_put(clk);
-	return ret;
-}
-
-#ifdef CONFIG_PM
-
-static u16 wdogenablestore;
-static u16 irqmaskstore;
-
-static int coh901327_suspend(struct platform_device *pdev, pm_message_t state)
-{
-	irqmaskstore = readw(virtbase + U300_WDOG_IMR) & 0x0001U;
-	wdogenablestore = readw(virtbase + U300_WDOG_D2R);
-	/* If watchdog is on, disable it here and now */
-	if (wdogenablestore == U300_WDOG_D2R_DISABLE_STATUS_ENABLED)
-		coh901327_disable();
-	return 0;
-}
-
-static int coh901327_resume(struct platform_device *pdev)
-{
-	/* Restore the watchdog interrupt */
-	writew(irqmaskstore, virtbase + U300_WDOG_IMR);
-	if (wdogenablestore == U300_WDOG_D2R_DISABLE_STATUS_ENABLED) {
-		/* Restart the watchdog timer */
-		writew(U300_WDOG_RR_RESTART_VALUE_RESUME,
-		       virtbase + U300_WDOG_RR);
-		writew(U300_WDOG_FR_FEED_RESTART_TIMER,
-		       virtbase + U300_WDOG_FR);
-	}
-	return 0;
-}
-#else
-#define coh901327_suspend NULL
-#define coh901327_resume  NULL
-#endif
-
-/*
- * Mistreating the watchdog is the only way to perform a software reset of the
- * system on EMP platforms. So we implement this and export a symbol for it.
- */
-void coh901327_watchdog_reset(void)
-{
-	/* Enable even if on JTAG too */
-	writew(U300_WDOG_JOR_JTAG_WATCHDOG_ENABLE,
-	       virtbase + U300_WDOG_JOR);
-	/*
-	 * Timeout = 5s, we have to wait for the watchdog reset to
-	 * actually take place: the watchdog will be reloaded with the
-	 * default value immediately, so we HAVE to reboot and get back
-	 * into the kernel in 30s, or the device will reboot again!
-	 * The boot loader will typically deactivate the watchdog, so we
-	 * need time enough for the boot loader to get to the point of
-	 * deactivating the watchdog before it is shut down by it.
-	 *
-	 * NOTE: on future versions of the watchdog, this restriction is
-	 * gone: the watchdog will be reloaded with a default value (1 min)
-	 * instead of last value, and you can conveniently set the watchdog
-	 * timeout to 10ms (value = 1) without any problems.
-	 */
-	coh901327_enable(500);
-	/* Return and await doom */
-}
-
-static const struct of_device_id coh901327_dt_match[] = {
-	{ .compatible = "stericsson,coh901327" },
-	{},
-};
-
-static struct platform_driver coh901327_driver = {
-	.driver = {
-		.name	= "coh901327_wdog",
-		.of_match_table = coh901327_dt_match,
-		.suppress_bind_attrs = true,
-	},
-	.suspend	= coh901327_suspend,
-	.resume		= coh901327_resume,
-};
-builtin_platform_driver_probe(coh901327_driver, coh901327_probe);
-
-/* not really modular, but ... */
-module_param(margin, uint, 0);
-MODULE_PARM_DESC(margin, "Watchdog margin in seconds (default 60s)");
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [PATCH 5/5] watchdog: remove coh901 driver
@ 2021-01-20 16:27   ` Arnd Bergmann
  0 siblings, 0 replies; 38+ messages in thread
From: Arnd Bergmann @ 2021-01-20 16:27 UTC (permalink / raw)
  To: linux-arm-kernel, linux-kernel, linux-watchdog, Guenter Roeck
  Cc: Linus Walleij, Wim Van Sebroeck, Arnd Bergmann

From: Arnd Bergmann <arnd@arndb.de>

The ST-Ericsson U300 platform is getting removed, so this driver is no
longer needed.

Cc: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 .../watchdog/stericsson-coh901327.txt         |  19 -
 drivers/watchdog/Kconfig                      |  11 -
 drivers/watchdog/Makefile                     |   1 -
 drivers/watchdog/coh901327_wdt.c              | 408 ------------------
 4 files changed, 439 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/watchdog/stericsson-coh901327.txt
 delete mode 100644 drivers/watchdog/coh901327_wdt.c

diff --git a/Documentation/devicetree/bindings/watchdog/stericsson-coh901327.txt b/Documentation/devicetree/bindings/watchdog/stericsson-coh901327.txt
deleted file mode 100644
index 8ffb88e39e76..000000000000
--- a/Documentation/devicetree/bindings/watchdog/stericsson-coh901327.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-ST-Ericsson COH 901 327 Watchdog timer
-
-Required properties:
-- compatible: must be "stericsson,coh901327".
-- reg: physical base address of the controller and length of memory mapped
-  region.
-- interrupts: the interrupt used for the watchdog timeout warning.
-
-Optional properties:
-- timeout-sec: contains the watchdog timeout in seconds.
-
-Example:
-
-watchdog: watchdog@c0012000 {
-	compatible = "stericsson,coh901327";
-	reg = <0xc0012000 0x1000>;
-	interrupts = <3>;
-	timeout-sec = <60>;
-};
diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
index 10efbb351f14..3b73735b0c8b 100644
--- a/drivers/watchdog/Kconfig
+++ b/drivers/watchdog/Kconfig
@@ -619,17 +619,6 @@ config SUNXI_WATCHDOG
 	  To compile this driver as a module, choose M here: the
 	  module will be called sunxi_wdt.
 
-config COH901327_WATCHDOG
-	bool "ST-Ericsson COH 901 327 watchdog"
-	depends on ARCH_U300 || (ARM && COMMON_CLK && COMPILE_TEST)
-	default y if MACH_U300
-	select WATCHDOG_CORE
-	help
-	  Say Y here to include Watchdog timer support for the
-	  watchdog embedded into the ST-Ericsson U300 series platforms.
-	  This watchdog is used to reset the system and thus cannot be
-	  compiled as a module.
-
 config NPCM7XX_WATCHDOG
 	tristate "Nuvoton NPCM750 watchdog"
 	depends on ARCH_NPCM || COMPILE_TEST
diff --git a/drivers/watchdog/Makefile b/drivers/watchdog/Makefile
index 1ff40d6a027f..1685dbc70a15 100644
--- a/drivers/watchdog/Makefile
+++ b/drivers/watchdog/Makefile
@@ -61,7 +61,6 @@ obj-$(CONFIG_K3_RTI_WATCHDOG) += rti_wdt.o
 obj-$(CONFIG_ORION_WATCHDOG) += orion_wdt.o
 obj-$(CONFIG_SUNXI_WATCHDOG) += sunxi_wdt.o
 obj-$(CONFIG_RN5T618_WATCHDOG) += rn5t618_wdt.o
-obj-$(CONFIG_COH901327_WATCHDOG) += coh901327_wdt.o
 obj-$(CONFIG_NPCM7XX_WATCHDOG) += npcm_wdt.o
 obj-$(CONFIG_STMP3XXX_RTC_WATCHDOG) += stmp3xxx_rtc_wdt.o
 obj-$(CONFIG_TS4800_WATCHDOG) += ts4800_wdt.o
diff --git a/drivers/watchdog/coh901327_wdt.c b/drivers/watchdog/coh901327_wdt.c
deleted file mode 100644
index 260c50b08483..000000000000
--- a/drivers/watchdog/coh901327_wdt.c
+++ /dev/null
@@ -1,408 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/*
- * coh901327_wdt.c
- *
- * Copyright (C) 2008-2009 ST-Ericsson AB
- * Watchdog driver for the ST-Ericsson AB COH 901 327 IP core
- * Author: Linus Walleij <linus.walleij@stericsson.com>
- */
-#include <linux/moduleparam.h>
-#include <linux/mod_devicetable.h>
-#include <linux/types.h>
-#include <linux/watchdog.h>
-#include <linux/interrupt.h>
-#include <linux/pm.h>
-#include <linux/platform_device.h>
-#include <linux/io.h>
-#include <linux/bitops.h>
-#include <linux/clk.h>
-#include <linux/delay.h>
-#include <linux/err.h>
-
-#define DRV_NAME "WDOG COH 901 327"
-
-/*
- * COH 901 327 register definitions
- */
-
-/* WDOG_FEED Register 32bit (-/W) */
-#define U300_WDOG_FR							0x00
-#define U300_WDOG_FR_FEED_RESTART_TIMER					0xFEEDU
-/* WDOG_TIMEOUT Register 32bit (R/W) */
-#define U300_WDOG_TR							0x04
-#define U300_WDOG_TR_TIMEOUT_MASK					0x7FFFU
-/* WDOG_DISABLE1 Register 32bit (-/W) */
-#define U300_WDOG_D1R							0x08
-#define U300_WDOG_D1R_DISABLE1_DISABLE_TIMER				0x2BADU
-/* WDOG_DISABLE2 Register 32bit (R/W) */
-#define U300_WDOG_D2R							0x0C
-#define U300_WDOG_D2R_DISABLE2_DISABLE_TIMER				0xCAFEU
-#define U300_WDOG_D2R_DISABLE_STATUS_DISABLED				0xDABEU
-#define U300_WDOG_D2R_DISABLE_STATUS_ENABLED				0x0000U
-/* WDOG_STATUS Register 32bit (R/W) */
-#define U300_WDOG_SR							0x10
-#define U300_WDOG_SR_STATUS_TIMED_OUT					0xCFE8U
-#define U300_WDOG_SR_STATUS_NORMAL					0x0000U
-#define U300_WDOG_SR_RESET_STATUS_RESET					0xE8B4U
-/* WDOG_COUNT Register 32bit (R/-) */
-#define U300_WDOG_CR							0x14
-#define U300_WDOG_CR_VALID_IND						0x8000U
-#define U300_WDOG_CR_VALID_STABLE					0x0000U
-#define U300_WDOG_CR_COUNT_VALUE_MASK					0x7FFFU
-/* WDOG_JTAGOVR Register 32bit (R/W) */
-#define U300_WDOG_JOR							0x18
-#define U300_WDOG_JOR_JTAG_MODE_IND					0x0002U
-#define U300_WDOG_JOR_JTAG_WATCHDOG_ENABLE				0x0001U
-/* WDOG_RESTART Register 32bit (-/W) */
-#define U300_WDOG_RR							0x1C
-#define U300_WDOG_RR_RESTART_VALUE_RESUME				0xACEDU
-/* WDOG_IRQ_EVENT Register 32bit (R/W) */
-#define U300_WDOG_IER							0x20
-#define U300_WDOG_IER_WILL_BARK_IRQ_EVENT_IND				0x0001U
-#define U300_WDOG_IER_WILL_BARK_IRQ_ACK_ENABLE				0x0001U
-/* WDOG_IRQ_MASK Register 32bit (R/W) */
-#define U300_WDOG_IMR							0x24
-#define U300_WDOG_IMR_WILL_BARK_IRQ_ENABLE				0x0001U
-/* WDOG_IRQ_FORCE Register 32bit (R/W) */
-#define U300_WDOG_IFR							0x28
-#define U300_WDOG_IFR_WILL_BARK_IRQ_FORCE_ENABLE			0x0001U
-
-/* Default timeout in seconds = 1 minute */
-#define U300_WDOG_DEFAULT_TIMEOUT					60
-
-static unsigned int margin;
-static int irq;
-static void __iomem *virtbase;
-static struct device *parent;
-
-static struct clk *clk;
-
-/*
- * Enabling and disabling functions.
- */
-static void coh901327_enable(u16 timeout)
-{
-	u16 val;
-	unsigned long freq;
-	unsigned long delay_ns;
-
-	/* Restart timer if it is disabled */
-	val = readw(virtbase + U300_WDOG_D2R);
-	if (val == U300_WDOG_D2R_DISABLE_STATUS_DISABLED)
-		writew(U300_WDOG_RR_RESTART_VALUE_RESUME,
-		       virtbase + U300_WDOG_RR);
-	/* Acknowledge any pending interrupt so it doesn't just fire off */
-	writew(U300_WDOG_IER_WILL_BARK_IRQ_ACK_ENABLE,
-	       virtbase + U300_WDOG_IER);
-	/*
-	 * The interrupt is cleared in the 32 kHz clock domain.
-	 * Wait 3 32 kHz cycles for it to take effect
-	 */
-	freq = clk_get_rate(clk);
-	delay_ns = DIV_ROUND_UP(1000000000, freq); /* Freq to ns and round up */
-	delay_ns = 3 * delay_ns; /* Wait 3 cycles */
-	ndelay(delay_ns);
-	/* Enable the watchdog interrupt */
-	writew(U300_WDOG_IMR_WILL_BARK_IRQ_ENABLE, virtbase + U300_WDOG_IMR);
-	/* Activate the watchdog timer */
-	writew(timeout, virtbase + U300_WDOG_TR);
-	/* Start the watchdog timer */
-	writew(U300_WDOG_FR_FEED_RESTART_TIMER, virtbase + U300_WDOG_FR);
-	/*
-	 * Extra read so that this change propagate in the watchdog.
-	 */
-	(void) readw(virtbase + U300_WDOG_CR);
-	val = readw(virtbase + U300_WDOG_D2R);
-	if (val != U300_WDOG_D2R_DISABLE_STATUS_ENABLED)
-		dev_err(parent,
-			"%s(): watchdog not enabled! D2R value %04x\n",
-			__func__, val);
-}
-
-static void coh901327_disable(void)
-{
-	u16 val;
-
-	/* Disable the watchdog interrupt if it is active */
-	writew(0x0000U, virtbase + U300_WDOG_IMR);
-	/* If the watchdog is currently enabled, attempt to disable it */
-	val = readw(virtbase + U300_WDOG_D2R);
-	if (val != U300_WDOG_D2R_DISABLE_STATUS_DISABLED) {
-		writew(U300_WDOG_D1R_DISABLE1_DISABLE_TIMER,
-		       virtbase + U300_WDOG_D1R);
-		writew(U300_WDOG_D2R_DISABLE2_DISABLE_TIMER,
-		       virtbase + U300_WDOG_D2R);
-		/* Write this twice (else problems occur) */
-		writew(U300_WDOG_D2R_DISABLE2_DISABLE_TIMER,
-		       virtbase + U300_WDOG_D2R);
-	}
-	val = readw(virtbase + U300_WDOG_D2R);
-	if (val != U300_WDOG_D2R_DISABLE_STATUS_DISABLED)
-		dev_err(parent,
-			"%s(): watchdog not disabled! D2R value %04x\n",
-			__func__, val);
-}
-
-static int coh901327_start(struct watchdog_device *wdt_dev)
-{
-	coh901327_enable(wdt_dev->timeout * 100);
-	return 0;
-}
-
-static int coh901327_stop(struct watchdog_device *wdt_dev)
-{
-	coh901327_disable();
-	return 0;
-}
-
-static int coh901327_ping(struct watchdog_device *wdd)
-{
-	/* Feed the watchdog */
-	writew(U300_WDOG_FR_FEED_RESTART_TIMER,
-	       virtbase + U300_WDOG_FR);
-	return 0;
-}
-
-static int coh901327_settimeout(struct watchdog_device *wdt_dev,
-				unsigned int time)
-{
-	wdt_dev->timeout = time;
-	/* Set new timeout value */
-	writew(time * 100, virtbase + U300_WDOG_TR);
-	/* Feed the dog */
-	writew(U300_WDOG_FR_FEED_RESTART_TIMER,
-	       virtbase + U300_WDOG_FR);
-	return 0;
-}
-
-static unsigned int coh901327_gettimeleft(struct watchdog_device *wdt_dev)
-{
-	u16 val;
-
-	/* Read repeatedly until the value is stable! */
-	val = readw(virtbase + U300_WDOG_CR);
-	while (val & U300_WDOG_CR_VALID_IND)
-		val = readw(virtbase + U300_WDOG_CR);
-	val &= U300_WDOG_CR_COUNT_VALUE_MASK;
-	if (val != 0)
-		val /= 100;
-
-	return val;
-}
-
-/*
- * This interrupt occurs 10 ms before the watchdog WILL bark.
- */
-static irqreturn_t coh901327_interrupt(int irq, void *data)
-{
-	u16 val;
-
-	/*
-	 * Ack IRQ? If this occurs we're FUBAR anyway, so
-	 * just acknowledge, disable the interrupt and await the imminent end.
-	 * If you at some point need a host of callbacks to be called
-	 * when the system is about to watchdog-reset, add them here!
-	 *
-	 * NOTE: on future versions of this IP-block, it will be possible
-	 * to prevent a watchdog reset by feeding the watchdog at this
-	 * point.
-	 */
-	val = readw(virtbase + U300_WDOG_IER);
-	if (val == U300_WDOG_IER_WILL_BARK_IRQ_EVENT_IND)
-		writew(U300_WDOG_IER_WILL_BARK_IRQ_ACK_ENABLE,
-		       virtbase + U300_WDOG_IER);
-	writew(0x0000U, virtbase + U300_WDOG_IMR);
-	dev_crit(parent, "watchdog is barking!\n");
-	return IRQ_HANDLED;
-}
-
-static const struct watchdog_info coh901327_ident = {
-	.options = WDIOF_CARDRESET | WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING,
-	.identity = DRV_NAME,
-};
-
-static const struct watchdog_ops coh901327_ops = {
-	.owner = THIS_MODULE,
-	.start = coh901327_start,
-	.stop = coh901327_stop,
-	.ping = coh901327_ping,
-	.set_timeout = coh901327_settimeout,
-	.get_timeleft = coh901327_gettimeleft,
-};
-
-static struct watchdog_device coh901327_wdt = {
-	.info = &coh901327_ident,
-	.ops = &coh901327_ops,
-	/*
-	 * Max timeout is 327 since the 10ms
-	 * timeout register is max
-	 * 0x7FFF = 327670ms ~= 327s.
-	 */
-	.min_timeout = 1,
-	.max_timeout = 327,
-	.timeout = U300_WDOG_DEFAULT_TIMEOUT,
-};
-
-static int __init coh901327_probe(struct platform_device *pdev)
-{
-	struct device *dev = &pdev->dev;
-	int ret;
-	u16 val;
-
-	parent = dev;
-
-	virtbase = devm_platform_ioremap_resource(pdev, 0);
-	if (IS_ERR(virtbase))
-		return PTR_ERR(virtbase);
-
-	clk = clk_get(dev, NULL);
-	if (IS_ERR(clk)) {
-		ret = PTR_ERR(clk);
-		dev_err(dev, "could not get clock\n");
-		return ret;
-	}
-	ret = clk_prepare_enable(clk);
-	if (ret) {
-		dev_err(dev, "could not prepare and enable clock\n");
-		goto out_no_clk_enable;
-	}
-
-	val = readw(virtbase + U300_WDOG_SR);
-	switch (val) {
-	case U300_WDOG_SR_STATUS_TIMED_OUT:
-		dev_info(dev, "watchdog timed out since last chip reset!\n");
-		coh901327_wdt.bootstatus |= WDIOF_CARDRESET;
-		/* Status will be cleared below */
-		break;
-	case U300_WDOG_SR_STATUS_NORMAL:
-		dev_info(dev, "in normal status, no timeouts have occurred.\n");
-		break;
-	default:
-		dev_info(dev, "contains an illegal status code (%08x)\n", val);
-		break;
-	}
-
-	val = readw(virtbase + U300_WDOG_D2R);
-	switch (val) {
-	case U300_WDOG_D2R_DISABLE_STATUS_DISABLED:
-		dev_info(dev, "currently disabled.\n");
-		break;
-	case U300_WDOG_D2R_DISABLE_STATUS_ENABLED:
-		dev_info(dev, "currently enabled! (disabling it now)\n");
-		coh901327_disable();
-		break;
-	default:
-		dev_err(dev, "contains an illegal enable/disable code (%08x)\n",
-			val);
-		break;
-	}
-
-	/* Reset the watchdog */
-	writew(U300_WDOG_SR_RESET_STATUS_RESET, virtbase + U300_WDOG_SR);
-
-	irq = platform_get_irq(pdev, 0);
-	if (request_irq(irq, coh901327_interrupt, 0,
-			DRV_NAME " Bark", pdev)) {
-		ret = -EIO;
-		goto out_no_irq;
-	}
-
-	watchdog_init_timeout(&coh901327_wdt, margin, dev);
-
-	coh901327_wdt.parent = dev;
-	ret = watchdog_register_device(&coh901327_wdt);
-	if (ret)
-		goto out_no_wdog;
-
-	dev_info(dev, "initialized. (timeout=%d sec)\n",
-			coh901327_wdt.timeout);
-	return 0;
-
-out_no_wdog:
-	free_irq(irq, pdev);
-out_no_irq:
-	clk_disable_unprepare(clk);
-out_no_clk_enable:
-	clk_put(clk);
-	return ret;
-}
-
-#ifdef CONFIG_PM
-
-static u16 wdogenablestore;
-static u16 irqmaskstore;
-
-static int coh901327_suspend(struct platform_device *pdev, pm_message_t state)
-{
-	irqmaskstore = readw(virtbase + U300_WDOG_IMR) & 0x0001U;
-	wdogenablestore = readw(virtbase + U300_WDOG_D2R);
-	/* If watchdog is on, disable it here and now */
-	if (wdogenablestore == U300_WDOG_D2R_DISABLE_STATUS_ENABLED)
-		coh901327_disable();
-	return 0;
-}
-
-static int coh901327_resume(struct platform_device *pdev)
-{
-	/* Restore the watchdog interrupt */
-	writew(irqmaskstore, virtbase + U300_WDOG_IMR);
-	if (wdogenablestore == U300_WDOG_D2R_DISABLE_STATUS_ENABLED) {
-		/* Restart the watchdog timer */
-		writew(U300_WDOG_RR_RESTART_VALUE_RESUME,
-		       virtbase + U300_WDOG_RR);
-		writew(U300_WDOG_FR_FEED_RESTART_TIMER,
-		       virtbase + U300_WDOG_FR);
-	}
-	return 0;
-}
-#else
-#define coh901327_suspend NULL
-#define coh901327_resume  NULL
-#endif
-
-/*
- * Mistreating the watchdog is the only way to perform a software reset of the
- * system on EMP platforms. So we implement this and export a symbol for it.
- */
-void coh901327_watchdog_reset(void)
-{
-	/* Enable even if on JTAG too */
-	writew(U300_WDOG_JOR_JTAG_WATCHDOG_ENABLE,
-	       virtbase + U300_WDOG_JOR);
-	/*
-	 * Timeout = 5s, we have to wait for the watchdog reset to
-	 * actually take place: the watchdog will be reloaded with the
-	 * default value immediately, so we HAVE to reboot and get back
-	 * into the kernel in 30s, or the device will reboot again!
-	 * The boot loader will typically deactivate the watchdog, so we
-	 * need time enough for the boot loader to get to the point of
-	 * deactivating the watchdog before it is shut down by it.
-	 *
-	 * NOTE: on future versions of the watchdog, this restriction is
-	 * gone: the watchdog will be reloaded with a default value (1 min)
-	 * instead of last value, and you can conveniently set the watchdog
-	 * timeout to 10ms (value = 1) without any problems.
-	 */
-	coh901327_enable(500);
-	/* Return and await doom */
-}
-
-static const struct of_device_id coh901327_dt_match[] = {
-	{ .compatible = "stericsson,coh901327" },
-	{},
-};
-
-static struct platform_driver coh901327_driver = {
-	.driver = {
-		.name	= "coh901327_wdog",
-		.of_match_table = coh901327_dt_match,
-		.suppress_bind_attrs = true,
-	},
-	.suspend	= coh901327_suspend,
-	.resume		= coh901327_resume,
-};
-builtin_platform_driver_probe(coh901327_driver, coh901327_probe);
-
-/* not really modular, but ... */
-module_param(margin, uint, 0);
-MODULE_PARM_DESC(margin, "Watchdog margin in seconds (default 60s)");
-- 
2.29.2


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 38+ messages in thread

* Re: [PATCH 1/5] watchdog: remove sirf prima driver
  2021-01-20 16:27   ` Arnd Bergmann
@ 2021-01-20 19:03     ` Guenter Roeck
  -1 siblings, 0 replies; 38+ messages in thread
From: Guenter Roeck @ 2021-01-20 19:03 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: linux-arm-kernel, linux-kernel, linux-watchdog, Wim Van Sebroeck,
	Arnd Bergmann, Barry Song

On Wed, Jan 20, 2021 at 05:27:41PM +0100, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
> 
> The CSR SiRF prima2/atlas platforms are getting removed, so this driver
> is no longer needed.
> 
> Cc: Barry Song <baohua@kernel.org>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Reviewed-by: Guenter Roeck <linux@roeck-us.net>

> ---
>  .../bindings/watchdog/sirfsoc_wdt.txt         |  18 --
>  drivers/watchdog/Kconfig                      |  10 -
>  drivers/watchdog/Makefile                     |   1 -
>  drivers/watchdog/sirfsoc_wdt.c                | 216 ------------------
>  4 files changed, 245 deletions(-)
>  delete mode 100644 Documentation/devicetree/bindings/watchdog/sirfsoc_wdt.txt
>  delete mode 100644 drivers/watchdog/sirfsoc_wdt.c
> 
> diff --git a/Documentation/devicetree/bindings/watchdog/sirfsoc_wdt.txt b/Documentation/devicetree/bindings/watchdog/sirfsoc_wdt.txt
> deleted file mode 100644
> index 0dce5e3100b4..000000000000
> --- a/Documentation/devicetree/bindings/watchdog/sirfsoc_wdt.txt
> +++ /dev/null
> @@ -1,18 +0,0 @@
> -SiRFSoC Timer and Watchdog Timer(WDT) Controller
> -
> -Required properties:
> -- compatible: "sirf,prima2-tick"
> -- reg: Address range of tick timer/WDT register set
> -- interrupts: interrupt number to the cpu
> -
> -Optional properties:
> -- timeout-sec : Contains the watchdog timeout in seconds
> -
> -Example:
> -
> -timer@b0020000 {
> -	compatible = "sirf,prima2-tick";
> -	reg = <0xb0020000 0x1000>;
> -	interrupts = <0>;
> -	timeout-sec = <30>;
> -};
> diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
> index 7ff941e71b79..88f4827849e4 100644
> --- a/drivers/watchdog/Kconfig
> +++ b/drivers/watchdog/Kconfig
> @@ -788,16 +788,6 @@ config MOXART_WDT
>  	  To compile this driver as a module, choose M here: the
>  	  module will be called moxart_wdt.
>  
> -config SIRFSOC_WATCHDOG
> -	tristate "SiRFSOC watchdog"
> -	depends on HAS_IOMEM
> -	depends on ARCH_SIRF || COMPILE_TEST
> -	select WATCHDOG_CORE
> -	default y
> -	help
> -	  Support for CSR SiRFprimaII and SiRFatlasVI watchdog. When
> -	  the watchdog triggers the system will be reset.
> -
>  config ST_LPC_WATCHDOG
>  	tristate "STMicroelectronics LPC Watchdog"
>  	depends on ARCH_STI || COMPILE_TEST
> diff --git a/drivers/watchdog/Makefile b/drivers/watchdog/Makefile
> index 5c74ee19d441..1741ed3c6ce6 100644
> --- a/drivers/watchdog/Makefile
> +++ b/drivers/watchdog/Makefile
> @@ -73,7 +73,6 @@ obj-$(CONFIG_UX500_WATCHDOG) += ux500_wdt.o
>  obj-$(CONFIG_RETU_WATCHDOG) += retu_wdt.o
>  obj-$(CONFIG_BCM2835_WDT) += bcm2835_wdt.o
>  obj-$(CONFIG_MOXART_WDT) += moxart_wdt.o
> -obj-$(CONFIG_SIRFSOC_WATCHDOG) += sirfsoc_wdt.o
>  obj-$(CONFIG_ST_LPC_WATCHDOG) += st_lpc_wdt.o
>  obj-$(CONFIG_QCOM_WDT) += qcom-wdt.o
>  obj-$(CONFIG_BCM_KONA_WDT) += bcm_kona_wdt.o
> diff --git a/drivers/watchdog/sirfsoc_wdt.c b/drivers/watchdog/sirfsoc_wdt.c
> deleted file mode 100644
> index 734cf2966ecb..000000000000
> --- a/drivers/watchdog/sirfsoc_wdt.c
> +++ /dev/null
> @@ -1,216 +0,0 @@
> -// SPDX-License-Identifier: GPL-2.0-or-later
> -/*
> - * Watchdog driver for CSR SiRFprimaII and SiRFatlasVI
> - *
> - * Copyright (c) 2013 Cambridge Silicon Radio Limited, a CSR plc group company.
> - */
> -
> -#include <linux/module.h>
> -#include <linux/watchdog.h>
> -#include <linux/platform_device.h>
> -#include <linux/moduleparam.h>
> -#include <linux/of.h>
> -#include <linux/io.h>
> -#include <linux/uaccess.h>
> -
> -#define CLOCK_FREQ	1000000
> -
> -#define SIRFSOC_TIMER_COUNTER_LO	0x0000
> -#define SIRFSOC_TIMER_MATCH_0		0x0008
> -#define SIRFSOC_TIMER_INT_EN		0x0024
> -#define SIRFSOC_TIMER_WATCHDOG_EN	0x0028
> -#define SIRFSOC_TIMER_LATCH		0x0030
> -#define SIRFSOC_TIMER_LATCHED_LO	0x0034
> -
> -#define SIRFSOC_TIMER_WDT_INDEX		5
> -
> -#define SIRFSOC_WDT_MIN_TIMEOUT		30		/* 30 secs */
> -#define SIRFSOC_WDT_MAX_TIMEOUT		(10 * 60)	/* 10 mins */
> -#define SIRFSOC_WDT_DEFAULT_TIMEOUT	30		/* 30 secs */
> -
> -static unsigned int timeout;
> -static bool nowayout = WATCHDOG_NOWAYOUT;
> -
> -module_param(timeout, uint, 0);
> -module_param(nowayout, bool, 0);
> -
> -MODULE_PARM_DESC(timeout, "Default watchdog timeout (in seconds)");
> -MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default="
> -			__MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
> -
> -static void __iomem *sirfsoc_wdt_base(struct watchdog_device *wdd)
> -{
> -	return (void __iomem __force *)watchdog_get_drvdata(wdd);
> -}
> -
> -static unsigned int sirfsoc_wdt_gettimeleft(struct watchdog_device *wdd)
> -{
> -	u32 counter, match;
> -	void __iomem *wdt_base;
> -	int time_left;
> -
> -	wdt_base = sirfsoc_wdt_base(wdd);
> -	counter = readl(wdt_base + SIRFSOC_TIMER_COUNTER_LO);
> -	match = readl(wdt_base +
> -		SIRFSOC_TIMER_MATCH_0 + (SIRFSOC_TIMER_WDT_INDEX << 2));
> -
> -	time_left = match - counter;
> -
> -	return time_left / CLOCK_FREQ;
> -}
> -
> -static int sirfsoc_wdt_updatetimeout(struct watchdog_device *wdd)
> -{
> -	u32 counter, timeout_ticks;
> -	void __iomem *wdt_base;
> -
> -	timeout_ticks = wdd->timeout * CLOCK_FREQ;
> -	wdt_base = sirfsoc_wdt_base(wdd);
> -
> -	/* Enable the latch before reading the LATCH_LO register */
> -	writel(1, wdt_base + SIRFSOC_TIMER_LATCH);
> -
> -	/* Set the TO value */
> -	counter = readl(wdt_base + SIRFSOC_TIMER_LATCHED_LO);
> -
> -	counter += timeout_ticks;
> -
> -	writel(counter, wdt_base +
> -		SIRFSOC_TIMER_MATCH_0 + (SIRFSOC_TIMER_WDT_INDEX << 2));
> -
> -	return 0;
> -}
> -
> -static int sirfsoc_wdt_enable(struct watchdog_device *wdd)
> -{
> -	void __iomem *wdt_base = sirfsoc_wdt_base(wdd);
> -	sirfsoc_wdt_updatetimeout(wdd);
> -
> -	/*
> -	 * NOTE: If interrupt is not enabled
> -	 * then WD-Reset doesn't get generated at all.
> -	 */
> -	writel(readl(wdt_base + SIRFSOC_TIMER_INT_EN)
> -		| (1 << SIRFSOC_TIMER_WDT_INDEX),
> -		wdt_base + SIRFSOC_TIMER_INT_EN);
> -	writel(1, wdt_base + SIRFSOC_TIMER_WATCHDOG_EN);
> -
> -	return 0;
> -}
> -
> -static int sirfsoc_wdt_disable(struct watchdog_device *wdd)
> -{
> -	void __iomem *wdt_base = sirfsoc_wdt_base(wdd);
> -
> -	writel(0, wdt_base + SIRFSOC_TIMER_WATCHDOG_EN);
> -	writel(readl(wdt_base + SIRFSOC_TIMER_INT_EN)
> -		& (~(1 << SIRFSOC_TIMER_WDT_INDEX)),
> -		wdt_base + SIRFSOC_TIMER_INT_EN);
> -
> -	return 0;
> -}
> -
> -static int sirfsoc_wdt_settimeout(struct watchdog_device *wdd, unsigned int to)
> -{
> -	wdd->timeout = to;
> -	sirfsoc_wdt_updatetimeout(wdd);
> -
> -	return 0;
> -}
> -
> -#define OPTIONS (WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING | WDIOF_MAGICCLOSE)
> -
> -static const struct watchdog_info sirfsoc_wdt_ident = {
> -	.options          =     OPTIONS,
> -	.firmware_version =	0,
> -	.identity         =	"SiRFSOC Watchdog",
> -};
> -
> -static const struct watchdog_ops sirfsoc_wdt_ops = {
> -	.owner = THIS_MODULE,
> -	.start = sirfsoc_wdt_enable,
> -	.stop = sirfsoc_wdt_disable,
> -	.get_timeleft = sirfsoc_wdt_gettimeleft,
> -	.ping = sirfsoc_wdt_updatetimeout,
> -	.set_timeout = sirfsoc_wdt_settimeout,
> -};
> -
> -static struct watchdog_device sirfsoc_wdd = {
> -	.info = &sirfsoc_wdt_ident,
> -	.ops = &sirfsoc_wdt_ops,
> -	.timeout = SIRFSOC_WDT_DEFAULT_TIMEOUT,
> -	.min_timeout = SIRFSOC_WDT_MIN_TIMEOUT,
> -	.max_timeout = SIRFSOC_WDT_MAX_TIMEOUT,
> -};
> -
> -static int sirfsoc_wdt_probe(struct platform_device *pdev)
> -{
> -	struct device *dev = &pdev->dev;
> -	int ret;
> -	void __iomem *base;
> -
> -	base = devm_platform_ioremap_resource(pdev, 0);
> -	if (IS_ERR(base))
> -		return PTR_ERR(base);
> -
> -	watchdog_set_drvdata(&sirfsoc_wdd, (__force void *)base);
> -
> -	watchdog_init_timeout(&sirfsoc_wdd, timeout, dev);
> -	watchdog_set_nowayout(&sirfsoc_wdd, nowayout);
> -	sirfsoc_wdd.parent = dev;
> -
> -	watchdog_stop_on_reboot(&sirfsoc_wdd);
> -	watchdog_stop_on_unregister(&sirfsoc_wdd);
> -	ret = devm_watchdog_register_device(dev, &sirfsoc_wdd);
> -	if (ret)
> -		return ret;
> -
> -	platform_set_drvdata(pdev, &sirfsoc_wdd);
> -
> -	return 0;
> -}
> -
> -#ifdef	CONFIG_PM_SLEEP
> -static int sirfsoc_wdt_suspend(struct device *dev)
> -{
> -	return 0;
> -}
> -
> -static int sirfsoc_wdt_resume(struct device *dev)
> -{
> -	struct watchdog_device *wdd = dev_get_drvdata(dev);
> -
> -	/*
> -	 * NOTE: Since timer controller registers settings are saved
> -	 * and restored back by the timer-prima2.c, so we need not
> -	 * update WD settings except refreshing timeout.
> -	 */
> -	sirfsoc_wdt_updatetimeout(wdd);
> -
> -	return 0;
> -}
> -#endif
> -
> -static SIMPLE_DEV_PM_OPS(sirfsoc_wdt_pm_ops,
> -		sirfsoc_wdt_suspend, sirfsoc_wdt_resume);
> -
> -static const struct of_device_id sirfsoc_wdt_of_match[] = {
> -	{ .compatible = "sirf,prima2-tick"},
> -	{},
> -};
> -MODULE_DEVICE_TABLE(of, sirfsoc_wdt_of_match);
> -
> -static struct platform_driver sirfsoc_wdt_driver = {
> -	.driver = {
> -		.name = "sirfsoc-wdt",
> -		.pm = &sirfsoc_wdt_pm_ops,
> -		.of_match_table	= sirfsoc_wdt_of_match,
> -	},
> -	.probe = sirfsoc_wdt_probe,
> -};
> -module_platform_driver(sirfsoc_wdt_driver);
> -
> -MODULE_DESCRIPTION("SiRF SoC watchdog driver");
> -MODULE_AUTHOR("Xianglong Du <Xianglong.Du@csr.com>");
> -MODULE_LICENSE("GPL v2");
> -MODULE_ALIAS("platform:sirfsoc-wdt");
> -- 
> 2.29.2
> 

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [PATCH 1/5] watchdog: remove sirf prima driver
@ 2021-01-20 19:03     ` Guenter Roeck
  0 siblings, 0 replies; 38+ messages in thread
From: Guenter Roeck @ 2021-01-20 19:03 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Barry Song, linux-watchdog, Arnd Bergmann, linux-kernel,
	Wim Van Sebroeck, linux-arm-kernel

On Wed, Jan 20, 2021 at 05:27:41PM +0100, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
> 
> The CSR SiRF prima2/atlas platforms are getting removed, so this driver
> is no longer needed.
> 
> Cc: Barry Song <baohua@kernel.org>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Reviewed-by: Guenter Roeck <linux@roeck-us.net>

> ---
>  .../bindings/watchdog/sirfsoc_wdt.txt         |  18 --
>  drivers/watchdog/Kconfig                      |  10 -
>  drivers/watchdog/Makefile                     |   1 -
>  drivers/watchdog/sirfsoc_wdt.c                | 216 ------------------
>  4 files changed, 245 deletions(-)
>  delete mode 100644 Documentation/devicetree/bindings/watchdog/sirfsoc_wdt.txt
>  delete mode 100644 drivers/watchdog/sirfsoc_wdt.c
> 
> diff --git a/Documentation/devicetree/bindings/watchdog/sirfsoc_wdt.txt b/Documentation/devicetree/bindings/watchdog/sirfsoc_wdt.txt
> deleted file mode 100644
> index 0dce5e3100b4..000000000000
> --- a/Documentation/devicetree/bindings/watchdog/sirfsoc_wdt.txt
> +++ /dev/null
> @@ -1,18 +0,0 @@
> -SiRFSoC Timer and Watchdog Timer(WDT) Controller
> -
> -Required properties:
> -- compatible: "sirf,prima2-tick"
> -- reg: Address range of tick timer/WDT register set
> -- interrupts: interrupt number to the cpu
> -
> -Optional properties:
> -- timeout-sec : Contains the watchdog timeout in seconds
> -
> -Example:
> -
> -timer@b0020000 {
> -	compatible = "sirf,prima2-tick";
> -	reg = <0xb0020000 0x1000>;
> -	interrupts = <0>;
> -	timeout-sec = <30>;
> -};
> diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
> index 7ff941e71b79..88f4827849e4 100644
> --- a/drivers/watchdog/Kconfig
> +++ b/drivers/watchdog/Kconfig
> @@ -788,16 +788,6 @@ config MOXART_WDT
>  	  To compile this driver as a module, choose M here: the
>  	  module will be called moxart_wdt.
>  
> -config SIRFSOC_WATCHDOG
> -	tristate "SiRFSOC watchdog"
> -	depends on HAS_IOMEM
> -	depends on ARCH_SIRF || COMPILE_TEST
> -	select WATCHDOG_CORE
> -	default y
> -	help
> -	  Support for CSR SiRFprimaII and SiRFatlasVI watchdog. When
> -	  the watchdog triggers the system will be reset.
> -
>  config ST_LPC_WATCHDOG
>  	tristate "STMicroelectronics LPC Watchdog"
>  	depends on ARCH_STI || COMPILE_TEST
> diff --git a/drivers/watchdog/Makefile b/drivers/watchdog/Makefile
> index 5c74ee19d441..1741ed3c6ce6 100644
> --- a/drivers/watchdog/Makefile
> +++ b/drivers/watchdog/Makefile
> @@ -73,7 +73,6 @@ obj-$(CONFIG_UX500_WATCHDOG) += ux500_wdt.o
>  obj-$(CONFIG_RETU_WATCHDOG) += retu_wdt.o
>  obj-$(CONFIG_BCM2835_WDT) += bcm2835_wdt.o
>  obj-$(CONFIG_MOXART_WDT) += moxart_wdt.o
> -obj-$(CONFIG_SIRFSOC_WATCHDOG) += sirfsoc_wdt.o
>  obj-$(CONFIG_ST_LPC_WATCHDOG) += st_lpc_wdt.o
>  obj-$(CONFIG_QCOM_WDT) += qcom-wdt.o
>  obj-$(CONFIG_BCM_KONA_WDT) += bcm_kona_wdt.o
> diff --git a/drivers/watchdog/sirfsoc_wdt.c b/drivers/watchdog/sirfsoc_wdt.c
> deleted file mode 100644
> index 734cf2966ecb..000000000000
> --- a/drivers/watchdog/sirfsoc_wdt.c
> +++ /dev/null
> @@ -1,216 +0,0 @@
> -// SPDX-License-Identifier: GPL-2.0-or-later
> -/*
> - * Watchdog driver for CSR SiRFprimaII and SiRFatlasVI
> - *
> - * Copyright (c) 2013 Cambridge Silicon Radio Limited, a CSR plc group company.
> - */
> -
> -#include <linux/module.h>
> -#include <linux/watchdog.h>
> -#include <linux/platform_device.h>
> -#include <linux/moduleparam.h>
> -#include <linux/of.h>
> -#include <linux/io.h>
> -#include <linux/uaccess.h>
> -
> -#define CLOCK_FREQ	1000000
> -
> -#define SIRFSOC_TIMER_COUNTER_LO	0x0000
> -#define SIRFSOC_TIMER_MATCH_0		0x0008
> -#define SIRFSOC_TIMER_INT_EN		0x0024
> -#define SIRFSOC_TIMER_WATCHDOG_EN	0x0028
> -#define SIRFSOC_TIMER_LATCH		0x0030
> -#define SIRFSOC_TIMER_LATCHED_LO	0x0034
> -
> -#define SIRFSOC_TIMER_WDT_INDEX		5
> -
> -#define SIRFSOC_WDT_MIN_TIMEOUT		30		/* 30 secs */
> -#define SIRFSOC_WDT_MAX_TIMEOUT		(10 * 60)	/* 10 mins */
> -#define SIRFSOC_WDT_DEFAULT_TIMEOUT	30		/* 30 secs */
> -
> -static unsigned int timeout;
> -static bool nowayout = WATCHDOG_NOWAYOUT;
> -
> -module_param(timeout, uint, 0);
> -module_param(nowayout, bool, 0);
> -
> -MODULE_PARM_DESC(timeout, "Default watchdog timeout (in seconds)");
> -MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default="
> -			__MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
> -
> -static void __iomem *sirfsoc_wdt_base(struct watchdog_device *wdd)
> -{
> -	return (void __iomem __force *)watchdog_get_drvdata(wdd);
> -}
> -
> -static unsigned int sirfsoc_wdt_gettimeleft(struct watchdog_device *wdd)
> -{
> -	u32 counter, match;
> -	void __iomem *wdt_base;
> -	int time_left;
> -
> -	wdt_base = sirfsoc_wdt_base(wdd);
> -	counter = readl(wdt_base + SIRFSOC_TIMER_COUNTER_LO);
> -	match = readl(wdt_base +
> -		SIRFSOC_TIMER_MATCH_0 + (SIRFSOC_TIMER_WDT_INDEX << 2));
> -
> -	time_left = match - counter;
> -
> -	return time_left / CLOCK_FREQ;
> -}
> -
> -static int sirfsoc_wdt_updatetimeout(struct watchdog_device *wdd)
> -{
> -	u32 counter, timeout_ticks;
> -	void __iomem *wdt_base;
> -
> -	timeout_ticks = wdd->timeout * CLOCK_FREQ;
> -	wdt_base = sirfsoc_wdt_base(wdd);
> -
> -	/* Enable the latch before reading the LATCH_LO register */
> -	writel(1, wdt_base + SIRFSOC_TIMER_LATCH);
> -
> -	/* Set the TO value */
> -	counter = readl(wdt_base + SIRFSOC_TIMER_LATCHED_LO);
> -
> -	counter += timeout_ticks;
> -
> -	writel(counter, wdt_base +
> -		SIRFSOC_TIMER_MATCH_0 + (SIRFSOC_TIMER_WDT_INDEX << 2));
> -
> -	return 0;
> -}
> -
> -static int sirfsoc_wdt_enable(struct watchdog_device *wdd)
> -{
> -	void __iomem *wdt_base = sirfsoc_wdt_base(wdd);
> -	sirfsoc_wdt_updatetimeout(wdd);
> -
> -	/*
> -	 * NOTE: If interrupt is not enabled
> -	 * then WD-Reset doesn't get generated at all.
> -	 */
> -	writel(readl(wdt_base + SIRFSOC_TIMER_INT_EN)
> -		| (1 << SIRFSOC_TIMER_WDT_INDEX),
> -		wdt_base + SIRFSOC_TIMER_INT_EN);
> -	writel(1, wdt_base + SIRFSOC_TIMER_WATCHDOG_EN);
> -
> -	return 0;
> -}
> -
> -static int sirfsoc_wdt_disable(struct watchdog_device *wdd)
> -{
> -	void __iomem *wdt_base = sirfsoc_wdt_base(wdd);
> -
> -	writel(0, wdt_base + SIRFSOC_TIMER_WATCHDOG_EN);
> -	writel(readl(wdt_base + SIRFSOC_TIMER_INT_EN)
> -		& (~(1 << SIRFSOC_TIMER_WDT_INDEX)),
> -		wdt_base + SIRFSOC_TIMER_INT_EN);
> -
> -	return 0;
> -}
> -
> -static int sirfsoc_wdt_settimeout(struct watchdog_device *wdd, unsigned int to)
> -{
> -	wdd->timeout = to;
> -	sirfsoc_wdt_updatetimeout(wdd);
> -
> -	return 0;
> -}
> -
> -#define OPTIONS (WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING | WDIOF_MAGICCLOSE)
> -
> -static const struct watchdog_info sirfsoc_wdt_ident = {
> -	.options          =     OPTIONS,
> -	.firmware_version =	0,
> -	.identity         =	"SiRFSOC Watchdog",
> -};
> -
> -static const struct watchdog_ops sirfsoc_wdt_ops = {
> -	.owner = THIS_MODULE,
> -	.start = sirfsoc_wdt_enable,
> -	.stop = sirfsoc_wdt_disable,
> -	.get_timeleft = sirfsoc_wdt_gettimeleft,
> -	.ping = sirfsoc_wdt_updatetimeout,
> -	.set_timeout = sirfsoc_wdt_settimeout,
> -};
> -
> -static struct watchdog_device sirfsoc_wdd = {
> -	.info = &sirfsoc_wdt_ident,
> -	.ops = &sirfsoc_wdt_ops,
> -	.timeout = SIRFSOC_WDT_DEFAULT_TIMEOUT,
> -	.min_timeout = SIRFSOC_WDT_MIN_TIMEOUT,
> -	.max_timeout = SIRFSOC_WDT_MAX_TIMEOUT,
> -};
> -
> -static int sirfsoc_wdt_probe(struct platform_device *pdev)
> -{
> -	struct device *dev = &pdev->dev;
> -	int ret;
> -	void __iomem *base;
> -
> -	base = devm_platform_ioremap_resource(pdev, 0);
> -	if (IS_ERR(base))
> -		return PTR_ERR(base);
> -
> -	watchdog_set_drvdata(&sirfsoc_wdd, (__force void *)base);
> -
> -	watchdog_init_timeout(&sirfsoc_wdd, timeout, dev);
> -	watchdog_set_nowayout(&sirfsoc_wdd, nowayout);
> -	sirfsoc_wdd.parent = dev;
> -
> -	watchdog_stop_on_reboot(&sirfsoc_wdd);
> -	watchdog_stop_on_unregister(&sirfsoc_wdd);
> -	ret = devm_watchdog_register_device(dev, &sirfsoc_wdd);
> -	if (ret)
> -		return ret;
> -
> -	platform_set_drvdata(pdev, &sirfsoc_wdd);
> -
> -	return 0;
> -}
> -
> -#ifdef	CONFIG_PM_SLEEP
> -static int sirfsoc_wdt_suspend(struct device *dev)
> -{
> -	return 0;
> -}
> -
> -static int sirfsoc_wdt_resume(struct device *dev)
> -{
> -	struct watchdog_device *wdd = dev_get_drvdata(dev);
> -
> -	/*
> -	 * NOTE: Since timer controller registers settings are saved
> -	 * and restored back by the timer-prima2.c, so we need not
> -	 * update WD settings except refreshing timeout.
> -	 */
> -	sirfsoc_wdt_updatetimeout(wdd);
> -
> -	return 0;
> -}
> -#endif
> -
> -static SIMPLE_DEV_PM_OPS(sirfsoc_wdt_pm_ops,
> -		sirfsoc_wdt_suspend, sirfsoc_wdt_resume);
> -
> -static const struct of_device_id sirfsoc_wdt_of_match[] = {
> -	{ .compatible = "sirf,prima2-tick"},
> -	{},
> -};
> -MODULE_DEVICE_TABLE(of, sirfsoc_wdt_of_match);
> -
> -static struct platform_driver sirfsoc_wdt_driver = {
> -	.driver = {
> -		.name = "sirfsoc-wdt",
> -		.pm = &sirfsoc_wdt_pm_ops,
> -		.of_match_table	= sirfsoc_wdt_of_match,
> -	},
> -	.probe = sirfsoc_wdt_probe,
> -};
> -module_platform_driver(sirfsoc_wdt_driver);
> -
> -MODULE_DESCRIPTION("SiRF SoC watchdog driver");
> -MODULE_AUTHOR("Xianglong Du <Xianglong.Du@csr.com>");
> -MODULE_LICENSE("GPL v2");
> -MODULE_ALIAS("platform:sirfsoc-wdt");
> -- 
> 2.29.2
> 

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [PATCH 2/5] watchdog: remove sirf atlas driver
  2021-01-20 16:27   ` Arnd Bergmann
@ 2021-01-20 19:03     ` Guenter Roeck
  -1 siblings, 0 replies; 38+ messages in thread
From: Guenter Roeck @ 2021-01-20 19:03 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: linux-arm-kernel, linux-kernel, linux-watchdog, Wim Van Sebroeck,
	Arnd Bergmann, Barry Song

On Wed, Jan 20, 2021 at 05:27:42PM +0100, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
> 
> The CSR SiRF prima2/atlas platforms are getting removed, so this driver
> is no longer needed.
> 
> Cc: Barry Song <baohua@kernel.org>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Reviewed-by: Guenter Roeck <linux@roeck-us.net>

> ---
>  drivers/watchdog/Kconfig      |  10 --
>  drivers/watchdog/Makefile     |   1 -
>  drivers/watchdog/atlas7_wdt.c | 221 ----------------------------------
>  3 files changed, 232 deletions(-)
>  delete mode 100644 drivers/watchdog/atlas7_wdt.c
> 
> diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
> index 88f4827849e4..5559e4325f6a 100644
> --- a/drivers/watchdog/Kconfig
> +++ b/drivers/watchdog/Kconfig
> @@ -890,16 +890,6 @@ config LPC18XX_WATCHDOG
>  	  To compile this driver as a module, choose M here: the
>  	  module will be called lpc18xx_wdt.
>  
> -config ATLAS7_WATCHDOG
> -	tristate "CSRatlas7 watchdog"
> -	depends on ARCH_ATLAS7 || COMPILE_TEST
> -	help
> -	  Say Y here to include Watchdog timer support for the watchdog
> -	  existing on the CSRatlas7 series platforms.
> -
> -	  To compile this driver as a module, choose M here: the
> -	  module will be called atlas7_wdt.
> -
>  config RENESAS_WDT
>  	tristate "Renesas WDT Watchdog"
>  	depends on ARCH_RENESAS || COMPILE_TEST
> diff --git a/drivers/watchdog/Makefile b/drivers/watchdog/Makefile
> index 1741ed3c6ce6..40b94403c487 100644
> --- a/drivers/watchdog/Makefile
> +++ b/drivers/watchdog/Makefile
> @@ -83,7 +83,6 @@ obj-$(CONFIG_MEDIATEK_WATCHDOG) += mtk_wdt.o
>  obj-$(CONFIG_DIGICOLOR_WATCHDOG) += digicolor_wdt.o
>  obj-$(CONFIG_LPC18XX_WATCHDOG) += lpc18xx_wdt.o
>  obj-$(CONFIG_BCM7038_WDT) += bcm7038_wdt.o
> -obj-$(CONFIG_ATLAS7_WATCHDOG) += atlas7_wdt.o
>  obj-$(CONFIG_RENESAS_WDT) += renesas_wdt.o
>  obj-$(CONFIG_RENESAS_RZAWDT) += rza_wdt.o
>  obj-$(CONFIG_ASPEED_WATCHDOG) += aspeed_wdt.o
> diff --git a/drivers/watchdog/atlas7_wdt.c b/drivers/watchdog/atlas7_wdt.c
> deleted file mode 100644
> index 9bfe650d802f..000000000000
> --- a/drivers/watchdog/atlas7_wdt.c
> +++ /dev/null
> @@ -1,221 +0,0 @@
> -// SPDX-License-Identifier: GPL-2.0-only
> -/*
> - * Watchdog driver for CSR Atlas7
> - *
> - * Copyright (c) 2015 Cambridge Silicon Radio Limited, a CSR plc group company.
> - */
> -
> -#include <linux/clk.h>
> -#include <linux/io.h>
> -#include <linux/module.h>
> -#include <linux/moduleparam.h>
> -#include <linux/of.h>
> -#include <linux/platform_device.h>
> -#include <linux/watchdog.h>
> -
> -#define ATLAS7_TIMER_WDT_INDEX		5
> -#define ATLAS7_WDT_DEFAULT_TIMEOUT	20
> -
> -#define ATLAS7_WDT_CNT_CTRL	(0 + 4 * ATLAS7_TIMER_WDT_INDEX)
> -#define ATLAS7_WDT_CNT_MATCH	(0x18 + 4 * ATLAS7_TIMER_WDT_INDEX)
> -#define ATLAS7_WDT_CNT		(0x48 +  4 * ATLAS7_TIMER_WDT_INDEX)
> -#define ATLAS7_WDT_CNT_EN	(BIT(0) | BIT(1))
> -#define ATLAS7_WDT_EN		0x64
> -
> -static unsigned int timeout = ATLAS7_WDT_DEFAULT_TIMEOUT;
> -static bool nowayout = WATCHDOG_NOWAYOUT;
> -
> -module_param(timeout, uint, 0);
> -module_param(nowayout, bool, 0);
> -
> -MODULE_PARM_DESC(timeout, "Default watchdog timeout (in seconds)");
> -MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default="
> -			__MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
> -
> -struct atlas7_wdog {
> -	struct device *dev;
> -	void __iomem *base;
> -	unsigned long tick_rate;
> -	struct clk *clk;
> -};
> -
> -static unsigned int atlas7_wdt_gettimeleft(struct watchdog_device *wdd)
> -{
> -	struct atlas7_wdog *wdt = watchdog_get_drvdata(wdd);
> -	u32 counter, match, delta;
> -
> -	counter = readl(wdt->base + ATLAS7_WDT_CNT);
> -	match = readl(wdt->base + ATLAS7_WDT_CNT_MATCH);
> -	delta = match - counter;
> -
> -	return  delta / wdt->tick_rate;
> -}
> -
> -static int atlas7_wdt_ping(struct watchdog_device *wdd)
> -{
> -	struct atlas7_wdog *wdt = watchdog_get_drvdata(wdd);
> -	u32 counter, match, delta;
> -
> -	counter = readl(wdt->base + ATLAS7_WDT_CNT);
> -	delta = wdd->timeout * wdt->tick_rate;
> -	match = counter + delta;
> -
> -	writel(match, wdt->base + ATLAS7_WDT_CNT_MATCH);
> -
> -	return 0;
> -}
> -
> -static int atlas7_wdt_enable(struct watchdog_device *wdd)
> -{
> -	struct atlas7_wdog *wdt = watchdog_get_drvdata(wdd);
> -
> -	atlas7_wdt_ping(wdd);
> -
> -	writel(readl(wdt->base + ATLAS7_WDT_CNT_CTRL) | ATLAS7_WDT_CNT_EN,
> -	      wdt->base + ATLAS7_WDT_CNT_CTRL);
> -	writel(1, wdt->base + ATLAS7_WDT_EN);
> -
> -	return 0;
> -}
> -
> -static int atlas7_wdt_disable(struct watchdog_device *wdd)
> -{
> -	struct atlas7_wdog *wdt = watchdog_get_drvdata(wdd);
> -
> -	writel(0, wdt->base + ATLAS7_WDT_EN);
> -	writel(readl(wdt->base + ATLAS7_WDT_CNT_CTRL) & ~ATLAS7_WDT_CNT_EN,
> -	      wdt->base + ATLAS7_WDT_CNT_CTRL);
> -
> -	return 0;
> -}
> -
> -static int atlas7_wdt_settimeout(struct watchdog_device *wdd, unsigned int to)
> -{
> -	wdd->timeout = to;
> -
> -	return 0;
> -}
> -
> -#define OPTIONS (WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING | WDIOF_MAGICCLOSE)
> -
> -static const struct watchdog_info atlas7_wdt_ident = {
> -	.options = OPTIONS,
> -	.firmware_version = 0,
> -	.identity = "atlas7 Watchdog",
> -};
> -
> -static const struct watchdog_ops atlas7_wdt_ops = {
> -	.owner = THIS_MODULE,
> -	.start = atlas7_wdt_enable,
> -	.stop = atlas7_wdt_disable,
> -	.get_timeleft = atlas7_wdt_gettimeleft,
> -	.ping = atlas7_wdt_ping,
> -	.set_timeout = atlas7_wdt_settimeout,
> -};
> -
> -static struct watchdog_device atlas7_wdd = {
> -	.info = &atlas7_wdt_ident,
> -	.ops = &atlas7_wdt_ops,
> -	.timeout = ATLAS7_WDT_DEFAULT_TIMEOUT,
> -};
> -
> -static const struct of_device_id atlas7_wdt_ids[] = {
> -	{ .compatible = "sirf,atlas7-tick"},
> -	{}
> -};
> -
> -static void atlas7_clk_disable_unprepare(void *data)
> -{
> -	clk_disable_unprepare(data);
> -}
> -
> -static int atlas7_wdt_probe(struct platform_device *pdev)
> -{
> -	struct device *dev = &pdev->dev;
> -	struct atlas7_wdog *wdt;
> -	struct clk *clk;
> -	int ret;
> -
> -	wdt = devm_kzalloc(dev, sizeof(*wdt), GFP_KERNEL);
> -	if (!wdt)
> -		return -ENOMEM;
> -	wdt->base = devm_platform_ioremap_resource(pdev, 0);
> -	if (IS_ERR(wdt->base))
> -		return PTR_ERR(wdt->base);
> -
> -	clk = devm_clk_get(dev, NULL);
> -	if (IS_ERR(clk))
> -		return PTR_ERR(clk);
> -	ret = clk_prepare_enable(clk);
> -	if (ret) {
> -		dev_err(dev, "clk enable failed\n");
> -		return ret;
> -	}
> -	ret = devm_add_action_or_reset(dev, atlas7_clk_disable_unprepare, clk);
> -	if (ret)
> -		return ret;
> -
> -	/* disable watchdog hardware */
> -	writel(0, wdt->base + ATLAS7_WDT_CNT_CTRL);
> -
> -	wdt->tick_rate = clk_get_rate(clk);
> -	if (!wdt->tick_rate)
> -		return -EINVAL;
> -
> -	wdt->clk = clk;
> -	atlas7_wdd.min_timeout = 1;
> -	atlas7_wdd.max_timeout = UINT_MAX / wdt->tick_rate;
> -
> -	watchdog_init_timeout(&atlas7_wdd, 0, dev);
> -	watchdog_set_nowayout(&atlas7_wdd, nowayout);
> -
> -	watchdog_set_drvdata(&atlas7_wdd, wdt);
> -	platform_set_drvdata(pdev, &atlas7_wdd);
> -
> -	watchdog_stop_on_reboot(&atlas7_wdd);
> -	watchdog_stop_on_unregister(&atlas7_wdd);
> -	return devm_watchdog_register_device(dev, &atlas7_wdd);
> -}
> -
> -static int __maybe_unused atlas7_wdt_suspend(struct device *dev)
> -{
> -	/*
> -	 * NOTE:timer controller registers settings are saved
> -	 * and restored back by the timer-atlas7.c
> -	 */
> -	return 0;
> -}
> -
> -static int __maybe_unused atlas7_wdt_resume(struct device *dev)
> -{
> -	struct watchdog_device *wdd = dev_get_drvdata(dev);
> -
> -	/*
> -	 * NOTE: Since timer controller registers settings are saved
> -	 * and restored back by the timer-atlas7.c, so we need not
> -	 * update WD settings except refreshing timeout.
> -	 */
> -	atlas7_wdt_ping(wdd);
> -
> -	return 0;
> -}
> -
> -static SIMPLE_DEV_PM_OPS(atlas7_wdt_pm_ops,
> -		atlas7_wdt_suspend, atlas7_wdt_resume);
> -
> -MODULE_DEVICE_TABLE(of, atlas7_wdt_ids);
> -
> -static struct platform_driver atlas7_wdt_driver = {
> -	.driver = {
> -		.name = "atlas7-wdt",
> -		.pm = &atlas7_wdt_pm_ops,
> -		.of_match_table	= atlas7_wdt_ids,
> -	},
> -	.probe = atlas7_wdt_probe,
> -};
> -module_platform_driver(atlas7_wdt_driver);
> -
> -MODULE_DESCRIPTION("CSRatlas7 watchdog driver");
> -MODULE_AUTHOR("Guo Zeng <Guo.Zeng@csr.com>");
> -MODULE_LICENSE("GPL v2");
> -MODULE_ALIAS("platform:atlas7-wdt");
> -- 
> 2.29.2
> 

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [PATCH 2/5] watchdog: remove sirf atlas driver
@ 2021-01-20 19:03     ` Guenter Roeck
  0 siblings, 0 replies; 38+ messages in thread
From: Guenter Roeck @ 2021-01-20 19:03 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Barry Song, linux-watchdog, Arnd Bergmann, linux-kernel,
	Wim Van Sebroeck, linux-arm-kernel

On Wed, Jan 20, 2021 at 05:27:42PM +0100, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
> 
> The CSR SiRF prima2/atlas platforms are getting removed, so this driver
> is no longer needed.
> 
> Cc: Barry Song <baohua@kernel.org>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Reviewed-by: Guenter Roeck <linux@roeck-us.net>

> ---
>  drivers/watchdog/Kconfig      |  10 --
>  drivers/watchdog/Makefile     |   1 -
>  drivers/watchdog/atlas7_wdt.c | 221 ----------------------------------
>  3 files changed, 232 deletions(-)
>  delete mode 100644 drivers/watchdog/atlas7_wdt.c
> 
> diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
> index 88f4827849e4..5559e4325f6a 100644
> --- a/drivers/watchdog/Kconfig
> +++ b/drivers/watchdog/Kconfig
> @@ -890,16 +890,6 @@ config LPC18XX_WATCHDOG
>  	  To compile this driver as a module, choose M here: the
>  	  module will be called lpc18xx_wdt.
>  
> -config ATLAS7_WATCHDOG
> -	tristate "CSRatlas7 watchdog"
> -	depends on ARCH_ATLAS7 || COMPILE_TEST
> -	help
> -	  Say Y here to include Watchdog timer support for the watchdog
> -	  existing on the CSRatlas7 series platforms.
> -
> -	  To compile this driver as a module, choose M here: the
> -	  module will be called atlas7_wdt.
> -
>  config RENESAS_WDT
>  	tristate "Renesas WDT Watchdog"
>  	depends on ARCH_RENESAS || COMPILE_TEST
> diff --git a/drivers/watchdog/Makefile b/drivers/watchdog/Makefile
> index 1741ed3c6ce6..40b94403c487 100644
> --- a/drivers/watchdog/Makefile
> +++ b/drivers/watchdog/Makefile
> @@ -83,7 +83,6 @@ obj-$(CONFIG_MEDIATEK_WATCHDOG) += mtk_wdt.o
>  obj-$(CONFIG_DIGICOLOR_WATCHDOG) += digicolor_wdt.o
>  obj-$(CONFIG_LPC18XX_WATCHDOG) += lpc18xx_wdt.o
>  obj-$(CONFIG_BCM7038_WDT) += bcm7038_wdt.o
> -obj-$(CONFIG_ATLAS7_WATCHDOG) += atlas7_wdt.o
>  obj-$(CONFIG_RENESAS_WDT) += renesas_wdt.o
>  obj-$(CONFIG_RENESAS_RZAWDT) += rza_wdt.o
>  obj-$(CONFIG_ASPEED_WATCHDOG) += aspeed_wdt.o
> diff --git a/drivers/watchdog/atlas7_wdt.c b/drivers/watchdog/atlas7_wdt.c
> deleted file mode 100644
> index 9bfe650d802f..000000000000
> --- a/drivers/watchdog/atlas7_wdt.c
> +++ /dev/null
> @@ -1,221 +0,0 @@
> -// SPDX-License-Identifier: GPL-2.0-only
> -/*
> - * Watchdog driver for CSR Atlas7
> - *
> - * Copyright (c) 2015 Cambridge Silicon Radio Limited, a CSR plc group company.
> - */
> -
> -#include <linux/clk.h>
> -#include <linux/io.h>
> -#include <linux/module.h>
> -#include <linux/moduleparam.h>
> -#include <linux/of.h>
> -#include <linux/platform_device.h>
> -#include <linux/watchdog.h>
> -
> -#define ATLAS7_TIMER_WDT_INDEX		5
> -#define ATLAS7_WDT_DEFAULT_TIMEOUT	20
> -
> -#define ATLAS7_WDT_CNT_CTRL	(0 + 4 * ATLAS7_TIMER_WDT_INDEX)
> -#define ATLAS7_WDT_CNT_MATCH	(0x18 + 4 * ATLAS7_TIMER_WDT_INDEX)
> -#define ATLAS7_WDT_CNT		(0x48 +  4 * ATLAS7_TIMER_WDT_INDEX)
> -#define ATLAS7_WDT_CNT_EN	(BIT(0) | BIT(1))
> -#define ATLAS7_WDT_EN		0x64
> -
> -static unsigned int timeout = ATLAS7_WDT_DEFAULT_TIMEOUT;
> -static bool nowayout = WATCHDOG_NOWAYOUT;
> -
> -module_param(timeout, uint, 0);
> -module_param(nowayout, bool, 0);
> -
> -MODULE_PARM_DESC(timeout, "Default watchdog timeout (in seconds)");
> -MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default="
> -			__MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
> -
> -struct atlas7_wdog {
> -	struct device *dev;
> -	void __iomem *base;
> -	unsigned long tick_rate;
> -	struct clk *clk;
> -};
> -
> -static unsigned int atlas7_wdt_gettimeleft(struct watchdog_device *wdd)
> -{
> -	struct atlas7_wdog *wdt = watchdog_get_drvdata(wdd);
> -	u32 counter, match, delta;
> -
> -	counter = readl(wdt->base + ATLAS7_WDT_CNT);
> -	match = readl(wdt->base + ATLAS7_WDT_CNT_MATCH);
> -	delta = match - counter;
> -
> -	return  delta / wdt->tick_rate;
> -}
> -
> -static int atlas7_wdt_ping(struct watchdog_device *wdd)
> -{
> -	struct atlas7_wdog *wdt = watchdog_get_drvdata(wdd);
> -	u32 counter, match, delta;
> -
> -	counter = readl(wdt->base + ATLAS7_WDT_CNT);
> -	delta = wdd->timeout * wdt->tick_rate;
> -	match = counter + delta;
> -
> -	writel(match, wdt->base + ATLAS7_WDT_CNT_MATCH);
> -
> -	return 0;
> -}
> -
> -static int atlas7_wdt_enable(struct watchdog_device *wdd)
> -{
> -	struct atlas7_wdog *wdt = watchdog_get_drvdata(wdd);
> -
> -	atlas7_wdt_ping(wdd);
> -
> -	writel(readl(wdt->base + ATLAS7_WDT_CNT_CTRL) | ATLAS7_WDT_CNT_EN,
> -	      wdt->base + ATLAS7_WDT_CNT_CTRL);
> -	writel(1, wdt->base + ATLAS7_WDT_EN);
> -
> -	return 0;
> -}
> -
> -static int atlas7_wdt_disable(struct watchdog_device *wdd)
> -{
> -	struct atlas7_wdog *wdt = watchdog_get_drvdata(wdd);
> -
> -	writel(0, wdt->base + ATLAS7_WDT_EN);
> -	writel(readl(wdt->base + ATLAS7_WDT_CNT_CTRL) & ~ATLAS7_WDT_CNT_EN,
> -	      wdt->base + ATLAS7_WDT_CNT_CTRL);
> -
> -	return 0;
> -}
> -
> -static int atlas7_wdt_settimeout(struct watchdog_device *wdd, unsigned int to)
> -{
> -	wdd->timeout = to;
> -
> -	return 0;
> -}
> -
> -#define OPTIONS (WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING | WDIOF_MAGICCLOSE)
> -
> -static const struct watchdog_info atlas7_wdt_ident = {
> -	.options = OPTIONS,
> -	.firmware_version = 0,
> -	.identity = "atlas7 Watchdog",
> -};
> -
> -static const struct watchdog_ops atlas7_wdt_ops = {
> -	.owner = THIS_MODULE,
> -	.start = atlas7_wdt_enable,
> -	.stop = atlas7_wdt_disable,
> -	.get_timeleft = atlas7_wdt_gettimeleft,
> -	.ping = atlas7_wdt_ping,
> -	.set_timeout = atlas7_wdt_settimeout,
> -};
> -
> -static struct watchdog_device atlas7_wdd = {
> -	.info = &atlas7_wdt_ident,
> -	.ops = &atlas7_wdt_ops,
> -	.timeout = ATLAS7_WDT_DEFAULT_TIMEOUT,
> -};
> -
> -static const struct of_device_id atlas7_wdt_ids[] = {
> -	{ .compatible = "sirf,atlas7-tick"},
> -	{}
> -};
> -
> -static void atlas7_clk_disable_unprepare(void *data)
> -{
> -	clk_disable_unprepare(data);
> -}
> -
> -static int atlas7_wdt_probe(struct platform_device *pdev)
> -{
> -	struct device *dev = &pdev->dev;
> -	struct atlas7_wdog *wdt;
> -	struct clk *clk;
> -	int ret;
> -
> -	wdt = devm_kzalloc(dev, sizeof(*wdt), GFP_KERNEL);
> -	if (!wdt)
> -		return -ENOMEM;
> -	wdt->base = devm_platform_ioremap_resource(pdev, 0);
> -	if (IS_ERR(wdt->base))
> -		return PTR_ERR(wdt->base);
> -
> -	clk = devm_clk_get(dev, NULL);
> -	if (IS_ERR(clk))
> -		return PTR_ERR(clk);
> -	ret = clk_prepare_enable(clk);
> -	if (ret) {
> -		dev_err(dev, "clk enable failed\n");
> -		return ret;
> -	}
> -	ret = devm_add_action_or_reset(dev, atlas7_clk_disable_unprepare, clk);
> -	if (ret)
> -		return ret;
> -
> -	/* disable watchdog hardware */
> -	writel(0, wdt->base + ATLAS7_WDT_CNT_CTRL);
> -
> -	wdt->tick_rate = clk_get_rate(clk);
> -	if (!wdt->tick_rate)
> -		return -EINVAL;
> -
> -	wdt->clk = clk;
> -	atlas7_wdd.min_timeout = 1;
> -	atlas7_wdd.max_timeout = UINT_MAX / wdt->tick_rate;
> -
> -	watchdog_init_timeout(&atlas7_wdd, 0, dev);
> -	watchdog_set_nowayout(&atlas7_wdd, nowayout);
> -
> -	watchdog_set_drvdata(&atlas7_wdd, wdt);
> -	platform_set_drvdata(pdev, &atlas7_wdd);
> -
> -	watchdog_stop_on_reboot(&atlas7_wdd);
> -	watchdog_stop_on_unregister(&atlas7_wdd);
> -	return devm_watchdog_register_device(dev, &atlas7_wdd);
> -}
> -
> -static int __maybe_unused atlas7_wdt_suspend(struct device *dev)
> -{
> -	/*
> -	 * NOTE:timer controller registers settings are saved
> -	 * and restored back by the timer-atlas7.c
> -	 */
> -	return 0;
> -}
> -
> -static int __maybe_unused atlas7_wdt_resume(struct device *dev)
> -{
> -	struct watchdog_device *wdd = dev_get_drvdata(dev);
> -
> -	/*
> -	 * NOTE: Since timer controller registers settings are saved
> -	 * and restored back by the timer-atlas7.c, so we need not
> -	 * update WD settings except refreshing timeout.
> -	 */
> -	atlas7_wdt_ping(wdd);
> -
> -	return 0;
> -}
> -
> -static SIMPLE_DEV_PM_OPS(atlas7_wdt_pm_ops,
> -		atlas7_wdt_suspend, atlas7_wdt_resume);
> -
> -MODULE_DEVICE_TABLE(of, atlas7_wdt_ids);
> -
> -static struct platform_driver atlas7_wdt_driver = {
> -	.driver = {
> -		.name = "atlas7-wdt",
> -		.pm = &atlas7_wdt_pm_ops,
> -		.of_match_table	= atlas7_wdt_ids,
> -	},
> -	.probe = atlas7_wdt_probe,
> -};
> -module_platform_driver(atlas7_wdt_driver);
> -
> -MODULE_DESCRIPTION("CSRatlas7 watchdog driver");
> -MODULE_AUTHOR("Guo Zeng <Guo.Zeng@csr.com>");
> -MODULE_LICENSE("GPL v2");
> -MODULE_ALIAS("platform:atlas7-wdt");
> -- 
> 2.29.2
> 

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [PATCH 3/5] watchdog: remove zte zx driver
  2021-01-20 16:27   ` Arnd Bergmann
@ 2021-01-20 19:03     ` Guenter Roeck
  -1 siblings, 0 replies; 38+ messages in thread
From: Guenter Roeck @ 2021-01-20 19:03 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: linux-arm-kernel, linux-kernel, linux-watchdog, Wim Van Sebroeck,
	Arnd Bergmann, Jun Nie, Shawn Guo

On Wed, Jan 20, 2021 at 05:27:43PM +0100, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
> 
> The zte zx platform is getting removed, so this driver is no
> longer needed.
> 
> Cc: Jun Nie <jun.nie@linaro.org>
> Cc: Shawn Guo <shawnguo@kernel.org>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Reviewed-by: Guenter Roeck <linux@roeck-us.net>

> ---
>  .../bindings/watchdog/zte,zx2967-wdt.txt      |  32 --
>  drivers/watchdog/Kconfig                      |  10 -
>  drivers/watchdog/Makefile                     |   1 -
>  drivers/watchdog/zx2967_wdt.c                 | 279 ------------------
>  4 files changed, 322 deletions(-)
>  delete mode 100644 Documentation/devicetree/bindings/watchdog/zte,zx2967-wdt.txt
>  delete mode 100644 drivers/watchdog/zx2967_wdt.c
> 
> diff --git a/Documentation/devicetree/bindings/watchdog/zte,zx2967-wdt.txt b/Documentation/devicetree/bindings/watchdog/zte,zx2967-wdt.txt
> deleted file mode 100644
> index 06ce67766756..000000000000
> --- a/Documentation/devicetree/bindings/watchdog/zte,zx2967-wdt.txt
> +++ /dev/null
> @@ -1,32 +0,0 @@
> -ZTE zx2967 Watchdog timer
> -
> -Required properties:
> -
> -- compatible : should be one of the following.
> -       * zte,zx296718-wdt
> -- reg : Specifies base physical address and size of the registers.
> -- clocks : Pairs of phandle and specifier referencing the controller's clocks.
> -- resets : Reference to the reset controller controlling the watchdog
> -           controller.
> -
> -Optional properties:
> -
> -- timeout-sec : Contains the watchdog timeout in seconds.
> -- zte,wdt-reset-sysctrl : Directs how to reset system by the watchdog.
> -	if we don't want to restart system when watchdog been triggered,
> -	it's not required, vice versa.
> -	It should include following fields.
> -	  * phandle of aon-sysctrl.
> -	  * offset of register that be written, should be 0xb0.
> -	  * configure value that be written to aon-sysctrl.
> -	  * bit mask, corresponding bits will be affected.
> -
> -Example:
> -
> -wdt: watchdog@1465000 {
> -	compatible = "zte,zx296718-wdt";
> -	reg = <0x1465000 0x1000>;
> -	clocks = <&topcrm WDT_WCLK>;
> -	resets = <&toprst 35>;
> -	zte,wdt-reset-sysctrl = <&aon_sysctrl 0xb0 1 0x115>;
> -};
> diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
> index 5559e4325f6a..c36f8233f60b 100644
> --- a/drivers/watchdog/Kconfig
> +++ b/drivers/watchdog/Kconfig
> @@ -919,16 +919,6 @@ config ASPEED_WATCHDOG
>  	  To compile this driver as a module, choose M here: the
>  	  module will be called aspeed_wdt.
>  
> -config ZX2967_WATCHDOG
> -	tristate "ZTE zx2967 SoCs watchdog support"
> -	depends on ARCH_ZX
> -	select WATCHDOG_CORE
> -	help
> -	  Say Y here to include support for the watchdog timer
> -	  in ZTE zx2967 SoCs.
> -	  To compile this driver as a module, choose M here: the
> -	  module will be called zx2967_wdt.
> -
>  config STM32_WATCHDOG
>  	tristate "STM32 Independent WatchDoG (IWDG) support"
>  	depends on ARCH_STM32
> diff --git a/drivers/watchdog/Makefile b/drivers/watchdog/Makefile
> index 40b94403c487..7a95b280cd9f 100644
> --- a/drivers/watchdog/Makefile
> +++ b/drivers/watchdog/Makefile
> @@ -86,7 +86,6 @@ obj-$(CONFIG_BCM7038_WDT) += bcm7038_wdt.o
>  obj-$(CONFIG_RENESAS_WDT) += renesas_wdt.o
>  obj-$(CONFIG_RENESAS_RZAWDT) += rza_wdt.o
>  obj-$(CONFIG_ASPEED_WATCHDOG) += aspeed_wdt.o
> -obj-$(CONFIG_ZX2967_WATCHDOG) += zx2967_wdt.o
>  obj-$(CONFIG_STM32_WATCHDOG) += stm32_iwdg.o
>  obj-$(CONFIG_UNIPHIER_WATCHDOG) += uniphier_wdt.o
>  obj-$(CONFIG_RTD119X_WATCHDOG) += rtd119x_wdt.o
> diff --git a/drivers/watchdog/zx2967_wdt.c b/drivers/watchdog/zx2967_wdt.c
> deleted file mode 100644
> index bf183e73671a..000000000000
> --- a/drivers/watchdog/zx2967_wdt.c
> +++ /dev/null
> @@ -1,279 +0,0 @@
> -// SPDX-License-Identifier: GPL-2.0-only
> -/*
> - * watchdog driver for ZTE's zx2967 family
> - *
> - * Copyright (C) 2017 ZTE Ltd.
> - *
> - * Author: Baoyou Xie <baoyou.xie@linaro.org>
> - */
> -
> -#include <linux/clk.h>
> -#include <linux/io.h>
> -#include <linux/mfd/syscon.h>
> -#include <linux/module.h>
> -#include <linux/of_address.h>
> -#include <linux/platform_device.h>
> -#include <linux/regmap.h>
> -#include <linux/reset.h>
> -#include <linux/watchdog.h>
> -
> -#define ZX2967_WDT_CFG_REG			0x4
> -#define ZX2967_WDT_LOAD_REG			0x8
> -#define ZX2967_WDT_REFRESH_REG			0x18
> -#define ZX2967_WDT_START_REG			0x1c
> -
> -#define ZX2967_WDT_REFRESH_MASK			GENMASK(5, 0)
> -
> -#define ZX2967_WDT_CFG_DIV(n)			((((n) & 0xff) - 1) << 8)
> -#define ZX2967_WDT_START_EN			0x1
> -
> -/*
> - * Hardware magic number.
> - * When watchdog reg is written, the lowest 16 bits are valid, but
> - * the highest 16 bits should be always this number.
> - */
> -#define ZX2967_WDT_WRITEKEY			(0x1234 << 16)
> -#define ZX2967_WDT_VAL_MASK			GENMASK(15, 0)
> -
> -#define ZX2967_WDT_DIV_DEFAULT			16
> -#define ZX2967_WDT_DEFAULT_TIMEOUT		32
> -#define ZX2967_WDT_MIN_TIMEOUT			1
> -#define ZX2967_WDT_MAX_TIMEOUT			524
> -#define ZX2967_WDT_MAX_COUNT			0xffff
> -
> -#define ZX2967_WDT_CLK_FREQ			0x8000
> -
> -#define ZX2967_WDT_FLAG_REBOOT_MON		BIT(0)
> -
> -struct zx2967_wdt {
> -	struct watchdog_device	wdt_device;
> -	void __iomem		*reg_base;
> -	struct clk		*clock;
> -};
> -
> -static inline u32 zx2967_wdt_readl(struct zx2967_wdt *wdt, u16 reg)
> -{
> -	return readl_relaxed(wdt->reg_base + reg);
> -}
> -
> -static inline void zx2967_wdt_writel(struct zx2967_wdt *wdt, u16 reg, u32 val)
> -{
> -	writel_relaxed(val | ZX2967_WDT_WRITEKEY, wdt->reg_base + reg);
> -}
> -
> -static void zx2967_wdt_refresh(struct zx2967_wdt *wdt)
> -{
> -	u32 val;
> -
> -	val = zx2967_wdt_readl(wdt, ZX2967_WDT_REFRESH_REG);
> -	/*
> -	 * Bit 4-5, 1 and 2: refresh config info
> -	 * Bit 2-3, 1 and 2: refresh counter
> -	 * Bit 0-1, 1 and 2: refresh int-value
> -	 * we shift each group value between 1 and 2 to refresh all data.
> -	 */
> -	val ^= ZX2967_WDT_REFRESH_MASK;
> -	zx2967_wdt_writel(wdt, ZX2967_WDT_REFRESH_REG,
> -			  val & ZX2967_WDT_VAL_MASK);
> -}
> -
> -static int
> -zx2967_wdt_set_timeout(struct watchdog_device *wdd, unsigned int timeout)
> -{
> -	struct zx2967_wdt *wdt = watchdog_get_drvdata(wdd);
> -	unsigned int divisor = ZX2967_WDT_DIV_DEFAULT;
> -	u32 count;
> -
> -	count = timeout * ZX2967_WDT_CLK_FREQ;
> -	if (count > divisor * ZX2967_WDT_MAX_COUNT)
> -		divisor = DIV_ROUND_UP(count, ZX2967_WDT_MAX_COUNT);
> -	count = DIV_ROUND_UP(count, divisor);
> -	zx2967_wdt_writel(wdt, ZX2967_WDT_CFG_REG,
> -			ZX2967_WDT_CFG_DIV(divisor) & ZX2967_WDT_VAL_MASK);
> -	zx2967_wdt_writel(wdt, ZX2967_WDT_LOAD_REG,
> -			count & ZX2967_WDT_VAL_MASK);
> -	zx2967_wdt_refresh(wdt);
> -	wdd->timeout =  (count * divisor) / ZX2967_WDT_CLK_FREQ;
> -
> -	return 0;
> -}
> -
> -static void __zx2967_wdt_start(struct zx2967_wdt *wdt)
> -{
> -	u32 val;
> -
> -	val = zx2967_wdt_readl(wdt, ZX2967_WDT_START_REG);
> -	val |= ZX2967_WDT_START_EN;
> -	zx2967_wdt_writel(wdt, ZX2967_WDT_START_REG,
> -			val & ZX2967_WDT_VAL_MASK);
> -}
> -
> -static void __zx2967_wdt_stop(struct zx2967_wdt *wdt)
> -{
> -	u32 val;
> -
> -	val = zx2967_wdt_readl(wdt, ZX2967_WDT_START_REG);
> -	val &= ~ZX2967_WDT_START_EN;
> -	zx2967_wdt_writel(wdt, ZX2967_WDT_START_REG,
> -			val & ZX2967_WDT_VAL_MASK);
> -}
> -
> -static int zx2967_wdt_start(struct watchdog_device *wdd)
> -{
> -	struct zx2967_wdt *wdt = watchdog_get_drvdata(wdd);
> -
> -	zx2967_wdt_set_timeout(wdd, wdd->timeout);
> -	__zx2967_wdt_start(wdt);
> -
> -	return 0;
> -}
> -
> -static int zx2967_wdt_stop(struct watchdog_device *wdd)
> -{
> -	struct zx2967_wdt *wdt = watchdog_get_drvdata(wdd);
> -
> -	__zx2967_wdt_stop(wdt);
> -
> -	return 0;
> -}
> -
> -static int zx2967_wdt_keepalive(struct watchdog_device *wdd)
> -{
> -	struct zx2967_wdt *wdt = watchdog_get_drvdata(wdd);
> -
> -	zx2967_wdt_refresh(wdt);
> -
> -	return 0;
> -}
> -
> -#define ZX2967_WDT_OPTIONS \
> -	(WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING | WDIOF_MAGICCLOSE)
> -static const struct watchdog_info zx2967_wdt_ident = {
> -	.options          =     ZX2967_WDT_OPTIONS,
> -	.identity         =	"zx2967 watchdog",
> -};
> -
> -static const struct watchdog_ops zx2967_wdt_ops = {
> -	.owner = THIS_MODULE,
> -	.start = zx2967_wdt_start,
> -	.stop = zx2967_wdt_stop,
> -	.ping = zx2967_wdt_keepalive,
> -	.set_timeout = zx2967_wdt_set_timeout,
> -};
> -
> -static void zx2967_wdt_reset_sysctrl(struct device *dev)
> -{
> -	int ret;
> -	void __iomem *regmap;
> -	unsigned int offset, mask, config;
> -	struct of_phandle_args out_args;
> -
> -	ret = of_parse_phandle_with_fixed_args(dev->of_node,
> -			"zte,wdt-reset-sysctrl", 3, 0, &out_args);
> -	if (ret)
> -		return;
> -
> -	offset = out_args.args[0];
> -	config = out_args.args[1];
> -	mask = out_args.args[2];
> -
> -	regmap = syscon_node_to_regmap(out_args.np);
> -	if (IS_ERR(regmap)) {
> -		of_node_put(out_args.np);
> -		return;
> -	}
> -
> -	regmap_update_bits(regmap, offset, mask, config);
> -	of_node_put(out_args.np);
> -}
> -
> -static void zx2967_clk_disable_unprepare(void *data)
> -{
> -	clk_disable_unprepare(data);
> -}
> -
> -static int zx2967_wdt_probe(struct platform_device *pdev)
> -{
> -	struct device *dev = &pdev->dev;
> -	struct zx2967_wdt *wdt;
> -	int ret;
> -	struct reset_control *rstc;
> -
> -	wdt = devm_kzalloc(dev, sizeof(*wdt), GFP_KERNEL);
> -	if (!wdt)
> -		return -ENOMEM;
> -
> -	platform_set_drvdata(pdev, wdt);
> -
> -	wdt->wdt_device.info = &zx2967_wdt_ident;
> -	wdt->wdt_device.ops = &zx2967_wdt_ops;
> -	wdt->wdt_device.timeout = ZX2967_WDT_DEFAULT_TIMEOUT;
> -	wdt->wdt_device.max_timeout = ZX2967_WDT_MAX_TIMEOUT;
> -	wdt->wdt_device.min_timeout = ZX2967_WDT_MIN_TIMEOUT;
> -	wdt->wdt_device.parent = dev;
> -
> -	wdt->reg_base = devm_platform_ioremap_resource(pdev, 0);
> -	if (IS_ERR(wdt->reg_base))
> -		return PTR_ERR(wdt->reg_base);
> -
> -	zx2967_wdt_reset_sysctrl(dev);
> -
> -	wdt->clock = devm_clk_get(dev, NULL);
> -	if (IS_ERR(wdt->clock)) {
> -		dev_err(dev, "failed to find watchdog clock source\n");
> -		return PTR_ERR(wdt->clock);
> -	}
> -
> -	ret = clk_prepare_enable(wdt->clock);
> -	if (ret < 0) {
> -		dev_err(dev, "failed to enable clock\n");
> -		return ret;
> -	}
> -	ret = devm_add_action_or_reset(dev, zx2967_clk_disable_unprepare,
> -				       wdt->clock);
> -	if (ret)
> -		return ret;
> -	clk_set_rate(wdt->clock, ZX2967_WDT_CLK_FREQ);
> -
> -	rstc = devm_reset_control_get_exclusive(dev, NULL);
> -	if (IS_ERR(rstc)) {
> -		dev_err(dev, "failed to get rstc");
> -		return PTR_ERR(rstc);
> -	}
> -
> -	reset_control_assert(rstc);
> -	reset_control_deassert(rstc);
> -
> -	watchdog_set_drvdata(&wdt->wdt_device, wdt);
> -	watchdog_init_timeout(&wdt->wdt_device,
> -			ZX2967_WDT_DEFAULT_TIMEOUT, dev);
> -	watchdog_set_nowayout(&wdt->wdt_device, WATCHDOG_NOWAYOUT);
> -
> -	ret = devm_watchdog_register_device(dev, &wdt->wdt_device);
> -	if (ret)
> -		return ret;
> -
> -	dev_info(dev, "watchdog enabled (timeout=%d sec, nowayout=%d)",
> -		 wdt->wdt_device.timeout, WATCHDOG_NOWAYOUT);
> -
> -	return 0;
> -}
> -
> -static const struct of_device_id zx2967_wdt_match[] = {
> -	{ .compatible = "zte,zx296718-wdt", },
> -	{}
> -};
> -MODULE_DEVICE_TABLE(of, zx2967_wdt_match);
> -
> -static struct platform_driver zx2967_wdt_driver = {
> -	.probe		= zx2967_wdt_probe,
> -	.driver		= {
> -		.name	= "zx2967-wdt",
> -		.of_match_table	= of_match_ptr(zx2967_wdt_match),
> -	},
> -};
> -module_platform_driver(zx2967_wdt_driver);
> -
> -MODULE_AUTHOR("Baoyou Xie <baoyou.xie@linaro.org>");
> -MODULE_DESCRIPTION("ZTE zx2967 Watchdog Device Driver");
> -MODULE_LICENSE("GPL v2");
> -- 
> 2.29.2
> 

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [PATCH 3/5] watchdog: remove zte zx driver
@ 2021-01-20 19:03     ` Guenter Roeck
  0 siblings, 0 replies; 38+ messages in thread
From: Guenter Roeck @ 2021-01-20 19:03 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: linux-watchdog, Arnd Bergmann, linux-kernel, Jun Nie,
	Wim Van Sebroeck, Shawn Guo, linux-arm-kernel

On Wed, Jan 20, 2021 at 05:27:43PM +0100, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
> 
> The zte zx platform is getting removed, so this driver is no
> longer needed.
> 
> Cc: Jun Nie <jun.nie@linaro.org>
> Cc: Shawn Guo <shawnguo@kernel.org>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Reviewed-by: Guenter Roeck <linux@roeck-us.net>

> ---
>  .../bindings/watchdog/zte,zx2967-wdt.txt      |  32 --
>  drivers/watchdog/Kconfig                      |  10 -
>  drivers/watchdog/Makefile                     |   1 -
>  drivers/watchdog/zx2967_wdt.c                 | 279 ------------------
>  4 files changed, 322 deletions(-)
>  delete mode 100644 Documentation/devicetree/bindings/watchdog/zte,zx2967-wdt.txt
>  delete mode 100644 drivers/watchdog/zx2967_wdt.c
> 
> diff --git a/Documentation/devicetree/bindings/watchdog/zte,zx2967-wdt.txt b/Documentation/devicetree/bindings/watchdog/zte,zx2967-wdt.txt
> deleted file mode 100644
> index 06ce67766756..000000000000
> --- a/Documentation/devicetree/bindings/watchdog/zte,zx2967-wdt.txt
> +++ /dev/null
> @@ -1,32 +0,0 @@
> -ZTE zx2967 Watchdog timer
> -
> -Required properties:
> -
> -- compatible : should be one of the following.
> -       * zte,zx296718-wdt
> -- reg : Specifies base physical address and size of the registers.
> -- clocks : Pairs of phandle and specifier referencing the controller's clocks.
> -- resets : Reference to the reset controller controlling the watchdog
> -           controller.
> -
> -Optional properties:
> -
> -- timeout-sec : Contains the watchdog timeout in seconds.
> -- zte,wdt-reset-sysctrl : Directs how to reset system by the watchdog.
> -	if we don't want to restart system when watchdog been triggered,
> -	it's not required, vice versa.
> -	It should include following fields.
> -	  * phandle of aon-sysctrl.
> -	  * offset of register that be written, should be 0xb0.
> -	  * configure value that be written to aon-sysctrl.
> -	  * bit mask, corresponding bits will be affected.
> -
> -Example:
> -
> -wdt: watchdog@1465000 {
> -	compatible = "zte,zx296718-wdt";
> -	reg = <0x1465000 0x1000>;
> -	clocks = <&topcrm WDT_WCLK>;
> -	resets = <&toprst 35>;
> -	zte,wdt-reset-sysctrl = <&aon_sysctrl 0xb0 1 0x115>;
> -};
> diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
> index 5559e4325f6a..c36f8233f60b 100644
> --- a/drivers/watchdog/Kconfig
> +++ b/drivers/watchdog/Kconfig
> @@ -919,16 +919,6 @@ config ASPEED_WATCHDOG
>  	  To compile this driver as a module, choose M here: the
>  	  module will be called aspeed_wdt.
>  
> -config ZX2967_WATCHDOG
> -	tristate "ZTE zx2967 SoCs watchdog support"
> -	depends on ARCH_ZX
> -	select WATCHDOG_CORE
> -	help
> -	  Say Y here to include support for the watchdog timer
> -	  in ZTE zx2967 SoCs.
> -	  To compile this driver as a module, choose M here: the
> -	  module will be called zx2967_wdt.
> -
>  config STM32_WATCHDOG
>  	tristate "STM32 Independent WatchDoG (IWDG) support"
>  	depends on ARCH_STM32
> diff --git a/drivers/watchdog/Makefile b/drivers/watchdog/Makefile
> index 40b94403c487..7a95b280cd9f 100644
> --- a/drivers/watchdog/Makefile
> +++ b/drivers/watchdog/Makefile
> @@ -86,7 +86,6 @@ obj-$(CONFIG_BCM7038_WDT) += bcm7038_wdt.o
>  obj-$(CONFIG_RENESAS_WDT) += renesas_wdt.o
>  obj-$(CONFIG_RENESAS_RZAWDT) += rza_wdt.o
>  obj-$(CONFIG_ASPEED_WATCHDOG) += aspeed_wdt.o
> -obj-$(CONFIG_ZX2967_WATCHDOG) += zx2967_wdt.o
>  obj-$(CONFIG_STM32_WATCHDOG) += stm32_iwdg.o
>  obj-$(CONFIG_UNIPHIER_WATCHDOG) += uniphier_wdt.o
>  obj-$(CONFIG_RTD119X_WATCHDOG) += rtd119x_wdt.o
> diff --git a/drivers/watchdog/zx2967_wdt.c b/drivers/watchdog/zx2967_wdt.c
> deleted file mode 100644
> index bf183e73671a..000000000000
> --- a/drivers/watchdog/zx2967_wdt.c
> +++ /dev/null
> @@ -1,279 +0,0 @@
> -// SPDX-License-Identifier: GPL-2.0-only
> -/*
> - * watchdog driver for ZTE's zx2967 family
> - *
> - * Copyright (C) 2017 ZTE Ltd.
> - *
> - * Author: Baoyou Xie <baoyou.xie@linaro.org>
> - */
> -
> -#include <linux/clk.h>
> -#include <linux/io.h>
> -#include <linux/mfd/syscon.h>
> -#include <linux/module.h>
> -#include <linux/of_address.h>
> -#include <linux/platform_device.h>
> -#include <linux/regmap.h>
> -#include <linux/reset.h>
> -#include <linux/watchdog.h>
> -
> -#define ZX2967_WDT_CFG_REG			0x4
> -#define ZX2967_WDT_LOAD_REG			0x8
> -#define ZX2967_WDT_REFRESH_REG			0x18
> -#define ZX2967_WDT_START_REG			0x1c
> -
> -#define ZX2967_WDT_REFRESH_MASK			GENMASK(5, 0)
> -
> -#define ZX2967_WDT_CFG_DIV(n)			((((n) & 0xff) - 1) << 8)
> -#define ZX2967_WDT_START_EN			0x1
> -
> -/*
> - * Hardware magic number.
> - * When watchdog reg is written, the lowest 16 bits are valid, but
> - * the highest 16 bits should be always this number.
> - */
> -#define ZX2967_WDT_WRITEKEY			(0x1234 << 16)
> -#define ZX2967_WDT_VAL_MASK			GENMASK(15, 0)
> -
> -#define ZX2967_WDT_DIV_DEFAULT			16
> -#define ZX2967_WDT_DEFAULT_TIMEOUT		32
> -#define ZX2967_WDT_MIN_TIMEOUT			1
> -#define ZX2967_WDT_MAX_TIMEOUT			524
> -#define ZX2967_WDT_MAX_COUNT			0xffff
> -
> -#define ZX2967_WDT_CLK_FREQ			0x8000
> -
> -#define ZX2967_WDT_FLAG_REBOOT_MON		BIT(0)
> -
> -struct zx2967_wdt {
> -	struct watchdog_device	wdt_device;
> -	void __iomem		*reg_base;
> -	struct clk		*clock;
> -};
> -
> -static inline u32 zx2967_wdt_readl(struct zx2967_wdt *wdt, u16 reg)
> -{
> -	return readl_relaxed(wdt->reg_base + reg);
> -}
> -
> -static inline void zx2967_wdt_writel(struct zx2967_wdt *wdt, u16 reg, u32 val)
> -{
> -	writel_relaxed(val | ZX2967_WDT_WRITEKEY, wdt->reg_base + reg);
> -}
> -
> -static void zx2967_wdt_refresh(struct zx2967_wdt *wdt)
> -{
> -	u32 val;
> -
> -	val = zx2967_wdt_readl(wdt, ZX2967_WDT_REFRESH_REG);
> -	/*
> -	 * Bit 4-5, 1 and 2: refresh config info
> -	 * Bit 2-3, 1 and 2: refresh counter
> -	 * Bit 0-1, 1 and 2: refresh int-value
> -	 * we shift each group value between 1 and 2 to refresh all data.
> -	 */
> -	val ^= ZX2967_WDT_REFRESH_MASK;
> -	zx2967_wdt_writel(wdt, ZX2967_WDT_REFRESH_REG,
> -			  val & ZX2967_WDT_VAL_MASK);
> -}
> -
> -static int
> -zx2967_wdt_set_timeout(struct watchdog_device *wdd, unsigned int timeout)
> -{
> -	struct zx2967_wdt *wdt = watchdog_get_drvdata(wdd);
> -	unsigned int divisor = ZX2967_WDT_DIV_DEFAULT;
> -	u32 count;
> -
> -	count = timeout * ZX2967_WDT_CLK_FREQ;
> -	if (count > divisor * ZX2967_WDT_MAX_COUNT)
> -		divisor = DIV_ROUND_UP(count, ZX2967_WDT_MAX_COUNT);
> -	count = DIV_ROUND_UP(count, divisor);
> -	zx2967_wdt_writel(wdt, ZX2967_WDT_CFG_REG,
> -			ZX2967_WDT_CFG_DIV(divisor) & ZX2967_WDT_VAL_MASK);
> -	zx2967_wdt_writel(wdt, ZX2967_WDT_LOAD_REG,
> -			count & ZX2967_WDT_VAL_MASK);
> -	zx2967_wdt_refresh(wdt);
> -	wdd->timeout =  (count * divisor) / ZX2967_WDT_CLK_FREQ;
> -
> -	return 0;
> -}
> -
> -static void __zx2967_wdt_start(struct zx2967_wdt *wdt)
> -{
> -	u32 val;
> -
> -	val = zx2967_wdt_readl(wdt, ZX2967_WDT_START_REG);
> -	val |= ZX2967_WDT_START_EN;
> -	zx2967_wdt_writel(wdt, ZX2967_WDT_START_REG,
> -			val & ZX2967_WDT_VAL_MASK);
> -}
> -
> -static void __zx2967_wdt_stop(struct zx2967_wdt *wdt)
> -{
> -	u32 val;
> -
> -	val = zx2967_wdt_readl(wdt, ZX2967_WDT_START_REG);
> -	val &= ~ZX2967_WDT_START_EN;
> -	zx2967_wdt_writel(wdt, ZX2967_WDT_START_REG,
> -			val & ZX2967_WDT_VAL_MASK);
> -}
> -
> -static int zx2967_wdt_start(struct watchdog_device *wdd)
> -{
> -	struct zx2967_wdt *wdt = watchdog_get_drvdata(wdd);
> -
> -	zx2967_wdt_set_timeout(wdd, wdd->timeout);
> -	__zx2967_wdt_start(wdt);
> -
> -	return 0;
> -}
> -
> -static int zx2967_wdt_stop(struct watchdog_device *wdd)
> -{
> -	struct zx2967_wdt *wdt = watchdog_get_drvdata(wdd);
> -
> -	__zx2967_wdt_stop(wdt);
> -
> -	return 0;
> -}
> -
> -static int zx2967_wdt_keepalive(struct watchdog_device *wdd)
> -{
> -	struct zx2967_wdt *wdt = watchdog_get_drvdata(wdd);
> -
> -	zx2967_wdt_refresh(wdt);
> -
> -	return 0;
> -}
> -
> -#define ZX2967_WDT_OPTIONS \
> -	(WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING | WDIOF_MAGICCLOSE)
> -static const struct watchdog_info zx2967_wdt_ident = {
> -	.options          =     ZX2967_WDT_OPTIONS,
> -	.identity         =	"zx2967 watchdog",
> -};
> -
> -static const struct watchdog_ops zx2967_wdt_ops = {
> -	.owner = THIS_MODULE,
> -	.start = zx2967_wdt_start,
> -	.stop = zx2967_wdt_stop,
> -	.ping = zx2967_wdt_keepalive,
> -	.set_timeout = zx2967_wdt_set_timeout,
> -};
> -
> -static void zx2967_wdt_reset_sysctrl(struct device *dev)
> -{
> -	int ret;
> -	void __iomem *regmap;
> -	unsigned int offset, mask, config;
> -	struct of_phandle_args out_args;
> -
> -	ret = of_parse_phandle_with_fixed_args(dev->of_node,
> -			"zte,wdt-reset-sysctrl", 3, 0, &out_args);
> -	if (ret)
> -		return;
> -
> -	offset = out_args.args[0];
> -	config = out_args.args[1];
> -	mask = out_args.args[2];
> -
> -	regmap = syscon_node_to_regmap(out_args.np);
> -	if (IS_ERR(regmap)) {
> -		of_node_put(out_args.np);
> -		return;
> -	}
> -
> -	regmap_update_bits(regmap, offset, mask, config);
> -	of_node_put(out_args.np);
> -}
> -
> -static void zx2967_clk_disable_unprepare(void *data)
> -{
> -	clk_disable_unprepare(data);
> -}
> -
> -static int zx2967_wdt_probe(struct platform_device *pdev)
> -{
> -	struct device *dev = &pdev->dev;
> -	struct zx2967_wdt *wdt;
> -	int ret;
> -	struct reset_control *rstc;
> -
> -	wdt = devm_kzalloc(dev, sizeof(*wdt), GFP_KERNEL);
> -	if (!wdt)
> -		return -ENOMEM;
> -
> -	platform_set_drvdata(pdev, wdt);
> -
> -	wdt->wdt_device.info = &zx2967_wdt_ident;
> -	wdt->wdt_device.ops = &zx2967_wdt_ops;
> -	wdt->wdt_device.timeout = ZX2967_WDT_DEFAULT_TIMEOUT;
> -	wdt->wdt_device.max_timeout = ZX2967_WDT_MAX_TIMEOUT;
> -	wdt->wdt_device.min_timeout = ZX2967_WDT_MIN_TIMEOUT;
> -	wdt->wdt_device.parent = dev;
> -
> -	wdt->reg_base = devm_platform_ioremap_resource(pdev, 0);
> -	if (IS_ERR(wdt->reg_base))
> -		return PTR_ERR(wdt->reg_base);
> -
> -	zx2967_wdt_reset_sysctrl(dev);
> -
> -	wdt->clock = devm_clk_get(dev, NULL);
> -	if (IS_ERR(wdt->clock)) {
> -		dev_err(dev, "failed to find watchdog clock source\n");
> -		return PTR_ERR(wdt->clock);
> -	}
> -
> -	ret = clk_prepare_enable(wdt->clock);
> -	if (ret < 0) {
> -		dev_err(dev, "failed to enable clock\n");
> -		return ret;
> -	}
> -	ret = devm_add_action_or_reset(dev, zx2967_clk_disable_unprepare,
> -				       wdt->clock);
> -	if (ret)
> -		return ret;
> -	clk_set_rate(wdt->clock, ZX2967_WDT_CLK_FREQ);
> -
> -	rstc = devm_reset_control_get_exclusive(dev, NULL);
> -	if (IS_ERR(rstc)) {
> -		dev_err(dev, "failed to get rstc");
> -		return PTR_ERR(rstc);
> -	}
> -
> -	reset_control_assert(rstc);
> -	reset_control_deassert(rstc);
> -
> -	watchdog_set_drvdata(&wdt->wdt_device, wdt);
> -	watchdog_init_timeout(&wdt->wdt_device,
> -			ZX2967_WDT_DEFAULT_TIMEOUT, dev);
> -	watchdog_set_nowayout(&wdt->wdt_device, WATCHDOG_NOWAYOUT);
> -
> -	ret = devm_watchdog_register_device(dev, &wdt->wdt_device);
> -	if (ret)
> -		return ret;
> -
> -	dev_info(dev, "watchdog enabled (timeout=%d sec, nowayout=%d)",
> -		 wdt->wdt_device.timeout, WATCHDOG_NOWAYOUT);
> -
> -	return 0;
> -}
> -
> -static const struct of_device_id zx2967_wdt_match[] = {
> -	{ .compatible = "zte,zx296718-wdt", },
> -	{}
> -};
> -MODULE_DEVICE_TABLE(of, zx2967_wdt_match);
> -
> -static struct platform_driver zx2967_wdt_driver = {
> -	.probe		= zx2967_wdt_probe,
> -	.driver		= {
> -		.name	= "zx2967-wdt",
> -		.of_match_table	= of_match_ptr(zx2967_wdt_match),
> -	},
> -};
> -module_platform_driver(zx2967_wdt_driver);
> -
> -MODULE_AUTHOR("Baoyou Xie <baoyou.xie@linaro.org>");
> -MODULE_DESCRIPTION("ZTE zx2967 Watchdog Device Driver");
> -MODULE_LICENSE("GPL v2");
> -- 
> 2.29.2
> 

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [PATCH 4/5] watchdog: remove tango driver
  2021-01-20 16:27   ` Arnd Bergmann
@ 2021-01-20 19:03     ` Guenter Roeck
  -1 siblings, 0 replies; 38+ messages in thread
From: Guenter Roeck @ 2021-01-20 19:03 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: linux-arm-kernel, linux-kernel, linux-watchdog, Wim Van Sebroeck,
	Arnd Bergmann, Marc Gonzalez, Mans Rullgard

On Wed, Jan 20, 2021 at 05:27:44PM +0100, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
> 
> The tango platform is getting removed, so the driver is no
> longer needed.
> 
> Cc: Marc Gonzalez <marc.w.gonzalez@free.fr>
> Cc: Mans Rullgard <mans@mansr.com>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Reviewed-by: Guenter Roeck <linux@roeck-us.net>

> ---
>  drivers/watchdog/Kconfig      |  11 --
>  drivers/watchdog/Makefile     |   1 -
>  drivers/watchdog/tangox_wdt.c | 209 ----------------------------------
>  3 files changed, 221 deletions(-)
>  delete mode 100644 drivers/watchdog/tangox_wdt.c
> 
> diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
> index c36f8233f60b..10efbb351f14 100644
> --- a/drivers/watchdog/Kconfig
> +++ b/drivers/watchdog/Kconfig
> @@ -254,17 +254,6 @@ config MENZ069_WATCHDOG
>  	  This driver can also be built as a module. If so the module
>  	  will be called menz069_wdt.
>  
> -config TANGOX_WATCHDOG
> -	tristate "Sigma Designs SMP86xx/SMP87xx watchdog"
> -	select WATCHDOG_CORE
> -	depends on ARCH_TANGO || COMPILE_TEST
> -	depends on HAS_IOMEM
> -	help
> -	  Support for the watchdog in Sigma Designs SMP86xx (tango3)
> -	  and SMP87xx (tango4) family chips.
> -
> -	  This driver can be built as a module. The module name is tangox_wdt.
> -
>  config WDAT_WDT
>  	tristate "ACPI Watchdog Action Table (WDAT)"
>  	depends on ACPI
> diff --git a/drivers/watchdog/Makefile b/drivers/watchdog/Makefile
> index 7a95b280cd9f..1ff40d6a027f 100644
> --- a/drivers/watchdog/Makefile
> +++ b/drivers/watchdog/Makefile
> @@ -210,7 +210,6 @@ obj-$(CONFIG_DA9055_WATCHDOG) += da9055_wdt.o
>  obj-$(CONFIG_DA9062_WATCHDOG) += da9062_wdt.o
>  obj-$(CONFIG_DA9063_WATCHDOG) += da9063_wdt.o
>  obj-$(CONFIG_GPIO_WATCHDOG)	+= gpio_wdt.o
> -obj-$(CONFIG_TANGOX_WATCHDOG) += tangox_wdt.o
>  obj-$(CONFIG_WDAT_WDT) += wdat_wdt.o
>  obj-$(CONFIG_WM831X_WATCHDOG) += wm831x_wdt.o
>  obj-$(CONFIG_WM8350_WATCHDOG) += wm8350_wdt.o
> diff --git a/drivers/watchdog/tangox_wdt.c b/drivers/watchdog/tangox_wdt.c
> deleted file mode 100644
> index 1afb0e9d808c..000000000000
> --- a/drivers/watchdog/tangox_wdt.c
> +++ /dev/null
> @@ -1,209 +0,0 @@
> -// SPDX-License-Identifier: GPL-2.0+
> -/*
> - *  Copyright (C) 2015 Mans Rullgard <mans@mansr.com>
> - *  SMP86xx/SMP87xx Watchdog driver
> - */
> -
> -#include <linux/bitops.h>
> -#include <linux/clk.h>
> -#include <linux/delay.h>
> -#include <linux/io.h>
> -#include <linux/kernel.h>
> -#include <linux/module.h>
> -#include <linux/moduleparam.h>
> -#include <linux/mod_devicetable.h>
> -#include <linux/platform_device.h>
> -#include <linux/watchdog.h>
> -
> -#define DEFAULT_TIMEOUT 30
> -
> -static bool nowayout = WATCHDOG_NOWAYOUT;
> -module_param(nowayout, bool, 0);
> -MODULE_PARM_DESC(nowayout,
> -		 "Watchdog cannot be stopped once started (default="
> -		 __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
> -
> -static unsigned int timeout;
> -module_param(timeout, int, 0);
> -MODULE_PARM_DESC(timeout, "Watchdog timeout");
> -
> -/*
> - * Counter counts down from programmed value.  Reset asserts when
> - * the counter reaches 1.
> - */
> -#define WD_COUNTER		0
> -
> -#define WD_CONFIG		4
> -#define WD_CONFIG_XTAL_IN	BIT(0)
> -#define WD_CONFIG_DISABLE	BIT(31)
> -
> -struct tangox_wdt_device {
> -	struct watchdog_device wdt;
> -	void __iomem *base;
> -	unsigned long clk_rate;
> -	struct clk *clk;
> -};
> -
> -static int tangox_wdt_set_timeout(struct watchdog_device *wdt,
> -				  unsigned int new_timeout)
> -{
> -	wdt->timeout = new_timeout;
> -
> -	return 0;
> -}
> -
> -static int tangox_wdt_start(struct watchdog_device *wdt)
> -{
> -	struct tangox_wdt_device *dev = watchdog_get_drvdata(wdt);
> -	u32 ticks;
> -
> -	ticks = 1 + wdt->timeout * dev->clk_rate;
> -	writel(ticks, dev->base + WD_COUNTER);
> -
> -	return 0;
> -}
> -
> -static int tangox_wdt_stop(struct watchdog_device *wdt)
> -{
> -	struct tangox_wdt_device *dev = watchdog_get_drvdata(wdt);
> -
> -	writel(0, dev->base + WD_COUNTER);
> -
> -	return 0;
> -}
> -
> -static unsigned int tangox_wdt_get_timeleft(struct watchdog_device *wdt)
> -{
> -	struct tangox_wdt_device *dev = watchdog_get_drvdata(wdt);
> -	u32 count;
> -
> -	count = readl(dev->base + WD_COUNTER);
> -
> -	if (!count)
> -		return 0;
> -
> -	return (count - 1) / dev->clk_rate;
> -}
> -
> -static const struct watchdog_info tangox_wdt_info = {
> -	.options  = WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING | WDIOF_MAGICCLOSE,
> -	.identity = "tangox watchdog",
> -};
> -
> -static int tangox_wdt_restart(struct watchdog_device *wdt,
> -			      unsigned long action, void *data)
> -{
> -	struct tangox_wdt_device *dev = watchdog_get_drvdata(wdt);
> -
> -	writel(1, dev->base + WD_COUNTER);
> -
> -	return 0;
> -}
> -
> -static const struct watchdog_ops tangox_wdt_ops = {
> -	.start		= tangox_wdt_start,
> -	.stop		= tangox_wdt_stop,
> -	.set_timeout	= tangox_wdt_set_timeout,
> -	.get_timeleft	= tangox_wdt_get_timeleft,
> -	.restart	= tangox_wdt_restart,
> -};
> -
> -static void tangox_clk_disable_unprepare(void *data)
> -{
> -	clk_disable_unprepare(data);
> -}
> -
> -static int tangox_wdt_probe(struct platform_device *pdev)
> -{
> -	struct tangox_wdt_device *dev;
> -	u32 config;
> -	int err;
> -
> -	dev = devm_kzalloc(&pdev->dev, sizeof(*dev), GFP_KERNEL);
> -	if (!dev)
> -		return -ENOMEM;
> -
> -	dev->base = devm_platform_ioremap_resource(pdev, 0);
> -	if (IS_ERR(dev->base))
> -		return PTR_ERR(dev->base);
> -
> -	dev->clk = devm_clk_get(&pdev->dev, NULL);
> -	if (IS_ERR(dev->clk))
> -		return PTR_ERR(dev->clk);
> -
> -	err = clk_prepare_enable(dev->clk);
> -	if (err)
> -		return err;
> -	err = devm_add_action_or_reset(&pdev->dev,
> -				       tangox_clk_disable_unprepare, dev->clk);
> -	if (err)
> -		return err;
> -
> -	dev->clk_rate = clk_get_rate(dev->clk);
> -	if (!dev->clk_rate)
> -		return -EINVAL;
> -
> -	dev->wdt.parent = &pdev->dev;
> -	dev->wdt.info = &tangox_wdt_info;
> -	dev->wdt.ops = &tangox_wdt_ops;
> -	dev->wdt.timeout = DEFAULT_TIMEOUT;
> -	dev->wdt.min_timeout = 1;
> -	dev->wdt.max_hw_heartbeat_ms = (U32_MAX - 1) / dev->clk_rate;
> -
> -	watchdog_init_timeout(&dev->wdt, timeout, &pdev->dev);
> -	watchdog_set_nowayout(&dev->wdt, nowayout);
> -	watchdog_set_drvdata(&dev->wdt, dev);
> -
> -	/*
> -	 * Deactivate counter if disable bit is set to avoid
> -	 * accidental reset.
> -	 */
> -	config = readl(dev->base + WD_CONFIG);
> -	if (config & WD_CONFIG_DISABLE)
> -		writel(0, dev->base + WD_COUNTER);
> -
> -	writel(WD_CONFIG_XTAL_IN, dev->base + WD_CONFIG);
> -
> -	/*
> -	 * Mark as active and restart with configured timeout if
> -	 * already running.
> -	 */
> -	if (readl(dev->base + WD_COUNTER)) {
> -		set_bit(WDOG_HW_RUNNING, &dev->wdt.status);
> -		tangox_wdt_start(&dev->wdt);
> -	}
> -
> -	watchdog_set_restart_priority(&dev->wdt, 128);
> -
> -	watchdog_stop_on_unregister(&dev->wdt);
> -	err = devm_watchdog_register_device(&pdev->dev, &dev->wdt);
> -	if (err)
> -		return err;
> -
> -	platform_set_drvdata(pdev, dev);
> -
> -	dev_info(&pdev->dev, "SMP86xx/SMP87xx watchdog registered\n");
> -
> -	return 0;
> -}
> -
> -static const struct of_device_id tangox_wdt_dt_ids[] = {
> -	{ .compatible = "sigma,smp8642-wdt" },
> -	{ .compatible = "sigma,smp8759-wdt" },
> -	{ }
> -};
> -MODULE_DEVICE_TABLE(of, tangox_wdt_dt_ids);
> -
> -static struct platform_driver tangox_wdt_driver = {
> -	.probe	= tangox_wdt_probe,
> -	.driver	= {
> -		.name		= "tangox-wdt",
> -		.of_match_table	= tangox_wdt_dt_ids,
> -	},
> -};
> -
> -module_platform_driver(tangox_wdt_driver);
> -
> -MODULE_AUTHOR("Mans Rullgard <mans@mansr.com>");
> -MODULE_DESCRIPTION("SMP86xx/SMP87xx Watchdog driver");
> -MODULE_LICENSE("GPL");
> -- 
> 2.29.2
> 

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [PATCH 4/5] watchdog: remove tango driver
@ 2021-01-20 19:03     ` Guenter Roeck
  0 siblings, 0 replies; 38+ messages in thread
From: Guenter Roeck @ 2021-01-20 19:03 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Mans Rullgard, linux-watchdog, Arnd Bergmann, Marc Gonzalez,
	linux-kernel, Wim Van Sebroeck, linux-arm-kernel

On Wed, Jan 20, 2021 at 05:27:44PM +0100, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
> 
> The tango platform is getting removed, so the driver is no
> longer needed.
> 
> Cc: Marc Gonzalez <marc.w.gonzalez@free.fr>
> Cc: Mans Rullgard <mans@mansr.com>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Reviewed-by: Guenter Roeck <linux@roeck-us.net>

> ---
>  drivers/watchdog/Kconfig      |  11 --
>  drivers/watchdog/Makefile     |   1 -
>  drivers/watchdog/tangox_wdt.c | 209 ----------------------------------
>  3 files changed, 221 deletions(-)
>  delete mode 100644 drivers/watchdog/tangox_wdt.c
> 
> diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
> index c36f8233f60b..10efbb351f14 100644
> --- a/drivers/watchdog/Kconfig
> +++ b/drivers/watchdog/Kconfig
> @@ -254,17 +254,6 @@ config MENZ069_WATCHDOG
>  	  This driver can also be built as a module. If so the module
>  	  will be called menz069_wdt.
>  
> -config TANGOX_WATCHDOG
> -	tristate "Sigma Designs SMP86xx/SMP87xx watchdog"
> -	select WATCHDOG_CORE
> -	depends on ARCH_TANGO || COMPILE_TEST
> -	depends on HAS_IOMEM
> -	help
> -	  Support for the watchdog in Sigma Designs SMP86xx (tango3)
> -	  and SMP87xx (tango4) family chips.
> -
> -	  This driver can be built as a module. The module name is tangox_wdt.
> -
>  config WDAT_WDT
>  	tristate "ACPI Watchdog Action Table (WDAT)"
>  	depends on ACPI
> diff --git a/drivers/watchdog/Makefile b/drivers/watchdog/Makefile
> index 7a95b280cd9f..1ff40d6a027f 100644
> --- a/drivers/watchdog/Makefile
> +++ b/drivers/watchdog/Makefile
> @@ -210,7 +210,6 @@ obj-$(CONFIG_DA9055_WATCHDOG) += da9055_wdt.o
>  obj-$(CONFIG_DA9062_WATCHDOG) += da9062_wdt.o
>  obj-$(CONFIG_DA9063_WATCHDOG) += da9063_wdt.o
>  obj-$(CONFIG_GPIO_WATCHDOG)	+= gpio_wdt.o
> -obj-$(CONFIG_TANGOX_WATCHDOG) += tangox_wdt.o
>  obj-$(CONFIG_WDAT_WDT) += wdat_wdt.o
>  obj-$(CONFIG_WM831X_WATCHDOG) += wm831x_wdt.o
>  obj-$(CONFIG_WM8350_WATCHDOG) += wm8350_wdt.o
> diff --git a/drivers/watchdog/tangox_wdt.c b/drivers/watchdog/tangox_wdt.c
> deleted file mode 100644
> index 1afb0e9d808c..000000000000
> --- a/drivers/watchdog/tangox_wdt.c
> +++ /dev/null
> @@ -1,209 +0,0 @@
> -// SPDX-License-Identifier: GPL-2.0+
> -/*
> - *  Copyright (C) 2015 Mans Rullgard <mans@mansr.com>
> - *  SMP86xx/SMP87xx Watchdog driver
> - */
> -
> -#include <linux/bitops.h>
> -#include <linux/clk.h>
> -#include <linux/delay.h>
> -#include <linux/io.h>
> -#include <linux/kernel.h>
> -#include <linux/module.h>
> -#include <linux/moduleparam.h>
> -#include <linux/mod_devicetable.h>
> -#include <linux/platform_device.h>
> -#include <linux/watchdog.h>
> -
> -#define DEFAULT_TIMEOUT 30
> -
> -static bool nowayout = WATCHDOG_NOWAYOUT;
> -module_param(nowayout, bool, 0);
> -MODULE_PARM_DESC(nowayout,
> -		 "Watchdog cannot be stopped once started (default="
> -		 __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
> -
> -static unsigned int timeout;
> -module_param(timeout, int, 0);
> -MODULE_PARM_DESC(timeout, "Watchdog timeout");
> -
> -/*
> - * Counter counts down from programmed value.  Reset asserts when
> - * the counter reaches 1.
> - */
> -#define WD_COUNTER		0
> -
> -#define WD_CONFIG		4
> -#define WD_CONFIG_XTAL_IN	BIT(0)
> -#define WD_CONFIG_DISABLE	BIT(31)
> -
> -struct tangox_wdt_device {
> -	struct watchdog_device wdt;
> -	void __iomem *base;
> -	unsigned long clk_rate;
> -	struct clk *clk;
> -};
> -
> -static int tangox_wdt_set_timeout(struct watchdog_device *wdt,
> -				  unsigned int new_timeout)
> -{
> -	wdt->timeout = new_timeout;
> -
> -	return 0;
> -}
> -
> -static int tangox_wdt_start(struct watchdog_device *wdt)
> -{
> -	struct tangox_wdt_device *dev = watchdog_get_drvdata(wdt);
> -	u32 ticks;
> -
> -	ticks = 1 + wdt->timeout * dev->clk_rate;
> -	writel(ticks, dev->base + WD_COUNTER);
> -
> -	return 0;
> -}
> -
> -static int tangox_wdt_stop(struct watchdog_device *wdt)
> -{
> -	struct tangox_wdt_device *dev = watchdog_get_drvdata(wdt);
> -
> -	writel(0, dev->base + WD_COUNTER);
> -
> -	return 0;
> -}
> -
> -static unsigned int tangox_wdt_get_timeleft(struct watchdog_device *wdt)
> -{
> -	struct tangox_wdt_device *dev = watchdog_get_drvdata(wdt);
> -	u32 count;
> -
> -	count = readl(dev->base + WD_COUNTER);
> -
> -	if (!count)
> -		return 0;
> -
> -	return (count - 1) / dev->clk_rate;
> -}
> -
> -static const struct watchdog_info tangox_wdt_info = {
> -	.options  = WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING | WDIOF_MAGICCLOSE,
> -	.identity = "tangox watchdog",
> -};
> -
> -static int tangox_wdt_restart(struct watchdog_device *wdt,
> -			      unsigned long action, void *data)
> -{
> -	struct tangox_wdt_device *dev = watchdog_get_drvdata(wdt);
> -
> -	writel(1, dev->base + WD_COUNTER);
> -
> -	return 0;
> -}
> -
> -static const struct watchdog_ops tangox_wdt_ops = {
> -	.start		= tangox_wdt_start,
> -	.stop		= tangox_wdt_stop,
> -	.set_timeout	= tangox_wdt_set_timeout,
> -	.get_timeleft	= tangox_wdt_get_timeleft,
> -	.restart	= tangox_wdt_restart,
> -};
> -
> -static void tangox_clk_disable_unprepare(void *data)
> -{
> -	clk_disable_unprepare(data);
> -}
> -
> -static int tangox_wdt_probe(struct platform_device *pdev)
> -{
> -	struct tangox_wdt_device *dev;
> -	u32 config;
> -	int err;
> -
> -	dev = devm_kzalloc(&pdev->dev, sizeof(*dev), GFP_KERNEL);
> -	if (!dev)
> -		return -ENOMEM;
> -
> -	dev->base = devm_platform_ioremap_resource(pdev, 0);
> -	if (IS_ERR(dev->base))
> -		return PTR_ERR(dev->base);
> -
> -	dev->clk = devm_clk_get(&pdev->dev, NULL);
> -	if (IS_ERR(dev->clk))
> -		return PTR_ERR(dev->clk);
> -
> -	err = clk_prepare_enable(dev->clk);
> -	if (err)
> -		return err;
> -	err = devm_add_action_or_reset(&pdev->dev,
> -				       tangox_clk_disable_unprepare, dev->clk);
> -	if (err)
> -		return err;
> -
> -	dev->clk_rate = clk_get_rate(dev->clk);
> -	if (!dev->clk_rate)
> -		return -EINVAL;
> -
> -	dev->wdt.parent = &pdev->dev;
> -	dev->wdt.info = &tangox_wdt_info;
> -	dev->wdt.ops = &tangox_wdt_ops;
> -	dev->wdt.timeout = DEFAULT_TIMEOUT;
> -	dev->wdt.min_timeout = 1;
> -	dev->wdt.max_hw_heartbeat_ms = (U32_MAX - 1) / dev->clk_rate;
> -
> -	watchdog_init_timeout(&dev->wdt, timeout, &pdev->dev);
> -	watchdog_set_nowayout(&dev->wdt, nowayout);
> -	watchdog_set_drvdata(&dev->wdt, dev);
> -
> -	/*
> -	 * Deactivate counter if disable bit is set to avoid
> -	 * accidental reset.
> -	 */
> -	config = readl(dev->base + WD_CONFIG);
> -	if (config & WD_CONFIG_DISABLE)
> -		writel(0, dev->base + WD_COUNTER);
> -
> -	writel(WD_CONFIG_XTAL_IN, dev->base + WD_CONFIG);
> -
> -	/*
> -	 * Mark as active and restart with configured timeout if
> -	 * already running.
> -	 */
> -	if (readl(dev->base + WD_COUNTER)) {
> -		set_bit(WDOG_HW_RUNNING, &dev->wdt.status);
> -		tangox_wdt_start(&dev->wdt);
> -	}
> -
> -	watchdog_set_restart_priority(&dev->wdt, 128);
> -
> -	watchdog_stop_on_unregister(&dev->wdt);
> -	err = devm_watchdog_register_device(&pdev->dev, &dev->wdt);
> -	if (err)
> -		return err;
> -
> -	platform_set_drvdata(pdev, dev);
> -
> -	dev_info(&pdev->dev, "SMP86xx/SMP87xx watchdog registered\n");
> -
> -	return 0;
> -}
> -
> -static const struct of_device_id tangox_wdt_dt_ids[] = {
> -	{ .compatible = "sigma,smp8642-wdt" },
> -	{ .compatible = "sigma,smp8759-wdt" },
> -	{ }
> -};
> -MODULE_DEVICE_TABLE(of, tangox_wdt_dt_ids);
> -
> -static struct platform_driver tangox_wdt_driver = {
> -	.probe	= tangox_wdt_probe,
> -	.driver	= {
> -		.name		= "tangox-wdt",
> -		.of_match_table	= tangox_wdt_dt_ids,
> -	},
> -};
> -
> -module_platform_driver(tangox_wdt_driver);
> -
> -MODULE_AUTHOR("Mans Rullgard <mans@mansr.com>");
> -MODULE_DESCRIPTION("SMP86xx/SMP87xx Watchdog driver");
> -MODULE_LICENSE("GPL");
> -- 
> 2.29.2
> 

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [PATCH 5/5] watchdog: remove coh901 driver
  2021-01-20 16:27   ` Arnd Bergmann
@ 2021-01-20 19:03     ` Guenter Roeck
  -1 siblings, 0 replies; 38+ messages in thread
From: Guenter Roeck @ 2021-01-20 19:03 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: linux-arm-kernel, linux-kernel, linux-watchdog, Wim Van Sebroeck,
	Arnd Bergmann, Linus Walleij

On Wed, Jan 20, 2021 at 05:27:45PM +0100, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
> 
> The ST-Ericsson U300 platform is getting removed, so this driver is no
> longer needed.
> 
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Reviewed-by: Guenter Roeck <linux@roeck-us.net>

> ---
>  .../watchdog/stericsson-coh901327.txt         |  19 -
>  drivers/watchdog/Kconfig                      |  11 -
>  drivers/watchdog/Makefile                     |   1 -
>  drivers/watchdog/coh901327_wdt.c              | 408 ------------------
>  4 files changed, 439 deletions(-)
>  delete mode 100644 Documentation/devicetree/bindings/watchdog/stericsson-coh901327.txt
>  delete mode 100644 drivers/watchdog/coh901327_wdt.c
> 
> diff --git a/Documentation/devicetree/bindings/watchdog/stericsson-coh901327.txt b/Documentation/devicetree/bindings/watchdog/stericsson-coh901327.txt
> deleted file mode 100644
> index 8ffb88e39e76..000000000000
> --- a/Documentation/devicetree/bindings/watchdog/stericsson-coh901327.txt
> +++ /dev/null
> @@ -1,19 +0,0 @@
> -ST-Ericsson COH 901 327 Watchdog timer
> -
> -Required properties:
> -- compatible: must be "stericsson,coh901327".
> -- reg: physical base address of the controller and length of memory mapped
> -  region.
> -- interrupts: the interrupt used for the watchdog timeout warning.
> -
> -Optional properties:
> -- timeout-sec: contains the watchdog timeout in seconds.
> -
> -Example:
> -
> -watchdog: watchdog@c0012000 {
> -	compatible = "stericsson,coh901327";
> -	reg = <0xc0012000 0x1000>;
> -	interrupts = <3>;
> -	timeout-sec = <60>;
> -};
> diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
> index 10efbb351f14..3b73735b0c8b 100644
> --- a/drivers/watchdog/Kconfig
> +++ b/drivers/watchdog/Kconfig
> @@ -619,17 +619,6 @@ config SUNXI_WATCHDOG
>  	  To compile this driver as a module, choose M here: the
>  	  module will be called sunxi_wdt.
>  
> -config COH901327_WATCHDOG
> -	bool "ST-Ericsson COH 901 327 watchdog"
> -	depends on ARCH_U300 || (ARM && COMMON_CLK && COMPILE_TEST)
> -	default y if MACH_U300
> -	select WATCHDOG_CORE
> -	help
> -	  Say Y here to include Watchdog timer support for the
> -	  watchdog embedded into the ST-Ericsson U300 series platforms.
> -	  This watchdog is used to reset the system and thus cannot be
> -	  compiled as a module.
> -
>  config NPCM7XX_WATCHDOG
>  	tristate "Nuvoton NPCM750 watchdog"
>  	depends on ARCH_NPCM || COMPILE_TEST
> diff --git a/drivers/watchdog/Makefile b/drivers/watchdog/Makefile
> index 1ff40d6a027f..1685dbc70a15 100644
> --- a/drivers/watchdog/Makefile
> +++ b/drivers/watchdog/Makefile
> @@ -61,7 +61,6 @@ obj-$(CONFIG_K3_RTI_WATCHDOG) += rti_wdt.o
>  obj-$(CONFIG_ORION_WATCHDOG) += orion_wdt.o
>  obj-$(CONFIG_SUNXI_WATCHDOG) += sunxi_wdt.o
>  obj-$(CONFIG_RN5T618_WATCHDOG) += rn5t618_wdt.o
> -obj-$(CONFIG_COH901327_WATCHDOG) += coh901327_wdt.o
>  obj-$(CONFIG_NPCM7XX_WATCHDOG) += npcm_wdt.o
>  obj-$(CONFIG_STMP3XXX_RTC_WATCHDOG) += stmp3xxx_rtc_wdt.o
>  obj-$(CONFIG_TS4800_WATCHDOG) += ts4800_wdt.o
> diff --git a/drivers/watchdog/coh901327_wdt.c b/drivers/watchdog/coh901327_wdt.c
> deleted file mode 100644
> index 260c50b08483..000000000000
> --- a/drivers/watchdog/coh901327_wdt.c
> +++ /dev/null
> @@ -1,408 +0,0 @@
> -// SPDX-License-Identifier: GPL-2.0
> -/*
> - * coh901327_wdt.c
> - *
> - * Copyright (C) 2008-2009 ST-Ericsson AB
> - * Watchdog driver for the ST-Ericsson AB COH 901 327 IP core
> - * Author: Linus Walleij <linus.walleij@stericsson.com>
> - */
> -#include <linux/moduleparam.h>
> -#include <linux/mod_devicetable.h>
> -#include <linux/types.h>
> -#include <linux/watchdog.h>
> -#include <linux/interrupt.h>
> -#include <linux/pm.h>
> -#include <linux/platform_device.h>
> -#include <linux/io.h>
> -#include <linux/bitops.h>
> -#include <linux/clk.h>
> -#include <linux/delay.h>
> -#include <linux/err.h>
> -
> -#define DRV_NAME "WDOG COH 901 327"
> -
> -/*
> - * COH 901 327 register definitions
> - */
> -
> -/* WDOG_FEED Register 32bit (-/W) */
> -#define U300_WDOG_FR							0x00
> -#define U300_WDOG_FR_FEED_RESTART_TIMER					0xFEEDU
> -/* WDOG_TIMEOUT Register 32bit (R/W) */
> -#define U300_WDOG_TR							0x04
> -#define U300_WDOG_TR_TIMEOUT_MASK					0x7FFFU
> -/* WDOG_DISABLE1 Register 32bit (-/W) */
> -#define U300_WDOG_D1R							0x08
> -#define U300_WDOG_D1R_DISABLE1_DISABLE_TIMER				0x2BADU
> -/* WDOG_DISABLE2 Register 32bit (R/W) */
> -#define U300_WDOG_D2R							0x0C
> -#define U300_WDOG_D2R_DISABLE2_DISABLE_TIMER				0xCAFEU
> -#define U300_WDOG_D2R_DISABLE_STATUS_DISABLED				0xDABEU
> -#define U300_WDOG_D2R_DISABLE_STATUS_ENABLED				0x0000U
> -/* WDOG_STATUS Register 32bit (R/W) */
> -#define U300_WDOG_SR							0x10
> -#define U300_WDOG_SR_STATUS_TIMED_OUT					0xCFE8U
> -#define U300_WDOG_SR_STATUS_NORMAL					0x0000U
> -#define U300_WDOG_SR_RESET_STATUS_RESET					0xE8B4U
> -/* WDOG_COUNT Register 32bit (R/-) */
> -#define U300_WDOG_CR							0x14
> -#define U300_WDOG_CR_VALID_IND						0x8000U
> -#define U300_WDOG_CR_VALID_STABLE					0x0000U
> -#define U300_WDOG_CR_COUNT_VALUE_MASK					0x7FFFU
> -/* WDOG_JTAGOVR Register 32bit (R/W) */
> -#define U300_WDOG_JOR							0x18
> -#define U300_WDOG_JOR_JTAG_MODE_IND					0x0002U
> -#define U300_WDOG_JOR_JTAG_WATCHDOG_ENABLE				0x0001U
> -/* WDOG_RESTART Register 32bit (-/W) */
> -#define U300_WDOG_RR							0x1C
> -#define U300_WDOG_RR_RESTART_VALUE_RESUME				0xACEDU
> -/* WDOG_IRQ_EVENT Register 32bit (R/W) */
> -#define U300_WDOG_IER							0x20
> -#define U300_WDOG_IER_WILL_BARK_IRQ_EVENT_IND				0x0001U
> -#define U300_WDOG_IER_WILL_BARK_IRQ_ACK_ENABLE				0x0001U
> -/* WDOG_IRQ_MASK Register 32bit (R/W) */
> -#define U300_WDOG_IMR							0x24
> -#define U300_WDOG_IMR_WILL_BARK_IRQ_ENABLE				0x0001U
> -/* WDOG_IRQ_FORCE Register 32bit (R/W) */
> -#define U300_WDOG_IFR							0x28
> -#define U300_WDOG_IFR_WILL_BARK_IRQ_FORCE_ENABLE			0x0001U
> -
> -/* Default timeout in seconds = 1 minute */
> -#define U300_WDOG_DEFAULT_TIMEOUT					60
> -
> -static unsigned int margin;
> -static int irq;
> -static void __iomem *virtbase;
> -static struct device *parent;
> -
> -static struct clk *clk;
> -
> -/*
> - * Enabling and disabling functions.
> - */
> -static void coh901327_enable(u16 timeout)
> -{
> -	u16 val;
> -	unsigned long freq;
> -	unsigned long delay_ns;
> -
> -	/* Restart timer if it is disabled */
> -	val = readw(virtbase + U300_WDOG_D2R);
> -	if (val == U300_WDOG_D2R_DISABLE_STATUS_DISABLED)
> -		writew(U300_WDOG_RR_RESTART_VALUE_RESUME,
> -		       virtbase + U300_WDOG_RR);
> -	/* Acknowledge any pending interrupt so it doesn't just fire off */
> -	writew(U300_WDOG_IER_WILL_BARK_IRQ_ACK_ENABLE,
> -	       virtbase + U300_WDOG_IER);
> -	/*
> -	 * The interrupt is cleared in the 32 kHz clock domain.
> -	 * Wait 3 32 kHz cycles for it to take effect
> -	 */
> -	freq = clk_get_rate(clk);
> -	delay_ns = DIV_ROUND_UP(1000000000, freq); /* Freq to ns and round up */
> -	delay_ns = 3 * delay_ns; /* Wait 3 cycles */
> -	ndelay(delay_ns);
> -	/* Enable the watchdog interrupt */
> -	writew(U300_WDOG_IMR_WILL_BARK_IRQ_ENABLE, virtbase + U300_WDOG_IMR);
> -	/* Activate the watchdog timer */
> -	writew(timeout, virtbase + U300_WDOG_TR);
> -	/* Start the watchdog timer */
> -	writew(U300_WDOG_FR_FEED_RESTART_TIMER, virtbase + U300_WDOG_FR);
> -	/*
> -	 * Extra read so that this change propagate in the watchdog.
> -	 */
> -	(void) readw(virtbase + U300_WDOG_CR);
> -	val = readw(virtbase + U300_WDOG_D2R);
> -	if (val != U300_WDOG_D2R_DISABLE_STATUS_ENABLED)
> -		dev_err(parent,
> -			"%s(): watchdog not enabled! D2R value %04x\n",
> -			__func__, val);
> -}
> -
> -static void coh901327_disable(void)
> -{
> -	u16 val;
> -
> -	/* Disable the watchdog interrupt if it is active */
> -	writew(0x0000U, virtbase + U300_WDOG_IMR);
> -	/* If the watchdog is currently enabled, attempt to disable it */
> -	val = readw(virtbase + U300_WDOG_D2R);
> -	if (val != U300_WDOG_D2R_DISABLE_STATUS_DISABLED) {
> -		writew(U300_WDOG_D1R_DISABLE1_DISABLE_TIMER,
> -		       virtbase + U300_WDOG_D1R);
> -		writew(U300_WDOG_D2R_DISABLE2_DISABLE_TIMER,
> -		       virtbase + U300_WDOG_D2R);
> -		/* Write this twice (else problems occur) */
> -		writew(U300_WDOG_D2R_DISABLE2_DISABLE_TIMER,
> -		       virtbase + U300_WDOG_D2R);
> -	}
> -	val = readw(virtbase + U300_WDOG_D2R);
> -	if (val != U300_WDOG_D2R_DISABLE_STATUS_DISABLED)
> -		dev_err(parent,
> -			"%s(): watchdog not disabled! D2R value %04x\n",
> -			__func__, val);
> -}
> -
> -static int coh901327_start(struct watchdog_device *wdt_dev)
> -{
> -	coh901327_enable(wdt_dev->timeout * 100);
> -	return 0;
> -}
> -
> -static int coh901327_stop(struct watchdog_device *wdt_dev)
> -{
> -	coh901327_disable();
> -	return 0;
> -}
> -
> -static int coh901327_ping(struct watchdog_device *wdd)
> -{
> -	/* Feed the watchdog */
> -	writew(U300_WDOG_FR_FEED_RESTART_TIMER,
> -	       virtbase + U300_WDOG_FR);
> -	return 0;
> -}
> -
> -static int coh901327_settimeout(struct watchdog_device *wdt_dev,
> -				unsigned int time)
> -{
> -	wdt_dev->timeout = time;
> -	/* Set new timeout value */
> -	writew(time * 100, virtbase + U300_WDOG_TR);
> -	/* Feed the dog */
> -	writew(U300_WDOG_FR_FEED_RESTART_TIMER,
> -	       virtbase + U300_WDOG_FR);
> -	return 0;
> -}
> -
> -static unsigned int coh901327_gettimeleft(struct watchdog_device *wdt_dev)
> -{
> -	u16 val;
> -
> -	/* Read repeatedly until the value is stable! */
> -	val = readw(virtbase + U300_WDOG_CR);
> -	while (val & U300_WDOG_CR_VALID_IND)
> -		val = readw(virtbase + U300_WDOG_CR);
> -	val &= U300_WDOG_CR_COUNT_VALUE_MASK;
> -	if (val != 0)
> -		val /= 100;
> -
> -	return val;
> -}
> -
> -/*
> - * This interrupt occurs 10 ms before the watchdog WILL bark.
> - */
> -static irqreturn_t coh901327_interrupt(int irq, void *data)
> -{
> -	u16 val;
> -
> -	/*
> -	 * Ack IRQ? If this occurs we're FUBAR anyway, so
> -	 * just acknowledge, disable the interrupt and await the imminent end.
> -	 * If you at some point need a host of callbacks to be called
> -	 * when the system is about to watchdog-reset, add them here!
> -	 *
> -	 * NOTE: on future versions of this IP-block, it will be possible
> -	 * to prevent a watchdog reset by feeding the watchdog at this
> -	 * point.
> -	 */
> -	val = readw(virtbase + U300_WDOG_IER);
> -	if (val == U300_WDOG_IER_WILL_BARK_IRQ_EVENT_IND)
> -		writew(U300_WDOG_IER_WILL_BARK_IRQ_ACK_ENABLE,
> -		       virtbase + U300_WDOG_IER);
> -	writew(0x0000U, virtbase + U300_WDOG_IMR);
> -	dev_crit(parent, "watchdog is barking!\n");
> -	return IRQ_HANDLED;
> -}
> -
> -static const struct watchdog_info coh901327_ident = {
> -	.options = WDIOF_CARDRESET | WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING,
> -	.identity = DRV_NAME,
> -};
> -
> -static const struct watchdog_ops coh901327_ops = {
> -	.owner = THIS_MODULE,
> -	.start = coh901327_start,
> -	.stop = coh901327_stop,
> -	.ping = coh901327_ping,
> -	.set_timeout = coh901327_settimeout,
> -	.get_timeleft = coh901327_gettimeleft,
> -};
> -
> -static struct watchdog_device coh901327_wdt = {
> -	.info = &coh901327_ident,
> -	.ops = &coh901327_ops,
> -	/*
> -	 * Max timeout is 327 since the 10ms
> -	 * timeout register is max
> -	 * 0x7FFF = 327670ms ~= 327s.
> -	 */
> -	.min_timeout = 1,
> -	.max_timeout = 327,
> -	.timeout = U300_WDOG_DEFAULT_TIMEOUT,
> -};
> -
> -static int __init coh901327_probe(struct platform_device *pdev)
> -{
> -	struct device *dev = &pdev->dev;
> -	int ret;
> -	u16 val;
> -
> -	parent = dev;
> -
> -	virtbase = devm_platform_ioremap_resource(pdev, 0);
> -	if (IS_ERR(virtbase))
> -		return PTR_ERR(virtbase);
> -
> -	clk = clk_get(dev, NULL);
> -	if (IS_ERR(clk)) {
> -		ret = PTR_ERR(clk);
> -		dev_err(dev, "could not get clock\n");
> -		return ret;
> -	}
> -	ret = clk_prepare_enable(clk);
> -	if (ret) {
> -		dev_err(dev, "could not prepare and enable clock\n");
> -		goto out_no_clk_enable;
> -	}
> -
> -	val = readw(virtbase + U300_WDOG_SR);
> -	switch (val) {
> -	case U300_WDOG_SR_STATUS_TIMED_OUT:
> -		dev_info(dev, "watchdog timed out since last chip reset!\n");
> -		coh901327_wdt.bootstatus |= WDIOF_CARDRESET;
> -		/* Status will be cleared below */
> -		break;
> -	case U300_WDOG_SR_STATUS_NORMAL:
> -		dev_info(dev, "in normal status, no timeouts have occurred.\n");
> -		break;
> -	default:
> -		dev_info(dev, "contains an illegal status code (%08x)\n", val);
> -		break;
> -	}
> -
> -	val = readw(virtbase + U300_WDOG_D2R);
> -	switch (val) {
> -	case U300_WDOG_D2R_DISABLE_STATUS_DISABLED:
> -		dev_info(dev, "currently disabled.\n");
> -		break;
> -	case U300_WDOG_D2R_DISABLE_STATUS_ENABLED:
> -		dev_info(dev, "currently enabled! (disabling it now)\n");
> -		coh901327_disable();
> -		break;
> -	default:
> -		dev_err(dev, "contains an illegal enable/disable code (%08x)\n",
> -			val);
> -		break;
> -	}
> -
> -	/* Reset the watchdog */
> -	writew(U300_WDOG_SR_RESET_STATUS_RESET, virtbase + U300_WDOG_SR);
> -
> -	irq = platform_get_irq(pdev, 0);
> -	if (request_irq(irq, coh901327_interrupt, 0,
> -			DRV_NAME " Bark", pdev)) {
> -		ret = -EIO;
> -		goto out_no_irq;
> -	}
> -
> -	watchdog_init_timeout(&coh901327_wdt, margin, dev);
> -
> -	coh901327_wdt.parent = dev;
> -	ret = watchdog_register_device(&coh901327_wdt);
> -	if (ret)
> -		goto out_no_wdog;
> -
> -	dev_info(dev, "initialized. (timeout=%d sec)\n",
> -			coh901327_wdt.timeout);
> -	return 0;
> -
> -out_no_wdog:
> -	free_irq(irq, pdev);
> -out_no_irq:
> -	clk_disable_unprepare(clk);
> -out_no_clk_enable:
> -	clk_put(clk);
> -	return ret;
> -}
> -
> -#ifdef CONFIG_PM
> -
> -static u16 wdogenablestore;
> -static u16 irqmaskstore;
> -
> -static int coh901327_suspend(struct platform_device *pdev, pm_message_t state)
> -{
> -	irqmaskstore = readw(virtbase + U300_WDOG_IMR) & 0x0001U;
> -	wdogenablestore = readw(virtbase + U300_WDOG_D2R);
> -	/* If watchdog is on, disable it here and now */
> -	if (wdogenablestore == U300_WDOG_D2R_DISABLE_STATUS_ENABLED)
> -		coh901327_disable();
> -	return 0;
> -}
> -
> -static int coh901327_resume(struct platform_device *pdev)
> -{
> -	/* Restore the watchdog interrupt */
> -	writew(irqmaskstore, virtbase + U300_WDOG_IMR);
> -	if (wdogenablestore == U300_WDOG_D2R_DISABLE_STATUS_ENABLED) {
> -		/* Restart the watchdog timer */
> -		writew(U300_WDOG_RR_RESTART_VALUE_RESUME,
> -		       virtbase + U300_WDOG_RR);
> -		writew(U300_WDOG_FR_FEED_RESTART_TIMER,
> -		       virtbase + U300_WDOG_FR);
> -	}
> -	return 0;
> -}
> -#else
> -#define coh901327_suspend NULL
> -#define coh901327_resume  NULL
> -#endif
> -
> -/*
> - * Mistreating the watchdog is the only way to perform a software reset of the
> - * system on EMP platforms. So we implement this and export a symbol for it.
> - */
> -void coh901327_watchdog_reset(void)
> -{
> -	/* Enable even if on JTAG too */
> -	writew(U300_WDOG_JOR_JTAG_WATCHDOG_ENABLE,
> -	       virtbase + U300_WDOG_JOR);
> -	/*
> -	 * Timeout = 5s, we have to wait for the watchdog reset to
> -	 * actually take place: the watchdog will be reloaded with the
> -	 * default value immediately, so we HAVE to reboot and get back
> -	 * into the kernel in 30s, or the device will reboot again!
> -	 * The boot loader will typically deactivate the watchdog, so we
> -	 * need time enough for the boot loader to get to the point of
> -	 * deactivating the watchdog before it is shut down by it.
> -	 *
> -	 * NOTE: on future versions of the watchdog, this restriction is
> -	 * gone: the watchdog will be reloaded with a default value (1 min)
> -	 * instead of last value, and you can conveniently set the watchdog
> -	 * timeout to 10ms (value = 1) without any problems.
> -	 */
> -	coh901327_enable(500);
> -	/* Return and await doom */
> -}
> -
> -static const struct of_device_id coh901327_dt_match[] = {
> -	{ .compatible = "stericsson,coh901327" },
> -	{},
> -};
> -
> -static struct platform_driver coh901327_driver = {
> -	.driver = {
> -		.name	= "coh901327_wdog",
> -		.of_match_table = coh901327_dt_match,
> -		.suppress_bind_attrs = true,
> -	},
> -	.suspend	= coh901327_suspend,
> -	.resume		= coh901327_resume,
> -};
> -builtin_platform_driver_probe(coh901327_driver, coh901327_probe);
> -
> -/* not really modular, but ... */
> -module_param(margin, uint, 0);
> -MODULE_PARM_DESC(margin, "Watchdog margin in seconds (default 60s)");
> -- 
> 2.29.2
> 

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [PATCH 5/5] watchdog: remove coh901 driver
@ 2021-01-20 19:03     ` Guenter Roeck
  0 siblings, 0 replies; 38+ messages in thread
From: Guenter Roeck @ 2021-01-20 19:03 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: linux-watchdog, Arnd Bergmann, Linus Walleij, linux-kernel,
	Wim Van Sebroeck, linux-arm-kernel

On Wed, Jan 20, 2021 at 05:27:45PM +0100, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
> 
> The ST-Ericsson U300 platform is getting removed, so this driver is no
> longer needed.
> 
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Reviewed-by: Guenter Roeck <linux@roeck-us.net>

> ---
>  .../watchdog/stericsson-coh901327.txt         |  19 -
>  drivers/watchdog/Kconfig                      |  11 -
>  drivers/watchdog/Makefile                     |   1 -
>  drivers/watchdog/coh901327_wdt.c              | 408 ------------------
>  4 files changed, 439 deletions(-)
>  delete mode 100644 Documentation/devicetree/bindings/watchdog/stericsson-coh901327.txt
>  delete mode 100644 drivers/watchdog/coh901327_wdt.c
> 
> diff --git a/Documentation/devicetree/bindings/watchdog/stericsson-coh901327.txt b/Documentation/devicetree/bindings/watchdog/stericsson-coh901327.txt
> deleted file mode 100644
> index 8ffb88e39e76..000000000000
> --- a/Documentation/devicetree/bindings/watchdog/stericsson-coh901327.txt
> +++ /dev/null
> @@ -1,19 +0,0 @@
> -ST-Ericsson COH 901 327 Watchdog timer
> -
> -Required properties:
> -- compatible: must be "stericsson,coh901327".
> -- reg: physical base address of the controller and length of memory mapped
> -  region.
> -- interrupts: the interrupt used for the watchdog timeout warning.
> -
> -Optional properties:
> -- timeout-sec: contains the watchdog timeout in seconds.
> -
> -Example:
> -
> -watchdog: watchdog@c0012000 {
> -	compatible = "stericsson,coh901327";
> -	reg = <0xc0012000 0x1000>;
> -	interrupts = <3>;
> -	timeout-sec = <60>;
> -};
> diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
> index 10efbb351f14..3b73735b0c8b 100644
> --- a/drivers/watchdog/Kconfig
> +++ b/drivers/watchdog/Kconfig
> @@ -619,17 +619,6 @@ config SUNXI_WATCHDOG
>  	  To compile this driver as a module, choose M here: the
>  	  module will be called sunxi_wdt.
>  
> -config COH901327_WATCHDOG
> -	bool "ST-Ericsson COH 901 327 watchdog"
> -	depends on ARCH_U300 || (ARM && COMMON_CLK && COMPILE_TEST)
> -	default y if MACH_U300
> -	select WATCHDOG_CORE
> -	help
> -	  Say Y here to include Watchdog timer support for the
> -	  watchdog embedded into the ST-Ericsson U300 series platforms.
> -	  This watchdog is used to reset the system and thus cannot be
> -	  compiled as a module.
> -
>  config NPCM7XX_WATCHDOG
>  	tristate "Nuvoton NPCM750 watchdog"
>  	depends on ARCH_NPCM || COMPILE_TEST
> diff --git a/drivers/watchdog/Makefile b/drivers/watchdog/Makefile
> index 1ff40d6a027f..1685dbc70a15 100644
> --- a/drivers/watchdog/Makefile
> +++ b/drivers/watchdog/Makefile
> @@ -61,7 +61,6 @@ obj-$(CONFIG_K3_RTI_WATCHDOG) += rti_wdt.o
>  obj-$(CONFIG_ORION_WATCHDOG) += orion_wdt.o
>  obj-$(CONFIG_SUNXI_WATCHDOG) += sunxi_wdt.o
>  obj-$(CONFIG_RN5T618_WATCHDOG) += rn5t618_wdt.o
> -obj-$(CONFIG_COH901327_WATCHDOG) += coh901327_wdt.o
>  obj-$(CONFIG_NPCM7XX_WATCHDOG) += npcm_wdt.o
>  obj-$(CONFIG_STMP3XXX_RTC_WATCHDOG) += stmp3xxx_rtc_wdt.o
>  obj-$(CONFIG_TS4800_WATCHDOG) += ts4800_wdt.o
> diff --git a/drivers/watchdog/coh901327_wdt.c b/drivers/watchdog/coh901327_wdt.c
> deleted file mode 100644
> index 260c50b08483..000000000000
> --- a/drivers/watchdog/coh901327_wdt.c
> +++ /dev/null
> @@ -1,408 +0,0 @@
> -// SPDX-License-Identifier: GPL-2.0
> -/*
> - * coh901327_wdt.c
> - *
> - * Copyright (C) 2008-2009 ST-Ericsson AB
> - * Watchdog driver for the ST-Ericsson AB COH 901 327 IP core
> - * Author: Linus Walleij <linus.walleij@stericsson.com>
> - */
> -#include <linux/moduleparam.h>
> -#include <linux/mod_devicetable.h>
> -#include <linux/types.h>
> -#include <linux/watchdog.h>
> -#include <linux/interrupt.h>
> -#include <linux/pm.h>
> -#include <linux/platform_device.h>
> -#include <linux/io.h>
> -#include <linux/bitops.h>
> -#include <linux/clk.h>
> -#include <linux/delay.h>
> -#include <linux/err.h>
> -
> -#define DRV_NAME "WDOG COH 901 327"
> -
> -/*
> - * COH 901 327 register definitions
> - */
> -
> -/* WDOG_FEED Register 32bit (-/W) */
> -#define U300_WDOG_FR							0x00
> -#define U300_WDOG_FR_FEED_RESTART_TIMER					0xFEEDU
> -/* WDOG_TIMEOUT Register 32bit (R/W) */
> -#define U300_WDOG_TR							0x04
> -#define U300_WDOG_TR_TIMEOUT_MASK					0x7FFFU
> -/* WDOG_DISABLE1 Register 32bit (-/W) */
> -#define U300_WDOG_D1R							0x08
> -#define U300_WDOG_D1R_DISABLE1_DISABLE_TIMER				0x2BADU
> -/* WDOG_DISABLE2 Register 32bit (R/W) */
> -#define U300_WDOG_D2R							0x0C
> -#define U300_WDOG_D2R_DISABLE2_DISABLE_TIMER				0xCAFEU
> -#define U300_WDOG_D2R_DISABLE_STATUS_DISABLED				0xDABEU
> -#define U300_WDOG_D2R_DISABLE_STATUS_ENABLED				0x0000U
> -/* WDOG_STATUS Register 32bit (R/W) */
> -#define U300_WDOG_SR							0x10
> -#define U300_WDOG_SR_STATUS_TIMED_OUT					0xCFE8U
> -#define U300_WDOG_SR_STATUS_NORMAL					0x0000U
> -#define U300_WDOG_SR_RESET_STATUS_RESET					0xE8B4U
> -/* WDOG_COUNT Register 32bit (R/-) */
> -#define U300_WDOG_CR							0x14
> -#define U300_WDOG_CR_VALID_IND						0x8000U
> -#define U300_WDOG_CR_VALID_STABLE					0x0000U
> -#define U300_WDOG_CR_COUNT_VALUE_MASK					0x7FFFU
> -/* WDOG_JTAGOVR Register 32bit (R/W) */
> -#define U300_WDOG_JOR							0x18
> -#define U300_WDOG_JOR_JTAG_MODE_IND					0x0002U
> -#define U300_WDOG_JOR_JTAG_WATCHDOG_ENABLE				0x0001U
> -/* WDOG_RESTART Register 32bit (-/W) */
> -#define U300_WDOG_RR							0x1C
> -#define U300_WDOG_RR_RESTART_VALUE_RESUME				0xACEDU
> -/* WDOG_IRQ_EVENT Register 32bit (R/W) */
> -#define U300_WDOG_IER							0x20
> -#define U300_WDOG_IER_WILL_BARK_IRQ_EVENT_IND				0x0001U
> -#define U300_WDOG_IER_WILL_BARK_IRQ_ACK_ENABLE				0x0001U
> -/* WDOG_IRQ_MASK Register 32bit (R/W) */
> -#define U300_WDOG_IMR							0x24
> -#define U300_WDOG_IMR_WILL_BARK_IRQ_ENABLE				0x0001U
> -/* WDOG_IRQ_FORCE Register 32bit (R/W) */
> -#define U300_WDOG_IFR							0x28
> -#define U300_WDOG_IFR_WILL_BARK_IRQ_FORCE_ENABLE			0x0001U
> -
> -/* Default timeout in seconds = 1 minute */
> -#define U300_WDOG_DEFAULT_TIMEOUT					60
> -
> -static unsigned int margin;
> -static int irq;
> -static void __iomem *virtbase;
> -static struct device *parent;
> -
> -static struct clk *clk;
> -
> -/*
> - * Enabling and disabling functions.
> - */
> -static void coh901327_enable(u16 timeout)
> -{
> -	u16 val;
> -	unsigned long freq;
> -	unsigned long delay_ns;
> -
> -	/* Restart timer if it is disabled */
> -	val = readw(virtbase + U300_WDOG_D2R);
> -	if (val == U300_WDOG_D2R_DISABLE_STATUS_DISABLED)
> -		writew(U300_WDOG_RR_RESTART_VALUE_RESUME,
> -		       virtbase + U300_WDOG_RR);
> -	/* Acknowledge any pending interrupt so it doesn't just fire off */
> -	writew(U300_WDOG_IER_WILL_BARK_IRQ_ACK_ENABLE,
> -	       virtbase + U300_WDOG_IER);
> -	/*
> -	 * The interrupt is cleared in the 32 kHz clock domain.
> -	 * Wait 3 32 kHz cycles for it to take effect
> -	 */
> -	freq = clk_get_rate(clk);
> -	delay_ns = DIV_ROUND_UP(1000000000, freq); /* Freq to ns and round up */
> -	delay_ns = 3 * delay_ns; /* Wait 3 cycles */
> -	ndelay(delay_ns);
> -	/* Enable the watchdog interrupt */
> -	writew(U300_WDOG_IMR_WILL_BARK_IRQ_ENABLE, virtbase + U300_WDOG_IMR);
> -	/* Activate the watchdog timer */
> -	writew(timeout, virtbase + U300_WDOG_TR);
> -	/* Start the watchdog timer */
> -	writew(U300_WDOG_FR_FEED_RESTART_TIMER, virtbase + U300_WDOG_FR);
> -	/*
> -	 * Extra read so that this change propagate in the watchdog.
> -	 */
> -	(void) readw(virtbase + U300_WDOG_CR);
> -	val = readw(virtbase + U300_WDOG_D2R);
> -	if (val != U300_WDOG_D2R_DISABLE_STATUS_ENABLED)
> -		dev_err(parent,
> -			"%s(): watchdog not enabled! D2R value %04x\n",
> -			__func__, val);
> -}
> -
> -static void coh901327_disable(void)
> -{
> -	u16 val;
> -
> -	/* Disable the watchdog interrupt if it is active */
> -	writew(0x0000U, virtbase + U300_WDOG_IMR);
> -	/* If the watchdog is currently enabled, attempt to disable it */
> -	val = readw(virtbase + U300_WDOG_D2R);
> -	if (val != U300_WDOG_D2R_DISABLE_STATUS_DISABLED) {
> -		writew(U300_WDOG_D1R_DISABLE1_DISABLE_TIMER,
> -		       virtbase + U300_WDOG_D1R);
> -		writew(U300_WDOG_D2R_DISABLE2_DISABLE_TIMER,
> -		       virtbase + U300_WDOG_D2R);
> -		/* Write this twice (else problems occur) */
> -		writew(U300_WDOG_D2R_DISABLE2_DISABLE_TIMER,
> -		       virtbase + U300_WDOG_D2R);
> -	}
> -	val = readw(virtbase + U300_WDOG_D2R);
> -	if (val != U300_WDOG_D2R_DISABLE_STATUS_DISABLED)
> -		dev_err(parent,
> -			"%s(): watchdog not disabled! D2R value %04x\n",
> -			__func__, val);
> -}
> -
> -static int coh901327_start(struct watchdog_device *wdt_dev)
> -{
> -	coh901327_enable(wdt_dev->timeout * 100);
> -	return 0;
> -}
> -
> -static int coh901327_stop(struct watchdog_device *wdt_dev)
> -{
> -	coh901327_disable();
> -	return 0;
> -}
> -
> -static int coh901327_ping(struct watchdog_device *wdd)
> -{
> -	/* Feed the watchdog */
> -	writew(U300_WDOG_FR_FEED_RESTART_TIMER,
> -	       virtbase + U300_WDOG_FR);
> -	return 0;
> -}
> -
> -static int coh901327_settimeout(struct watchdog_device *wdt_dev,
> -				unsigned int time)
> -{
> -	wdt_dev->timeout = time;
> -	/* Set new timeout value */
> -	writew(time * 100, virtbase + U300_WDOG_TR);
> -	/* Feed the dog */
> -	writew(U300_WDOG_FR_FEED_RESTART_TIMER,
> -	       virtbase + U300_WDOG_FR);
> -	return 0;
> -}
> -
> -static unsigned int coh901327_gettimeleft(struct watchdog_device *wdt_dev)
> -{
> -	u16 val;
> -
> -	/* Read repeatedly until the value is stable! */
> -	val = readw(virtbase + U300_WDOG_CR);
> -	while (val & U300_WDOG_CR_VALID_IND)
> -		val = readw(virtbase + U300_WDOG_CR);
> -	val &= U300_WDOG_CR_COUNT_VALUE_MASK;
> -	if (val != 0)
> -		val /= 100;
> -
> -	return val;
> -}
> -
> -/*
> - * This interrupt occurs 10 ms before the watchdog WILL bark.
> - */
> -static irqreturn_t coh901327_interrupt(int irq, void *data)
> -{
> -	u16 val;
> -
> -	/*
> -	 * Ack IRQ? If this occurs we're FUBAR anyway, so
> -	 * just acknowledge, disable the interrupt and await the imminent end.
> -	 * If you at some point need a host of callbacks to be called
> -	 * when the system is about to watchdog-reset, add them here!
> -	 *
> -	 * NOTE: on future versions of this IP-block, it will be possible
> -	 * to prevent a watchdog reset by feeding the watchdog at this
> -	 * point.
> -	 */
> -	val = readw(virtbase + U300_WDOG_IER);
> -	if (val == U300_WDOG_IER_WILL_BARK_IRQ_EVENT_IND)
> -		writew(U300_WDOG_IER_WILL_BARK_IRQ_ACK_ENABLE,
> -		       virtbase + U300_WDOG_IER);
> -	writew(0x0000U, virtbase + U300_WDOG_IMR);
> -	dev_crit(parent, "watchdog is barking!\n");
> -	return IRQ_HANDLED;
> -}
> -
> -static const struct watchdog_info coh901327_ident = {
> -	.options = WDIOF_CARDRESET | WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING,
> -	.identity = DRV_NAME,
> -};
> -
> -static const struct watchdog_ops coh901327_ops = {
> -	.owner = THIS_MODULE,
> -	.start = coh901327_start,
> -	.stop = coh901327_stop,
> -	.ping = coh901327_ping,
> -	.set_timeout = coh901327_settimeout,
> -	.get_timeleft = coh901327_gettimeleft,
> -};
> -
> -static struct watchdog_device coh901327_wdt = {
> -	.info = &coh901327_ident,
> -	.ops = &coh901327_ops,
> -	/*
> -	 * Max timeout is 327 since the 10ms
> -	 * timeout register is max
> -	 * 0x7FFF = 327670ms ~= 327s.
> -	 */
> -	.min_timeout = 1,
> -	.max_timeout = 327,
> -	.timeout = U300_WDOG_DEFAULT_TIMEOUT,
> -};
> -
> -static int __init coh901327_probe(struct platform_device *pdev)
> -{
> -	struct device *dev = &pdev->dev;
> -	int ret;
> -	u16 val;
> -
> -	parent = dev;
> -
> -	virtbase = devm_platform_ioremap_resource(pdev, 0);
> -	if (IS_ERR(virtbase))
> -		return PTR_ERR(virtbase);
> -
> -	clk = clk_get(dev, NULL);
> -	if (IS_ERR(clk)) {
> -		ret = PTR_ERR(clk);
> -		dev_err(dev, "could not get clock\n");
> -		return ret;
> -	}
> -	ret = clk_prepare_enable(clk);
> -	if (ret) {
> -		dev_err(dev, "could not prepare and enable clock\n");
> -		goto out_no_clk_enable;
> -	}
> -
> -	val = readw(virtbase + U300_WDOG_SR);
> -	switch (val) {
> -	case U300_WDOG_SR_STATUS_TIMED_OUT:
> -		dev_info(dev, "watchdog timed out since last chip reset!\n");
> -		coh901327_wdt.bootstatus |= WDIOF_CARDRESET;
> -		/* Status will be cleared below */
> -		break;
> -	case U300_WDOG_SR_STATUS_NORMAL:
> -		dev_info(dev, "in normal status, no timeouts have occurred.\n");
> -		break;
> -	default:
> -		dev_info(dev, "contains an illegal status code (%08x)\n", val);
> -		break;
> -	}
> -
> -	val = readw(virtbase + U300_WDOG_D2R);
> -	switch (val) {
> -	case U300_WDOG_D2R_DISABLE_STATUS_DISABLED:
> -		dev_info(dev, "currently disabled.\n");
> -		break;
> -	case U300_WDOG_D2R_DISABLE_STATUS_ENABLED:
> -		dev_info(dev, "currently enabled! (disabling it now)\n");
> -		coh901327_disable();
> -		break;
> -	default:
> -		dev_err(dev, "contains an illegal enable/disable code (%08x)\n",
> -			val);
> -		break;
> -	}
> -
> -	/* Reset the watchdog */
> -	writew(U300_WDOG_SR_RESET_STATUS_RESET, virtbase + U300_WDOG_SR);
> -
> -	irq = platform_get_irq(pdev, 0);
> -	if (request_irq(irq, coh901327_interrupt, 0,
> -			DRV_NAME " Bark", pdev)) {
> -		ret = -EIO;
> -		goto out_no_irq;
> -	}
> -
> -	watchdog_init_timeout(&coh901327_wdt, margin, dev);
> -
> -	coh901327_wdt.parent = dev;
> -	ret = watchdog_register_device(&coh901327_wdt);
> -	if (ret)
> -		goto out_no_wdog;
> -
> -	dev_info(dev, "initialized. (timeout=%d sec)\n",
> -			coh901327_wdt.timeout);
> -	return 0;
> -
> -out_no_wdog:
> -	free_irq(irq, pdev);
> -out_no_irq:
> -	clk_disable_unprepare(clk);
> -out_no_clk_enable:
> -	clk_put(clk);
> -	return ret;
> -}
> -
> -#ifdef CONFIG_PM
> -
> -static u16 wdogenablestore;
> -static u16 irqmaskstore;
> -
> -static int coh901327_suspend(struct platform_device *pdev, pm_message_t state)
> -{
> -	irqmaskstore = readw(virtbase + U300_WDOG_IMR) & 0x0001U;
> -	wdogenablestore = readw(virtbase + U300_WDOG_D2R);
> -	/* If watchdog is on, disable it here and now */
> -	if (wdogenablestore == U300_WDOG_D2R_DISABLE_STATUS_ENABLED)
> -		coh901327_disable();
> -	return 0;
> -}
> -
> -static int coh901327_resume(struct platform_device *pdev)
> -{
> -	/* Restore the watchdog interrupt */
> -	writew(irqmaskstore, virtbase + U300_WDOG_IMR);
> -	if (wdogenablestore == U300_WDOG_D2R_DISABLE_STATUS_ENABLED) {
> -		/* Restart the watchdog timer */
> -		writew(U300_WDOG_RR_RESTART_VALUE_RESUME,
> -		       virtbase + U300_WDOG_RR);
> -		writew(U300_WDOG_FR_FEED_RESTART_TIMER,
> -		       virtbase + U300_WDOG_FR);
> -	}
> -	return 0;
> -}
> -#else
> -#define coh901327_suspend NULL
> -#define coh901327_resume  NULL
> -#endif
> -
> -/*
> - * Mistreating the watchdog is the only way to perform a software reset of the
> - * system on EMP platforms. So we implement this and export a symbol for it.
> - */
> -void coh901327_watchdog_reset(void)
> -{
> -	/* Enable even if on JTAG too */
> -	writew(U300_WDOG_JOR_JTAG_WATCHDOG_ENABLE,
> -	       virtbase + U300_WDOG_JOR);
> -	/*
> -	 * Timeout = 5s, we have to wait for the watchdog reset to
> -	 * actually take place: the watchdog will be reloaded with the
> -	 * default value immediately, so we HAVE to reboot and get back
> -	 * into the kernel in 30s, or the device will reboot again!
> -	 * The boot loader will typically deactivate the watchdog, so we
> -	 * need time enough for the boot loader to get to the point of
> -	 * deactivating the watchdog before it is shut down by it.
> -	 *
> -	 * NOTE: on future versions of the watchdog, this restriction is
> -	 * gone: the watchdog will be reloaded with a default value (1 min)
> -	 * instead of last value, and you can conveniently set the watchdog
> -	 * timeout to 10ms (value = 1) without any problems.
> -	 */
> -	coh901327_enable(500);
> -	/* Return and await doom */
> -}
> -
> -static const struct of_device_id coh901327_dt_match[] = {
> -	{ .compatible = "stericsson,coh901327" },
> -	{},
> -};
> -
> -static struct platform_driver coh901327_driver = {
> -	.driver = {
> -		.name	= "coh901327_wdog",
> -		.of_match_table = coh901327_dt_match,
> -		.suppress_bind_attrs = true,
> -	},
> -	.suspend	= coh901327_suspend,
> -	.resume		= coh901327_resume,
> -};
> -builtin_platform_driver_probe(coh901327_driver, coh901327_probe);
> -
> -/* not really modular, but ... */
> -module_param(margin, uint, 0);
> -MODULE_PARM_DESC(margin, "Watchdog margin in seconds (default 60s)");
> -- 
> 2.29.2
> 

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [PATCH 1/5] watchdog: remove sirf prima driver
  2021-01-20 16:27   ` Arnd Bergmann
@ 2021-01-20 21:15     ` Barry Song
  -1 siblings, 0 replies; 38+ messages in thread
From: Barry Song @ 2021-01-20 21:15 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: linux-arm-kernel, LKML, linux-watchdog, Guenter Roeck,
	Wim Van Sebroeck, Arnd Bergmann

Arnd Bergmann <arnd@kernel.org> 于2021年1月21日周四 上午5:27写道:
>
> From: Arnd Bergmann <arnd@arndb.de>
>
> The CSR SiRF prima2/atlas platforms are getting removed, so this driver
> is no longer needed.
>
> Cc: Barry Song <baohua@kernel.org>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Acked-by: Barry Song <baohua@kernel.org>

> ---
>  .../bindings/watchdog/sirfsoc_wdt.txt         |  18 --
>  drivers/watchdog/Kconfig                      |  10 -
>  drivers/watchdog/Makefile                     |   1 -
>  drivers/watchdog/sirfsoc_wdt.c                | 216 ------------------
>  4 files changed, 245 deletions(-)
>  delete mode 100644 Documentation/devicetree/bindings/watchdog/sirfsoc_wdt.txt
>  delete mode 100644 drivers/watchdog/sirfsoc_wdt.c
>
> diff --git a/Documentation/devicetree/bindings/watchdog/sirfsoc_wdt.txt b/Documentation/devicetree/bindings/watchdog/sirfsoc_wdt.txt
> deleted file mode 100644
> index 0dce5e3100b4..000000000000
> --- a/Documentation/devicetree/bindings/watchdog/sirfsoc_wdt.txt
> +++ /dev/null
> @@ -1,18 +0,0 @@
> -SiRFSoC Timer and Watchdog Timer(WDT) Controller
> -
> -Required properties:
> -- compatible: "sirf,prima2-tick"
> -- reg: Address range of tick timer/WDT register set
> -- interrupts: interrupt number to the cpu
> -
> -Optional properties:
> -- timeout-sec : Contains the watchdog timeout in seconds
> -
> -Example:
> -
> -timer@b0020000 {
> -       compatible = "sirf,prima2-tick";
> -       reg = <0xb0020000 0x1000>;
> -       interrupts = <0>;
> -       timeout-sec = <30>;
> -};
> diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
> index 7ff941e71b79..88f4827849e4 100644
> --- a/drivers/watchdog/Kconfig
> +++ b/drivers/watchdog/Kconfig
> @@ -788,16 +788,6 @@ config MOXART_WDT
>           To compile this driver as a module, choose M here: the
>           module will be called moxart_wdt.
>
> -config SIRFSOC_WATCHDOG
> -       tristate "SiRFSOC watchdog"
> -       depends on HAS_IOMEM
> -       depends on ARCH_SIRF || COMPILE_TEST
> -       select WATCHDOG_CORE
> -       default y
> -       help
> -         Support for CSR SiRFprimaII and SiRFatlasVI watchdog. When
> -         the watchdog triggers the system will be reset.
> -
>  config ST_LPC_WATCHDOG
>         tristate "STMicroelectronics LPC Watchdog"
>         depends on ARCH_STI || COMPILE_TEST
> diff --git a/drivers/watchdog/Makefile b/drivers/watchdog/Makefile
> index 5c74ee19d441..1741ed3c6ce6 100644
> --- a/drivers/watchdog/Makefile
> +++ b/drivers/watchdog/Makefile
> @@ -73,7 +73,6 @@ obj-$(CONFIG_UX500_WATCHDOG) += ux500_wdt.o
>  obj-$(CONFIG_RETU_WATCHDOG) += retu_wdt.o
>  obj-$(CONFIG_BCM2835_WDT) += bcm2835_wdt.o
>  obj-$(CONFIG_MOXART_WDT) += moxart_wdt.o
> -obj-$(CONFIG_SIRFSOC_WATCHDOG) += sirfsoc_wdt.o
>  obj-$(CONFIG_ST_LPC_WATCHDOG) += st_lpc_wdt.o
>  obj-$(CONFIG_QCOM_WDT) += qcom-wdt.o
>  obj-$(CONFIG_BCM_KONA_WDT) += bcm_kona_wdt.o
> diff --git a/drivers/watchdog/sirfsoc_wdt.c b/drivers/watchdog/sirfsoc_wdt.c
> deleted file mode 100644
> index 734cf2966ecb..000000000000
> --- a/drivers/watchdog/sirfsoc_wdt.c
> +++ /dev/null
> @@ -1,216 +0,0 @@
> -// SPDX-License-Identifier: GPL-2.0-or-later
> -/*
> - * Watchdog driver for CSR SiRFprimaII and SiRFatlasVI
> - *
> - * Copyright (c) 2013 Cambridge Silicon Radio Limited, a CSR plc group company.
> - */
> -
> -#include <linux/module.h>
> -#include <linux/watchdog.h>
> -#include <linux/platform_device.h>
> -#include <linux/moduleparam.h>
> -#include <linux/of.h>
> -#include <linux/io.h>
> -#include <linux/uaccess.h>
> -
> -#define CLOCK_FREQ     1000000
> -
> -#define SIRFSOC_TIMER_COUNTER_LO       0x0000
> -#define SIRFSOC_TIMER_MATCH_0          0x0008
> -#define SIRFSOC_TIMER_INT_EN           0x0024
> -#define SIRFSOC_TIMER_WATCHDOG_EN      0x0028
> -#define SIRFSOC_TIMER_LATCH            0x0030
> -#define SIRFSOC_TIMER_LATCHED_LO       0x0034
> -
> -#define SIRFSOC_TIMER_WDT_INDEX                5
> -
> -#define SIRFSOC_WDT_MIN_TIMEOUT                30              /* 30 secs */
> -#define SIRFSOC_WDT_MAX_TIMEOUT                (10 * 60)       /* 10 mins */
> -#define SIRFSOC_WDT_DEFAULT_TIMEOUT    30              /* 30 secs */
> -
> -static unsigned int timeout;
> -static bool nowayout = WATCHDOG_NOWAYOUT;
> -
> -module_param(timeout, uint, 0);
> -module_param(nowayout, bool, 0);
> -
> -MODULE_PARM_DESC(timeout, "Default watchdog timeout (in seconds)");
> -MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default="
> -                       __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
> -
> -static void __iomem *sirfsoc_wdt_base(struct watchdog_device *wdd)
> -{
> -       return (void __iomem __force *)watchdog_get_drvdata(wdd);
> -}
> -
> -static unsigned int sirfsoc_wdt_gettimeleft(struct watchdog_device *wdd)
> -{
> -       u32 counter, match;
> -       void __iomem *wdt_base;
> -       int time_left;
> -
> -       wdt_base = sirfsoc_wdt_base(wdd);
> -       counter = readl(wdt_base + SIRFSOC_TIMER_COUNTER_LO);
> -       match = readl(wdt_base +
> -               SIRFSOC_TIMER_MATCH_0 + (SIRFSOC_TIMER_WDT_INDEX << 2));
> -
> -       time_left = match - counter;
> -
> -       return time_left / CLOCK_FREQ;
> -}
> -
> -static int sirfsoc_wdt_updatetimeout(struct watchdog_device *wdd)
> -{
> -       u32 counter, timeout_ticks;
> -       void __iomem *wdt_base;
> -
> -       timeout_ticks = wdd->timeout * CLOCK_FREQ;
> -       wdt_base = sirfsoc_wdt_base(wdd);
> -
> -       /* Enable the latch before reading the LATCH_LO register */
> -       writel(1, wdt_base + SIRFSOC_TIMER_LATCH);
> -
> -       /* Set the TO value */
> -       counter = readl(wdt_base + SIRFSOC_TIMER_LATCHED_LO);
> -
> -       counter += timeout_ticks;
> -
> -       writel(counter, wdt_base +
> -               SIRFSOC_TIMER_MATCH_0 + (SIRFSOC_TIMER_WDT_INDEX << 2));
> -
> -       return 0;
> -}
> -
> -static int sirfsoc_wdt_enable(struct watchdog_device *wdd)
> -{
> -       void __iomem *wdt_base = sirfsoc_wdt_base(wdd);
> -       sirfsoc_wdt_updatetimeout(wdd);
> -
> -       /*
> -        * NOTE: If interrupt is not enabled
> -        * then WD-Reset doesn't get generated at all.
> -        */
> -       writel(readl(wdt_base + SIRFSOC_TIMER_INT_EN)
> -               | (1 << SIRFSOC_TIMER_WDT_INDEX),
> -               wdt_base + SIRFSOC_TIMER_INT_EN);
> -       writel(1, wdt_base + SIRFSOC_TIMER_WATCHDOG_EN);
> -
> -       return 0;
> -}
> -
> -static int sirfsoc_wdt_disable(struct watchdog_device *wdd)
> -{
> -       void __iomem *wdt_base = sirfsoc_wdt_base(wdd);
> -
> -       writel(0, wdt_base + SIRFSOC_TIMER_WATCHDOG_EN);
> -       writel(readl(wdt_base + SIRFSOC_TIMER_INT_EN)
> -               & (~(1 << SIRFSOC_TIMER_WDT_INDEX)),
> -               wdt_base + SIRFSOC_TIMER_INT_EN);
> -
> -       return 0;
> -}
> -
> -static int sirfsoc_wdt_settimeout(struct watchdog_device *wdd, unsigned int to)
> -{
> -       wdd->timeout = to;
> -       sirfsoc_wdt_updatetimeout(wdd);
> -
> -       return 0;
> -}
> -
> -#define OPTIONS (WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING | WDIOF_MAGICCLOSE)
> -
> -static const struct watchdog_info sirfsoc_wdt_ident = {
> -       .options          =     OPTIONS,
> -       .firmware_version =     0,
> -       .identity         =     "SiRFSOC Watchdog",
> -};
> -
> -static const struct watchdog_ops sirfsoc_wdt_ops = {
> -       .owner = THIS_MODULE,
> -       .start = sirfsoc_wdt_enable,
> -       .stop = sirfsoc_wdt_disable,
> -       .get_timeleft = sirfsoc_wdt_gettimeleft,
> -       .ping = sirfsoc_wdt_updatetimeout,
> -       .set_timeout = sirfsoc_wdt_settimeout,
> -};
> -
> -static struct watchdog_device sirfsoc_wdd = {
> -       .info = &sirfsoc_wdt_ident,
> -       .ops = &sirfsoc_wdt_ops,
> -       .timeout = SIRFSOC_WDT_DEFAULT_TIMEOUT,
> -       .min_timeout = SIRFSOC_WDT_MIN_TIMEOUT,
> -       .max_timeout = SIRFSOC_WDT_MAX_TIMEOUT,
> -};
> -
> -static int sirfsoc_wdt_probe(struct platform_device *pdev)
> -{
> -       struct device *dev = &pdev->dev;
> -       int ret;
> -       void __iomem *base;
> -
> -       base = devm_platform_ioremap_resource(pdev, 0);
> -       if (IS_ERR(base))
> -               return PTR_ERR(base);
> -
> -       watchdog_set_drvdata(&sirfsoc_wdd, (__force void *)base);
> -
> -       watchdog_init_timeout(&sirfsoc_wdd, timeout, dev);
> -       watchdog_set_nowayout(&sirfsoc_wdd, nowayout);
> -       sirfsoc_wdd.parent = dev;
> -
> -       watchdog_stop_on_reboot(&sirfsoc_wdd);
> -       watchdog_stop_on_unregister(&sirfsoc_wdd);
> -       ret = devm_watchdog_register_device(dev, &sirfsoc_wdd);
> -       if (ret)
> -               return ret;
> -
> -       platform_set_drvdata(pdev, &sirfsoc_wdd);
> -
> -       return 0;
> -}
> -
> -#ifdef CONFIG_PM_SLEEP
> -static int sirfsoc_wdt_suspend(struct device *dev)
> -{
> -       return 0;
> -}
> -
> -static int sirfsoc_wdt_resume(struct device *dev)
> -{
> -       struct watchdog_device *wdd = dev_get_drvdata(dev);
> -
> -       /*
> -        * NOTE: Since timer controller registers settings are saved
> -        * and restored back by the timer-prima2.c, so we need not
> -        * update WD settings except refreshing timeout.
> -        */
> -       sirfsoc_wdt_updatetimeout(wdd);
> -
> -       return 0;
> -}
> -#endif
> -
> -static SIMPLE_DEV_PM_OPS(sirfsoc_wdt_pm_ops,
> -               sirfsoc_wdt_suspend, sirfsoc_wdt_resume);
> -
> -static const struct of_device_id sirfsoc_wdt_of_match[] = {
> -       { .compatible = "sirf,prima2-tick"},
> -       {},
> -};
> -MODULE_DEVICE_TABLE(of, sirfsoc_wdt_of_match);
> -
> -static struct platform_driver sirfsoc_wdt_driver = {
> -       .driver = {
> -               .name = "sirfsoc-wdt",
> -               .pm = &sirfsoc_wdt_pm_ops,
> -               .of_match_table = sirfsoc_wdt_of_match,
> -       },
> -       .probe = sirfsoc_wdt_probe,
> -};
> -module_platform_driver(sirfsoc_wdt_driver);
> -
> -MODULE_DESCRIPTION("SiRF SoC watchdog driver");
> -MODULE_AUTHOR("Xianglong Du <Xianglong.Du@csr.com>");
> -MODULE_LICENSE("GPL v2");
> -MODULE_ALIAS("platform:sirfsoc-wdt");
> --
> 2.29.2
>

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [PATCH 1/5] watchdog: remove sirf prima driver
@ 2021-01-20 21:15     ` Barry Song
  0 siblings, 0 replies; 38+ messages in thread
From: Barry Song @ 2021-01-20 21:15 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: linux-watchdog, Arnd Bergmann, LKML, linux-arm-kernel,
	Wim Van Sebroeck, Guenter Roeck

Arnd Bergmann <arnd@kernel.org> 于2021年1月21日周四 上午5:27写道:
>
> From: Arnd Bergmann <arnd@arndb.de>
>
> The CSR SiRF prima2/atlas platforms are getting removed, so this driver
> is no longer needed.
>
> Cc: Barry Song <baohua@kernel.org>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Acked-by: Barry Song <baohua@kernel.org>

> ---
>  .../bindings/watchdog/sirfsoc_wdt.txt         |  18 --
>  drivers/watchdog/Kconfig                      |  10 -
>  drivers/watchdog/Makefile                     |   1 -
>  drivers/watchdog/sirfsoc_wdt.c                | 216 ------------------
>  4 files changed, 245 deletions(-)
>  delete mode 100644 Documentation/devicetree/bindings/watchdog/sirfsoc_wdt.txt
>  delete mode 100644 drivers/watchdog/sirfsoc_wdt.c
>
> diff --git a/Documentation/devicetree/bindings/watchdog/sirfsoc_wdt.txt b/Documentation/devicetree/bindings/watchdog/sirfsoc_wdt.txt
> deleted file mode 100644
> index 0dce5e3100b4..000000000000
> --- a/Documentation/devicetree/bindings/watchdog/sirfsoc_wdt.txt
> +++ /dev/null
> @@ -1,18 +0,0 @@
> -SiRFSoC Timer and Watchdog Timer(WDT) Controller
> -
> -Required properties:
> -- compatible: "sirf,prima2-tick"
> -- reg: Address range of tick timer/WDT register set
> -- interrupts: interrupt number to the cpu
> -
> -Optional properties:
> -- timeout-sec : Contains the watchdog timeout in seconds
> -
> -Example:
> -
> -timer@b0020000 {
> -       compatible = "sirf,prima2-tick";
> -       reg = <0xb0020000 0x1000>;
> -       interrupts = <0>;
> -       timeout-sec = <30>;
> -};
> diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
> index 7ff941e71b79..88f4827849e4 100644
> --- a/drivers/watchdog/Kconfig
> +++ b/drivers/watchdog/Kconfig
> @@ -788,16 +788,6 @@ config MOXART_WDT
>           To compile this driver as a module, choose M here: the
>           module will be called moxart_wdt.
>
> -config SIRFSOC_WATCHDOG
> -       tristate "SiRFSOC watchdog"
> -       depends on HAS_IOMEM
> -       depends on ARCH_SIRF || COMPILE_TEST
> -       select WATCHDOG_CORE
> -       default y
> -       help
> -         Support for CSR SiRFprimaII and SiRFatlasVI watchdog. When
> -         the watchdog triggers the system will be reset.
> -
>  config ST_LPC_WATCHDOG
>         tristate "STMicroelectronics LPC Watchdog"
>         depends on ARCH_STI || COMPILE_TEST
> diff --git a/drivers/watchdog/Makefile b/drivers/watchdog/Makefile
> index 5c74ee19d441..1741ed3c6ce6 100644
> --- a/drivers/watchdog/Makefile
> +++ b/drivers/watchdog/Makefile
> @@ -73,7 +73,6 @@ obj-$(CONFIG_UX500_WATCHDOG) += ux500_wdt.o
>  obj-$(CONFIG_RETU_WATCHDOG) += retu_wdt.o
>  obj-$(CONFIG_BCM2835_WDT) += bcm2835_wdt.o
>  obj-$(CONFIG_MOXART_WDT) += moxart_wdt.o
> -obj-$(CONFIG_SIRFSOC_WATCHDOG) += sirfsoc_wdt.o
>  obj-$(CONFIG_ST_LPC_WATCHDOG) += st_lpc_wdt.o
>  obj-$(CONFIG_QCOM_WDT) += qcom-wdt.o
>  obj-$(CONFIG_BCM_KONA_WDT) += bcm_kona_wdt.o
> diff --git a/drivers/watchdog/sirfsoc_wdt.c b/drivers/watchdog/sirfsoc_wdt.c
> deleted file mode 100644
> index 734cf2966ecb..000000000000
> --- a/drivers/watchdog/sirfsoc_wdt.c
> +++ /dev/null
> @@ -1,216 +0,0 @@
> -// SPDX-License-Identifier: GPL-2.0-or-later
> -/*
> - * Watchdog driver for CSR SiRFprimaII and SiRFatlasVI
> - *
> - * Copyright (c) 2013 Cambridge Silicon Radio Limited, a CSR plc group company.
> - */
> -
> -#include <linux/module.h>
> -#include <linux/watchdog.h>
> -#include <linux/platform_device.h>
> -#include <linux/moduleparam.h>
> -#include <linux/of.h>
> -#include <linux/io.h>
> -#include <linux/uaccess.h>
> -
> -#define CLOCK_FREQ     1000000
> -
> -#define SIRFSOC_TIMER_COUNTER_LO       0x0000
> -#define SIRFSOC_TIMER_MATCH_0          0x0008
> -#define SIRFSOC_TIMER_INT_EN           0x0024
> -#define SIRFSOC_TIMER_WATCHDOG_EN      0x0028
> -#define SIRFSOC_TIMER_LATCH            0x0030
> -#define SIRFSOC_TIMER_LATCHED_LO       0x0034
> -
> -#define SIRFSOC_TIMER_WDT_INDEX                5
> -
> -#define SIRFSOC_WDT_MIN_TIMEOUT                30              /* 30 secs */
> -#define SIRFSOC_WDT_MAX_TIMEOUT                (10 * 60)       /* 10 mins */
> -#define SIRFSOC_WDT_DEFAULT_TIMEOUT    30              /* 30 secs */
> -
> -static unsigned int timeout;
> -static bool nowayout = WATCHDOG_NOWAYOUT;
> -
> -module_param(timeout, uint, 0);
> -module_param(nowayout, bool, 0);
> -
> -MODULE_PARM_DESC(timeout, "Default watchdog timeout (in seconds)");
> -MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default="
> -                       __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
> -
> -static void __iomem *sirfsoc_wdt_base(struct watchdog_device *wdd)
> -{
> -       return (void __iomem __force *)watchdog_get_drvdata(wdd);
> -}
> -
> -static unsigned int sirfsoc_wdt_gettimeleft(struct watchdog_device *wdd)
> -{
> -       u32 counter, match;
> -       void __iomem *wdt_base;
> -       int time_left;
> -
> -       wdt_base = sirfsoc_wdt_base(wdd);
> -       counter = readl(wdt_base + SIRFSOC_TIMER_COUNTER_LO);
> -       match = readl(wdt_base +
> -               SIRFSOC_TIMER_MATCH_0 + (SIRFSOC_TIMER_WDT_INDEX << 2));
> -
> -       time_left = match - counter;
> -
> -       return time_left / CLOCK_FREQ;
> -}
> -
> -static int sirfsoc_wdt_updatetimeout(struct watchdog_device *wdd)
> -{
> -       u32 counter, timeout_ticks;
> -       void __iomem *wdt_base;
> -
> -       timeout_ticks = wdd->timeout * CLOCK_FREQ;
> -       wdt_base = sirfsoc_wdt_base(wdd);
> -
> -       /* Enable the latch before reading the LATCH_LO register */
> -       writel(1, wdt_base + SIRFSOC_TIMER_LATCH);
> -
> -       /* Set the TO value */
> -       counter = readl(wdt_base + SIRFSOC_TIMER_LATCHED_LO);
> -
> -       counter += timeout_ticks;
> -
> -       writel(counter, wdt_base +
> -               SIRFSOC_TIMER_MATCH_0 + (SIRFSOC_TIMER_WDT_INDEX << 2));
> -
> -       return 0;
> -}
> -
> -static int sirfsoc_wdt_enable(struct watchdog_device *wdd)
> -{
> -       void __iomem *wdt_base = sirfsoc_wdt_base(wdd);
> -       sirfsoc_wdt_updatetimeout(wdd);
> -
> -       /*
> -        * NOTE: If interrupt is not enabled
> -        * then WD-Reset doesn't get generated at all.
> -        */
> -       writel(readl(wdt_base + SIRFSOC_TIMER_INT_EN)
> -               | (1 << SIRFSOC_TIMER_WDT_INDEX),
> -               wdt_base + SIRFSOC_TIMER_INT_EN);
> -       writel(1, wdt_base + SIRFSOC_TIMER_WATCHDOG_EN);
> -
> -       return 0;
> -}
> -
> -static int sirfsoc_wdt_disable(struct watchdog_device *wdd)
> -{
> -       void __iomem *wdt_base = sirfsoc_wdt_base(wdd);
> -
> -       writel(0, wdt_base + SIRFSOC_TIMER_WATCHDOG_EN);
> -       writel(readl(wdt_base + SIRFSOC_TIMER_INT_EN)
> -               & (~(1 << SIRFSOC_TIMER_WDT_INDEX)),
> -               wdt_base + SIRFSOC_TIMER_INT_EN);
> -
> -       return 0;
> -}
> -
> -static int sirfsoc_wdt_settimeout(struct watchdog_device *wdd, unsigned int to)
> -{
> -       wdd->timeout = to;
> -       sirfsoc_wdt_updatetimeout(wdd);
> -
> -       return 0;
> -}
> -
> -#define OPTIONS (WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING | WDIOF_MAGICCLOSE)
> -
> -static const struct watchdog_info sirfsoc_wdt_ident = {
> -       .options          =     OPTIONS,
> -       .firmware_version =     0,
> -       .identity         =     "SiRFSOC Watchdog",
> -};
> -
> -static const struct watchdog_ops sirfsoc_wdt_ops = {
> -       .owner = THIS_MODULE,
> -       .start = sirfsoc_wdt_enable,
> -       .stop = sirfsoc_wdt_disable,
> -       .get_timeleft = sirfsoc_wdt_gettimeleft,
> -       .ping = sirfsoc_wdt_updatetimeout,
> -       .set_timeout = sirfsoc_wdt_settimeout,
> -};
> -
> -static struct watchdog_device sirfsoc_wdd = {
> -       .info = &sirfsoc_wdt_ident,
> -       .ops = &sirfsoc_wdt_ops,
> -       .timeout = SIRFSOC_WDT_DEFAULT_TIMEOUT,
> -       .min_timeout = SIRFSOC_WDT_MIN_TIMEOUT,
> -       .max_timeout = SIRFSOC_WDT_MAX_TIMEOUT,
> -};
> -
> -static int sirfsoc_wdt_probe(struct platform_device *pdev)
> -{
> -       struct device *dev = &pdev->dev;
> -       int ret;
> -       void __iomem *base;
> -
> -       base = devm_platform_ioremap_resource(pdev, 0);
> -       if (IS_ERR(base))
> -               return PTR_ERR(base);
> -
> -       watchdog_set_drvdata(&sirfsoc_wdd, (__force void *)base);
> -
> -       watchdog_init_timeout(&sirfsoc_wdd, timeout, dev);
> -       watchdog_set_nowayout(&sirfsoc_wdd, nowayout);
> -       sirfsoc_wdd.parent = dev;
> -
> -       watchdog_stop_on_reboot(&sirfsoc_wdd);
> -       watchdog_stop_on_unregister(&sirfsoc_wdd);
> -       ret = devm_watchdog_register_device(dev, &sirfsoc_wdd);
> -       if (ret)
> -               return ret;
> -
> -       platform_set_drvdata(pdev, &sirfsoc_wdd);
> -
> -       return 0;
> -}
> -
> -#ifdef CONFIG_PM_SLEEP
> -static int sirfsoc_wdt_suspend(struct device *dev)
> -{
> -       return 0;
> -}
> -
> -static int sirfsoc_wdt_resume(struct device *dev)
> -{
> -       struct watchdog_device *wdd = dev_get_drvdata(dev);
> -
> -       /*
> -        * NOTE: Since timer controller registers settings are saved
> -        * and restored back by the timer-prima2.c, so we need not
> -        * update WD settings except refreshing timeout.
> -        */
> -       sirfsoc_wdt_updatetimeout(wdd);
> -
> -       return 0;
> -}
> -#endif
> -
> -static SIMPLE_DEV_PM_OPS(sirfsoc_wdt_pm_ops,
> -               sirfsoc_wdt_suspend, sirfsoc_wdt_resume);
> -
> -static const struct of_device_id sirfsoc_wdt_of_match[] = {
> -       { .compatible = "sirf,prima2-tick"},
> -       {},
> -};
> -MODULE_DEVICE_TABLE(of, sirfsoc_wdt_of_match);
> -
> -static struct platform_driver sirfsoc_wdt_driver = {
> -       .driver = {
> -               .name = "sirfsoc-wdt",
> -               .pm = &sirfsoc_wdt_pm_ops,
> -               .of_match_table = sirfsoc_wdt_of_match,
> -       },
> -       .probe = sirfsoc_wdt_probe,
> -};
> -module_platform_driver(sirfsoc_wdt_driver);
> -
> -MODULE_DESCRIPTION("SiRF SoC watchdog driver");
> -MODULE_AUTHOR("Xianglong Du <Xianglong.Du@csr.com>");
> -MODULE_LICENSE("GPL v2");
> -MODULE_ALIAS("platform:sirfsoc-wdt");
> --
> 2.29.2
>

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [PATCH 2/5] watchdog: remove sirf atlas driver
  2021-01-20 16:27   ` Arnd Bergmann
@ 2021-01-20 21:17     ` Barry Song
  -1 siblings, 0 replies; 38+ messages in thread
From: Barry Song @ 2021-01-20 21:17 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: linux-arm-kernel, LKML, linux-watchdog, Guenter Roeck,
	Wim Van Sebroeck, Arnd Bergmann

Arnd Bergmann <arnd@kernel.org> 于2021年1月21日周四 上午5:27写道:
>
> From: Arnd Bergmann <arnd@arndb.de>
>
> The CSR SiRF prima2/atlas platforms are getting removed, so this driver
> is no longer needed.
>
> Cc: Barry Song <baohua@kernel.org>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Acked-by: Barry Song <baohua@kernel.org>

> ---
>  drivers/watchdog/Kconfig      |  10 --
>  drivers/watchdog/Makefile     |   1 -
>  drivers/watchdog/atlas7_wdt.c | 221 ----------------------------------
>  3 files changed, 232 deletions(-)
>  delete mode 100644 drivers/watchdog/atlas7_wdt.c
>
> diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
> index 88f4827849e4..5559e4325f6a 100644
> --- a/drivers/watchdog/Kconfig
> +++ b/drivers/watchdog/Kconfig
> @@ -890,16 +890,6 @@ config LPC18XX_WATCHDOG
>           To compile this driver as a module, choose M here: the
>           module will be called lpc18xx_wdt.
>
> -config ATLAS7_WATCHDOG
> -       tristate "CSRatlas7 watchdog"
> -       depends on ARCH_ATLAS7 || COMPILE_TEST
> -       help
> -         Say Y here to include Watchdog timer support for the watchdog
> -         existing on the CSRatlas7 series platforms.
> -
> -         To compile this driver as a module, choose M here: the
> -         module will be called atlas7_wdt.
> -
>  config RENESAS_WDT
>         tristate "Renesas WDT Watchdog"
>         depends on ARCH_RENESAS || COMPILE_TEST
> diff --git a/drivers/watchdog/Makefile b/drivers/watchdog/Makefile
> index 1741ed3c6ce6..40b94403c487 100644
> --- a/drivers/watchdog/Makefile
> +++ b/drivers/watchdog/Makefile
> @@ -83,7 +83,6 @@ obj-$(CONFIG_MEDIATEK_WATCHDOG) += mtk_wdt.o
>  obj-$(CONFIG_DIGICOLOR_WATCHDOG) += digicolor_wdt.o
>  obj-$(CONFIG_LPC18XX_WATCHDOG) += lpc18xx_wdt.o
>  obj-$(CONFIG_BCM7038_WDT) += bcm7038_wdt.o
> -obj-$(CONFIG_ATLAS7_WATCHDOG) += atlas7_wdt.o
>  obj-$(CONFIG_RENESAS_WDT) += renesas_wdt.o
>  obj-$(CONFIG_RENESAS_RZAWDT) += rza_wdt.o
>  obj-$(CONFIG_ASPEED_WATCHDOG) += aspeed_wdt.o
> diff --git a/drivers/watchdog/atlas7_wdt.c b/drivers/watchdog/atlas7_wdt.c
> deleted file mode 100644
> index 9bfe650d802f..000000000000
> --- a/drivers/watchdog/atlas7_wdt.c
> +++ /dev/null
> @@ -1,221 +0,0 @@
> -// SPDX-License-Identifier: GPL-2.0-only
> -/*
> - * Watchdog driver for CSR Atlas7
> - *
> - * Copyright (c) 2015 Cambridge Silicon Radio Limited, a CSR plc group company.
> - */
> -
> -#include <linux/clk.h>
> -#include <linux/io.h>
> -#include <linux/module.h>
> -#include <linux/moduleparam.h>
> -#include <linux/of.h>
> -#include <linux/platform_device.h>
> -#include <linux/watchdog.h>
> -
> -#define ATLAS7_TIMER_WDT_INDEX         5
> -#define ATLAS7_WDT_DEFAULT_TIMEOUT     20
> -
> -#define ATLAS7_WDT_CNT_CTRL    (0 + 4 * ATLAS7_TIMER_WDT_INDEX)
> -#define ATLAS7_WDT_CNT_MATCH   (0x18 + 4 * ATLAS7_TIMER_WDT_INDEX)
> -#define ATLAS7_WDT_CNT         (0x48 +  4 * ATLAS7_TIMER_WDT_INDEX)
> -#define ATLAS7_WDT_CNT_EN      (BIT(0) | BIT(1))
> -#define ATLAS7_WDT_EN          0x64
> -
> -static unsigned int timeout = ATLAS7_WDT_DEFAULT_TIMEOUT;
> -static bool nowayout = WATCHDOG_NOWAYOUT;
> -
> -module_param(timeout, uint, 0);
> -module_param(nowayout, bool, 0);
> -
> -MODULE_PARM_DESC(timeout, "Default watchdog timeout (in seconds)");
> -MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default="
> -                       __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
> -
> -struct atlas7_wdog {
> -       struct device *dev;
> -       void __iomem *base;
> -       unsigned long tick_rate;
> -       struct clk *clk;
> -};
> -
> -static unsigned int atlas7_wdt_gettimeleft(struct watchdog_device *wdd)
> -{
> -       struct atlas7_wdog *wdt = watchdog_get_drvdata(wdd);
> -       u32 counter, match, delta;
> -
> -       counter = readl(wdt->base + ATLAS7_WDT_CNT);
> -       match = readl(wdt->base + ATLAS7_WDT_CNT_MATCH);
> -       delta = match - counter;
> -
> -       return  delta / wdt->tick_rate;
> -}
> -
> -static int atlas7_wdt_ping(struct watchdog_device *wdd)
> -{
> -       struct atlas7_wdog *wdt = watchdog_get_drvdata(wdd);
> -       u32 counter, match, delta;
> -
> -       counter = readl(wdt->base + ATLAS7_WDT_CNT);
> -       delta = wdd->timeout * wdt->tick_rate;
> -       match = counter + delta;
> -
> -       writel(match, wdt->base + ATLAS7_WDT_CNT_MATCH);
> -
> -       return 0;
> -}
> -
> -static int atlas7_wdt_enable(struct watchdog_device *wdd)
> -{
> -       struct atlas7_wdog *wdt = watchdog_get_drvdata(wdd);
> -
> -       atlas7_wdt_ping(wdd);
> -
> -       writel(readl(wdt->base + ATLAS7_WDT_CNT_CTRL) | ATLAS7_WDT_CNT_EN,
> -             wdt->base + ATLAS7_WDT_CNT_CTRL);
> -       writel(1, wdt->base + ATLAS7_WDT_EN);
> -
> -       return 0;
> -}
> -
> -static int atlas7_wdt_disable(struct watchdog_device *wdd)
> -{
> -       struct atlas7_wdog *wdt = watchdog_get_drvdata(wdd);
> -
> -       writel(0, wdt->base + ATLAS7_WDT_EN);
> -       writel(readl(wdt->base + ATLAS7_WDT_CNT_CTRL) & ~ATLAS7_WDT_CNT_EN,
> -             wdt->base + ATLAS7_WDT_CNT_CTRL);
> -
> -       return 0;
> -}
> -
> -static int atlas7_wdt_settimeout(struct watchdog_device *wdd, unsigned int to)
> -{
> -       wdd->timeout = to;
> -
> -       return 0;
> -}
> -
> -#define OPTIONS (WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING | WDIOF_MAGICCLOSE)
> -
> -static const struct watchdog_info atlas7_wdt_ident = {
> -       .options = OPTIONS,
> -       .firmware_version = 0,
> -       .identity = "atlas7 Watchdog",
> -};
> -
> -static const struct watchdog_ops atlas7_wdt_ops = {
> -       .owner = THIS_MODULE,
> -       .start = atlas7_wdt_enable,
> -       .stop = atlas7_wdt_disable,
> -       .get_timeleft = atlas7_wdt_gettimeleft,
> -       .ping = atlas7_wdt_ping,
> -       .set_timeout = atlas7_wdt_settimeout,
> -};
> -
> -static struct watchdog_device atlas7_wdd = {
> -       .info = &atlas7_wdt_ident,
> -       .ops = &atlas7_wdt_ops,
> -       .timeout = ATLAS7_WDT_DEFAULT_TIMEOUT,
> -};
> -
> -static const struct of_device_id atlas7_wdt_ids[] = {
> -       { .compatible = "sirf,atlas7-tick"},
> -       {}
> -};
> -
> -static void atlas7_clk_disable_unprepare(void *data)
> -{
> -       clk_disable_unprepare(data);
> -}
> -
> -static int atlas7_wdt_probe(struct platform_device *pdev)
> -{
> -       struct device *dev = &pdev->dev;
> -       struct atlas7_wdog *wdt;
> -       struct clk *clk;
> -       int ret;
> -
> -       wdt = devm_kzalloc(dev, sizeof(*wdt), GFP_KERNEL);
> -       if (!wdt)
> -               return -ENOMEM;
> -       wdt->base = devm_platform_ioremap_resource(pdev, 0);
> -       if (IS_ERR(wdt->base))
> -               return PTR_ERR(wdt->base);
> -
> -       clk = devm_clk_get(dev, NULL);
> -       if (IS_ERR(clk))
> -               return PTR_ERR(clk);
> -       ret = clk_prepare_enable(clk);
> -       if (ret) {
> -               dev_err(dev, "clk enable failed\n");
> -               return ret;
> -       }
> -       ret = devm_add_action_or_reset(dev, atlas7_clk_disable_unprepare, clk);
> -       if (ret)
> -               return ret;
> -
> -       /* disable watchdog hardware */
> -       writel(0, wdt->base + ATLAS7_WDT_CNT_CTRL);
> -
> -       wdt->tick_rate = clk_get_rate(clk);
> -       if (!wdt->tick_rate)
> -               return -EINVAL;
> -
> -       wdt->clk = clk;
> -       atlas7_wdd.min_timeout = 1;
> -       atlas7_wdd.max_timeout = UINT_MAX / wdt->tick_rate;
> -
> -       watchdog_init_timeout(&atlas7_wdd, 0, dev);
> -       watchdog_set_nowayout(&atlas7_wdd, nowayout);
> -
> -       watchdog_set_drvdata(&atlas7_wdd, wdt);
> -       platform_set_drvdata(pdev, &atlas7_wdd);
> -
> -       watchdog_stop_on_reboot(&atlas7_wdd);
> -       watchdog_stop_on_unregister(&atlas7_wdd);
> -       return devm_watchdog_register_device(dev, &atlas7_wdd);
> -}
> -
> -static int __maybe_unused atlas7_wdt_suspend(struct device *dev)
> -{
> -       /*
> -        * NOTE:timer controller registers settings are saved
> -        * and restored back by the timer-atlas7.c
> -        */
> -       return 0;
> -}
> -
> -static int __maybe_unused atlas7_wdt_resume(struct device *dev)
> -{
> -       struct watchdog_device *wdd = dev_get_drvdata(dev);
> -
> -       /*
> -        * NOTE: Since timer controller registers settings are saved
> -        * and restored back by the timer-atlas7.c, so we need not
> -        * update WD settings except refreshing timeout.
> -        */
> -       atlas7_wdt_ping(wdd);
> -
> -       return 0;
> -}
> -
> -static SIMPLE_DEV_PM_OPS(atlas7_wdt_pm_ops,
> -               atlas7_wdt_suspend, atlas7_wdt_resume);
> -
> -MODULE_DEVICE_TABLE(of, atlas7_wdt_ids);
> -
> -static struct platform_driver atlas7_wdt_driver = {
> -       .driver = {
> -               .name = "atlas7-wdt",
> -               .pm = &atlas7_wdt_pm_ops,
> -               .of_match_table = atlas7_wdt_ids,
> -       },
> -       .probe = atlas7_wdt_probe,
> -};
> -module_platform_driver(atlas7_wdt_driver);
> -
> -MODULE_DESCRIPTION("CSRatlas7 watchdog driver");
> -MODULE_AUTHOR("Guo Zeng <Guo.Zeng@csr.com>");
> -MODULE_LICENSE("GPL v2");
> -MODULE_ALIAS("platform:atlas7-wdt");
> --
> 2.29.2
>

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [PATCH 2/5] watchdog: remove sirf atlas driver
@ 2021-01-20 21:17     ` Barry Song
  0 siblings, 0 replies; 38+ messages in thread
From: Barry Song @ 2021-01-20 21:17 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: linux-watchdog, Arnd Bergmann, LKML, linux-arm-kernel,
	Wim Van Sebroeck, Guenter Roeck

Arnd Bergmann <arnd@kernel.org> 于2021年1月21日周四 上午5:27写道:
>
> From: Arnd Bergmann <arnd@arndb.de>
>
> The CSR SiRF prima2/atlas platforms are getting removed, so this driver
> is no longer needed.
>
> Cc: Barry Song <baohua@kernel.org>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Acked-by: Barry Song <baohua@kernel.org>

> ---
>  drivers/watchdog/Kconfig      |  10 --
>  drivers/watchdog/Makefile     |   1 -
>  drivers/watchdog/atlas7_wdt.c | 221 ----------------------------------
>  3 files changed, 232 deletions(-)
>  delete mode 100644 drivers/watchdog/atlas7_wdt.c
>
> diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
> index 88f4827849e4..5559e4325f6a 100644
> --- a/drivers/watchdog/Kconfig
> +++ b/drivers/watchdog/Kconfig
> @@ -890,16 +890,6 @@ config LPC18XX_WATCHDOG
>           To compile this driver as a module, choose M here: the
>           module will be called lpc18xx_wdt.
>
> -config ATLAS7_WATCHDOG
> -       tristate "CSRatlas7 watchdog"
> -       depends on ARCH_ATLAS7 || COMPILE_TEST
> -       help
> -         Say Y here to include Watchdog timer support for the watchdog
> -         existing on the CSRatlas7 series platforms.
> -
> -         To compile this driver as a module, choose M here: the
> -         module will be called atlas7_wdt.
> -
>  config RENESAS_WDT
>         tristate "Renesas WDT Watchdog"
>         depends on ARCH_RENESAS || COMPILE_TEST
> diff --git a/drivers/watchdog/Makefile b/drivers/watchdog/Makefile
> index 1741ed3c6ce6..40b94403c487 100644
> --- a/drivers/watchdog/Makefile
> +++ b/drivers/watchdog/Makefile
> @@ -83,7 +83,6 @@ obj-$(CONFIG_MEDIATEK_WATCHDOG) += mtk_wdt.o
>  obj-$(CONFIG_DIGICOLOR_WATCHDOG) += digicolor_wdt.o
>  obj-$(CONFIG_LPC18XX_WATCHDOG) += lpc18xx_wdt.o
>  obj-$(CONFIG_BCM7038_WDT) += bcm7038_wdt.o
> -obj-$(CONFIG_ATLAS7_WATCHDOG) += atlas7_wdt.o
>  obj-$(CONFIG_RENESAS_WDT) += renesas_wdt.o
>  obj-$(CONFIG_RENESAS_RZAWDT) += rza_wdt.o
>  obj-$(CONFIG_ASPEED_WATCHDOG) += aspeed_wdt.o
> diff --git a/drivers/watchdog/atlas7_wdt.c b/drivers/watchdog/atlas7_wdt.c
> deleted file mode 100644
> index 9bfe650d802f..000000000000
> --- a/drivers/watchdog/atlas7_wdt.c
> +++ /dev/null
> @@ -1,221 +0,0 @@
> -// SPDX-License-Identifier: GPL-2.0-only
> -/*
> - * Watchdog driver for CSR Atlas7
> - *
> - * Copyright (c) 2015 Cambridge Silicon Radio Limited, a CSR plc group company.
> - */
> -
> -#include <linux/clk.h>
> -#include <linux/io.h>
> -#include <linux/module.h>
> -#include <linux/moduleparam.h>
> -#include <linux/of.h>
> -#include <linux/platform_device.h>
> -#include <linux/watchdog.h>
> -
> -#define ATLAS7_TIMER_WDT_INDEX         5
> -#define ATLAS7_WDT_DEFAULT_TIMEOUT     20
> -
> -#define ATLAS7_WDT_CNT_CTRL    (0 + 4 * ATLAS7_TIMER_WDT_INDEX)
> -#define ATLAS7_WDT_CNT_MATCH   (0x18 + 4 * ATLAS7_TIMER_WDT_INDEX)
> -#define ATLAS7_WDT_CNT         (0x48 +  4 * ATLAS7_TIMER_WDT_INDEX)
> -#define ATLAS7_WDT_CNT_EN      (BIT(0) | BIT(1))
> -#define ATLAS7_WDT_EN          0x64
> -
> -static unsigned int timeout = ATLAS7_WDT_DEFAULT_TIMEOUT;
> -static bool nowayout = WATCHDOG_NOWAYOUT;
> -
> -module_param(timeout, uint, 0);
> -module_param(nowayout, bool, 0);
> -
> -MODULE_PARM_DESC(timeout, "Default watchdog timeout (in seconds)");
> -MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default="
> -                       __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
> -
> -struct atlas7_wdog {
> -       struct device *dev;
> -       void __iomem *base;
> -       unsigned long tick_rate;
> -       struct clk *clk;
> -};
> -
> -static unsigned int atlas7_wdt_gettimeleft(struct watchdog_device *wdd)
> -{
> -       struct atlas7_wdog *wdt = watchdog_get_drvdata(wdd);
> -       u32 counter, match, delta;
> -
> -       counter = readl(wdt->base + ATLAS7_WDT_CNT);
> -       match = readl(wdt->base + ATLAS7_WDT_CNT_MATCH);
> -       delta = match - counter;
> -
> -       return  delta / wdt->tick_rate;
> -}
> -
> -static int atlas7_wdt_ping(struct watchdog_device *wdd)
> -{
> -       struct atlas7_wdog *wdt = watchdog_get_drvdata(wdd);
> -       u32 counter, match, delta;
> -
> -       counter = readl(wdt->base + ATLAS7_WDT_CNT);
> -       delta = wdd->timeout * wdt->tick_rate;
> -       match = counter + delta;
> -
> -       writel(match, wdt->base + ATLAS7_WDT_CNT_MATCH);
> -
> -       return 0;
> -}
> -
> -static int atlas7_wdt_enable(struct watchdog_device *wdd)
> -{
> -       struct atlas7_wdog *wdt = watchdog_get_drvdata(wdd);
> -
> -       atlas7_wdt_ping(wdd);
> -
> -       writel(readl(wdt->base + ATLAS7_WDT_CNT_CTRL) | ATLAS7_WDT_CNT_EN,
> -             wdt->base + ATLAS7_WDT_CNT_CTRL);
> -       writel(1, wdt->base + ATLAS7_WDT_EN);
> -
> -       return 0;
> -}
> -
> -static int atlas7_wdt_disable(struct watchdog_device *wdd)
> -{
> -       struct atlas7_wdog *wdt = watchdog_get_drvdata(wdd);
> -
> -       writel(0, wdt->base + ATLAS7_WDT_EN);
> -       writel(readl(wdt->base + ATLAS7_WDT_CNT_CTRL) & ~ATLAS7_WDT_CNT_EN,
> -             wdt->base + ATLAS7_WDT_CNT_CTRL);
> -
> -       return 0;
> -}
> -
> -static int atlas7_wdt_settimeout(struct watchdog_device *wdd, unsigned int to)
> -{
> -       wdd->timeout = to;
> -
> -       return 0;
> -}
> -
> -#define OPTIONS (WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING | WDIOF_MAGICCLOSE)
> -
> -static const struct watchdog_info atlas7_wdt_ident = {
> -       .options = OPTIONS,
> -       .firmware_version = 0,
> -       .identity = "atlas7 Watchdog",
> -};
> -
> -static const struct watchdog_ops atlas7_wdt_ops = {
> -       .owner = THIS_MODULE,
> -       .start = atlas7_wdt_enable,
> -       .stop = atlas7_wdt_disable,
> -       .get_timeleft = atlas7_wdt_gettimeleft,
> -       .ping = atlas7_wdt_ping,
> -       .set_timeout = atlas7_wdt_settimeout,
> -};
> -
> -static struct watchdog_device atlas7_wdd = {
> -       .info = &atlas7_wdt_ident,
> -       .ops = &atlas7_wdt_ops,
> -       .timeout = ATLAS7_WDT_DEFAULT_TIMEOUT,
> -};
> -
> -static const struct of_device_id atlas7_wdt_ids[] = {
> -       { .compatible = "sirf,atlas7-tick"},
> -       {}
> -};
> -
> -static void atlas7_clk_disable_unprepare(void *data)
> -{
> -       clk_disable_unprepare(data);
> -}
> -
> -static int atlas7_wdt_probe(struct platform_device *pdev)
> -{
> -       struct device *dev = &pdev->dev;
> -       struct atlas7_wdog *wdt;
> -       struct clk *clk;
> -       int ret;
> -
> -       wdt = devm_kzalloc(dev, sizeof(*wdt), GFP_KERNEL);
> -       if (!wdt)
> -               return -ENOMEM;
> -       wdt->base = devm_platform_ioremap_resource(pdev, 0);
> -       if (IS_ERR(wdt->base))
> -               return PTR_ERR(wdt->base);
> -
> -       clk = devm_clk_get(dev, NULL);
> -       if (IS_ERR(clk))
> -               return PTR_ERR(clk);
> -       ret = clk_prepare_enable(clk);
> -       if (ret) {
> -               dev_err(dev, "clk enable failed\n");
> -               return ret;
> -       }
> -       ret = devm_add_action_or_reset(dev, atlas7_clk_disable_unprepare, clk);
> -       if (ret)
> -               return ret;
> -
> -       /* disable watchdog hardware */
> -       writel(0, wdt->base + ATLAS7_WDT_CNT_CTRL);
> -
> -       wdt->tick_rate = clk_get_rate(clk);
> -       if (!wdt->tick_rate)
> -               return -EINVAL;
> -
> -       wdt->clk = clk;
> -       atlas7_wdd.min_timeout = 1;
> -       atlas7_wdd.max_timeout = UINT_MAX / wdt->tick_rate;
> -
> -       watchdog_init_timeout(&atlas7_wdd, 0, dev);
> -       watchdog_set_nowayout(&atlas7_wdd, nowayout);
> -
> -       watchdog_set_drvdata(&atlas7_wdd, wdt);
> -       platform_set_drvdata(pdev, &atlas7_wdd);
> -
> -       watchdog_stop_on_reboot(&atlas7_wdd);
> -       watchdog_stop_on_unregister(&atlas7_wdd);
> -       return devm_watchdog_register_device(dev, &atlas7_wdd);
> -}
> -
> -static int __maybe_unused atlas7_wdt_suspend(struct device *dev)
> -{
> -       /*
> -        * NOTE:timer controller registers settings are saved
> -        * and restored back by the timer-atlas7.c
> -        */
> -       return 0;
> -}
> -
> -static int __maybe_unused atlas7_wdt_resume(struct device *dev)
> -{
> -       struct watchdog_device *wdd = dev_get_drvdata(dev);
> -
> -       /*
> -        * NOTE: Since timer controller registers settings are saved
> -        * and restored back by the timer-atlas7.c, so we need not
> -        * update WD settings except refreshing timeout.
> -        */
> -       atlas7_wdt_ping(wdd);
> -
> -       return 0;
> -}
> -
> -static SIMPLE_DEV_PM_OPS(atlas7_wdt_pm_ops,
> -               atlas7_wdt_suspend, atlas7_wdt_resume);
> -
> -MODULE_DEVICE_TABLE(of, atlas7_wdt_ids);
> -
> -static struct platform_driver atlas7_wdt_driver = {
> -       .driver = {
> -               .name = "atlas7-wdt",
> -               .pm = &atlas7_wdt_pm_ops,
> -               .of_match_table = atlas7_wdt_ids,
> -       },
> -       .probe = atlas7_wdt_probe,
> -};
> -module_platform_driver(atlas7_wdt_driver);
> -
> -MODULE_DESCRIPTION("CSRatlas7 watchdog driver");
> -MODULE_AUTHOR("Guo Zeng <Guo.Zeng@csr.com>");
> -MODULE_LICENSE("GPL v2");
> -MODULE_ALIAS("platform:atlas7-wdt");
> --
> 2.29.2
>

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [PATCH 5/5] watchdog: remove coh901 driver
  2021-01-20 16:27   ` Arnd Bergmann
@ 2021-01-21 13:14     ` Linus Walleij
  -1 siblings, 0 replies; 38+ messages in thread
From: Linus Walleij @ 2021-01-21 13:14 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Linux ARM, linux-kernel, LINUXWATCHDOG, Guenter Roeck,
	Wim Van Sebroeck, Arnd Bergmann

On Wed, Jan 20, 2021 at 5:28 PM Arnd Bergmann <arnd@kernel.org> wrote:

> From: Arnd Bergmann <arnd@arndb.de>
>
> The ST-Ericsson U300 platform is getting removed, so this driver is no
> longer needed.
>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [PATCH 5/5] watchdog: remove coh901 driver
@ 2021-01-21 13:14     ` Linus Walleij
  0 siblings, 0 replies; 38+ messages in thread
From: Linus Walleij @ 2021-01-21 13:14 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: LINUXWATCHDOG, Arnd Bergmann, linux-kernel, Linux ARM,
	Wim Van Sebroeck, Guenter Roeck

On Wed, Jan 20, 2021 at 5:28 PM Arnd Bergmann <arnd@kernel.org> wrote:

> From: Arnd Bergmann <arnd@arndb.de>
>
> The ST-Ericsson U300 platform is getting removed, so this driver is no
> longer needed.
>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [PATCH 4/5] watchdog: remove tango driver
  2021-01-20 16:27   ` Arnd Bergmann
@ 2021-01-21 14:01     ` Måns Rullgård
  -1 siblings, 0 replies; 38+ messages in thread
From: Måns Rullgård @ 2021-01-21 14:01 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: linux-arm-kernel, linux-kernel, linux-watchdog, Guenter Roeck,
	Wim Van Sebroeck, Arnd Bergmann, Marc Gonzalez

Arnd Bergmann <arnd@kernel.org> writes:

> From: Arnd Bergmann <arnd@arndb.de>
>
> The tango platform is getting removed, so the driver is no
> longer needed.
>
> Cc: Marc Gonzalez <marc.w.gonzalez@free.fr>
> Cc: Mans Rullgard <mans@mansr.com>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>  drivers/watchdog/Kconfig      |  11 --
>  drivers/watchdog/Makefile     |   1 -
>  drivers/watchdog/tangox_wdt.c | 209 ----------------------------------
>  3 files changed, 221 deletions(-)
>  delete mode 100644 drivers/watchdog/tangox_wdt.c

The DT binding can go as well.

Otherwise:

Acked-by: Mans Rullgard <mans@mansr.com>

> diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
> index c36f8233f60b..10efbb351f14 100644
> --- a/drivers/watchdog/Kconfig
> +++ b/drivers/watchdog/Kconfig
> @@ -254,17 +254,6 @@ config MENZ069_WATCHDOG
>  	  This driver can also be built as a module. If so the module
>  	  will be called menz069_wdt.
>
> -config TANGOX_WATCHDOG
> -	tristate "Sigma Designs SMP86xx/SMP87xx watchdog"
> -	select WATCHDOG_CORE
> -	depends on ARCH_TANGO || COMPILE_TEST
> -	depends on HAS_IOMEM
> -	help
> -	  Support for the watchdog in Sigma Designs SMP86xx (tango3)
> -	  and SMP87xx (tango4) family chips.
> -
> -	  This driver can be built as a module. The module name is tangox_wdt.
> -
>  config WDAT_WDT
>  	tristate "ACPI Watchdog Action Table (WDAT)"
>  	depends on ACPI
> diff --git a/drivers/watchdog/Makefile b/drivers/watchdog/Makefile
> index 7a95b280cd9f..1ff40d6a027f 100644
> --- a/drivers/watchdog/Makefile
> +++ b/drivers/watchdog/Makefile
> @@ -210,7 +210,6 @@ obj-$(CONFIG_DA9055_WATCHDOG) += da9055_wdt.o
>  obj-$(CONFIG_DA9062_WATCHDOG) += da9062_wdt.o
>  obj-$(CONFIG_DA9063_WATCHDOG) += da9063_wdt.o
>  obj-$(CONFIG_GPIO_WATCHDOG)	+= gpio_wdt.o
> -obj-$(CONFIG_TANGOX_WATCHDOG) += tangox_wdt.o
>  obj-$(CONFIG_WDAT_WDT) += wdat_wdt.o
>  obj-$(CONFIG_WM831X_WATCHDOG) += wm831x_wdt.o
>  obj-$(CONFIG_WM8350_WATCHDOG) += wm8350_wdt.o
> diff --git a/drivers/watchdog/tangox_wdt.c b/drivers/watchdog/tangox_wdt.c
> deleted file mode 100644
> index 1afb0e9d808c..000000000000
> --- a/drivers/watchdog/tangox_wdt.c
> +++ /dev/null
> @@ -1,209 +0,0 @@
> -// SPDX-License-Identifier: GPL-2.0+
> -/*
> - *  Copyright (C) 2015 Mans Rullgard <mans@mansr.com>
> - *  SMP86xx/SMP87xx Watchdog driver
> - */
> -
> -#include <linux/bitops.h>
> -#include <linux/clk.h>
> -#include <linux/delay.h>
> -#include <linux/io.h>
> -#include <linux/kernel.h>
> -#include <linux/module.h>
> -#include <linux/moduleparam.h>
> -#include <linux/mod_devicetable.h>
> -#include <linux/platform_device.h>
> -#include <linux/watchdog.h>
> -
> -#define DEFAULT_TIMEOUT 30
> -
> -static bool nowayout = WATCHDOG_NOWAYOUT;
> -module_param(nowayout, bool, 0);
> -MODULE_PARM_DESC(nowayout,
> -		 "Watchdog cannot be stopped once started (default="
> -		 __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
> -
> -static unsigned int timeout;
> -module_param(timeout, int, 0);
> -MODULE_PARM_DESC(timeout, "Watchdog timeout");
> -
> -/*
> - * Counter counts down from programmed value.  Reset asserts when
> - * the counter reaches 1.
> - */
> -#define WD_COUNTER		0
> -
> -#define WD_CONFIG		4
> -#define WD_CONFIG_XTAL_IN	BIT(0)
> -#define WD_CONFIG_DISABLE	BIT(31)
> -
> -struct tangox_wdt_device {
> -	struct watchdog_device wdt;
> -	void __iomem *base;
> -	unsigned long clk_rate;
> -	struct clk *clk;
> -};
> -
> -static int tangox_wdt_set_timeout(struct watchdog_device *wdt,
> -				  unsigned int new_timeout)
> -{
> -	wdt->timeout = new_timeout;
> -
> -	return 0;
> -}
> -
> -static int tangox_wdt_start(struct watchdog_device *wdt)
> -{
> -	struct tangox_wdt_device *dev = watchdog_get_drvdata(wdt);
> -	u32 ticks;
> -
> -	ticks = 1 + wdt->timeout * dev->clk_rate;
> -	writel(ticks, dev->base + WD_COUNTER);
> -
> -	return 0;
> -}
> -
> -static int tangox_wdt_stop(struct watchdog_device *wdt)
> -{
> -	struct tangox_wdt_device *dev = watchdog_get_drvdata(wdt);
> -
> -	writel(0, dev->base + WD_COUNTER);
> -
> -	return 0;
> -}
> -
> -static unsigned int tangox_wdt_get_timeleft(struct watchdog_device *wdt)
> -{
> -	struct tangox_wdt_device *dev = watchdog_get_drvdata(wdt);
> -	u32 count;
> -
> -	count = readl(dev->base + WD_COUNTER);
> -
> -	if (!count)
> -		return 0;
> -
> -	return (count - 1) / dev->clk_rate;
> -}
> -
> -static const struct watchdog_info tangox_wdt_info = {
> -	.options  = WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING | WDIOF_MAGICCLOSE,
> -	.identity = "tangox watchdog",
> -};
> -
> -static int tangox_wdt_restart(struct watchdog_device *wdt,
> -			      unsigned long action, void *data)
> -{
> -	struct tangox_wdt_device *dev = watchdog_get_drvdata(wdt);
> -
> -	writel(1, dev->base + WD_COUNTER);
> -
> -	return 0;
> -}
> -
> -static const struct watchdog_ops tangox_wdt_ops = {
> -	.start		= tangox_wdt_start,
> -	.stop		= tangox_wdt_stop,
> -	.set_timeout	= tangox_wdt_set_timeout,
> -	.get_timeleft	= tangox_wdt_get_timeleft,
> -	.restart	= tangox_wdt_restart,
> -};
> -
> -static void tangox_clk_disable_unprepare(void *data)
> -{
> -	clk_disable_unprepare(data);
> -}
> -
> -static int tangox_wdt_probe(struct platform_device *pdev)
> -{
> -	struct tangox_wdt_device *dev;
> -	u32 config;
> -	int err;
> -
> -	dev = devm_kzalloc(&pdev->dev, sizeof(*dev), GFP_KERNEL);
> -	if (!dev)
> -		return -ENOMEM;
> -
> -	dev->base = devm_platform_ioremap_resource(pdev, 0);
> -	if (IS_ERR(dev->base))
> -		return PTR_ERR(dev->base);
> -
> -	dev->clk = devm_clk_get(&pdev->dev, NULL);
> -	if (IS_ERR(dev->clk))
> -		return PTR_ERR(dev->clk);
> -
> -	err = clk_prepare_enable(dev->clk);
> -	if (err)
> -		return err;
> -	err = devm_add_action_or_reset(&pdev->dev,
> -				       tangox_clk_disable_unprepare, dev->clk);
> -	if (err)
> -		return err;
> -
> -	dev->clk_rate = clk_get_rate(dev->clk);
> -	if (!dev->clk_rate)
> -		return -EINVAL;
> -
> -	dev->wdt.parent = &pdev->dev;
> -	dev->wdt.info = &tangox_wdt_info;
> -	dev->wdt.ops = &tangox_wdt_ops;
> -	dev->wdt.timeout = DEFAULT_TIMEOUT;
> -	dev->wdt.min_timeout = 1;
> -	dev->wdt.max_hw_heartbeat_ms = (U32_MAX - 1) / dev->clk_rate;
> -
> -	watchdog_init_timeout(&dev->wdt, timeout, &pdev->dev);
> -	watchdog_set_nowayout(&dev->wdt, nowayout);
> -	watchdog_set_drvdata(&dev->wdt, dev);
> -
> -	/*
> -	 * Deactivate counter if disable bit is set to avoid
> -	 * accidental reset.
> -	 */
> -	config = readl(dev->base + WD_CONFIG);
> -	if (config & WD_CONFIG_DISABLE)
> -		writel(0, dev->base + WD_COUNTER);
> -
> -	writel(WD_CONFIG_XTAL_IN, dev->base + WD_CONFIG);
> -
> -	/*
> -	 * Mark as active and restart with configured timeout if
> -	 * already running.
> -	 */
> -	if (readl(dev->base + WD_COUNTER)) {
> -		set_bit(WDOG_HW_RUNNING, &dev->wdt.status);
> -		tangox_wdt_start(&dev->wdt);
> -	}
> -
> -	watchdog_set_restart_priority(&dev->wdt, 128);
> -
> -	watchdog_stop_on_unregister(&dev->wdt);
> -	err = devm_watchdog_register_device(&pdev->dev, &dev->wdt);
> -	if (err)
> -		return err;
> -
> -	platform_set_drvdata(pdev, dev);
> -
> -	dev_info(&pdev->dev, "SMP86xx/SMP87xx watchdog registered\n");
> -
> -	return 0;
> -}
> -
> -static const struct of_device_id tangox_wdt_dt_ids[] = {
> -	{ .compatible = "sigma,smp8642-wdt" },
> -	{ .compatible = "sigma,smp8759-wdt" },
> -	{ }
> -};
> -MODULE_DEVICE_TABLE(of, tangox_wdt_dt_ids);
> -
> -static struct platform_driver tangox_wdt_driver = {
> -	.probe	= tangox_wdt_probe,
> -	.driver	= {
> -		.name		= "tangox-wdt",
> -		.of_match_table	= tangox_wdt_dt_ids,
> -	},
> -};
> -
> -module_platform_driver(tangox_wdt_driver);
> -
> -MODULE_AUTHOR("Mans Rullgard <mans@mansr.com>");
> -MODULE_DESCRIPTION("SMP86xx/SMP87xx Watchdog driver");
> -MODULE_LICENSE("GPL");
> -- 
>
> 2.29.2
>

-- 
Måns Rullgård

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [PATCH 4/5] watchdog: remove tango driver
@ 2021-01-21 14:01     ` Måns Rullgård
  0 siblings, 0 replies; 38+ messages in thread
From: Måns Rullgård @ 2021-01-21 14:01 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: linux-watchdog, Arnd Bergmann, Marc Gonzalez, linux-kernel,
	linux-arm-kernel, Wim Van Sebroeck, Guenter Roeck

Arnd Bergmann <arnd@kernel.org> writes:

> From: Arnd Bergmann <arnd@arndb.de>
>
> The tango platform is getting removed, so the driver is no
> longer needed.
>
> Cc: Marc Gonzalez <marc.w.gonzalez@free.fr>
> Cc: Mans Rullgard <mans@mansr.com>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>  drivers/watchdog/Kconfig      |  11 --
>  drivers/watchdog/Makefile     |   1 -
>  drivers/watchdog/tangox_wdt.c | 209 ----------------------------------
>  3 files changed, 221 deletions(-)
>  delete mode 100644 drivers/watchdog/tangox_wdt.c

The DT binding can go as well.

Otherwise:

Acked-by: Mans Rullgard <mans@mansr.com>

> diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
> index c36f8233f60b..10efbb351f14 100644
> --- a/drivers/watchdog/Kconfig
> +++ b/drivers/watchdog/Kconfig
> @@ -254,17 +254,6 @@ config MENZ069_WATCHDOG
>  	  This driver can also be built as a module. If so the module
>  	  will be called menz069_wdt.
>
> -config TANGOX_WATCHDOG
> -	tristate "Sigma Designs SMP86xx/SMP87xx watchdog"
> -	select WATCHDOG_CORE
> -	depends on ARCH_TANGO || COMPILE_TEST
> -	depends on HAS_IOMEM
> -	help
> -	  Support for the watchdog in Sigma Designs SMP86xx (tango3)
> -	  and SMP87xx (tango4) family chips.
> -
> -	  This driver can be built as a module. The module name is tangox_wdt.
> -
>  config WDAT_WDT
>  	tristate "ACPI Watchdog Action Table (WDAT)"
>  	depends on ACPI
> diff --git a/drivers/watchdog/Makefile b/drivers/watchdog/Makefile
> index 7a95b280cd9f..1ff40d6a027f 100644
> --- a/drivers/watchdog/Makefile
> +++ b/drivers/watchdog/Makefile
> @@ -210,7 +210,6 @@ obj-$(CONFIG_DA9055_WATCHDOG) += da9055_wdt.o
>  obj-$(CONFIG_DA9062_WATCHDOG) += da9062_wdt.o
>  obj-$(CONFIG_DA9063_WATCHDOG) += da9063_wdt.o
>  obj-$(CONFIG_GPIO_WATCHDOG)	+= gpio_wdt.o
> -obj-$(CONFIG_TANGOX_WATCHDOG) += tangox_wdt.o
>  obj-$(CONFIG_WDAT_WDT) += wdat_wdt.o
>  obj-$(CONFIG_WM831X_WATCHDOG) += wm831x_wdt.o
>  obj-$(CONFIG_WM8350_WATCHDOG) += wm8350_wdt.o
> diff --git a/drivers/watchdog/tangox_wdt.c b/drivers/watchdog/tangox_wdt.c
> deleted file mode 100644
> index 1afb0e9d808c..000000000000
> --- a/drivers/watchdog/tangox_wdt.c
> +++ /dev/null
> @@ -1,209 +0,0 @@
> -// SPDX-License-Identifier: GPL-2.0+
> -/*
> - *  Copyright (C) 2015 Mans Rullgard <mans@mansr.com>
> - *  SMP86xx/SMP87xx Watchdog driver
> - */
> -
> -#include <linux/bitops.h>
> -#include <linux/clk.h>
> -#include <linux/delay.h>
> -#include <linux/io.h>
> -#include <linux/kernel.h>
> -#include <linux/module.h>
> -#include <linux/moduleparam.h>
> -#include <linux/mod_devicetable.h>
> -#include <linux/platform_device.h>
> -#include <linux/watchdog.h>
> -
> -#define DEFAULT_TIMEOUT 30
> -
> -static bool nowayout = WATCHDOG_NOWAYOUT;
> -module_param(nowayout, bool, 0);
> -MODULE_PARM_DESC(nowayout,
> -		 "Watchdog cannot be stopped once started (default="
> -		 __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
> -
> -static unsigned int timeout;
> -module_param(timeout, int, 0);
> -MODULE_PARM_DESC(timeout, "Watchdog timeout");
> -
> -/*
> - * Counter counts down from programmed value.  Reset asserts when
> - * the counter reaches 1.
> - */
> -#define WD_COUNTER		0
> -
> -#define WD_CONFIG		4
> -#define WD_CONFIG_XTAL_IN	BIT(0)
> -#define WD_CONFIG_DISABLE	BIT(31)
> -
> -struct tangox_wdt_device {
> -	struct watchdog_device wdt;
> -	void __iomem *base;
> -	unsigned long clk_rate;
> -	struct clk *clk;
> -};
> -
> -static int tangox_wdt_set_timeout(struct watchdog_device *wdt,
> -				  unsigned int new_timeout)
> -{
> -	wdt->timeout = new_timeout;
> -
> -	return 0;
> -}
> -
> -static int tangox_wdt_start(struct watchdog_device *wdt)
> -{
> -	struct tangox_wdt_device *dev = watchdog_get_drvdata(wdt);
> -	u32 ticks;
> -
> -	ticks = 1 + wdt->timeout * dev->clk_rate;
> -	writel(ticks, dev->base + WD_COUNTER);
> -
> -	return 0;
> -}
> -
> -static int tangox_wdt_stop(struct watchdog_device *wdt)
> -{
> -	struct tangox_wdt_device *dev = watchdog_get_drvdata(wdt);
> -
> -	writel(0, dev->base + WD_COUNTER);
> -
> -	return 0;
> -}
> -
> -static unsigned int tangox_wdt_get_timeleft(struct watchdog_device *wdt)
> -{
> -	struct tangox_wdt_device *dev = watchdog_get_drvdata(wdt);
> -	u32 count;
> -
> -	count = readl(dev->base + WD_COUNTER);
> -
> -	if (!count)
> -		return 0;
> -
> -	return (count - 1) / dev->clk_rate;
> -}
> -
> -static const struct watchdog_info tangox_wdt_info = {
> -	.options  = WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING | WDIOF_MAGICCLOSE,
> -	.identity = "tangox watchdog",
> -};
> -
> -static int tangox_wdt_restart(struct watchdog_device *wdt,
> -			      unsigned long action, void *data)
> -{
> -	struct tangox_wdt_device *dev = watchdog_get_drvdata(wdt);
> -
> -	writel(1, dev->base + WD_COUNTER);
> -
> -	return 0;
> -}
> -
> -static const struct watchdog_ops tangox_wdt_ops = {
> -	.start		= tangox_wdt_start,
> -	.stop		= tangox_wdt_stop,
> -	.set_timeout	= tangox_wdt_set_timeout,
> -	.get_timeleft	= tangox_wdt_get_timeleft,
> -	.restart	= tangox_wdt_restart,
> -};
> -
> -static void tangox_clk_disable_unprepare(void *data)
> -{
> -	clk_disable_unprepare(data);
> -}
> -
> -static int tangox_wdt_probe(struct platform_device *pdev)
> -{
> -	struct tangox_wdt_device *dev;
> -	u32 config;
> -	int err;
> -
> -	dev = devm_kzalloc(&pdev->dev, sizeof(*dev), GFP_KERNEL);
> -	if (!dev)
> -		return -ENOMEM;
> -
> -	dev->base = devm_platform_ioremap_resource(pdev, 0);
> -	if (IS_ERR(dev->base))
> -		return PTR_ERR(dev->base);
> -
> -	dev->clk = devm_clk_get(&pdev->dev, NULL);
> -	if (IS_ERR(dev->clk))
> -		return PTR_ERR(dev->clk);
> -
> -	err = clk_prepare_enable(dev->clk);
> -	if (err)
> -		return err;
> -	err = devm_add_action_or_reset(&pdev->dev,
> -				       tangox_clk_disable_unprepare, dev->clk);
> -	if (err)
> -		return err;
> -
> -	dev->clk_rate = clk_get_rate(dev->clk);
> -	if (!dev->clk_rate)
> -		return -EINVAL;
> -
> -	dev->wdt.parent = &pdev->dev;
> -	dev->wdt.info = &tangox_wdt_info;
> -	dev->wdt.ops = &tangox_wdt_ops;
> -	dev->wdt.timeout = DEFAULT_TIMEOUT;
> -	dev->wdt.min_timeout = 1;
> -	dev->wdt.max_hw_heartbeat_ms = (U32_MAX - 1) / dev->clk_rate;
> -
> -	watchdog_init_timeout(&dev->wdt, timeout, &pdev->dev);
> -	watchdog_set_nowayout(&dev->wdt, nowayout);
> -	watchdog_set_drvdata(&dev->wdt, dev);
> -
> -	/*
> -	 * Deactivate counter if disable bit is set to avoid
> -	 * accidental reset.
> -	 */
> -	config = readl(dev->base + WD_CONFIG);
> -	if (config & WD_CONFIG_DISABLE)
> -		writel(0, dev->base + WD_COUNTER);
> -
> -	writel(WD_CONFIG_XTAL_IN, dev->base + WD_CONFIG);
> -
> -	/*
> -	 * Mark as active and restart with configured timeout if
> -	 * already running.
> -	 */
> -	if (readl(dev->base + WD_COUNTER)) {
> -		set_bit(WDOG_HW_RUNNING, &dev->wdt.status);
> -		tangox_wdt_start(&dev->wdt);
> -	}
> -
> -	watchdog_set_restart_priority(&dev->wdt, 128);
> -
> -	watchdog_stop_on_unregister(&dev->wdt);
> -	err = devm_watchdog_register_device(&pdev->dev, &dev->wdt);
> -	if (err)
> -		return err;
> -
> -	platform_set_drvdata(pdev, dev);
> -
> -	dev_info(&pdev->dev, "SMP86xx/SMP87xx watchdog registered\n");
> -
> -	return 0;
> -}
> -
> -static const struct of_device_id tangox_wdt_dt_ids[] = {
> -	{ .compatible = "sigma,smp8642-wdt" },
> -	{ .compatible = "sigma,smp8759-wdt" },
> -	{ }
> -};
> -MODULE_DEVICE_TABLE(of, tangox_wdt_dt_ids);
> -
> -static struct platform_driver tangox_wdt_driver = {
> -	.probe	= tangox_wdt_probe,
> -	.driver	= {
> -		.name		= "tangox-wdt",
> -		.of_match_table	= tangox_wdt_dt_ids,
> -	},
> -};
> -
> -module_platform_driver(tangox_wdt_driver);
> -
> -MODULE_AUTHOR("Mans Rullgard <mans@mansr.com>");
> -MODULE_DESCRIPTION("SMP86xx/SMP87xx Watchdog driver");
> -MODULE_LICENSE("GPL");
> -- 
>
> 2.29.2
>

-- 
Måns Rullgård

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [PATCH 4/5] watchdog: remove tango driver
  2021-01-21 14:01     ` Måns Rullgård
@ 2021-01-21 15:18       ` Arnd Bergmann
  -1 siblings, 0 replies; 38+ messages in thread
From: Arnd Bergmann @ 2021-01-21 15:18 UTC (permalink / raw)
  To: Måns Rullgård
  Cc: Linux ARM, linux-kernel, LINUXWATCHDOG, Guenter Roeck,
	Wim Van Sebroeck, Arnd Bergmann, Marc Gonzalez

On Thu, Jan 21, 2021 at 3:01 PM Måns Rullgård <mans@mansr.com> wrote:
> Arnd Bergmann <arnd@kernel.org> writes:
> > From: Arnd Bergmann <arnd@arndb.de>
> >
> > The tango platform is getting removed, so the driver is no
> > longer needed.
> >
> > Cc: Marc Gonzalez <marc.w.gonzalez@free.fr>
> > Cc: Mans Rullgard <mans@mansr.com>
> > Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> > ---
> >  drivers/watchdog/Kconfig      |  11 --
> >  drivers/watchdog/Makefile     |   1 -
> >  drivers/watchdog/tangox_wdt.c | 209 ----------------------------------
> >  3 files changed, 221 deletions(-)
> >  delete mode 100644 drivers/watchdog/tangox_wdt.c
>
> The DT binding can go as well.

Good catch! I thought I had cross-checked all DT compatible strings of the
removed dts files, bindings and drivers to make sure everything is gone
at once, but it seems I missed a couple of files including this one.

Guenter and Wim, let me know if I should resend this patch or all watchdog
patches, or just remove the binding as part of the platform removal in the
soc tree.

       Arnd

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [PATCH 4/5] watchdog: remove tango driver
@ 2021-01-21 15:18       ` Arnd Bergmann
  0 siblings, 0 replies; 38+ messages in thread
From: Arnd Bergmann @ 2021-01-21 15:18 UTC (permalink / raw)
  To: Måns Rullgård
  Cc: LINUXWATCHDOG, Arnd Bergmann, Marc Gonzalez, linux-kernel,
	Linux ARM, Wim Van Sebroeck, Guenter Roeck

On Thu, Jan 21, 2021 at 3:01 PM Måns Rullgård <mans@mansr.com> wrote:
> Arnd Bergmann <arnd@kernel.org> writes:
> > From: Arnd Bergmann <arnd@arndb.de>
> >
> > The tango platform is getting removed, so the driver is no
> > longer needed.
> >
> > Cc: Marc Gonzalez <marc.w.gonzalez@free.fr>
> > Cc: Mans Rullgard <mans@mansr.com>
> > Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> > ---
> >  drivers/watchdog/Kconfig      |  11 --
> >  drivers/watchdog/Makefile     |   1 -
> >  drivers/watchdog/tangox_wdt.c | 209 ----------------------------------
> >  3 files changed, 221 deletions(-)
> >  delete mode 100644 drivers/watchdog/tangox_wdt.c
>
> The DT binding can go as well.

Good catch! I thought I had cross-checked all DT compatible strings of the
removed dts files, bindings and drivers to make sure everything is gone
at once, but it seems I missed a couple of files including this one.

Guenter and Wim, let me know if I should resend this patch or all watchdog
patches, or just remove the binding as part of the platform removal in the
soc tree.

       Arnd

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [PATCH 4/5] watchdog: remove tango driver
  2021-01-21 15:18       ` Arnd Bergmann
@ 2021-01-21 16:33         ` Guenter Roeck
  -1 siblings, 0 replies; 38+ messages in thread
From: Guenter Roeck @ 2021-01-21 16:33 UTC (permalink / raw)
  To: Arnd Bergmann, Måns Rullgård
  Cc: Linux ARM, linux-kernel, LINUXWATCHDOG, Wim Van Sebroeck,
	Arnd Bergmann, Marc Gonzalez

On 1/21/21 7:18 AM, Arnd Bergmann wrote:
> On Thu, Jan 21, 2021 at 3:01 PM Måns Rullgård <mans@mansr.com> wrote:
>> Arnd Bergmann <arnd@kernel.org> writes:
>>> From: Arnd Bergmann <arnd@arndb.de>
>>>
>>> The tango platform is getting removed, so the driver is no
>>> longer needed.
>>>
>>> Cc: Marc Gonzalez <marc.w.gonzalez@free.fr>
>>> Cc: Mans Rullgard <mans@mansr.com>
>>> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
>>> ---
>>>  drivers/watchdog/Kconfig      |  11 --
>>>  drivers/watchdog/Makefile     |   1 -
>>>  drivers/watchdog/tangox_wdt.c | 209 ----------------------------------
>>>  3 files changed, 221 deletions(-)
>>>  delete mode 100644 drivers/watchdog/tangox_wdt.c
>>
>> The DT binding can go as well.
> 
> Good catch! I thought I had cross-checked all DT compatible strings of the
> removed dts files, bindings and drivers to make sure everything is gone
> at once, but it seems I missed a couple of files including this one.
> 
> Guenter and Wim, let me know if I should resend this patch or all watchdog
> patches, or just remove the binding as part of the platform removal in the
> soc tree.

I'd suggest to just resend this patch, or to send another one on top of it.
It is Wim's call to make, though, since he will apply the patches.

Guenter

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [PATCH 4/5] watchdog: remove tango driver
@ 2021-01-21 16:33         ` Guenter Roeck
  0 siblings, 0 replies; 38+ messages in thread
From: Guenter Roeck @ 2021-01-21 16:33 UTC (permalink / raw)
  To: Arnd Bergmann, Måns Rullgård
  Cc: LINUXWATCHDOG, Arnd Bergmann, Marc Gonzalez, linux-kernel,
	Wim Van Sebroeck, Linux ARM

On 1/21/21 7:18 AM, Arnd Bergmann wrote:
> On Thu, Jan 21, 2021 at 3:01 PM Måns Rullgård <mans@mansr.com> wrote:
>> Arnd Bergmann <arnd@kernel.org> writes:
>>> From: Arnd Bergmann <arnd@arndb.de>
>>>
>>> The tango platform is getting removed, so the driver is no
>>> longer needed.
>>>
>>> Cc: Marc Gonzalez <marc.w.gonzalez@free.fr>
>>> Cc: Mans Rullgard <mans@mansr.com>
>>> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
>>> ---
>>>  drivers/watchdog/Kconfig      |  11 --
>>>  drivers/watchdog/Makefile     |   1 -
>>>  drivers/watchdog/tangox_wdt.c | 209 ----------------------------------
>>>  3 files changed, 221 deletions(-)
>>>  delete mode 100644 drivers/watchdog/tangox_wdt.c
>>
>> The DT binding can go as well.
> 
> Good catch! I thought I had cross-checked all DT compatible strings of the
> removed dts files, bindings and drivers to make sure everything is gone
> at once, but it seems I missed a couple of files including this one.
> 
> Guenter and Wim, let me know if I should resend this patch or all watchdog
> patches, or just remove the binding as part of the platform removal in the
> soc tree.

I'd suggest to just resend this patch, or to send another one on top of it.
It is Wim's call to make, though, since he will apply the patches.

Guenter

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [PATCH 4/5] watchdog: remove tango driver
  2021-01-20 16:27   ` Arnd Bergmann
@ 2021-01-23 18:34     ` Guenter Roeck
  -1 siblings, 0 replies; 38+ messages in thread
From: Guenter Roeck @ 2021-01-23 18:34 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: linux-arm-kernel, linux-kernel, linux-watchdog, Wim Van Sebroeck,
	Arnd Bergmann, Marc Gonzalez, Mans Rullgard

On Wed, Jan 20, 2021 at 05:27:44PM +0100, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
> 
> The tango platform is getting removed, so the driver is no
> longer needed.
> 
> Cc: Marc Gonzalez <marc.w.gonzalez@free.fr>
> Cc: Mans Rullgard <mans@mansr.com>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> Reviewed-by: Guenter Roeck <linux@roeck-us.net>
> Acked-by: Mans Rullgard <mans@mansr.com>

I ueued this patch up in my watchdog-next tree, and while doing so
removed the devicetree bindings as well. If Wim picks up the patch
from my tree we should be fine; otherwise I'd suggest to submit a
follow-up patch after v5.11 to remove the bindings file.

Guenter

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [PATCH 4/5] watchdog: remove tango driver
@ 2021-01-23 18:34     ` Guenter Roeck
  0 siblings, 0 replies; 38+ messages in thread
From: Guenter Roeck @ 2021-01-23 18:34 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Mans Rullgard, linux-watchdog, Arnd Bergmann, Marc Gonzalez,
	linux-kernel, Wim Van Sebroeck, linux-arm-kernel

On Wed, Jan 20, 2021 at 05:27:44PM +0100, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
> 
> The tango platform is getting removed, so the driver is no
> longer needed.
> 
> Cc: Marc Gonzalez <marc.w.gonzalez@free.fr>
> Cc: Mans Rullgard <mans@mansr.com>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> Reviewed-by: Guenter Roeck <linux@roeck-us.net>
> Acked-by: Mans Rullgard <mans@mansr.com>

I ueued this patch up in my watchdog-next tree, and while doing so
removed the devicetree bindings as well. If Wim picks up the patch
from my tree we should be fine; otherwise I'd suggest to submit a
follow-up patch after v5.11 to remove the bindings file.

Guenter

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [PATCH 4/5] watchdog: remove tango driver
  2021-01-23 18:34     ` Guenter Roeck
@ 2021-01-23 18:47       ` Arnd Bergmann
  -1 siblings, 0 replies; 38+ messages in thread
From: Arnd Bergmann @ 2021-01-23 18:47 UTC (permalink / raw)
  To: Guenter Roeck
  Cc: Linux ARM, linux-kernel, LINUXWATCHDOG, Wim Van Sebroeck,
	Arnd Bergmann, Marc Gonzalez, Mans Rullgard

On Sat, Jan 23, 2021 at 7:36 PM Guenter Roeck <linux@roeck-us.net> wrote:
>
> On Wed, Jan 20, 2021 at 05:27:44PM +0100, Arnd Bergmann wrote:
> > From: Arnd Bergmann <arnd@arndb.de>
> >
> > The tango platform is getting removed, so the driver is no
> > longer needed.
> >
> > Cc: Marc Gonzalez <marc.w.gonzalez@free.fr>
> > Cc: Mans Rullgard <mans@mansr.com>
> > Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> > Reviewed-by: Guenter Roeck <linux@roeck-us.net>
> > Acked-by: Mans Rullgard <mans@mansr.com>
>
> I ueued this patch up in my watchdog-next tree, and while doing so
> removed the devicetree bindings as well. If Wim picks up the patch
> from my tree we should be fine; otherwise I'd suggest to submit a
> follow-up patch after v5.11 to remove the bindings file.

Thanks a lot!

       Arnd

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [PATCH 4/5] watchdog: remove tango driver
@ 2021-01-23 18:47       ` Arnd Bergmann
  0 siblings, 0 replies; 38+ messages in thread
From: Arnd Bergmann @ 2021-01-23 18:47 UTC (permalink / raw)
  To: Guenter Roeck
  Cc: Mans Rullgard, LINUXWATCHDOG, Arnd Bergmann, Marc Gonzalez,
	linux-kernel, Wim Van Sebroeck, Linux ARM

On Sat, Jan 23, 2021 at 7:36 PM Guenter Roeck <linux@roeck-us.net> wrote:
>
> On Wed, Jan 20, 2021 at 05:27:44PM +0100, Arnd Bergmann wrote:
> > From: Arnd Bergmann <arnd@arndb.de>
> >
> > The tango platform is getting removed, so the driver is no
> > longer needed.
> >
> > Cc: Marc Gonzalez <marc.w.gonzalez@free.fr>
> > Cc: Mans Rullgard <mans@mansr.com>
> > Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> > Reviewed-by: Guenter Roeck <linux@roeck-us.net>
> > Acked-by: Mans Rullgard <mans@mansr.com>
>
> I ueued this patch up in my watchdog-next tree, and while doing so
> removed the devicetree bindings as well. If Wim picks up the patch
> from my tree we should be fine; otherwise I'd suggest to submit a
> follow-up patch after v5.11 to remove the bindings file.

Thanks a lot!

       Arnd

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 38+ messages in thread

end of thread, other threads:[~2021-01-23 18:48 UTC | newest]

Thread overview: 38+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-20 16:27 [PATCH 0/5] watchdog: remove obsolete drivers Arnd Bergmann
2021-01-20 16:27 ` Arnd Bergmann
2021-01-20 16:27 ` [PATCH 1/5] watchdog: remove sirf prima driver Arnd Bergmann
2021-01-20 16:27   ` Arnd Bergmann
2021-01-20 19:03   ` Guenter Roeck
2021-01-20 19:03     ` Guenter Roeck
2021-01-20 21:15   ` Barry Song
2021-01-20 21:15     ` Barry Song
2021-01-20 16:27 ` [PATCH 2/5] watchdog: remove sirf atlas driver Arnd Bergmann
2021-01-20 16:27   ` Arnd Bergmann
2021-01-20 19:03   ` Guenter Roeck
2021-01-20 19:03     ` Guenter Roeck
2021-01-20 21:17   ` Barry Song
2021-01-20 21:17     ` Barry Song
2021-01-20 16:27 ` [PATCH 3/5] watchdog: remove zte zx driver Arnd Bergmann
2021-01-20 16:27   ` Arnd Bergmann
2021-01-20 19:03   ` Guenter Roeck
2021-01-20 19:03     ` Guenter Roeck
2021-01-20 16:27 ` [PATCH 4/5] watchdog: remove tango driver Arnd Bergmann
2021-01-20 16:27   ` Arnd Bergmann
2021-01-20 19:03   ` Guenter Roeck
2021-01-20 19:03     ` Guenter Roeck
2021-01-21 14:01   ` Måns Rullgård
2021-01-21 14:01     ` Måns Rullgård
2021-01-21 15:18     ` Arnd Bergmann
2021-01-21 15:18       ` Arnd Bergmann
2021-01-21 16:33       ` Guenter Roeck
2021-01-21 16:33         ` Guenter Roeck
2021-01-23 18:34   ` Guenter Roeck
2021-01-23 18:34     ` Guenter Roeck
2021-01-23 18:47     ` Arnd Bergmann
2021-01-23 18:47       ` Arnd Bergmann
2021-01-20 16:27 ` [PATCH 5/5] watchdog: remove coh901 driver Arnd Bergmann
2021-01-20 16:27   ` Arnd Bergmann
2021-01-20 19:03   ` Guenter Roeck
2021-01-20 19:03     ` Guenter Roeck
2021-01-21 13:14   ` Linus Walleij
2021-01-21 13:14     ` Linus Walleij

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.