linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/4] Add RZ/A1 and RZ/A2 support to the rpc-if driver
@ 2025-07-12 13:39 Magnus Damm
  2025-07-12 13:39 ` [PATCH v2 1/4] dt-bindings: memory-controllers: renesas,rpc-if: Add RZ/A1 and RZ/A2 compat strings Magnus Damm
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Magnus Damm @ 2025-07-12 13:39 UTC (permalink / raw)
  To: linux-renesas-soc
  Cc: robh, Magnus Damm, geert+renesas, devicetree, conor+dt, krzk,
	linux-kernel, wsa+renesas, sergei.shtylyov, p.zabel

Add RZ/A1 and RZ/A2 support to the rpc-if driver (v2)

[PATCH v2 1/4] dt-bindings: memory-controllers: renesas,rpc-if: Add RZ/A1 and RZ/A2 compat strings
[PATCH v2 2/4] ARM: dts: renesas: r7s72100: add rpc-if nodes
[PATCH v2 3/4] ARM: dts: renesas: r7s9210: add rpc-if node
[PATCH v2 3/4] memory: renesas-rpc-if: Add RZ/A1 and RZ/A2 support

Document new rpc-if compat strings for RZ/A1 and RZ/A2, add rpc-if nodes
to RZ/A1 and RZ/A2 DT files and add support to the driver. The reset
controller is made optional since RZ/A1 hardware comes without reset bits.

These DT bindings and SoC DT files are also used by U-Boot. The patches
have been checked against checkpatch.pl and the CC list is taken from the
get_maintainers.pl script. I have not run any scripts to check on
the validity of the DT binding documentation change or new DT nodes.

The patches have no ordering requirements, feel free to pick up part
of this series and/or ask me to rework and resend.

Signed-off-by: Magnus Damm <damm@opensource.se>
---

 Previous verison posted as:
  [PATCH 0/6] Add rpc-if to RZ/A1, RZ/A2 and update/add board support

 Changes since v1:
 - Added reg-names to the rpc-if nodes in r7s72100.dtsi and r7s9210.dtsi
 - Moved the compat strings to keep sort order in the DT binding doc
 - Added driver code that makes use of the new bindings
 - Dropped board code

 Applies to next-20250710

 Documentation/devicetree/bindings/memory-controllers/renesas,rpc-if.yaml |    5 ++
 arch/arm/boot/dts/renesas/r7s72100.dtsi                                  |   24 ++++++++++
 arch/arm/boot/dts/renesas/r7s9210.dtsi                                   |   13 +++++
 drivers/memory/renesas-rpc-if.c                                          |   15 +++++-
 include/memory/renesas-rpc-if.h                                          |    1 


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH v2 1/4] dt-bindings: memory-controllers: renesas,rpc-if: Add RZ/A1 and RZ/A2 compat strings
  2025-07-12 13:39 [PATCH v2 0/4] Add RZ/A1 and RZ/A2 support to the rpc-if driver Magnus Damm
@ 2025-07-12 13:39 ` Magnus Damm
  2025-07-12 16:45   ` Krzysztof Kozlowski
  2025-07-12 19:06   ` Rob Herring (Arm)
  2025-07-12 13:39 ` [PATCH v2 2/4] ARM: dts: renesas: r7s72100: add rpc-if nodes Magnus Damm
                   ` (2 subsequent siblings)
  3 siblings, 2 replies; 9+ messages in thread
From: Magnus Damm @ 2025-07-12 13:39 UTC (permalink / raw)
  To: linux-renesas-soc
  Cc: robh, Magnus Damm, geert+renesas, devicetree, conor+dt, krzk,
	linux-kernel, wsa+renesas, sergei.shtylyov, p.zabel

From: Magnus Damm <damm@opensource.se>

Add RZ/A1 and RZ/A2 compat strings for the renesas rpc-if device.

