From patchwork Tue Dec 8 12:46:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Leizhen \(ThunderTown\)" X-Patchwork-Id: 339734 Delivered-To: patch@linaro.org Received: by 2002:a02:85a7:0:0:0:0:0 with SMTP id d36csp3663403jai; Tue, 8 Dec 2020 04:52:50 -0800 (PST) X-Google-Smtp-Source: ABdhPJzUkggEzZGZJq9INP+Xjtcp0vVWb7btlxzUm1KryE9dIEU9wVYmjTKaxbKocAKFmfvXp3sx X-Received: by 2002:a17:906:40d3:: with SMTP id a19mr22618702ejk.98.1607431969821; Tue, 08 Dec 2020 04:52:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607431969; cv=none; d=google.com; s=arc-20160816; b=rVKdYGpLiGiNVYrS8qkVekaoy6Gt14K483AFyxBUAnx01VBSQOdekumHQu8QrYMhPy AhXqp5wutO5RZvbQYSKAA0NTumt3Ynd3K4dNzPg2HF1UNI9o/GNE8XLISfPOV2aycgjo RkaRTf7Y2wEBSonDY0yMGvnJiXaHcl09lIwpWzz6WzraeUNG1FxleG7uSy0vWD0d095G reUQJzfMmpnAb1NpnH0cTVz7Rb+DfZ03tdQ/48QRoIsRtZAUMhZqEvtTlXJre/KtVb7H 12pP7jAAy2roQ8NVM9pTzEHgthfy39leZZctNMsS0R7pCHcsGxSR0tbVNy2g074vh3by P/ew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=owX/PhfbcFJeWJ3EwGDTBI4JtcpUNpABMw5bsHZWjEw=; b=mvn0HUzcOnmiFfF/V38Bs0wVef0fxBya1dRZHJaD7gK51ojU6RJINLpx1Tthlx7Vm1 7s0CATkpD9Ctp3mi7OF3iS4VKIrNJnOAqktFR8Yh6SmKhY21j6b9MHXW/eeMLYy080c+ woFr37YHYdzsIZkCa4CJFR4LGJ/6/ehZAyeE2V0NS2FDc3B/Ih4TdyaHVq8vgXdnEScO lLOnqWk5xMCgwo6ifg4/dqhBo7AN+Mi+G6CtwiQX1fX3p+ow5L6Jj5T8fPmhAfBdGmPv 4iatrebcKxD/oE9f/V4GvKg0JF4FyUnYV4K9RKliS26+/MDZAHfIfl5+hfDpslTxvL5V yC/w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m11si10059482edr.583.2020.12.08.04.52.49; Tue, 08 Dec 2020 04:52:49 -0800 (PST) Received-SPF: pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729339AbgLHMv0 (ORCPT + 6 others); Tue, 8 Dec 2020 07:51:26 -0500 Received: from szxga04-in.huawei.com ([45.249.212.190]:9131 "EHLO szxga04-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729268AbgLHMvZ (ORCPT ); Tue, 8 Dec 2020 07:51:25 -0500 Received: from DGGEMS403-HUB.china.huawei.com (unknown [172.30.72.59]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4Cr0QD0b00z15Ymv; Tue, 8 Dec 2020 20:50:12 +0800 (CST) Received: from thunder-town.china.huawei.com (10.174.177.9) by DGGEMS403-HUB.china.huawei.com (10.3.19.203) with Microsoft SMTP Server id 14.3.487.0; Tue, 8 Dec 2020 20:50:35 +0800 From: Zhen Lei To: Philipp Zabel , Wei Xu , "Rob Herring" , linux-arm-kernel , devicetree , linux-kernel CC: Zhen Lei , Zhangfei Gao , Chen Feng , "Manivannan Sadhasivam" Subject: [PATCH v3 4/4] dt-bindings: reset: convert Hisilicon reset controller bindings to json-schema Date: Tue, 8 Dec 2020 20:46:41 +0800 Message-ID: <20201208124641.1787-5-thunder.leizhen@huawei.com> X-Mailer: git-send-email 2.26.0.windows.1 In-Reply-To: <20201208124641.1787-1-thunder.leizhen@huawei.com> References: <20201208124641.1787-1-thunder.leizhen@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.174.177.9] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Convert the Hisilicon reset controller binding to DT schema format using json-schema. Signed-off-by: Zhen Lei --- .../bindings/reset/hisilicon,hi3660-reset.txt | 44 ------------- .../bindings/reset/hisilicon,hi3660-reset.yaml | 77 ++++++++++++++++++++++ 2 files changed, 77 insertions(+), 44 deletions(-) delete mode 100644 Documentation/devicetree/bindings/reset/hisilicon,hi3660-reset.txt create mode 100644 Documentation/devicetree/bindings/reset/hisilicon,hi3660-reset.yaml -- 1.8.3 Reviewed-by: Rob Herring diff --git a/Documentation/devicetree/bindings/reset/hisilicon,hi3660-reset.txt b/Documentation/devicetree/bindings/reset/hisilicon,hi3660-reset.txt deleted file mode 100644 index aefd26710f9e87d..000000000000000 --- a/Documentation/devicetree/bindings/reset/hisilicon,hi3660-reset.txt +++ /dev/null @@ -1,44 +0,0 @@ -Hisilicon System Reset Controller -====================================== - -Please also refer to reset.txt in this directory for common reset -controller binding usage. - -The reset controller registers are part of the system-ctl block on -hi3660 and hi3670 SoCs. - -Required properties: -- compatible: should be one of the following: - "hisilicon,hi3660-reset" for HI3660 - "hisilicon,hi3670-reset", "hisilicon,hi3660-reset" for HI3670 -- hisilicon,rst-syscon: phandle of the reset's syscon. -- #reset-cells : Specifies the number of cells needed to encode a - reset source. The type shall be a and the value shall be 2. - - Cell #1 : offset of the reset assert control - register from the syscon register base - offset + 4: deassert control register - offset + 8: status control register - Cell #2 : bit position of the reset in the reset control register - -Example: - iomcu: iomcu@ffd7e000 { - compatible = "hisilicon,hi3660-iomcu", "syscon"; - reg = <0x0 0xffd7e000 0x0 0x1000>; - }; - - iomcu_rst: iomcu_rst_controller { - compatible = "hisilicon,hi3660-reset"; - hisilicon,rst-syscon = <&iomcu>; - #reset-cells = <2>; - }; - -Specifying reset lines connected to IP modules -============================================== -example: - - i2c0: i2c@..... { - ... - resets = <&iomcu_rst 0x20 3>; /* offset: 0x20; bit: 3 */ - ... - }; diff --git a/Documentation/devicetree/bindings/reset/hisilicon,hi3660-reset.yaml b/Documentation/devicetree/bindings/reset/hisilicon,hi3660-reset.yaml new file mode 100644 index 000000000000000..9bf40952e5b7d28 --- /dev/null +++ b/Documentation/devicetree/bindings/reset/hisilicon,hi3660-reset.yaml @@ -0,0 +1,77 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/reset/hisilicon,hi3660-reset.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Hisilicon System Reset Controller + +maintainers: + - Wei Xu + +description: | + Please also refer to reset.txt in this directory for common reset + controller binding usage. + The reset controller registers are part of the system-ctl block on + hi3660 and hi3670 SoCs. + +properties: + compatible: + oneOf: + - items: + - const: hisilicon,hi3660-reset + - items: + - const: hisilicon,hi3670-reset + - const: hisilicon,hi3660-reset + + hisilicon,rst-syscon: + description: phandle of the reset's syscon. + $ref: /schemas/types.yaml#/definitions/phandle + + '#reset-cells': + description: | + Specifies the number of cells needed to encode a reset source. + Cell #1 : offset of the reset assert control register from the syscon + register base + offset + 4: deassert control register + offset + 8: status control register + Cell #2 : bit position of the reset in the reset control register + const: 2 + +required: + - compatible + +additionalProperties: false + +examples: + - | + #include + #include + #include + + iomcu: iomcu@ffd7e000 { + compatible = "hisilicon,hi3660-iomcu", "syscon"; + reg = <0xffd7e000 0x1000>; + }; + + iomcu_rst: iomcu_rst_controller { + compatible = "hisilicon,hi3660-reset"; + hisilicon,rst-syscon = <&iomcu>; + #reset-cells = <2>; + }; + + /* Specifying reset lines connected to IP modules */ + i2c@ffd71000 { + compatible = "snps,designware-i2c"; + reg = <0xffd71000 0x1000>; + interrupts = ; + #address-cells = <1>; + #size-cells = <0>; + clock-frequency = <400000>; + clocks = <&crg_ctrl HI3660_CLK_GATE_I2C0>; + resets = <&iomcu_rst 0x20 3>; + pinctrl-names = "default"; + pinctrl-0 = <&i2c0_pmx_func &i2c0_cfg_func>; + status = "disabled"; + }; +...