2022-11-03 16:47:25

by Yu, Richard

[permalink] [raw]
Subject: [PATCH v1 0/7] Add USB Driver for HPE GXP Architecture

From: Richard Yu <[email protected]>

The GXP vEHCI controller presents an 8 port EHCI compatible PCI function
to host software. Each EHCI port is logically connected to a
corresponding set of virtual device registers.

Richard Yu (7):
usb: gadget: udc: gxp_udc: add gxp USB support
dt-bindings: usb: hpe,gxp-udc: Add binding for gxp gadget
dt-bindings: usb: hpe,gxp-udcg: Add binding for gxp gadget group
dt-bindings: usb: hpe,gxp-vuhc: add binding for gxp vEHCI
ARM: dts: hpe: Add UDC nodes
ARM: configs: multi_v7_defconfig: Enable HPE GXP USB Driver
MAINTAINERS: add USB support to GXP

.../devicetree/bindings/usb/hpe,gxp-udc.yaml | 57 +
.../devicetree/bindings/usb/hpe,gxp-udcg.yaml | 34 +
.../devicetree/bindings/usb/hpe,gxp-vuhc.yaml | 34 +
MAINTAINERS | 5 +
arch/arm/boot/dts/hpe-gxp.dtsi | 30 +
arch/arm/configs/multi_v7_defconfig | 1 +
drivers/usb/gadget/udc/Kconfig | 6 +
drivers/usb/gadget/udc/Makefile | 1 +
drivers/usb/gadget/udc/gxp_udc.c | 1300 +++++++++++++++++
9 files changed, 1468 insertions(+)
create mode 100644 Documentation/devicetree/bindings/usb/hpe,gxp-udc.yaml
create mode 100644 Documentation/devicetree/bindings/usb/hpe,gxp-udcg.yaml
create mode 100644 Documentation/devicetree/bindings/usb/hpe,gxp-vuhc.yaml
create mode 100644 drivers/usb/gadget/udc/gxp_udc.c

--
2.17.1



2022-11-03 17:01:10

by Yu, Richard

[permalink] [raw]
Subject: [PATCH v1 2/7] dt-bindings: usb: hpe,gxp-udc: Add binding for gxp gadget

From: Richard Yu <[email protected]>

Create documentation for the hpe,gxp-udc binding to support access to
the virtual USB device.

Signed-off-by: Richard Yu <[email protected]>
---
.../devicetree/bindings/usb/hpe,gxp-udc.yaml | 57 +++++++++++++++++++
1 file changed, 57 insertions(+)
create mode 100644 Documentation/devicetree/bindings/usb/hpe,gxp-udc.yaml

diff --git a/Documentation/devicetree/bindings/usb/hpe,gxp-udc.yaml b/Documentation/devicetree/bindings/usb/hpe,gxp-udc.yaml
new file mode 100644
index 000000000000..f1ec4df8c3d3
--- /dev/null
+++ b/Documentation/devicetree/bindings/usb/hpe,gxp-udc.yaml
@@ -0,0 +1,57 @@
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/usb/hpe,gxp-udc.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: HPE GXP Gadget Universal Device Controller (UDC)
+
+maintainers:
+ - Richard Yu <[email protected]>
+ - Jean-Marie Verdun <[email protected]>
+ - Nick Hawkins <[email protected]>
+
+properties:
+ compatible:
+ const: hpe,gxp-udc
+
+ reg:
+ maxItems: 1
+
+ interrupts:
+ maxItems: 1
+
+ vdevnum:
+ description:
+ virtual device number.
+
+ fepnum:
+ description:
+ number of the flexible end-points this device is needed.
+
+ hpe,syscon-phandle:
+ $ref: '/schemas/types.yaml#/definitions/phandle'
+ description:
+ Phandle to the gxp vEHCI controller access vDevice registers.
+
+required:
+ - compatible
+ - reg
+ - interrupts
+ - vdevnum
+ - fepnum
+ - hpe,syscon-phandle
+
+additionalProperties: false
+
+examples:
+ - |
+ udc@80401000 {
+ compatible = "hpe,gxp-udc";
+ reg = <0x80401000 0x1000>;
+ interrupts = <13>;
+ interrupt-parent = <&vic1>;
+ vdevnum = <0>;
+ fepnum = <7>;
+ hpe,syscon-phandle = <&udc_system_controller>;
+ };
--
2.17.1


2022-11-04 20:39:37

by Krzysztof Kozlowski

[permalink] [raw]
Subject: Re: [PATCH v1 2/7] dt-bindings: usb: hpe,gxp-udc: Add binding for gxp gadget

On 04/11/2022 16:03, Yu, Richard wrote:
> Hi Mr. Kozlowski,
>
> Thank you very much for your quick review and feedbacks.
>
> I will modify the patches based on your feedback accordingly.
>
> On this specific patch, you have questions on how we defined the device/gadget configurations: vdevnum and fepnum.
>
> Please see my answers following the questions:
>
>> + vdevnum:
>> + description:
>> + virtual device number.
>
> That's unusual property... Why numbering devices is part of DT (hardware description)?
>
>>> Richard: In HPE GXP virtual EHCI controller chipset, it can support up to 8 virtual devices(gadgets). Each device/gadget will be represented by a bit in 8 bits register. For example, the interrupt register bit 0 indicates the interrupt from device 0, bit 1 for device 1 ... so on. When an user defines a device/gadget, he/she can define the device number as between 0 and 7. Thus, the driver can up to the bit position. That is why we have numbering devices as port of DT.
>
>> +
>> + fepnum:
>> + description:
>> + number of the flexible end-points this device is needed.
>
> Similar question.
>
>>> Richard: In HPE GXP virtual EHCI Controller chipset, there is a flexible EP pool. Each flexible EP has its own mapping register. The mapping register bit 0 to 3 is for device number (vdevnum) and bit 4 to 7 is for EP number inside the device. The device driver configures the mapping register to assign a flexible EP to a specific device. Here, "fepnum" is the input letting the driver know how many EP is needed for this device/gadget.
>
> Hope I have answered your questions on "vdevnum" and "fepnum".

Unfortunately I don't see your answers... Or actually I am not sure what
is the answer and what is not. What is unusual, you did not quote my
email but quoted something else. Please send it again, but following
normal mailing list netiquette for replies.

Here is one:

https://en.opensuse.org/openSUSE:Mailing_list_netiquette

Just don't use corporate style of emails on mailing list. We usually
cannot handle them...

Best regards,
Krzysztof