Signed-off-by: Magnus Damm <damm@opensource.se>
---

 Changes since v1:
 - Moved RZ/A to top of RZ

 Applies to next-20250710

 Documentation/devicetree/bindings/memory-controllers/renesas,rpc-if.yaml |    5 +++++
 1 file changed, 5 insertions(+)

--- 0001/Documentation/devicetree/bindings/memory-controllers/renesas,rpc-if.yaml
+++ work/Documentation/devicetree/bindings/memory-controllers/renesas,rpc-if.yaml	2025-07-11 04:50:41.505855241 +0900
@@ -50,6 +50,11 @@ properties:
 
       - items:
           - enum:
+	      - renesas,r7s72100-rpc-if       # RZ/A1H
+	      - renesas,r7s9210-rpc-if        # RZ/A2M
+
+      - items:
+          - enum:
               - renesas,r9a07g043-rpc-if      # RZ/G2UL
               - renesas,r9a07g044-rpc-if      # RZ/G2{L,LC}
               - renesas,r9a07g054-rpc-if      # RZ/V2L

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH v2 2/4] ARM: dts: renesas: r7s72100: add rpc-if nodes
  2025-07-12 13:39 [PATCH v2 0/4] Add RZ/A1 and RZ/A2 support to the rpc-if driver Magnus Damm
  2025-07-12 13:39 ` [PATCH v2 1/4] dt-bindings: memory-controllers: renesas,rpc-if: Add RZ/A1 and RZ/A2 compat strings Magnus Damm
@ 2025-07-12 13:39 ` Magnus Damm
  2025-07-12 13:39 ` [PATCH v2 3/4] ARM: dts: renesas: r7s9210: add rpc-if node Magnus Damm
  2025-07-12 13:39 ` [PATCH v2 3/4] memory: renesas-rpc-if: Add RZ/A1 and RZ/A2 support Magnus Damm
  3 siblings, 0 replies; 9+ messages in thread
From: Magnus Damm @ 2025-07-12 13:39 UTC (permalink / raw)
  To: linux-renesas-soc
  Cc: robh, Magnus Damm, geert+renesas, devicetree, conor+dt, krzk,
	linux-kernel, wsa+renesas, sergei.shtylyov, p.zabel

From: Magnus Damm <damm@opensource.se>

Add two on-chip rpc-if devices to r7s72100 (RZ/A1H). These devices tend to
interface to one or more on-board SPI / Hyper / Octo flash devices.

Signed-off-by: Magnus Damm <damm@opensource.se>
---

 Changes since V1:
 - Added reg-names

 Applies to next-20250710

 arch/arm/boot/dts/renesas/r7s72100.dtsi |   24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)
 
--- 0001/arch/arm/boot/dts/renesas/r7s72100.dtsi
+++ work/arch/arm/boot/dts/renesas/r7s72100.dtsi	2025-07-11 04:05:21.133946837 +0900
@@ -315,6 +315,30 @@
 			status = "disabled";
 		};
 
+		rpc0: spi@3fefa000 {
+			compatible = "renesas,r7s72100-rpc-if";
+			reg = <0x3fefa000 0x100>, <0x18000000 0x04000000>;
+			reg-names = "regs", "dirmap";
+			clocks = <&mstp9_clks R7S72100_CLK_SPIBSC0>;
+			power-domains = <&cpg_clocks>;
+			num-cs = <1>;
+			#address-cells = <1>;
+			#size-cells = <0>;
+			status = "disabled";
+		};
+
+		rpc1: spi@3fefb000 {
+			compatible = "renesas,r7s72100-rpc-if";
+			reg = <0x3fefb000 0x100>, <0x1c000000 0x04000000>;
+			reg-names = "regs", "dirmap";
+			clocks = <&mstp9_clks R7S72100_CLK_SPIBSC1>;
+			power-domains = <&cpg_clocks>;
+			num-cs = <1>;
+			#address-cells = <1>;
+			#size-cells = <0>;
+			status = "disabled";
+		};
+
 		usbhs0: usb@e8010000 {
 			compatible = "renesas,usbhs-r7s72100", "renesas,rza1-usbhs";
 			reg = <0xe8010000 0x1a0>;

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH v2 3/4] ARM: dts: renesas: r7s9210: add rpc-if node
  2025-07-12 13:39 [PATCH v2 0/4] Add RZ/A1 and RZ/A2 support to the rpc-if driver Magnus Damm
  2025-07-12 13:39 ` [PATCH v2 1/4] dt-bindings: memory-controllers: renesas,rpc-if: Add RZ/A1 and RZ/A2 compat strings Magnus Damm
  2025-07-12 13:39 ` [PATCH v2 2/4] ARM: dts: renesas: r7s72100: add rpc-if nodes Magnus Damm
