All of lore.kernel.org
 help / color / mirror / Atom feed
From: clement.leger@linux.dev
To: Sascha Hauer <s.hauer@pengutronix.de>, barebox@lists.infradead.org
Cc: "Ahmad Fatoum" <a.fatoum@barebox.org>,
	"Clément Léger" <clement.leger@linux.dev>
Subject: [PATCH 4/5] drivers: watchdog: remove KVX watchdog
Date: Fri, 23 Oct 2026 22:05:06 +0200	[thread overview]
Message-ID: <20261023200507.63716-5-clement.leger@linux.dev> (raw)
In-Reply-To: <20261023200507.63716-1-clement.leger@linux.dev>

From: Clément Léger <clement.leger@linux.dev>

Remove the kvx watchdog driver.

Signed-off-by: Clément Léger <clement.leger@linux.dev>
---
 drivers/watchdog/Kconfig   |  17 ------
 drivers/watchdog/Makefile  |   1 -
 drivers/watchdog/kvx_wdt.c | 109 -------------------------------------
 3 files changed, 127 deletions(-)
 delete mode 100644 drivers/watchdog/kvx_wdt.c

diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
index 14fdb7cf68..068d3c93dd 100644
--- a/drivers/watchdog/Kconfig
+++ b/drivers/watchdog/Kconfig
@@ -83,23 +83,6 @@ config WATCHDOG_ORION
 	help
 	  Add support for watchdog on the Marvall Armada XP
 
-config WATCHDOG_KVX
-	bool "KVX Core watchdog"
-	depends on KVX
-	help
-	  Add support for the KVX core watchdog.
-
-config WATCHDOG_KVX_EARLY_INIT
-	bool "KVX Core watchdog early init"
-	depends on WATCHDOG_KVX
-	help
-	  Activate the watchdog with early initcall
-
-config WATCHDOG_KVX_EARLY_TIMEOUT
-	int "KVX Core watchdog early timeout in cycles"
-	depends on WATCHDOG_KVX_EARLY_INIT
-	default 100000000
-
 config WATCHDOG_BCM2835
 	bool "Watchdog for BCM283x SoCs"
 	depends on ARCH_BCM283X || COMPILE_TEST
diff --git a/drivers/watchdog/Makefile b/drivers/watchdog/Makefile
index c49d090f8d..4b7fd74dfa 100644
--- a/drivers/watchdog/Makefile
+++ b/drivers/watchdog/Makefile
@@ -11,7 +11,6 @@ obj-$(CONFIG_WATCHDOG_JZ4740) += jz4740.o
 obj-$(CONFIG_WATCHDOG_IMX_RESET_SOURCE) += imxwd.o
 obj-$(CONFIG_WATCHDOG_IMX) += imxwd.o
 obj-$(CONFIG_WATCHDOG_IMXULP) += imxulp-wdt.o
-obj-$(CONFIG_WATCHDOG_KVX) += kvx_wdt.o
 obj-$(CONFIG_WATCHDOG_ORION) += orion_wdt.o
 obj-$(CONFIG_ARCH_BCM283X) += bcm2835_wdt.o
 obj-$(CONFIG_RAVE_SP_WATCHDOG) += rave-sp-wdt.o
