* [PATCH v4 0/7] Add syscon support for Renesas RZ/T2H & RZ/N2H in CPG/MSSR driver
@ 2026-08-17 19:25 Prabhakar
2026-08-17 19:25 ` [PATCH v4 1/7] clk: renesas: r9a09g077: Register SYSC regmap Prabhakar
` (7 more replies)
0 siblings, 8 replies; 21+ messages in thread
From: Prabhakar @ 2026-08-17 19:25 UTC (permalink / raw)
To: Geert Uytterhoeven, Magnus Damm, Michael Turquette, Stephen Boyd,
Brian Masney, Guenter Roeck, Wim Van Sebroeck, Rob Herring,
Krzysztof Kozlowski, Conor Dooley
Cc: linux-watchdog, devicetree, linux-kernel, linux-renesas-soc,
linux-clk, Prabhakar, Biju Das, Fabrizio Castro, Lad Prabhakar
From: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Hi All,
This series adds syscon support for the Renesas RZ/T2H and RZ/N2H SoCs
in the CPG/MSSR driver. The CPG/MSSR block on these SoCs is a
multi-function block that integrates several system-level features beyond
clock and reset control, including clock monitoring, write protection,
and peripheral configuration registers.
For the other IP blocks to be configured a syscon support is provided in
the CPG/MSSR driver. This allows other drivers to access the CPG/MSSR
registers via a regmap interface.
Note:
- Patches have been rebased on top of next-20260817 + renesas-dts-for-v7.4 +
renesas-clk-for-v7.4.
- The WDT driver patches apply on top of series [0].
[0] https://lore.kernel.org/all/20260814191415.2110732-1-prabhakar.mahadev-lad.rj@bp.renesas.com/
v3->v4:
- Dropped DT binding patch that split up the renesas,cpg-mssr.yaml file
- Dropped RZT2H_SYSC_BASE macro
- Added array of base pointers to the r9a09g077_sysc_reg struct to
support multiple SYSC regions
- Merged r9a09g077_writeable_readable_sysc0 and
r9a09g077_writeable_readable_sysc1 into a single function
that checks the SYSC block and offset to determine if the register is
readable/writable.
- Added RZT2H_CPG_REG_SIZE macro
- Updated r9a09g077_post_init() to call of_address_to_resource() to check
the size of the mapped CPG register regions
- Dropped changes from cpg_mssr_common_init
v2->v3:
- Switched to non-RFC patches for the series.
- Added new patch to split out the RZ/T2H CPG binding from the generic
Renesas CPG/MSSR binding.
- Dropped WDT driver refactor changes from this series. These has be
submitted in a separate series which makes use of regmap.
- Dropped registers from writeable_readable list.
- Renamed sysc_init to post_init and updated signature to take
cpg_mssr_pub struct.
- Created a single regmap covering both SYSC register regions
instead of two separate regmaps.
- Updated commit messages
v1->v2:
https://lore.kernel.org/all/20260702123112.161160-1-prabhakar.mahadev-lad.rj@bp.renesas.com/
- Updated commit message for patch #1
- Made use of for_each_child_of_node_scoped
- Moved sysc_init() to the end of the probe function
v1: https://lore.kernel.org/all/20260511185058.1926869-1-prabhakar.mahadev-lad.rj@bp.renesas.com/
Cheers,
Prabhakar
Lad Prabhakar (7):
clk: renesas: r9a09g077: Register SYSC regmap
arm64: dts: renesas: r9a09g077: Adjust CPG register region sizes
arm64: dts: renesas: r9a09g087: Adjust CPG register region sizes
dt-bindings: watchdog: renesas,r9a09g057-wdt: Add CPG/MSSR syscon
support
watchdog: rzv2h: Add syscon support for WDTDCR
arm64: dts: renesas: r9a09g077: Use CPG/MSSR syscon for WDTDCR access
arm64: dts: renesas: r9a09g087: Use CPG/MSSR syscon for WDTDCR access
.../watchdog/renesas,r9a09g057-wdt.yaml | 29 +++-
arch/arm64/boot/dts/renesas/r9a09g077.dtsi | 28 ++--
arch/arm64/boot/dts/renesas/r9a09g087.dtsi | 28 ++--
drivers/clk/renesas/Kconfig | 2 +
drivers/clk/renesas/r9a09g077-cpg.c | 140 ++++++++++++++++++
drivers/clk/renesas/renesas-cpg-mssr.c | 3 +
drivers/clk/renesas/renesas-cpg-mssr.h | 1 +
drivers/watchdog/Kconfig | 1 +
drivers/watchdog/rzv2h_wdt.c | 56 +++++--
9 files changed, 247 insertions(+), 41 deletions(-)
--
2.43.0
^ permalink raw reply [flat|nested] 21+ messages in thread
* [PATCH v4 1/7] clk: renesas: r9a09g077: Register SYSC regmap
2026-08-17 19:25 [PATCH v4 0/7] Add syscon support for Renesas RZ/T2H & RZ/N2H in CPG/MSSR driver Prabhakar
@ 2026-08-17 19:25 ` Prabhakar
2026-08-25 12:26 ` Geert Uytterhoeven
2026-08-17 19:25 ` [PATCH v4 2/7] arm64: dts: renesas: r9a09g077: Adjust CPG register region sizes Prabhakar
` (6 subsequent siblings)
7 siblings, 1 reply; 21+ messages in thread
From: Prabhakar @ 2026-08-17 19:25 UTC (permalink / raw)
To: Geert Uytterhoeven, Magnus Damm, Michael Turquette, Stephen Boyd,
Brian Masney, Guenter Roeck, Wim Van Sebroeck, Rob Herring,
Krzysztof Kozlowski, Conor Dooley
Cc: linux-watchdog, devicetree, linux-kernel, linux-renesas-soc,
linux-clk, Prabhakar, Biju Das, Fabrizio Castro, Lad Prabhakar
From: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Register a syscon regmap for the System Controller (SYSC) integrated into
the RZ/T2H and RZ/N2H CPG block.
Unlike traditional Renesas CPG/MSSR implementations, the RZ/T2H and RZ/N2H
CPG block also integrates the SYSC, which provides low-power management,
clock monitoring, write protection and peripheral configuration registers
shared by multiple drivers.
Implement the RZ/T2H-specific .post_init() callback to create and register
a syscon regmap covering the SYSC register space using the CPG device node.
For backward compatibility, return without registering the regmap when the
mapped resources correspond to older Device Trees that expose only the
legacy 64 KiB CPG register window.
Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
---
v3->v4:
- Dropped RZT2H_SYSC_BASE macro
- Added array of base pointers to the r9a09g077_sysc_reg struct to
support multiple SYSC regions
- Merged r9a09g077_writeable_readable_sysc0 and
r9a09g077_writeable_readable_sysc1 into a single function
that checks the SYSC block and offset to determine if the register is
readable/writable.
- Added RZT2H_CPG_REG_SIZE macro
- Updated r9a09g077_post_init() to call of_address_to_resource() to check
the size of the mapped CPG register regions
- Dropped changes from cpg_mssr_common_init
v2->v3:
- Dropped dangerous registers from writeable_readable list.
- Renamed sysc_init to post_init and updated signature to take
cpg_mssr_pub struct.
- Created a single regmap covering both SYSC register regions
instead of two separate regmaps.
- Updated commit message
v1->v2:
- Made use of for_each_child_of_node_scoped
- Moved sysc_init() to the end of the probe function
---
drivers/clk/renesas/Kconfig | 2 +
drivers/clk/renesas/r9a09g077-cpg.c | 140 +++++++++++++++++++++++++
drivers/clk/renesas/renesas-cpg-mssr.c | 3 +
drivers/clk/renesas/renesas-cpg-mssr.h | 1 +
4 files changed, 146 insertions(+)
diff --git a/drivers/clk/renesas/Kconfig b/drivers/clk/renesas/Kconfig
index 17b95a2e96fb..46b929e9872b 100644
--- a/drivers/clk/renesas/Kconfig
+++ b/drivers/clk/renesas/Kconfig
@@ -223,11 +223,13 @@ config CLK_R9A09G077
bool "RZ/T2H clock support" if COMPILE_TEST
select CLK_RENESAS_CPG_MSSR
select CLK_RZV2H_CPG_LIB
+ select MFD_SYSCON
config CLK_R9A09G087
bool "RZ/N2H clock support" if COMPILE_TEST
select CLK_RENESAS_CPG_MSSR
select CLK_RZV2H_CPG_LIB
+ select MFD_SYSCON
config CLK_SH73A0
bool "SH-Mobile AG5 clock support" if COMPILE_TEST
diff --git a/drivers/clk/renesas/r9a09g077-cpg.c b/drivers/clk/renesas/r9a09g077-cpg.c
index 5640c2035e5a..0495e3206973 100644
--- a/drivers/clk/renesas/r9a09g077-cpg.c
+++ b/drivers/clk/renesas/r9a09g077-cpg.c
@@ -7,6 +7,7 @@
*/
#include <linux/bitfield.h>
+#include <linux/bits.h>
#include <linux/clk-provider.h>
#include <linux/clk/renesas.h>
#include <linux/device.h>
@@ -15,7 +16,10 @@
#include <linux/iopoll.h>
#include <linux/kernel.h>
#include <linux/math.h>
+#include <linux/mfd/syscon.h>
#include <linux/module.h>
+#include <linux/of_address.h>
+#include <linux/regmap.h>
#include <linux/types.h>
#include <linux/units.h>
@@ -87,6 +91,20 @@ MODULE_IMPORT_NS("RZV2H_CPG");
#define CPG_PLL_MON(x) ((x) - 0x10)
#define CPG_PLL_MON_LOCK BIT(0)
+/* Size of each mapped CPG/MSSR register region (base0, base1) */
+#define RZT2H_CPG_REG_SIZE 0x20000
+/* This is the size of two SYSC regions combined */
+#define RZT2H_SYSC_SIZE 0x20000
+#define RZT2H_SYSC_OFFSET 0x10000
+#define RZT2H_SYSC_BLOCK_MASK BIT(16)
+#define RZT2H_SYSC_OFFSET_MASK GENMASK(15, 0)
+#define RZT2H_SYSC_BLOCK(x) FIELD_GET(RZT2H_SYSC_BLOCK_MASK, x)
+#define RZT2H_SYSC_REG_OFFSET(x) FIELD_GET(RZT2H_SYSC_OFFSET_MASK, x)
+
+struct r9a09g077_sysc_reg {
+ void __iomem *base[2];
+};
+
enum rzt2h_clk_types {
CLK_TYPE_RZT2H_DIV = CLK_TYPE_CUSTOM, /* Clock with divider */
CLK_TYPE_RZT2H_MUX, /* Clock with clock source selector */
@@ -875,6 +893,126 @@ r9a09g077_cpg_clk_register(struct device *dev, const struct cpg_core_clk *core,
}
}
+static int r9a09g077_regmap_read(void *context, unsigned int reg, unsigned int *val)
+{
+ struct r9a09g077_sysc_reg *sysc = context;
+ void __iomem *base = sysc->base[RZT2H_SYSC_BLOCK(reg)];
+
+ *val = readl(base + RZT2H_SYSC_REG_OFFSET(reg));
+
+ return 0;
+}
+
+static int r9a09g077_regmap_write(void *context, unsigned int reg, unsigned int val)
+{
+ struct r9a09g077_sysc_reg *sysc = context;
+ void __iomem *base = sysc->base[RZT2H_SYSC_BLOCK(reg)];
+
+ writel(val, base + RZT2H_SYSC_REG_OFFSET(reg));
+
+ return 0;
+}
+
+static const struct regmap_bus r9a09g077_sys_regmap_bus = {
+ .reg_write = r9a09g077_regmap_write,
+ .reg_read = r9a09g077_regmap_read,
+};
+
+static bool r9a09g077_writeable_readable_sysc(struct device *dev, unsigned int reg)
+{
+ unsigned int offset = RZT2H_SYSC_REG_OFFSET(reg);
+
+ switch (RZT2H_SYSC_BLOCK(reg)) {
+ case 0:
+ switch (offset) {
+ /* ELOPA/B and GTIOCSEL */
+ case 0x0000 ... 0x0008:
+ /* Encoder config */
+ case 0x1000 ... 0x1164:
+ /* PCIe config */
+ case 0x2000 ... 0x2024:
+ case 0x2030 ... 0x2054:
+ case 0x2060:
+ /* xSPI config */
+ case 0x3000 ... 0x300C:
+ case 0x3100 ... 0x310C:
+ /* MD_MON */
+ case 0x4100:
+ /* PRCRN */
+ case 0x4200:
+ return true;
+
+ default:
+ return false;
+ }
+ case 1:
+ switch (offset) {
+ /* WDTDCRm */
+ case 0x5100 ... 0x5114:
+ /* PRCRS */
+ case 0x6000:
+ return true;
+
+ default:
+ return false;
+ }
+ default:
+ return false;
+ }
+}
+
+static int r9a09g077_post_init(struct device *dev, struct cpg_mssr_pub *pub)
+{
+ struct regmap_config *regmap_cfg __free(kfree) = kzalloc_obj(*regmap_cfg);
+ struct r9a09g077_sysc_reg *sysc_reg;
+ struct regmap *regmap;
+ struct resource res;
+ int ret;
+
+ /*
+ * Return early if the SYSC sizes are not as expected, for backwards
+ * compatibility with older device trees that only expose the 64 KiB
+ * CPG register window.
+ */
+ ret = of_address_to_resource(dev->of_node, 0, &res);
+ if (ret)
+ return ret;
+ if (resource_size(&res) != RZT2H_CPG_REG_SIZE)
+ return 0;
+
+ ret = of_address_to_resource(dev->of_node, 1, &res);
+ if (ret)
+ return ret;
+ if (resource_size(&res) != RZT2H_CPG_REG_SIZE)
+ return 0;
+
+ if (!regmap_cfg)
+ return -ENOMEM;
+
+ sysc_reg = devm_kzalloc(dev, sizeof(*sysc_reg), GFP_KERNEL);
+ if (!sysc_reg)
+ return -ENOMEM;
+
+ /* Only allow access in the SYSC regions */
+ sysc_reg->base[0] = pub->base0 + RZT2H_SYSC_OFFSET;
+ sysc_reg->base[1] = pub->base1 + RZT2H_SYSC_OFFSET;
+
+ regmap_cfg->name = "rzt2h_sysc";
+ regmap_cfg->reg_bits = 32;
+ regmap_cfg->reg_stride = 4;
+ regmap_cfg->val_bits = 32;
+ regmap_cfg->fast_io = true;
+ regmap_cfg->max_register = RZT2H_SYSC_SIZE - 1;
+ regmap_cfg->readable_reg = r9a09g077_writeable_readable_sysc;
+ regmap_cfg->writeable_reg = r9a09g077_writeable_readable_sysc;
+
+ regmap = devm_regmap_init(dev, &r9a09g077_sys_regmap_bus, sysc_reg, regmap_cfg);
+ if (IS_ERR(regmap))
+ return PTR_ERR(regmap);
+
+ return of_syscon_register_regmap(dev->of_node, regmap);
+}
+
const struct cpg_mssr_info r9a09g077_cpg_mssr_info = {
/* Core Clocks */
.core_clks = r9a09g077_core_clks,
@@ -889,4 +1027,6 @@ const struct cpg_mssr_info r9a09g077_cpg_mssr_info = {
.reg_layout = CLK_REG_LAYOUT_RZ_T2H,
.cpg_clk_register = r9a09g077_cpg_clk_register,
+
+ .post_init = r9a09g077_post_init,
};
diff --git a/drivers/clk/renesas/renesas-cpg-mssr.c b/drivers/clk/renesas/renesas-cpg-mssr.c
index 80f4403ea2ba..f2feac1cc74f 100644
--- a/drivers/clk/renesas/renesas-cpg-mssr.c
+++ b/drivers/clk/renesas/renesas-cpg-mssr.c
@@ -1414,6 +1414,9 @@ static int __init cpg_mssr_probe(struct platform_device *pdev)
error = cpg_mssr_reset_controller_register(priv);
+ if (!error && info->post_init)
+ error = info->post_init(priv->dev, &priv->pub);
+
reserve_exit:
cpg_mssr_reserved_exit(priv);
diff --git a/drivers/clk/renesas/renesas-cpg-mssr.h b/drivers/clk/renesas/renesas-cpg-mssr.h
index ad11ab5f0069..5bef6f34dcb2 100644
--- a/drivers/clk/renesas/renesas-cpg-mssr.h
+++ b/drivers/clk/renesas/renesas-cpg-mssr.h
@@ -178,6 +178,7 @@ struct cpg_mssr_info {
/* Callbacks */
int (*init)(struct device *dev);
+ int (*post_init)(struct device *dev, struct cpg_mssr_pub *pub);
struct clk *(*cpg_clk_register)(struct device *dev,
const struct cpg_core_clk *core,
const struct cpg_mssr_info *info,
--
2.43.0
^ permalink raw reply [flat|nested] 21+ messages in thread
* [PATCH v4 2/7] arm64: dts: renesas: r9a09g077: Adjust CPG register region sizes
2026-08-17 19:25 [PATCH v4 0/7] Add syscon support for Renesas RZ/T2H & RZ/N2H in CPG/MSSR driver Prabhakar
2026-08-17 19:25 ` [PATCH v4 1/7] clk: renesas: r9a09g077: Register SYSC regmap Prabhakar
@ 2026-08-17 19:25 ` Prabhakar
2026-08-25 12:27 ` Geert Uytterhoeven
2026-08-17 19:25 ` [PATCH v4 3/7] arm64: dts: renesas: r9a09g087: " Prabhakar
` (5 subsequent siblings)
7 siblings, 1 reply; 21+ messages in thread
From: Prabhakar @ 2026-08-17 19:25 UTC (permalink / raw)
To: Geert Uytterhoeven, Magnus Damm, Michael Turquette, Stephen Boyd,
Brian Masney, Guenter Roeck, Wim Van Sebroeck, Rob Herring,
Krzysztof Kozlowski, Conor Dooley
Cc: linux-watchdog, devicetree, linux-kernel, linux-renesas-soc,
linux-clk, Prabhakar, Biju Das, Fabrizio Castro, Lad Prabhakar
From: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Increase the size of both CPG register regions from 64 KiB to 128 KiB.
On the RZ/T2H SoC, the CPG/MSSR block is a multi-function block where,
apart from clock and reset handling, it supports other features including
clock monitoring, write protection, and peripheral configuration registers.
Expand the mapped register regions to cover the entire register space of
this block so these additional features can be utilized.
Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
---
v3->v4:
- No change
v2->v3:
- new patch
---
arch/arm64/boot/dts/renesas/r9a09g077.dtsi | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/arm64/boot/dts/renesas/r9a09g077.dtsi b/arch/arm64/boot/dts/renesas/r9a09g077.dtsi
index 33f953c110bb..de20bed2797b 100644
--- a/arch/arm64/boot/dts/renesas/r9a09g077.dtsi
+++ b/arch/arm64/boot/dts/renesas/r9a09g077.dtsi
@@ -1075,8 +1075,8 @@ xspi1: spi@801c1000 {
cpg: clock-controller@80280000 {
compatible = "renesas,r9a09g077-cpg-mssr";
- reg = <0 0x80280000 0 0x10000>,
- <0 0x81280000 0 0x10000>;
+ reg = <0 0x80280000 0 0x20000>,
+ <0 0x81280000 0 0x20000>;
clocks = <&extal_clk>;
clock-names = "extal";
#clock-cells = <2>;
--
2.43.0
^ permalink raw reply [flat|nested] 21+ messages in thread
* [PATCH v4 3/7] arm64: dts: renesas: r9a09g087: Adjust CPG register region sizes
2026-08-17 19:25 [PATCH v4 0/7] Add syscon support for Renesas RZ/T2H & RZ/N2H in CPG/MSSR driver Prabhakar
2026-08-17 19:25 ` [PATCH v4 1/7] clk: renesas: r9a09g077: Register SYSC regmap Prabhakar
2026-08-17 19:25 ` [PATCH v4 2/7] arm64: dts: renesas: r9a09g077: Adjust CPG register region sizes Prabhakar
@ 2026-08-17 19:25 ` Prabhakar
2026-08-25 12:27 ` Geert Uytterhoeven
2026-08-17 19:25 ` [PATCH v4 4/7] dt-bindings: watchdog: renesas,r9a09g057-wdt: Add CPG/MSSR syscon support Prabhakar
` (4 subsequent siblings)
7 siblings, 1 reply; 21+ messages in thread
From: Prabhakar @ 2026-08-17 19:25 UTC (permalink / raw)
To: Geert Uytterhoeven, Magnus Damm, Michael Turquette, Stephen Boyd,
Brian Masney, Guenter Roeck, Wim Van Sebroeck, Rob Herring,
Krzysztof Kozlowski, Conor Dooley
Cc: linux-watchdog, devicetree, linux-kernel, linux-renesas-soc,
linux-clk, Prabhakar, Biju Das, Fabrizio Castro, Lad Prabhakar
From: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Increase the size of both CPG register regions from 64 KiB to 128 KiB.
On the RZ/N2H SoC, the CPG/MSSR block is a multi-function block where,
apart from clock and reset handling, it supports other features including
clock monitoring, write protection, and peripheral configuration registers.
Expand the mapped register regions to cover the entire register space of
this block so these additional features can be utilized.
Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
---
v3->v4:
- No change
v2->v3:
- new patch
---
arch/arm64/boot/dts/renesas/r9a09g087.dtsi | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/arm64/boot/dts/renesas/r9a09g087.dtsi b/arch/arm64/boot/dts/renesas/r9a09g087.dtsi
index d5b3eb6c1736..813bb0cb021c 100644
--- a/arch/arm64/boot/dts/renesas/r9a09g087.dtsi
+++ b/arch/arm64/boot/dts/renesas/r9a09g087.dtsi
@@ -1078,8 +1078,8 @@ xspi1: spi@801c1000 {
cpg: clock-controller@80280000 {
compatible = "renesas,r9a09g087-cpg-mssr";
- reg = <0 0x80280000 0 0x10000>,
- <0 0x81280000 0 0x10000>;
+ reg = <0 0x80280000 0 0x20000>,
+ <0 0x81280000 0 0x20000>;
clocks = <&extal_clk>;
clock-names = "extal";
#clock-cells = <2>;
--
2.43.0
^ permalink raw reply [flat|nested] 21+ messages in thread
* [PATCH v4 4/7] dt-bindings: watchdog: renesas,r9a09g057-wdt: Add CPG/MSSR syscon support
2026-08-17 19:25 [PATCH v4 0/7] Add syscon support for Renesas RZ/T2H & RZ/N2H in CPG/MSSR driver Prabhakar
` (2 preceding siblings ...)
2026-08-17 19:25 ` [PATCH v4 3/7] arm64: dts: renesas: r9a09g087: " Prabhakar
@ 2026-08-17 19:25 ` Prabhakar
2026-08-25 12:28 ` Geert Uytterhoeven
2026-08-27 14:02 ` Guenter Roeck
2026-08-17 19:25 ` [PATCH v4 5/7] watchdog: rzv2h: Add syscon support for WDTDCR Prabhakar
` (3 subsequent siblings)
7 siblings, 2 replies; 21+ messages in thread
From: Prabhakar @ 2026-08-17 19:25 UTC (permalink / raw)
To: Geert Uytterhoeven, Magnus Damm, Michael Turquette, Stephen Boyd,
Brian Masney, Guenter Roeck, Wim Van Sebroeck, Rob Herring,
Krzysztof Kozlowski, Conor Dooley
Cc: linux-watchdog, devicetree, linux-kernel, linux-renesas-soc,
linux-clk, Prabhakar, Biju Das, Fabrizio Castro, Lad Prabhakar
From: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
On the Renesas RZ/T2H SoC, the Watchdog Timer Control Register (WDTDCR)
resides within the CPG/MSSR block rather than the WDT address space
itself.
Previously, this was handled by including a second register range in the
"reg" property. However, this is architecturally incorrect as the CPG/MSSR
block consists of two distinct regions (0x80280000 and 0x81280000) that
contain registers for multiple peripheral blocks.
Since the CPG/MSSR block is a multi-function block, introduce the
"renesas,sysc" phandle-array property to allow the WDT driver to access
its control register via this shared regmap.
Mark the use of a second "reg" entry as deprecated in favor of the
new phandle-array approach for SoCs that require WDTDCR access.
Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
---
v3->v4:
- Added RB tag from Rob.
v2->v3:
- Updated property name to "renesas,sysc"
- Updated description about deprecation and use of the new
phandle-array property.
- Updated commit message
v1->v2:
- No change.
---
.../watchdog/renesas,r9a09g057-wdt.yaml | 29 +++++++++++++++++--
1 file changed, 27 insertions(+), 2 deletions(-)
diff --git a/Documentation/devicetree/bindings/watchdog/renesas,r9a09g057-wdt.yaml b/Documentation/devicetree/bindings/watchdog/renesas,r9a09g057-wdt.yaml
index 975c5aa4d747..322b6921c147 100644
--- a/Documentation/devicetree/bindings/watchdog/renesas,r9a09g057-wdt.yaml
+++ b/Documentation/devicetree/bindings/watchdog/renesas,r9a09g057-wdt.yaml
@@ -48,6 +48,17 @@ properties:
resets:
maxItems: 1
+ renesas,sysc:
+ description:
+ System controller registers control the start/stop of the WDT, and halt debug.
+ $ref: /schemas/types.yaml#/definitions/phandle-array
+ items:
+ - items:
+ - description: phandle to system controller
+ - description: watchdog IP instance index
+ minimum: 0
+ maximum: 5
+
timeout-sec: true
required:
@@ -73,15 +84,29 @@ allOf:
minItems: 2
clock-names:
minItems: 2
+ renesas,sysc: false
else:
properties:
clocks:
maxItems: 1
clock-names:
maxItems: 1
- reg:
- minItems: 2
resets: false
+ allOf:
+ - if:
+ required:
+ - renesas,sysc
+ then:
+ properties:
+ reg:
+ maxItems: 1
+ else:
+ properties:
+ reg:
+ description: Deprecated. Use the renesas,sysc property along with
+ the watchdog IP instance index instead.
+ minItems: 2
+ deprecated: true
additionalProperties: false
--
2.43.0
^ permalink raw reply [flat|nested] 21+ messages in thread
* [PATCH v4 5/7] watchdog: rzv2h: Add syscon support for WDTDCR
2026-08-17 19:25 [PATCH v4 0/7] Add syscon support for Renesas RZ/T2H & RZ/N2H in CPG/MSSR driver Prabhakar
` (3 preceding siblings ...)
2026-08-17 19:25 ` [PATCH v4 4/7] dt-bindings: watchdog: renesas,r9a09g057-wdt: Add CPG/MSSR syscon support Prabhakar
@ 2026-08-17 19:25 ` Prabhakar
2026-08-25 12:34 ` Geert Uytterhoeven
2026-09-17 1:12 ` Guenter Roeck
2026-08-17 19:25 ` [PATCH v4 6/7] arm64: dts: renesas: r9a09g077: Use CPG/MSSR syscon for WDTDCR access Prabhakar
` (2 subsequent siblings)
7 siblings, 2 replies; 21+ messages in thread
From: Prabhakar @ 2026-08-17 19:25 UTC (permalink / raw)
To: Geert Uytterhoeven, Magnus Damm, Michael Turquette, Stephen Boyd,
Brian Masney, Guenter Roeck, Wim Van Sebroeck, Rob Herring,
Krzysztof Kozlowski, Conor Dooley
Cc: linux-watchdog, devicetree, linux-kernel, linux-renesas-soc,
linux-clk, Prabhakar, Biju Das, Fabrizio Castro, Lad Prabhakar
From: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
On RZ/T2H and RZ/N2H SoCs, the WDTDCR (WDT Debug Control Register) resides
in the second register region of the CPG/MSSR block. Since this
multi-function block is shared with other peripherals, it is exposed via a
syscon regmap interface.
Look up the SYSC regmap using the optional "renesas,sysc" property and
derive the WDTDCR offset from the watchdog instance index.
Retain the existing MMIO-based access method when the "renesas,sysc"
property is absent to preserve compatibility with existing DT's.
Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
---
v3->v4:
- No change
v2->v3:
- Made use of the new "renesas,sysc" phandle-array property to access the
WDTDCR register via the CPG/MSSR syscon node.
- Updated commit message
v1->v2:
- No change.
---
drivers/watchdog/Kconfig | 1 +
drivers/watchdog/rzv2h_wdt.c | 56 +++++++++++++++++++++++++++++-------
2 files changed, 46 insertions(+), 11 deletions(-)
diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
index f7d0a0c2c0ef..3c4fc9916d8c 100644
--- a/drivers/watchdog/Kconfig
+++ b/drivers/watchdog/Kconfig
@@ -1046,6 +1046,7 @@ config RENESAS_RZV2HWDT
depends on ARCH_RENESAS || COMPILE_TEST
depends on PM || COMPILE_TEST
select WATCHDOG_CORE
+ select MFD_SYSCON
help
This driver adds watchdog support for the integrated watchdogs in the
Renesas RZ/{G3E,V2H(P)} SoCs. These watchdogs can be used to reset a
diff --git a/drivers/watchdog/rzv2h_wdt.c b/drivers/watchdog/rzv2h_wdt.c
index 8af2f33b5680..04ea962da837 100644
--- a/drivers/watchdog/rzv2h_wdt.c
+++ b/drivers/watchdog/rzv2h_wdt.c
@@ -8,6 +8,7 @@
#include <linux/delay.h>
#include <linux/io.h>
#include <linux/kernel.h>
+#include <linux/mfd/syscon.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/platform_device.h>
@@ -44,6 +45,11 @@
#define WDT_DEFAULT_TIMEOUT 60U
+#define RZT2H_WDT_MAX_INSTANCES 6
+
+#define RZT2H_SYS_BLOCK1(n) (BIT(16) | (0x5100 + (n) * 4))
+#define RZT2H_WDTDCR_OFFSET(n) RZT2H_SYS_BLOCK1(n)
+
static bool nowayout = WATCHDOG_NOWAYOUT;
module_param(nowayout, bool, 0);
MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default="
@@ -64,14 +70,19 @@ struct rzv2h_of_data {
bool wdtdcr;
};
+struct rzv2h_sysc_wdtdcr {
+ struct regmap *regmap;
+ unsigned int offset;
+};
+
struct rzv2h_wdt_priv {
void __iomem *base;
- struct regmap *wdtdcr_regmap;
struct clk *pclk;
struct clk *oscclk;
struct reset_control *rstc;
struct watchdog_device wdev;
const struct rzv2h_of_data *of_data;
+ struct rzv2h_sysc_wdtdcr sysc;
};
static int rzv2h_wdt_ping(struct watchdog_device *wdev)
@@ -90,12 +101,16 @@ static int rzv2h_wdt_ping(struct watchdog_device *wdev)
static int rzt2h_wdt_wdtdcr_count_stop(struct rzv2h_wdt_priv *priv)
{
- return regmap_set_bits(priv->wdtdcr_regmap, WDTDCR, WDTDCR_WDTSTOPCTRL);
+ struct rzv2h_sysc_wdtdcr *sysc = &priv->sysc;
+
+ return regmap_set_bits(sysc->regmap, sysc->offset, WDTDCR_WDTSTOPCTRL);
}
static int rzt2h_wdt_wdtdcr_count_start(struct rzv2h_wdt_priv *priv)
{
- return regmap_clear_bits(priv->wdtdcr_regmap, WDTDCR, WDTDCR_WDTSTOPCTRL);
+ struct rzv2h_sysc_wdtdcr *sysc = &priv->sysc;
+
+ return regmap_clear_bits(sysc->regmap, sysc->offset, WDTDCR_WDTSTOPCTRL);
}
static void rzv2h_wdt_setup(struct watchdog_device *wdev, u16 wdtcr)
@@ -284,17 +299,36 @@ static const struct regmap_config rzv2h_wdtdcr_regmap_config = {
static int rzt2h_wdt_wdtdcr_init(struct platform_device *pdev,
struct rzv2h_wdt_priv *priv)
{
- void __iomem *wdtdcr;
+ struct device_node *np = pdev->dev.of_node;
+ bool syscon_present = of_property_present(np, "renesas,sysc");
+ struct rzv2h_sysc_wdtdcr *sysc = &priv->sysc;
int ret;
- wdtdcr = devm_platform_ioremap_resource(pdev, 1);
- if (IS_ERR(wdtdcr))
- return PTR_ERR(wdtdcr);
+ if (syscon_present) {
+ unsigned int wdt_index;
- priv->wdtdcr_regmap = devm_regmap_init_mmio(&pdev->dev, wdtdcr,
- &rzv2h_wdtdcr_regmap_config);
- if (IS_ERR(priv->wdtdcr_regmap))
- return PTR_ERR(priv->wdtdcr_regmap);
+ sysc->regmap = syscon_regmap_lookup_by_phandle_args(np, "renesas,sysc",
+ 1, &wdt_index);
+ if (IS_ERR(sysc->regmap))
+ return PTR_ERR(sysc->regmap);
+
+ if (wdt_index >= RZT2H_WDT_MAX_INSTANCES)
+ return -EINVAL;
+
+ sysc->offset = RZT2H_WDTDCR_OFFSET(wdt_index);
+ } else {
+ void __iomem *wdtdcr;
+
+ wdtdcr = devm_platform_ioremap_resource(pdev, 1);
+ if (IS_ERR(wdtdcr))
+ return PTR_ERR(wdtdcr);
+
+ sysc->regmap = devm_regmap_init_mmio(&pdev->dev, wdtdcr,
+ &rzv2h_wdtdcr_regmap_config);
+ if (IS_ERR(sysc->regmap))
+ return PTR_ERR(sysc->regmap);
+ sysc->offset = WDTDCR;
+ }
ret = pm_runtime_resume_and_get(&pdev->dev);
if (ret)
--
2.43.0
^ permalink raw reply [flat|nested] 21+ messages in thread
* [PATCH v4 6/7] arm64: dts: renesas: r9a09g077: Use CPG/MSSR syscon for WDTDCR access
2026-08-17 19:25 [PATCH v4 0/7] Add syscon support for Renesas RZ/T2H & RZ/N2H in CPG/MSSR driver Prabhakar
` (4 preceding siblings ...)
2026-08-17 19:25 ` [PATCH v4 5/7] watchdog: rzv2h: Add syscon support for WDTDCR Prabhakar
@ 2026-08-17 19:25 ` Prabhakar
2026-08-25 12:30 ` Geert Uytterhoeven
2026-08-17 19:25 ` [PATCH v4 7/7] arm64: dts: renesas: r9a09g087: " Prabhakar
2026-09-08 12:31 ` [PATCH v4 0/7] Add syscon support for Renesas RZ/T2H & RZ/N2H in CPG/MSSR driver Geert Uytterhoeven
7 siblings, 1 reply; 21+ messages in thread
From: Prabhakar @ 2026-08-17 19:25 UTC (permalink / raw)
To: Geert Uytterhoeven, Magnus Damm, Michael Turquette, Stephen Boyd,
Brian Masney, Guenter Roeck, Wim Van Sebroeck, Rob Herring,
Krzysztof Kozlowski, Conor Dooley
Cc: linux-watchdog, devicetree, linux-kernel, linux-renesas-soc,
linux-clk, Prabhakar, Biju Das, Fabrizio Castro, Lad Prabhakar
From: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
The WDTDCR registers for wdt0-wdt5 reside in the second register region of
the CPG/MSSR block. This multi-function block is now exposed via a unified
syscon regmap interface.
Replace the direct mapping of the individual WDTDCR registers with the
new "renesas,sysc" phandle property pointing to the CPG/MSSR block syscon
node.
Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
---
v3->v4:
- No change
v2->v3:
- Renamed the "renesas,sys" property to "renesas,sysc"
- Updated commit message
v1->v2:
- No change.
---
arch/arm64/boot/dts/renesas/r9a09g077.dtsi | 24 +++++++++++-----------
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/arch/arm64/boot/dts/renesas/r9a09g077.dtsi b/arch/arm64/boot/dts/renesas/r9a09g077.dtsi
index de20bed2797b..80910e0bd977 100644
--- a/arch/arm64/boot/dts/renesas/r9a09g077.dtsi
+++ b/arch/arm64/boot/dts/renesas/r9a09g077.dtsi
@@ -327,61 +327,61 @@ channel1 {
wdt0: watchdog@80082000 {
compatible = "renesas,r9a09g077-wdt";
- reg = <0 0x80082000 0 0x400>,
- <0 0x81295100 0 0x04>;
+ reg = <0 0x80082000 0 0x400>;
clocks = <&cpg CPG_CORE R9A09G077_CLK_PCLKL>;
clock-names = "pclk";
power-domains = <&cpg>;
+ renesas,sysc = <&cpg 0>;
status = "disabled";
};
wdt1: watchdog@80082400 {
compatible = "renesas,r9a09g077-wdt";
- reg = <0 0x80082400 0 0x400>,
- <0 0x81295104 0 0x04>;
+ reg = <0 0x80082400 0 0x400>;
clocks = <&cpg CPG_CORE R9A09G077_CLK_PCLKL>;
clock-names = "pclk";
power-domains = <&cpg>;
+ renesas,sysc = <&cpg 1>;
status = "disabled";
};
wdt2: watchdog@80082800 {
compatible = "renesas,r9a09g077-wdt";
- reg = <0 0x80082800 0 0x400>,
- <0 0x81295108 0 0x04>;
+ reg = <0 0x80082800 0 0x400>;
clocks = <&cpg CPG_CORE R9A09G077_CLK_PCLKL>;
clock-names = "pclk";
power-domains = <&cpg>;
+ renesas,sysc = <&cpg 2>;
status = "disabled";
};
wdt3: watchdog@80082c00 {
compatible = "renesas,r9a09g077-wdt";
- reg = <0 0x80082c00 0 0x400>,
- <0 0x8129510c 0 0x04>;
+ reg = <0 0x80082c00 0 0x400>;
clocks = <&cpg CPG_CORE R9A09G077_CLK_PCLKL>;
clock-names = "pclk";
power-domains = <&cpg>;
+ renesas,sysc = <&cpg 3>;
status = "disabled";
};
wdt4: watchdog@80083000 {
compatible = "renesas,r9a09g077-wdt";
- reg = <0 0x80083000 0 0x400>,
- <0 0x81295110 0 0x04>;
+ reg = <0 0x80083000 0 0x400>;
clocks = <&cpg CPG_CORE R9A09G077_CLK_PCLKL>;
clock-names = "pclk";
power-domains = <&cpg>;
+ renesas,sysc = <&cpg 4>;
status = "disabled";
};
wdt5: watchdog@80083400 {
compatible = "renesas,r9a09g077-wdt";
- reg = <0 0x80083400 0 0x400>,
- <0 0x81295114 0 0x04>;
+ reg = <0 0x80083400 0 0x400>;
clocks = <&cpg CPG_CORE R9A09G077_CLK_PCLKL>;
clock-names = "pclk";
power-domains = <&cpg>;
+ renesas,sysc = <&cpg 5>;
status = "disabled";
};
--
2.43.0
^ permalink raw reply [flat|nested] 21+ messages in thread
* [PATCH v4 7/7] arm64: dts: renesas: r9a09g087: Use CPG/MSSR syscon for WDTDCR access
2026-08-17 19:25 [PATCH v4 0/7] Add syscon support for Renesas RZ/T2H & RZ/N2H in CPG/MSSR driver Prabhakar
` (5 preceding siblings ...)
2026-08-17 19:25 ` [PATCH v4 6/7] arm64: dts: renesas: r9a09g077: Use CPG/MSSR syscon for WDTDCR access Prabhakar
@ 2026-08-17 19:25 ` Prabhakar
2026-08-25 12:30 ` Geert Uytterhoeven
2026-09-08 12:31 ` [PATCH v4 0/7] Add syscon support for Renesas RZ/T2H & RZ/N2H in CPG/MSSR driver Geert Uytterhoeven
7 siblings, 1 reply; 21+ messages in thread
From: Prabhakar @ 2026-08-17 19:25 UTC (permalink / raw)
To: Geert Uytterhoeven, Magnus Damm, Michael Turquette, Stephen Boyd,
Brian Masney, Guenter Roeck, Wim Van Sebroeck, Rob Herring,
Krzysztof Kozlowski, Conor Dooley
Cc: linux-watchdog, devicetree, linux-kernel, linux-renesas-soc,
linux-clk, Prabhakar, Biju Das, Fabrizio Castro, Lad Prabhakar
From: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
The WDTDCR registers for wdt0-wdt5 reside in the second register region of
the CPG/MSSR block. This multi-function block is now exposed via a unified
syscon regmap interface.
Replace the direct mapping of the individual WDTDCR registers with the
new "renesas,sysc" phandle property pointing to the CPG/MSSR block syscon
node.
Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
---
v3->v4:
- No change
v2->v3:
- Renamed the "renesas,sys" property to "renesas,sysc"
- Updated commit message
v1->v2:
- No change.
---
arch/arm64/boot/dts/renesas/r9a09g087.dtsi | 24 +++++++++++-----------
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/arch/arm64/boot/dts/renesas/r9a09g087.dtsi b/arch/arm64/boot/dts/renesas/r9a09g087.dtsi
index 813bb0cb021c..3ede2e89cf67 100644
--- a/arch/arm64/boot/dts/renesas/r9a09g087.dtsi
+++ b/arch/arm64/boot/dts/renesas/r9a09g087.dtsi
@@ -327,61 +327,61 @@ channel1 {
wdt0: watchdog@80082000 {
compatible = "renesas,r9a09g087-wdt", "renesas,r9a09g077-wdt";
- reg = <0 0x80082000 0 0x400>,
- <0 0x81295100 0 0x04>;
+ reg = <0 0x80082000 0 0x400>;
clocks = <&cpg CPG_CORE R9A09G087_CLK_PCLKL>;
clock-names = "pclk";
power-domains = <&cpg>;
+ renesas,sysc = <&cpg 0>;
status = "disabled";
};
wdt1: watchdog@80082400 {
compatible = "renesas,r9a09g087-wdt", "renesas,r9a09g077-wdt";
- reg = <0 0x80082400 0 0x400>,
- <0 0x81295104 0 0x04>;
+ reg = <0 0x80082400 0 0x400>;
clocks = <&cpg CPG_CORE R9A09G087_CLK_PCLKL>;
clock-names = "pclk";
power-domains = <&cpg>;
+ renesas,sysc = <&cpg 1>;
status = "disabled";
};
wdt2: watchdog@80082800 {
compatible = "renesas,r9a09g087-wdt", "renesas,r9a09g077-wdt";
- reg = <0 0x80082800 0 0x400>,
- <0 0x81295108 0 0x04>;
+ reg = <0 0x80082800 0 0x400>;
clocks = <&cpg CPG_CORE R9A09G087_CLK_PCLKL>;
clock-names = "pclk";
power-domains = <&cpg>;
+ renesas,sysc = <&cpg 2>;
status = "disabled";
};
wdt3: watchdog@80082c00 {
compatible = "renesas,r9a09g087-wdt", "renesas,r9a09g077-wdt";
- reg = <0 0x80082c00 0 0x400>,
- <0 0x8129510c 0 0x04>;
+ reg = <0 0x80082c00 0 0x400>;
clocks = <&cpg CPG_CORE R9A09G087_CLK_PCLKL>;
clock-names = "pclk";
power-domains = <&cpg>;
+ renesas,sysc = <&cpg 3>;
status = "disabled";
};
wdt4: watchdog@80083000 {
compatible = "renesas,r9a09g087-wdt", "renesas,r9a09g077-wdt";
- reg = <0 0x80083000 0 0x400>,
- <0 0x81295110 0 0x04>;
+ reg = <0 0x80083000 0 0x400>;
clocks = <&cpg CPG_CORE R9A09G087_CLK_PCLKL>;
clock-names = "pclk";
power-domains = <&cpg>;
+ renesas,sysc = <&cpg 4>;
status = "disabled";
};
wdt5: watchdog@80083400 {
compatible = "renesas,r9a09g087-wdt", "renesas,r9a09g077-wdt";
- reg = <0 0x80083400 0 0x400>,
- <0 0x81295114 0 0x04>;
+ reg = <0 0x80083400 0 0x400>;
clocks = <&cpg CPG_CORE R9A09G087_CLK_PCLKL>;
clock-names = "pclk";
power-domains = <&cpg>;
+ renesas,sysc = <&cpg 5>;
status = "disabled";
};
--
2.43.0
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH v4 1/7] clk: renesas: r9a09g077: Register SYSC regmap
2026-08-17 19:25 ` [PATCH v4 1/7] clk: renesas: r9a09g077: Register SYSC regmap Prabhakar
@ 2026-08-25 12:26 ` Geert Uytterhoeven
0 siblings, 0 replies; 21+ messages in thread
From: Geert Uytterhoeven @ 2026-08-25 12:26 UTC (permalink / raw)
To: Prabhakar
Cc: Magnus Damm, Michael Turquette, Stephen Boyd, Brian Masney,
Guenter Roeck, Wim Van Sebroeck, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, linux-watchdog, devicetree,
linux-kernel, linux-renesas-soc, linux-clk, Prabhakar, Biju Das,
Fabrizio Castro, Lad Prabhakar
On Mon, 17 Aug 2026 at 21:26, Prabhakar <prabhakar.csengg@gmail.com> wrote:
> From: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
>
> Register a syscon regmap for the System Controller (SYSC) integrated into
> the RZ/T2H and RZ/N2H CPG block.
>
> Unlike traditional Renesas CPG/MSSR implementations, the RZ/T2H and RZ/N2H
> CPG block also integrates the SYSC, which provides low-power management,
> clock monitoring, write protection and peripheral configuration registers
> shared by multiple drivers.
>
> Implement the RZ/T2H-specific .post_init() callback to create and register
> a syscon regmap covering the SYSC register space using the CPG device node.
> For backward compatibility, return without registering the regmap when the
> mapped resources correspond to older Device Trees that expose only the
> legacy 64 KiB CPG register window.
>
> Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
> ---
> v3->v4:
> - Dropped RZT2H_SYSC_BASE macro
> - Added array of base pointers to the r9a09g077_sysc_reg struct to
> support multiple SYSC regions
> - Merged r9a09g077_writeable_readable_sysc0 and
> r9a09g077_writeable_readable_sysc1 into a single function
> that checks the SYSC block and offset to determine if the register is
> readable/writable.
> - Added RZT2H_CPG_REG_SIZE macro
> - Updated r9a09g077_post_init() to call of_address_to_resource() to check
> the size of the mapped CPG register regions
> - Dropped changes from cpg_mssr_common_init
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH v4 2/7] arm64: dts: renesas: r9a09g077: Adjust CPG register region sizes
2026-08-17 19:25 ` [PATCH v4 2/7] arm64: dts: renesas: r9a09g077: Adjust CPG register region sizes Prabhakar
@ 2026-08-25 12:27 ` Geert Uytterhoeven
0 siblings, 0 replies; 21+ messages in thread
From: Geert Uytterhoeven @ 2026-08-25 12:27 UTC (permalink / raw)
To: Prabhakar
Cc: Magnus Damm, Michael Turquette, Stephen Boyd, Brian Masney,
Guenter Roeck, Wim Van Sebroeck, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, linux-watchdog, devicetree,
linux-kernel, linux-renesas-soc, linux-clk, Prabhakar, Biju Das,
Fabrizio Castro, Lad Prabhakar
On Mon, 17 Aug 2026 at 21:26, Prabhakar <prabhakar.csengg@gmail.com> wrote:
> From: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
>
> Increase the size of both CPG register regions from 64 KiB to 128 KiB.
>
> On the RZ/T2H SoC, the CPG/MSSR block is a multi-function block where,
> apart from clock and reset handling, it supports other features including
> clock monitoring, write protection, and peripheral configuration registers.
> Expand the mapped register regions to cover the entire register space of
> this block so these additional features can be utilized.
>
> Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH v4 3/7] arm64: dts: renesas: r9a09g087: Adjust CPG register region sizes
2026-08-17 19:25 ` [PATCH v4 3/7] arm64: dts: renesas: r9a09g087: " Prabhakar
@ 2026-08-25 12:27 ` Geert Uytterhoeven
0 siblings, 0 replies; 21+ messages in thread
From: Geert Uytterhoeven @ 2026-08-25 12:27 UTC (permalink / raw)
To: Prabhakar
Cc: Magnus Damm, Michael Turquette, Stephen Boyd, Brian Masney,
Guenter Roeck, Wim Van Sebroeck, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, linux-watchdog, devicetree,
linux-kernel, linux-renesas-soc, linux-clk, Prabhakar, Biju Das,
Fabrizio Castro, Lad Prabhakar
On Mon, 17 Aug 2026 at 21:26, Prabhakar <prabhakar.csengg@gmail.com> wrote:
> From: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
>
> Increase the size of both CPG register regions from 64 KiB to 128 KiB.
>
> On the RZ/N2H SoC, the CPG/MSSR block is a multi-function block where,
> apart from clock and reset handling, it supports other features including
> clock monitoring, write protection, and peripheral configuration registers.
> Expand the mapped register regions to cover the entire register space of
> this block so these additional features can be utilized.
>
> Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH v4 4/7] dt-bindings: watchdog: renesas,r9a09g057-wdt: Add CPG/MSSR syscon support
2026-08-17 19:25 ` [PATCH v4 4/7] dt-bindings: watchdog: renesas,r9a09g057-wdt: Add CPG/MSSR syscon support Prabhakar
@ 2026-08-25 12:28 ` Geert Uytterhoeven
2026-08-27 14:02 ` Guenter Roeck
1 sibling, 0 replies; 21+ messages in thread
From: Geert Uytterhoeven @ 2026-08-25 12:28 UTC (permalink / raw)
To: Prabhakar
Cc: Magnus Damm, Michael Turquette, Stephen Boyd, Brian Masney,
Guenter Roeck, Wim Van Sebroeck, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, linux-watchdog, devicetree,
linux-kernel, linux-renesas-soc, linux-clk, Prabhakar, Biju Das,
Fabrizio Castro, Lad Prabhakar
On Mon, 17 Aug 2026 at 21:26, Prabhakar <prabhakar.csengg@gmail.com> wrote:
> From: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
>
> On the Renesas RZ/T2H SoC, the Watchdog Timer Control Register (WDTDCR)
> resides within the CPG/MSSR block rather than the WDT address space
> itself.
>
> Previously, this was handled by including a second register range in the
> "reg" property. However, this is architecturally incorrect as the CPG/MSSR
> block consists of two distinct regions (0x80280000 and 0x81280000) that
> contain registers for multiple peripheral blocks.
>
> Since the CPG/MSSR block is a multi-function block, introduce the
> "renesas,sysc" phandle-array property to allow the WDT driver to access
> its control register via this shared regmap.
>
> Mark the use of a second "reg" entry as deprecated in favor of the
> new phandle-array approach for SoCs that require WDTDCR access.
>
> Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
> Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH v4 6/7] arm64: dts: renesas: r9a09g077: Use CPG/MSSR syscon for WDTDCR access
2026-08-17 19:25 ` [PATCH v4 6/7] arm64: dts: renesas: r9a09g077: Use CPG/MSSR syscon for WDTDCR access Prabhakar
@ 2026-08-25 12:30 ` Geert Uytterhoeven
0 siblings, 0 replies; 21+ messages in thread
From: Geert Uytterhoeven @ 2026-08-25 12:30 UTC (permalink / raw)
To: Prabhakar
Cc: Magnus Damm, Michael Turquette, Stephen Boyd, Brian Masney,
Guenter Roeck, Wim Van Sebroeck, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, linux-watchdog, devicetree,
linux-kernel, linux-renesas-soc, linux-clk, Prabhakar, Biju Das,
Fabrizio Castro, Lad Prabhakar
On Mon, 17 Aug 2026 at 21:26, Prabhakar <prabhakar.csengg@gmail.com> wrote:
> From: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
>
> The WDTDCR registers for wdt0-wdt5 reside in the second register region of
> the CPG/MSSR block. This multi-function block is now exposed via a unified
> syscon regmap interface.
>
> Replace the direct mapping of the individual WDTDCR registers with the
> new "renesas,sysc" phandle property pointing to the CPG/MSSR block syscon
> node.
>
> Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH v4 7/7] arm64: dts: renesas: r9a09g087: Use CPG/MSSR syscon for WDTDCR access
2026-08-17 19:25 ` [PATCH v4 7/7] arm64: dts: renesas: r9a09g087: " Prabhakar
@ 2026-08-25 12:30 ` Geert Uytterhoeven
0 siblings, 0 replies; 21+ messages in thread
From: Geert Uytterhoeven @ 2026-08-25 12:30 UTC (permalink / raw)
To: Prabhakar
Cc: Magnus Damm, Michael Turquette, Stephen Boyd, Brian Masney,
Guenter Roeck, Wim Van Sebroeck, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, linux-watchdog, devicetree,
linux-kernel, linux-renesas-soc, linux-clk, Prabhakar, Biju Das,
Fabrizio Castro, Lad Prabhakar
On Mon, 17 Aug 2026 at 21:26, Prabhakar <prabhakar.csengg@gmail.com> wrote:
> From: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
>
> The WDTDCR registers for wdt0-wdt5 reside in the second register region of
> the CPG/MSSR block. This multi-function block is now exposed via a unified
> syscon regmap interface.
>
> Replace the direct mapping of the individual WDTDCR registers with the
> new "renesas,sysc" phandle property pointing to the CPG/MSSR block syscon
> node.
>
> Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH v4 5/7] watchdog: rzv2h: Add syscon support for WDTDCR
2026-08-17 19:25 ` [PATCH v4 5/7] watchdog: rzv2h: Add syscon support for WDTDCR Prabhakar
@ 2026-08-25 12:34 ` Geert Uytterhoeven
2026-09-17 1:12 ` Guenter Roeck
1 sibling, 0 replies; 21+ messages in thread
From: Geert Uytterhoeven @ 2026-08-25 12:34 UTC (permalink / raw)
To: Prabhakar
Cc: Magnus Damm, Michael Turquette, Stephen Boyd, Brian Masney,
Guenter Roeck, Wim Van Sebroeck, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, linux-watchdog, devicetree,
linux-kernel, linux-renesas-soc, linux-clk, Prabhakar, Biju Das,
Fabrizio Castro, Lad Prabhakar
On Mon, 17 Aug 2026 at 21:26, Prabhakar <prabhakar.csengg@gmail.com> wrote:
> From: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
>
> On RZ/T2H and RZ/N2H SoCs, the WDTDCR (WDT Debug Control Register) resides
> in the second register region of the CPG/MSSR block. Since this
> multi-function block is shared with other peripherals, it is exposed via a
> syscon regmap interface.
>
> Look up the SYSC regmap using the optional "renesas,sysc" property and
> derive the WDTDCR offset from the watchdog instance index.
>
> Retain the existing MMIO-based access method when the "renesas,sysc"
> property is absent to preserve compatibility with existing DT's.
>
> Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH v4 4/7] dt-bindings: watchdog: renesas,r9a09g057-wdt: Add CPG/MSSR syscon support
2026-08-17 19:25 ` [PATCH v4 4/7] dt-bindings: watchdog: renesas,r9a09g057-wdt: Add CPG/MSSR syscon support Prabhakar
2026-08-25 12:28 ` Geert Uytterhoeven
@ 2026-08-27 14:02 ` Guenter Roeck
1 sibling, 0 replies; 21+ messages in thread
From: Guenter Roeck @ 2026-08-27 14:02 UTC (permalink / raw)
To: Prabhakar
Cc: Geert Uytterhoeven, Magnus Damm, Michael Turquette, Stephen Boyd,
Brian Masney, Wim Van Sebroeck, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, linux-watchdog, devicetree, linux-kernel,
linux-renesas-soc, linux-clk, Prabhakar, Biju Das,
Fabrizio Castro, Lad Prabhakar
On Mon, Aug 17, 2026 at 08:25:37PM +0100, Prabhakar wrote:
> From: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
>
> On the Renesas RZ/T2H SoC, the Watchdog Timer Control Register (WDTDCR)
> resides within the CPG/MSSR block rather than the WDT address space
> itself.
>
> Previously, this was handled by including a second register range in the
> "reg" property. However, this is architecturally incorrect as the CPG/MSSR
> block consists of two distinct regions (0x80280000 and 0x81280000) that
> contain registers for multiple peripheral blocks.
>
> Since the CPG/MSSR block is a multi-function block, introduce the
> "renesas,sysc" phandle-array property to allow the WDT driver to access
> its control register via this shared regmap.
>
> Mark the use of a second "reg" entry as deprecated in favor of the
> new phandle-array approach for SoCs that require WDTDCR access.
>
> Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
> Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Applied.
Thanks,
Guenter
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH v4 0/7] Add syscon support for Renesas RZ/T2H & RZ/N2H in CPG/MSSR driver
2026-08-17 19:25 [PATCH v4 0/7] Add syscon support for Renesas RZ/T2H & RZ/N2H in CPG/MSSR driver Prabhakar
` (6 preceding siblings ...)
2026-08-17 19:25 ` [PATCH v4 7/7] arm64: dts: renesas: r9a09g087: " Prabhakar
@ 2026-09-08 12:31 ` Geert Uytterhoeven
2026-09-08 16:22 ` Lad, Prabhakar
7 siblings, 1 reply; 21+ messages in thread
From: Geert Uytterhoeven @ 2026-09-08 12:31 UTC (permalink / raw)
To: Prabhakar
Cc: Magnus Damm, Michael Turquette, Stephen Boyd, Brian Masney,
Guenter Roeck, Wim Van Sebroeck, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, linux-watchdog, devicetree,
linux-kernel, linux-renesas-soc, linux-clk, Prabhakar, Biju Das,
Fabrizio Castro, Lad Prabhakar
Hi Prabhakar,
On Mon, 17 Aug 2026 at 21:25, Prabhakar <prabhakar.csengg@gmail.com> wrote:
> This series adds syscon support for the Renesas RZ/T2H and RZ/N2H SoCs
> in the CPG/MSSR driver. The CPG/MSSR block on these SoCs is a
> multi-function block that integrates several system-level features beyond
> clock and reset control, including clock monitoring, write protection,
> and peripheral configuration registers.
>
> For the other IP blocks to be configured a syscon support is provided in
> the CPG/MSSR driver. This allows other drivers to access the CPG/MSSR
> registers via a regmap interface.
> Lad Prabhakar (7):
> clk: renesas: r9a09g077: Register SYSC regmap
Thanks, will queue in renesas-clk for v7.4.
> arm64: dts: renesas: r9a09g077: Adjust CPG register region sizes
> arm64: dts: renesas: r9a09g087: Adjust CPG register region sizes
Thanks, will queue both in renesas-devel for v7.4.
> dt-bindings: watchdog: renesas,r9a09g057-wdt: Add CPG/MSSR syscon
> support
This is now in watchdog-next.
> watchdog: rzv2h: Add syscon support for WDTDCR
> arm64: dts: renesas: r9a09g077: Use CPG/MSSR syscon for WDTDCR access
> arm64: dts: renesas: r9a09g087: Use CPG/MSSR syscon for WDTDCR access
These two have a hard dependency on the first five patches, so they
are postponed.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH v4 0/7] Add syscon support for Renesas RZ/T2H & RZ/N2H in CPG/MSSR driver
2026-09-08 12:31 ` [PATCH v4 0/7] Add syscon support for Renesas RZ/T2H & RZ/N2H in CPG/MSSR driver Geert Uytterhoeven
@ 2026-09-08 16:22 ` Lad, Prabhakar
0 siblings, 0 replies; 21+ messages in thread
From: Lad, Prabhakar @ 2026-09-08 16:22 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: Magnus Damm, Michael Turquette, Stephen Boyd, Brian Masney,
Guenter Roeck, Wim Van Sebroeck, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, linux-watchdog, devicetree,
linux-kernel, linux-renesas-soc, linux-clk, Prabhakar, Biju Das,
Fabrizio Castro, Lad Prabhakar
Hi Geert,
On Tue, Sep 8, 2026 at 1:31 PM Geert Uytterhoeven <geert@linux-m68k.org> wrote:
>
> Hi Prabhakar,
>
> On Mon, 17 Aug 2026 at 21:25, Prabhakar <prabhakar.csengg@gmail.com> wrote:
> > This series adds syscon support for the Renesas RZ/T2H and RZ/N2H SoCs
> > in the CPG/MSSR driver. The CPG/MSSR block on these SoCs is a
> > multi-function block that integrates several system-level features beyond
> > clock and reset control, including clock monitoring, write protection,
> > and peripheral configuration registers.
> >
> > For the other IP blocks to be configured a syscon support is provided in
> > the CPG/MSSR driver. This allows other drivers to access the CPG/MSSR
> > registers via a regmap interface.
>
> > Lad Prabhakar (7):
> > clk: renesas: r9a09g077: Register SYSC regmap
>
> Thanks, will queue in renesas-clk for v7.4.
>
> > arm64: dts: renesas: r9a09g077: Adjust CPG register region sizes
> > arm64: dts: renesas: r9a09g087: Adjust CPG register region sizes
>
> Thanks, will queue both in renesas-devel for v7.4.
>
Thank you for picking it up.
> > dt-bindings: watchdog: renesas,r9a09g057-wdt: Add CPG/MSSR syscon
> > support
>
> This is now in watchdog-next.
>
> > watchdog: rzv2h: Add syscon support for WDTDCR
> > arm64: dts: renesas: r9a09g077: Use CPG/MSSR syscon for WDTDCR access
> > arm64: dts: renesas: r9a09g087: Use CPG/MSSR syscon for WDTDCR access
>
> These two have a hard dependency on the first five patches, so they
> are postponed.
>
Agreed, once I sort out the series [0] maybe we can take all the WDT
driver changes via renesas-soc due to its hard dependancy.
[0] https://lore.kernel.org/all/20260814191415.2110732-1-prabhakar.mahadev-lad.rj@bp.renesas.com/
Cheers,
Prabhakar
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH v4 5/7] watchdog: rzv2h: Add syscon support for WDTDCR
2026-08-17 19:25 ` [PATCH v4 5/7] watchdog: rzv2h: Add syscon support for WDTDCR Prabhakar
2026-08-25 12:34 ` Geert Uytterhoeven
@ 2026-09-17 1:12 ` Guenter Roeck
2026-09-18 15:18 ` Lad, Prabhakar
1 sibling, 1 reply; 21+ messages in thread
From: Guenter Roeck @ 2026-09-17 1:12 UTC (permalink / raw)
To: Prabhakar
Cc: Geert Uytterhoeven, Magnus Damm, Michael Turquette, Stephen Boyd,
Brian Masney, Wim Van Sebroeck, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, linux-watchdog, devicetree, linux-kernel,
linux-renesas-soc, linux-clk, Prabhakar, Biju Das,
Fabrizio Castro, Lad Prabhakar
Hi,
On Mon, Aug 17, 2026 at 08:25:38PM +0100, Prabhakar wrote:
> From: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
>
> On RZ/T2H and RZ/N2H SoCs, the WDTDCR (WDT Debug Control Register) resides
> in the second register region of the CPG/MSSR block. Since this
> multi-function block is shared with other peripherals, it is exposed via a
> syscon regmap interface.
>
> Look up the SYSC regmap using the optional "renesas,sysc" property and
> derive the WDTDCR offset from the watchdog instance index.
>
> Retain the existing MMIO-based access method when the "renesas,sysc"
> property is absent to preserve compatibility with existing DT's.
>
> Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Can I apply this patch without the other patches of the series ?
Thanks,
Guenter
> ---
> v3->v4:
> - No change
>
> v2->v3:
> - Made use of the new "renesas,sysc" phandle-array property to access the
> WDTDCR register via the CPG/MSSR syscon node.
> - Updated commit message
>
> v1->v2:
> - No change.
> ---
> drivers/watchdog/Kconfig | 1 +
> drivers/watchdog/rzv2h_wdt.c | 56 +++++++++++++++++++++++++++++-------
> 2 files changed, 46 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
> index f7d0a0c2c0ef..3c4fc9916d8c 100644
> --- a/drivers/watchdog/Kconfig
> +++ b/drivers/watchdog/Kconfig
> @@ -1046,6 +1046,7 @@ config RENESAS_RZV2HWDT
> depends on ARCH_RENESAS || COMPILE_TEST
> depends on PM || COMPILE_TEST
> select WATCHDOG_CORE
> + select MFD_SYSCON
> help
> This driver adds watchdog support for the integrated watchdogs in the
> Renesas RZ/{G3E,V2H(P)} SoCs. These watchdogs can be used to reset a
> diff --git a/drivers/watchdog/rzv2h_wdt.c b/drivers/watchdog/rzv2h_wdt.c
> index 8af2f33b5680..04ea962da837 100644
> --- a/drivers/watchdog/rzv2h_wdt.c
> +++ b/drivers/watchdog/rzv2h_wdt.c
> @@ -8,6 +8,7 @@
> #include <linux/delay.h>
> #include <linux/io.h>
> #include <linux/kernel.h>
> +#include <linux/mfd/syscon.h>
> #include <linux/module.h>
> #include <linux/of.h>
> #include <linux/platform_device.h>
> @@ -44,6 +45,11 @@
>
> #define WDT_DEFAULT_TIMEOUT 60U
>
> +#define RZT2H_WDT_MAX_INSTANCES 6
> +
> +#define RZT2H_SYS_BLOCK1(n) (BIT(16) | (0x5100 + (n) * 4))
> +#define RZT2H_WDTDCR_OFFSET(n) RZT2H_SYS_BLOCK1(n)
> +
> static bool nowayout = WATCHDOG_NOWAYOUT;
> module_param(nowayout, bool, 0);
> MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default="
> @@ -64,14 +70,19 @@ struct rzv2h_of_data {
> bool wdtdcr;
> };
>
> +struct rzv2h_sysc_wdtdcr {
> + struct regmap *regmap;
> + unsigned int offset;
> +};
> +
> struct rzv2h_wdt_priv {
> void __iomem *base;
> - struct regmap *wdtdcr_regmap;
> struct clk *pclk;
> struct clk *oscclk;
> struct reset_control *rstc;
> struct watchdog_device wdev;
> const struct rzv2h_of_data *of_data;
> + struct rzv2h_sysc_wdtdcr sysc;
> };
>
> static int rzv2h_wdt_ping(struct watchdog_device *wdev)
> @@ -90,12 +101,16 @@ static int rzv2h_wdt_ping(struct watchdog_device *wdev)
>
> static int rzt2h_wdt_wdtdcr_count_stop(struct rzv2h_wdt_priv *priv)
> {
> - return regmap_set_bits(priv->wdtdcr_regmap, WDTDCR, WDTDCR_WDTSTOPCTRL);
> + struct rzv2h_sysc_wdtdcr *sysc = &priv->sysc;
> +
> + return regmap_set_bits(sysc->regmap, sysc->offset, WDTDCR_WDTSTOPCTRL);
> }
>
> static int rzt2h_wdt_wdtdcr_count_start(struct rzv2h_wdt_priv *priv)
> {
> - return regmap_clear_bits(priv->wdtdcr_regmap, WDTDCR, WDTDCR_WDTSTOPCTRL);
> + struct rzv2h_sysc_wdtdcr *sysc = &priv->sysc;
> +
> + return regmap_clear_bits(sysc->regmap, sysc->offset, WDTDCR_WDTSTOPCTRL);
> }
>
> static void rzv2h_wdt_setup(struct watchdog_device *wdev, u16 wdtcr)
> @@ -284,17 +299,36 @@ static const struct regmap_config rzv2h_wdtdcr_regmap_config = {
> static int rzt2h_wdt_wdtdcr_init(struct platform_device *pdev,
> struct rzv2h_wdt_priv *priv)
> {
> - void __iomem *wdtdcr;
> + struct device_node *np = pdev->dev.of_node;
> + bool syscon_present = of_property_present(np, "renesas,sysc");
> + struct rzv2h_sysc_wdtdcr *sysc = &priv->sysc;
> int ret;
>
> - wdtdcr = devm_platform_ioremap_resource(pdev, 1);
> - if (IS_ERR(wdtdcr))
> - return PTR_ERR(wdtdcr);
> + if (syscon_present) {
> + unsigned int wdt_index;
>
> - priv->wdtdcr_regmap = devm_regmap_init_mmio(&pdev->dev, wdtdcr,
> - &rzv2h_wdtdcr_regmap_config);
> - if (IS_ERR(priv->wdtdcr_regmap))
> - return PTR_ERR(priv->wdtdcr_regmap);
> + sysc->regmap = syscon_regmap_lookup_by_phandle_args(np, "renesas,sysc",
> + 1, &wdt_index);
> + if (IS_ERR(sysc->regmap))
> + return PTR_ERR(sysc->regmap);
> +
> + if (wdt_index >= RZT2H_WDT_MAX_INSTANCES)
> + return -EINVAL;
> +
> + sysc->offset = RZT2H_WDTDCR_OFFSET(wdt_index);
> + } else {
> + void __iomem *wdtdcr;
> +
> + wdtdcr = devm_platform_ioremap_resource(pdev, 1);
> + if (IS_ERR(wdtdcr))
> + return PTR_ERR(wdtdcr);
> +
> + sysc->regmap = devm_regmap_init_mmio(&pdev->dev, wdtdcr,
> + &rzv2h_wdtdcr_regmap_config);
> + if (IS_ERR(sysc->regmap))
> + return PTR_ERR(sysc->regmap);
> + sysc->offset = WDTDCR;
> + }
>
> ret = pm_runtime_resume_and_get(&pdev->dev);
> if (ret)
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH v4 5/7] watchdog: rzv2h: Add syscon support for WDTDCR
2026-09-17 1:12 ` Guenter Roeck
@ 2026-09-18 15:18 ` Lad, Prabhakar
2026-09-18 17:39 ` Guenter Roeck
0 siblings, 1 reply; 21+ messages in thread
From: Lad, Prabhakar @ 2026-09-18 15:18 UTC (permalink / raw)
To: Guenter Roeck
Cc: Geert Uytterhoeven, Magnus Damm, Michael Turquette, Stephen Boyd,
Brian Masney, Wim Van Sebroeck, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, linux-watchdog, devicetree, linux-kernel,
linux-renesas-soc, linux-clk, Prabhakar, Biju Das,
Fabrizio Castro, Lad Prabhakar
Hi Guenter,
On Thu, Sep 17, 2026 at 2:12 AM Guenter Roeck <linux@roeck-us.net> wrote:
>
> Hi,
>
> On Mon, Aug 17, 2026 at 08:25:38PM +0100, Prabhakar wrote:
> > From: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
> >
> > On RZ/T2H and RZ/N2H SoCs, the WDTDCR (WDT Debug Control Register) resides
> > in the second register region of the CPG/MSSR block. Since this
> > multi-function block is shared with other peripherals, it is exposed via a
> > syscon regmap interface.
> >
> > Look up the SYSC regmap using the optional "renesas,sysc" property and
> > derive the WDTDCR offset from the watchdog instance index.
> >
> > Retain the existing MMIO-based access method when the "renesas,sysc"
> > property is absent to preserve compatibility with existing DT's.
> >
> > Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
> > Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
>
> Can I apply this patch without the other patches of the series ?
>
I posted the v5 series here addressing Sashiko's comments.
https://lore.kernel.org/all/20260911111731.3404308-1-prabhakar.mahadev-lad.rj@bp.renesas.com/
Cheers,
Prabhakar
> Thanks,
> Guenter
>
> > ---
> > v3->v4:
> > - No change
> >
> > v2->v3:
> > - Made use of the new "renesas,sysc" phandle-array property to access the
> > WDTDCR register via the CPG/MSSR syscon node.
> > - Updated commit message
> >
> > v1->v2:
> > - No change.
> > ---
> > drivers/watchdog/Kconfig | 1 +
> > drivers/watchdog/rzv2h_wdt.c | 56 +++++++++++++++++++++++++++++-------
> > 2 files changed, 46 insertions(+), 11 deletions(-)
> >
> > diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
> > index f7d0a0c2c0ef..3c4fc9916d8c 100644
> > --- a/drivers/watchdog/Kconfig
> > +++ b/drivers/watchdog/Kconfig
> > @@ -1046,6 +1046,7 @@ config RENESAS_RZV2HWDT
> > depends on ARCH_RENESAS || COMPILE_TEST
> > depends on PM || COMPILE_TEST
> > select WATCHDOG_CORE
> > + select MFD_SYSCON
> > help
> > This driver adds watchdog support for the integrated watchdogs in the
> > Renesas RZ/{G3E,V2H(P)} SoCs. These watchdogs can be used to reset a
> > diff --git a/drivers/watchdog/rzv2h_wdt.c b/drivers/watchdog/rzv2h_wdt.c
> > index 8af2f33b5680..04ea962da837 100644
> > --- a/drivers/watchdog/rzv2h_wdt.c
> > +++ b/drivers/watchdog/rzv2h_wdt.c
> > @@ -8,6 +8,7 @@
> > #include <linux/delay.h>
> > #include <linux/io.h>
> > #include <linux/kernel.h>
> > +#include <linux/mfd/syscon.h>
> > #include <linux/module.h>
> > #include <linux/of.h>
> > #include <linux/platform_device.h>
> > @@ -44,6 +45,11 @@
> >
> > #define WDT_DEFAULT_TIMEOUT 60U
> >
> > +#define RZT2H_WDT_MAX_INSTANCES 6
> > +
> > +#define RZT2H_SYS_BLOCK1(n) (BIT(16) | (0x5100 + (n) * 4))
> > +#define RZT2H_WDTDCR_OFFSET(n) RZT2H_SYS_BLOCK1(n)
> > +
> > static bool nowayout = WATCHDOG_NOWAYOUT;
> > module_param(nowayout, bool, 0);
> > MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default="
> > @@ -64,14 +70,19 @@ struct rzv2h_of_data {
> > bool wdtdcr;
> > };
> >
> > +struct rzv2h_sysc_wdtdcr {
> > + struct regmap *regmap;
> > + unsigned int offset;
> > +};
> > +
> > struct rzv2h_wdt_priv {
> > void __iomem *base;
> > - struct regmap *wdtdcr_regmap;
> > struct clk *pclk;
> > struct clk *oscclk;
> > struct reset_control *rstc;
> > struct watchdog_device wdev;
> > const struct rzv2h_of_data *of_data;
> > + struct rzv2h_sysc_wdtdcr sysc;
> > };
> >
> > static int rzv2h_wdt_ping(struct watchdog_device *wdev)
> > @@ -90,12 +101,16 @@ static int rzv2h_wdt_ping(struct watchdog_device *wdev)
> >
> > static int rzt2h_wdt_wdtdcr_count_stop(struct rzv2h_wdt_priv *priv)
> > {
> > - return regmap_set_bits(priv->wdtdcr_regmap, WDTDCR, WDTDCR_WDTSTOPCTRL);
> > + struct rzv2h_sysc_wdtdcr *sysc = &priv->sysc;
> > +
> > + return regmap_set_bits(sysc->regmap, sysc->offset, WDTDCR_WDTSTOPCTRL);
> > }
> >
> > static int rzt2h_wdt_wdtdcr_count_start(struct rzv2h_wdt_priv *priv)
> > {
> > - return regmap_clear_bits(priv->wdtdcr_regmap, WDTDCR, WDTDCR_WDTSTOPCTRL);
> > + struct rzv2h_sysc_wdtdcr *sysc = &priv->sysc;
> > +
> > + return regmap_clear_bits(sysc->regmap, sysc->offset, WDTDCR_WDTSTOPCTRL);
> > }
> >
> > static void rzv2h_wdt_setup(struct watchdog_device *wdev, u16 wdtcr)
> > @@ -284,17 +299,36 @@ static const struct regmap_config rzv2h_wdtdcr_regmap_config = {
> > static int rzt2h_wdt_wdtdcr_init(struct platform_device *pdev,
> > struct rzv2h_wdt_priv *priv)
> > {
> > - void __iomem *wdtdcr;
> > + struct device_node *np = pdev->dev.of_node;
> > + bool syscon_present = of_property_present(np, "renesas,sysc");
> > + struct rzv2h_sysc_wdtdcr *sysc = &priv->sysc;
> > int ret;
> >
> > - wdtdcr = devm_platform_ioremap_resource(pdev, 1);
> > - if (IS_ERR(wdtdcr))
> > - return PTR_ERR(wdtdcr);
> > + if (syscon_present) {
> > + unsigned int wdt_index;
> >
> > - priv->wdtdcr_regmap = devm_regmap_init_mmio(&pdev->dev, wdtdcr,
> > - &rzv2h_wdtdcr_regmap_config);
> > - if (IS_ERR(priv->wdtdcr_regmap))
> > - return PTR_ERR(priv->wdtdcr_regmap);
> > + sysc->regmap = syscon_regmap_lookup_by_phandle_args(np, "renesas,sysc",
> > + 1, &wdt_index);
> > + if (IS_ERR(sysc->regmap))
> > + return PTR_ERR(sysc->regmap);
> > +
> > + if (wdt_index >= RZT2H_WDT_MAX_INSTANCES)
> > + return -EINVAL;
> > +
> > + sysc->offset = RZT2H_WDTDCR_OFFSET(wdt_index);
> > + } else {
> > + void __iomem *wdtdcr;
> > +
> > + wdtdcr = devm_platform_ioremap_resource(pdev, 1);
> > + if (IS_ERR(wdtdcr))
> > + return PTR_ERR(wdtdcr);
> > +
> > + sysc->regmap = devm_regmap_init_mmio(&pdev->dev, wdtdcr,
> > + &rzv2h_wdtdcr_regmap_config);
> > + if (IS_ERR(sysc->regmap))
> > + return PTR_ERR(sysc->regmap);
> > + sysc->offset = WDTDCR;
> > + }
> >
> > ret = pm_runtime_resume_and_get(&pdev->dev);
> > if (ret)
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH v4 5/7] watchdog: rzv2h: Add syscon support for WDTDCR
2026-09-18 15:18 ` Lad, Prabhakar
@ 2026-09-18 17:39 ` Guenter Roeck
0 siblings, 0 replies; 21+ messages in thread
From: Guenter Roeck @ 2026-09-18 17:39 UTC (permalink / raw)
To: Lad, Prabhakar
Cc: Geert Uytterhoeven, Magnus Damm, Michael Turquette, Stephen Boyd,
Brian Masney, Wim Van Sebroeck, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, linux-watchdog, devicetree, linux-kernel,
linux-renesas-soc, linux-clk, Prabhakar, Biju Das,
Fabrizio Castro, Lad Prabhakar
Hi,
On 9/18/26 08:18, Lad, Prabhakar wrote:
> Hi Guenter,
>
> On Thu, Sep 17, 2026 at 2:12 AM Guenter Roeck <linux@roeck-us.net> wrote:
>>
>> Hi,
>>
>> On Mon, Aug 17, 2026 at 08:25:38PM +0100, Prabhakar wrote:
>>> From: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
>>>
>>> On RZ/T2H and RZ/N2H SoCs, the WDTDCR (WDT Debug Control Register) resides
>>> in the second register region of the CPG/MSSR block. Since this
>>> multi-function block is shared with other peripherals, it is exposed via a
>>> syscon regmap interface.
>>>
>>> Look up the SYSC regmap using the optional "renesas,sysc" property and
>>> derive the WDTDCR offset from the watchdog instance index.
>>>
>>> Retain the existing MMIO-based access method when the "renesas,sysc"
>>> property is absent to preserve compatibility with existing DT's.
>>>
>>> Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
>>> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
>>
>> Can I apply this patch without the other patches of the series ?
>>
> I posted the v5 series here addressing Sashiko's comments.
>
Sorry, I was getting confused. I somehow thought they are different series.
Do you plan to send v6 to address the issues reported in v5 ?
Note that Sashiko no longer reports pre-existing issues in public,
so those will be out of scope.
Thanks,
Guenter
^ permalink raw reply [flat|nested] 21+ messages in thread
end of thread, other threads:[~2026-09-18 17:39 UTC | newest]
Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-08-17 19:25 [PATCH v4 0/7] Add syscon support for Renesas RZ/T2H & RZ/N2H in CPG/MSSR driver Prabhakar
2026-08-17 19:25 ` [PATCH v4 1/7] clk: renesas: r9a09g077: Register SYSC regmap Prabhakar
2026-08-25 12:26 ` Geert Uytterhoeven
2026-08-17 19:25 ` [PATCH v4 2/7] arm64: dts: renesas: r9a09g077: Adjust CPG register region sizes Prabhakar
2026-08-25 12:27 ` Geert Uytterhoeven
2026-08-17 19:25 ` [PATCH v4 3/7] arm64: dts: renesas: r9a09g087: " Prabhakar
2026-08-25 12:27 ` Geert Uytterhoeven
2026-08-17 19:25 ` [PATCH v4 4/7] dt-bindings: watchdog: renesas,r9a09g057-wdt: Add CPG/MSSR syscon support Prabhakar
2026-08-25 12:28 ` Geert Uytterhoeven
2026-08-27 14:02 ` Guenter Roeck
2026-08-17 19:25 ` [PATCH v4 5/7] watchdog: rzv2h: Add syscon support for WDTDCR Prabhakar
2026-08-25 12:34 ` Geert Uytterhoeven
2026-09-17 1:12 ` Guenter Roeck
2026-09-18 15:18 ` Lad, Prabhakar
2026-09-18 17:39 ` Guenter Roeck
2026-08-17 19:25 ` [PATCH v4 6/7] arm64: dts: renesas: r9a09g077: Use CPG/MSSR syscon for WDTDCR access Prabhakar
2026-08-25 12:30 ` Geert Uytterhoeven
2026-08-17 19:25 ` [PATCH v4 7/7] arm64: dts: renesas: r9a09g087: " Prabhakar
2026-08-25 12:30 ` Geert Uytterhoeven
2026-09-08 12:31 ` [PATCH v4 0/7] Add syscon support for Renesas RZ/T2H & RZ/N2H in CPG/MSSR driver Geert Uytterhoeven
2026-09-08 16:22 ` Lad, Prabhakar
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®