devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v4 0/3] dt-bindings: nvmem: mediatek: Convert efuse binding to YAML
@ 2022-05-10 13:26 Allen-KH Cheng
  2022-05-10 13:26 ` [PATCH v4 1/3] " Allen-KH Cheng
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Allen-KH Cheng @ 2022-05-10 13:26 UTC (permalink / raw)
  To: Srinivas Kandagatla, Matthias Brugger, Rob Herring,
	Krzysztof Kozlowski
  Cc: Lala Lin, Project_Global_Chrome_Upstream_Group, devicetree,
	linux-arm-kernel, linux-kernel, linux-mediatek, Chen-Yu Tsai,
	Allen-kh Cheng

From: Allen-kh Cheng <allen-kh.cheng@mediatek.corp-partner.google.com>

Convert MediaTek eFuse devicetree binding to YAML.

Based on tag: next-20220510, linux-next/master

Run cmds as following:
make DT_CHECKER_FLAGS=-m dt_binding_check
DT_SCHEMA_FILES=Documentation/devicetree/bindings/nvmem/mediatek,efuse.yaml

make ARCH=arm64
dtbs_check DT_SCHEMA_FILES=Documentation/devicetree/bindings/nvmem/mediatek,efuse.yaml

We mark the mediatek,mt8173-efuse and mediatek,efuse as deprecated to indicate
not use a signle compatible and should always use mediatek,efuse as generic
fallback.

change since v3:
 - use mediatek as vendor name instead of mtk

changes since v2:
 - document deprecated efuse property
 - update efuse compatible fallbacks
 - add two PATCHs into series

changes since v1:
- change file name from mtk,efuse-yaml to mtk,efuse.yaml
- add efuse in commit title
- change compatible entries from const to enum

Allen-KH Cheng (2):
  dt-bindings: nvmem: mediatek: Convert efuse binding to YAML
  arm64: dts: mediatek: update efuse compatible fallbacks

Allen-kh Cheng (1):
  dt-bindings: nvmem: mediatek: document deprecated efuse property

 .../bindings/nvmem/mediatek,efuse.yaml        | 60 +++++++++++++++++++
 .../devicetree/bindings/nvmem/mtk-efuse.txt   | 43 -------------
 arch/arm64/boot/dts/mediatek/mt8173.dtsi      |  3 +-
 arch/arm64/boot/dts/mediatek/mt8192.dtsi      |  3 +-
 4 files changed, 64 insertions(+), 45 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/nvmem/mediatek,efuse.yaml
 delete mode 100644 Documentation/devicetree/bindings/nvmem/mtk-efuse.txt

-- 
2.18.0


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH v4 1/3] dt-bindings: nvmem: mediatek: Convert efuse binding to YAML
  2022-05-10 13:26 [PATCH v4 0/3] dt-bindings: nvmem: mediatek: Convert efuse binding to YAML Allen-KH Cheng
@ 2022-05-10 13:26 ` Allen-KH Cheng
  2022-05-11 15:16   ` Krzysztof Kozlowski
  2022-05-10 13:26 ` [PATCH v4 2/3] dt-bindings: nvmem: mediatek: document deprecated efuse property Allen-KH Cheng
  2022-05-10 13:26 ` [PATCH v4 3/3] arm64: dts: mediatek: update efuse compatible fallbacks Allen-KH Cheng
  2 siblings, 1 reply; 6+ messages in thread
From: Allen-KH Cheng @ 2022-05-10 13:26 UTC (permalink / raw)
  To: Srinivas Kandagatla, Matthias Brugger, Rob Herring,
	Krzysztof Kozlowski
  Cc: Lala Lin, Project_Global_Chrome_Upstream_Group, devicetree,
	linux-arm-kernel, linux-kernel, linux-mediatek, Chen-Yu Tsai,
	Allen-KH Cheng

Convert MediaTek eFuse devicetree binding to YAML.

Signed-off-by: Allen-KH Cheng <allen-kh.cheng@mediatek.com>
---
 .../bindings/nvmem/mediatek,efuse.yaml        | 57 +++++++++++++++++++
 .../devicetree/bindings/nvmem/mtk-efuse.txt   | 43 --------------
 2 files changed, 57 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..529f5888d93f
--- /dev/null
+++ b/Documentation/devicetree/bindings/nvmem/mediatek,efuse.yaml
@@ -0,0 +1,57 @@
+# SPDX-License-Identifier: (GPL-2.0 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
+
+maintainers:
+  - Lala Lin <lala.lin@mediatek.com>
+  - Allen-KH Cheng <allen-kh.cheng@mediatek.com>
+
+allOf:
+  - $ref: "nvmem.yaml#"
+
+properties:
+  compatible:
+    oneOf:
+      - enum:
+          - mediatek,mt8173-efuse
+          - mediatek,efuse
+        description:
+          Only mt8173 SoC-specific compatible with generic fallback should be
+          used
+      - items:
+          - enum:
+              - mediatek,mt7622-efuse
+              - mediatek,mt7623-efuse
+              - mediatek,mt8183-efuse
+              - mediatek,mt8192-efuse
+              - mediatek,mt8195-efuse
+              - mediatek,mt8516-efuse
+          - const: mediatek,efuse
+
+  reg:
+    maxItems: 1
+
+required:
+  - compatible
+  - reg
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    efuse: efuse@10206000 {
+            compatible = "mediatek,mt8173-efuse";
+            reg = <0x10206000 0x1000>;
+            #address-cells = <1>;
+            #size-cells = <1>;
+
+            /* Data cells */
+            thermal_calibration: calib@528 {
+                reg = <0x528 0xc>;
+            };
+    };
+...
diff --git a/Documentation/devicetree/bindings/nvmem/mtk-efuse.txt b/Documentation/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 @@
-= Mediatek MTK-EFUSE device tree bindings =
-
-This binding is intended to represent MTK-EFUSE which is found in most Mediatek 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
-
-= Data cells =
-Are child nodes of MTK-EFUSE, bindings of which as described in
-bindings/nvmem/nvmem.txt
-
-Example:
-
-	efuse: efuse@10206000 {
-		compatible = "mediatek,mt8173-efuse";
-		reg	   = <0 0x10206000 0 0x1000>;
-		#address-cells = <1>;
-		#size-cells = <1>;
-
-		/* Data cells */
-		thermal_calibration: calib@528 {
-			reg = <0x528 0xc>;
-		};
-	};
-
-= Data consumers =
-Are device nodes which consume nvmem data cells.
-
-For example:
-
-	thermal {
-		...
-		nvmem-cells = <&thermal_calibration>;
-		nvmem-cell-names = "calibration";
-	};
-- 
2.18.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH v4 2/3] dt-bindings: nvmem: mediatek: document deprecated efuse property
  2022-05-10 13:26 [PATCH v4 0/3] dt-bindings: nvmem: mediatek: Convert efuse binding to YAML Allen-KH Cheng
  2022-05-10 13:26 ` [PATCH v4 1/3] " Allen-KH Cheng
