Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp3654605ybb; Tue, 31 Mar 2020 09:22:39 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvRvTVTxbETc8vLlUbi0NZFAuHruwtUSPILl9VIRcljnMps5Lav89hmc2eG2jSMW56dV5k8 X-Received: by 2002:a05:6808:495:: with SMTP id z21mr2731104oid.30.1585671759283; Tue, 31 Mar 2020 09:22:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585671759; cv=none; d=google.com; s=arc-20160816; b=yw7tfW4sIhk9yn6pnyrlnCRBYfC6ZMD9lSX2yK9d1ePvytBTkts7NZMU3qci6aCCa7 daSZ/U7pM9C8meIC8V5vIaemlWWZQxT8N+NPAlKa5+RN6uu91KJsdL6c4YUmtUNDeN/x fGzbWOFyztacChY3uOEZY5YW/XFHRmRNKJdz1qN5G+jvu57Z8bCMNAMKyNHbmQ8R8O/F I3HtzsLmswRRTvZZMOu+Xhk4l0r9iWMfPvC6cyDiKyyeN1vjsnceZs4USDScQ4GFI2BH DoBklGTUj9pohpCJKAOdNO0ASbqkbMUQcXr8xt3qCQKtDwiaeGGsZnh1PzC/ZX/EcxES ds8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=AK+2ExPtlr5Tb3hjzdVAO2l3pZre3+UfX4EE+oudLDA=; b=m/0Ii9LwJjDfTugp5XFDQPNv1/aIiiZu+R+05rTEpWVQBkF9rhEhJRTook2hHdCfYW bjjUxlK0umhArSpeqYyx4W77vzakFmG5qxvlRdKf/7qU/6peBAQw+r9iCAaFrtLAqBw0 Id8HqZ6xFnNQXLLD7V5KJrdmf2EghmmKMQBX++9k+u4xVVuEzcWfXJMbroBQhi9g0yOt mmQxc5OFyGw3+mDI072QN4udduo1Gmyx83q9sBQeWbQewEO4IiO2z6DpohdygK6dl7qb VmlpUegP9Z/SZUqCsI996C7XL3FYTkQEpOye05OnHl5WCnF4iCokSJLuEsqv35kLTyxk agvA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=gNLQBrPc; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w188si7201514oig.183.2020.03.31.09.22.25; Tue, 31 Mar 2020 09:22:39 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=gNLQBrPc; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730574AbgCaQVX (ORCPT + 99 others); Tue, 31 Mar 2020 12:21:23 -0400 Received: from mail.kernel.org ([198.145.29.99]:35630 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730011AbgCaQVX (ORCPT ); Tue, 31 Mar 2020 12:21:23 -0400 Received: from mail-qt1-f175.google.com (mail-qt1-f175.google.com [209.85.160.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E58DD21473; Tue, 31 Mar 2020 16:21:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1585671682; bh=YHNMT5j8Euq0n+mseKfPA6cKBa4Jew7v+YKTKPRHb/4=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=gNLQBrPcq3oyN2Ogv+oTJyFfBNekyyJFE8OMY+ksIRuIUm4Epp9KM6Y1F/8vi0HEK 10SfgtgPdKeKpsdZiqQ2ixSx9HcCCrFep4hoh/CePpyQATN8UU/WSDZC0IVmvAP2LT v14r3TcSkQKemqZJ9R1yludBCEJye3nWX1UaBApI= Received: by mail-qt1-f175.google.com with SMTP id z12so18836742qtq.5; Tue, 31 Mar 2020 09:21:21 -0700 (PDT) X-Gm-Message-State: ANhLgQ0eFQXJPHRl5wRowCdEqbAlE5Qup/b60Tefav6tVtVAI01tH+j3 jEPDKj3BsjkAHgUdk6rL/n79Yy8651xuJTczsA== X-Received: by 2002:ac8:1611:: with SMTP id p17mr5993804qtj.300.1585671680921; Tue, 31 Mar 2020 09:21:20 -0700 (PDT) MIME-Version: 1.0 References: <20200315191632.12536-1-rentao.bupt@gmail.com> <20200315191632.12536-7-rentao.bupt@gmail.com> <20200330192347.GA6388@bogus> <4dc3ac910c79dcca398eb5161dde44e1cc50baca.camel@kernel.crashing.org> In-Reply-To: <4dc3ac910c79dcca398eb5161dde44e1cc50baca.camel@kernel.crashing.org> From: Rob Herring Date: Tue, 31 Mar 2020 10:21:10 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 6/6] dt-bindings: usb: document aspeed vhub device ID/string properties To: Benjamin Herrenschmidt Cc: rentao.bupt@gmail.com, Felipe Balbi , Greg Kroah-Hartman , Joel Stanley , Andrew Jeffery , Chunfeng Yun , Colin Ian King , Stephen Boyd , Mark Rutland , Linux USB List , "moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE" , linux-aspeed@lists.ozlabs.org, devicetree@vger.kernel.org, "linux-kernel@vger.kernel.org" , OpenBMC Maillist , Tao Ren Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Mar 30, 2020 at 6:14 PM Benjamin Herrenschmidt wrote: > > On Mon, 2020-03-30 at 13:23 -0600, Rob Herring wrote: > > On Sun, Mar 15, 2020 at 12:16:32PM -0700, rentao.bupt@gmail.com wrote: > > > From: Tao Ren > > > > > > Update device tree binding document for aspeed vhub's device IDs and > > > string properties. > > > > > > Signed-off-by: Tao Ren > > > --- > > > No change in v2: > > > - the patch is added into the series since v2. > > > > > > .../bindings/usb/aspeed,usb-vhub.yaml | 68 +++++++++++++++++++ > > > 1 file changed, 68 insertions(+) > > > > > > diff --git a/Documentation/devicetree/bindings/usb/aspeed,usb-vhub.yaml b/Documentation/devicetree/bindings/usb/aspeed,usb-vhub.yaml > > > index 06399ba0d9e4..5b2e8d867219 100644 > > > --- a/Documentation/devicetree/bindings/usb/aspeed,usb-vhub.yaml > > > +++ b/Documentation/devicetree/bindings/usb/aspeed,usb-vhub.yaml > > > @@ -52,6 +52,59 @@ properties: > > > minimum: 1 > > > maximum: 21 > > > > > > + vhub-vendor-id: > > > + description: vhub Vendor ID > > > + allOf: > > > + - $ref: /schemas/types.yaml#/definitions/uint32 > > > + - maximum: 65535 > > > + > > > + vhub-product-id: > > > + description: vhub Product ID > > > + allOf: > > > + - $ref: /schemas/types.yaml#/definitions/uint32 > > > + - maximum: 65535 > > > > There's already standard 'vendor-id' and 'device-id' properties. Use > > those. > > So yes and no... I don't fundamentally object but keep in mind that > traditionally, the properties are about matching with a physical > hardware. > > In this case however, we are describing a virtual piece of HW and so > those IDs are going to be picked up to be exposed as the USB > vendor/device of the vhub on the USB bus. > > Not necessarily an issue but it's more "configuration" than "matching" > and as such, it might make sense to expose that with a prefix, though I > would prefer something like usb-vendor-id or usb,vendor-id... For FDT uses, it's pretty much been configuration. It's mostly been for PCI that I've seen these properties used. > > > + > > > + vhub-device-revision: > > > > Specific to USB, not vhub. > > Same as the above. > > > > + description: vhub Device Revision in binary-coded decimal > > > + allOf: > > > + - $ref: /schemas/types.yaml#/definitions/uint32 > > > + - maximum: 65535 > > > + > > > + vhub-strings: > > > + type: object > > > + > > > + properties: > > > + '#address-cells': > > > + const: 1 > > > + > > > + '#size-cells': > > > + const: 0 > > > + > > > + patternProperties: > > > + '^string@[0-9a-f]+$': > > > + type: object > > > + description: string descriptors of the specific language > > > + > > > + properties: > > > + reg: > > > + maxItems: 1 > > > + description: 16-bit Language Identifier defined by USB-IF > > > + > > > + manufacturer: > > > + description: vhub manufacturer > > > + allOf: > > > + - $ref: /schemas/types.yaml#/definitions/string > > > + > > > + product: > > > + description: vhub product name > > > + allOf: > > > + - $ref: /schemas/types.yaml#/definitions/string > > > + > > > + serial-number: > > > + description: vhub device serial number > > > + allOf: > > > + - $ref: /schemas/types.yaml#/definitions/string > > > > For all of this, it's USB specific, not vhub specific. I'm not sure this > > is the right approach. It might be better to just define properties > > which are just raw USB descriptors rather than inventing some DT format > > that then has to be converted into USB descriptors. > > Raw blob in the DT is rather annoying and leads to hard to parse stuff > for both humans and scripts. The main strenght of the DT is it's easy > to read and manipulate. True, and I'd certainly agree when we're talking about some vendor specific blob. but there's already code/tools to parse USB descriptors. > Also not the entire descriptor is configurable this way. > > That said, it could be that using the DT for the above is overkill and > instead, we should consider a configfs like the rest of USB gadget. > Though it isn't obvious how to do that, the current gadget stuff > doesn't really "fit" what we need here. Surely the descriptor building code can be shared at a minimum. Regardless of whether gadget configfs fits, usually it is pretty clear whether something belongs in DT or userspace. That should be decided first. > Maybe we could expose the port as UDCs but not actually expose them on > the bus until the hub is "activated" via a special configfs entry... If control of the hub is done by userspace, I'd think configuration should be there too. Rob