@ 2025-07-12 13:39 ` Magnus Damm
  2025-07-12 13:39 ` [PATCH v2 3/4] memory: renesas-rpc-if: Add RZ/A1 and RZ/A2 support Magnus Damm
  3 siblings, 0 replies; 9+ messages in thread
From: Magnus Damm @ 2025-07-12 13:39 UTC (permalink / raw)
  To: linux-renesas-soc
  Cc: robh, Magnus Damm, geert+renesas, devicetree, conor+dt, krzk,
	linux-kernel, wsa+renesas, sergei.shtylyov, p.zabel

From: Magnus Damm <damm@opensource.se>

Add one on-chip rpc-if device to r7s9210 (RZ/A2M). This kind of device tends
to interface to one or more on-board SPI / Hyper / Octo flash devices.

Signed-off-by: Magnus Damm <damm@opensource.se>
---

 Changes since V1:
 - Added reg-names

 Applies to next-20250710

 arch/arm/boot/dts/renesas/r7s9210.dtsi |   13 +++++++++++++
 1 file changed, 13 insertions(+)

--- 0001/arch/arm/boot/dts/renesas/r7s9210.dtsi
+++ work/arch/arm/boot/dts/renesas/r7s9210.dtsi	2025-07-11 04:26:10.383216792 +0900
@@ -198,6 +198,19 @@
 			status = "disabled";
 		};
 
+		rpc0: spi@1f800000 {
+			compatible = "renesas,r7s9210-rpc-if";
+			reg = <0x1f800000 0x100>, <0x20000000 0x10000000>;
+			reg-names = "regs", "dirmap";
+			interrupts = <GIC_SPI 445 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&cpg CPG_MOD 83>;
+			power-domains = <&cpg>;
+			num-cs = <1>;
+			#address-cells = <1>;
+			#size-cells = <0>;
+			status = "disabled";
+		};
+
 		ether0: ethernet@e8204000 {
 			compatible = "renesas,ether-r7s9210";
 			reg = <0xe8204000 0x200>;

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH v2 3/4] memory: renesas-rpc-if: Add RZ/A1 and RZ/A2 support
  2025-07-12 13:39 [PATCH v2 0/4] Add RZ/A1 and RZ/A2 support to the rpc-if driver Magnus Damm
                   ` (2 preceding siblings ...)
  2025-07-12 13:39 ` [PATCH v2 3/4] ARM: dts: renesas: r7s9210: add rpc-if node Magnus Damm
