From patchwork Fri Oct 5 16:58:12 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Rob Herring (Arm)" X-Patchwork-Id: 979626 Return-Path: X-Original-To: incoming-imx@patchwork.ozlabs.org Delivered-To: patchwork-incoming-imx@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="ap6S0OJ5"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 42RbcW4tk0z9s55 for ; Sat, 6 Oct 2018 03:00:59 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=fqSFydop16vYCLhW4HGwYas7nt/6myFBIz3Cj6wWXlE=; b=ap6S0OJ5xIuEKo 6TqSPSaBXle0LgKYDH5oHKCmSlUMeS6Egrj8wPKM5rqQbuDBs+peXEToxC1fQ0MlWIhXp/tsn0Pqq 14npF/960pPcC3TlJEoD2M6wg/F8DDcW79R8xrYFgQHJnOCkLnwIBi98+qZgQfBSLsqfGEnnjaZTi BSzKT/EhHdKph12lOhnZsQ/IVGSE7V6IZKW2DslAl8qzhH9lbhz7OGuVLfxcdsEWy5Y1CNnIMfyUi qyqY/3TfZi9uWyIrTjI8tK16s7NcN+Q26avPa+F9oztQW/WMH04ouzAf/rLqNoasmxxleZA35R+6m YJSyRbMh6MiILIGf2Hpg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1g8TT5-0000yu-Nn; Fri, 05 Oct 2018 17:00:47 +0000 Received: from mail-ot1-f45.google.com ([209.85.210.45]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1g8TRO-0007Ya-GT for linux-arm-kernel@lists.infradead.org; Fri, 05 Oct 2018 16:59:19 +0000 Received: by mail-ot1-f45.google.com with SMTP id o21so13055213otb.13 for ; Fri, 05 Oct 2018 09:58:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=2H5TWm/H0mjutjCIY7LBeMKuqNZFs88YFnIbfjaa4Us=; b=ApKzl2cgYuFdIPQrVWlJ6SqIjMrbuK6TEdW7qpd5Tl0SFTwegqW+BA8riOvHkb1NT8 ahhFEFgGHNxIkXKYS3hFj9PtvNkSjDDfLS5oXgQrI/Lw7F/6jeXAgX+HBEPBH2gOZZbQ ZqS9rMrSkW51E2G+CJReyq+uCYDAp/1HfJMmIR/dwugnX9WRRmK8kVHC6aiSkHp2zvpy Nh4oiJxZBVWz3scK2W2eMrK+zF8GYAZcxR3htLAHw3jeRRRl5nV4JYY8OyU7CcDs37sG V9Per7Q6IeGMuJ4Vrh9XQwxd1xkMOEYKGe8D8QVhXFij+JHQGkFnGMLu9wJP4KaRUty4 +elQ== X-Gm-Message-State: ABuFfoib698cfafy1WX9ECIsAVbvNY8onh9HbR7vKdPTC64bAO5poau/ jk14JpgRtg7JANAh5dWgQQ== X-Google-Smtp-Source: ACcGV60WUWdaXiwzhdMITdQ9ubAhOA3zBfrGJTp2HugmJjP1enuNMMsN8DTPobelUqkXaCwDuaTDkA== X-Received: by 2002:a9d:3cd0:: with SMTP id t16mr7183164otf.158.1538758730142; Fri, 05 Oct 2018 09:58:50 -0700 (PDT) Received: from xps15.herring.priv (24-155-109-49.dyn.grandenetworks.net. [24.155.109.49]) by smtp.googlemail.com with ESMTPSA id u63-v6sm2904328ota.75.2018.10.05.09.58.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 05 Oct 2018 09:58:49 -0700 (PDT) From: Rob Herring To: linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org Subject: [PATCH 00/36] Devicetree schema Date: Fri, 5 Oct 2018 11:58:12 -0500 Message-Id: <20181005165848.3474-1-robh@kernel.org> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181005_095902_604095_90B5EA7C X-CRM114-Status: GOOD ( 18.59 ) X-Spam-Score: 0.8 (/) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (0.8 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [209.85.210.45 listed in list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (robherring2[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record 0.2 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level mail domains are different 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit (robherring2[at]gmail.com) 0.2 FREEMAIL_FORGED_FROMDOMAIN 2nd level domains in From and EnvelopeFrom freemail headers are different X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Tom Rini , Kumar Gala , Grant Likely , Arnd Bergmann , Linus Walleij , Pantelis Antoniou , Bjorn Andersson , Mark Brown , Geert Uytterhoeven , Olof Johansson , Frank Rowand , Jonathan Cameron Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org List-Id: linux-imx-kernel.lists.patchwork.ozlabs.org The current DT binding documentation is not ideal as it is just free form text with at most only a loose structure. This makes reviewing bindings a manual process. The bindings are often duplicating information that's already defined elsewhere and missing information one would need to validate a DTS file. The examples in binding documents are not built and a source of lots of typos sometimes found in review and sometimes not. Secondly, there's no verification that DTS files match what the documentation says. While dtc does do some checking (and has gained more recently), it can't do per binding checks as it would have to understand thousands of compatible strings to match on. There's been a number of proposals over the years to address validation. They've all suffered from inventing their own validation language and the effort it would take to fully define and flush out a validation language. Enter json-schema. The language has a defined specification, maps well to DT data, and there are numerous existing tools which can be leveraged. The actual DT schema doc files are stored as YAML using only a JSON compatible subset. YAML is considered more human readable allowing comments for example. This series adds the build support, some documentation, and converts some bindings (mostly ARM board/soc bindings). The tools, core schema, and meta-schema are in a separate repository[1]. This might eventually be integrated with dtc or added to the kernel, but for now I plan to keep it separate. Future plans/ideas: - Validate examples against the schema. Currently, they are just built with dtc. - Support single targets in addition to validating all enabled dtb targets. - Better control of which schemas to use for validation such as core only or specific lists of schemas. This will make for more easily testing new schema and filtering warnings. - Printing out nodes without any specific schema (i.e. missing schema). This series is dependent on the dt/next branch and is available here[2]. The branch also has a doc2yaml script which can help convert binding files. It's not perfect, but works pretty well considering the input is free form text. Rob [1] https://github.com/robherring/yaml-bindings [2] git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git yaml-bindings Rob Herring (36): dt-bindings: arm: alpine: Move CPU control related binding to cpu-enable-method/al,alpine-smp dt-bindings: arm: amlogic: Move 'amlogic,meson-gx-ao-secure' binding to its own file dt-bindings: arm: atmel: Move various sys registers out of SoC binding doc dt-bindings: arm: fsl: Move DCFG and SCFG bindings to their own docs dt-bindings: arm: renesas: Move 'renesas,prr' binding to its own doc dt-bindings: arm: zte: Move sysctrl bindings to their own doc kbuild: Add support for DT binding schema checks dt-bindings: Add a writing DT schemas how-to and annotated example dt-bindings: Convert trivial-devices.txt to json-schema dt-bindings: altera: Convert clkmgr binding to json-schema dt-bindings: timer: Convert ARM timer bindings to json-schema dt-bindings: arm: Convert cpu binding to json-schema dt-bindings: arm: Convert PMU binding to json-schema dt-bindings: arm: Convert primecell binding to json-schema dt-bindings: arm: Convert Actions Semi bindings to jsonschema dt-bindings: arm: Convert Alpine board/soc bindings to json-schema dt-bindings: arm: Convert Altera board/soc bindings to json-schema dt-bindings: arm: Convert Amlogic board/soc bindings to json-schema dt-bindings: arm: Convert Atmel board/soc bindings to json-schema dt-bindings: arm: Convert Calxeda board/soc bindings to json-schema dt-bindings: arm: Convert TI davinci board/soc bindings to json-schema dt-bindings: arm: Convert FSL board/soc bindings to json-schema dt-bindings: arm: Convert MediaTek board/soc bindings to json-schema dt-bindings: arm: Convert TI nspire board/soc bindings to json-schema dt-bindings: arm: Convert Oxford Semi board/soc bindings to json-schema dt-bindings: arm: Convert QCom board/soc bindings to json-schema dt-bindings: arm: Convert Realtek board/soc bindings to json-schema dt-bindings: arm: Convert Rockchip board/soc bindings to json-schema dt-bindings: arm: Convert Renesas board/soc bindings to json-schema dt-bindings: arm: Convert CSR SiRF board/soc bindings to json-schema dt-bindings: arm: Convert SPEAr board/soc bindings to json-schema dt-bindings: arm: Convert ST STi board/soc bindings to json-schema dt-bindings: arm: Convert Tegra board/soc bindings to json-schema dt-bindings: arm: Convert VIA board/soc bindings to json-schema dt-bindings: arm: Convert Xilinx board/soc bindings to json-schema dt-bindings: arm: Convert ZTE board/soc bindings to json-schema .gitignore | 1 + Documentation/Makefile | 2 +- Documentation/devicetree/bindings/.gitignore | 2 + Documentation/devicetree/bindings/Makefile | 30 ++ .../devicetree/bindings/arm/actions.txt | 56 -- .../devicetree/bindings/arm/actions.yaml | 34 ++ .../devicetree/bindings/arm/al,alpine.txt | 88 --- .../devicetree/bindings/arm/al,alpine.yaml | 21 + .../devicetree/bindings/arm/altera.txt | 14 - .../devicetree/bindings/arm/altera.yaml | 20 + .../arm/altera/socfpga-clk-manager.txt | 11 - .../arm/altera/socfpga-clk-manager.yaml | 30 ++ .../devicetree/bindings/arm/amlogic.txt | 131 ----- .../devicetree/bindings/arm/amlogic.yaml | 104 ++++ .../amlogic/amlogic,meson-gx-ao-secure.txt | 28 + .../devicetree/bindings/arm/armadeus.txt | 6 - .../devicetree/bindings/arm/atmel-at91.yaml | 132 +++++ .../arm/{atmel-at91.txt => atmel-sysregs.txt} | 73 +-- Documentation/devicetree/bindings/arm/bhf.txt | 6 - .../devicetree/bindings/arm/calxeda.txt | 15 - .../devicetree/bindings/arm/calxeda.yaml | 22 + .../bindings/arm/compulab-boards.txt | 25 - .../arm/cpu-enable-method/al,alpine-smp | 34 +- .../devicetree/bindings/arm/cpus.txt | 490 ----------------- .../devicetree/bindings/arm/cpus.yaml | 503 ++++++++++++++++++ .../devicetree/bindings/arm/davinci.txt | 25 - .../arm/freescale/fsl,layerscape-dcfg.txt | 19 + .../arm/freescale/fsl,layerscape-scfg.txt | 19 + Documentation/devicetree/bindings/arm/fsl.txt | 224 -------- .../devicetree/bindings/arm/fsl.yaml | 166 ++++++ .../devicetree/bindings/arm/i2se.txt | 22 - .../devicetree/bindings/arm/mediatek.txt | 79 --- .../devicetree/bindings/arm/mediatek.yaml | 85 +++ .../devicetree/bindings/arm/nspire.txt | 14 - .../devicetree/bindings/arm/olimex.txt | 10 - .../devicetree/bindings/arm/oxnas.txt | 14 - .../devicetree/bindings/arm/oxnas.yaml | 25 + Documentation/devicetree/bindings/arm/pmu.txt | 70 --- .../devicetree/bindings/arm/pmu.yaml | 96 ++++ .../devicetree/bindings/arm/primecell.txt | 46 -- .../devicetree/bindings/arm/primecell.yaml | 35 ++ .../devicetree/bindings/arm/qcom.txt | 57 -- .../devicetree/bindings/arm/qcom.yaml | 125 +++++ .../devicetree/bindings/arm/realtek.txt | 22 - .../devicetree/bindings/arm/realtek.yaml | 25 + .../devicetree/bindings/arm/renesas,prr.txt | 18 + .../devicetree/bindings/arm/rockchip.txt | 220 -------- .../devicetree/bindings/arm/rockchip.yaml | 242 +++++++++ .../devicetree/bindings/arm/shmobile.txt | 161 ------ .../devicetree/bindings/arm/shmobile.yaml | 205 +++++++ .../devicetree/bindings/arm/sirf.txt | 11 - .../devicetree/bindings/arm/sirf.yaml | 27 + .../devicetree/bindings/arm/spear.txt | 26 - .../devicetree/bindings/arm/spear.yaml | 25 + Documentation/devicetree/bindings/arm/sti.txt | 23 - .../devicetree/bindings/arm/sti.yaml | 23 + .../devicetree/bindings/arm/technologic.txt | 23 - .../devicetree/bindings/arm/tegra.txt | 60 --- .../devicetree/bindings/arm/tegra.yaml | 88 +++ .../devicetree/bindings/arm/ti/nspire.yaml | 24 + .../bindings/arm/ti/ti,davinci.yaml | 26 + .../devicetree/bindings/arm/vt8500.txt | 22 - .../devicetree/bindings/arm/vt8500.yaml | 23 + .../devicetree/bindings/arm/xilinx.txt | 83 --- .../devicetree/bindings/arm/xilinx.yaml | 81 +++ .../bindings/arm/{zte.txt => zte-sysctrl.txt} | 15 +- .../devicetree/bindings/arm/zte.yaml | 26 + .../devicetree/bindings/example-schema.yaml | 155 ++++++ .../bindings/timer/arm,arch_timer.txt | 112 ---- .../bindings/timer/arm,arch_timer.yaml | 103 ++++ .../bindings/timer/arm,arch_timer_mmio.yaml | 120 +++++ .../bindings/timer/arm,global_timer.txt | 27 - .../bindings/timer/arm,global_timer.yaml | 46 ++ .../devicetree/bindings/trivial-devices.txt | 201 ------- .../devicetree/bindings/trivial-devices.yaml | 414 ++++++++++++++ Documentation/devicetree/writing-schema.md | 111 ++++ Makefile | 8 +- scripts/Makefile.lib | 24 +- 78 files changed, 3344 insertions(+), 2485 deletions(-) create mode 100644 Documentation/devicetree/bindings/.gitignore create mode 100644 Documentation/devicetree/bindings/Makefile delete mode 100644 Documentation/devicetree/bindings/arm/actions.txt create mode 100644 Documentation/devicetree/bindings/arm/actions.yaml delete mode 100644 Documentation/devicetree/bindings/arm/al,alpine.txt create mode 100644 Documentation/devicetree/bindings/arm/al,alpine.yaml delete mode 100644 Documentation/devicetree/bindings/arm/altera.txt create mode 100644 Documentation/devicetree/bindings/arm/altera.yaml delete mode 100644 Documentation/devicetree/bindings/arm/altera/socfpga-clk-manager.txt create mode 100644 Documentation/devicetree/bindings/arm/altera/socfpga-clk-manager.yaml delete mode 100644 Documentation/devicetree/bindings/arm/amlogic.txt create mode 100644 Documentation/devicetree/bindings/arm/amlogic.yaml create mode 100644 Documentation/devicetree/bindings/arm/amlogic/amlogic,meson-gx-ao-secure.txt delete mode 100644 Documentation/devicetree/bindings/arm/armadeus.txt create mode 100644 Documentation/devicetree/bindings/arm/atmel-at91.yaml rename Documentation/devicetree/bindings/arm/{atmel-at91.txt => atmel-sysregs.txt} (67%) delete mode 100644 Documentation/devicetree/bindings/arm/bhf.txt delete mode 100644 Documentation/devicetree/bindings/arm/calxeda.txt create mode 100644 Documentation/devicetree/bindings/arm/calxeda.yaml delete mode 100644 Documentation/devicetree/bindings/arm/compulab-boards.txt delete mode 100644 Documentation/devicetree/bindings/arm/cpus.txt create mode 100644 Documentation/devicetree/bindings/arm/cpus.yaml delete mode 100644 Documentation/devicetree/bindings/arm/davinci.txt create mode 100644 Documentation/devicetree/bindings/arm/freescale/fsl,layerscape-dcfg.txt create mode 100644 Documentation/devicetree/bindings/arm/freescale/fsl,layerscape-scfg.txt delete mode 100644 Documentation/devicetree/bindings/arm/fsl.txt create mode 100644 Documentation/devicetree/bindings/arm/fsl.yaml delete mode 100644 Documentation/devicetree/bindings/arm/i2se.txt delete mode 100644 Documentation/devicetree/bindings/arm/mediatek.txt create mode 100644 Documentation/devicetree/bindings/arm/mediatek.yaml delete mode 100644 Documentation/devicetree/bindings/arm/nspire.txt delete mode 100644 Documentation/devicetree/bindings/arm/olimex.txt delete mode 100644 Documentation/devicetree/bindings/arm/oxnas.txt create mode 100644 Documentation/devicetree/bindings/arm/oxnas.yaml delete mode 100644 Documentation/devicetree/bindings/arm/pmu.txt create mode 100644 Documentation/devicetree/bindings/arm/pmu.yaml delete mode 100644 Documentation/devicetree/bindings/arm/primecell.txt create mode 100644 Documentation/devicetree/bindings/arm/primecell.yaml delete mode 100644 Documentation/devicetree/bindings/arm/qcom.txt create mode 100644 Documentation/devicetree/bindings/arm/qcom.yaml delete mode 100644 Documentation/devicetree/bindings/arm/realtek.txt create mode 100644 Documentation/devicetree/bindings/arm/realtek.yaml create mode 100644 Documentation/devicetree/bindings/arm/renesas,prr.txt delete mode 100644 Documentation/devicetree/bindings/arm/rockchip.txt create mode 100644 Documentation/devicetree/bindings/arm/rockchip.yaml delete mode 100644 Documentation/devicetree/bindings/arm/shmobile.txt create mode 100644 Documentation/devicetree/bindings/arm/shmobile.yaml delete mode 100644 Documentation/devicetree/bindings/arm/sirf.txt create mode 100644 Documentation/devicetree/bindings/arm/sirf.yaml delete mode 100644 Documentation/devicetree/bindings/arm/spear.txt create mode 100644 Documentation/devicetree/bindings/arm/spear.yaml delete mode 100644 Documentation/devicetree/bindings/arm/sti.txt create mode 100644 Documentation/devicetree/bindings/arm/sti.yaml delete mode 100644 Documentation/devicetree/bindings/arm/technologic.txt delete mode 100644 Documentation/devicetree/bindings/arm/tegra.txt create mode 100644 Documentation/devicetree/bindings/arm/tegra.yaml create mode 100644 Documentation/devicetree/bindings/arm/ti/nspire.yaml create mode 100644 Documentation/devicetree/bindings/arm/ti/ti,davinci.yaml delete mode 100644 Documentation/devicetree/bindings/arm/vt8500.txt create mode 100644 Documentation/devicetree/bindings/arm/vt8500.yaml delete mode 100644 Documentation/devicetree/bindings/arm/xilinx.txt create mode 100644 Documentation/devicetree/bindings/arm/xilinx.yaml rename Documentation/devicetree/bindings/arm/{zte.txt => zte-sysctrl.txt} (62%) create mode 100644 Documentation/devicetree/bindings/arm/zte.yaml create mode 100644 Documentation/devicetree/bindings/example-schema.yaml delete mode 100644 Documentation/devicetree/bindings/timer/arm,arch_timer.txt create mode 100644 Documentation/devicetree/bindings/timer/arm,arch_timer.yaml create mode 100644 Documentation/devicetree/bindings/timer/arm,arch_timer_mmio.yaml delete mode 100644 Documentation/devicetree/bindings/timer/arm,global_timer.txt create mode 100644 Documentation/devicetree/bindings/timer/arm,global_timer.yaml delete mode 100644 Documentation/devicetree/bindings/trivial-devices.txt create mode 100644 Documentation/devicetree/bindings/trivial-devices.yaml create mode 100644 Documentation/devicetree/writing-schema.md Acked-by: Shawn Guo Acked-by: Shawn Guo Acked-by: Shawn Guo Acked-by: Michal Simek --- 2.17.1