@ 2022-05-10 13:26 ` Allen-KH Cheng
  2022-05-11 15:20   ` Krzysztof Kozlowski
  2022-05-10 13:26 ` [PATCH v4 3/3] arm64: dts: mediatek: update efuse compatible fallbacks Allen-KH Cheng
  2 siblings, 1 reply; 6+ messages in thread
From: Allen-KH Cheng @ 2022-05-10 13:26 UTC (permalink / raw)
  To: Srinivas Kandagatla, Matthias Brugger, Rob Herring,
	Krzysztof Kozlowski
  Cc: Lala Lin, Project_Global_Chrome_Upstream_Group, devicetree,
	linux-arm-kernel, linux-kernel, linux-mediatek, Chen-Yu Tsai,
	Allen-kh Cheng, Allen-KH Cheng

From: Allen-kh Cheng <allen-kh.cheng@mediatek.corp-partner.google.com>

We mark mediatek,mt8173-efuse and mediatek,efuse as deprecated to
prevent them from being the single compatible in the future.

The mediatek,efuse compatible should be used as generic fallback for
all MediaTek chipsets.

Signed-off-by: Allen-KH Cheng <allen-kh.cheng@mediatek.com>
---
 .../devicetree/bindings/nvmem/mediatek,efuse.yaml | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/Documentation/devicetree/bindings/nvmem/mediatek,efuse.yaml b/Documentation/devicetree/bindings/nvmem/mediatek,efuse.yaml
index 529f5888d93f..04ecf5980b2e 100644
--- a/Documentation/devicetree/bindings/nvmem/mediatek,efuse.yaml
+++ b/Documentation/devicetree/bindings/nvmem/mediatek,efuse.yaml
@@ -16,16 +16,18 @@ allOf:
 properties:
   compatible:
     oneOf:
-      - enum:
-          - mediatek,mt8173-efuse
-          - mediatek,efuse
+      - const: mediatek,mt8173-efuse # Don't use this in new dts files
+        deprecated: true
+      - const: mediatek,efuse
+        deprecated: true
         description:
-          Only mt8173 SoC-specific compatible with generic fallback should be
-          used
+          Please use mediatek,efuse as generic fallback to enable the MediaTek
+          eFuse support.
       - items:
           - enum:
               - mediatek,mt7622-efuse
               - mediatek,mt7623-efuse
+              - mediatek,mt8173-efuse
               - mediatek,mt8183-efuse
               - mediatek,mt8192-efuse
               - mediatek,mt8195-efuse
@@ -44,7 +46,8 @@ unevaluatedProperties: false
 examples:
   - |
     efuse: efuse@10206000 {
-            compatible = "mediatek,mt8173-efuse";
+            compatible = "mediatek,mt8173-efuse",
+                         "mediatek,efuse";
             reg = <0x10206000 0x1000>;
             #address-cells = <1>;
             #size-cells = <1>;
-- 
2.18.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH v4 3/3] arm64: dts: mediatek: update efuse compatible fallbacks
  2022-05-10 13:26 [PATCH v4 0/3] dt-bindings: nvmem: mediatek: Convert efuse binding to YAML Allen-KH Cheng
  2022-05-10 13:26 ` [PATCH v4 1/3] " Allen-KH Cheng
  2022-05-10 13:26 ` [PATCH v4 2/3] dt-bindings: nvmem: mediatek: document deprecated efuse property Allen-KH Cheng
@ 2022-05-10 13:26 ` Allen-KH Cheng
  2 siblings, 0 replies; 6+ messages in thread
