Received: by 2002:a05:6a10:83d0:0:0:0:0 with SMTP id o16csp75799pxh; Thu, 7 Apr 2022 14:27:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwcPn1sVzifNy5aDT2WM+41wpkrXH+VzVVovXO7od0giSgjnT3hH0wDne54zRS5AMk1VCos X-Received: by 2002:a65:6a4c:0:b0:39c:f169:b54a with SMTP id o12-20020a656a4c000000b0039cf169b54amr1126295pgu.384.1649366872548; Thu, 07 Apr 2022 14:27:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649366872; cv=none; d=google.com; s=arc-20160816; b=Xp0xp29EEhElUZiZLAU1wr5qX3U6EJ8fAIif0gChyI8UZ6TFvcyMAL8J59XGOsc3Kn hPD/qO5E6r5T7cB2/G4AqZmFvdizJGoXt5lQbezLQTnORJLUGuqYrmQxSkbQREakdu0m NXNT7QOTvyWW6L3QswqvycujQYOhwl/KCEfRCbTRQwmiKewdLArBd/wRYxQi5IPc8R3V vL21ZdLmA0Uu/0eznuODSMw3gHHSr7w1ItJb/19Dxz4JFrvpIOBj3hOPX2CyBzLftCbw DJ0Zh3kLtbdVsZzrRLjniYYf+ssDIALJPyykew0fmJBxq2bHYVYd4FWrzhaMMMysURm9 x45Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=m8g+U9TYp/KmmutHAdrKb6oEqOtOebbJJ9ukyAtaTjY=; b=uvh7bpjmNiEeqD0eklzoJePRI0sVcaFr7rUbx/TNwC1O4JBYCOZJ6FDX4F/aOAQnuk wHfGA5ytv0+A5IfczD4tDh48Mj6DMoPsO7ZM5rZQYTccTmoVn7XL6CYX0nOSA16eW+yq OiFH02deuo6obgNUmmNNW+DtF3cK0+wbXfyUxuAMUOcLEaXEK3T/AxaZv5D8pf+lZGOd MkfXhwlfGUg+gRQP2BqL9KwhUXW/fPmYJUvBR2YO75zv1KupD2xM51lvMBBJaUpsIfEY hRLSGBdMwovkHcF86HyEXqGDgMH9cjmeTuKDZzCo+M7vOmbj3DGuKi7HsWK+69woaPTg IClw== ARC-Authentication-Results: i=1; mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id bf11-20020a170902b90b00b00153b2d1645asi809979plb.98.2022.04.07.14.27.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Apr 2022 14:27:52 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 95DB2460A04; Thu, 7 Apr 2022 13:28:42 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229586AbiDGUaf (ORCPT + 99 others); Thu, 7 Apr 2022 16:30:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55120 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229622AbiDGUaZ (ORCPT ); Thu, 7 Apr 2022 16:30:25 -0400 Received: from mail-oa1-f41.google.com (mail-oa1-f41.google.com [209.85.160.41]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 22B37488BF1; Thu, 7 Apr 2022 13:14:27 -0700 (PDT) Received: by mail-oa1-f41.google.com with SMTP id 586e51a60fabf-e1dcc0a327so7641417fac.1; Thu, 07 Apr 2022 13:14:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=m8g+U9TYp/KmmutHAdrKb6oEqOtOebbJJ9ukyAtaTjY=; b=XJcnhIpiYMOxhngocfK+VpucVypVNKWVH2ng3I8RijRkOd3swiqTfL8jFy0tSrDsY+ hXaULqkx1jxW4vIVVvwqRnpjf+cYvcj541XGwtZW9cgajD6EFUQu5vRnhPwTKfBtmQMp WhBBjn2zzBD4hQk+JgedEVj8PpfVuGF9/tS5Pjy8Wm5ca4hTGWZFVfEV79cC4cHuAvfh jzqboWNJ0Vjs78e4nkD6gj1ePU3Mu0NYJqX2k6TxyPFPF/G2c9ZGxQifRtId/0wevGak 07FL8jc9+95kzqReIO5aXZl/EBd38sVxnSR5E6n9P6vqLnQz9fj/br3IPoDzXKNKf6An MFEQ== X-Gm-Message-State: AOAM53196iJTGLtwCyVm1uje7/IdiF8kFKuUTVYlbn0dr5IA/S5fL16n AYFZExe7TAMDPHxkVuEtC5UHkXg3KQ== X-Received: by 2002:a54:4792:0:b0:2ef:7562:dcd7 with SMTP id o18-20020a544792000000b002ef7562dcd7mr6434763oic.263.1649361846938; Thu, 07 Apr 2022 13:04:06 -0700 (PDT) Received: from robh.at.kernel.org (66-90-144-107.dyn.grandenetworks.net. [66.90.144.107]) by smtp.gmail.com with ESMTPSA id ay5-20020a056820150500b00320f8a179d0sm8193572oob.30.2022.04.07.13.04.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Apr 2022 13:04:06 -0700 (PDT) Received: (nullmailer pid 1873984 invoked by uid 1000); Thu, 07 Apr 2022 20:04:05 -0000 Date: Thu, 7 Apr 2022 15:04:05 -0500 From: Rob Herring To: Philipp Zabel Cc: devicetree@vger.kernel.org, Krzysztof Kozlowski , Neil Armstrong , linux-kernel@vger.kernel.org, Stephen Warren Subject: Re: [PATCH 14/14] dt-bindings: reset: Convert to yaml Message-ID: References: <20220407154338.4190674-1-p.zabel@pengutronix.de> <20220407154338.4190674-14-p.zabel@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220407154338.4190674-14-p.zabel@pengutronix.de> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=no 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: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 07, 2022 at 05:43:38PM +0200, Philipp Zabel wrote: > Convert the common reset controller and reset consumer device tree > bindings to YAML schema. In general, common bindings should go in DT schema repo: https://github.com/devicetree-org/dt-schema/blob/main/dtschema/schemas/reset/reset.yaml Though part of the issue is dtschema is dual licensed and all the exsting text is GPL2, so permission to relicense is needed. That's why the schemas are just the schema and little description ATM. Shouldn't be too hard here with Stephen/NVIDIA being the only copyright holder. > Signed-off-by: Philipp Zabel > Cc: Stephen Warren > --- > .../bindings/reset/reset-consumer.yaml | 72 ++++++++++++++++++ > .../bindings/reset/reset-controller.yaml | 50 +++++++++++++ > .../devicetree/bindings/reset/reset.txt | 75 ------------------- > 3 files changed, 122 insertions(+), 75 deletions(-) > create mode 100644 Documentation/devicetree/bindings/reset/reset-consumer.yaml > create mode 100644 Documentation/devicetree/bindings/reset/reset-controller.yaml > delete mode 100644 Documentation/devicetree/bindings/reset/reset.txt > > diff --git a/Documentation/devicetree/bindings/reset/reset-consumer.yaml b/Documentation/devicetree/bindings/reset/reset-consumer.yaml > new file mode 100644 > index 000000000000..e17229eb49c0 > --- /dev/null > +++ b/Documentation/devicetree/bindings/reset/reset-consumer.yaml > @@ -0,0 +1,72 @@ > +# SPDX-License-Identifier: GPL-2.0 > +# Copyright 2012 Stephen Warren > +%YAML 1.2 > +--- > +$id: http://devicetree.org/schemas/reset/reset-consumer.yaml# > +$schema: http://devicetree.org/meta-schemas/core.yaml# > + > +title: Common reset signal consumer bindings > + > +maintainers: > + - Philipp Zabel > + > +description: | > + Hardware blocks typically receive a reset signal. This signal is generated by > + a reset provider (e.g. power management or clock module) and received by a > + reset consumer (the module being reset, or a module managing when a sub- > + ordinate module is reset). This binding exists to represent the consumers of > + reset signals provided by reset controllers. > + > + A reset signal is represented by the phandle of the provider, plus a reset > + specifier - a list of DT cells that represents the reset signal within the > + provider. The length (number of cells) and semantics of the reset specifier > + are dictated by the binding of the reset provider, although common schemes > + are described below. > + > + A word on where to place reset signal consumers in device tree: It is possible > + in hardware for a reset signal to affect multiple logically separate HW blocks > + at once. In this case, it would be unwise to represent this reset signal in > + the DT node of each affected HW block, since if activated, an unrelated block > + may be reset. Instead, reset signals should be represented in the DT node > + where it makes most sense to control it; this may be a bus node if all > + children of the bus are affected by the reset signal, or an individual HW > + block node for dedicated reset signals. The intent of this binding is to give > + appropriate software access to the reset signals in order to manage the HW, > + rather than to slavishly enumerate the reset signal that affects each HW > + block. > + > +select: true > + > +properties: > + resets: > + $ref: /schemas/types.yaml#/definitions/phandle-array > + description: | > + List of phandle and reset specifier pairs, one pair for each reset signal > + that affects the device, or that the device manages. > + Note: if the reset provider specifies '0' for "#reset-cells", then only > + the phandle portion of the pair will appear. > + > + reset-names: > + description: | > + List of reset signal name strings sorted in the same order as the resets > + property. Consumers drivers will use "reset-names" to match reset signal > + names with reset specifiers. > + > +additionalProperties: true > + > +examples: > + - | > + // A device with a single reset signal named "reset". > + device { > + resets = <&rst 20>; > + reset-names = "reset"; > + }; > + - | > + // A bus that controls the reset signal of each of four subordinate > + // devices. Consider for example a bus that fails to operate unless no > + // child device has reset asserted. > + bus { > + resets = <&rst 10>, <&rst 11>, <&rst 12>, <&rst 11>; > + reset-names = "i2s1", "i2s2", "dma", "mixer"; > + }; > +... > diff --git a/Documentation/devicetree/bindings/reset/reset-controller.yaml b/Documentation/devicetree/bindings/reset/reset-controller.yaml > new file mode 100644 > index 000000000000..33468f94f4c2 > --- /dev/null > +++ b/Documentation/devicetree/bindings/reset/reset-controller.yaml > @@ -0,0 +1,50 @@ > +# SPDX-License-Identifier: GPL-2.0 > +# Copyright 2021 Stephen Warren > +%YAML 1.2 > +--- > +$id: http://devicetree.org/schemas/reset/reset-controller.yaml# > +$schema: http://devicetree.org/meta-schemas/core.yaml# > + > +title: Common reset controller provider bindings > + > +maintainers: > + - Philipp Zabel > + > +description: | > + This binding is intended to represent the hardware reset signals present > + internally in most IC (SoC, FPGA, ...) designs. Reset signals for whole > + standalone chips are most likely better represented as GPIOs, although there > + are likely to be exceptions to this rule. > + > + Hardware blocks typically receive a reset signal. This signal is generated by > + a reset provider (e.g. power management or clock module) and received by a > + reset consumer (the module being reset, or a module managing when a sub- > + ordinate module is reset). This binding exists to represent the provider of > + one or more reset signals. > + > +select: > + anyOf: > + - properties: > + $nodename: > + pattern: '^reset-controller' This actually serves no purpose unless you made #reset-cells required. If the node name matches, the schema will be applied and be true whether #reset-cells is present or not. We were trying to define the node name for providers, but that breaks in cases of nodes that are multiple providers which as you know is common in this case. So we need to come up with another way of encouraging standard node names. > + - required: > + - '#reset-cells' > + > +properties: > + '#reset-cells': > + $ref: /schemas/types.yaml#/definitions/uint32 '#.*-cells' has a type already. The only thing you can really put here would be some constraint on the range of number of cells allowed and a description. > + > +additionalProperties: true > + > +examples: > + - | > + // A reset controller providing multiple reset controls > + rst: reset-controller { > + #reset-cells = <1>; > + }; > + > + // A reset consumer receiving a single reset signal with index 0 > + peripheral { > + resets = <&rst 0>; > + }; > +...