From nobody Sun Sep 22 01:50:50 2024 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 002F7C433EF for ; Mon, 9 May 2022 01:53:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232593AbiEIB4R (ORCPT ); Sun, 8 May 2022 21:56:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37580 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233619AbiEIBt1 (ORCPT ); Sun, 8 May 2022 21:49:27 -0400 Received: from mailgw01.mediatek.com (unknown [60.244.123.138]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 04030284; Sun, 8 May 2022 18:45:31 -0700 (PDT) X-UUID: 46fa9032b54741dcbe0f7ad98487b557-20220509 X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.4,REQID:ebe8ad17-54e3-40c5-a217-83d5c5f5ba1a,OB:0,LO B:0,IP:0,URL:25,TC:0,Content:0,EDM:0,RT:0,SF:0,FILE:0,RULE:Release_Ham,ACT ION:release,TS:25 X-CID-META: VersionHash:faefae9,CLOUDID:78f9a816-2e53-443e-b81a-655c13977218,C OID:IGNORED,Recheck:0,SF:nil,TC:nil,Content:0,EDM:-3,File:nil,QS:0,BEC:nil X-UUID: 46fa9032b54741dcbe0f7ad98487b557-20220509 Received: from mtkexhb01.mediatek.inc [(172.21.101.102)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 296730226; Mon, 09 May 2022 09:45:25 +0800 Received: from mtkcas11.mediatek.inc (172.21.101.40) by mtkmbs10n2.mediatek.inc (172.21.101.183) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.2.792.3; Mon, 9 May 2022 09:45:24 +0800 Received: from localhost.localdomain (10.17.3.154) by mtkcas11.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Mon, 9 May 2022 09:45:23 +0800 From: Chunfeng Yun To: Srinivas Kandagatla , Rob Herring CC: Matthias Brugger , Chunfeng Yun , , , , , , Eddie Hung , Andrew-CT Chen Subject: [PATCH v4] dt-bindings: nvmem: convert mtk-efuse.txt to YAML schema Date: Mon, 9 May 2022 09:45:21 +0800 Message-ID: <20220509014521.10248-1-chunfeng.yun@mediatek.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-MTK: N Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Convert mtk-efuse.txt to YAML schema mediatek,efuse.yaml Signed-off-by: Chunfeng Yun Reviewed-by: Krzysztof Kozlowski --- v4: fix duplicated unit-address in example; drop reviewed-by Rob, due to changes; v3: add reviewed-by Rob v2: 1. remove description of subnodes which is covered by nvmem.yaml suggest= ed by Rob 2. change the example which is commoner than mt8173's --- .../bindings/nvmem/mediatek,efuse.yaml | 86 +++++++++++++++++++ .../devicetree/bindings/nvmem/mtk-efuse.txt | 43 ---------- 2 files changed, 86 insertions(+), 43 deletions(-) create mode 100644 Documentation/devicetree/bindings/nvmem/mediatek,efuse.= yaml delete mode 100644 Documentation/devicetree/bindings/nvmem/mtk-efuse.txt diff --git a/Documentation/devicetree/bindings/nvmem/mediatek,efuse.yaml b/= Documentation/devicetree/bindings/nvmem/mediatek,efuse.yaml new file mode 100644 index 000000000000..abb8b85655fe --- /dev/null +++ b/Documentation/devicetree/bindings/nvmem/mediatek,efuse.yaml @@ -0,0 +1,86 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/nvmem/mediatek,efuse.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: MediaTek efuse device tree bindings + +description: | + MediaTek's efuse is used for storing calibration data, it can be accessed + on ARM devices usiong I/O mapped memory. + +maintainers: + - Andrew-CT Chen + +allOf: + - $ref: "nvmem.yaml#" + +properties: + $nodename: + pattern: "^efuse@[0-9a-f]+$" + + compatible: + oneOf: + - items: + - enum: + - mediatek,mt7622-efuse + - mediatek,mt7623-efuse + - mediatek,mt8173-efuse + - mediatek,mt8192-efuse + - mediatek,mt8195-efuse + - mediatek,mt8516-efuse + - const: mediatek,efuse + - const: mediatek,mt8173-efuse + deprecated: true + + reg: + maxItems: 1 + +required: + - compatible + - reg + +unevaluatedProperties: false + +examples: + - | + efuse@11c10000 { + compatible =3D "mediatek,mt8195-efuse", "mediatek,efuse"; + reg =3D <0x11c10000 0x1000>; + #address-cells =3D <1>; + #size-cells =3D <1>; + + u3_tx_imp_p0: usb3-tx-imp@184,1 { + reg =3D <0x184 0x1>; + bits =3D <0 5>; + }; + u3_rx_imp_p0: usb3-rx-imp@184,2 { + reg =3D <0x184 0x2>; + bits =3D <5 5>; + }; + u3_intr_p0: usb3-intr@185 { + reg =3D <0x185 0x1>; + bits =3D <2 6>; + }; + comb_tx_imp_p1: usb3-tx-imp@186,1 { + reg =3D <0x186 0x1>; + bits =3D <0 5>; + }; + comb_rx_imp_p1: usb3-rx-imp@186,2 { + reg =3D <0x186 0x2>; + bits =3D <5 5>; + }; + comb_intr_p1: usb3-intr@187 { + reg =3D <0x187 0x1>; + bits =3D <2 6>; + }; + u2_intr_p0: usb2-intr-p0@188,1 { + reg =3D <0x188 0x1>; + bits =3D <0 5>; + }; + u2_intr_p1: usb2-intr-p1@188,2 { + reg =3D <0x188 0x2>; + bits =3D <5 5>; + }; + }; diff --git a/Documentation/devicetree/bindings/nvmem/mtk-efuse.txt b/Docume= ntation/devicetree/bindings/nvmem/mtk-efuse.txt deleted file mode 100644 index 39d529599444..000000000000 --- a/Documentation/devicetree/bindings/nvmem/mtk-efuse.txt +++ /dev/null @@ -1,43 +0,0 @@ -=3D Mediatek MTK-EFUSE device tree bindings =3D - -This binding is intended to represent MTK-EFUSE which is found in most Med= iatek SOCs. - -Required properties: -- compatible: should be - "mediatek,mt7622-efuse", "mediatek,efuse": for MT7622 - "mediatek,mt7623-efuse", "mediatek,efuse": for MT7623 - "mediatek,mt8173-efuse" or "mediatek,efuse": for MT8173 - "mediatek,mt8192-efuse", "mediatek,efuse": for MT8192 - "mediatek,mt8195-efuse", "mediatek,efuse": for MT8195 - "mediatek,mt8516-efuse", "mediatek,efuse": for MT8516 -- reg: Should contain registers location and length -- bits: contain the bits range by offset and size - -=3D Data cells =3D -Are child nodes of MTK-EFUSE, bindings of which as described in -bindings/nvmem/nvmem.txt - -Example: - - efuse: efuse@10206000 { - compatible =3D "mediatek,mt8173-efuse"; - reg =3D <0 0x10206000 0 0x1000>; - #address-cells =3D <1>; - #size-cells =3D <1>; - - /* Data cells */ - thermal_calibration: calib@528 { - reg =3D <0x528 0xc>; - }; - }; - -=3D Data consumers =3D -Are device nodes which consume nvmem data cells. - -For example: - - thermal { - ... - nvmem-cells =3D <&thermal_calibration>; - nvmem-cell-names =3D "calibration"; - }; --=20 2.25.1