@ 2025-07-12 13:39 ` Magnus Damm
  2025-07-12 16:48   ` Krzysztof Kozlowski
  2025-07-30 13:24   ` Geert Uytterhoeven
  3 siblings, 2 replies; 9+ messages in thread
From: Magnus Damm @ 2025-07-12 13:39 UTC (permalink / raw)
  To: linux-renesas-soc
  Cc: robh, Magnus Damm, geert+renesas, devicetree, conor+dt, krzk,
	linux-kernel, wsa+renesas, sergei.shtylyov, p.zabel

From: Magnus Damm <damm@opensource.se>

Add RZ/A1 and RZ/A2 compat strings to the rpc-if driver. Also make the
reset controller optional. This is because RZ/A1 does not have any reset
bits assigned to the device so there is no reset controller available.

Signed-off-by: Magnus Damm <damm@opensource.se>
---

 Changes since v1:
 - New patch

 Applies to next-20250710

 drivers/memory/renesas-rpc-if.c |   15 ++++++++++++---
 include/memory/renesas-rpc-if.h |    1 +
 2 files changed, 13 insertions(+), 3 deletions(-)

--- 0001/drivers/memory/renesas-rpc-if.c
+++ work/drivers/memory/renesas-rpc-if.c	2025-07-11 03:45:25.605098312 +0900
@@ -234,7 +234,7 @@ static int rpcif_hw_init_impl(struct rpc
 	int ret;
 
 	if (rpc->info->type == RPCIF_RZ_G2L) {
-		ret = reset_control_reset(rpc->rstc);
+		ret = rpc->rstc ? reset_control_reset(rpc->rstc) : 0;
 		if (ret)
 			return ret;
 		usleep_range(200, 300);
@@ -614,7 +614,7 @@ static int rpcif_manual_xfer_impl(struct
 	return ret;
 
 err_out:
-	if (reset_control_reset(rpc->rstc))
+	if (rpc->rstc && reset_control_reset(rpc->rstc))
 		dev_err(rpc->dev, "Failed to reset HW\n");
 	rpcif_hw_init_impl(rpc, rpc->bus_size == 2);
 	return ret;
@@ -1017,7 +1017,7 @@ static int rpcif_probe(struct platform_d
 	rpc->size = resource_size(res);
 	rpc->rstc = devm_reset_control_array_get_exclusive(dev);
 	if (IS_ERR(rpc->rstc))
-		return PTR_ERR(rpc->rstc);
+		rpc->rstc = NULL;
 
 	/*
 	 * The enabling/disabling of spi/spix2 clocks at runtime leading to
@@ -1115,7 +1115,16 @@ static const struct rpcif_info xspi_info
 	.type = XSPI_RZ_G3E,
 };
 
+static const struct rpcif_info rpcif_info_rz_a = {
+	.regmap_config = &rpcif_regmap_config,
+	.impl = &rpcif_impl,
+	.type = RPCIF_RZ_A,
+	.strtim = 7,
+};
+
 static const struct of_device_id rpcif_of_match[] = {
+	{ .compatible = "renesas,r7s72100-rpc-if", .data = &rpcif_info_rz_a },
+	{ .compatible = "renesas,r7s9210-rpc-if", .data = &rpcif_info_rz_a },
 	{ .compatible = "renesas,r8a7796-rpc-if", .data = &rpcif_info_r8a7796 },
 	{ .compatible = "renesas,r9a09g047-xspi", .data = &xspi_info_r9a09g047 },
 	{ .compatible = "renesas,rcar-gen3-rpc-if", .data = &rpcif_info_gen3 },
--- 0001/include/memory/renesas-rpc-if.h
+++ work/include/memory/renesas-rpc-if.h	2025-07-11 03:38:33.472749814 +0900
@@ -62,6 +62,7 @@ enum rpcif_type {
 	RPCIF_RCAR_GEN4,
 	RPCIF_RZ_G2L,
 	XSPI_RZ_G3E,
+	RPCIF_RZ_A,
 };
 
 struct rpcif {

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v2 1/4] dt-bindings: memory-controllers: renesas,rpc-if: Add RZ/A1 and RZ/A2 compat strings
  2025-07-12 13:39 ` [PATCH v2 1/4] dt-bindings: memory-controllers: renesas,rpc-if: Add RZ/A1 and RZ/A2 compat strings Magnus Damm