diff --git a/drivers/watchdog/kvx_wdt.c b/drivers/watchdog/kvx_wdt.c
deleted file mode 100644
index 3e66aa38ba..0000000000
--- a/drivers/watchdog/kvx_wdt.c
+++ /dev/null
@@ -1,109 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0-or-later
-/*
- * Copyright (C) 2018 Kalray Inc.
- */
-
-#include <common.h>
-#include <init.h>
-#include <io.h>
-#include <of.h>
-#include <watchdog.h>
-
-#include <linux/clk.h>
-#include <linux/err.h>
-
-#include <asm/sfr.h>
-
-struct kvx_wdt {
-	uint64_t clk_rate;
-	struct watchdog wdd;
-};
-
-static void kvx_watchdog_disable(void)
-{
-	kvx_sfr_set_field(TCR, WUI, 0);
-	kvx_sfr_set_field(TCR, WCE, 0);
-}
-
-static int kvx_wdt_set_timeout(struct watchdog *wdd, unsigned int timeout)
-{
-	struct kvx_wdt *wdt = container_of(wdd, struct kvx_wdt, wdd);
-	uint64_t cycle_timeout = wdt->clk_rate * timeout;
-
-	/* Disable watchdog */
-	if (timeout == 0) {
-		kvx_watchdog_disable();
-		return 0;
-	}
-
-	kvx_sfr_set(WDV, cycle_timeout);
-	kvx_sfr_set(WDR, 0);
-
-	/* Start watchdog counting */
-	kvx_sfr_set_field(TCR, WUI, 1);
-	kvx_sfr_set_field(TCR, WCE, 1);
-
-	return 0;
-}
-
-static int count;
-
-static int kvx_wdt_drv_probe(struct device *dev)
-{
-	struct watchdog *wdd;
-	struct clk *clk;
-	struct kvx_wdt *kvx_wdt;
-
-	if (count != 0) {
-		dev_warn(dev, "Tried to register core watchdog twice\n");
-		return -EINVAL;
-	}
-	count++;
-
-	kvx_wdt = xzalloc(sizeof(*kvx_wdt));
-	clk = clk_get(dev, NULL);
-	if (IS_ERR(clk))
-		return PTR_ERR(clk);
-
-	kvx_wdt->clk_rate = clk_get_rate(clk);
-	clk_put(clk);
-
-	wdd = &kvx_wdt->wdd;
-	wdd->name = "kvx_wdt";
-	wdd->hwdev = dev;
-	wdd->set_timeout = kvx_wdt_set_timeout;
-
-	/* Be sure that interrupt are disabled */
-	kvx_sfr_set_field(TCR, WIE, 0);
-
-	return watchdog_register(wdd);
-}
-
-static struct of_device_id kvx_wdt_of_match[] = {
-	{ .compatible = "kalray,kvx-core-watchdog", },
-	{ /* sentinel */ }
-};
-MODULE_DEVICE_TABLE(of, kvx_wdt_of_match);
-
-static struct driver kvx_wdt_driver = {
-	.name		= "kvx-wdt",
-	.probe		= kvx_wdt_drv_probe,
-	.of_compatible	= DRV_OF_COMPAT(kvx_wdt_of_match),
-};
-device_platform_driver(kvx_wdt_driver);
-
-#ifdef CONFIG_WATCHDOG_KVX_EARLY_INIT
-static int kvx_wdt_early_init(void)
-{
-	/* Set Start watchdog counting */
-	kvx_sfr_set(WDV, CONFIG_WATCHDOG_KVX_EARLY_TIMEOUT);
-	kvx_sfr_set(WDR, 0);
-
-	/* Start watchdog counting */
-	kvx_sfr_set_field(TCR, WUI, 1);
-	kvx_sfr_set_field(TCR, WCE, 1);
-
-	return 0;
-}
-core_initcall(kvx_wdt_early_init);
-#endif
-- 
2.55.0




  parent reply	other threads:[~2026-10-23 20:06 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-23 20:05 [PATCH 0/5] kvx: remove architecture support clement.leger
2026-10-23 20:05 ` [PATCH 1/5] drivers: soc: remove KVX support clement.leger
2026-10-23 20:05 ` [PATCH 2/5] drivers: clocksource: remove KVX timer clement.leger
2026-10-23 20:05 ` [PATCH 3/5] drivers: nvmem: remove KVX OTP support clement.leger
2026-10-23 20:05 ` clement.leger [this message]
2026-10-26 10:01 ` [PATCH 0/5] kvx: remove architecture support Sascha Hauer
2026-10-26 15:28   ` Clement Leger
2026-10-26 10:01 ` Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261023200507.63716-5-clement.leger@linux.dev \
    --to=clement.leger@linux.dev \
    --cc=a.fatoum@barebox.org \
    --cc=barebox@lists.infradead.org \
    --cc=s.hauer@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.