Add HSUSB to r8a7743
Subsystems (2)
cover Add HSUSB to r8a7743
Dear All,
this series backports all the patches necessary to add HSUSB support to the r8a7743.
Thanks,
Fabrizio
Biju Das (5):
usb: renesas_usbhs: Add compatible string for r8a7743/5
ARM: dts: r8a7743: Add HS-USB device node
ARM: dts: iwg20d-q7: Enable HS-USB
ARM: dts: r8a7743: Add USB-DMAC device nodes
ARM: dts: r8a7743: Enable DMA for HSUSB
Simon Horman (2):
usb: renesas_usbhs: add SoC names to compatibility string
documentation
usb: renesas_usbhs: add fallback compatibility strings
.../devicetree/bindings/usb/renesas_usbhs.txt | 22 ++++++++---- arch/arm/boot/dts/iwg20d-q7-common.dtsi | 7 +++- arch/arm/boot/dts/r8a7743.dtsi | 40 ++++++++++++++++++++++ drivers/usb/renesas_usbhs/common.c | 9 +++++ 4 files changed, 71 insertions(+), 7 deletions(-)
Signature · 1 line
2.7.4
PATCH 1/7 usb: renesas_usbhs: add SoC names to compatibility string documentation
From: Simon Horman <[email protected]>
This extends the documentation of compatibility strings a little to include the SoC names.
--- Documentation/devicetree/bindings/usb/renesas_usbhs.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
Documentation/devicetree/bindings/usb/renesas_usbhs.txt +4 -4
@@ -2,10 +2,10 @@ Renesas Electronics USBHS driver Required properties: - compatible: Must contain one of the following: - - "renesas,usbhs-r8a7790" - - "renesas,usbhs-r8a7791" - - "renesas,usbhs-r8a7794" - - "renesas,usbhs-r8a7795" + - "renesas,usbhs-r8a7790" for r8a7790 (R-Car H2) compatible device + - "renesas,usbhs-r8a7791" for r8a7791 (R-Car M2-W) compatible device + - "renesas,usbhs-r8a7794" for r8a7794 (R-Car E2) compatible device + - "renesas,usbhs-r8a7795" for r8a7795 (R-Car H3) compatible device - reg: Base address and length of the register for the USBHS - interrupts: Interrupt specifier for the USBHS - clocks: A list of phandle + clock specifier pairs
Signature · 1 line
2.7.4
PATCH 2/7 usb: renesas_usbhs: add fallback compatibility strings
In reply to Fabrizio CastroFrom: Simon Horman <[email protected]>
Add fallback compatibility strings for R-Car Gen2 and Gen3. This is in keeping with the fallback scheme being adopted wherever appropriate for drivers for Renesas SoCs.
--- Documentation/devicetree/bindings/usb/renesas_usbhs.txt | 12 ++++++++++-- drivers/usb/renesas_usbhs/common.c | 9 +++++++++ 2 files changed, 19 insertions(+), 2 deletions(-)
Documentation/devicetree/bindings/usb/renesas_usbhs.txt +10 -2
@@ -1,11 +1,19 @@ Renesas Electronics USBHS driver Required properties: - - compatible: Must contain one of the following: + - compatible: Must contain one or more of the following: + - "renesas,usbhs-r8a7790" for r8a7790 (R-Car H2) compatible device - "renesas,usbhs-r8a7791" for r8a7791 (R-Car M2-W) compatible device - "renesas,usbhs-r8a7794" for r8a7794 (R-Car E2) compatible device - "renesas,usbhs-r8a7795" for r8a7795 (R-Car H3) compatible device + - "renesas,rcar-gen2-usbhs" for R-Car Gen2 compatible device + - "renesas,rcar-gen3-usbhs" for R-Car Gen3 compatible device + + When compatible with the generic version, nodes must list the + SoC-specific version corresponding to the platform first followed + by the generic version. + - reg: Base address and length of the register for the USBHS - interrupts: Interrupt specifier for the USBHS - clocks: A list of phandle + clock specifier pairs
@@ -22,7 +30,7 @@ Optional properties: Example: usbhs: usb at e6590000 { - compatible = "renesas,usbhs-r8a7790"; + compatible = "renesas,usbhs-r8a7790", "renesas,rcar-gen2-usbhs"; reg = <0 0xe6590000 0 0x100>; interrupts = <0 107 IRQ_TYPE_LEVEL_HIGH>; clocks = <&mstp7_clks R8A7790_CLK_HSUSB>;
drivers/usb/renesas_usbhs/common.c +9 -0
@@ -481,6 +481,15 @@ static const struct of_device_id usbhs_of_match[] = { .compatible = "renesas,usbhs-r8a7795", .data = (void *)USBHS_TYPE_RCAR_GEN2, }, + { + .compatible = "renesas,rcar-gen2-usbhs", + .data = (void *)USBHS_TYPE_RCAR_GEN2, + }, + { +/* Gen3 is compatible with Gen2 */ + .compatible = "renesas,rcar-gen3-usbhs", + .data = (void *)USBHS_TYPE_RCAR_GEN2, + }, { }, };MODULE_DEVICE_TABLE (of, usbhs_of_match);
Signature · 1 line
2.7.4
PATCH 3/7 usb: renesas_usbhs: Add compatible string for r8a7743/5
In reply to Fabrizio CastroFrom: Biju Das <[email protected]>
This patch adds support for r8a7743/5 SoCs. The Renesas RZ/G1[ME] (R8A7743/5) usbhs is identical to the R-Car Gen2 family.
No driver change is needed due to the fallback compatible value "renesas,rcar-gen2-usbhs".
Adding the SoC-specific compatible values here has two purposes:
1. Document which SoCs have this hardware module,
2. Allow checkpatch to validate compatible values.
--- Documentation/devicetree/bindings/usb/renesas_usbhs.txt | 2 ++ 1 file changed, 2 insertions(+)
Documentation/devicetree/bindings/usb/renesas_usbhs.txt +2 -0
@@ -3,6 +3,8 @@ Renesas Electronics USBHS driver Required properties: - compatible: Must contain one or more of the following: + - "renesas,usbhs-r8a7743" for r8a7743 (RZ/G1M) compatible device + - "renesas,usbhs-r8a7745" for r8a7745 (RZ/G1E) compatible device - "renesas,usbhs-r8a7790" for r8a7790 (R-Car H2) compatible device - "renesas,usbhs-r8a7791" for r8a7791 (R-Car M2-W) compatible device - "renesas,usbhs-r8a7794" for r8a7794 (R-Car E2) compatible device
Signature · 1 line
2.7.4
PATCH 4/7 ARM: dts: r8a7743: Add HS-USB device node
In reply to Fabrizio CastroFrom: Biju Das <[email protected]>
Define the R8A7743 generic part of the HS-USB device node. It is up to the board file to enable the device.
(modified clocks, power-domains properties and removed resets property)
--- arch/arm/boot/dts/r8a7743.dtsi | 13 +++++++++++++ 1 file changed, 13 insertions(+)
arch/arm/boot/dts/r8a7743.dtsi +13 -0
@@ -1185,6 +1185,19 @@ }; }; + hsusb: usb at e6590000 { + compatible = "renesas,usbhs-r8a7743", + "renesas,rcar-gen2-usbhs"; + reg = <0 0xe6590000 0 0x100>; + interrupts = <GIC_SPI 107 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&mstp7_clks R8A7743_CLK_HSUSB>; + power-domains = <&cpg_clocks>; + renesas,buswait = <4>; + phys = <&usb0 1>; + phy-names = "usb"; + status = "disabled"; + }; + usbphy: usb-phy at e6590100 { compatible = "renesas,usb-phy-r8a7743", "renesas,rcar-gen2-usb-phy";
Signature · 1 line
2.7.4
PATCH 5/7 ARM: dts: iwg20d-q7: Enable HS-USB
In reply to Fabrizio CastroFrom: Biju Das <[email protected]>
Enable HS-USB device for the iWave G20D-Q7 carrier board based on RZ/G1M.
Also disable the host mode support on usb otg port by default to avoid pin conflicts.
--- arch/arm/boot/dts/iwg20d-q7-common.dtsi | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
arch/arm/boot/dts/iwg20d-q7-common.dtsi +6 -1
@@ -59,6 +59,12 @@ }; }; +&hsusb { + status = "okay"; + pinctrl-0 = <&usb0_pins>; + pinctrl-names = "default"; +}; + &i2c2 { pinctrl-0 = <&i2c2_pins>; pinctrl-names = "default";
@@ -111,7 +117,6 @@ }; &pci0 { - status = "okay"; pinctrl-0 = <&usb0_pins>; pinctrl-names = "default"; };
Signature · 1 line
2.7.4
PATCH 6/7 ARM: dts: r8a7743: Add USB-DMAC device nodes
In reply to Fabrizio CastroFrom: Biju Das <[email protected]>
(modified clocks and power-domains properties, removed resets property)
--- arch/arm/boot/dts/r8a7743.dtsi | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+)
arch/arm/boot/dts/r8a7743.dtsi +24 -0
@@ -309,6 +309,30 @@ dma-channels = <15>; }; + usb_dmac0: dma-controller at e65a0000 { + compatible = "renesas,usb-dmac"; + reg = <0 0xe65a0000 0 0x100>; + interrupts = <GIC_SPI 109 IRQ_TYPE_LEVEL_HIGH + GIC_SPI 109 IRQ_TYPE_LEVEL_HIGH>; + interrupt-names = "ch0", "ch1"; + clocks = <&mstp3_clks R8A7743_CLK_USBDMAC0>; + power-domains = <&cpg_clocks>; + #dma-cells = <1>; + dma-channels = <2>; + }; + + usb_dmac1: dma-controller at e65b0000 { + compatible = "renesas,usb-dmac"; + reg = <0 0xe65b0000 0 0x100>; + interrupts = <GIC_SPI 110 IRQ_TYPE_LEVEL_HIGH + GIC_SPI 110 IRQ_TYPE_LEVEL_HIGH>; + interrupt-names = "ch0", "ch1"; + clocks = <&mstp3_clks R8A7743_CLK_USBDMAC1>; + power-domains = <&cpg_clocks>; + #dma-cells = <1>; + dma-channels = <2>; + }; + /* The memory map in the User's Manual maps the cores to bus * numbers */
Signature · 1 line
2.7.4
PATCH 6/7 ARM: dts: r8a7743: Add USB-DMAC device nodes
Quoted 21 lines · Fabrizio Castro
From: Biju Das <[email protected]>
Signed-off-by Biju Das <[email protected]>Signed-off-by Chris Paterson <[email protected]>Reviewed-by Geert Uytterhoeven <[email protected]>Signed-off-by Simon Horman <[email protected]>(cherry picked from commit 310861003a0d59cb410538bcdf73a218157a111d)(modified clocks and power-domains properties, removed resets property)
Signed-off-by Fabrizio Castro <[email protected]>---
?arch/arm/boot/dts/r8a7743.dtsi | 24 ++++++++++++++++++++++++ ?1 file changed, 24 insertions(+)arch/arm/boot/dts/r8a7743.dtsi +0
-0@@ -309,6 +309,30 @@ ? dma-channels = <15>; ? };?
arch/arm/boot/dts/r8a7743.dtsi
Quoted 2 lines
arch/arm/boot/dts/r8a7743.dtsi +2
-0+ usb_dmac0: dma-controller at e65a0000 { + compatible = "renesas,usb-dmac";
[...]
Why no "renesas,r8a7743-usb-dmac" compatible string?
Ben.
Signature · 2 lines
Ben Hutchings Software Developer, Codethink Ltd.
PATCH 6/7 ARM: dts: r8a7743: Add USB-DMAC device nodes
Hi Ben,
Quoted 27 lines
Subject: Re: [cip-dev][PATCH 6/7] ARM: dts: r8a7743: Add USB-DMAC device nodes
[This sender failed our fraud detection checks and may not be who they appear to be. Learn about spoofing at
http://aka.ms/LearnAboutSpoofing]Quoted 21 lines · Fabrizio Castro
From: Biju Das <[email protected]>
Signed-off-by Biju Das <[email protected]>Signed-off-by Chris Paterson <[email protected]>Reviewed-by Geert Uytterhoeven <[email protected]>Signed-off-by Simon Horman <[email protected]>(cherry picked from commit 310861003a0d59cb410538bcdf73a218157a111d)(modified clocks and power-domains properties, removed resets property)
Signed-off-by Fabrizio Castro <[email protected]>--- arch/arm/boot/dts/r8a7743.dtsi | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+)arch/arm/boot/dts/r8a7743.dtsi +0
-0@@ -309,6 +309,30 @@ dma-channels = <15>; };
Quoted 5 lines
arch/arm/boot/dts/r8a7743.dtsi line 313
Quoted 2 lines
arch/arm/boot/dts/r8a7743.dtsi +2
-0+ usb_dmac0: dma-controller at e65a0000 { + compatible = "renesas,usb-dmac";[...]
Why no "renesas,r8a7743-usb-dmac" compatible string?
It's down to the dt-bindings, commit 0b2eed49875ec3605b7a71bdf05adc8c1cbd49fc introduces SoC specific support, this would trigger changes to the corresponding SoC specific DT touched by such a change, and as usual, where do we draw the line with the backporting? Would you rather I used "renesas,r8a7743-usb-dmac" instead?
Thanks,
Fab
Quoted 6 lines
Ben.
--
Ben Hutchings
Software Developer, Codethink Ltd.
Renesas Electronics Europe Ltd, Dukes Meadow, Millboard Road, Bourne End, Buckinghamshire, SL8 5FH, UK. Registered in England & Wales under Registered No. 04586709.
PATCH 6/7 ARM: dts: r8a7743: Add USB-DMAC device nodes
Quoted 34 lines · Fabrizio Castro
Hi Ben,
Quoted 32 lines
Subject: Re: [cip-dev][PATCH 6/7] ARM: dts: r8a7743: Add USB-DMAC device nodes
[This sender failed our fraud detection checks and may not be who they appear to be. Learn about spoofing at
http://aka.ms/LearnAboutSpoofing]Quoted 23 lines · Fabrizio Castro
From: Biju Das <[email protected]>
Signed-off-by Biju Das <[email protected]>Signed-off-by Chris Paterson <[email protected]>Reviewed-by Geert Uytterhoeven <[email protected]>Signed-off-by Simon Horman <[email protected]>(cherry picked from commit 310861003a0d59cb410538bcdf73a218157a111d)(modified clocks and power-domains properties, removed resets property)
Signed-off-by Fabrizio Castro <[email protected]>---
?arch/arm/boot/dts/r8a7743.dtsi | 24 ++++++++++++++++++++++++ ?1 file changed, 24 insertions(+)arch/arm/boot/dts/r8a7743.dtsi +2
-0@@ -309,6 +309,30 @@ ??????????????????????dma-channels = <15>; ??????????????}; +?????????????usb_dmac0: dma-controller at e65a0000 { +?????????????????????compatible = "renesas,usb-dmac";[...]
Quoted 5 lines
Quoted 1 line
Why no "renesas,r8a7743-usb-dmac" compatible string?
It's down to the dt-bindings, commit
0b2eed49875ec3605b7a71bdf05adc8c1cbd49fcintroduces SoC specific support, this would trigger changes to the corresponding SoC specific DT touched by such a change,
It adds documentation of the string. It wouldn't trigger anything.
Quoted 2 lines
and as usual, where do we draw the line with
the backporting? Would you rather I used "renesas,r8a7743-usb-dmac" instead?
In general we should make the minimum necessary changes to a backported commit. Deleting one of the compatible strings does not appear to be necessary.
Ben.
Signature · 2 lines
Ben Hutchings Software Developer, Codethink Ltd.
PATCH 7/7 ARM: dts: r8a7743: Enable DMA for HSUSB
In reply to Fabrizio CastroFrom: Biju Das <[email protected]>
This patch adds DMA properties to the HSUSB node.
--- arch/arm/boot/dts/r8a7743.dtsi | 3 +++ 1 file changed, 3 insertions(+)
arch/arm/boot/dts/r8a7743.dtsi +3 -0
@@ -1215,6 +1215,9 @@ reg = <0 0xe6590000 0 0x100>; interrupts = <GIC_SPI 107 IRQ_TYPE_LEVEL_HIGH>; clocks = <&mstp7_clks R8A7743_CLK_HSUSB>; + dmas = <&usb_dmac0 0>, <&usb_dmac0 1>, + <&usb_dmac1 0>, <&usb_dmac1 1>; + dma-names = "ch0", "ch1", "ch2", "ch3"; power-domains = <&cpg_clocks>; renesas,buswait = <4>; phys = <&usb0 1>;
Signature · 1 line
2.7.4
Ben Hutchings
Appliedcover Add HSUSB to r8a7743
In reply to Fabrizio CastroI've applied this series, thanks. I added back the compatible strings that you left out of the last patch, since I didn't see any need to diverge from upstream there.
Ben.
Quoted 26 lines · Fabrizio Castro
Dear All,
this series backports all the patches necessary to add HSUSB support to the r8a7743.
Thanks,
FabrizioBiju Das (5):
? usb:renesas_usbhs: Add compatible string for r8a7743/5 ? ARM: dts: r8a7743: Add HS-USB device node
? ARM: dts: iwg20d-q7: Enable HS-USB
? ARM: dts: r8a7743: Add USB-DMAC device nodes
? ARM: dts: r8a7743: Enable DMA for HSUSBSimon Horman (2):
? usb:renesas_usbhs: add SoC names to compatibility string ????documentation
? usb:renesas_usbhs: add fallback compatibility strings?.../devicetree/bindings/usb/renesas_usbhs.txt??????| 22 ++++++++---- ?arch/arm/boot/dts/iwg20d-q7-common.dtsi????????????|??7 +++- ?arch/arm/boot/dts/r8a7743.dtsi?????????????????????| 40 ++++++++++++++++++++++ ?drivers/usb/renesas_usbhs/common.c?????????????????|??9 +++++?4 files changed, 71 insertions(+), 7 deletions(-)
Signature · 2 lines
Ben Hutchings Software Developer, Codethink Ltd.
cover Add HSUSB to r8a7743
Hello Ben,
Quoted 5 lines
Subject: Re: [cip-dev][PATCH 0/7] Add HSUSB to r8a7743
I've applied this series, thanks. I added back the compatible strings that you left out of the last patch, since I didn't see any need to diverge from upstream there.
Ok.
Thanks,
Fab
Quoted 30 lines
Ben.
Quoted 20 lines · Fabrizio Castro
Dear All,
this series backports all the patches necessary to add HSUSB support to the r8a7743.
Thanks,
FabrizioBiju Das (5):
usb:renesas_usbhs: Add compatible string for r8a7743/5
ARM: dts: r8a7743: Add HS-USB device node
ARM: dts: iwg20d-q7: Enable HS-USB
ARM: dts: r8a7743: Add USB-DMAC device nodes
ARM: dts: r8a7743: Enable DMA for HSUSBSimon Horman (2):
usb:renesas_usbhs: add SoC names to compatibility string
documentation
usb:renesas_usbhs: add fallback compatibility stringsQuoted 6 lines
.../devicetree/bindings/usb/renesas_usbhs.txt | 22 ++++++++---- arch/arm/boot/dts/iwg20d-q7-common.dtsi | 7 +++- arch/arm/boot/dts/r8a7743.dtsi | 40 ++++++++++++++++++++++ drivers/usb/renesas_usbhs/common.c | 9 +++++ 4 files changed, 71 insertions(+), 7 deletions(-)
Quoted 3 lines
--
Ben Hutchings
Software Developer, Codethink Ltd.
Renesas Electronics Europe Ltd, Dukes Meadow, Millboard Road, Bourne End, Buckinghamshire, SL8 5FH, UK. Registered in England & Wales under Registered No. 04586709.