devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/2] Add usb gadget support for RZ/V2M
@ 2022-08-04 19:22 Phil Edworthy
  2022-08-04 19:22 ` [PATCH v3 1/2] dt-bindings: usb: renesas, usb3-peri: Document RZ/V2M r9a09g011 support Phil Edworthy
  0 siblings, 1 reply; 3+ messages in thread
From: Phil Edworthy @ 2022-08-04 19:22 UTC (permalink / raw)
  To: Felipe Balbi, Philipp Zabel, Rob Herring, Krzysztof Kozlowski
  Cc: Phil Edworthy, Greg Kroah-Hartman, Geert Uytterhoeven,
	Yoshihiro Shimoda, Biju Das, Adam Ford, linux-usb, devicetree,
	linux-renesas-soc

Hi,

The RZ/V2M SoC is very similar to the R-Car implementation.
The differences are that a few DRD related registers and bits have
moved, there is a separate interrupt for DRD, an additional clock for
register access and reset lines for DRD and USBP.

Thanks
Phil

v3:
bindings:
 - Keep the existing constraints by adding an 'else' clause with
   'maxItems: 1' for various properties.
driver:
 - The ramsize_per_ramif specifies the amount of ram for
   IN _or_ OUT pipes, not combined, so it should be 16KB.
 - When changing role, ensure only one of host/perip reset is deasserted
 - Correct number of pipes to 16. The driver will calculate the nr
   of pipes to use based on the available ram and ramsize_per_pipe.

v2:
bindings:
 - SoCs other than rz/v2m must limit the number of clock/interrupt names
 - Add "Battery Charging" and "Global Purpose Input" interrupts
driver:
 - Rename r9a09g011 feature to is_rzv2m; use rzv2m compat string
 - Pass pointer into macros that access is_rzv2m member

Phil Edworthy (2):
  dt-bindings: usb: renesas, usb3-peri: Document RZ/V2M r9a09g011
    support
  usb: gadget: udc: renesas_usb3: Add support for RZ/V2M

 .../bindings/usb/renesas,usb3-peri.yaml       |  99 +++++++++++--
 drivers/usb/gadget/udc/renesas_usb3.c         | 131 ++++++++++++++----
 2 files changed, 188 insertions(+), 42 deletions(-)

-- 
2.34.1


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

* [PATCH v3 1/2] dt-bindings: usb: renesas, usb3-peri: Document RZ/V2M r9a09g011 support
  2022-08-04 19:22 [PATCH v3 0/2] Add usb gadget support for RZ/V2M Phil Edworthy
@ 2022-08-04 19:22 ` Phil Edworthy
  2022-08-09 18:39   ` Rob Herring
  0 siblings, 1 reply; 3+ messages in thread
From: Phil Edworthy @ 2022-08-04 19:22 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski
  Cc: Phil Edworthy, Greg Kroah-Hartman, Yoshihiro Shimoda, linux-usb,
	devicetree, Geert Uytterhoeven, linux-renesas-soc, Biju Das

Document the RZ/V2M SoC bindings.
The RZ/V2M SoC is a little different to the R-Car implementations.
A few DRD related registers and bits have moved, there is a separate
interrupt for DRD, an additional clock for register access and reset
lines for DRD and USBP.

Signed-off-by: Phil Edworthy <phil.edworthy@renesas.com>
Reviewed-by: Biju Das <biju.das.jz@bp.renesas.com>
---
v3:
 - Keep the existing constraints by adding an 'else' clause with
   'maxItems: 1' for various properties.
v2:
 - SoCs other than rz/v2m must limit the number of clock/interrupt names
 - Add "Battery Charging" and "Global Purpose Input" interrupts
---
 .../bindings/usb/renesas,usb3-peri.yaml       | 99 ++++++++++++++++---
 1 file changed, 84 insertions(+), 15 deletions(-)

diff --git a/Documentation/devicetree/bindings/usb/renesas,usb3-peri.yaml b/Documentation/devicetree/bindings/usb/renesas,usb3-peri.yaml
index 9fcf54b10b07..55dfd121b555 100644
--- a/Documentation/devicetree/bindings/usb/renesas,usb3-peri.yaml
+++ b/Documentation/devicetree/bindings/usb/renesas,usb3-peri.yaml
@@ -11,27 +11,55 @@ maintainers:
 
 properties:
   compatible:
-    items:
-      - enum:
-          - renesas,r8a774a1-usb3-peri # RZ/G2M
-          - renesas,r8a774b1-usb3-peri # RZ/G2N
-          - renesas,r8a774c0-usb3-peri # RZ/G2E
-          - renesas,r8a774e1-usb3-peri # RZ/G2H
-          - renesas,r8a7795-usb3-peri  # R-Car H3
-          - renesas,r8a7796-usb3-peri  # R-Car M3-W
-          - renesas,r8a77961-usb3-peri # R-Car M3-W+
-          - renesas,r8a77965-usb3-peri # R-Car M3-N
-          - renesas,r8a77990-usb3-peri # R-Car E3
-      - const: renesas,rcar-gen3-usb3-peri
+    oneOf:
+      - items:
+          - enum:
+              - renesas,r8a774a1-usb3-peri # RZ/G2M
+              - renesas,r8a774b1-usb3-peri # RZ/G2N
+              - renesas,r8a774c0-usb3-peri # RZ/G2E
+              - renesas,r8a774e1-usb3-peri # RZ/G2H
+              - renesas,r8a7795-usb3-peri  # R-Car H3
+              - renesas,r8a7796-usb3-peri  # R-Car M3-W
+              - renesas,r8a77961-usb3-peri # R-Car M3-W+
+              - renesas,r8a77965-usb3-peri # R-Car M3-N
+              - renesas,r8a77990-usb3-peri # R-Car E3
+          - const: renesas,rcar-gen3-usb3-peri
+
+      - items:
+          - enum:
+              - renesas,r9a09g011-usb3-peri # RZ/V2M
+          - const: renesas,rzv2m-usb3-peri
 
   reg:
     maxItems: 1
 
   interrupts:
-    maxItems: 1
+    minItems: 1
+    items:
+      - description: Combined interrupt for DMA, SYS and ERR
+      - description: Dual Role Device (DRD)
+      - description: Battery Charging
+      - description: Global Purpose Input
+
+  interrupt-names:
+    minItems: 1
+    items:
+      - const: all_p
+      - const: drd
+      - const: bc
+      - const: gpi
 
   clocks:
-    maxItems: 1
+    minItems: 1
+    items:
+      - description: Main clock
+      - description: Register access clock
+
+  clock-names:
+    minItems: 1
+    items:
+      - const: aclk
+      - const: reg
 
   phys:
     maxItems: 1
@@ -43,7 +71,15 @@ properties:
     maxItems: 1
 
   resets:
-    maxItems: 1
+    minItems: 1
+    items:
+      - description: Peripheral reset
+      - description: DRD reset
+
+  reset-names:
+    items:
+      - const: aresetn_p
+      - const: drd_reset
 
   usb-role-switch:
     $ref: /schemas/types.yaml#/definitions/flag
@@ -78,6 +114,39 @@ required:
   - interrupts
   - clocks
 
+allOf:
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - renesas,rzv2m-usb3-peri
+    then:
+      properties:
+        clocks:
+          minItems: 2
+        clock-names:
+          minItems: 2
+        interrupts:
+          minItems: 4
+        interrupt-names:
+          minItems: 4
+        resets:
+          minItems: 2
+      required:
+        - clock-names
+        - interrupt-names
+        - resets
+        - reset-names
+    else:
+      properties:
+        clocks:
+          maxItems: 1
+        interrupts:
+          maxItems: 1
+        resets:
+          maxItems: 1
+
 additionalProperties: false
 
 examples:
-- 
2.34.1


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

* Re: [PATCH v3 1/2] dt-bindings: usb: renesas, usb3-peri: Document RZ/V2M r9a09g011 support
  2022-08-04 19:22 ` [PATCH v3 1/2] dt-bindings: usb: renesas, usb3-peri: Document RZ/V2M r9a09g011 support Phil Edworthy
