From patchwork Thu Feb 20 18:06:51 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomasz Figa X-Patchwork-Id: 3689161 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 47947BF13A for ; Thu, 20 Feb 2014 18:14:51 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6EDB120145 for ; Thu, 20 Feb 2014 18:14:50 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 659E320131 for ; Thu, 20 Feb 2014 18:14:49 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WGY7Z-0001os-2O; Thu, 20 Feb 2014 18:13:17 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WGY2e-00081R-Lv; Thu, 20 Feb 2014 18:08:12 +0000 Received: from mailout4.w1.samsung.com ([210.118.77.14]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WGY26-0007xU-6E for linux-arm-kernel@lists.infradead.org; Thu, 20 Feb 2014 18:07:39 +0000 Received: from eucpsbgm1.samsung.com (unknown [203.254.199.244]) by mailout4.w1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0N1B00DK03O3GY80@mailout4.w1.samsung.com> for linux-arm-kernel@lists.infradead.org; Thu, 20 Feb 2014 18:07:15 +0000 (GMT) X-AuditID: cbfec7f4-b7f796d000005a13-e0-5306445274d9 Received: from eusync3.samsung.com ( [203.254.199.213]) by eucpsbgm1.samsung.com (EUCPMTA) with SMTP id F4.B6.23059.25446035; Thu, 20 Feb 2014 18:07:14 +0000 (GMT) Received: from AMDC1227.digital.local ([106.116.147.199]) by eusync3.samsung.com (Oracle Communications Messaging Server 7u4-23.01(7.0.4.23.0) 64bit (built Aug 10 2011)) with ESMTPA id <0N1B00D1E3NTAA00@eusync3.samsung.com>; Thu, 20 Feb 2014 18:07:14 +0000 (GMT) From: Tomasz Figa To: devicetree-compiler@vger.kernel.org Subject: [PATCH RFC 5/5] Add sample DTS and DTSS schema Date: Thu, 20 Feb 2014 19:06:51 +0100 Message-id: <1392919611-10746-6-git-send-email-t.figa@samsung.com> X-Mailer: git-send-email 1.8.5.2 In-reply-to: <1392919611-10746-1-git-send-email-t.figa@samsung.com> References: <1392919611-10746-1-git-send-email-t.figa@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrNLMWRmVeSWpSXmKPExsVy+t/xq7pBLmzBBkuOqVjcWneO1eLvpGPs Fnfm/2W12Hmoldniw8FtTBbzjwAl+t8sZLV4dWYjm8XrSQvZLL7fMLXY9Pgaq8XaI3fZLZZe v8hkcer6ZzaLCdPXsli8OtjGYrF+xmsWB0GPNfPWMHr8/jWJ0eP9jVZ2j8t9vUweExe8Z/P4 fPYgu8fmJfUeV040sXp839HL6NG3ZRWjx8+XOh6fN8l5bJwbGsAbxWWTkpqTWZZapG+XwJVx 9+9p5oKpshWXOtcxNjDuF+ti5OSQEDCRONtwnhnCFpO4cG89WxcjF4eQwFJGiaerbjBCOH1M Eq8uvQerYhNQk/jc8IgNxBYRUJd4MO0EE0gRs8AJZol7J96DJYQFzCVa3k5jAbFZBFQlzuxc AdTMwcEr4CRx9FceiCkhoCCx+roQSAWngLPE249rmUBsIaCK3lPP2CYw8i5gZFjFKJpamlxQ nJSea6hXnJhbXJqXrpecn7uJERIBX3YwLj5mdYhRgINRiYe3QIItWIg1say4MvcQowQHs5II b5MNUIg3JbGyKrUoP76oNCe1+BAjEwenVAOjj+ShQ5ovq05NvpS82kzBln+JpXGq2reDN25H O0T9dtKo3Pq+I8yMNWrz5Q8uU+0lGzne7Z+4LLMty+1RRe9pC77NvLYPimtZmir2Xs90zy3Q 7Ox69tfG6X1hfv0qT6U8+wPiJZfMr+owiFye+VQ35YcA42rbkO/r2dj2bj/sbm3dVbm/cYcS S3FGoqEWc1FxIgAFmPWxXgIAAA== X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140220_130738_401422_BDE711A5 X-CRM114-Status: UNSURE ( 8.72 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -4.5 (----) Cc: mark.rutland@arm.com, devicetree@vger.kernel.org, jdl@jdl.com, Arnd Bergmann , pawel.moll@arm.com, Stephen Warren , Tomasz Figa , jgunthorpe@obsidianresearch.com, grant.likely@secretlab.ca, a.hajda@samsung.com, bcousson@baylibre.com, galak@codeaurora.org, olof@lixom.net, david@gibson.dropbear.id.au, linux-arm-kernel@lists.infradead.org, Marek Szyprowski X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,KHOP_BIG_TO_CC, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=no version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Tomasz Figa --- sample.dts | 70 +++++++++++++++++++++++++++++++++++++++++++++++++ schema.dtss | 86 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 156 insertions(+) create mode 100644 sample.dts create mode 100644 schema.dtss diff --git a/sample.dts b/sample.dts new file mode 100644 index 0000000..f962051 --- /dev/null +++ b/sample.dts @@ -0,0 +1,70 @@ +/dts-v1/; + +/ { + #address-cells = <1>; + #size-cells = <1>; + interrupt-parent = <&gic>; + compatible = "foo,bar"; + model = "Foo Bar board"; + + chosen { + bootargs = "console=ttySAC2,115200N8"; + }; + + aliases { + i2c0 = &i2c_0; + }; + + memory { + device_type = "memory"; + reg = <0x40000000 0x40000000>; + }; + + soc { + compatible = "simple-bus"; + #address-cells = <1>; + #size-cells = <1>; + ranges; + + gic: interrupt-controller@10490000 { + compatible = "arm,cortex-a9-gic"; + #interrupt-cells = <3>; + interrupt-controller; + reg = <0x10490000 0x1000>, <0x10480000 0x100>; + cpu-offset = <0x4000>; + }; + + i2c_0: i2c@13860000 { + compatible = "nvidia,tegra20-i2c"; + reg = <0x13860000 0x100>; + interrupts = <0 57 0>; + clocks = <&clocks 43>, <&clocks 28>; + clock-names = "div-clk", "fast-clk"; + #address-cells = <1>; + #size-cells = <0>; + + audio-codec@33 { + compatible = "wlf,wm8903"; + reg = <0x33>; + gpio-controller; + #gpio-cells = <1>; + }; + }; + + gpio: pinctrl@11400000 { + compatible = "foo,bar-gpio"; + reg = <0x11400000 0x1000>; + interrupts = <0 47 0>; + gpio-controller; + #gpio-cells = <2>; + interrupt-controller; + #interrupt-cells = <2>; + }; + + clocks: clock-controller@15440000 { + compatible = "foo,bar-clocks"; + reg = <0x15440000 0x1000>; + #clock-cells = <1>; + }; + }; +}; diff --git a/schema.dtss b/schema.dtss new file mode 100644 index 0000000..7a819fe --- /dev/null +++ b/schema.dtss @@ -0,0 +1,86 @@ +/* + * schema.dtss - Sample Device Tree schema file. + * + * Copyright (C) 2013 Samsung Electronics Co., Ltd. + * Author: Tomasz Figa + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation version 2. + * + * This program is distributed "as is" WITHOUT ANY WARRANTY of any + * kind, whether express or implied; without even the implied warranty + * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +/dtss-v1/; + +root-node { + /match/ path = "/"; + /require/ mmio-bus; + + compatible; + /optional/ model; +}; + +wlf,wm8903 { + /match/ compatible = "wlf,wm8903"; + + /optional/ micdet-cfg; + /optional/ micdet-delay; + /optional/ gpio-cfg; + + /require/ i2c-device; + + /require/ gpio-provider { + cells = <1>; + }; + + /use/ interrupts { + count = <1>; + }; +}; + +nvidia,tegra20-i2c { + /match/ compatible = "nvidia,tegra20-i2c", "nvidia,tegra30-i2c"; + + resets; + reset-names; + dmas; + dma-names; + + /require/ i2c-bus; + + /require/ mmio-device { + reg-count = <1>; + }; + + /require/ interrupts { + count = <1>; + }; + + /require/ clocks { + names = "div-clk", "fast-clk"; + }; +}; + +foo,bar-gpio { + /match/ compatible = "foo,bar-gpio"; + + /require/ interrupts { + count = <1>; + }; + + /require/ mmio-device { + reg-count = <1>; + }; + + /require/ gpio-provider { + cells = <2>; + }; + + /require/ interrupt-controller { + cells = <2>; + }; +};