* [PATCH v2 1/3] dt-bindings: clock: r9a06g032-sysctrl: Document reset cells
2026-11-20 21:16 [PATCH v2 0/3] clk: renesas: r9a06g032: Add reset controller to clear resets for mii converter Kyle Hendry via B4 Relay
@ 2026-11-20 21:16 ` Kyle Hendry via B4 Relay
2026-11-23 9:53 ` Wolfram Sang
2026-11-20 21:16 ` [PATCH v2 2/3] clk: renesas: r9a06g032: Add reset controller Kyle Hendry via B4 Relay
` (2 subsequent siblings)
3 siblings, 1 reply; 9+ messages in thread
From: Kyle Hendry via B4 Relay @ 2026-11-20 21:16 UTC (permalink / raw)
To: Geert Uytterhoeven, Stephen Boyd, Brian Masney, Jerome Brunet,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Magnus Damm,
Fabrizio Castro, Philipp Zabel
Cc: linux-renesas-soc, linux-clk, devicetree, linux-kernel,
Kyle Hendry
From: Kyle Hendry <khendry@reliablecontrols.com>
Update the rzn1 system controller to indicate it can be a reset controller
and add defines for miic resets
Signed-off-by: Kyle Hendry <khendry@reliablecontrols.com>
---
.../devicetree/bindings/clock/renesas,r9a06g032-sysctrl.yaml | 5 +++++
include/dt-bindings/clock/r9a06g032-sysctrl.h | 3 +++
2 files changed, 8 insertions(+)
diff --git a/Documentation/devicetree/bindings/clock/renesas,r9a06g032-sysctrl.yaml b/Documentation/devicetree/bindings/clock/renesas,r9a06g032-sysctrl.yaml
index 26d94cedc871..70ccc315a10c 100644
--- a/Documentation/devicetree/bindings/clock/renesas,r9a06g032-sysctrl.yaml
+++ b/Documentation/devicetree/bindings/clock/renesas,r9a06g032-sysctrl.yaml
@@ -36,6 +36,9 @@ properties:
'#clock-cells':
const: 1
+ '#reset-cells':
+ const: 1
+
'#power-domain-cells':
const: 0
@@ -56,6 +59,7 @@ required:
- clocks
- clock-names
- '#clock-cells'
+ - '#reset-cells'
- '#power-domain-cells'
additionalProperties: false
@@ -69,5 +73,6 @@ examples:
<&ext_rgmii_ref>;
clock-names = "mclk", "rtc", "jtag", "rgmii_ref_ext";
#clock-cells = <1>;
+ #reset-cells = <1>;
#power-domain-cells = <0>;
};
diff --git a/include/dt-bindings/clock/r9a06g032-sysctrl.h b/include/dt-bindings/clock/r9a06g032-sysctrl.h
index d9d7b8b4f426..e3059c50f7c3 100644
--- a/include/dt-bindings/clock/r9a06g032-sysctrl.h
+++ b/include/dt-bindings/clock/r9a06g032-sysctrl.h
@@ -146,4 +146,7 @@
#define R9A06G032_CLK_UART6 152
#define R9A06G032_CLK_UART7 153
+#define R9A06G032_RST_TS 1
+#define R9A06G032_RST_MIIC 2
+
#endif /* __DT_BINDINGS_R9A06G032_SYSCTRL_H__ */
--
2.53.0
^ permalink raw reply related [flat|nested] 9+ messages in thread* Re: [PATCH v2 1/3] dt-bindings: clock: r9a06g032-sysctrl: Document reset cells
2026-11-20 21:16 ` [PATCH v2 1/3] dt-bindings: clock: r9a06g032-sysctrl: Document reset cells Kyle Hendry via B4 Relay
@ 2026-11-23 9:53 ` Wolfram Sang
0 siblings, 0 replies; 9+ messages in thread
From: Wolfram Sang @ 2026-11-23 9:53 UTC (permalink / raw)
To: khendry
Cc: Geert Uytterhoeven, Stephen Boyd, Brian Masney, Jerome Brunet,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Magnus Damm,
Fabrizio Castro, Philipp Zabel, linux-renesas-soc, linux-clk,
devicetree, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 196 bytes --]
> +#define R9A06G032_RST_TS 1
> +#define R9A06G032_RST_MIIC 2
Given the Sashiko-review for patch 2, it might be easier to start from 0
after all.
Other than that, the rest looks good to me.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH v2 2/3] clk: renesas: r9a06g032: Add reset controller
2026-11-20 21:16 [PATCH v2 0/3] clk: renesas: r9a06g032: Add reset controller to clear resets for mii converter Kyle Hendry via B4 Relay
2026-11-20 21:16 ` [PATCH v2 1/3] dt-bindings: clock: r9a06g032-sysctrl: Document reset cells Kyle Hendry via B4 Relay
@ 2026-11-20 21:16 ` Kyle Hendry via B4 Relay
2026-11-20 21:32 ` sashiko-bot
` (2 more replies)
2026-11-20 21:16 ` [PATCH v2 3/3] ARM: dts: renesas: r9a06g032: Add #reset-cells to system controller node Kyle Hendry via B4 Relay
2026-11-23 10:11 ` [PATCH v2 0/3] clk: renesas: r9a06g032: Add reset controller to clear resets for mii converter Wolfram Sang
3 siblings, 3 replies; 9+ messages in thread
From: Kyle Hendry via B4 Relay @ 2026-11-20 21:16 UTC (permalink / raw)
To: Geert Uytterhoeven, Stephen Boyd, Brian Masney, Jerome Brunet,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Magnus Damm,
Fabrizio Castro, Philipp Zabel
Cc: linux-renesas-soc, linux-clk, devicetree, linux-kernel,
Kyle Hendry
From: Kyle Hendry <khendry@reliablecontrols.com>
The rzn1 system controller has two resets that need to be cleared for the
mii converter to work. They are not directly associated with any clocks
so they need a reset controller to set them.
They are documented in the PWRCTRL_SWITCHCTRL (0x4000C188) register as:
Bit 3: RSTN_CLK25 - Active low Reset for Timestamp signal selection logic
Bit 4: RSTN_ETH - Active low Reset for RGMII/RMII Converter (50 MHz).
Add a reset controller and add resets for those bits.
Signed-off-by: Kyle Hendry <khendry@reliablecontrols.com>
---
drivers/clk/renesas/r9a06g032-clocks.c | 59 ++++++++++++++++++++++++++++++++++
1 file changed, 59 insertions(+)
diff --git a/drivers/clk/renesas/r9a06g032-clocks.c b/drivers/clk/renesas/r9a06g032-clocks.c
index 3df3f2b2c6de..a474302987aa 100644
--- a/drivers/clk/renesas/r9a06g032-clocks.c
+++ b/drivers/clk/renesas/r9a06g032-clocks.c
@@ -21,6 +21,7 @@
#include <linux/pm_clock.h>
#include <linux/pm_domain.h>
#include <linux/reboot.h>
+#include <linux/reset-controller.h>
#include <linux/slab.h>
#include <linux/soc/renesas/r9a06g032-sysctrl.h>
#include <linux/spinlock.h>
@@ -675,7 +676,13 @@ static const struct r9a06g032_clkdesc r9a06g032_clocks[] = {
RB(0xec, 16), RB(0xec, 17), RB(0xec, 18), RB(0xec, 19)),
};
+static const struct regbit r9a06g032_resets[] = {
+ [R9A06G032_RST_TS] = RB(0x188, 3),
+ [R9A06G032_RST_MIIC] = RB(0x188, 4),
+};
+
struct r9a06g032_priv {
+ struct reset_controller_dev rcdev;
struct clk_onecell_data data;
spinlock_t lock; /* protects concurrent access to gates */
void __iomem *reg;
@@ -1307,6 +1314,51 @@ static void __init r9a06g032_init_h2mode(struct r9a06g032_priv *clocks)
writel(usb, clocks->reg + R9A06G032_SYSCTRL_USB);
}
+static inline
+struct r9a06g032_priv *priv_from_rcdev(struct reset_controller_dev *resetdev)
+{
+ return container_of(resetdev, struct r9a06g032_priv, rcdev);
+}
+
+static int r9a06g032_reset_set(struct reset_controller_dev *rcdev,
+ bool set, unsigned long id)
+{
+ struct r9a06g032_priv *priv = priv_from_rcdev(rcdev);
+ unsigned long flags;
+
+ spin_lock_irqsave(&priv->lock, flags);
+ clk_rdesc_set(priv, r9a06g032_resets[id], set);
+ spin_unlock_irqrestore(&priv->lock, flags);
+
+ return 0;
+}
+
+static int r9a06g032_reset_assert(struct reset_controller_dev *rcdev,
+ unsigned long id)
+{
+ return r9a06g032_reset_set(rcdev, false, id);
+}
+
+static int r9a06g032_reset_deassert(struct reset_controller_dev *rcdev,
+ unsigned long id)
+{
+ return r9a06g032_reset_set(rcdev, true, id);
+}
+
+static int r9a06g032_reset_status(struct reset_controller_dev *rcdev,
+ unsigned long id)
+{
+ struct r9a06g032_priv *priv = priv_from_rcdev(rcdev);
+
+ return !clk_rdesc_get(priv, r9a06g032_resets[id]);
+}
+
+static const struct reset_control_ops r9a06g032_reset_ops = {
+ .assert = r9a06g032_reset_assert,
+ .deassert = r9a06g032_reset_deassert,
+ .status = r9a06g032_reset_status,
+};
+
static int __init r9a06g032_clocks_probe(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
@@ -1394,6 +1446,13 @@ static int __init r9a06g032_clocks_probe(struct platform_device *pdev)
if (error)
return error;
+ clocks->rcdev.ops = &r9a06g032_reset_ops;
+ clocks->rcdev.of_node = np;
+ clocks->rcdev.nr_resets = ARRAY_SIZE(r9a06g032_resets);
+ error = devm_reset_controller_register(dev, &clocks->rcdev);
+ if (error)
+ return error;
+
error = r9a06g032_add_clk_domain(dev);
if (error)
return error;
--
2.53.0
^ permalink raw reply related [flat|nested] 9+ messages in thread* Re: [PATCH v2 2/3] clk: renesas: r9a06g032: Add reset controller
2026-11-20 21:16 ` [PATCH v2 2/3] clk: renesas: r9a06g032: Add reset controller Kyle Hendry via B4 Relay
@ 2026-11-20 21:32 ` sashiko-bot
2026-11-20 22:17 ` Wolfram Sang
2026-11-20 22:24 ` Wolfram Sang
2 siblings, 0 replies; 9+ messages in thread
From: sashiko-bot @ 2026-11-20 21:32 UTC (permalink / raw)
To: Kyle Hendry; +Cc: linux-clk, devicetree, robh, conor+dt, wsa+renesas
Thank you for your contribution! Sashiko AI review found 2 potential
issues to consider:
- [Medium] clk: renesas: r9a06g032: unpopulated index 0 in
r9a06g032_resets
- [Medium] clk: renesas: r9a06g032: missing RESET_CONTROLLER Kconfig
selection
--
commit 2cc290ce9843c419fbe880756a7ccf01089df58d
Author: Kyle Hendry <khendry@reliablecontrols.com>
clk: renesas: r9a06g032: Add reset controller
This commit registers a reset controller in the R9A06G032 clock driver to
expose the timestamp and RGMII/RMII converter reset bits in the
PWRCTRL_SWITCHCTRL register.
> diff --git a/drivers/clk/renesas/r9a06g032-clocks.c b/drivers/clk/renesas/r9a06g032-clocks.c
> index 3df3f2b2c6de7..a474302987aa6 100644
> --- a/drivers/clk/renesas/r9a06g032-clocks.c
> +++ b/drivers/clk/renesas/r9a06g032-clocks.c
[ ... ]
> @@ -675,7 +676,13 @@ static const struct r9a06g032_clkdesc r9a06g032_clocks[] = {
> RB(0xec, 16), RB(0xec, 17), RB(0xec, 18), RB(0xec, 19)),
> };
>
> +static const struct regbit r9a06g032_resets[] = {
> + [R9A06G032_RST_TS] = RB(0x188, 3),
> + [R9A06G032_RST_MIIC] = RB(0x188, 4),
> +};
[Severity: Medium]
Since R9A06G032_RST_TS is 1 and R9A06G032_RST_MIIC is 2, can reset ID 0 be
requested and accepted even though r9a06g032_resets[0] is unpopulated?
ARRAY_SIZE(r9a06g032_resets) is 3, and without a custom xlate callback,
fwnode_reset_simple_xlate() allows index 0. If a consumer requests reset
0, assert and deassert silently become no-ops in clk_rdesc_set(), while
r9a06g032_reset_status() calls clk_rdesc_get() with { .bit = 0, .reg = 0 }
and reads bit 0 of offset 0x00 (R9A06G032_SYSCTRL_USB).
Either the reset IDs should be 0-based, or the driver should provide an
xlate callback that rejects unpopulated entries where !reg && !bit.
[ ... ]
> @@ -1394,6 +1446,13 @@ static int __init r9a06g032_clocks_probe(struct platform_device *pdev)
> if (error)
> return error;
>
> + clocks->rcdev.ops = &r9a06g032_reset_ops;
> + clocks->rcdev.of_node = np;
> + clocks->rcdev.nr_resets = ARRAY_SIZE(r9a06g032_resets);
> + error = devm_reset_controller_register(dev, &clocks->rcdev);
> + if (error)
> + return error;
[Severity: Medium]
Should CLK_R9A06G032 select RESET_CONTROLLER in
drivers/clk/renesas/Kconfig?
When CONFIG_RESET_CONTROLLER is disabled, devm_reset_controller_register()
compiles to a no-op stub returning 0, so the reset controller is never
registered and consumers such as pcs-rzn1-miic fail probe with
-EOPNOTSUPP.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261120-rzn1-miic-resets-v2-0-f1cfa678615b@reliablecontrols.com?part=2
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: [PATCH v2 2/3] clk: renesas: r9a06g032: Add reset controller
2026-11-20 21:16 ` [PATCH v2 2/3] clk: renesas: r9a06g032: Add reset controller Kyle Hendry via B4 Relay
2026-11-20 21:32 ` sashiko-bot
@ 2026-11-20 22:17 ` Wolfram Sang
2026-11-20 22:24 ` Wolfram Sang
2 siblings, 0 replies; 9+ messages in thread
From: Wolfram Sang @ 2026-11-20 22:17 UTC (permalink / raw)
To: khendry
Cc: Geert Uytterhoeven, Stephen Boyd, Brian Masney, Jerome Brunet,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Magnus Damm,
Fabrizio Castro, Philipp Zabel, linux-renesas-soc, linux-clk,
devicetree, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 1283 bytes --]
> > +static const struct regbit r9a06g032_resets[] = {
> > + [R9A06G032_RST_TS] = RB(0x188, 3),
> > + [R9A06G032_RST_MIIC] = RB(0x188, 4),
> > +};
>
> [Severity: Medium]
> Since R9A06G032_RST_TS is 1 and R9A06G032_RST_MIIC is 2, can reset ID 0 be
> requested and accepted even though r9a06g032_resets[0] is unpopulated?
>
> ARRAY_SIZE(r9a06g032_resets) is 3, and without a custom xlate callback,
> fwnode_reset_simple_xlate() allows index 0. If a consumer requests reset
> 0, assert and deassert silently become no-ops in clk_rdesc_set(), while
> r9a06g032_reset_status() calls clk_rdesc_get() with { .bit = 0, .reg = 0 }
> and reads bit 0 of offset 0x00 (R9A06G032_SYSCTRL_USB).
>
> Either the reset IDs should be 0-based, or the driver should provide an
> xlate callback that rejects unpopulated entries where !reg && !bit.
Seems like starting from 0 is the better (and easier) option after all.
> [Severity: Medium]
> Should CLK_R9A06G032 select RESET_CONTROLLER in
> drivers/clk/renesas/Kconfig?
>
> When CONFIG_RESET_CONTROLLER is disabled, devm_reset_controller_register()
> compiles to a no-op stub returning 0, so the reset controller is never
> registered and consumers such as pcs-rzn1-miic fail probe with
> -EOPNOTSUPP.
I agree.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: [PATCH v2 2/3] clk: renesas: r9a06g032: Add reset controller
2026-11-20 21:16 ` [PATCH v2 2/3] clk: renesas: r9a06g032: Add reset controller Kyle Hendry via B4 Relay
2026-11-20 21:32 ` sashiko-bot
2026-11-20 22:17 ` Wolfram Sang
@ 2026-11-20 22:24 ` Wolfram Sang
2 siblings, 0 replies; 9+ messages in thread
From: Wolfram Sang @ 2026-11-20 22:24 UTC (permalink / raw)
To: khendry
Cc: Geert Uytterhoeven, Stephen Boyd, Brian Masney, Jerome Brunet,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Magnus Damm,
Fabrizio Castro, Philipp Zabel, linux-renesas-soc, linux-clk,
devicetree, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 528 bytes --]
> struct r9a06g032_priv {
> + struct reset_controller_dev rcdev;
Minor: I would put it last. Wrt cache lines, this member is not so
important.
> struct clk_onecell_data data;
> spinlock_t lock; /* protects concurrent access to gates */
> void __iomem *reg;
> +static const struct reset_control_ops r9a06g032_reset_ops = {
> + .assert = r9a06g032_reset_assert,
> + .deassert = r9a06g032_reset_deassert,
> + .status = r9a06g032_reset_status,
> +};
How do we ensure now the 5us recommended delay for reset propagation?
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH v2 3/3] ARM: dts: renesas: r9a06g032: Add #reset-cells to system controller node
2026-11-20 21:16 [PATCH v2 0/3] clk: renesas: r9a06g032: Add reset controller to clear resets for mii converter Kyle Hendry via B4 Relay
2026-11-20 21:16 ` [PATCH v2 1/3] dt-bindings: clock: r9a06g032-sysctrl: Document reset cells Kyle Hendry via B4 Relay
2026-11-20 21:16 ` [PATCH v2 2/3] clk: renesas: r9a06g032: Add reset controller Kyle Hendry via B4 Relay
@ 2026-11-20 21:16 ` Kyle Hendry via B4 Relay
2026-11-23 10:11 ` [PATCH v2 0/3] clk: renesas: r9a06g032: Add reset controller to clear resets for mii converter Wolfram Sang
3 siblings, 0 replies; 9+ messages in thread
From: Kyle Hendry via B4 Relay @ 2026-11-20 21:16 UTC (permalink / raw)
To: Geert Uytterhoeven, Stephen Boyd, Brian Masney, Jerome Brunet,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Magnus Damm,
Fabrizio Castro, Philipp Zabel
Cc: linux-renesas-soc, linux-clk, devicetree, linux-kernel,
Wolfram Sang, Kyle Hendry
From: Kyle Hendry <khendry@reliablecontrols.com>
Update the rzn1 system controller node with cells for the reset controller
Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Kyle Hendry <khendry@reliablecontrols.com>
---
arch/arm/boot/dts/renesas/r9a06g032.dtsi | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/arm/boot/dts/renesas/r9a06g032.dtsi b/arch/arm/boot/dts/renesas/r9a06g032.dtsi
index 5455dccfbdd0..f2bf087f7ad2 100644
--- a/arch/arm/boot/dts/renesas/r9a06g032.dtsi
+++ b/arch/arm/boot/dts/renesas/r9a06g032.dtsi
@@ -146,6 +146,7 @@ sysctrl: system-controller@4000c000 {
compatible = "renesas,r9a06g032-sysctrl";
reg = <0x4000c000 0x1000>;
#clock-cells = <1>;
+ #reset-cells = <1>;
#power-domain-cells = <0>;
clocks = <&ext_mclk>, <&ext_rtc_clk>,
--
2.53.0
^ permalink raw reply related [flat|nested] 9+ messages in thread* Re: [PATCH v2 0/3] clk: renesas: r9a06g032: Add reset controller to clear resets for mii converter
2026-11-20 21:16 [PATCH v2 0/3] clk: renesas: r9a06g032: Add reset controller to clear resets for mii converter Kyle Hendry via B4 Relay
` (2 preceding siblings ...)
2026-11-20 21:16 ` [PATCH v2 3/3] ARM: dts: renesas: r9a06g032: Add #reset-cells to system controller node Kyle Hendry via B4 Relay
@ 2026-11-23 10:11 ` Wolfram Sang
3 siblings, 0 replies; 9+ messages in thread
From: Wolfram Sang @ 2026-11-23 10:11 UTC (permalink / raw)
To: khendry
Cc: Geert Uytterhoeven, Stephen Boyd, Brian Masney, Jerome Brunet,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Magnus Damm,
Fabrizio Castro, Philipp Zabel, linux-renesas-soc, linux-clk,
devicetree, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 562 bytes --]
On Fri, Nov 20, 2026 at 01:16:51PM -0800, Kyle Hendry via B4 Relay wrote:
> On the rzn1, there are two resets for the mii converter in the system
> controller. If they are not cleared by the bootloader then the kernel needs
> to do it.
>
> To handle this, I've added a reset controller interface to the clock
> driver so the miic driver can deassert them.
I took patches 4-6 from v1 to actually test this series. Worked fine and
the resets were deasserted (I added some debug prints):
Tested-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread