* [PATCH 0/6] clk: renesas: r9a06g032: Add reset controller to clear resets for mii converter
@ 2026-11-19 17:57 ` Kyle Hendry via B4 Relay
0 siblings, 0 replies; 27+ messages in thread
From: Kyle Hendry @ 2026-11-19 17:57 UTC (permalink / raw)
To: Geert Uytterhoeven, Stephen Boyd, Brian Masney, Jerome Brunet,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Magnus Damm,
Fabrizio Castro, Philipp Zabel, Clément Léger,
Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Lad Prabhakar, Andrew Lunn, Heiner Kallweit,
Russell King
Cc: linux-renesas-soc, linux-clk, devicetree, linux-kernel, netdev,
Kyle Hendry
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.
Signed-off-by: Kyle Hendry <khendry@reliablecontrols.com>
---
Kyle Hendry (6):
dt-bindings: clock: r9a06g032-sysctrl: Document reset cells
clk: renesas: r9a06g032: Add reset controller
ARM: dts: renesas: r9a06g032: Add #reset-cells to system controller node
dt-bindings: net: pcs: renesas,rzn1-miic: Document rzn1 resets
net: pcs: rzn1-miic: Add resets to rzn1 info structure
ARM: dts: renesas: r9a06g032: Add resets to mii converter
.../bindings/clock/renesas,r9a06g032-sysctrl.yaml | 3 +
.../bindings/net/pcs/renesas,rzn1-miic.yaml | 36 ++++++++----
arch/arm/boot/dts/renesas/r9a06g032.dtsi | 4 ++
drivers/clk/renesas/r9a06g032-clocks.c | 64 ++++++++++++++++++++++
drivers/net/pcs/pcs-rzn1-miic.c | 7 +++
include/dt-bindings/clock/r9a06g032-sysctrl.h | 3 +
6 files changed, 106 insertions(+), 11 deletions(-)
---
base-commit: 662377fd1bb1d7cf4e97d312255fed868f56342d
change-id: 20261027-rzn1-miic-resets-8308515aa2c0
Best regards,
--
Kyle Hendry <khendry@reliablecontrols.com>
^ permalink raw reply [flat|nested] 27+ messages in thread
* [PATCH 0/6] clk: renesas: r9a06g032: Add reset controller to clear resets for mii converter
@ 2026-11-19 17:57 ` Kyle Hendry via B4 Relay
0 siblings, 0 replies; 27+ messages in thread
From: Kyle Hendry via B4 Relay @ 2026-11-19 17:57 UTC (permalink / raw)
To: Geert Uytterhoeven, Stephen Boyd, Brian Masney, Jerome Brunet,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Magnus Damm,
Fabrizio Castro, Philipp Zabel, Clément Léger,
Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Lad Prabhakar, Andrew Lunn, Heiner Kallweit,
Russell King
Cc: linux-renesas-soc, linux-clk, devicetree, linux-kernel, netdev,
Kyle Hendry
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.
Signed-off-by: Kyle Hendry <khendry@reliablecontrols.com>
---
Kyle Hendry (6):
dt-bindings: clock: r9a06g032-sysctrl: Document reset cells
clk: renesas: r9a06g032: Add reset controller
ARM: dts: renesas: r9a06g032: Add #reset-cells to system controller node
dt-bindings: net: pcs: renesas,rzn1-miic: Document rzn1 resets
net: pcs: rzn1-miic: Add resets to rzn1 info structure
ARM: dts: renesas: r9a06g032: Add resets to mii converter
.../bindings/clock/renesas,r9a06g032-sysctrl.yaml | 3 +
.../bindings/net/pcs/renesas,rzn1-miic.yaml | 36 ++++++++----
arch/arm/boot/dts/renesas/r9a06g032.dtsi | 4 ++
drivers/clk/renesas/r9a06g032-clocks.c | 64 ++++++++++++++++++++++
drivers/net/pcs/pcs-rzn1-miic.c | 7 +++
include/dt-bindings/clock/r9a06g032-sysctrl.h | 3 +
6 files changed, 106 insertions(+), 11 deletions(-)
---
base-commit: 662377fd1bb1d7cf4e97d312255fed868f56342d
change-id: 20261027-rzn1-miic-resets-8308515aa2c0
Best regards,
--
Kyle Hendry <khendry@reliablecontrols.com>
^ permalink raw reply [flat|nested] 27+ messages in thread
* [PATCH 1/6] dt-bindings: clock: r9a06g032-sysctrl: Document reset cells
2026-11-19 17:57 ` Kyle Hendry via B4 Relay
@ 2026-11-19 17:57 ` Kyle Hendry via B4 Relay
-1 siblings, 0 replies; 27+ messages in thread
From: Kyle Hendry @ 2026-11-19 17:57 UTC (permalink / raw)
To: Geert Uytterhoeven, Stephen Boyd, Brian Masney, Jerome Brunet,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Magnus Damm,
Fabrizio Castro, Philipp Zabel, Clément Léger,
Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Lad Prabhakar, Andrew Lunn, Heiner Kallweit,
Russell King
Cc: linux-renesas-soc, linux-clk, devicetree, linux-kernel, netdev,
Kyle Hendry
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>
---
Documentation/devicetree/bindings/clock/renesas,r9a06g032-sysctrl.yaml | 3 +++
include/dt-bindings/clock/r9a06g032-sysctrl.h | 3 +++
2 files changed, 6 insertions(+)
diff --git a/Documentation/devicetree/bindings/clock/renesas,r9a06g032-sysctrl.yaml b/Documentation/devicetree/bindings/clock/renesas,r9a06g032-sysctrl.yaml
index 26d94cedc871..c552b78c9d43 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
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] 27+ messages in thread
* [PATCH 1/6] dt-bindings: clock: r9a06g032-sysctrl: Document reset cells
@ 2026-11-19 17:57 ` Kyle Hendry via B4 Relay
0 siblings, 0 replies; 27+ messages in thread
From: Kyle Hendry via B4 Relay @ 2026-11-19 17:57 UTC (permalink / raw)
To: Geert Uytterhoeven, Stephen Boyd, Brian Masney, Jerome Brunet,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Magnus Damm,
Fabrizio Castro, Philipp Zabel, Clément Léger,
Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Lad Prabhakar, Andrew Lunn, Heiner Kallweit,
Russell King
Cc: linux-renesas-soc, linux-clk, devicetree, linux-kernel, netdev,
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>
---
Documentation/devicetree/bindings/clock/renesas,r9a06g032-sysctrl.yaml | 3 +++
include/dt-bindings/clock/r9a06g032-sysctrl.h | 3 +++
2 files changed, 6 insertions(+)
diff --git a/Documentation/devicetree/bindings/clock/renesas,r9a06g032-sysctrl.yaml b/Documentation/devicetree/bindings/clock/renesas,r9a06g032-sysctrl.yaml
index 26d94cedc871..c552b78c9d43 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
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] 27+ messages in thread
* [PATCH 2/6] clk: renesas: r9a06g032: Add reset controller
2026-11-19 17:57 ` Kyle Hendry via B4 Relay
@ 2026-11-19 17:57 ` Kyle Hendry via B4 Relay
-1 siblings, 0 replies; 27+ messages in thread
From: Kyle Hendry @ 2026-11-19 17:57 UTC (permalink / raw)
To: Geert Uytterhoeven, Stephen Boyd, Brian Masney, Jerome Brunet,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Magnus Damm,
Fabrizio Castro, Philipp Zabel, Clément Léger,
Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Lad Prabhakar, Andrew Lunn, Heiner Kallweit,
Russell King
Cc: linux-renesas-soc, linux-clk, devicetree, linux-kernel, netdev,
Kyle Hendry
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 | 64 ++++++++++++++++++++++++++++++++++
1 file changed, 64 insertions(+)
diff --git a/drivers/clk/renesas/r9a06g032-clocks.c b/drivers/clk/renesas/r9a06g032-clocks.c
index 3df3f2b2c6de..547e8d82f1cf 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,6 +676,11 @@ 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[] = {
+ RB(0x188, 3),
+ RB(0x188, 4),
+};
+
struct r9a06g032_priv {
struct clk_onecell_data data;
spinlock_t lock; /* protects concurrent access to gates */
@@ -1307,6 +1313,56 @@ static void __init r9a06g032_init_h2mode(struct r9a06g032_priv *clocks)
writel(usb, clocks->reg + R9A06G032_SYSCTRL_USB);
}
+
+#define rcdev_to_priv(x) container_of(x, struct r9a06g032_priv, rcdev)
+
+static int r9a06g032_reset_set(struct reset_controller_dev *rcdev,
+ const char *func, bool set, unsigned long id)
+{
+ struct r9a06g032_priv *priv = rcdev_to_priv(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(struct reset_controller_dev *rcdev,
+ unsigned long id)
+{
+ r9a06g032_reset_set(rcdev, "reset", true, id);
+ udelay(5);
+ return r9a06g032_reset_set(rcdev, NULL, false, id);
+}
+
+static int r9a06g032_reset_assert(struct reset_controller_dev *rcdev, unsigned long id)
+{
+ return r9a06g032_reset_set(rcdev, "assert", false, id);
+}
+
+static int r9a06g032_reset_deassert(struct reset_controller_dev *rcdev,
+ unsigned long id)
+{
+ return r9a06g032_reset_set(rcdev, "deassert", true, id);
+}
+
+static int r9a06g032_reset_status(struct reset_controller_dev *rcdev,
+ unsigned long id)
+{
+ struct r9a06g032_priv *priv = rcdev_to_priv(rcdev);
+
+ return clk_rdesc_get(priv, r9a06g032_resets[id]);
+}
+
+static const struct reset_control_ops r9a06g032_reset_ops = {
+ .reset = r9a06g032_reset,
+ .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;
@@ -1404,6 +1460,14 @@ static int __init r9a06g032_clocks_probe(struct platform_device *pdev)
if (error)
dev_err(dev, "Failed to populate children (%d)\n", error);
+ clocks->rcdev.ops = &r9a06g032_reset_ops;
+ clocks->rcdev.of_node = np;
+ clocks->rcdev.of_reset_n_cells = 1;
+ clocks->rcdev.nr_resets = ARRAY_SIZE(r9a06g032_resets);
+ error = devm_reset_controller_register(dev, &clocks->rcdev);
+ if (error)
+ return error;
+
return 0;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 27+ messages in thread
* [PATCH 2/6] clk: renesas: r9a06g032: Add reset controller
@ 2026-11-19 17:57 ` Kyle Hendry via B4 Relay
0 siblings, 0 replies; 27+ messages in thread
From: Kyle Hendry via B4 Relay @ 2026-11-19 17:57 UTC (permalink / raw)
To: Geert Uytterhoeven, Stephen Boyd, Brian Masney, Jerome Brunet,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Magnus Damm,
Fabrizio Castro, Philipp Zabel, Clément Léger,
Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Lad Prabhakar, Andrew Lunn, Heiner Kallweit,
Russell King
Cc: linux-renesas-soc, linux-clk, devicetree, linux-kernel, netdev,
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 | 64 ++++++++++++++++++++++++++++++++++
1 file changed, 64 insertions(+)
diff --git a/drivers/clk/renesas/r9a06g032-clocks.c b/drivers/clk/renesas/r9a06g032-clocks.c
index 3df3f2b2c6de..547e8d82f1cf 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,6 +676,11 @@ 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[] = {
+ RB(0x188, 3),
+ RB(0x188, 4),
+};
+
struct r9a06g032_priv {
struct clk_onecell_data data;
spinlock_t lock; /* protects concurrent access to gates */
@@ -1307,6 +1313,56 @@ static void __init r9a06g032_init_h2mode(struct r9a06g032_priv *clocks)
writel(usb, clocks->reg + R9A06G032_SYSCTRL_USB);
}
+
+#define rcdev_to_priv(x) container_of(x, struct r9a06g032_priv, rcdev)
+
+static int r9a06g032_reset_set(struct reset_controller_dev *rcdev,
+ const char *func, bool set, unsigned long id)
+{
+ struct r9a06g032_priv *priv = rcdev_to_priv(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(struct reset_controller_dev *rcdev,
+ unsigned long id)
+{
+ r9a06g032_reset_set(rcdev, "reset", true, id);
+ udelay(5);
+ return r9a06g032_reset_set(rcdev, NULL, false, id);
+}
+
+static int r9a06g032_reset_assert(struct reset_controller_dev *rcdev, unsigned long id)
+{
+ return r9a06g032_reset_set(rcdev, "assert", false, id);
+}
+
+static int r9a06g032_reset_deassert(struct reset_controller_dev *rcdev,
+ unsigned long id)
+{
+ return r9a06g032_reset_set(rcdev, "deassert", true, id);
+}
+
+static int r9a06g032_reset_status(struct reset_controller_dev *rcdev,
+ unsigned long id)
+{
+ struct r9a06g032_priv *priv = rcdev_to_priv(rcdev);
+
+ return clk_rdesc_get(priv, r9a06g032_resets[id]);
+}
+
+static const struct reset_control_ops r9a06g032_reset_ops = {
+ .reset = r9a06g032_reset,
+ .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;
@@ -1404,6 +1460,14 @@ static int __init r9a06g032_clocks_probe(struct platform_device *pdev)
if (error)
dev_err(dev, "Failed to populate children (%d)\n", error);
+ clocks->rcdev.ops = &r9a06g032_reset_ops;
+ clocks->rcdev.of_node = np;
+ clocks->rcdev.of_reset_n_cells = 1;
+ clocks->rcdev.nr_resets = ARRAY_SIZE(r9a06g032_resets);
+ error = devm_reset_controller_register(dev, &clocks->rcdev);
+ if (error)
+ return error;
+
return 0;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 27+ messages in thread
* [PATCH 3/6] ARM: dts: renesas: r9a06g032: Add #reset-cells to system controller node
2026-11-19 17:57 ` Kyle Hendry via B4 Relay
@ 2026-11-19 17:57 ` Kyle Hendry via B4 Relay
-1 siblings, 0 replies; 27+ messages in thread
From: Kyle Hendry @ 2026-11-19 17:57 UTC (permalink / raw)
To: Geert Uytterhoeven, Stephen Boyd, Brian Masney, Jerome Brunet,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Magnus Damm,
Fabrizio Castro, Philipp Zabel, Clément Léger,
Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Lad Prabhakar, Andrew Lunn, Heiner Kallweit,
Russell King
Cc: linux-renesas-soc, linux-clk, devicetree, linux-kernel, netdev,
Kyle Hendry
Update the rzn1 system controller node with cells for the reset controller
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] 27+ messages in thread
* [PATCH 3/6] ARM: dts: renesas: r9a06g032: Add #reset-cells to system controller node
@ 2026-11-19 17:57 ` Kyle Hendry via B4 Relay
0 siblings, 0 replies; 27+ messages in thread
From: Kyle Hendry via B4 Relay @ 2026-11-19 17:57 UTC (permalink / raw)
To: Geert Uytterhoeven, Stephen Boyd, Brian Masney, Jerome Brunet,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Magnus Damm,
Fabrizio Castro, Philipp Zabel, Clément Léger,
Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Lad Prabhakar, Andrew Lunn, Heiner Kallweit,
Russell King
Cc: linux-renesas-soc, linux-clk, devicetree, linux-kernel, netdev,
Kyle Hendry
From: Kyle Hendry <khendry@reliablecontrols.com>
Update the rzn1 system controller node with cells for the reset controller
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] 27+ messages in thread
* [PATCH 4/6] dt-bindings: net: pcs: renesas,rzn1-miic: Document rzn1 resets
2026-11-19 17:57 ` Kyle Hendry via B4 Relay
@ 2026-11-19 17:57 ` Kyle Hendry via B4 Relay
-1 siblings, 0 replies; 27+ messages in thread
From: Kyle Hendry @ 2026-11-19 17:57 UTC (permalink / raw)
To: Geert Uytterhoeven, Stephen Boyd, Brian Masney, Jerome Brunet,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Magnus Damm,
Fabrizio Castro, Philipp Zabel, Clément Léger,
Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Lad Prabhakar, Andrew Lunn, Heiner Kallweit,
Russell King
Cc: linux-renesas-soc, linux-clk, devicetree, linux-kernel, netdev,
Kyle Hendry
On the rzn1, there are two resets for the miic. Add documentation for them.
Signed-off-by: Kyle Hendry <khendry@reliablecontrols.com>
---
.../bindings/net/pcs/renesas,rzn1-miic.yaml | 36 +++++++++++++++-------
1 file changed, 25 insertions(+), 11 deletions(-)
diff --git a/Documentation/devicetree/bindings/net/pcs/renesas,rzn1-miic.yaml b/Documentation/devicetree/bindings/net/pcs/renesas,rzn1-miic.yaml
index f9d39114e667..d0d820f86da6 100644
--- a/Documentation/devicetree/bindings/net/pcs/renesas,rzn1-miic.yaml
+++ b/Documentation/devicetree/bindings/net/pcs/renesas,rzn1-miic.yaml
@@ -51,14 +51,12 @@ properties:
- const: hclk
resets:
- items:
- - description: Converter register reset
- - description: Converter reset
+ minItems: 2
+ maxItems: 2
reset-names:
- items:
- - const: rst
- - const: crst
+ minItems: 2
+ maxItems: 2
renesas,miic-switch-portin:
description: MII Switch PORTIN configuration. This value should use one of
@@ -109,8 +107,14 @@ allOf:
properties:
renesas,miic-switch-portin:
enum: [1, 2]
- resets: false
- reset-names: false
+ resets:
+ items:
+ - description: Timestamp selector reset
+ - description: Converter reset
+ reset-names:
+ items:
+ - const: rst_ts
+ - const: rst_miic
patternProperties:
"^mii-conv@[0-5]$":
properties:
@@ -161,9 +165,14 @@ allOf:
properties:
renesas,miic-switch-portin:
const: 0
- required:
- - resets
- - reset-names
+ resets:
+ items:
+ - description: Converter register reset
+ - description: Converter reset
+ reset-names:
+ items:
+ - const: rst
+ - const: crst
patternProperties:
"^mii-conv@[0-5]$":
properties:
@@ -210,6 +219,8 @@ required:
- reg
- clocks
- clock-names
+ - resets
+ - reset-names
- power-domains
additionalProperties: false
@@ -229,6 +240,9 @@ examples:
<&sysctrl R9A06G032_CLK_RMII_REF>,
<&sysctrl R9A06G032_HCLK_SWITCH_RG>;
clock-names = "mii_ref", "rgmii_ref", "rmii_ref", "hclk";
+ resets = <&sysctrl R9A06G032_RST_TS>,
+ <&sysctrl R9A06G032_RST_MIIC>;
+ reset-names = "rst_ts", "rst_miic";
renesas,miic-switch-portin = <MIIC_GMAC2_PORT>;
power-domains = <&sysctrl>;
--
2.53.0
^ permalink raw reply related [flat|nested] 27+ messages in thread
* [PATCH 4/6] dt-bindings: net: pcs: renesas,rzn1-miic: Document rzn1 resets
@ 2026-11-19 17:57 ` Kyle Hendry via B4 Relay
0 siblings, 0 replies; 27+ messages in thread
From: Kyle Hendry via B4 Relay @ 2026-11-19 17:57 UTC (permalink / raw)
To: Geert Uytterhoeven, Stephen Boyd, Brian Masney, Jerome Brunet,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Magnus Damm,
Fabrizio Castro, Philipp Zabel, Clément Léger,
Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Lad Prabhakar, Andrew Lunn, Heiner Kallweit,
Russell King
Cc: linux-renesas-soc, linux-clk, devicetree, linux-kernel, netdev,
Kyle Hendry
From: Kyle Hendry <khendry@reliablecontrols.com>
On the rzn1, there are two resets for the miic. Add documentation for them.
Signed-off-by: Kyle Hendry <khendry@reliablecontrols.com>
---
.../bindings/net/pcs/renesas,rzn1-miic.yaml | 36 +++++++++++++++-------
1 file changed, 25 insertions(+), 11 deletions(-)
diff --git a/Documentation/devicetree/bindings/net/pcs/renesas,rzn1-miic.yaml b/Documentation/devicetree/bindings/net/pcs/renesas,rzn1-miic.yaml
index f9d39114e667..d0d820f86da6 100644
--- a/Documentation/devicetree/bindings/net/pcs/renesas,rzn1-miic.yaml
+++ b/Documentation/devicetree/bindings/net/pcs/renesas,rzn1-miic.yaml
@@ -51,14 +51,12 @@ properties:
- const: hclk
resets:
- items:
- - description: Converter register reset
- - description: Converter reset
+ minItems: 2
+ maxItems: 2
reset-names:
- items:
- - const: rst
- - const: crst
+ minItems: 2
+ maxItems: 2
renesas,miic-switch-portin:
description: MII Switch PORTIN configuration. This value should use one of
@@ -109,8 +107,14 @@ allOf:
properties:
renesas,miic-switch-portin:
enum: [1, 2]
- resets: false
- reset-names: false
+ resets:
+ items:
+ - description: Timestamp selector reset
+ - description: Converter reset
+ reset-names:
+ items:
+ - const: rst_ts
+ - const: rst_miic
patternProperties:
"^mii-conv@[0-5]$":
properties:
@@ -161,9 +165,14 @@ allOf:
properties:
renesas,miic-switch-portin:
const: 0
- required:
- - resets
- - reset-names
+ resets:
+ items:
+ - description: Converter register reset
+ - description: Converter reset
+ reset-names:
+ items:
+ - const: rst
+ - const: crst
patternProperties:
"^mii-conv@[0-5]$":
properties:
@@ -210,6 +219,8 @@ required:
- reg
- clocks
- clock-names
+ - resets
+ - reset-names
- power-domains
additionalProperties: false
@@ -229,6 +240,9 @@ examples:
<&sysctrl R9A06G032_CLK_RMII_REF>,
<&sysctrl R9A06G032_HCLK_SWITCH_RG>;
clock-names = "mii_ref", "rgmii_ref", "rmii_ref", "hclk";
+ resets = <&sysctrl R9A06G032_RST_TS>,
+ <&sysctrl R9A06G032_RST_MIIC>;
+ reset-names = "rst_ts", "rst_miic";
renesas,miic-switch-portin = <MIIC_GMAC2_PORT>;
power-domains = <&sysctrl>;
--
2.53.0
^ permalink raw reply related [flat|nested] 27+ messages in thread
* [PATCH 5/6] net: pcs: rzn1-miic: Add resets to rzn1 info structure
2026-11-19 17:57 ` Kyle Hendry via B4 Relay
@ 2026-11-19 17:57 ` Kyle Hendry via B4 Relay
-1 siblings, 0 replies; 27+ messages in thread
From: Kyle Hendry @ 2026-11-19 17:57 UTC (permalink / raw)
To: Geert Uytterhoeven, Stephen Boyd, Brian Masney, Jerome Brunet,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Magnus Damm,
Fabrizio Castro, Philipp Zabel, Clément Léger,
Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Lad Prabhakar, Andrew Lunn, Heiner Kallweit,
Russell King
Cc: linux-renesas-soc, linux-clk, devicetree, linux-kernel, netdev,
Kyle Hendry
Update the rzn1 info structure to include the resets that the driver needs
to deassert
Signed-off-by: Kyle Hendry <khendry@reliablecontrols.com>
---
drivers/net/pcs/pcs-rzn1-miic.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/net/pcs/pcs-rzn1-miic.c b/drivers/net/pcs/pcs-rzn1-miic.c
index f8bafce26bf1..38164502c08c 100644
--- a/drivers/net/pcs/pcs-rzn1-miic.c
+++ b/drivers/net/pcs/pcs-rzn1-miic.c
@@ -128,6 +128,11 @@ static const char * const index_to_string[] = {
"CONV5",
};
+static const char * const rzn1_reset_ids[] = {
+ "rst_ts",
+ "rst_miic",
+};
+
static struct modctrl_match rzt2h_modctrl_match_table[] = {
{0x0, {ETHSS_GMAC0_PORT, ETHSS_ETHSW_PORT0, ETHSS_ETHSW_PORT1,
ETHSS_ETHSW_PORT2, ETHSS_GMAC1_PORT}},
@@ -855,6 +860,8 @@ static struct miic_of_data rzn1_miic_of_data = {
.miic_port_start = 1,
.miic_port_last = 5,
.sw_mode_mask = GENMASK(4, 0),
+ .reset_ids = rzn1_reset_ids,
+ .reset_count = ARRAY_SIZE(rzn1_reset_ids),
.init_unlock_lock_regs = true,
.miic_write = miic_reg_writel_unlocked,
.type = MIIC_TYPE_RZN1,
--
2.53.0
^ permalink raw reply related [flat|nested] 27+ messages in thread
* [PATCH 5/6] net: pcs: rzn1-miic: Add resets to rzn1 info structure
@ 2026-11-19 17:57 ` Kyle Hendry via B4 Relay
0 siblings, 0 replies; 27+ messages in thread
From: Kyle Hendry via B4 Relay @ 2026-11-19 17:57 UTC (permalink / raw)
To: Geert Uytterhoeven, Stephen Boyd, Brian Masney, Jerome Brunet,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Magnus Damm,
Fabrizio Castro, Philipp Zabel, Clément Léger,
Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Lad Prabhakar, Andrew Lunn, Heiner Kallweit,
Russell King
Cc: linux-renesas-soc, linux-clk, devicetree, linux-kernel, netdev,
Kyle Hendry
From: Kyle Hendry <khendry@reliablecontrols.com>
Update the rzn1 info structure to include the resets that the driver needs
to deassert
Signed-off-by: Kyle Hendry <khendry@reliablecontrols.com>
---
drivers/net/pcs/pcs-rzn1-miic.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/net/pcs/pcs-rzn1-miic.c b/drivers/net/pcs/pcs-rzn1-miic.c
index f8bafce26bf1..38164502c08c 100644
--- a/drivers/net/pcs/pcs-rzn1-miic.c
+++ b/drivers/net/pcs/pcs-rzn1-miic.c
@@ -128,6 +128,11 @@ static const char * const index_to_string[] = {
"CONV5",
};
+static const char * const rzn1_reset_ids[] = {
+ "rst_ts",
+ "rst_miic",
+};
+
static struct modctrl_match rzt2h_modctrl_match_table[] = {
{0x0, {ETHSS_GMAC0_PORT, ETHSS_ETHSW_PORT0, ETHSS_ETHSW_PORT1,
ETHSS_ETHSW_PORT2, ETHSS_GMAC1_PORT}},
@@ -855,6 +860,8 @@ static struct miic_of_data rzn1_miic_of_data = {
.miic_port_start = 1,
.miic_port_last = 5,
.sw_mode_mask = GENMASK(4, 0),
+ .reset_ids = rzn1_reset_ids,
+ .reset_count = ARRAY_SIZE(rzn1_reset_ids),
.init_unlock_lock_regs = true,
.miic_write = miic_reg_writel_unlocked,
.type = MIIC_TYPE_RZN1,
--
2.53.0
^ permalink raw reply related [flat|nested] 27+ messages in thread
* [PATCH 6/6] ARM: dts: renesas: r9a06g032: Add resets to mii converter
2026-11-19 17:57 ` Kyle Hendry via B4 Relay
@ 2026-11-19 17:57 ` Kyle Hendry via B4 Relay
-1 siblings, 0 replies; 27+ messages in thread
From: Kyle Hendry @ 2026-11-19 17:57 UTC (permalink / raw)
To: Geert Uytterhoeven, Stephen Boyd, Brian Masney, Jerome Brunet,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Magnus Damm,
Fabrizio Castro, Philipp Zabel, Clément Léger,
Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Lad Prabhakar, Andrew Lunn, Heiner Kallweit,
Russell King
Cc: linux-renesas-soc, linux-clk, devicetree, linux-kernel, netdev,
Kyle Hendry
Add references to the resets in the system driver that the miic needs
Signed-off-by: Kyle Hendry <khendry@reliablecontrols.com>
---
arch/arm/boot/dts/renesas/r9a06g032.dtsi | 3 +++
1 file changed, 3 insertions(+)
diff --git a/arch/arm/boot/dts/renesas/r9a06g032.dtsi b/arch/arm/boot/dts/renesas/r9a06g032.dtsi
index f2bf087f7ad2..0a538d922125 100644
--- a/arch/arm/boot/dts/renesas/r9a06g032.dtsi
+++ b/arch/arm/boot/dts/renesas/r9a06g032.dtsi
@@ -463,6 +463,9 @@ eth_miic: eth-miic@44030000 {
<&sysctrl R9A06G032_CLK_RMII_REF>,
<&sysctrl R9A06G032_HCLK_SWITCH_RG>;
clock-names = "mii_ref", "rgmii_ref", "rmii_ref", "hclk";
+ resets = <&sysctrl R9A06G032_RST_TS>,
+ <&sysctrl R9A06G032_RST_MIIC>;
+ reset-names = "rst_ts", "rst_miic";
power-domains = <&sysctrl>;
status = "disabled";
--
2.53.0
^ permalink raw reply related [flat|nested] 27+ messages in thread
* [PATCH 6/6] ARM: dts: renesas: r9a06g032: Add resets to mii converter
@ 2026-11-19 17:57 ` Kyle Hendry via B4 Relay
0 siblings, 0 replies; 27+ messages in thread
From: Kyle Hendry via B4 Relay @ 2026-11-19 17:57 UTC (permalink / raw)
To: Geert Uytterhoeven, Stephen Boyd, Brian Masney, Jerome Brunet,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Magnus Damm,
Fabrizio Castro, Philipp Zabel, Clément Léger,
Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Lad Prabhakar, Andrew Lunn, Heiner Kallweit,
Russell King
Cc: linux-renesas-soc, linux-clk, devicetree, linux-kernel, netdev,
Kyle Hendry
From: Kyle Hendry <khendry@reliablecontrols.com>
Add references to the resets in the system driver that the miic needs
Signed-off-by: Kyle Hendry <khendry@reliablecontrols.com>
---
arch/arm/boot/dts/renesas/r9a06g032.dtsi | 3 +++
1 file changed, 3 insertions(+)
diff --git a/arch/arm/boot/dts/renesas/r9a06g032.dtsi b/arch/arm/boot/dts/renesas/r9a06g032.dtsi
index f2bf087f7ad2..0a538d922125 100644
--- a/arch/arm/boot/dts/renesas/r9a06g032.dtsi
+++ b/arch/arm/boot/dts/renesas/r9a06g032.dtsi
@@ -463,6 +463,9 @@ eth_miic: eth-miic@44030000 {
<&sysctrl R9A06G032_CLK_RMII_REF>,
<&sysctrl R9A06G032_HCLK_SWITCH_RG>;
clock-names = "mii_ref", "rgmii_ref", "rmii_ref", "hclk";
+ resets = <&sysctrl R9A06G032_RST_TS>,
+ <&sysctrl R9A06G032_RST_MIIC>;
+ reset-names = "rst_ts", "rst_miic";
power-domains = <&sysctrl>;
status = "disabled";
--
2.53.0
^ permalink raw reply related [flat|nested] 27+ messages in thread
* Re: [PATCH 0/6] clk: renesas: r9a06g032: Add reset controller to clear resets for mii converter
2026-11-19 17:57 ` Kyle Hendry via B4 Relay
` (6 preceding siblings ...)
(?)
@ 2026-11-19 22:02 ` Jakub Kicinski
-1 siblings, 0 replies; 27+ messages in thread
From: Jakub Kicinski @ 2026-11-19 22:02 UTC (permalink / raw)
To: Kyle Hendry via B4 Relay
Cc: khendry, Geert Uytterhoeven, Stephen Boyd, Brian Masney,
Jerome Brunet, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Magnus Damm, Fabrizio Castro, Philipp Zabel,
Clément Léger, Andrew Lunn, David S. Miller,
Eric Dumazet, Paolo Abeni, Lad Prabhakar, Andrew Lunn,
Heiner Kallweit, Russell King, linux-renesas-soc, linux-clk,
devicetree, linux-kernel, netdev
On Thu, 19 Nov 2026 09:57:42 -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.
You need to split this up by subsystem, the series as posted doesn't
seem to build for us. Please send patches 4 and 5 as a separate mini
series and tag it for net-next. Please wait until tomorrow (24h
from this posting) per netdev subsystem guide.
Thanks!
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH 1/6] dt-bindings: clock: r9a06g032-sysctrl: Document reset cells
2026-11-19 17:57 ` Kyle Hendry via B4 Relay
(?)
@ 2026-11-20 9:23 ` Wolfram Sang
2026-11-20 9:51 ` Philipp Zabel
-1 siblings, 1 reply; 27+ messages in thread
From: Wolfram Sang @ 2026-11-20 9:23 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, Clément Léger,
Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Lad Prabhakar, Andrew Lunn, Heiner Kallweit,
Russell King, linux-renesas-soc, linux-clk, devicetree,
linux-kernel, netdev
[-- Attachment #1: Type: text/plain, Size: 747 bytes --]
Hi Kyle,
thank you for this series!
>
> + '#reset-cells':
> + const: 1
> +
Maybe add the new property to the example below, too?
> 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
I didn't find any listing of the resets in the RZN1 docs, so coming up
with arbitrary numbers as we need them seems okay to me.
Happy hacking,
Wolfram
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH 2/6] clk: renesas: r9a06g032: Add reset controller
2026-11-19 17:57 ` Kyle Hendry via B4 Relay
(?)
@ 2026-11-20 9:30 ` Wolfram Sang
-1 siblings, 0 replies; 27+ messages in thread
From: Wolfram Sang @ 2026-11-20 9:30 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, Clément Léger,
Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Lad Prabhakar, Andrew Lunn, Heiner Kallweit,
Russell King, linux-renesas-soc, linux-clk, devicetree,
linux-kernel, netdev
[-- Attachment #1: Type: text/plain, Size: 1740 bytes --]
On Thu, Nov 19, 2026 at 09:57:44AM -0800, Kyle Hendry via B4 Relay wrote:
> 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>
General approach looks good to me, just some minor comments...
> +static const struct regbit r9a06g032_resets[] = {
> + RB(0x188, 3),
> + RB(0x188, 4),
> +};
Please add the DT name of the reset as a comment after each line.
+ RB(0x188, 3), /* RST_TS */
or similar.
> +static int r9a06g032_reset_set(struct reset_controller_dev *rcdev,
> + const char *func, bool set, unsigned long id)
> +{
*func was likely debug help and is unused now and can go.
> + struct r9a06g032_priv *priv = rcdev_to_priv(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(struct reset_controller_dev *rcdev,
> + unsigned long id)
> +{
> + r9a06g032_reset_set(rcdev, "reset", true, id);
> + udelay(5);
For future reference, please add a comment pointing to chapter in the
docs where it is saying 5us is needed.
Rest looks good!
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH 3/6] ARM: dts: renesas: r9a06g032: Add #reset-cells to system controller node
2026-11-19 17:57 ` Kyle Hendry via B4 Relay
(?)
@ 2026-11-20 9:32 ` Wolfram Sang
-1 siblings, 0 replies; 27+ messages in thread
From: Wolfram Sang @ 2026-11-20 9:32 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, Clément Léger,
Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Lad Prabhakar, Andrew Lunn, Heiner Kallweit,
Russell King, linux-renesas-soc, linux-clk, devicetree,
linux-kernel, netdev
[-- Attachment #1: Type: text/plain, Size: 446 bytes --]
On Thu, Nov 19, 2026 at 09:57:45AM -0800, Kyle Hendry via B4 Relay wrote:
> From: Kyle Hendry <khendry@reliablecontrols.com>
>
> Update the rzn1 system controller node with cells for the reset controller
>
> Signed-off-by: Kyle Hendry <khendry@reliablecontrols.com>
I'll leave the final decision for Geert, but I think this can be merged
with patch 6. But in general:
Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH 6/6] ARM: dts: renesas: r9a06g032: Add resets to mii converter
2026-11-19 17:57 ` Kyle Hendry via B4 Relay
(?)
@ 2026-11-20 9:34 ` Wolfram Sang
-1 siblings, 0 replies; 27+ messages in thread
From: Wolfram Sang @ 2026-11-20 9:34 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, Clément Léger,
Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Lad Prabhakar, Andrew Lunn, Heiner Kallweit,
Russell King, linux-renesas-soc, linux-clk, devicetree,
linux-kernel, netdev
[-- Attachment #1: Type: text/plain, Size: 335 bytes --]
On Thu, Nov 19, 2026 at 09:57:48AM -0800, Kyle Hendry via B4 Relay wrote:
> From: Kyle Hendry <khendry@reliablecontrols.com>
>
> Add references to the resets in the system driver that the miic needs
>
> Signed-off-by: Kyle Hendry <khendry@reliablecontrols.com>
Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH 1/6] dt-bindings: clock: r9a06g032-sysctrl: Document reset cells
2026-11-20 9:23 ` Wolfram Sang
@ 2026-11-20 9:51 ` Philipp Zabel
2026-11-20 11:11 ` Wolfram Sang
0 siblings, 1 reply; 27+ messages in thread
From: Philipp Zabel @ 2026-11-20 9:51 UTC (permalink / raw)
To: Wolfram Sang, khendry
Cc: Geert Uytterhoeven, Stephen Boyd, Brian Masney, Jerome Brunet,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Magnus Damm,
Fabrizio Castro, Clément Léger, Andrew Lunn,
David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Lad Prabhakar, Andrew Lunn, Heiner Kallweit, Russell King,
linux-renesas-soc, linux-clk, devicetree, linux-kernel, netdev
On Fr, 2026-11-20 at 10:23 +0100, Wolfram Sang wrote:
> Hi Kyle,
>
> thank you for this series!
>
> >
> > + '#reset-cells':
> > + const: 1
> > +
>
> Maybe add the new property to the example below, too?
>
> > 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
>
> I didn't find any listing of the resets in the RZN1 docs, so coming up
> with arbitrary numbers as we need them seems okay to me.
Why aren't we starting at 0?
regards
Philipp
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH 2/6] clk: renesas: r9a06g032: Add reset controller
2026-11-19 17:57 ` Kyle Hendry via B4 Relay
(?)
(?)
@ 2026-11-20 10:00 ` Philipp Zabel
-1 siblings, 0 replies; 27+ messages in thread
From: Philipp Zabel @ 2026-11-20 10:00 UTC (permalink / raw)
To: khendry, Geert Uytterhoeven, Stephen Boyd, Brian Masney,
Jerome Brunet, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Magnus Damm, Fabrizio Castro, Clément Léger,
Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Lad Prabhakar, Andrew Lunn, Heiner Kallweit,
Russell King
Cc: linux-renesas-soc, linux-clk, devicetree, linux-kernel, netdev
On Do, 2026-11-19 at 09:57 -0800, Kyle Hendry via B4 Relay wrote:
> 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 | 64 ++++++++++++++++++++++++++++++++++
> 1 file changed, 64 insertions(+)
>
> diff --git a/drivers/clk/renesas/r9a06g032-clocks.c b/drivers/clk/renesas/r9a06g032-clocks.c
> index 3df3f2b2c6de..547e8d82f1cf 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,6 +676,11 @@ 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[] = {
> + RB(0x188, 3),
> + RB(0x188, 4),
I suggest to use designated initializers:
[R9A06G032_RST_TS] = RB(0x188, 3),
[R9A06G032_RST_MIIC] = RB(0x188, 4),
to document the association and make sure there are no off-by-one
errors.
> +};
> +
> struct r9a06g032_priv {
> struct clk_onecell_data data;
> spinlock_t lock; /* protects concurrent access to gates */
> @@ -1307,6 +1313,56 @@ static void __init r9a06g032_init_h2mode(struct r9a06g032_priv *clocks)
> writel(usb, clocks->reg + R9A06G032_SYSCTRL_USB);
> }
>
> +
> +#define rcdev_to_priv(x) container_of(x, struct r9a06g032_priv, rcdev)
I'd use a static inline function for this.
> +
> +static int r9a06g032_reset_set(struct reset_controller_dev *rcdev,
> + const char *func, bool set, unsigned long id)
> +{
> + struct r9a06g032_priv *priv = rcdev_to_priv(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(struct reset_controller_dev *rcdev,
> + unsigned long id)
> +{
> + r9a06g032_reset_set(rcdev, "reset", true, id);
> + udelay(5);
> + return r9a06g032_reset_set(rcdev, NULL, false, id);
> +}
Please don't implement the reset op unless really needed for
compatibility with actual, self-clearing reset controllers.
If it is needed, please explain why. If so, is this delay enough for
both resets? Is it enough for any other resets this reset controller
driver may support in the future?
> +
> +static int r9a06g032_reset_assert(struct reset_controller_dev *rcdev, unsigned long id)
> +{
> + return r9a06g032_reset_set(rcdev, "assert", false, id);
> +}
> +
> +static int r9a06g032_reset_deassert(struct reset_controller_dev *rcdev,
> + unsigned long id)
> +{
> + return r9a06g032_reset_set(rcdev, "deassert", true, id);
> +}
> +
> +static int r9a06g032_reset_status(struct reset_controller_dev *rcdev,
> + unsigned long id)
> +{
> + struct r9a06g032_priv *priv = rcdev_to_priv(rcdev);
> +
> + return clk_rdesc_get(priv, r9a06g032_resets[id]);
> +}
> +
> +static const struct reset_control_ops r9a06g032_reset_ops = {
> + .reset = r9a06g032_reset,
> + .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;
> @@ -1404,6 +1460,14 @@ static int __init r9a06g032_clocks_probe(struct platform_device *pdev)
> if (error)
> dev_err(dev, "Failed to populate children (%d)\n", error);
>
> + clocks->rcdev.ops = &r9a06g032_reset_ops;
> + clocks->rcdev.of_node = np;
> + clocks->rcdev.of_reset_n_cells = 1;
Don't set of_reset_n_cells, as of_xlate isn't set either.
fwnode_reset_n_cells will be set to 1 by default in
reset_controller_register().
> + clocks->rcdev.nr_resets = ARRAY_SIZE(r9a06g032_resets);
> + error = devm_reset_controller_register(dev, &clocks->rcdev);
^
Superfluous whitespace.
> + if (error)
> + return error;
> +
> return 0;
Could be simplified to just:
return devm_reset_controller_register(dev, &clocks->rcdev);
regards
Philipp
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH 1/6] dt-bindings: clock: r9a06g032-sysctrl: Document reset cells
2026-11-20 9:51 ` Philipp Zabel
@ 2026-11-20 11:11 ` Wolfram Sang
0 siblings, 0 replies; 27+ messages in thread
From: Wolfram Sang @ 2026-11-20 11:11 UTC (permalink / raw)
To: Philipp Zabel
Cc: khendry, Geert Uytterhoeven, Stephen Boyd, Brian Masney,
Jerome Brunet, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Magnus Damm, Fabrizio Castro, Clément Léger,
Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Lad Prabhakar, Andrew Lunn, Heiner Kallweit,
Russell King, linux-renesas-soc, linux-clk, devicetree,
linux-kernel, netdev
> > > +#define R9A06G032_RST_TS 1
> > > +#define R9A06G032_RST_MIIC 2
> >
> > I didn't find any listing of the resets in the RZN1 docs, so coming up
> > with arbitrary numbers as we need them seems okay to me.
>
> Why aren't we starting at 0?
I wondered as well but clocks are also starting from 1, so we could
argue with consistency.
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH 2/6] clk: renesas: r9a06g032: Add reset controller
2026-11-19 17:57 ` Kyle Hendry via B4 Relay
` (2 preceding siblings ...)
(?)
@ 2026-11-20 11:47 ` Wolfram Sang
-1 siblings, 0 replies; 27+ messages in thread
From: Wolfram Sang @ 2026-11-20 11:47 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, Clément Léger,
Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Lad Prabhakar, Andrew Lunn, Heiner Kallweit,
Russell King, linux-renesas-soc, linux-clk, devicetree,
linux-kernel, netdev
> struct r9a06g032_priv {
> struct clk_onecell_data data;
> spinlock_t lock; /* protects concurrent access to gates */
Build error :( No addition of 'rcdev' to priv data!
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH 4/6] dt-bindings: net: pcs: renesas,rzn1-miic: Document rzn1 resets
2026-11-19 17:57 ` Kyle Hendry via B4 Relay
(?)
@ 2026-11-20 11:49 ` Wolfram Sang
-1 siblings, 0 replies; 27+ messages in thread
From: Wolfram Sang @ 2026-11-20 11:49 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, Clément Léger,
Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Lad Prabhakar, Andrew Lunn, Heiner Kallweit,
Russell King, linux-renesas-soc, linux-clk, devicetree,
linux-kernel, netdev
On Thu, Nov 19, 2026 at 09:57:46AM -0800, Kyle Hendry via B4 Relay wrote:
> From: Kyle Hendry <khendry@reliablecontrols.com>
>
> On the rzn1, there are two resets for the miic. Add documentation for them.
>
> Signed-off-by: Kyle Hendry <khendry@reliablecontrols.com>
I will comment on the bindings over the weekend.
For further testing on real HW, I will wait for v2.
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH 2/6] clk: renesas: r9a06g032: Add reset controller
2026-11-19 17:57 ` Kyle Hendry via B4 Relay
` (3 preceding siblings ...)
(?)
@ 2026-11-20 17:58 ` sashiko-bot
-1 siblings, 0 replies; 27+ messages in thread
From: sashiko-bot @ 2026-11-20 17:58 UTC (permalink / raw)
To: Kyle Hendry; +Cc: linux-clk, devicetree, robh, conor+dt, wsa+renesas
Thank you for your contribution! Sashiko AI review found 6 potential
issues to consider:
- [High] clk: renesas: r9a06g032: missing rcdev member in struct
r9a06g032_priv
- [High] clk: renesas: r9a06g032: 0-based r9a06g032_resets[] mismatches
1-based DT IDs
- [High] clk: renesas: r9a06g032: inverted reset polarity in
r9a06g032_reset()
- [Medium] clk: renesas: r9a06g032: inverted return value in
r9a06g032_reset_status()
- [Medium] clk: renesas: r9a06g032: dangling sysctrl_priv on reset
registration error
- [Low] clk: renesas: r9a06g032: unused func parameter in
r9a06g032_reset_set()
--
commit c1ea072ef200e955b9711c8cf6fa8c5c06a195de
Author: Kyle Hendry <khendry@reliablecontrols.com>
clk: renesas: r9a06g032: Add reset controller
This commit registers a reset controller in the r9a06g032 clock driver to
control the RSTN_CLK25 and RSTN_ETH active-low 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..547e8d82f1cf1 100644
> --- a/drivers/clk/renesas/r9a06g032-clocks.c
> +++ b/drivers/clk/renesas/r9a06g032-clocks.c
[ ... ]
> @@ -675,6 +676,11 @@ 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[] = {
> + RB(0x188, 3),
> + RB(0x188, 4),
> +};
[Severity: High]
Does the 0-based indexing of r9a06g032_resets[] mismatch the 1-based DT
binding definitions?
include/dt-bindings/clock/r9a06g032-sysctrl.h defines R9A06G032_RST_TS as
1 and R9A06G032_RST_MIIC as 2. With clocks->rcdev.nr_resets set to
ARRAY_SIZE(r9a06g032_resets) (2) and the default
fwnode_reset_simple_xlate(), requesting R9A06G032_RST_MIIC (2) fails with
-EINVAL, and requesting R9A06G032_RST_TS (1) indexes r9a06g032_resets[1]
(bit 4, RSTN_ETH) instead of bit 3 (RSTN_CLK25).
> +
> struct r9a06g032_priv {
> struct clk_onecell_data data;
> spinlock_t lock; /* protects concurrent access to gates */
> @@ -1307,6 +1313,56 @@ static void __init r9a06g032_init_h2mode(struct r9a06g032_priv *clocks)
> writel(usb, clocks->reg + R9A06G032_SYSCTRL_USB);
> }
>
> +
> +#define rcdev_to_priv(x) container_of(x, struct r9a06g032_priv, rcdev)
[Severity: High]
Is struct r9a06g032_priv missing the struct reset_controller_dev rcdev
member? Without it, rcdev_to_priv() and clocks->rcdev in
r9a06g032_clocks_probe() fail to compile when CONFIG_CLK_R9A06G032 is
enabled.
> +
> +static int r9a06g032_reset_set(struct reset_controller_dev *rcdev,
> + const char *func, bool set, unsigned long id)
> +{
> + struct r9a06g032_priv *priv = rcdev_to_priv(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;
> +}
[Severity: Low]
The func parameter in r9a06g032_reset_set() is unused and triggers a
-Wunused-parameter warning under W=1 builds.
> +
> +static int r9a06g032_reset(struct reset_controller_dev *rcdev,
> + unsigned long id)
> +{
> + r9a06g032_reset_set(rcdev, "reset", true, id);
> + udelay(5);
> + return r9a06g032_reset_set(rcdev, NULL, false, id);
> +}
> +
> +static int r9a06g032_reset_assert(struct reset_controller_dev *rcdev, unsigned long id)
> +{
> + return r9a06g032_reset_set(rcdev, "assert", false, id);
> +}
> +
> +static int r9a06g032_reset_deassert(struct reset_controller_dev *rcdev,
> + unsigned long id)
> +{
> + return r9a06g032_reset_set(rcdev, "deassert", true, id);
> +}
[Severity: High]
Is the reset polarity in r9a06g032_reset() inverted?
Because these resets are active-low (false asserts and true deasserts, as
in r9a06g032_reset_assert() and r9a06g032_reset_deassert()), passing true
before udelay(5) and false afterward deasserts the line and then leaves
the hardware held in reset.
> +
> +static int r9a06g032_reset_status(struct reset_controller_dev *rcdev,
> + unsigned long id)
> +{
> + struct r9a06g032_priv *priv = rcdev_to_priv(rcdev);
> +
> + return clk_rdesc_get(priv, r9a06g032_resets[id]);
> +}
[Severity: Medium]
Should r9a06g032_reset_status() invert the return value of
clk_rdesc_get()?
reset_control_ops.status must return a positive value when the reset is
asserted and 0 when deasserted, whereas clk_rdesc_get() on these
active-low bits returns 0 when asserted and 1 when deasserted.
[ ... ]
> @@ -1404,6 +1460,14 @@ static int __init r9a06g032_clocks_probe(struct platform_device *pdev)
> if (error)
> dev_err(dev, "Failed to populate children (%d)\n", error);
>
> + clocks->rcdev.ops = &r9a06g032_reset_ops;
> + clocks->rcdev.of_node = np;
> + clocks->rcdev.of_reset_n_cells = 1;
> + clocks->rcdev.nr_resets = ARRAY_SIZE(r9a06g032_resets);
> + error = devm_reset_controller_register(dev, &clocks->rcdev);
> + if (error)
> + return error;
[Severity: Medium]
If devm_reset_controller_register() fails here, does returning an error
leave sysctrl_priv dangling after devres frees clocks?
Earlier in r9a06g032_clocks_probe(), r9a06g032_add_clk_domain(dev)
registers an unmanaged genpd provider, sysctrl_priv is set to clocks, and
of_platform_populate() creates child devices. If
devm_reset_controller_register() fails afterward, devres frees clocks and
unmaps clocks->reg while sysctrl_priv remains non-NULL, causing a
use-after-free in r9a06g032_sysctrl_set_dmamux(), and child devices
probed during of_platform_populate() cannot look up the reset controller
yet. Registering the reset controller before r9a06g032_add_clk_domain(),
sysctrl_priv = clocks, and of_platform_populate() avoids both problems.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261119-rzn1-miic-resets-v1-0-feee2bb28bb4@reliablecontrols.com?part=2
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH 5/6] net: pcs: rzn1-miic: Add resets to rzn1 info structure
2026-11-19 17:57 ` Kyle Hendry via B4 Relay
(?)
@ 2026-11-20 17:58 ` sashiko-bot
-1 siblings, 0 replies; 27+ messages in thread
From: sashiko-bot @ 2026-11-20 17:58 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:
- [High] net: pcs: rzn1-miic: mandatory resets in
miic_reset_control_init() fail probe
- [High] net: pcs: rzn1-miic: 1-based reset IDs fail
miic_reset_control_init() lookup
--
commit cf9182d3fcd65a07b7b29000ceaaa7372b1589dd
Author: Kyle Hendry <khendry@reliablecontrols.com>
net: pcs: rzn1-miic: Add resets to rzn1 info structure
This commit adds the "rst_ts" and "rst_miic" reset names and count to
rzn1_miic_of_data so that the driver requests and deasserts the RZ/N1
MII converter resets.
> diff --git a/drivers/net/pcs/pcs-rzn1-miic.c b/drivers/net/pcs/pcs-rzn1-miic.c
> index f8bafce26bf13..38164502c08cf 100644
> --- a/drivers/net/pcs/pcs-rzn1-miic.c
> +++ b/drivers/net/pcs/pcs-rzn1-miic.c
> @@ -128,6 +128,11 @@ static const char * const index_to_string[] = {
> "CONV5",
> };
>
> +static const char * const rzn1_reset_ids[] = {
> + "rst_ts",
> + "rst_miic",
> +};
> +
> static struct modctrl_match rzt2h_modctrl_match_table[] = {
> {0x0, {ETHSS_GMAC0_PORT, ETHSS_ETHSW_PORT0, ETHSS_ETHSW_PORT1,
> ETHSS_ETHSW_PORT2, ETHSS_GMAC1_PORT}},
[Severity: High]
Does looking up rzn1_reset_ids[] fail in fwnode_reset_simple_xlate() when
the eth_miic node uses R9A06G032_RST_TS (1) and R9A06G032_RST_MIIC (2)?
include/dt-bindings/clock/r9a06g032-sysctrl.h defines R9A06G032_RST_TS as
1 and R9A06G032_RST_MIIC as 2, while r9a06g032_clocks_probe() registers a
2-entry r9a06g032_resets[] table (indices 0 and 1) with the default
0-based fwnode_reset_simple_xlate(). As a result, "rst_ts" (ID 1) maps
to r9a06g032_resets[1] (the MIIC reset bit instead of the timestamp reset
bit at index 0), and "rst_miic" (ID 2) is rejected with -EINVAL because
2 >= rcdev->nr_resets, causing miic_probe() to fail.
> @@ -855,6 +860,8 @@ static struct miic_of_data rzn1_miic_of_data = {
> .miic_port_start = 1,
> .miic_port_last = 5,
> .sw_mode_mask = GENMASK(4, 0),
> + .reset_ids = rzn1_reset_ids,
> + .reset_count = ARRAY_SIZE(rzn1_reset_ids),
> .init_unlock_lock_regs = true,
> .miic_write = miic_reg_writel_unlocked,
> .type = MIIC_TYPE_RZN1,
[Severity: High]
Will setting reset_count on rzn1_miic_of_data break probe on existing
RZ/N1 device trees that do not have resets and reset-names properties?
miic_reset_control_init() requests the resets with the non-optional
devm_reset_control_bulk_get_exclusive(), which fails with -ENOENT when
resets are absent from the eth-miic node. Prior to this series, the
renesas,rzn1-miic binding forbade resets, and in-tree r9a06g032.dtsi only
gains them in a later commit in this series ("ARM: dts: renesas:
r9a06g032: Add resets to mii converter"), so probe fails on older DTBs
and at this commit during bisection unless the resets are requested as
optional.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261119-rzn1-miic-resets-v1-0-feee2bb28bb4@reliablecontrols.com?part=5
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH 6/6] ARM: dts: renesas: r9a06g032: Add resets to mii converter
2026-11-19 17:57 ` Kyle Hendry via B4 Relay
(?)
(?)
@ 2026-11-20 17:58 ` sashiko-bot
-1 siblings, 0 replies; 27+ messages in thread
From: sashiko-bot @ 2026-11-20 17:58 UTC (permalink / raw)
To: Kyle Hendry; +Cc: linux-clk, devicetree, robh, conor+dt, wsa+renesas
Thank you for your contribution! Sashiko AI review found 4 potential
issues to consider:
- [High] ARM: dts: renesas: r9a06g032: 1-based reset IDs mismatch
0-based reset table
- [High] clk: renesas: r9a06g032: missing rcdev member in struct
r9a06g032_priv
- [Medium] clk: renesas: r9a06g032: inverted polarity in
r9a06g032_reset() and status
- [Medium] clk: renesas: r9a06g032: dangling sysctrl_priv on reset
register error
--
commit 37a9aace6321173b9dddf5f8ccba42dd97dee222
Author: Kyle Hendry <khendry@reliablecontrols.com>
ARM: dts: renesas: r9a06g032: Add resets to mii converter
This commit adds the rst_ts and rst_miic reset references from the sysctrl
node to the eth_miic node in the r9a06g032 device tree.
> diff --git a/arch/arm/boot/dts/renesas/r9a06g032.dtsi b/arch/arm/boot/dts/renesas/r9a06g032.dtsi
> index f2bf087f7ad2e..0a538d9221254 100644
> --- a/arch/arm/boot/dts/renesas/r9a06g032.dtsi
> +++ b/arch/arm/boot/dts/renesas/r9a06g032.dtsi
> @@ -463,6 +463,9 @@ eth_miic: eth-miic@44030000 {
> <&sysctrl R9A06G032_CLK_RMII_REF>,
> <&sysctrl R9A06G032_HCLK_SWITCH_RG>;
> clock-names = "mii_ref", "rgmii_ref", "rmii_ref", "hclk";
> + resets = <&sysctrl R9A06G032_RST_TS>,
> + <&sysctrl R9A06G032_RST_MIIC>;
> + reset-names = "rst_ts", "rst_miic";
> power-domains = <&sysctrl>;
> status = "disabled";
>
[Severity: High]
Are R9A06G032_RST_TS and R9A06G032_RST_MIIC off by one relative to
r9a06g032_resets[]?
Commit "dt-bindings: clock: r9a06g032-sysctrl: Document reset cells"
defines R9A06G032_RST_TS as 1 and R9A06G032_RST_MIIC as 2, while commit
"clk: renesas: r9a06g032: Add reset controller" registers a 2-element
r9a06g032_resets[] array (indices 0 and 1) using the default 0-based
fwnode_reset_simple_xlate():
drivers/clk/renesas/r9a06g032-clocks.c:
static const struct regbit r9a06g032_resets[] = {
RB(0x188, 3),
RB(0x188, 4),
};
When miic_probe() requests these resets, rst_ts (1) targets index 1
(RB(0x188, 4), the MII converter reset) instead of index 0 (RB(0x188, 3),
the timestamp reset), and rst_miic (2) fails translation with -EINVAL
because 2 >= nr_resets.
[Severity: High]
Does commit "clk: renesas: r9a06g032: Add reset controller" fail to
compile because struct r9a06g032_priv has no rcdev member?
Both rcdev_to_priv() and r9a06g032_clocks_probe() access clocks->rcdev to
register the sysctrl reset controller referenced here, but struct
r9a06g032_priv only defines data, lock, and reg.
[Severity: Medium]
In the sysctrl reset provider added by commit "clk: renesas: r9a06g032:
Add reset controller", are the reset polarity and status inverted in
r9a06g032_reset() and r9a06g032_reset_status()?
drivers/clk/renesas/r9a06g032-clocks.c:r9a06g032_reset() {
r9a06g032_reset_set(rcdev, "reset", true, id);
udelay(5);
return r9a06g032_reset_set(rcdev, NULL, false, id);
}
The reset bits in PWRCTRL_SWITCHCTRL are active-low (r9a06g032_reset_assert()
passes false and r9a06g032_reset_deassert() passes true). Calling
r9a06g032_reset() deasserts the line and then asserts it, leaving the
peripheral held in reset. Likewise, r9a06g032_reset_status() returns
clk_rdesc_get() directly, which returns 1 when deasserted and 0 when
asserted, opposite to the reset_control_status() contract.
[Severity: Medium]
In commit "clk: renesas: r9a06g032: Add reset controller", what happens if
devm_reset_controller_register() fails at the end of
r9a06g032_clocks_probe()?
drivers/clk/renesas/r9a06g032-clocks.c:r9a06g032_clocks_probe() {
...
sysctrl_priv = clocks;
error = of_platform_populate(np, NULL, NULL, dev);
if (error)
dev_err(dev, "Failed to populate children (%d)\n", error);
clocks->rcdev.ops = &r9a06g032_reset_ops;
clocks->rcdev.of_node = np;
clocks->rcdev.of_reset_n_cells = 1;
clocks->rcdev.nr_resets = ARRAY_SIZE(r9a06g032_resets);
error = devm_reset_controller_register(dev, &clocks->rcdev);
if (error)
return error;
...
}
Returning an error after r9a06g032_add_clk_domain(), sysctrl_priv
assignment, and of_platform_populate() leaves global sysctrl_priv and the
registered OF genpd provider pointing to devm-freed memory, and leaves
populated child platform devices behind. Also, calling
of_platform_populate() before devm_reset_controller_register() means child
devices probing during populate cannot look up the reset controller yet.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261119-rzn1-miic-resets-v1-0-feee2bb28bb4@reliablecontrols.com?part=6
^ permalink raw reply [flat|nested] 27+ messages in thread
end of thread, other threads:[~2026-11-20 17:58 UTC | newest]
Thread overview: 27+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-19 17:57 [PATCH 0/6] clk: renesas: r9a06g032: Add reset controller to clear resets for mii converter Kyle Hendry
2026-11-19 17:57 ` Kyle Hendry via B4 Relay
2026-11-19 17:57 ` [PATCH 1/6] dt-bindings: clock: r9a06g032-sysctrl: Document reset cells Kyle Hendry
2026-11-19 17:57 ` Kyle Hendry via B4 Relay
2026-11-20 9:23 ` Wolfram Sang
2026-11-20 9:51 ` Philipp Zabel
2026-11-20 11:11 ` Wolfram Sang
2026-11-19 17:57 ` [PATCH 2/6] clk: renesas: r9a06g032: Add reset controller Kyle Hendry
2026-11-19 17:57 ` Kyle Hendry via B4 Relay
2026-11-20 9:30 ` Wolfram Sang
2026-11-20 10:00 ` Philipp Zabel
2026-11-20 11:47 ` Wolfram Sang
2026-11-20 17:58 ` sashiko-bot
2026-11-19 17:57 ` [PATCH 3/6] ARM: dts: renesas: r9a06g032: Add #reset-cells to system controller node Kyle Hendry
2026-11-19 17:57 ` Kyle Hendry via B4 Relay
2026-11-20 9:32 ` Wolfram Sang
2026-11-19 17:57 ` [PATCH 4/6] dt-bindings: net: pcs: renesas,rzn1-miic: Document rzn1 resets Kyle Hendry
2026-11-19 17:57 ` Kyle Hendry via B4 Relay
2026-11-20 11:49 ` Wolfram Sang
2026-11-19 17:57 ` [PATCH 5/6] net: pcs: rzn1-miic: Add resets to rzn1 info structure Kyle Hendry
2026-11-19 17:57 ` Kyle Hendry via B4 Relay
2026-11-20 17:58 ` sashiko-bot
2026-11-19 17:57 ` [PATCH 6/6] ARM: dts: renesas: r9a06g032: Add resets to mii converter Kyle Hendry
2026-11-19 17:57 ` Kyle Hendry via B4 Relay
2026-11-20 9:34 ` Wolfram Sang
2026-11-20 17:58 ` sashiko-bot
2026-11-19 22:02 ` [PATCH 0/6] clk: renesas: r9a06g032: Add reset controller to clear resets for " Jakub Kicinski
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.