@ 2022-08-09 18:39   ` Rob Herring
  0 siblings, 0 replies; 3+ messages in thread
From: Rob Herring @ 2022-08-09 18:39 UTC (permalink / raw)
  To: Phil Edworthy
  Cc: Yoshihiro Shimoda, Biju Das, linux-usb, Geert Uytterhoeven,
	linux-renesas-soc, Greg Kroah-Hartman, Krzysztof Kozlowski,
	devicetree, Rob Herring

On Thu, 04 Aug 2022 20:22:19 +0100, Phil Edworthy wrote:
> Document the RZ/V2M SoC bindings.
> The RZ/V2M SoC is a little different to the R-Car implementations.
> A few DRD related registers and bits have moved, there is a separate
> interrupt for DRD, an additional clock for register access and reset
> lines for DRD and USBP.
> 
> Signed-off-by: Phil Edworthy <phil.edworthy@renesas.com>
> Reviewed-by: Biju Das <biju.das.jz@bp.renesas.com>
> ---
> v3:
>  - Keep the existing constraints by adding an 'else' clause with
>    'maxItems: 1' for various properties.
> v2:
>  - SoCs other than rz/v2m must limit the number of clock/interrupt names
>  - Add "Battery Charging" and "Global Purpose Input" interrupts
> ---
>  .../bindings/usb/renesas,usb3-peri.yaml       | 99 ++++++++++++++++---
>  1 file changed, 84 insertions(+), 15 deletions(-)
> 

Reviewed-by: Rob Herring <robh@kernel.org>

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

end of thread, other threads:[~2022-08-09 19:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-08-04 19:22 [PATCH v3 0/2] Add usb gadget support for RZ/V2M Phil Edworthy
2022-08-04 19:22 ` [PATCH v3 1/2] dt-bindings: usb: renesas, usb3-peri: Document RZ/V2M r9a09g011 support Phil Edworthy
2022-08-09 18:39   ` Rob Herring

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).