RE: [PATCH v1 2/3] usb: gadget: udc: gxp-udc: add HPE GXP USB support

From: Yu, Richard
Date: Tue Aug 01 2023 - 14:50:48 EST




-----Original Message-----
From: Alan Stern <stern@xxxxxxxxxxxxxxxxxxx>
Sent: Thursday, July 6, 2023 9:17 PM
To: Yu, Richard <richard.yu@xxxxxxx>
Cc: Verdun, Jean-Marie <verdun@xxxxxxx>; Hawkins, Nick <nick.hawkins@xxxxxxx>; gregkh@xxxxxxxxxxxxxxxxxxx; robh+dt@xxxxxxxxxx; krzysztof.kozlowski+dt@xxxxxxxxxx; conor+dt@xxxxxxxxxx; linux-usb@xxxxxxxxxxxxxxx; devicetree@xxxxxxxxxxxxxxx; linux-kernel@xxxxxxxxxxxxxxx
Subject: Re: [PATCH v1 2/3] usb: gadget: udc: gxp-udc: add HPE GXP USB support

On Thu, Jul 06, 2023 at 04:59:09PM -0500, richard.yu@xxxxxxx wrote:
>> From: Richard Yu <richard.yu@xxxxxxx>
>>
>> The HPE GXP vEHCI controller presents a four port EHCI compatible PCI
>> function to host software. Each vEHCI port is logically connected to a
>> corresponding set of virtual device registers.

> What makes the vEHCI controller virtual? Presenting a "PCI function"
> certainly seems to indicate it is a physical device, indeed, a PCI device.

To the host and system OS, GXP is indeed to present a physical standard
EHCI controller. The standard Linux EHCI driver will be used. What virtual
Here are the ports. We will remove references to EHCI in code and
Documentation. It has been modeled to following ASPEEDs v-hub approach.

>> +config USB_GXP_UDC
>> + bool "GXP UDC Driver"
>> + depends on ARCH_HPE_GXP || COMPILE_TEST
>> + help
>> + Say "y" to add support for GXP UDC driver

> Now hang on a second. What sort of driver is this patch adding support
> for: a GXP vEHCI controller driver or a GXP UDC controller driver?
> The patch description says the first, but the code says the second.

I will modify the patch description as a GXP virtual UDC driver.

> It sounds like this thing actually is a PCI device that appears to the OS as
> an actual EHCI controller, but with virtual (rather than physical) downstream ports,
> and it includes a virtual UDC for each port. As such, it requires a driver for the virtual UDCs,
> which is what this patch provides. (No new driver is needed for the EHCI controller part,
> since the kernel already has an EHCI driver.)

> Is that a correct description? And if it is, what is the purpose of this device?
> To act as a testing ground for gadget drivers?

That is a correct description. The purpose of this device is for us to create virtual USB devices,
such as virtual keyboard/ mouse using in OpenBmc KVM, virtual CD, virtual NIC...

> Alan Stern

Thank you very much for your feedback.

Richard.