Message ID | 20230706215910.78772-2-richard.yu@hpe.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp2860453vqx; Thu, 6 Jul 2023 15:05:45 -0700 (PDT) X-Google-Smtp-Source: APBJJlGSInAOzLCvNNMpTq2kd1colii5R7R4tAq1Q2GUPI3KLj9pkX76sN/mns9Gkk0i9XgMXDtw X-Received: by 2002:a17:90a:10c9:b0:262:e9c2:7d0f with SMTP id b9-20020a17090a10c900b00262e9c27d0fmr2383161pje.20.1688681145105; Thu, 06 Jul 2023 15:05:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688681145; cv=none; d=google.com; s=arc-20160816; b=yuQE0nIgVkgQzaeIkfCYWwbv+P8x/sJTq/OAjjQ9CVXozgf+viyWHhqXOvWw+uRDtw oMDkJFsIRa6cF5WkXpKOTqxePtVh24++7VgWlqTLCY5VeZ6FUcZlZy9Zj2fQ4Qjg2B3M l4i1tFsaphWRZBmBWPzeEKZ3R/VOfZeDT354AGshwfSeBkQFm9liPgv3npEqm4mC0XsC WN5hvYkgG4MbNmixsTLViGAHPXbMdYZRlmc4/j1+29x+NOwMyMPQXdSLbbcXFBSDuCoh A9NJnEwtdITuV8OiMOS+JjUktGuTomZwn3zBHK/vYhljjVmOAqfsChde1oADUA3mAIj0 4osg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:to:from:dkim-signature; bh=zVII/PXG3Y6NdKx0fn+21TgXx8mLHkE7tiHfaKhWlt8=; fh=UQIhTl16MZz5LmBMSKdo9gSVaeGKvz+bZVdxRnTE+7k=; b=DHiaQ+dVm/gDzEqKbupdO+Qg0CEEbyRtXldTgeNs8jPqwwN62tuBlOAqoPkbEn8PkB cKCvQ1OQxqlf4OSLsMcvjjMACv/PL5WFRpLjREupwPQqBiXOcp0Tb0ajSU3apIj+Yx0J Qt8GHEW626BXTIXveGiNUTL/098BEoAmNAb9+jYz66e9wRvQHp9wEXUyl08YiMIbrIDd fj7WMyq4XF5AbUC04S1pUp3a3Av2VqPUgQNgEj4mR1FFYQ6N90sDWYMI3J4XSnpcyFiT C7ZVKCnt1BWtYmR85GJ6bfO4BSgd/lt9kmyzzbkcbatTxADVXlhmtIhfS2woyKF5YlUO w0yg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@hpe.com header.s=pps0720 header.b=TvrNtjbA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=hpe.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t19-20020a63dd13000000b0055b6a782669si2206287pgg.261.2023.07.06.15.05.29; Thu, 06 Jul 2023 15:05:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@hpe.com header.s=pps0720 header.b=TvrNtjbA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=hpe.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231616AbjGFWEF (ORCPT <rfc822;hadasmailinglist@gmail.com> + 99 others); Thu, 6 Jul 2023 18:04:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38170 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229993AbjGFWEC (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 6 Jul 2023 18:04:02 -0400 Received: from mx0b-002e3701.pphosted.com (mx0b-002e3701.pphosted.com [148.163.143.35]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6E4621BF3; Thu, 6 Jul 2023 15:04:01 -0700 (PDT) Received: from pps.filterd (m0148664.ppops.net [127.0.0.1]) by mx0b-002e3701.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 366K2sIF015802; Thu, 6 Jul 2023 22:03:50 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hpe.com; h=from : to : subject : date : message-id : in-reply-to : references : mime-version; s=pps0720; bh=zVII/PXG3Y6NdKx0fn+21TgXx8mLHkE7tiHfaKhWlt8=; b=TvrNtjbA4y3NX9xniqOAh5dVYM8YaXvNTC8pGRQHuUw2M3lSrQ6c6jf+E/gCsd8X+gpK 91ZNmTYDpnemNrVbGke8DqdlvrLCGyMdtHfMdnWrZXmH+1DVW3LKEhFcEZwlKrMPDIrx 1W4Xd0RYYUgSa7ji6gkVcp/l3Rp5BZX7Qngcygu6RFNtMjNpq/el52OdC8AzEdeyjJ/U Wgr9gssmQ8fk+Bgoc/2pk4NteB43Wdxgk3ZDECcq4L/GgDK7AmolUwRNwRnu9IeowHEB Kx2Yd12mvZW+W/AdbMGjmIpB0V9p5PMwGPJym/gQcPcY/M4SzfWSujDhDzE+tiopxy7o jA== Received: from p1lg14881.it.hpe.com (p1lg14881.it.hpe.com [16.230.97.202]) by mx0b-002e3701.pphosted.com (PPS) with ESMTPS id 3rnx95bs9v-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 06 Jul 2023 22:03:50 +0000 Received: from p1lg14885.dc01.its.hpecorp.net (unknown [10.119.18.236]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by p1lg14881.it.hpe.com (Postfix) with ESMTPS id DBF90804DF6; Thu, 6 Jul 2023 22:03:49 +0000 (UTC) Received: from hpe.com (unknown [16.231.227.36]) by p1lg14885.dc01.its.hpecorp.net (Postfix) with ESMTP id 5FEF5806B42; Thu, 6 Jul 2023 22:03:49 +0000 (UTC) From: richard.yu@hpe.com To: verdun@hpe.com, nick.hawkins@hpe.com, gregkh@linuxfoundation.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, richard.yu@hpe.com, linux-usb@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v1 1/3] dt-bindings: usb: Add HPE GXP UDCG Controller Date: Thu, 6 Jul 2023 16:59:08 -0500 Message-Id: <20230706215910.78772-2-richard.yu@hpe.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230706215910.78772-1-richard.yu@hpe.com> References: <20230706215910.78772-1-richard.yu@hpe.com> X-Proofpoint-GUID: LOc4MqMbkCEn3KzxJ2lbIqqz13eDBRYM X-Proofpoint-ORIG-GUID: LOc4MqMbkCEn3KzxJ2lbIqqz13eDBRYM X-Proofpoint-UnRewURL: 0 URL was un-rewritten MIME-Version: 1.0 X-HPE-SCL: -1 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-07-06_15,2023-07-06_02,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 spamscore=0 lowpriorityscore=0 impostorscore=0 suspectscore=0 clxscore=1015 phishscore=0 mlxlogscore=813 adultscore=0 mlxscore=0 malwarescore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2305260000 definitions=main-2307060193 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770710520238031633?= X-GMAIL-MSGID: =?utf-8?q?1770710520238031633?= |
Series |
Add USB driver for HPE GXP Architecture
|
|
Commit Message
Yu, Richard
July 6, 2023, 9:59 p.m. UTC
From: Richard Yu <richard.yu@hpe.com> Provide access to the two register regions for GXP Virtual EHCI controller through the hpe,gxp-udcg binding. Signed-off-by: Richard Yu <richard.yu@hpe.com> --- .../devicetree/bindings/usb/hpe,gxp-udcg.yaml | 70 +++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 Documentation/devicetree/bindings/usb/hpe,gxp-udcg.yaml
Comments
On 06/07/2023 23:59, richard.yu@hpe.com wrote: > From: Richard Yu <richard.yu@hpe.com> > > Provide access to the two register regions for GXP Virtual EHCI > controller through the hpe,gxp-udcg binding. Thank you for your patch. There is something to discuss/improve. > > Signed-off-by: Richard Yu <richard.yu@hpe.com> > --- > .../devicetree/bindings/usb/hpe,gxp-udcg.yaml | 70 +++++++++++++++++++ > 1 file changed, 70 insertions(+) > create mode 100644 Documentation/devicetree/bindings/usb/hpe,gxp-udcg.yaml > > diff --git a/Documentation/devicetree/bindings/usb/hpe,gxp-udcg.yaml b/Documentation/devicetree/bindings/usb/hpe,gxp-udcg.yaml > new file mode 100644 > index 000000000000..e6746374f97d > --- /dev/null > +++ b/Documentation/devicetree/bindings/usb/hpe,gxp-udcg.yaml > @@ -0,0 +1,70 @@ > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) > +%YAML 1.2 > +--- > +$id: http://devicetree.org/schemas/usb/hpe,gxp-udcg.yaml# > +$schema: http://devicetree.org/meta-schemas/core.yaml# > + > +title: HPE GXP USB Virtual EHCI controller The word "virtual" in bindings pretty often raises questions, because we describe usually real hardware, not virtual. Some explanation in description would be useful. > + > +maintainers: > + - Nick Hawkins <nick.hawkins@hpe.com> > + - Richard Yu <richard.yu@hpe.com> > + > +description: |+ Drop |+ > + The HPE GXP USB Virtual EHCI Controller implements 1 set of USB EHCI > + register and several sets of device and endpoint registers to support > + the virtual EHCI's downstream USB devices. > + If this is EHCI controller, then I would expect here reference to usb-hcd. > +properties: > + compatible: > + enum: > + - hpe,gxp-udcg > + > + reg: > + items: > + - description: UDC Global (UDCG) config controller > + - description: UDC Invidual config/interrupt controllers > + > + reg-names: > + items: > + - const: udcg > + - const: udc > + > + interrupts: > + maxItems: 1 > + > + hpe,vehci-downstream-ports: > + description: Number of downstream ports supported by the GXP Why do you need this property in DT and what exactly does it represent? You have one device - EHCI controller - and on some boards it is further customized? Even though it is the same device? > + $ref: /schemas/types.yaml#/definitions/uint32 > + default: 4 > + minimum: 1 > + maximum: 8 > + > + hpe,vehci-generic-endpoints: > + description: Number of generic endpoints supported by the GXP > + $ref: /schemas/types.yaml#/definitions/uint32 Same concerns. > + default: 16 > + minimum: 1 > + maximum: 16 > + > +required: > + - compatible > + - reg > + - reg-names > + - interrupts > + - hpe,vehci-downstream-ports > + - hpe,vehci-generic-endpoints > + > +additionalProperties: false > + > +examples: > + - | > + udcg@80400800 { Node names should be generic. See also an explanation and list of examples (not exhaustive) in DT specification: https://devicetree-specification.readthedocs.io/en/latest/chapter2-devicetree-basics.html#generic-names-recommendation Best regards, Krzysztof
>> +title: HPE GXP USB Virtual EHCI controller > The word "virtual" in bindings pretty often raises questions, because we > describe usually real hardware, not virtual. Some explanation in > description would be useful. Here we are working with virtual devices that are created and have no physical presence. We have modeled our code off of ASPEED's VHUB implementation to comply with the implementation in OpenBMC. >> + The HPE GXP USB Virtual EHCI Controller implements 1 set of USB EHCI >> + register and several sets of device and endpoint registers to support >> + the virtual EHCI's downstream USB devices. >> + > If this is EHCI controller, then I would expect here reference to usb-hcd. We will remove references to EHCI in code and documentation. It has been modeled to following ASPEEDs approach as mentioned above. >> + hpe,vehci-downstream-ports: >> + description: Number of downstream ports supported by the GXP > Why do you need this property in DT and what exactly does it represent? > You have one device - EHCI controller - and on some boards it is further > customized? Even though it is the same device? That is correct. We can configure this VHUB Controller to have one to 8 virtual ports. This is similar to the aspeed virtual USB HUB "aspeed,vhub-downstream-ports" moving forward in the next patch we are going to use "hpe,vhub-downstream-ports" >> + $ref: /schemas/types.yaml#/definitions/uint32 >> + default: 4 >> + minimum: 1 >> + maximum: 8 >> + >> + hpe,vehci-generic-endpoints: >> + description: Number of generic endpoints supported by the GXP >> + $ref: /schemas/types.yaml#/definitions/uint32 > Same concerns. We intend to change this to "hpe,vhub-generic-endpoints" following ASPEED's "aspeed,vhub-generic-endpoints" >> +examples: >> + - | >> + udcg@80400800 { > Node names should be generic. See also an explanation and list of ... We will use usb-hub. Thank you for your feedback, Richard Yu
On 01/08/2023 20:07, Yu, Richard wrote: > >>> +title: HPE GXP USB Virtual EHCI controller > >> The word "virtual" in bindings pretty often raises questions, because we >> describe usually real hardware, not virtual. Some explanation in >> description would be useful. > > Here we are working with virtual devices that are created and have no Unfortunately I do not know what are virtual devices which do not exist physically. I have serious doubts that they fit Devicetree purpose... > physical presence. We have modeled our code off of ASPEED's VHUB > implementation to comply with the implementation in OpenBMC. > >>> + The HPE GXP USB Virtual EHCI Controller implements 1 set of USB EHCI >>> + register and several sets of device and endpoint registers to support >>> + the virtual EHCI's downstream USB devices. >>> + > > >> If this is EHCI controller, then I would expect here reference to usb-hcd. > > We will remove references to EHCI in code and documentation. It has been > modeled to following ASPEEDs approach as mentioned above. > >>> + hpe,vehci-downstream-ports: >>> + description: Number of downstream ports supported by the GXP > > >> Why do you need this property in DT and what exactly does it represent? >> You have one device - EHCI controller - and on some boards it is further >> customized? Even though it is the same device? > > That is correct. We can configure this VHUB Controller to have one to > 8 virtual ports. This is similar to the aspeed virtual USB HUB > "aspeed,vhub-downstream-ports" moving forward in the next patch > we are going to use "hpe,vhub-downstream-ports" Moving forward you need to address this lack of physical presence... Aren't these different devices and you just forgot to customize the compatible? Best regards, Krzysztof
Thank you, Mr. Kozlowski, for your feedback. -----Original Message----- From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Sent: Saturday, August 5, 2023 2:09 PM To: Yu, Richard <richard.yu@hpe.com>; Verdun, Jean-Marie <verdun@hpe.com>; Hawkins, Nick <nick.hawkins@hpe.com>; gregkh@linuxfoundation.org; robh+dt@kernel.org; krzysztof.kozlowski+dt@linaro.org; conor+dt@kernel.org; linux-usb@vger.kernel.org; devicetree@vger.kernel.org; linux-kernel@vger.kernel.org Subject: Re: [PATCH v1 1/3] dt-bindings: usb: Add HPE GXP UDCG Controller On 01/08/2023 20:07, Yu, Richard wrote: >> >>>> +title: HPE GXP USB Virtual EHCI controller >> >>> The word "virtual" in bindings pretty often raises questions, because >>> we describe usually real hardware, not virtual. Some explanation in >>> description would be useful. >> >> Here we are working with virtual devices that are created and have no > Unfortunately I do not know what are virtual devices which do not exist physically. > I have serious doubts that they fit Devicetree purpose... In our HPE gxp, we have an EHCI device which it is present to host as standard EHCI controller. However, this EHCI controller does not have any physical port. Users can figure this EHCI controller to have 1 to 8 ports (we call it as virtual ports) and attached 1 to 8 UDC devices (we call them as virtual devices). User can figure each port/device to have 1 to 16 endpoints. I am writing his driver to create the device descriptor entry for each port/UDC. /sys/bus/platform/devices/80400800.vhub/80400800.vhub:p1 .... Thus, the OpenBmc KVM can use them as virtual mouse/keyboard, virtual NIC .... I am implementing this driver using the Aspeed virtual hub driver as example. Just like the Aspeed virtual hub is in the Devicetree: vhub: usb-vhub@1e6a0000 { compatible = "aspeed,ast2600-usb-vhub"; reg = <0x1e6a0000 0x350>; interrupts = <GIC_SPI 5 IRQ_TYPE_LEVEL_HIGH>; clocks = <&syscon ASPEED_CLK_GATE_USBPORT1CLK>; aspeed,vhub-downstream-ports = <7>; aspeed,vhub-generic-endpoints = <21>; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_usb2ad_default>; status = "disabled"; }; In my case: (I am replacing "udcg" with "vhub" and remove the vehci reference). vhub: usb-vhub@80400800 { compatible = "hpe,gxp-vhub"; reg = <0x80400800 0x0200>, <0x80401000 0x8000>; reg-names = "vhub", "udc"; interrupts = <13>; interrupt-parent = <&vic1>; hpe,vhub-downstream-ports = <4>; hpe,vhub-generic-endpoints = <16>; }; >> physical presence. We have modeled our code off of ASPEED's VHUB >> implementation to comply with the implementation in OpenBMC. >> >>>> + The HPE GXP USB Virtual EHCI Controller implements 1 set of USB >>>> + EHCI register and several sets of device and endpoint registers to >>>> + support the virtual EHCI's downstream USB devices. >>>> + >> > > >>> If this is EHCI controller, then I would expect here reference to usb-hcd. >> >> We will remove references to EHCI in code and documentation. It has >> been modeled to following ASPEEDs approach as mentioned above. >> >>> + hpe,vehci-downstream-ports: >>> + description: Number of downstream ports supported by the GXP > > >>> Why do you need this property in DT and what exactly does it represent? >>> You have one device - EHCI controller - and on some boards it is >>> further customized? Even though it is the same device? >> >> That is correct. We can configure this VHUB Controller to have one to >> 8 virtual ports. This is similar to the aspeed virtual USB HUB >> "aspeed,vhub-downstream-ports" moving forward in the next patch we are >> going to use "hpe,vhub-downstream-ports" > Moving forward you need to address this lack of physical presence... > Aren't these different devices and you just forgot to customize the compatible? I don’t fully understand here. Isn't the lack of physical presence similar to the Aspeed virtual hub driver? > Best regards, > Krzysztof Thank very much. Richard.
diff --git a/Documentation/devicetree/bindings/usb/hpe,gxp-udcg.yaml b/Documentation/devicetree/bindings/usb/hpe,gxp-udcg.yaml new file mode 100644 index 000000000000..e6746374f97d --- /dev/null +++ b/Documentation/devicetree/bindings/usb/hpe,gxp-udcg.yaml @@ -0,0 +1,70 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/usb/hpe,gxp-udcg.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: HPE GXP USB Virtual EHCI controller + +maintainers: + - Nick Hawkins <nick.hawkins@hpe.com> + - Richard Yu <richard.yu@hpe.com> + +description: |+ + The HPE GXP USB Virtual EHCI Controller implements 1 set of USB EHCI + register and several sets of device and endpoint registers to support + the virtual EHCI's downstream USB devices. + +properties: + compatible: + enum: + - hpe,gxp-udcg + + reg: + items: + - description: UDC Global (UDCG) config controller + - description: UDC Invidual config/interrupt controllers + + reg-names: + items: + - const: udcg + - const: udc + + interrupts: + maxItems: 1 + + hpe,vehci-downstream-ports: + description: Number of downstream ports supported by the GXP + $ref: /schemas/types.yaml#/definitions/uint32 + default: 4 + minimum: 1 + maximum: 8 + + hpe,vehci-generic-endpoints: + description: Number of generic endpoints supported by the GXP + $ref: /schemas/types.yaml#/definitions/uint32 + default: 16 + minimum: 1 + maximum: 16 + +required: + - compatible + - reg + - reg-names + - interrupts + - hpe,vehci-downstream-ports + - hpe,vehci-generic-endpoints + +additionalProperties: false + +examples: + - | + udcg@80400800 { + compatible = "hpe,gxp-udcg"; + reg = <0x80400800 0x0200>, <0x80401000 0x8000>; + reg-names = "udcg", "udc"; + interrupts = <13>; + interrupt-parent = <&vic1>; + hpe,vehci-downstream-ports = <4>; + hpe,vehci-generic-endpoints = <16>; + };