From: Allen-KH Cheng @ 2022-05-10 13:26 UTC (permalink / raw)
  To: Srinivas Kandagatla, Matthias Brugger, Rob Herring,
	Krzysztof Kozlowski
  Cc: Lala Lin, Project_Global_Chrome_Upstream_Group, devicetree,
	linux-arm-kernel, linux-kernel, linux-mediatek, Chen-Yu Tsai,
	Allen-KH Cheng

dtschema expects mediatek,efuse to be a generic fallback. We add
mediatek,efuse fallback for mt8173 and mt8192 SoC.

Signed-off-by: Allen-KH Cheng <allen-kh.cheng@mediatek.com>
---
 arch/arm64/boot/dts/mediatek/mt8173.dtsi | 3 ++-
 arch/arm64/boot/dts/mediatek/mt8192.dtsi | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/arch/arm64/boot/dts/mediatek/mt8173.dtsi b/arch/arm64/boot/dts/mediatek/mt8173.dtsi
index 40d7b47fc52e..a62fb810d2a0 100644
--- a/arch/arm64/boot/dts/mediatek/mt8173.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt8173.dtsi
@@ -594,7 +594,8 @@
 		};
 
 		efuse: efuse@10206000 {
-			compatible = "mediatek,mt8173-efuse";
+			compatible = "mediatek,mt8173-efuse",
+				     "mediatek,efuse";
 			reg = <0 0x10206000 0 0x1000>;
 			#address-cells = <1>;
 			#size-cells = <1>;
diff --git a/arch/arm64/boot/dts/mediatek/mt8192.dtsi b/arch/arm64/boot/dts/mediatek/mt8192.dtsi
index 26dbe9ecc528..4a5af1ed3abf 100644
--- a/arch/arm64/boot/dts/mediatek/mt8192.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt8192.dtsi
@@ -911,7 +911,8 @@
 		};
 
 		efuse: efuse@11c10000 {
-			compatible = "mediatek,efuse";
+			compatible = "mediatek,mt8192-efuse",
+				     "mediatek,efuse";
 			reg = <0 0x11c10000 0 0x1000>;
 			#address-cells = <1>;
 			#size-cells = <1>;
-- 
2.18.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH v4 1/3] dt-bindings: nvmem: mediatek: Convert efuse binding to YAML
  2022-05-10 13:26 ` [PATCH v4 1/3] " Allen-KH Cheng
@ 2022-05-11 15:16   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 6+ messages in thread
From: Krzysztof Kozlowski @ 2022-05-11 15:16 UTC (permalink / raw)
  To: Allen-KH Cheng, Srinivas Kandagatla, Matthias Brugger,
	Rob Herring, Krzysztof Kozlowski
  Cc: Lala Lin, Project_Global_Chrome_Upstream_Group, devicetree,
	linux-arm-kernel, linux-kernel, linux-mediatek, Chen-Yu Tsai

On 10/05/2022 15:26, Allen-KH Cheng wrote:
> Convert MediaTek eFuse devicetree binding to YAML.
> 
> Signed-off-by: Allen-KH Cheng <allen-kh.cheng@mediatek.com>
> ---
>  .../bindings/nvmem/mediatek,efuse.yaml        | 57 +++++++++++++++++++
>  .../devicetree/bindings/nvmem/mtk-efuse.txt   | 43 --------------
>  2 files changed, 57 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..529f5888d93f
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/nvmem/mediatek,efuse.yaml
> @@ -0,0 +1,57 @@
> +# SPDX-License-Identifier: (GPL-2.0 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
> +
> +maintainers:
> +  - Lala Lin <lala.lin@mediatek.com>
> +  - Allen-KH Cheng <allen-kh.cheng@mediatek.com>
> +
> +allOf:
> +  - $ref: "nvmem.yaml#"
> +
> +properties:
> +  compatible:
> +    oneOf:
> +      - enum:
> +          - mediatek,mt8173-efuse
> +          - mediatek,efuse
> +        description:
> +          Only mt8173 SoC-specific compatible with generic fallback should be
> +          used

I don't see changes here after our v2 discussion. In the past several
comments were not implemented in new versions (filename, title). So this
is one more case where you receive a comment and send a next version
without implementing it.

Can you please focus on the received comments and not loose pieces of them?

https://lore.kernel.org/all/0169c4ac-fdce-29b7-553a-14dc7df532d1@linaro.org/

Best regards,
Krzysztof

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v4 2/3] dt-bindings: nvmem: mediatek: document deprecated efuse property
  2022-05-10 13:26 ` [PATCH v4 2/3] dt-bindings: nvmem: mediatek: document deprecated efuse property Allen-KH Cheng
