From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9292AC433DF for ; Fri, 16 Oct 2020 17:14:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2C8492084C for ; Fri, 16 Oct 2020 17:14:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1602868477; bh=mSxFo/Yx0b0V+QT1gwqsYbcPIOixuZ0QFDRwy22skeo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=Sxh5U9VNI3m+uae/fhb3QmVYc0ahGy1ouwhZqV4Pgh+dBtnzXVznClbTnSyNne+9Z zym8kpxakuTm+JraWO5jGxZ4/Swsm3f9j+cS6Y6VLqPoBxa70iQ6owZW3Am8kaLl8P xS0BCmUnlr+mOSlNHb7CsAkwgK4CsPKLHnuzF0QE= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732521AbgJPROg (ORCPT ); Fri, 16 Oct 2020 13:14:36 -0400 Received: from mail-oo1-f66.google.com ([209.85.161.66]:34496 "EHLO mail-oo1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732484AbgJPROg (ORCPT ); Fri, 16 Oct 2020 13:14:36 -0400 Received: by mail-oo1-f66.google.com with SMTP id o20so788432ook.1; Fri, 16 Oct 2020 10:14:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=Cx3kdixfNY15+bkDWSXUmy0pMm0MYx3AfrDukLSG/n8=; b=QBu1bKpNNm3TBLd40dcXFp4hvQfH3zLu0hcdJ30dH5Qh9ibCdR4co6zOF4VVdDNL1k 7vZRBj/252FZHTIyNUkh5vHgybSInmIxdreGsPwO1ojC2fmXBKZz8KATzysluYRCyHx4 TzDfeA5zvbXezk/cy25VxvCQuVyRr9VP5BjzM4Pq8CRnZhQFK8d6C8S8k/ARF6JVJFbR Dog516tUfHCYbl5vQD6rqJP7e8KGMZcIl6LHzgeoQOONY7KV2CLd1GyOF25S6xRnQVLE LRYLnP2Qwzh2vkMDMgVEZASc3qdRjuH+Obgx8+Be40i2wq7bUlfA/38ek2wgpk4f3Xwm ClCw== X-Gm-Message-State: AOAM531cD27AnwxxVT9vWspMOpnw1Banpzrx5wc09EoLAwu5hQyBi3KX FMxN7rJprfH2N66MqO+mUA== X-Google-Smtp-Source: ABdhPJyUYYpCf4fr775G5Nt5ObMp6uVb0vD24ss0jYA4zBxq25ZZHmkPUKeKvbIi12WGaFegdiIIeg== X-Received: by 2002:a4a:5182:: with SMTP id s124mr3543501ooa.88.1602868474952; Fri, 16 Oct 2020 10:14:34 -0700 (PDT) Received: from xps15 (24-155-109-49.dyn.grandenetworks.net. [24.155.109.49]) by smtp.gmail.com with ESMTPSA id m18sm1277107ooj.6.2020.10.16.10.14.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Oct 2020 10:14:34 -0700 (PDT) Received: (nullmailer pid 1593243 invoked by uid 1000); Fri, 16 Oct 2020 17:14:33 -0000 Date: Fri, 16 Oct 2020 12:14:33 -0500 From: Rob Herring To: Chunfeng Yun Cc: Chun-Kuang Hu , Philipp Zabel , David Airlie , Daniel Vetter , Kishon Vijay Abraham I , Vinod Koul , Matthias Brugger , Greg Kroah-Hartman , Mauro Carvalho Chehab , "David S . Miller" , CK Hu , Stanley Chu , Min Guo , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-usb@vger.kernel.org Subject: Re: [PATCH v2 6/8] dt-bindings: usb: convert mediatek,mtk-xhci.txt to YAML schema Message-ID: <20201016171433.GA1585924@bogus> References: <20201013085207.17749-1-chunfeng.yun@mediatek.com> <20201013085207.17749-6-chunfeng.yun@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201013085207.17749-6-chunfeng.yun@mediatek.com> Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org On Tue, Oct 13, 2020 at 04:52:05PM +0800, Chunfeng Yun wrote: > Convert mediatek,mtk-xhci.txt to YAML schema mediatek,mtk-xhci.yaml > There's some refactoring of usb-hcd.yaml and XHCI schema under review and this may need some refactoring on top of it. > Signed-off-by: Chunfeng Yun > --- > v2: new patch > --- > .../bindings/usb/mediatek,mtk-xhci.txt | 121 ------------ > .../bindings/usb/mediatek,mtk-xhci.yaml | 180 ++++++++++++++++++ > 2 files changed, 180 insertions(+), 121 deletions(-) > delete mode 100644 Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.txt > create mode 100644 Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.yaml > diff --git a/Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.yaml b/Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.yaml > new file mode 100644 > index 000000000000..ea696c8f1269 > --- /dev/null > +++ b/Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.yaml > @@ -0,0 +1,180 @@ > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) > +# Copyright (c) 2020 MediaTek > +%YAML 1.2 > +--- > +$id: http://devicetree.org/schemas/usb/mediatek,mtk-xhci.yaml# > +$schema: http://devicetree.org/meta-schemas/core.yaml# > + > +title: MediaTek USB3 xHCI Device Tree Bindings > + > +maintainers: > + - Chunfeng Yun > + > +allOf: > + - $ref: "usb-hcd.yaml" > + > +description: | > + There are two scenarios: > + case 1: only supports xHCI driver; > + case 2: supports dual-role mode, and the host is based on xHCI driver. > + > +properties: > + #common properties for both case 1 and case 2 > + compatible: > + items: > + - enum: > + - mediatek,mt2712-xhci > + - mediatek,mt7622-xhci > + - mediatek,mt7629-xhci > + - mediatek,mt8173-xhci > + - mediatek,mt8183-xhci > + - const: mediatek,mtk-xhci > + > + reg: > + minItems: 1 > + maxItems: 2 > + items: > + - description: the registers of xHCI MAC > + - description: the registers of IP Port Control > + > + reg-names: > + minItems: 1 > + maxItems: 2 > + items: > + - const: mac > + - const: ippc #optional, only needed for case 1. > + > + interrupts: > + maxItems: 1 > + > + power-domains: > + description: A phandle to USB power domain node to control USB's MTCMOS > + maxItems: 1 > + > + clocks: > + minItems: 1 > + maxItems: 5 > + items: > + - description: Controller clock used by normal mode > + - description: Reference clock used by low power mode etc > + - description: Mcu bus clock for register access > + - description: DMA bus clock for data transfer > + - description: controller clock > + > + clock-names: > + minItems: 1 > + maxItems: 5 > + items: > + - const: sys_ck #required, the following ones are optional > + - const: ref_ck > + - const: mcu_ck > + - const: dma_ck > + - const: xhci_ck > + > + phys: > + $ref: /usb/usb-hcd.yaml# That doesn't look right... > + > + vusb33-supply: > + description: Regulator of USB AVDD3.3v > + > + vbus-supply: > + description: Regulator of USB VBUS5v > + > + usb3-lpm-capable: > + description: supports USB3.0 LPM > + type: boolean > + > + imod-interval-ns: > + $ref: /schemas/types.yaml#/definitions/uint32 > + description: | > + Interrupt moderation interval value, it is 8 times as much as that > + defined in the xHCI spec on MTK's controller. > + default: 5000 > + > + #the following properties are only used for case 1 > + pinctrl-0: > + description: A phandle to the default pinctrl state. > + > + pinctrl-names: > + description: A pinctrl state named "default" must be defined. > + See pinctrl/pinctrl-bindings.txt > + const: default Don't need pinctrl-* properties. They are always allowed. > + > + wakeup-source: > + description: enable USB remote wakeup, see power/wakeup-source.txt > + type: boolean > + > + mediatek,syscon-wakeup: > + $ref: /schemas/types.yaml#/definitions/phandle-array > + maxItems: 1 > + description: | > + A phandle to syscon used to access the register of the USB wakeup glue > + layer between xHCI and SPM, the field should always be a multiple of > + 3 cells long. A multiple of 3? How would there be more than 3 cells? > + > + items: > + - description: > + The first cell represents a phandle to syscon > + - description: > + The second cell represents the register base address of the glue > + layer in syscon > + - description: > + The third cell represents the hardware version of the glue layer, > + 1 is used by mt8173 etc, 2 is used by mt2712 etc > + enum: [1, 2] > + > + mediatek,u3p-dis-msk: > + $ref: /schemas/types.yaml#/definitions/uint32 > + description: The mask to disable u3ports, bit0 for u3port0, > + bit1 for u3port1, ... etc > + > + "#address-cells": > + const: 1 > + > + "#size-cells": > + const: 0 > + > +patternProperties: > + "^[a-f]+@[0-9a-f]+$": > + $ref: /usb/usb-hcd.yaml# > + type: object > + description: The hard wired USB devices. > + > +dependencies: > + wakeup-source: [ 'mediatek,syscon-wakeup' ] > + > +required: > + - compatible > + - reg > + - reg-names > + - interrupts > + - clocks > + - clock-names > + > +additionalProperties: false > + > +examples: > + - | > + #include > + #include > + #include > + #include > + #include > + > + usb3: usb@11270000 { > + compatible = "mediatek,mt8173-xhci", "mediatek,mtk-xhci"; > + reg = <0x11270000 0x1000>, <0x11280700 0x0100>; > + reg-names = "mac", "ippc"; > + interrupts = ; > + power-domains = <&scpsys MT8173_POWER_DOMAIN_USB>; > + clocks = <&topckgen CLK_TOP_USB30_SEL>, <&clk26m>; > + clock-names = "sys_ck", "ref_ck"; > + phys = <&u3port0 PHY_TYPE_USB3>, <&u2port1 PHY_TYPE_USB2>; > + vusb33-supply = <&mt6397_vusb_reg>; > + vbus-supply = <&usb_p1_vbus>; > + imod-interval-ns = <10000>; > + mediatek,syscon-wakeup = <&pericfg 0x400 1>; > + wakeup-source; > + usb3-lpm-capable; > + }; > +... > -- > 2.18.0