This series adds USB 3.0 support for the CAT874 platform, including a
new driver for the TI HD3SS3220 USB Type-C DRP port controller.
This patch series supports:
1) Host hotplug operation
2) Device hot plug operation
3) USB type-C data_role switch
(Tested with 2 RZ/G2E boards connected with a Type-C cable)
This patchset is based on linux_next next-20190514 branch.
V5-->V6
* Updated bindings patch by using usb-role-switch property
* Used graph api's to get role switch supported by the usb-c-connector
V4-->V5
* Incorporated Heikki's review comment.
(https://patchwork.kernel.org/patch/10902531/)
* Patch 1 is a dependency patch to make the compilation successful.
(https://patchwork.kernel.org/patch/10909971/)
* Patch 2 is also dependency patch to make the compilation successful.
Rebased on top of Patch1 and fixed Heikki's review comments
(https://patchwork.kernel.org/patch/10882555/)
* Incorporated Shimoda-San's review comment.
(https://patchwork.kernel.org/patch/10902535/)
V3-->V4
* Incorporated Chunfeng Yun's review comment
(https://patchwork.kernel.org/project/linux-usb/list/?submitter=133171)
* Used fwnode API's to get roleswitch handle
V2-->V3
* Used the new API to usb_role_switch by node to find the remote endpoint
(https://patchwork.kernel.org/patch/10882555/)
* Added renesas,usb-role-switch property
* Incorporated shimoda-san's review comment
(https://patchwork.kernel.org/patch/10852507/)
V1-->V2
* Use USB role class instead of extcon to receive connect and disconnect
events and also for the dual role switch.
* Dropped patch 6
* Squashed patch 8 and patch 9
* https://patchwork.kernel.org/cover/10840641/
Biju Das (7):
dt-bindings: usb: hd3ss3220 device tree binding document
dt-bindings: usb: renesas_usb3: Document usb role switch support
usb: typec: driver for TI HD3SS3220 USB Type-C DRP port controller
usb: gadget: udc: renesas_usb3: Add dual role switch support
arm64: defconfig: enable TYPEC_HD3SS3220 config option
arm64: dts: renesas: r8a774c0-cat874: Enable USB3.0 host/peripheral
device node
arm64: dts: renesas: r8a774c0-cat874: Enable usb role switch support
.../devicetree/bindings/usb/renesas_usb3.txt | 26 ++
.../devicetree/bindings/usb/ti,hd3ss3220.txt | 37 +++
arch/arm64/boot/dts/renesas/r8a774c0-cat874.dts | 56 +++++
arch/arm64/configs/defconfig | 2 +
drivers/usb/gadget/udc/renesas_usb3.c | 121 +++++++++-
drivers/usb/typec/Kconfig | 10 +
drivers/usb/typec/Makefile | 1 +
drivers/usb/typec/hd3ss3220.c | 263 +++++++++++++++++++++
8 files changed, 509 insertions(+), 7 deletions(-)
create mode 100644 Documentation/devicetree/bindings/usb/ti,hd3ss3220.txt
create mode 100644 drivers/usb/typec/hd3ss3220.c
--
2.7.4
@@ -0,0 +1,37 @@+TI HD3SS3220 TypeC DRP Port Controller.++Required properties:+ - compatible: Must be "ti,hd3ss3220".+ - reg: I2C slave address, must be 0x47 or 0x67 based on ADDR pin.+ - interrupts: <a b> where a is the interrupt number and b represents an+ encoding of the sense and level information for the interrupt.++Required sub-node:+ - connector : The "usb-c-connector" attached to the hd3ss3220 chip. The+ bindings of the connector node are specified in:++ Documentation/devicetree/bindings/connector/usb-connector.txt++Example:+hd3ss3220@47 {+ compatible = "ti,hd3ss3220";+ reg = <0x47>;+ interrupt-parent = <&gpio6>;+ interrupts = <3 IRQ_TYPE_LEVEL_LOW>;++ usb_con: connector {+ compatible = "usb-c-connector";+ label = "USB-C";+ data-role = "dual";+ };++ port {+ #address-cells = <1>;+ #size-cells = <0>;++ hd3ss3220_ep: endpoint@0 {+ reg = <0>;+ remote-endpoint = <&usb3peri_role_switch>;+ };+ };+};
Update the DT bindings documentation to support usb role switch
for USB Type-C connector using USB role switch class framework.
Signed-off-by: Biju Das <redacted>
---
V5-->V6
* Updated description
* Added usb-role-switch-property
V4-->V5
* No Change
V3-->V4
* No Change
V2-->V3
* Added optional renesas,usb-role-switch property.
V1-->V2
* Added usb-role-switch-property
* Updated the example with usb-role-switch property.
---
.../devicetree/bindings/usb/renesas_usb3.txt | 26 ++++++++++++++++++++++
1 file changed, 26 insertions(+)
@@ -22,6 +22,11 @@ Required properties: Optional properties: - phys: phandle + phy specifier pair - phy-names: must be "usb"+ - usb-role-switch: support role switch. see usb/generic.txt++Sub-nodes:+The port would be added as a subnode if the "usb-role-switch" property is used.+ see graph.txt Example of R-Car H3 ES1.x: usb3_peri0: usb@ee020000 {
Driver for TI HD3SS3220 USB Type-C DRP port controller.
The driver currently registers the port and supports data role swapping.
Signed-off-by: Biju Das <redacted>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
---
V5-->V6
* No change
Note: This patch depend on [1]
[1]: [v5,4/6] usb: roles: add API to get usb_role_switch by node
https://patchwork.kernel.org/patch/10942499/
V4-->V5
* Incorporated Heikki's review comment
(https://patchwork.kernel.org/patch/10902531/)
* Added Heikki's Reviewed-by tag
V3-->V4
* Incorporated Chunfeng Yun's review comment
* Used fwnode API's to get usb role switch handle.
V2-->V3
* Used the new api "usb_role_switch by node" for getting
remote endpoint associated with Type-C USB DRP port
controller devices.
V1-->V2
* Driver uses usb role class instead of extcon for dual role switch
and also handles connect/disconnect events.
---
drivers/usb/typec/Kconfig | 10 ++
drivers/usb/typec/Makefile | 1 +
drivers/usb/typec/hd3ss3220.c | 263 ++++++++++++++++++++++++++++++++++++++++++
3 files changed, 274 insertions(+)
create mode 100644 drivers/usb/typec/hd3ss3220.c
The RZ/G2E cat874 board has a type-c connector connected to hd3ss3220 usb
type-c drp port controller. This patch adds dual role switch support for
the type-c connector using the usb role switch class framework.
Signed-off-by: Biju Das <redacted>
---
V5-->V6
* Added graph api's to find the role supported by the connector.
V4-->V5
* Incorporated Shimoda-san's review comment
(https://patchwork.kernel.org/patch/10902537/)
V3-->V4
* No Change
V2-->V3
* Incorporated Shimoda-san's review comment
(https://patchwork.kernel.org/patch/10852507/)
* Used renesas,usb-role-switch property for differentiating USB
role switch associated with Type-C port controller driver.
V1-->V2
* Driver uses usb role clas for handling dual role switch and handling
connect/disconnect events instead of extcon.
---
drivers/usb/gadget/udc/renesas_usb3.c | 121 ++++++++++++++++++++++++++++++++--
1 file changed, 114 insertions(+), 7 deletions(-)
@@ -2343,14 +2350,65 @@ static enum usb_role renesas_usb3_role_switch_get(struct device *dev)returncur_role;}-staticintrenesas_usb3_role_switch_set(structdevice*dev,-enumusb_rolerole)+staticvoidhandle_ext_role_switch_states(structdevice*dev,+enumusb_rolerole)+{+structrenesas_usb3*usb3=dev_get_drvdata(dev);+structdevice*host=usb3->host_dev;+enumusb_rolecur_role=renesas_usb3_role_switch_get(dev);++switch(role){+caseUSB_ROLE_NONE:+usb3->connection_state=USB_ROLE_NONE;+if(usb3->driver)+usb3_disconnect(usb3);+usb3_vbus_out(usb3,false);+break;+caseUSB_ROLE_DEVICE:+if(usb3->connection_state==USB_ROLE_NONE){+usb3->connection_state=USB_ROLE_DEVICE;+usb3_set_mode(usb3,false);+if(usb3->driver)+usb3_connect(usb3);+}elseif(cur_role==USB_ROLE_HOST){+device_release_driver(host);+usb3_set_mode(usb3,false);+if(usb3->driver)+usb3_connect(usb3);+}+usb3_vbus_out(usb3,false);+break;+caseUSB_ROLE_HOST:+if(usb3->connection_state==USB_ROLE_NONE){+if(usb3->driver)+usb3_disconnect(usb3);++usb3->connection_state=USB_ROLE_HOST;+usb3_set_mode(usb3,true);+usb3_vbus_out(usb3,true);+if(device_attach(host)<0)+dev_err(dev,"device_attach(host) failed\n");+}elseif(cur_role==USB_ROLE_DEVICE){+usb3_disconnect(usb3);+/* Must set the mode before device_attach of the host */+usb3_set_mode(usb3,true);+/* This device_attach() might sleep */+if(device_attach(host)<0)+dev_err(dev,"device_attach(host) failed\n");+}+break;+default:+break;+}+}++staticvoidhandle_role_switch_states(structdevice*dev,+enumusb_rolerole){structrenesas_usb3*usb3=dev_get_drvdata(dev);structdevice*host=usb3->host_dev;enumusb_rolecur_role=renesas_usb3_role_switch_get(dev);-pm_runtime_get_sync(dev);if(cur_role==USB_ROLE_HOST&&role==USB_ROLE_DEVICE){device_release_driver(host);usb3_set_mode(usb3,false);
@@ -2361,6 +2419,20 @@ static int renesas_usb3_role_switch_set(struct device *dev,if(device_attach(host)<0)dev_err(dev,"device_attach(host) failed\n");}+}++staticintrenesas_usb3_role_switch_set(structdevice*dev,+enumusb_rolerole)+{+structrenesas_usb3*usb3=dev_get_drvdata(dev);++pm_runtime_get_sync(dev);++if(usb3->dual_role_sw)+handle_ext_role_switch_states(dev,role);+else+handle_role_switch_states(dev,role);+pm_runtime_put(dev);return0;
@@ -0,0 +1,37 @@+TI HD3SS3220 TypeC DRP Port Controller.++Required properties:+ - compatible: Must be "ti,hd3ss3220".+ - reg: I2C slave address, must be 0x47 or 0x67 based on ADDR pin.+ - interrupts: <a b> where a is the interrupt number and b represents an+ encoding of the sense and level information for the interrupt.
This depends on an interrupt controller used. I'd just said "an interrupt
specifier", w/o further details.
quoted hunk
++Required sub-node:+ - connector : The "usb-c-connector" attached to the hd3ss3220 chip. The+ bindings of the connector node are specified in:++ Documentation/devicetree/bindings/connector/usb-connector.txt+
On Wed, 2019-05-15 at 13:09 +0100, Biju Das wrote:
quoted hunk
The RZ/G2E cat874 board has a type-c connector connected to hd3ss3220 usb
type-c drp port controller. This patch adds dual role switch support for
the type-c connector using the usb role switch class framework.
Signed-off-by: Biju Das <redacted>
---
V5-->V6
* Added graph api's to find the role supported by the connector.
V4-->V5
* Incorporated Shimoda-san's review comment
(https://patchwork.kernel.org/patch/10902537/)
V3-->V4
* No Change
V2-->V3
* Incorporated Shimoda-san's review comment
(https://patchwork.kernel.org/patch/10852507/)
* Used renesas,usb-role-switch property for differentiating USB
role switch associated with Type-C port controller driver.
V1-->V2
* Driver uses usb role clas for handling dual role switch and handling
connect/disconnect events instead of extcon.
---
drivers/usb/gadget/udc/renesas_usb3.c | 121 ++++++++++++++++++++++++++++++++--
1 file changed, 114 insertions(+), 7 deletions(-)
@@ -2343,14 +2350,65 @@ static enum usb_role renesas_usb3_role_switch_get(struct device *dev)returncur_role;}-staticintrenesas_usb3_role_switch_set(structdevice*dev,-enumusb_rolerole)+staticvoidhandle_ext_role_switch_states(structdevice*dev,+enumusb_rolerole)+{+structrenesas_usb3*usb3=dev_get_drvdata(dev);+structdevice*host=usb3->host_dev;+enumusb_rolecur_role=renesas_usb3_role_switch_get(dev);++switch(role){+caseUSB_ROLE_NONE:+usb3->connection_state=USB_ROLE_NONE;+if(usb3->driver)+usb3_disconnect(usb3);+usb3_vbus_out(usb3,false);+break;+caseUSB_ROLE_DEVICE:+if(usb3->connection_state==USB_ROLE_NONE){+usb3->connection_state=USB_ROLE_DEVICE;+usb3_set_mode(usb3,false);+if(usb3->driver)+usb3_connect(usb3);+}elseif(cur_role==USB_ROLE_HOST){+device_release_driver(host);+usb3_set_mode(usb3,false);+if(usb3->driver)+usb3_connect(usb3);+}+usb3_vbus_out(usb3,false);+break;+caseUSB_ROLE_HOST:+if(usb3->connection_state==USB_ROLE_NONE){+if(usb3->driver)+usb3_disconnect(usb3);++usb3->connection_state=USB_ROLE_HOST;+usb3_set_mode(usb3,true);+usb3_vbus_out(usb3,true);+if(device_attach(host)<0)+dev_err(dev,"device_attach(host) failed\n");+}elseif(cur_role==USB_ROLE_DEVICE){+usb3_disconnect(usb3);+/* Must set the mode before device_attach of the host */+usb3_set_mode(usb3,true);+/* This device_attach() might sleep */+if(device_attach(host)<0)+dev_err(dev,"device_attach(host) failed\n");+}+break;+default:+break;+}+}++staticvoidhandle_role_switch_states(structdevice*dev,+enumusb_rolerole){structrenesas_usb3*usb3=dev_get_drvdata(dev);structdevice*host=usb3->host_dev;enumusb_rolecur_role=renesas_usb3_role_switch_get(dev);-pm_runtime_get_sync(dev);if(cur_role==USB_ROLE_HOST&&role==USB_ROLE_DEVICE){device_release_driver(host);usb3_set_mode(usb3,false);
@@ -2361,6 +2419,20 @@ static int renesas_usb3_role_switch_set(struct device *dev,if(device_attach(host)<0)dev_err(dev,"device_attach(host) failed\n");}+}++staticintrenesas_usb3_role_switch_set(structdevice*dev,+enumusb_rolerole)+{+structrenesas_usb3*usb3=dev_get_drvdata(dev);++pm_runtime_get_sync(dev);++if(usb3->dual_role_sw)+handle_ext_role_switch_states(dev,role);+else+handle_role_switch_states(dev,role);+pm_runtime_put(dev);return0;
To me, it's not good idea to pay an attention to specific consumer of
the role switch, assume any device could assign role if it get this USB
role switch, not only type-c connector
Subject: Re: [PATCH v6 4/7] usb: gadget: udc: renesas_usb3: Add dual role
switch support
On Wed, 2019-05-15 at 13:09 +0100, Biju Das wrote:
quoted
The RZ/G2E cat874 board has a type-c connector connected to hd3ss3220
usb type-c drp port controller. This patch adds dual role switch
support for the type-c connector using the usb role switch class framework.
Signed-off-by: Biju Das <redacted>
---
V5-->V6
* Added graph api's to find the role supported by the connector.
V4-->V5
* Incorporated Shimoda-san's review comment
(https://patchwork.kernel.org/patch/10902537/)
V3-->V4
* No Change
V2-->V3
* Incorporated Shimoda-san's review comment
(https://patchwork.kernel.org/patch/10852507/)
* Used renesas,usb-role-switch property for differentiating USB
role switch associated with Type-C port controller driver.
V1-->V2
* Driver uses usb role clas for handling dual role switch and handling
connect/disconnect events instead of extcon.
---
drivers/usb/gadget/udc/renesas_usb3.c | 121
++++++++++++++++++++++++++++++++--
1 file changed, 114 insertions(+), 7 deletions(-)
To me, it's not good idea to pay an attention to specific consumer of the role
switch, assume any device could assign role if it get this USB role switch, not
only type-c connector
Yes, I agree.
I have previously posted a patch based on this [1].
[1]. https://patchwork.kernel.org/patch/10852505/
Then on the binding patch, Rob suggested to walk the graph to the connector
and determine if dual role is supported by the connector type [2]
[2]. https://patchwork.kernel.org/patch/10914379/
The purpose of "usb role switch" is to assign the roles. So looks like, we don't need this function.
Please correct me, if I am wrong.
Regards,
Biju
From: Biju Das, Sent: Wednesday, May 15, 2019 9:09 PM
Subject: [PATCH v6 4/7] usb: gadget: udc: renesas_usb3: Add dual role switch support
Now I'm confusing about the "Add dual role switch support" mean... Especially,
this driver has already supports dual role switch support by own sysfs or debugfs.
The RZ/G2E cat874 board has a type-c connector connected to hd3ss3220 usb
type-c drp port controller. This patch adds dual role switch support for
the type-c connector using the usb role switch class framework.
IIUC, after this patch is applied, the hs3ss3220 type-c driver can switch
the role by using the usb role switch class framework.
quoted hunk
Signed-off-by: Biju Das <redacted>
---
V5-->V6
* Added graph api's to find the role supported by the connector.
V4-->V5
* Incorporated Shimoda-san's review comment
(https://patchwork.kernel.org/patch/10902537/)
V3-->V4
* No Change
V2-->V3
* Incorporated Shimoda-san's review comment
(https://patchwork.kernel.org/patch/10852507/)
* Used renesas,usb-role-switch property for differentiating USB
role switch associated with Type-C port controller driver.
V1-->V2
* Driver uses usb role clas for handling dual role switch and handling
connect/disconnect events instead of extcon.
---
drivers/usb/gadget/udc/renesas_usb3.c | 121 ++++++++++++++++++++++++++++++++--
1 file changed, 114 insertions(+), 7 deletions(-)
@@ -2741,6 +2842,12 @@ static int renesas_usb3_probe(struct platform_device *pdev) if (ret < 0) goto err_dev_create;+ if (device_property_read_bool(&pdev->dev, "usb-role-switch") &&+ is_usb_dual_role_switch(&pdev->dev)) {
I think either one of the conditions is enough. (Only "usb-role-switch"
checking is enough, IIUC).
JFYI, according to the binding document [1], this "usb-role-switch" means:
---
+ - usb-role-switch: boolean, indicates that the device is capable of assigning
+ the USB data role (USB host or USB device) for a given
+ USB connector, such as Type-C, Type-B(micro).
+ see connector/usb-connector.txt.
---
So, R-Car Gen3 / Salvator-XS cannot have this property because the board
has Type-A connector.
[1] https://patchwork.kernel.org/patch/10934835/
+ usb3->dual_role_sw = true;
So, "role_sw_by_connector" matches with my image.
What do you think?
Best regards,
Yoshihiro Shimoda
From: Biju Das, Sent: Wednesday, May 15, 2019 9:09 PM
Subject: [PATCH v6 4/7] usb: gadget: udc: renesas_usb3: Add dual role
switch support
Now I'm confusing about the "Add dual role switch support" mean...
Especially, this driver has already supports dual role switch support by own
sysfs or debugfs.
Sorry for the confusion.
What about "Enhance role switch support" ?
quoted
The RZ/G2E cat874 board has a type-c connector connected to hd3ss3220
usb type-c drp port controller. This patch adds dual role switch
support for the type-c connector using the usb role switch class framework.
IIUC, after this patch is applied, the hs3ss3220 type-c driver can switch the
role by using the usb role switch class framework.
Yes, That is correct. HD3SS3220 driver detects host/device connection events (attach/detach) and
It calls "usb_role_switch_set_role" to assign/switch the role.
quoted
Signed-off-by: Biju Das <redacted>
---
V5-->V6
* Added graph api's to find the role supported by the connector.
V4-->V5
* Incorporated Shimoda-san's review comment
(https://patchwork.kernel.org/patch/10902537/)
V3-->V4
* No Change
V2-->V3
* Incorporated Shimoda-san's review comment
(https://patchwork.kernel.org/patch/10852507/)
* Used renesas,usb-role-switch property for differentiating USB
role switch associated with Type-C port controller driver.
V1-->V2
* Driver uses usb role clas for handling dual role switch and handling
connect/disconnect events instead of extcon.
---
drivers/usb/gadget/udc/renesas_usb3.c | 121
++++++++++++++++++++++++++++++++--
1 file changed, 114 insertions(+), 7 deletions(-)
+ ret = true;+ }++ of_node_put(child);+ return ret;+}+ static int renesas_usb3_probe(struct platform_device *pdev) { struct renesas_usb3 *usb3;
@@ -2741,6 +2842,12 @@ static int renesas_usb3_probe(struct
platform_device *pdev)
quoted
if (ret < 0) goto err_dev_create;+ if (device_property_read_bool(&pdev->dev, "usb-role-switch") &&+ is_usb_dual_role_switch(&pdev->dev)) {
I think either one of the conditions is enough. (Only "usb-role-switch"
checking is enough, IIUC).
OK, Will remove the other check.
JFYI, according to the binding document [1], this "usb-role-switch" means:
---
+ - usb-role-switch: boolean, indicates that the device is capable of assigning
+ the USB data role (USB host or USB device) for a
given
+ USB connector, such as Type-C, Type-B(micro).
+ see connector/usb-connector.txt.
---
So, R-Car Gen3 / Salvator-XS cannot have this property because the board
has Type-A connector.
[1] https://patchwork.kernel.org/patch/10934835/
From: Biju Das, Sent: Tuesday, May 21, 2019 4:10 PM
Hi Shimoda-San,
Thanks for the feedback.
quoted
quoted
From: Biju Das, Sent: Wednesday, May 15, 2019 9:09 PM
Subject: [PATCH v6 4/7] usb: gadget: udc: renesas_usb3: Add dual role
switch support
Now I'm confusing about the "Add dual role switch support" mean...
Especially, this driver has already supports dual role switch support by own
sysfs or debugfs.
Sorry for the confusion.
What about "Enhance role switch support" ?
Thank you for the suggestion. It's good to me.
quoted
quoted
The RZ/G2E cat874 board has a type-c connector connected to hd3ss3220
usb type-c drp port controller. This patch adds dual role switch
support for the type-c connector using the usb role switch class framework.
IIUC, after this patch is applied, the hs3ss3220 type-c driver can switch the
role by using the usb role switch class framework.
Yes, That is correct. HD3SS3220 driver detects host/device connection events (attach/detach) and
It calls "usb_role_switch_set_role" to assign/switch the role.
I got it.
<snip>
quoted
JFYI, according to the binding document [1], this "usb-role-switch" means:
---
+ - usb-role-switch: boolean, indicates that the device is capable of assigning
+ the USB data role (USB host or USB device) for a
given
+ USB connector, such as Type-C, Type-B(micro).
+ see connector/usb-connector.txt.
---
So, R-Car Gen3 / Salvator-XS cannot have this property because the board
has Type-A connector.
[1] https://patchwork.kernel.org/patch/10934835/
@@ -0,0 +1,37 @@+TI HD3SS3220 TypeC DRP Port Controller.++Required properties:+ - compatible: Must be "ti,hd3ss3220".+ - reg: I2C slave address, must be 0x47 or 0x67 based on ADDR pin.+ - interrupts: <a b> where a is the interrupt number and b represents an+ encoding of the sense and level information for the interrupt.++Required sub-node:+ - connector : The "usb-c-connector" attached to the hd3ss3220 chip. The
+Required properties:+ - compatible: Must be "ti,hd3ss3220".+ - reg: I2C slave address, must be 0x47 or 0x67 based on ADDR pin.+ - interrupts: <a b> where a is the interrupt number and b represents an+ encoding of the sense and level information for the interrupt.++Required sub-node:+ - connector : The "usb-c-connector" attached to the hd3ss3220 chip. The
s/connector :/connector:/
Maybe it is for alignment ?
According to the connector/usb-connector.txt, should the connector node
have ports, port@1 and an endpoint nodes like below?
"ports" is needed if it has multiple "port",
otherwise, single port is allowed from OF-graph point of view.
Thank you for your help !!
Best regards
---
Kuninori Morimoto
From: Biju Das, Sent: Wednesday, May 15, 2019 9:09 PM
Update the DT bindings documentation to support usb role switch
for USB Type-C connector using USB role switch class framework.
Signed-off-by: Biju Das <redacted>
---
V5-->V6
* Updated description
* Added usb-role-switch-property
V4-->V5
* No Change
V3-->V4
* No Change
V2-->V3
* Added optional renesas,usb-role-switch property.
V1-->V2
* Added usb-role-switch-property
* Updated the example with usb-role-switch property.
---
.../devicetree/bindings/usb/renesas_usb3.txt | 26 ++++++++++++++++++++++
1 file changed, 26 insertions(+)
@@ -22,6 +22,11 @@ Required properties: Optional properties: - phys: phandle + phy specifier pair - phy-names: must be "usb"+ - usb-role-switch: support role switch. see usb/generic.txt++Sub-nodes:+The port would be added as a subnode if the "usb-role-switch" property is used.+ see graph.txt
I think we should describe which type of a subnode is needed.
I made an example below. This is based on the usb-connector.txt.
---
Sub-nodes:
- any connector to the data bus of this controller should be modeled using the OF graph
bindings specified in bindings/graph.txt.
---
quoted hunk
Example of R-Car H3 ES1.x:
usb3_peri0: usb@ee020000 {
I'm not sure, but I don't think this endpoint@0 and reg = <0> are needed.
In other words, can we use have following node?
usb3peri_role_switch: endpoint {
remote-endpoint = <&hd3ss3220_ep>;
};
Best regards,
Yoshihiro Shimoda
Subject: Re: [PATCH v6 1/7] dt-bindings: usb: hd3ss3220 device tree binding
document
Hello!
On 05/15/2019 03:09 PM, Biju Das wrote:
quoted
Add device tree binding document for TI HD3SS3220 Type-C DRP port
controller driver.
Signed-off-by: Biju Das <redacted>
Reviewed-by: Rob Herring <robh@kernel.org>
---
V5-->V6
* No change.
V4-->V5
* No Change.
V3-->V4
* No Change.
V2-->V3
* Added Rob's Reviewed by tag.
V1-->V2
* Added connector node.
* updated the example with connector node.
---
.../devicetree/bindings/usb/ti,hd3ss3220.txt | 37
@@ -0,0 +1,37 @@+TI HD3SS3220 TypeC DRP Port Controller.++Required properties:+ - compatible: Must be "ti,hd3ss3220".+ - reg: I2C slave address, must be 0x47 or 0x67 based on ADDR pin.+ - interrupts: <a b> where a is the interrupt number and b represents an+ encoding of the sense and level information for the interrupt.
This depends on an interrupt controller used. I'd just said "an interrupt
specifier", w/o further details.
Fine , If it is ok for everyone.
Regards,
Biju
quoted
++Required sub-node:+ - connector : The "usb-c-connector" attached to the hd3ss3220 chip. The+ bindings of the connector node are specified in:++ Documentation/devicetree/bindings/connector/usb-connector.txt+
Hi Morimoto-San and Shimoda-San,
Thanks for the feedback.
Subject: Re: [PATCH v6 1/7] dt-bindings: usb: hd3ss3220 device tree binding
document
Hi
quoted
quoted
+Required properties:+ - compatible: Must be "ti,hd3ss3220".+ - reg: I2C slave address, must be 0x47 or 0x67 based on ADDR pin.+ - interrupts: <a b> where a is the interrupt number and b represents an+ encoding of the sense and level information for the interrupt.++Required sub-node:+ - connector : The "usb-c-connector" attached to the hd3ss3220+chip. The
s/connector :/connector:/
Maybe it is for alignment ?
Yes, I need to fix the extra space.
quoted
According to the connector/usb-connector.txt, should the connector
node have ports, port@1 and an endpoint nodes like below?
"ports" is needed if it has multiple "port", otherwise, single port is allowed
from OF-graph point of view.
OK. I will use single port on the next patch series.
Regards,
Biju
From: Biju Das, Sent: Wednesday, May 22, 2019 8:00 PM
<snip>
quoted
quoted
According to the connector/usb-connector.txt, should the connector
node have ports, port@1 and an endpoint nodes like below?
"ports" is needed if it has multiple "port", otherwise, single port is allowed
from OF-graph point of view.
OK. I will use single port on the next patch series.
According to the connector/usb-connector.txt [1], even if this device uses a single port,
we should describe ports node and port@1 (for SuperSpeed) subnode like usb/typec-tcpci.txt.
[1]
Required nodes:
- any data bus to the connector should be modeled using the OF graph bindings
specified in bindings/graph.txt, unless the bus is between parent node and
the connector. Since single connector can have multiple data buses every bus
has assigned OF graph port number as follows:
0: High Speed (HS), present in all connectors,
1: Super Speed (SS), present in SS capable connectors,
2: Sideband use (SBU), present in USB-C.
Best regards,
Yoshihiro Shimoda
Subject: RE: [PATCH v6 1/7] dt-bindings: usb: hd3ss3220 device tree binding
document
Hi Biju-san, Morimoto-san,
quoted
From: Biju Das, Sent: Wednesday, May 22, 2019 8:00 PM
<snip>
quoted
quoted
quoted
According to the connector/usb-connector.txt, should the connector
node have ports, port@1 and an endpoint nodes like below?
"ports" is needed if it has multiple "port", otherwise, single port
is allowed from OF-graph point of view.
OK. I will use single port on the next patch series.
According to the connector/usb-connector.txt [1], even if this device uses a
single port, we should describe ports node and port@1 (for SuperSpeed)
subnode like usb/typec-tcpci.txt.
[1]
Required nodes:
- any data bus to the connector should be modeled using the OF graph
bindings
specified in bindings/graph.txt, unless the bus is between parent node and
the connector. Since single connector can have multiple data buses every
bus
has assigned OF graph port number as follows:
0: High Speed (HS), present in all connectors,
1: Super Speed (SS), present in SS capable connectors,
2: Sideband use (SBU), present in USB-C.
Subject: RE: [PATCH v6 2/7] dt-bindings: usb: renesas_usb3: Document usb
role switch support
Hi Biju-san,
Thank you for the patch!
quoted
From: Biju Das, Sent: Wednesday, May 15, 2019 9:09 PM
Update the DT bindings documentation to support usb role switch for
USB Type-C connector using USB role switch class framework.
Signed-off-by: Biju Das <redacted>
---
V5-->V6
* Updated description
* Added usb-role-switch-property
V4-->V5
* No Change
V3-->V4
* No Change
V2-->V3
* Added optional renesas,usb-role-switch property.
V1-->V2
* Added usb-role-switch-property
* Updated the example with usb-role-switch property.
---
.../devicetree/bindings/usb/renesas_usb3.txt | 26
@@ -22,6 +22,11 @@ Required properties: Optional properties: - phys: phandle + phy specifier pair - phy-names: must be "usb"+ - usb-role-switch: support role switch. see usb/generic.txt++Sub-nodes:+The port would be added as a subnode if the "usb-role-switch" property is
used.
quoted
+ see graph.txt
I think we should describe which type of a subnode is needed.
I made an example below. This is based on the usb-connector.txt.
---
Sub-nodes:
- any connector to the data bus of this controller should be modeled using
the OF graph
bindings specified in bindings/graph.txt
OK to me. I will add the following at the end. ", if the "usb-role-switch" property is
used."
---
quoted
Example of R-Car H3 ES1.x:
usb3_peri0: usb@ee020000 {
I'm not sure, but I don't think this endpoint@0 and reg = <0> are needed.
In other words, can we use have following node?
usb3peri_role_switch: endpoint {
remote-endpoint = <&hd3ss3220_ep>;
};
OK . Will update the example with
port {
usb3_role_switch: endpoint {
remote-endpoint = <&hd3ss3220_ep>;
};
};
Regards,
Biju