@ 2022-05-11 15:20   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 6+ messages in thread
From: Krzysztof Kozlowski @ 2022-05-11 15:20 UTC (permalink / raw)
  To: Allen-KH Cheng, Srinivas Kandagatla, Matthias Brugger,
	Rob Herring, Krzysztof Kozlowski
  Cc: Lala Lin, Project_Global_Chrome_Upstream_Group, devicetree,
	linux-arm-kernel, linux-kernel, linux-mediatek, Chen-Yu Tsai,
	Allen-kh Cheng

On 10/05/2022 15:26, Allen-KH Cheng wrote:
> From: Allen-kh Cheng <allen-kh.cheng@mediatek.corp-partner.google.com>
> 
> We mark mediatek,mt8173-efuse and mediatek,efuse as deprecated to
> prevent them from being the single compatible in the future.
> 
> The mediatek,efuse compatible should be used as generic fallback for
> all MediaTek chipsets.
> 
> Signed-off-by: Allen-KH Cheng <allen-kh.cheng@mediatek.com>
> ---
>  .../devicetree/bindings/nvmem/mediatek,efuse.yaml | 15 +++++++++------
>  1 file changed, 9 insertions(+), 6 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/nvmem/mediatek,efuse.yaml b/Documentation/devicetree/bindings/nvmem/mediatek,efuse.yaml
> index 529f5888d93f..04ecf5980b2e 100644
> --- a/Documentation/devicetree/bindings/nvmem/mediatek,efuse.yaml
> +++ b/Documentation/devicetree/bindings/nvmem/mediatek,efuse.yaml
> @@ -16,16 +16,18 @@ allOf:
>  properties:
>    compatible:
>      oneOf:
> -      - enum:
> -          - mediatek,mt8173-efuse
> -          - mediatek,efuse
> +      - const: mediatek,mt8173-efuse # Don't use this in new dts files
> +        deprecated: true
> +      - const: mediatek,efuse
> +        deprecated: true
>          description:
> -          Only mt8173 SoC-specific compatible with generic fallback should be
> -          used
> +          Please use mediatek,efuse as generic fallback to enable the MediaTek
> +          eFuse support.

Now I see the change, it's a bit surprising to have it in separate
patch, but ok. In such case, in your first patch don't add this
description. There is no point to add a description which immediately
you change in next patch.


Best regards,
Krzysztof

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-05-11 15:20 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-05-10 13:26 [PATCH v4 0/3] dt-bindings: nvmem: mediatek: Convert efuse binding to YAML Allen-KH Cheng
2022-05-10 13:26 ` [PATCH v4 1/3] " Allen-KH Cheng
2022-05-11 15:16   ` Krzysztof Kozlowski
2022-05-10 13:26 ` [PATCH v4 2/3] dt-bindings: nvmem: mediatek: document deprecated efuse property Allen-KH Cheng
2022-05-11 15:20   ` Krzysztof Kozlowski
2022-05-10 13:26 ` [PATCH v4 3/3] arm64: dts: mediatek: update efuse compatible fallbacks Allen-KH Cheng

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).