Add Embedded USB Debugger (EUD) driver
Subsystems (6)
Souradeep Chowdhury
maintainerv5 cover Add Embedded USB Debugger (EUD) driver
This is a series of patches that implements a driver for the control peripheral, EUD (Embedded USB Debugger). The EUD is a mini-USB hub implemented on chip to support the USB-based debug and trace capabilities. Apart from debug capabilities, EUD has a control peripheral. Control Peripheral is on when EUD is on and gets signals like USB attach, pet EUD etc. EUD driver listens to events like USB attach or detach and then informs the USB about these events via ROLE-SWITCH. At regular intervals, the EUD driver receives an interrupt to pet the driver indicating that the software is functional.
Changes in V5
* Added the review tags and implemented comments on V4 of the patch.
Changes in V4
* Aligned the device tree node structure of EUD as per discussion.
* Changes to usb-connector.yaml is no longer required and is not included in the patch series.
* Implemented the rest of the comments on Version 3 of the patch.
Changes in V3
* Removed the patch for registration of EUD connector as it is no longer required.
* Added the description to include EUD in usb-connector.yaml
* Implemented comments on V2 of the patch.
Changes in V2
* Fixed the yaml issue and also implemented comments on yaml in V1.
Changes in V1
* EUD has now been mapped as a separate DT node as it is an independent QCOM IP.
* EUD is attached to the connector child of dwc3 via port end point since EUD driver needs the connector for role-switching.
* EUD driver has been moved now to drivers/soc/qcom/qcom_eud.c.
* All the comments from version 0 of the patch has been implemented.
Souradeep Chowdhury (6):
dt-bindings: Add the yaml bindings for EUD
bindings: usb: dwc3: Update dwc3 properties for EUD connector
usb: common: eud: Add driver support for Embedded USB Debugger(EUD)
arm64: dts: qcom: sc7280: Add EUD dt node and dwc3 connector
arm64: dts: qcom: sc7280: Set the default dr_mode for usb2
MAINTAINERS: Add maintainer entry for EUD
Documentation/ABI/testing/sysfs-driver-eud | 9 + .../devicetree/bindings/soc/qcom/qcom,eud.yaml | 77 +++++++ .../devicetree/bindings/usb/snps,dwc3.yaml | 6 + MAINTAINERS | 8 + arch/arm64/boot/dts/qcom/sc7280-idp.dts | 4 + arch/arm64/boot/dts/qcom/sc7280.dtsi | 36 +++ drivers/usb/common/Kconfig | 10 + drivers/usb/common/Makefile | 1 + drivers/usb/common/qcom_eud.c | 251 +++++++++++++++++++++ 9 files changed, 402 insertions(+) create mode 100644 Documentation/ABI/testing/sysfs-driver-eud create mode 100644 Documentation/devicetree/bindings/soc/qcom/qcom,eud.yaml create mode 100644 drivers/usb/common/qcom_eud.c
Signature · 1 line
2.7.4
Souradeep Chowdhury
maintainerPATCH v5 1/6 dt-bindings: Add the yaml bindings for EUD
Documentation for Embedded USB Debugger(EUD) device tree bindings in yaml format.
--- .../devicetree/bindings/soc/qcom/qcom,eud.yaml | 77 ++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 Documentation/devicetree/bindings/soc/qcom/qcom,eud.yaml
Documentation/devicetree/bindings/soc/qcom/qcom,eud.yaml new file +77 -0
@@ -0,0 +1,77 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: "http://devicetree.org/schemas/soc/qcom/qcom,eud.yaml#" +$schema: "http://devicetree.org/meta-schemas/core.yaml#" + +title: Qualcomm Embedded USB Debugger + +maintainers: + - Souradeep Chowdhury <[email protected]> + +description: + This binding is used to describe the Qualcomm Embedded USB Debugger, which is + mini USB-hub implemented on chip to support USB-based debug capabilities. + +properties: + compatible: + items: + - enum: + - qcom,sc7280-eud + - const: qcom,eud + + reg: + items: + - description: EUD Base Register Region + - description: EUD Mode Manager Register + + interrupts: + description: EUD interrupt + maxItems: 1 + + ports: + $ref: /schemas/graph.yaml#/properties/ports + description: + These ports is to be attached to the endpoint of the DWC3 controller node + and type C connector node. The controller has the "usb-role-switch" + property. + + properties: + port@0: + $ref: /schemas/graph.yaml#/properties/port + description: This port is to be attached to the DWC3 controller. + + port@1: + $ref: /schemas/graph.yaml#/properties/port + description: This port is to be attached to the type C connector. + +required: + - compatible + - reg + - ports + +additionalProperties: false + +examples: + - | + eud@88e0000 { + compatible = "qcom,sc7280-eud","qcom,eud"; + reg = <0x88e0000 0x2000>, + <0x88e2000 0x1000>; + ports { + #address-cells = <1>; + #size-cells = <0>; + port@0 { + reg = <0>; + eud_ep: endpoint { + remote-endpoint = <&usb2_role_switch>; + }; + }; + port@1 { + reg = <1>; + eud_con: endpoint { + remote-endpoint = <&con_eud>; + }; + }; + }; + };
Signature · 1 line
2.7.4
Souradeep Chowdhury
maintainerPATCH v5 3/6 usb: common: eud: Add driver support for Embedded USB Debugger(EUD)
In reply to Souradeep ChowdhuryAdd support for control peripheral of EUD (Embedded USB Debugger) to listen to events such as USB attach/detach, pet EUD to indicate software is functional.Reusing the platform device kobj, sysfs entry 'enable' is created to enable or disable EUD.
To enable the eud the following needs to be done
echo 1 > /sys/bus/platform/.../enable
To disable eud, following is the command
echo 0 > /sys/bus/platform/.../enable
--- Documentation/ABI/testing/sysfs-driver-eud | 9 ++ drivers/usb/common/Kconfig | 10 ++ drivers/usb/common/Makefile | 1 + drivers/usb/common/qcom_eud.c | 251 +++++++++++++++++++++++++++++ 4 files changed, 271 insertions(+) create mode 100644 Documentation/ABI/testing/sysfs-driver-eud create mode 100644 drivers/usb/common/qcom_eud.c
Documentation/ABI/testing/sysfs-driver-eud new file +9 -0
@@ -0,0 +1,9 @@ +What: /sys/bus/platform/drivers/eud/.../enable +Date: February 2022 +Contact: Souradeep Chowdhury <[email protected]> +Description: + The Enable/Disable sysfs interface for Embedded + USB Debugger(EUD). This enables and disables the + EUD based on a 1 or a 0 value. By enabling EUD, + the user is able to activate the mini-usb hub of + EUD for debug and trace capabilities.
drivers/usb/common/Kconfig +10 -0
@@ -14,6 +14,16 @@ config USB_LED_TRIG LEDs and you want to use them as activity indicators for USB host or gadget. +config USB_QCOM_EUD + tristate "QCOM Embedded USB Debugger(EUD) Driver" + select USB_ROLE_SWITCH + help + This module enables support for Qualcomm Technologies, Inc. + Embedded USB Debugger (EUD). The EUD is a control peripheral + which reports VBUS attach/detach events and has USB-based + debug and trace capabilities. On selecting m, the module name + that is built is qcom_eud.ko + config USB_ULPI_BUS tristate "USB ULPI PHY interface support" select USB_COMMON
drivers/usb/common/Makefile +1 -0
@@ -10,4 +10,5 @@ usb-common-$(CONFIG_USB_LED_TRIG) += led.o obj-$(CONFIG_USB_CONN_GPIO) += usb-conn-gpio.o obj-$(CONFIG_USB_OTG_FSM) += usb-otg-fsm.o +obj-$(CONFIG_USB_QCOM_EUD) += qcom_eud.o obj-$(CONFIG_USB_ULPI_BUS) += ulpi.o
drivers/usb/common/qcom_eud.c new file +251 -0
251 lines not on this page · raw message
--
2.7.4
Souradeep Chowdhury
maintainerPATCH v5 4/6 arm64: dts: qcom: sc7280: Add EUD dt node and dwc3 connector
In reply to Souradeep ChowdhuryAdd the Embedded USB Debugger(EUD) device tree node. The node contains EUD base register region and EUD mode manager register regions along with the interrupt entry. Also add the typec connector node for EUD which is attached to EUD node via port. EUD is also attached to DWC3 node via port. Also add the role-switch property to dwc3 node.
--- arch/arm64/boot/dts/qcom/sc7280.dtsi | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+)
arch/arm64/boot/dts/qcom/sc7280.dtsi +36 -0
@@ -2583,6 +2583,12 @@ phys = <&usb_2_hsphy>; phy-names = "usb2-phy"; maximum-speed = "high-speed"; + usb-role-switch; + port { + usb2_role_switch: endpoint { + remote-endpoint = <&eud_ep>; + }; + }; }; };
@@ -2624,6 +2630,36 @@ interrupts = <GIC_SPI 582 IRQ_TYPE_LEVEL_HIGH>; }; + eud: eud@88e0000 { + compatible = "qcom,sc7280-eud","qcom,eud"; + reg = <0 0x88e0000 0 0x2000>, + <0 0x88e2000 0 0x1000>; + interrupts-extended = <&pdc 11 IRQ_TYPE_LEVEL_HIGH>; + ports { + port@0 { + eud_ep: endpoint { + remote-endpoint = <&usb2_role_switch>; + }; + }; + port@1 { + eud_con: endpoint { + remote-endpoint = <&con_eud>; + }; + }; + }; + }; + + eud_typec: connector { + compatible = "usb-c-connector"; + ports { + port@0 { + con_eud: endpoint { + remote-endpoint = <&eud_con>; + }; + }; + }; + }; + nsp_noc: interconnect@a0c0000 { reg = <0 0x0a0c0000 0 0x10000>; compatible = "qcom,sc7280-nsp-noc";
Signature · 1 line
2.7.4
Souradeep Chowdhury
maintainerPATCH v5 6/6 MAINTAINERS: Add maintainer entry for EUD
In reply to Souradeep ChowdhuryAdd the entry for maintainer for EUD driver
and other associated files.
--- MAINTAINERS | 8 ++++++++ 1 file changed, 8 insertions(+)
MAINTAINERS +8 -0
@@ -7227,6 +7227,14 @@ F: include/uapi/linux/mdio.h F: include/uapi/linux/mii.h F: net/core/of_net.c +QCOM EMBEDDED USB DEBUGGER(EUD) +M: Souradeep Chowdhury <[email protected]> +L: [email protected] +S: Maintained +F: Documentation/ABI/testing/sysfs-driver-eud +F: Documentation/devicetree/bindings/soc/qcom/qcom,eud.yaml +F: drivers/usb/common/qcom_eud.c + EXEC & BINFMT API R: Eric Biederman <[email protected]> R: Kees Cook <[email protected]>
Signature · 1 line
2.7.4
Souradeep Chowdhury
maintainerPATCH v5 5/6 arm64: dts: qcom: sc7280: Set the default dr_mode for usb2
In reply to Souradeep ChowdhurySet the default dr_mode for usb2 node to "otg" to enable role-switch for EUD(Embedded USB Debugger) connector node.
--- arch/arm64/boot/dts/qcom/sc7280-idp.dts | 4 ++++ 1 file changed, 4 insertions(+)
arch/arm64/boot/dts/qcom/sc7280-idp.dts +4 -0
@@ -61,6 +61,10 @@ modem-init; }; +&usb_2_dwc3 { + dr_mode = "otg"; +}; + &pmk8350_rtc { status = "okay"; };
Signature · 1 line
2.7.4
Souradeep Chowdhury
maintainerPATCH v5 2/6 bindings: usb: dwc3: Update dwc3 properties for EUD connector
In reply to Souradeep ChowdhuryAdd the ports property for dwc3 node. This port can be used by the Embedded USB Debugger for role switching the controller from device to host mode and vice versa.
--- Documentation/devicetree/bindings/usb/snps,dwc3.yaml | 6 ++++++ 1 file changed, 6 insertions(+)
Documentation/devicetree/bindings/usb/snps,dwc3.yaml +6 -0
@@ -332,6 +332,12 @@ properties: items: enum: [1, 4, 8, 16, 32, 64, 128, 256] + port: + $ref: /schemas/graph.yaml#/properties/port + description: + This port is used with the 'usb-role-switch' property to connect the + dwc3 to type C connector. + unevaluatedProperties: false required:
--
2.7.4
Greg KH
maintainerRe: [PATCH V5 3/6] usb: common: eud: Add driver support for Embedded USB Debugger(EUD)
In reply to Souradeep ChowdhuryQuoted 11 lines · Souradeep Chowdhury
Add support for control peripheral of EUD (Embedded USB Debugger) to listen to events such as USB attach/detach, pet EUD to indicate software is functional.Reusing the platform device kobj, sysfs entry 'enable' is created to enable or disable EUD.
To enable the eud the following needs to be done
echo 1 >/sys/bus/platform/.../enableTo disable eud, following is the command
echo 0 >/sys/bus/platform/.../enable
Quoted 6 lines
Signed-off-by Souradeep Chowdhury <[email protected]>--- Documentation/ABI/testing/sysfs-driver-eud | 9 ++ drivers/usb/common/Kconfig | 10 ++ drivers/usb/common/Makefile | 1 + drivers/usb/common/qcom_eud.c | 251 +++++++++++++++++++++++++++++
This really should be drivers/usb/misc/ right? No other code uses anything from this driver which is what "common" is for.
thanks,
greg k-h
Souradeep Chowdhury
maintainerRe: [PATCH V5 3/6] usb: common: eud: Add driver support for Embedded USB Debugger(EUD)
Quoted 12 lines · Greg KH
Quoted 11 lines · Souradeep Chowdhury
Add support for control peripheral of EUD (Embedded USB Debugger) to listen to events such as USB attach/detach, pet EUD to indicate software is functional.Reusing the platform device kobj, sysfs entry 'enable' is created to enable or disable EUD.
To enable the eud the following needs to be done
echo 1 >/sys/bus/platform/.../enableTo disable eud, following is the command
echo 0 >/sys/bus/platform/.../enable
Quoted 8 lines
Quoted 6 lines
Signed-off-by Souradeep Chowdhury <[email protected]>--- Documentation/ABI/testing/sysfs-driver-eud | 9 ++ drivers/usb/common/Kconfig | 10 ++ drivers/usb/common/Makefile | 1 + drivers/usb/common/qcom_eud.c | 251 +++++++++++++++++++++++++++++This really should be
drivers/usb/misc/right? No other code uses anything from this driver which is what "common" is for.
Ack
Quoted 4 lines
thanks,
greg k-h
Re: [PATCH V5 1/6] dt-bindings: Add the yaml bindings for EUD
In reply to Souradeep ChowdhuryQuoted 10 lines · Souradeep Chowdhury
Documentation for Embedded USB Debugger(EUD) device tree bindings in yaml format.
Signed-off-by Souradeep Chowdhury <[email protected]>Reviewed-by Bjorn Andersson <[email protected]>--- .../devicetree/bindings/soc/qcom/qcom,eud.yaml | 77 ++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 Documentation/devicetree/bindings/soc/qcom/qcom,eud.yaml
Re: [PATCH V5 2/6] bindings: usb: dwc3: Update dwc3 properties for EUD connector
In reply to Souradeep ChowdhuryQuoted 9 lines · Souradeep Chowdhury
Add the ports property for dwc3 node. This port can be used by the Embedded USB Debugger for role switching the controller from device to host mode and vice versa.
Signed-off-by Souradeep Chowdhury <[email protected]>--- Documentation/devicetree/bindings/usb/snps,dwc3.yaml | 6 ++++++ 1 file changed, 6 insertions(+)