Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/1.1/patches/2223654/?format=api
{ "id": 2223654, "url": "http://patchwork.ozlabs.org/api/1.1/patches/2223654/?format=api", "web_url": "http://patchwork.ozlabs.org/project/uboot/patch/20260415220213.449146-1-marek.vasut+renesas@mailbox.org/", "project": { "id": 18, "url": "http://patchwork.ozlabs.org/api/1.1/projects/18/?format=api", "name": "U-Boot", "link_name": "uboot", "list_id": "u-boot.lists.denx.de", "list_email": "u-boot@lists.denx.de", "web_url": null, "scm_url": null, "webscm_url": null }, "msgid": "<20260415220213.449146-1-marek.vasut+renesas@mailbox.org>", "date": "2026-04-15T22:01:54", "name": "watchdog: Add Renesas R-Car Gen5 window watchdog driver", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "0969c459796db39433606fe8c1f12b0a4d821d6a", "submitter": { "id": 85650, "url": "http://patchwork.ozlabs.org/api/1.1/people/85650/?format=api", "name": "Marek Vasut", "email": "marek.vasut+renesas@mailbox.org" }, "delegate": { "id": 1699, "url": "http://patchwork.ozlabs.org/api/1.1/users/1699/?format=api", "username": "marex", "first_name": "Marek", "last_name": "Vasut", "email": "marek.vasut@gmail.com" }, "mbox": "http://patchwork.ozlabs.org/project/uboot/patch/20260415220213.449146-1-marek.vasut+renesas@mailbox.org/mbox/", "series": [ { "id": 500045, "url": "http://patchwork.ozlabs.org/api/1.1/series/500045/?format=api", "web_url": "http://patchwork.ozlabs.org/project/uboot/list/?series=500045", "date": "2026-04-15T22:01:54", "name": "watchdog: Add Renesas R-Car Gen5 window watchdog driver", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/500045/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2223654/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2223654/checks/", "tags": {}, "headers": { "Return-Path": "<u-boot-bounces@lists.denx.de>", "X-Original-To": "incoming@patchwork.ozlabs.org", "Delivered-To": "patchwork-incoming@legolas.ozlabs.org", "Authentication-Results": [ "legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n secure) header.d=mailbox.org header.i=@mailbox.org header.a=rsa-sha256\n header.s=mail20150812 header.b=AyRjFT7P;\n\tdkim=pass (2048-bit key) header.d=mailbox.org header.i=@mailbox.org\n header.a=rsa-sha256 header.s=mail20150812 header.b=FQg7ZWRd;\n\tdkim-atps=neutral", "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de\n (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de;\n envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org)", "phobos.denx.de;\n dmarc=pass (p=reject dis=none) header.from=mailbox.org", "phobos.denx.de;\n spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de", "phobos.denx.de;\n\tdkim=pass (2048-bit key;\n secure) header.d=mailbox.org header.i=@mailbox.org header.b=\"AyRjFT7P\";\n\tdkim=pass (2048-bit key) header.d=mailbox.org header.i=@mailbox.org\n header.b=\"FQg7ZWRd\";\n\tdkim-atps=neutral", "phobos.denx.de;\n dmarc=pass (p=reject dis=none) header.from=mailbox.org", "phobos.denx.de;\n spf=pass smtp.mailfrom=marek.vasut+renesas@mailbox.org", "outgoing_mbo_mout;\n dkim=pass header.d=mailbox.org header.s=mail20150812 header.b=FQg7ZWRd;\n spf=pass (outgoing_mbo_mout: domain of marek.vasut+renesas@mailbox.org\n designates 2001:67c:2050:b231:465::102 as permitted sender)\n smtp.mailfrom=marek.vasut+renesas@mailbox.org" ], "Received": [ "from phobos.denx.de (phobos.denx.de\n [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fww9W4Tt3z1yG9\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 16 Apr 2026 08:02:23 +1000 (AEST)", "from h2850616.stratoserver.net (localhost [IPv6:::1])\n\tby phobos.denx.de (Postfix) with ESMTP id 014F883B99;\n\tThu, 16 Apr 2026 00:02:21 +0200 (CEST)", "by phobos.denx.de (Postfix, from userid 109)\n id 4846683B99; Thu, 16 Apr 2026 00:02:20 +0200 (CEST)", "from mout-p-202.mailbox.org (mout-p-202.mailbox.org\n [IPv6:2001:67c:2050:0:465::202])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))\n (No client certificate requested)\n by phobos.denx.de (Postfix) with ESMTPS id 30C5083936\n for <u-boot@lists.denx.de>; Thu, 16 Apr 2026 00:02:18 +0200 (CEST)", "from smtp102.mailbox.org (smtp102.mailbox.org\n [IPv6:2001:67c:2050:b231:465::102])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest\n SHA256)\n (No client certificate requested)\n by mout-p-202.mailbox.org (Postfix) with ESMTPS id 4fww9P5h4Lz9tFZ;\n Thu, 16 Apr 2026 00:02:17 +0200 (CEST)" ], "X-Spam-Checker-Version": "SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de", "X-Spam-Level": "", "X-Spam-Status": "No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,\n DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED,\n SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2", "DKIM-Signature": [ "v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailbox.org;\n s=mail20150812; t=1776290537;\n h=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n to:to:cc:cc:mime-version:mime-version:\n content-transfer-encoding:content-transfer-encoding;\n bh=sSp5JaJFst2B9D8ZD6ZnhtGCAeIuz+jq7nGkfj1wPSs=;\n b=AyRjFT7PrWDejGYzNgsxJobm53ESA+Nu0/w8tBuZl10iYSmkqH+a1HnYEHVgHYpYuD7ydh\n qq7wPbDEPFV5TurlUvswkiJUeUmpFUziNhPxhRkBCktipzEy/a/WKJiInob6+brBiSRGWD\n SWBsWcixXCPbPWMsu5/hkYZUJ4mX4JyJs7pWcv2YJeH8IQYfL5RLZCkhlUgcQfwyGhZpke\n D8phhbHj/P47ATFG2wmZJETUZPBQuWokErFXk456yvOzZ5QWntIQ6v9HOPECCffVVO7TNN\n GECgWEj/IYTCex4qYCWRZPywDc/LGVT55iJELF4iN85OnebQiLih0Tv/Z77xrw==", "v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailbox.org;\n s=mail20150812; t=1776290536;\n h=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n to:to:cc:cc:mime-version:mime-version:\n content-transfer-encoding:content-transfer-encoding;\n bh=sSp5JaJFst2B9D8ZD6ZnhtGCAeIuz+jq7nGkfj1wPSs=;\n b=FQg7ZWRdfF4MFvDhnDPCjy+1wkzWkgQquoINQABsrQfHa3FUXnseuSuXIPF4A0RdOI17QS\n Uq9X72LZ3nzqzz6Cgkajhd9hKZN1+a2mFYRKJ/g67SRKWCcIT9V2lQtaSctVHDu+5v8bWQ\n UMUXhHPOfnxQiBbumErBzqUY5X8Rkw1THuDxthZWccx68voWsgxKdR0OOSeZHl7nTvflda\n 8EBxDa8NN9tasd5SiGUHTi5iSOVodrZl0qHuN1Tdei4doeFdT6dcffBfb8Ow4QFpzoaTVM\n 6/XHLh3lRl2dJKQX8iPoHqEV7ZKIje3LFRj+70efdozkaUARcXPQIEeOWnfylg==" ], "From": "Marek Vasut <marek.vasut+renesas@mailbox.org>", "To": "u-boot@lists.denx.de", "Cc": "Marek Vasut <marek.vasut+renesas@mailbox.org>,\n Nobuhiro Iwamatsu <iwamatsu@nigauri.org>,\n Stefan Roese <stefan.roese@mailbox.org>, Tom Rini <trini@konsulko.com>", "Subject": "[PATCH] watchdog: Add Renesas R-Car Gen5 window watchdog driver", "Date": "Thu, 16 Apr 2026 00:01:54 +0200", "Message-ID": "<20260415220213.449146-1-marek.vasut+renesas@mailbox.org>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "X-MBO-RS-ID": "5fe122557a4ba454557", "X-MBO-RS-META": "h6mtmejiu8shz4g9fahetro5reubgt5g", "X-Rspamd-Queue-Id": "4fww9P5h4Lz9tFZ", "X-BeenThere": "u-boot@lists.denx.de", "X-Mailman-Version": "2.1.39", "Precedence": "list", "List-Id": "U-Boot discussion <u-boot.lists.denx.de>", "List-Unsubscribe": "<https://lists.denx.de/options/u-boot>,\n <mailto:u-boot-request@lists.denx.de?subject=unsubscribe>", "List-Archive": "<https://lists.denx.de/pipermail/u-boot/>", "List-Post": "<mailto:u-boot@lists.denx.de>", "List-Help": "<mailto:u-boot-request@lists.denx.de?subject=help>", "List-Subscribe": "<https://lists.denx.de/listinfo/u-boot>,\n <mailto:u-boot-request@lists.denx.de?subject=subscribe>", "Errors-To": "u-boot-bounces@lists.denx.de", "Sender": "\"U-Boot\" <u-boot-bounces@lists.denx.de>", "X-Virus-Scanned": "clamav-milter 0.103.8 at phobos.denx.de", "X-Virus-Status": "Clean" }, "content": "Add support of Renesas R-Car Gen5 window watchdog timer. Timeout\nconfiguration is derived from CONFIG_WATCHDOG_TIMEOUT_MSECS, which\nis more accurate than the 1-second granularity 'timeout' passed to\n.start callback.\n\nSigned-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>\n---\nCc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>\nCc: Stefan Roese <stefan.roese@mailbox.org>\nCc: Tom Rini <trini@konsulko.com>\nCc: u-boot@lists.denx.de\n---\n drivers/watchdog/Kconfig | 6 ++\n drivers/watchdog/Makefile | 1 +\n drivers/watchdog/renesas_wwdt.c | 147 ++++++++++++++++++++++++++++++++\n 3 files changed, 154 insertions(+)\n create mode 100644 drivers/watchdog/renesas_wwdt.c", "diff": "diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig\nindex 416d29d256a..7fdfb7add45 100644\n--- a/drivers/watchdog/Kconfig\n+++ b/drivers/watchdog/Kconfig\n@@ -356,6 +356,12 @@ config WDT_RENESAS\n \thelp\n \t Enables Renesas SoC R8A779F0 watchdog timer support.\n \n+config WDT_RENESAS_WWDT\n+\tbool \"Renesas window watchdog timer support\"\n+\tdepends on WDT\n+\thelp\n+\t Enables Renesas window watchdog timer support.\n+\n config WDT_SANDBOX\n \tbool \"Enable Watchdog Timer support for Sandbox\"\n \tdepends on SANDBOX && WDT\ndiff --git a/drivers/watchdog/Makefile b/drivers/watchdog/Makefile\nindex 02e2674f8af..84faefdb4c2 100644\n--- a/drivers/watchdog/Makefile\n+++ b/drivers/watchdog/Makefile\n@@ -44,6 +44,7 @@ obj-$(CONFIG_WDT_NPCM) += npcm_wdt.o\n obj-$(CONFIG_WDT_OCTEONTX) += octeontx_wdt.o\n obj-$(CONFIG_WDT_OMAP3) += omap_wdt.o\n obj-$(CONFIG_WDT_RENESAS) += renesas_wdt.o\n+obj-$(CONFIG_WDT_RENESAS_WWDT) += renesas_wwdt.o\n obj-$(CONFIG_WDT_SBSA) += sbsa_gwdt.o\n obj-$(CONFIG_WDT_K3_RTI) += rti_wdt.o\n obj-$(CONFIG_WDT_SIEMENS_PMIC) += siemens_pmic_wdt.o\ndiff --git a/drivers/watchdog/renesas_wwdt.c b/drivers/watchdog/renesas_wwdt.c\nnew file mode 100644\nindex 00000000000..3e76ccc415d\n--- /dev/null\n+++ b/drivers/watchdog/renesas_wwdt.c\n@@ -0,0 +1,147 @@\n+// SPDX-License-Identifier: GPL-2.0+\n+/*\n+ * Copyright (C) 2026 Marek Vasut <marek.vasut+renesas@mailbox.org>\n+ */\n+\n+#include <asm/io.h>\n+#include <clk.h>\n+#include <dm/device_compat.h>\n+#include <dm.h>\n+#include <linux/bitfield.h>\n+#include <linux/iopoll.h>\n+#include <wdt.h>\n+\n+#define field_prep(_mask, _val) (((_val) << (ffs(_mask) - 1)) & (_mask))\n+\n+#define RSIP_CTL_BASE\t\t0x5fffd000\n+#define RSIP_CTL_CFG4\t\t(RSIP_CTL_BASE + 0xb0)\n+#define RSIP_CTL_CFG4_OPWDEN\tBIT(3)\n+#define RSIP_CTL_CFG4_OPWDVAC\tBIT(5)\n+\n+#define WDTA0_ACT_CODE\t\t0xac\n+#define WDTA0WDTE\t\t0x0\n+#define WDTA0EVAC\t\t0x4\n+#define WDTA0REF\t\t0x8\n+#define WDTA0MD\t\t\t0xc\n+#define WDTA0MD_OVF_MASK\tGENMASK(6, 4)\n+#define WDTA0MD_OVF(n)\t\tfield_prep(WDTA0MD_OVF_MASK, (n))\n+#define WDTA0MD_NWIE\t\tBIT(3)\n+#define WDTA0MD_NERM\t\tBIT(2)\n+#define WDTA0MD_NVS_MASK\tGENMASK(1, 0)\n+#define WDTA0MD_NVS_75P\t\tFIELD_PREP(WDTA0MD_NVS_MASK, 3)\n+\n+struct wwdt_priv {\n+\tvoid __iomem *base;\n+\tunsigned int timeout;\n+};\n+\n+/**\n+ * wwdt_reset() - Reset or ping Window WDT\n+ * @dev: Watchdog device\n+ */\n+static int wwdt_reset(struct udevice *dev)\n+{\n+\tstruct wwdt_priv *priv = dev_get_priv(dev);\n+\tconst u32 cfg = readl(RSIP_CTL_CFG4);\n+\tu32 rv;\n+\n+\t/* WDT disabled, do nothing. */\n+\tif (!(cfg & RSIP_CTL_CFG4_OPWDEN))\n+\t\treturn 0;\n+\n+\t/* WDT with variable activation code */\n+\tif (cfg & RSIP_CTL_CFG4_OPWDVAC) {\n+\t\trv = readb(priv->base + WDTA0REF);\n+\t\trv = WDTA0_ACT_CODE - rv;\n+\t\twriteb(rv, priv->base + WDTA0EVAC);\n+\t} else {\n+\t\twriteb(WDTA0_ACT_CODE, priv->base + WDTA0WDTE);\n+\t}\n+\n+\treturn 0;\n+}\n+\n+/**\n+ * wwdt_start() - Start Window WDT\n+ * @dev: Watchdog device\n+ * @timeout: Watchdog timeout (not used)\n+ * @flags: Flags (not used)\n+ */\n+static int wwdt_start(struct udevice *dev, u64 timeout, ulong flags)\n+{\n+\tstruct wwdt_priv *priv = dev_get_priv(dev);\n+\n+\tclrsetbits_8(priv->base + WDTA0MD,\n+\t\t WDTA0MD_OVF_MASK | WDTA0MD_NWIE |\n+\t\t WDTA0MD_NERM | WDTA0MD_NVS_MASK,\n+\t\t WDTA0MD_OVF(priv->timeout) | WDTA0MD_NWIE |\n+\t\t WDTA0MD_NVS_75P);\n+\n+\twwdt_reset(dev);\n+\n+\treturn 0;\n+}\n+\n+/**\n+ * wwdt_probe() - Initialize Window WDT hardware\n+ * @dev: Watchdog device\n+ */\n+static int wwdt_probe(struct udevice *dev)\n+{\n+\tstruct wwdt_priv *priv = dev_get_priv(dev);\n+\tunsigned long rate;\n+\tstruct clk *clk;\n+\tint ret;\n+\n+\tpriv->base = dev_remap_addr(dev);\n+\tif (!priv->base)\n+\t\treturn -EINVAL;\n+\n+\tclk = devm_clk_get(dev, \"cnt\");\n+\tif (IS_ERR(clk)) {\n+\t\tret = PTR_ERR(clk);\n+\t\tdev_err(dev, \"Failed to get counter clock: %d\\n\", ret);\n+\t\treturn ret;\n+\t}\n+\n+\tret = clk_enable(clk);\n+\tif (ret)\n+\t\treturn ret;\n+\n+\trate = clk_get_rate(clk);\n+\tif (!rate) {\n+\t\tclk_disable(clk);\n+\t\treturn -ENOENT;\n+\t}\n+\n+\t/*\n+\t * Interval time is in \"2^9..2^16 / clk_wdt\" range. WDTA0OVFx is\n+\t * in 0..7 range. The code below does the WDTA0OVFx calculation\n+\t * from \"interval_time = (1 << N) / clk_wdt\" by caculating the N.\n+\t * The N rounded down is MSbit of (interval_time * clk_wdt). The\n+\t * result is then clamped to fit into the N in 9..16 range, and\n+\t * decremented by 9 to fit into WDTA0OVFx in 0..7 range .\n+\t */\n+\tpriv->timeout = clamp(fls(CONFIG_WATCHDOG_TIMEOUT_MSECS * rate) - 1, 9, 16) - 9;\n+\n+\treturn 0;\n+}\n+\n+static const struct wdt_ops wwdt_ops = {\n+\t.start = wwdt_start,\n+\t.reset = wwdt_reset,\n+};\n+\n+static const struct udevice_id wwdt_ids[] = {\n+\t{ .compatible = \"renesas,rcar-gen5-wwdt\" },\n+\t{}\n+};\n+\n+U_BOOT_DRIVER(wwdt_renesas) = {\n+\t.name = \"wwdt_renesas\",\n+\t.id = UCLASS_WDT,\n+\t.of_match = wwdt_ids,\n+\t.ops = &wwdt_ops,\n+\t.probe\t= wwdt_probe,\n+\t.priv_auto = sizeof(struct wwdt_priv),\n+};\n", "prefixes": [] }