Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp6896188ybe; Wed, 18 Sep 2019 10:48:14 -0700 (PDT) X-Google-Smtp-Source: APXvYqy4tzILKSXbGQzkNmgwjvNAPbZolfxANJR0ZmT64Pk1bcmx7H8U3YC5FIpkxwU396tTSOQa X-Received: by 2002:a17:906:ecb6:: with SMTP id qh22mr10536858ejb.114.1568828894573; Wed, 18 Sep 2019 10:48:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568828894; cv=none; d=google.com; s=arc-20160816; b=bkrkt7VbH5PVrPGnHf6qtFL5pmRDE0dFE/q9psyPd+lrEEN4g7U81luMnfmIW4n3M9 qKkoahKclSVopFUUrfCk2C3oeF5X/Re5Gt1iFMCGZZcQf+j/9CtqeTrNVlNj6MpF1oIw xf5NiN9DaskfplG0AZh8lX3wywekNa4Hdp7kK6E0rM0ycSzcM7CXTu2Kw//jwQ2zQMEZ SItRW4w4hA5Ef9s7eu5XEpDOBaQeEL3bD9u/s5K7HXZKZZuTeA1L15UMKicOlHhR2dx1 mXuDNBSPI1OtbHFmB6yJ6GIXftU+h9SMPgM/5COOYI7hAt8qntlwUwLu/OhUm3hTQH41 GE+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=/p8xEi7gfSnFJI/UlvuvcbQejdt/jVyuTy3pZNrl1u0=; b=EzqjT/JSNTwdc3Vz8WTEUqO5THE7XZh+8UCdJ2KAbZ6DkmN1LprC4t9Mrq1DC17bk/ 0aR5E+ScPIc3QPKWLHL7O0biz93RcSDFTaPPTUhHH4k4dsbPl5aMsW4swl+usW3z147j 829p/n6o6ibPqZ1ahjATaVRQEpaQ3b5mwj1F4PLfX5DqDhtN4yTLX8GIbti3KWOjRy+k Znc/KAG2kBabX3PaYiDjnogWvGRKFiKFz9VDvCTJL/MmOWaUo/D9bEC+HMSdvHdXVj4t jdxL1fy8a6X0IaA/HwMECE5DLS3dauZwa/RhRQaSFfLmE/F84XIvRztV6Hcvw/eRTos1 CNBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=FvR1MjqI; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id dd8si3317468ejb.36.2019.09.18.10.47.50; Wed, 18 Sep 2019 10:48:14 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-crypto-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=@kernel.org header.s=default header.b=FvR1MjqI; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731542AbfIRRcV (ORCPT + 99 others); Wed, 18 Sep 2019 13:32:21 -0400 Received: from mail.kernel.org ([198.145.29.99]:42530 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729042AbfIRRcV (ORCPT ); Wed, 18 Sep 2019 13:32:21 -0400 Received: from localhost.localdomain (unknown [194.230.155.145]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id BD58921924; Wed, 18 Sep 2019 17:32:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1568827939; bh=zjXEIYpD3fE5Zr/V3tvwmlVGzHjthNbt5x4gZC+CdjI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FvR1MjqI294G8TedX7gWzHt3umBVoayRHdF7EOG3JD2wP2uWpCqWQc99LBZQ0Kh3L LDh3tPkQazq+H1Zkj4fi4TBZTgyNr2RAqWjGuznHsqPzewMg7Y8RFelIXYKOF3z4xp SRQvgJUOP+tCnMh2lvxLixwouFiU1b0SyXv+qMn8= From: Krzysztof Kozlowski To: Rob Herring , Mark Rutland , Thierry Reding , Matt Mackall , Herbert Xu , Wim Van Sebroeck , Guenter Roeck , linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-leds@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-pwm@vger.kernel.org, linux-tegra@vger.kernel.org, bcm-kernel-feedback-list@broadcom.com, linux-rpi-kernel@lists.infradead.org, linux-amlogic@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-riscv@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, linux-crypto@vger.kernel.org, linux-watchdog@vger.kernel.org Cc: Krzysztof Kozlowski Subject: [PATCH v2 2/8] dt-bindings: sram: Convert SRAM bindings to json-schema Date: Wed, 18 Sep 2019 19:31:35 +0200 Message-Id: <20190918173141.4314-2-krzk@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190918173141.4314-1-krzk@kernel.org> References: <20190918173141.4314-1-krzk@kernel.org> Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org Convert generic mmio-sram bindings to DT schema format using json-schema. Signed-off-by: Krzysztof Kozlowski --- Changes since v1: 1. Indent example with four spaces (more readable). --- .../devicetree/bindings/sram/sram.txt | 80 ---------- .../devicetree/bindings/sram/sram.yaml | 138 ++++++++++++++++++ 2 files changed, 138 insertions(+), 80 deletions(-) delete mode 100644 Documentation/devicetree/bindings/sram/sram.txt create mode 100644 Documentation/devicetree/bindings/sram/sram.yaml diff --git a/Documentation/devicetree/bindings/sram/sram.txt b/Documentation/devicetree/bindings/sram/sram.txt deleted file mode 100644 index e98908bd4227..000000000000 --- a/Documentation/devicetree/bindings/sram/sram.txt +++ /dev/null @@ -1,80 +0,0 @@ -Generic on-chip SRAM - -Simple IO memory regions to be managed by the genalloc API. - -Required properties: - -- compatible : mmio-sram or atmel,sama5d2-securam - -- reg : SRAM iomem address range - -Reserving sram areas: ---------------------- - -Each child of the sram node specifies a region of reserved memory. Each -child node should use a 'reg' property to specify a specific range of -reserved memory. - -Following the generic-names recommended practice, node names should -reflect the purpose of the node. Unit address (@
) should be -appended to the name. - -Required properties in the sram node: - -- #address-cells, #size-cells : should use the same values as the root node -- ranges : standard definition, should translate from local addresses - within the sram to bus addresses - -Optional properties in the sram node: - -- no-memory-wc : the flag indicating, that SRAM memory region has not to - be remapped as write combining. WC is used by default. - -Required properties in the area nodes: - -- reg : iomem address range, relative to the SRAM range - -Optional properties in the area nodes: - -- compatible : standard definition, should contain a vendor specific string - in the form ,[-] -- pool : indicates that the particular reserved SRAM area is addressable - and in use by another device or devices -- export : indicates that the reserved SRAM area may be accessed outside - of the kernel, e.g. by bootloader or userspace -- protect-exec : Same as 'pool' above but with the additional - constraint that code wil be run from the region and - that the memory is maintained as read-only, executable - during code execution. NOTE: This region must be page - aligned on start and end in order to properly allow - manipulation of the page attributes. -- label : the name for the reserved partition, if omitted, the label - is taken from the node name excluding the unit address. -- clocks : a list of phandle and clock specifier pair that controls the - single SRAM clock. - -Example: - -sram: sram@5c000000 { - compatible = "mmio-sram"; - reg = <0x5c000000 0x40000>; /* 256 KiB SRAM at address 0x5c000000 */ - - #address-cells = <1>; - #size-cells = <1>; - ranges = <0 0x5c000000 0x40000>; - - smp-sram@100 { - compatible = "socvendor,smp-sram"; - reg = <0x100 0x50>; - }; - - device-sram@1000 { - reg = <0x1000 0x1000>; - pool; - }; - - exported@20000 { - reg = <0x20000 0x20000>; - export; - }; -}; diff --git a/Documentation/devicetree/bindings/sram/sram.yaml b/Documentation/devicetree/bindings/sram/sram.yaml new file mode 100644 index 000000000000..8d9d6ce494b2 --- /dev/null +++ b/Documentation/devicetree/bindings/sram/sram.yaml @@ -0,0 +1,138 @@ +# SPDX-License-Identifier: GPL-2.0 +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/sram/sram.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Generic on-chip SRAM + +maintainers: + - FIXME + +description: |+ + Simple IO memory regions to be managed by the genalloc API. + + Each child of the sram node specifies a region of reserved memory. Each + child node should use a 'reg' property to specify a specific range of + reserved memory. + + Following the generic-names recommended practice, node names should + reflect the purpose of the node. Unit address (@
) should be + appended to the name. + +properties: + $nodename: + pattern: "^sram(@.*)?" + + compatible: + items: + - enum: + - mmio-sram + - atmel,sama5d2-securam + + reg: + maxItems: 1 + + "#address-cells": + description: Should use the same values as the root node. + + "#size-cells": + description: Should use the same values as the root node. + + ranges: + description: + Should translate from local addresses within the sram to bus addresses. + + no-memory-wc: + description: + The flag indicating, that SRAM memory region has not to be remapped + as write combining. WC is used by default. + type: boolean + + # TODO: additionalProperties: false + +patternProperties: + "^([a-z]*-)?sram@[a-f0-9]$": + type: object + description: + Each child of the sram node specifies a region of reserved memory. + properties: + reg: + description: + IO mem address range, relative to the SRAM range. + + compatible: + $ref: /schemas/types.yaml#/definitions/string + description: + Should contain a vendor specific string in the form + ,[-] + + pool: + description: + Indicates that the particular reserved SRAM area is addressable + and in use by another device or devices. + type: boolean + + export: + description: + Indicates that the reserved SRAM area may be accessed outside + of the kernel, e.g. by bootloader or userspace. + type: boolean + + protect-exec: + description: | + Same as 'pool' above but with the additional constraint that code + will be run from the region and that the memory is maintained as + read-only, executable during code execution. NOTE: This region must + be page aligned on start and end in order to properly allow + manipulation of the page attributes. + type: boolean + + label: + $ref: /schemas/types.yaml#/definitions/string + description: + The name for the reserved partition, if omitted, the label is taken + from the node name excluding the unit address. + + clocks: + description: + A list of phandle and clock specifier pair that controls the + single SRAM clock. + + # TODO: additionalProperties: false + + required: + - reg + +required: + - compatible + - reg + - "#address-cells" + - "#size-cells" + - ranges + +examples: + - | + sram: sram@5c000000 { + compatible = "mmio-sram"; + reg = <0x5c000000 0x40000>; /* 256 KiB SRAM at address 0x5c000000 */ + + #address-cells = <1>; + #size-cells = <1>; + ranges = <0 0x5c000000 0x40000>; + + smp-sram@100 { + compatible = "socvendor,smp-sram"; + reg = <0x100 0x50>; + }; + + device-sram@1000 { + reg = <0x1000 0x1000>; + pool; + }; + + exported@20000 { + reg = <0x20000 0x20000>; + export; + }; + }; -- 2.17.1