Received: by 10.192.165.148 with SMTP id m20csp3513485imm; Mon, 23 Apr 2018 07:50:04 -0700 (PDT) X-Google-Smtp-Source: AIpwx48DNEyOMD6hWXNOdtV3N9UH8hCTiJqTOnieFvXlN7Z6PyBwcHXo4/Gu5NQsjOtskIkyZKv1 X-Received: by 10.98.102.79 with SMTP id a76mr20226912pfc.162.1524495004888; Mon, 23 Apr 2018 07:50:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524495004; cv=none; d=google.com; s=arc-20160816; b=GUNCDFsh6h0ng/Op8aCRu5IGspb+Y6llzFw3wmEIIWwZw2aU0nu046k5Fw0E827r7m KEMFZDQ8FtMvpNz1THd+LSI+nBLp4arFeAxw7BkGFC3KBqs6T4lQ60sRP6FFy0jlxTyP qlC13yh36YkckX4CCjufbRMSfyJBQaqQ3uMvSCUOQC1eklcE6mWREslfOrwmmJHAFdvW IYi2q1nRgydkf4p+kdzeGlq+hGxFjyWaJ8ssJeKoiyZpwc6ofwctVZWPx1cWz+yZWERR De8As6p+2669aCx86PU1adSPoRZIsHIVg7Lk114/H7ge28rzCMgds2mHGNeIqbrbK/Uc TC/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:spamdiagnosticmetadata :spamdiagnosticoutput:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature:arc-authentication-results; bh=MCW4fe+KyzgytwraxwOYGfbDcLLW1Bwpaol6lE5WD+A=; b=YJU7/3nSAa4ZjCoeabc0H9zxdsauZMzhs3YUlXf032is1zWrVtp6y31FthjqpwVxe8 vHQhOY/ojOH/hJhUFvylg3pdsIhCmoc5VyzW5Rnuoh2LPqvIdWT0Rgp9uxC91uTmcW4v DbeBFztE8sejbP6bapxkP+e6AhVkplooSgEFR4Jwv/PFTLbVqfcy7DnkflVycH7zvumY slRfk/1Nl6s8vob2BUdrPN2S9ZS/olXcWcxRWfKBW41vLKgqCamaz0OfcMuguNaj0L7C yP9vAM7/ox22T/Vgk8rQtwHM17JOkGzGdSCU376l8FpQhvPPHWE7yFs6fOBWSxHLQLmE 3dLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@armh.onmicrosoft.com header.s=selector1-arm-com header.b=hYNvxNoq; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y11-v6si11004389pln.525.2018.04.23.07.49.50; Mon, 23 Apr 2018 07:50:04 -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=@armh.onmicrosoft.com header.s=selector1-arm-com header.b=hYNvxNoq; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755580AbeDWOsL (ORCPT + 99 others); Mon, 23 Apr 2018 10:48:11 -0400 Received: from mail-ve1eur01on0051.outbound.protection.outlook.com ([104.47.1.51]:22112 "EHLO EUR01-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755198AbeDWOsB (ORCPT ); Mon, 23 Apr 2018 10:48:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector1-arm-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=MCW4fe+KyzgytwraxwOYGfbDcLLW1Bwpaol6lE5WD+A=; b=hYNvxNoqDwPHrcFM+5k3OaxqPjW7/OqmepI2MIBDNDG0lDklJBmrQgjJ56pDQ4Z5dmENyckOiTJ86GoPaH/Yg3dMxX2cXSxbjNRkXuTipbTl4PwuU4ezp0+QRViyjeGE7XgsjEsGgvuql069Zuc1v5KdyDEtPG3n6jJzgyAUipc= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Grant.Likely@arm.com; Received: from C02T10KAHF1T.secretlab.ca (217.43.212.223) by VI1PR0801MB1759.eurprd08.prod.outlook.com (2603:10a6:800:5b::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.696.13; Mon, 23 Apr 2018 14:47:55 +0000 Subject: Re: [RFC PATCH] dt-bindings: add a jsonschema binding example To: Rob Herring , Frank Rowand Cc: devicetree@vger.kernel.org, devicetree-spec@vger.kernel.org, "linux-kernel@vger.kernel.org" , Mark Rutland , Geert Uytterhoeven , Linus Walleij , Thierry Reding , Mark Brown , Shawn Guo , Bjorn Andersson , Arnd Bergmann , Stephen Boyd , Jonathan Cameron References: <20180418222905.10414-1-robh@kernel.org> From: Grant Likely Message-ID: Date: Mon, 23 Apr 2018 15:47:51 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: quoted-printable X-Originating-IP: [217.43.212.223] X-ClientProxiedBy: LO2P265CA0190.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:a::34) To VI1PR0801MB1759.eurprd08.prod.outlook.com (2603:10a6:800:5b::8) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(5600026)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020);SRVR:VI1PR0801MB1759; X-Microsoft-Exchange-Diagnostics: 1;VI1PR0801MB1759;3:pv/BOP4OZYZAymRn95y9o7JIYEN9Kh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EATZ8GHcRd1XyH1JxccArCJ1ZJZJCLlWXj3zCa5Tf2yh69GpeU7jN7XF8WJX+BGKhMyxt1Nx0AOtUJHDg9Ad17w7852/OUy21+BzbTRbYydFAZeyA95IjD9Np9E8lZcCE67Uub7k5U4rQbs/4sWuH2CCbjRcVntolNkci1CgvAWRKXjj25oMMeCeth1VJ0H2kSGLkqJM4yYsf5HmJevG7S1Hzkqy+PkfR5COJDOJBqeu///E5SPyAu/R1UFqc3NBxmt163MFqa0+RklZPe36e7ltQrsOGhjmkVfmhH4nziYDxUvoC4Q;4:wUvnfvvhdxA042fopKvyZ+x135vtCy13DjnEu0VxXnLe+1gio2oWN3Gpwwso/ECu7VNqV8Z+XSmOQleCG7BHpAleU+o5D/R6dMkBlK9vGCNFx6BWNgPFH6iwOmDZPDflD9MMmWHXeJdt+EZglkIZf7KQUWi7J8Y7b5SkIqapV84Z6wooCoUdTojxVGoEVfwDshpwDL+9w344/zHI+oSEm61EBrAPTKr6Sk1sPCyIRkC3SZwvHT/U5m7MDvtkaqqdwxn7D3qTMqCUjOk1l8uc5MISno9K4hEqvvQEEnXQ3eVRRA4gaIoRcGK9c2DbBLVYbdF+uy2dnj+wuZkjBtYmdIM5dFB1inpUsStCD8zr0JpXJc2tZD5WDJpZFdqzXFzZ X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(166708455590820)(35073007944872)(85827821059158); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(10201501046)(3231232)(944501410)(52105095)(3002001)(93006095)(93001095)(6055026)(6041310)(20161123560045)(20161123564045)(20161123562045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011);SRVR:VI1PR0801MB1759;BCL:0;PCL:0;RULEID:;SRVR:VI1PR0801MB1759; X-Forefront-PRVS: 06515DA04B X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(366004)(396003)(39860400002)(376002)(39380400002)(346002)(40434004)(51914003)(2486003)(386003)(52116002)(31696002)(6116002)(6506007)(316002)(25786009)(186003)(39060400002)(6246003)(53376002)(50466002)(81166006)(47776003)(58726001)(36756003)(476003)(26005)(229853002)(6486002)(3846002)(76176011)(6666003)(110136005)(67846002)(64126003)(54906003)(7736002)(23676004)(65806001)(86362001)(65956001)(53546011)(6512007)(8936002)(59450400001)(16526019)(52146003)(65826007)(478600001)(5890100001)(44832011)(58126008)(53936002)(6306002)(66066001)(305945005)(575784001)(956004)(8676002)(446003)(11346002)(7416002)(2906002)(5660300001)(72206003)(8746002)(31686004)(4326008)(53416004)(2616005)(966005)(58736002);DIR:OUT;SFP:1101;SCL:1;SRVR:VI1PR0801MB1759;H:C02T10KAHF1T.secretlab.ca;FPR:;SPF:None;LANG:en;MLV:ovrnspm;PTR:InfoNoRecords; Received-SPF: None (protection.outlook.com: arm.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtWSTFQUjA4MDFNQjE3NTk7MjM6Q0ZZaVh0dGVrMXY2eUp3YmpkM1orMHJM?= =?utf-8?B?R2lIdFQ2Q2ZBdDNpa3BWZ1JxclEzZWV5RTg1NG9nZ3REcnl4VjVHOGtGNGY4?= =?utf-8?B?bHdrbVVjS3VsZDR6N1F6WTlGZTIwRFJEME5VTThBYnlnUjNCTXhNRExndlRO?= =?utf-8?B?ZGp1RG1jRUFxUm0xV0pvcnRvTHM2NGhzTTZkb2lJa3BSdS85S2R2ODEzN3lq?= =?utf-8?B?KzlSKytubXNsdVAzdGFhcjg5VWJZenN4MzNIUVZ4QlRMRU0xVlRJMTRWVEZL?= =?utf-8?B?SjdhSWw3d0NWYWNRMlBWMitMRmYyeGdVOEN2blRkK1NIUWNmckdVSkl5L25U?= =?utf-8?B?Q2ZMak00WGp6Rk1mUEJQZCtOWkplRWNSN2NySlIzbC84ME9uYlBxdzFHUThZ?= =?utf-8?B?dzAyS2ZpQXlQbzl5SEFrdDF0c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soft-Antispam-Message-Info: PeFfRNiTaqDq49IxUp04TZZPNjANs6uYj+F54ER9/3JTSyZRjzYS1bqT6Fn9nYEBScf8gQ2Gp/jBIWUGo+q6gSVL2TBvIIieJ6vaMhR38mJWrOJOgql6qOOXYFt8J5+h0Z/haIY9DI7oucp8fBSpOV33JwVSK+agK3b3LNvuaNXSwoXmin79Psde54jeAYdV X-Microsoft-Exchange-Diagnostics: 1;VI1PR0801MB1759;6:GP0Ln6uuFujuhQFNgYTvxkyv5ZrJTo/mkvy34ALCVBhvMTZmuESBVMNQK8lWci3Ei27dvaMLaTthSIwIa+2s2fIZ2lrkeG7R1ID5IBHBLVWzlnn3xpxPIIkbPE9kA3cklSmSk56pZLD5fpToU7zOqq64JNUWh+ttyZ2ciTQgnbVuPbyYqYm/zUvuCSdNeTh09BaAnNmr4Oa5kQZAP/IWRDV35zqzxjPFjB2qIXWDHnyIft35lIV7ieDmqwfDqxzd76CVXhUxlIfscBLHBbbYrNci4UV/nl4UV4KObOdmYs+G6dLJVvSnJMkDuyp2lYJVvXU/Q2jaf3X2WKAd0j0l33FkQOTcnqQlwCWLgP/rk8UOxH8lq/LRtvJx/4Imn0/Rh/UfYZnEgDgDXAZ+yPyaejnxYw3UuYWxfzOsq7uYsVlK8nfBWB3VQQr1105U8yr33MA9YeSAhuZXIi1D+7Xwrg==;5:YA6SOhKir73Rde3qAXI0xegtNWmL5zBG/TvSMJvCLbhA6uDijMLbGDWX53AyDRwEKd+WjUBDqszSi9GeFGz+dqCWakndORIYHjOOWCkpxBGDlhawwYeOHvHHXT/OFO7L57ng2MxmHMeKgMrryd4ny0qp5tt2NM8rz0eYshRdcsY=;24:G0ExxjDi6hRnaLfwldLltnuB0CfUVqw2KUhnhesmkgp6E3MrGR8XMEs6sMVLY7u2eWhr7jBPKnT7qFcmawMJauY1iqrqc2EboiETbGnveQ8= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;VI1PR0801MB1759;7:nvmsjP73MKEc8cm1cPQ9yGuT7HJ3avqB/kI4Bawra79a3XxI6477ZvaPBRn5NJlm9rvWpOqi92aAoMgk5cDB9czDBtTHy7Y4bhxfxn02PZpZ1DZAhefvUA1n8Zj2iJoYzEGFZ/vFvaaKd2GdEqXV1A9d5MBmI2kn8XM+acqWZtj5Hq5kPGDbxMDVTKNiTcyeEnSoIlMEccmnBCC3UT/G9eY44f3E+gcuqSjjXt0l9dM1gO27p3Hz4oc9PU8rOoYS X-MS-Office365-Filtering-Correlation-Id: aa968362-6b87-4459-8a37-08d5a92933fb X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Apr 2018 14:47:55.8981 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: aa968362-6b87-4459-8a37-08d5a92933fb X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0801MB1759 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 21/04/2018 02:28, Rob Herring wrote: > On Fri, Apr 20, 2018 at 4:00 PM, Frank Rowand wr= ote: >> Hi Rob, >> >> Thanks for the example. It was a good starting tutorial of sorts for me >> to understand the format a bit. >> >> >> On 04/18/18 15:29, Rob Herring wrote: >>> The current DT binding documentation format of freeform text is painful >>> to write, review, validate and maintain. >>> >>> This is just an example of what a binding in the schema format looks >>> like. It's using jsonschema vocabulary in a YAML encoded document. Usin= g >>> jsonschema gives us access to existing tooling. A YAML encoding gives u= s >>> something easy to edit. >>> >>> This example is just the tip of the iceberg, but it the part most >>> developers writing bindings will interact with. Backing all this up >>> are meta-schema (to validate the binding schemas), some DT core schema, >>> YAML encoded DT output with dtc, and a small number of python scripts t= o >>> run validation. The gory details including how to run end-to-end >>> validation can be found here: >>> >>> https://www.spinics.net/lists/devicetree-spec/msg00649.html >>> >>> Signed-off-by: Rob Herring >>> --- >>> Cc list, >>> You all review and/or write lots of binding documents. I'd like some fe= edback >>> on the format. >>> >>> Thanks, >>> Rob >>> >>> .../devicetree/bindings/example-schema.yaml | 149 ++++++++++++= +++++++++ >>> 1 file changed, 149 insertions(+) >>> create mode 100644 Documentation/devicetree/bindings/example-schema.y= aml >>> >>> diff --git a/Documentation/devicetree/bindings/example-schema.yaml b/Do= cumentation/devicetree/bindings/example-schema.yaml >>> new file mode 100644 >>> index 000000000000..fe0a3bd1668e >>> --- /dev/null >>> +++ b/Documentation/devicetree/bindings/example-schema.yaml >> >> I'm guessing by the path name that this is in the Linux kernel source tr= ee. > > Yes, well, my kernel tree. Most of the work still lives here: > > https://github.com/robherring/yaml-bindings/ > >>> @@ -0,0 +1,149 @@ >>> +# SPDX-License-Identifier: BSD-2-Clause >> >> If in the Linux kernel source tree, then allow gpl-v2 as a possible lice= nse. > > Why? BSD is compatible. The license of the above repo is all BSD. > > Of course there's all the existing docs which default to GPLv2 and > we'll probably have to maintain that. > >>> +# Copyright 2018 Linaro Ltd. >>> +%YAML 1.2 >>> +--- >>> +# All the top-level keys are standard json-schema keywords except for >>> +# 'maintainers' and 'select' >>> + >>> +# $id is a unique idenifier based on the filename >> >> ^^^^^^^^^ identifier >> >>> +$id: "http://devicetree.org/schemas/example-schema.yaml#" >> >> Does this imply that all schemas will be at devicetree.org instead >> of in the Linux kernel source tree? This would be counter to my >> earlier guess about where this patch is applied. > > They could be, but not necessarily. This is just convention in > jsonschema is the best I understand it. > > I don't think you'd want validation to require an internet connection. > For the base meta-schema, for example, it does exist at > http://json-schema.org/draft-06/schema, but that's also distributed > with implementations of jsonschema validators. > > A large part (not that any part is large) of the tools Grant and I > have written is doing the cross reference resolution of files which > uses the $id field. > > >>> +$schema: "http://devicetree.org/meta-schemas/core.yaml#" >> >> How is $schema used? > > Tells the validator what meta-schema this schema follows. Typically > you see draft04 or draft06 here if you haven't written a meta-schema. On this topic, we should probably do the same thing for the dt metaschemas. I didn't worry about it initially because there was a lot of working out what it should look like, but we should include a revision number in the DT metaschema $id URLs. >> Is it accessed across the network? > > Could be, but generally no. The $schema and $id values are used as unique identifiers. The parser is setup to look locally for both devicetree.org and json-schema.org URLs, so network access is not used. The parser /can/ fetch a URL over the network, but that isn't a feature we want to use. Using the http://devicetree.org/ prefix makes sense for the metaschema, and for all the schema files because I think the desire is to have a common database for all users. For practical reasons it makes sense to start with putting them in the Linux kernel tree, but only because that's where all the binding documents currently are. However, we also have the DT rebasing tree that is tracking mainline and has a good structure. We can start encouraging non-Linux users to base off the -rebasing tree, and work on transition plans to allow patches against -rebasing, and to eventually make it the master tree instead of the kernel. It is also possible to have other prefixes for schemas that don't belong in the common repo (but I cannot think of many good reasons for doing that)= . >> >> (This example file provides a good example of a single syntax style, but= does >> not preclude other equivalent syntax.) > > There's also a question of formatting. For example, we can have: > > enum: [1,2,3] > > or > > enum: > - 1 > - 2 > - 3 > > IMO, we should lock that down too. I don't think this level of variance needs to be locked down. That is a very basic example of standard YAML encoding of lists. There are times when one will look better than the other, and it isn't a lot different from the kinds of things we do in C. For example: int a; int b; vs. int a, b; On Jsonschema vocabulary? Yes, start with it restricted because there may be unintended consequences. But for YAML syntax, I would rely on the metaschema to make sure the structure of the data is correct, but not get worried about the encoding. [...] >>> + interrupts: >>> + # Either 1 or 2 interrupts can be present >>> + minItems: 1 >>> + maxItems: 2 >>> + items: >>> + - description: tx or combined interrupt >>> + - description: rx interrupt >>> + >>> + description: | >>> + A variable number of interrupts warrants a description of what c= onditions >>> + affect the number of interrupts. Otherwise, descriptions on stan= dard >>> + properties are not necessary. >>> + >>> + interrupt-names: >>> + # minItems must be specified here because the default would be 2 >>> + minItems: 1 >> >> Why the difference between the interrupts property and the interrupt-nam= es >> property (specifying maxItems for interrupt, but not interrupt-names)? > > I should probably have maxItems here too. > >> Others have already commented on a desire to have a way to specify that >> number of interrupts should match number of interrupt-names. > > Yeah, but I don't see a way to do that. You could stick the array size > constraints in a common definition and have a $ref to that definition > from both, but that doesn't really save you too much. There has been discussions in the jsonschema community regarding referencing data in the document when applying the schema. https://github.com/json-schema-org/json-schema-spec/issues/549 However, those discussions are ongoing and have been pushed back to after draft-8 (the current release is draft-7). We can instead define DT-specific keywords and extend the validator to make it do what we want. We need to do something very similar to validate that the length of tuples in 'reg', 'interrupts', and '*gpios' match the '#*-cells' values. IMPORTANT NOTICE: The contents of this email and any attachments are confid= ential and may also be privileged. If you are not the intended recipient, p= lease notify the sender immediately and do not disclose the contents to any= other person, use it for any purpose, or store or copy the information in = any medium. Thank you.