@ 2025-07-12 16:45   ` Krzysztof Kozlowski
  2025-07-12 19:06   ` Rob Herring (Arm)
  1 sibling, 0 replies; 9+ messages in thread
From: Krzysztof Kozlowski @ 2025-07-12 16:45 UTC (permalink / raw)
  To: Magnus Damm, linux-renesas-soc
  Cc: robh, geert+renesas, devicetree, conor+dt, linux-kernel,
	wsa+renesas, sergei.shtylyov, p.zabel

On 12/07/2025 15:39, Magnus Damm wrote:
> From: Magnus Damm <damm@opensource.se>
> 
> Add RZ/A1 and RZ/A2 compat strings for the renesas rpc-if device.
> 
> Signed-off-by: Magnus Damm <damm@opensource.se>
> ---
> 
>  Changes since v1:
>  - Moved RZ/A to top of RZ
> 
>  Applies to next-20250710
> 
>  Documentation/devicetree/bindings/memory-controllers/renesas,rpc-if.yaml |    5 +++++
>  1 file changed, 5 insertions(+)
> 
> --- 0001/Documentation/devicetree/bindings/memory-controllers/renesas,rpc-if.yaml
> +++ work/Documentation/devicetree/bindings/memory-controllers/renesas,rpc-if.yaml	2025-07-11 04:50:41.505855241 +0900
> @@ -50,6 +50,11 @@ properties:
>  
>        - items:
>            - enum:
> +	      - renesas,r7s72100-rpc-if       # RZ/A1H
> +	      - renesas,r7s9210-rpc-if        # RZ/A2M

Still not tested.

You got extensive guideline from me last time. You just replied (in
private!) that you are not going to install dtschema and test it.

Fine if you send correct code.

Not fine if you write buggy code. And this is obviously the case here as
easily visible in the diff above - borken indentation.

Please read carefully previous instructions.

Best regards,
Krzysztof

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v2 3/4] memory: renesas-rpc-if: Add RZ/A1 and RZ/A2 support
  2025-07-12 13:39 ` [PATCH v2 3/4] memory: renesas-rpc-if: Add RZ/A1 and RZ/A2 support Magnus Damm
@ 2025-07-12 16:48   ` Krzysztof Kozlowski
  2025-07-30 13:24   ` Geert Uytterhoeven
  1 sibling, 0 replies; 9+ messages in thread
From: Krzysztof Kozlowski @ 2025-07-12 16:48 UTC (permalink / raw)
  To: Magnus Damm, linux-renesas-soc
  Cc: robh, geert+renesas, devicetree, conor+dt, linux-kernel,
	wsa+renesas, sergei.shtylyov, p.zabel

On 12/07/2025 15:39, Magnus Damm wrote:
> From: Magnus Damm <damm@opensource.se>
> 
> Add RZ/A1 and RZ/A2 compat strings to the rpc-if driver. Also make the
> reset controller optional. This is because RZ/A1 does not have any reset
> bits assigned to the device so there is no reset controller available.

That's different ABI and if you tested bindings, you would see warnings.
My previous instruction was really important so I am disappointed that
you replied that you are not going to test bindings or your DTS patches.

Fix the bindings.

> +
>  static const struct of_device_id rpcif_of_match[] = {
> +	{ .compatible = "renesas,r7s72100-rpc-if", .data = &rpcif_info_rz_a },
> +	{ .compatible = "renesas,r7s9210-rpc-if", .data = &rpcif_info_rz_a },

So devices are compatible. Express it with proper fallbacks and don't
create redundant entries.

Or explain in the binding WHY they are not compatible.

Best regards,
Krzysztof

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v2 1/4] dt-bindings: memory-controllers: renesas,rpc-if: Add RZ/A1 and RZ/A2 compat strings
  2025-07-12 13:39 ` [PATCH v2 1/4] dt-bindings: memory-controllers: renesas,rpc-if: Add RZ/A1 and RZ/A2 compat strings Magnus Damm
  2025-07-12 16:45   ` Krzysztof Kozlowski
@ 2025-07-12 19:06   ` Rob Herring (Arm)
  1 sibling, 0 replies; 9+ messages in thread
From: Rob Herring (Arm) @ 2025-07-12 19:06 UTC (permalink / raw)
  To: Magnus Damm
  Cc: linux-kernel, wsa+renesas, devicetree, geert+renesas, p.zabel,
	krzk, linux-renesas-soc, sergei.shtylyov, conor+dt


On Sat, 12 Jul 2025 15:39:27 +0200, Magnus Damm wrote:
> From: Magnus Damm <damm@opensource.se>
> 
> Add RZ/A1 and RZ/A2 compat strings for the renesas rpc-if device.
> 
> Signed-off-by: Magnus Damm <damm@opensource.se>
> ---
> 
>  Changes since v1:
>  - Moved RZ/A to top of RZ
> 
>  Applies to next-20250710
> 
>  Documentation/devicetree/bindings/memory-controllers/renesas,rpc-if.yaml |    5 +++++
>  1 file changed, 5 insertions(+)
> 
> --- 0001/Documentation/devicetree/bindings/memory-controllers/renesas,rpc-if.yaml
> +++ work/Documentation/devicetree/bindings/memory-controllers/renesas,rpc-if.yaml	2025-07-11 04:50:41.505855241 +0900
> @@ -50,6 +50,11 @@ properties:
> 
>        - items:
>            - enum:
> +	      - renesas,r7s72100-rpc-if       # RZ/A1H
> +	      - renesas,r7s9210-rpc-if        # RZ/A2M
> +
> +      - items:
> +          - enum:
>                - renesas,r9a07g043-rpc-if      # RZ/G2UL
>                - renesas,r9a07g044-rpc-if      # RZ/G2{L,LC}
>                - renesas,r9a07g054-rpc-if      # RZ/V2L
> 
> 

My bot found errors running 'make dt_binding_check' on your patch:

yamllint warnings/errors:
./Documentation/devicetree/bindings/memory-controllers/renesas,rpc-if.yaml:53:1: [error] syntax error: found character '\t' that cannot start any token (syntax)

dtschema/dtc warnings/errors:
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/memory-controllers/renesas,rpc-if.yaml: ignoring, error parsing file
./Documentation/devicetree/bindings/memory-controllers/renesas,rpc-if.yaml:53:1: found character that cannot start any token
make[2]: *** Deleting file 'Documentation/devicetree/bindings/memory-controllers/renesas,rpc-if.example.dts'
Documentation/devicetree/bindings/memory-controllers/renesas,rpc-if.yaml:53:1: found character that cannot start any token
make[2]: *** [Documentation/devicetree/bindings/Makefile:26: Documentation/devicetree/bindings/memory-controllers/renesas,rpc-if.example.dts] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [/builds/robherring/dt-review-ci/linux/Makefile:1525: dt_binding_check] Error 2
make: *** [Makefile:248: __sub-make] Error 2

doc reference errors (make refcheckdocs):

See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/175232756792.19062.3922882730162396395.sendpatchset@1.0.0.127.in-addr.arpa

The base for the series is generally the latest rc1. A different dependency
should be noted in *this* patch.

If you already ran 'make dt_binding_check' and didn't see the above
error(s), then make sure 'yamllint' is installed and dt-schema is up to
date:

pip3 install dtschema --upgrade

Please check and re-submit after running the above command yourself. Note
that DT_SCHEMA_FILES can be set to your schema file to speed up checking
your schema. However, it must be unset to test all examples with your schema.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v2 3/4] memory: renesas-rpc-if: Add RZ/A1 and RZ/A2 support
  2025-07-12 13:39 ` [PATCH v2 3/4] memory: renesas-rpc-if: Add RZ/A1 and RZ/A2 support Magnus Damm
  2025-07-12 16:48   ` Krzysztof Kozlowski
@ 2025-07-30 13:24   ` Geert Uytterhoeven
  1 sibling, 0 replies; 9+ messages in thread
From: Geert Uytterhoeven @ 2025-07-30 13:24 UTC (permalink / raw)
  To: Magnus Damm
  Cc: linux-renesas-soc, robh, geert+renesas, devicetree, conor+dt,
	krzk, linux-kernel, wsa+renesas, sergei.shtylyov, p.zabel

Hi Magnus,

On Sat, 12 Jul 2025 at 15:39, Magnus Damm <damm@opensource.se> wrote:
> From: Magnus Damm <damm@opensource.se>
>
> Add RZ/A1 and RZ/A2 compat strings to the rpc-if driver. Also make the
> reset controller optional. This is because RZ/A1 does not have any reset
> bits assigned to the device so there is no reset controller available.
>
> Signed-off-by: Magnus Damm <damm@opensource.se>

Thanks for your patch!

> --- 0001/drivers/memory/renesas-rpc-if.c
> +++ work/drivers/memory/renesas-rpc-if.c        2025-07-11 03:45:25.605098312 +0900
> @@ -234,7 +234,7 @@ static int rpcif_hw_init_impl(struct rpc
>         int ret;
>
>         if (rpc->info->type == RPCIF_RZ_G2L) {
> -               ret = reset_control_reset(rpc->rstc);
> +               ret = rpc->rstc ? reset_control_reset(rpc->rstc) : 0;

No need for this, as reset_control_reset() does nothing in case
an optional reset is not present.

>                 if (ret)
>                         return ret;
>                 usleep_range(200, 300);
> @@ -614,7 +614,7 @@ static int rpcif_manual_xfer_impl(struct
>         return ret;
>
>  err_out:
> -       if (reset_control_reset(rpc->rstc))
> +       if (rpc->rstc && reset_control_reset(rpc->rstc))

Likewise.

>                 dev_err(rpc->dev, "Failed to reset HW\n");
>         rpcif_hw_init_impl(rpc, rpc->bus_size == 2);
>         return ret;
> @@ -1017,7 +1017,7 @@ static int rpcif_probe(struct platform_d
>         rpc->size = resource_size(res);
>         rpc->rstc = devm_reset_control_array_get_exclusive(dev);
>         if (IS_ERR(rpc->rstc))
> -               return PTR_ERR(rpc->rstc);
> +               rpc->rstc = NULL;

Errors should be propagated correctly, also for probe deferral.
devm_reset_control_array_get_optional_exclusive() is what you are
looking for. You can enforce the presence of the resets where needed
through the DT bindings.

>
>         /*
>          * The enabling/disabling of spi/spix2 clocks at runtime leading to


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] 9+ messages in thread

end of thread, other threads:[~2025-07-30 13:24 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-12 13:39 [PATCH v2 0/4] Add RZ/A1 and RZ/A2 support to the rpc-if driver Magnus Damm
2025-07-12 13:39 ` [PATCH v2 1/4] dt-bindings: memory-controllers: renesas,rpc-if: Add RZ/A1 and RZ/A2 compat strings Magnus Damm
2025-07-12 16:45   ` Krzysztof Kozlowski
2025-07-12 19:06   ` Rob Herring (Arm)
2025-07-12 13:39 ` [PATCH v2 2/4] ARM: dts: renesas: r7s72100: add rpc-if nodes Magnus Damm
2025-07-12 13:39 ` [PATCH v2 3/4] ARM: dts: renesas: r7s9210: add rpc-if node Magnus Damm
2025-07-12 13:39 ` [PATCH v2 3/4] memory: renesas-rpc-if: Add RZ/A1 and RZ/A2 support Magnus Damm
2025-07-12 16:48   ` Krzysztof Kozlowski
2025-07-30 13:24   ` Geert Uytterhoeven

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).