linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/2] dt-bindings: Update nvmem and UniPhier eFuse bindings
@ 2021-07-19  2:31 Kunihiko Hayashi
  2021-07-19  2:31 ` [PATCH v2 1/2] dt-bindings: nvmem: Extend patternProperties to optionally indicate bit position Kunihiko Hayashi
  2021-07-19  2:31 ` [PATCH v2 2/2] dt-bindings: nvmem: Convert UniPhier eFuse bindings to json-schema Kunihiko Hayashi
  0 siblings, 2 replies; 6+ messages in thread
From: Kunihiko Hayashi @ 2021-07-19  2:31 UTC (permalink / raw)
  To: Srinivas Kandagatla, Rob Herring
  Cc: devicetree, linux-arm-kernel, linux-kernel, Masami Hiramatsu,
	Kunihiko Hayashi

This patch series intend to convert UniPhier eFuse bindings to json-schema, and
extend expression of sub nodes to indicate bit position.

Changes in v1:
- Add patternProperties extension patch
- Remove "reg" and "bits" properties that exist in nvmem.yaml
- Replace "additionalProperties: false" with "unevaluatedProperties: false"

Kunihiko Hayashi (2):
  dt-bindings: nvmem: Extend patternProperties to optionally indicate
    bit position
  dt-bindings: nvmem: Convert UniPhier eFuse bindings to json-schema

 Documentation/devicetree/bindings/nvmem/nvmem.yaml |  2 +-
 .../bindings/nvmem/socionext,uniphier-efuse.yaml   | 95 ++++++++++++++++++++++
 .../devicetree/bindings/nvmem/uniphier-efuse.txt   | 49 -----------
 3 files changed, 96 insertions(+), 50 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/nvmem/socionext,uniphier-efuse.yaml
 delete mode 100644 Documentation/devicetree/bindings/nvmem/uniphier-efuse.txt

-- 
2.7.4


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

* [PATCH v2 1/2] dt-bindings: nvmem: Extend patternProperties to optionally indicate bit position
  2021-07-19  2:31 [PATCH v2 0/2] dt-bindings: Update nvmem and UniPhier eFuse bindings Kunihiko Hayashi
@ 2021-07-19  2:31 ` Kunihiko Hayashi
  2021-07-29 18:47   ` Rob Herring
  2021-07-29 18:47   ` Rob Herring
  2021-07-19  2:31 ` [PATCH v2 2/2] dt-bindings: nvmem: Convert UniPhier eFuse bindings to json-schema Kunihiko Hayashi
  1 sibling, 2 replies; 6+ messages in thread
From: Kunihiko Hayashi @ 2021-07-19  2:31 UTC (permalink / raw)
  To: Srinivas Kandagatla, Rob Herring
  Cc: devicetree, linux-arm-kernel, linux-kernel, Masami Hiramatsu,
	Kunihiko Hayashi

Allow to extend expression of sub nodes to optionally indicate bit
position. This extension is needed to distinguish between different bit
positions in the same address.

For example, there are two nvmem nodes starting with bit 4 and bit 0
at the same address 0x54. In this case, it can be expressed as follows.

    trim@54,4 {
        reg = <0x54 1>;
        bits = <4 2>;
    };
    trim@54,0 {
        reg = <0x54 1>;
        bits = <0 4>;
    };

Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
---
 Documentation/devicetree/bindings/nvmem/nvmem.yaml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/nvmem/nvmem.yaml b/Documentation/devicetree/bindings/nvmem/nvmem.yaml
index b8dc3d2..9dfe196 100644
--- a/Documentation/devicetree/bindings/nvmem/nvmem.yaml
+++ b/Documentation/devicetree/bindings/nvmem/nvmem.yaml
@@ -40,7 +40,7 @@ properties:
     maxItems: 1
 
 patternProperties:
-  "^.*@[0-9a-f]+$":
+  "^.*@[0-9a-f]+(,[0-9]+)?$":
     type: object
 
     properties:
-- 
2.7.4


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

* [PATCH v2 2/2] dt-bindings: nvmem: Convert UniPhier eFuse bindings to json-schema
  2021-07-19  2:31 [PATCH v2 0/2] dt-bindings: Update nvmem and UniPhier eFuse bindings Kunihiko Hayashi
  2021-07-19  2:31 ` [PATCH v2 1/2] dt-bindings: nvmem: Extend patternProperties to optionally indicate bit position Kunihiko Hayashi
@ 2021-07-19  2:31 ` Kunihiko Hayashi
  2021-07-29 18:49   ` Rob Herring
  1 sibling, 1 reply; 6+ messages in thread
From: Kunihiko Hayashi @ 2021-07-19  2:31 UTC (permalink / raw)
  To: Srinivas Kandagatla, Rob Herring
  Cc: devicetree, linux-arm-kernel, linux-kernel, Masami Hiramatsu,
	Kunihiko Hayashi, Keiji Hayashibara

Convert the UniPhier eFuse binding to DT schema format.

Cc: Keiji Hayashibara <hayashibara.keiji@socionext.com>
Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
---
 .../bindings/nvmem/socionext,uniphier-efuse.yaml   | 95 ++++++++++++++++++++++
 .../devicetree/bindings/nvmem/uniphier-efuse.txt   | 49 -----------
 2 files changed, 95 insertions(+), 49 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/nvmem/socionext,uniphier-efuse.yaml
 delete mode 100644 Documentation/devicetree/bindings/nvmem/uniphier-efuse.txt

diff --git a/Documentation/devicetree/bindings/nvmem/socionext,uniphier-efuse.yaml b/Documentation/devicetree/bindings/nvmem/socionext,uniphier-efuse.yaml
new file mode 100644
index 0000000..2578e39
--- /dev/null
+++ b/Documentation/devicetree/bindings/nvmem/socionext,uniphier-efuse.yaml
@@ -0,0 +1,95 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/nvmem/socionext,uniphier-efuse.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Socionext UniPhier eFuse bindings
+
+maintainers:
+  - Keiji Hayashibara <hayashibara.keiji@socionext.com>
+  - Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
+
+allOf:
+  - $ref: "nvmem.yaml#"
+
+properties:
+  "#address-cells": true
+  "#size-cells": true
+
+  compatible:
+    const: socionext,uniphier-efuse
+
+  reg:
+    maxItems: 1
+
+required:
+  - compatible
+  - reg
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    // The UniPhier eFuse should be a subnode of a "soc-glue" node.
+
+    soc-glue@5f900000 {
+        compatible = "simple-mfd";
+        #address-cells = <1>;
+        #size-cells = <1>;
+        ranges = <0x0 0x5f900000 0x2000>;
+
+        efuse@100 {
+            compatible = "socionext,uniphier-efuse";
+            reg = <0x100 0x28>;
+        };
+
+        efuse@200 {
+            compatible = "socionext,uniphier-efuse";
+            reg = <0x200 0x68>;
+            #address-cells = <1>;
+            #size-cells = <1>;
+
+            /* Data cells */
+            usb_rterm0: trim@54,4 {
+                reg = <0x54 1>;
+                bits = <4 2>;
+            };
+            usb_rterm1: trim@55,4 {
+                reg = <0x55 1>;
+                bits = <4 2>;
+            };
+            usb_rterm2: trim@58,4 {
+                reg = <0x58 1>;
+                bits = <4 2>;
+            };
+            usb_rterm3: trim@59,4 {
+                reg = <0x59 1>;
+                bits = <4 2>;
+            };
+            usb_sel_t0: trim@54,0 {
+                reg = <0x54 1>;
+                bits = <0 4>;
+            };
+            usb_sel_t1: trim@55,0 {
+                reg = <0x55 1>;
+                bits = <0 4>;
+            };
+            usb_sel_t2: trim@58,0 {
+                reg = <0x58 1>;
+                bits = <0 4>;
+            };
+            usb_sel_t3: trim@59,0 {
+                reg = <0x59 1>;
+                bits = <0 4>;
+            };
+            usb_hs_i0: trim@56,0 {
+                reg = <0x56 1>;
+                bits = <0 4>;
+            };
+            usb_hs_i2: trim@5a,0 {
+                reg = <0x5a 1>;
+                bits = <0 4>;
+            };
+        };
+    };
diff --git a/Documentation/devicetree/bindings/nvmem/uniphier-efuse.txt b/Documentation/devicetree/bindings/nvmem/uniphier-efuse.txt
deleted file mode 100644
index eccf490..0000000
--- a/Documentation/devicetree/bindings/nvmem/uniphier-efuse.txt
+++ /dev/null
@@ -1,49 +0,0 @@
-= UniPhier eFuse device tree bindings =
-
-This UniPhier eFuse must be under soc-glue.
-
-Required properties:
-- compatible: should be "socionext,uniphier-efuse"
-- reg: should contain the register location and length
-
-= Data cells =
-Are child nodes of efuse, bindings of which as described in
-bindings/nvmem/nvmem.txt
-
-Example:
-
-	soc-glue@5f900000 {
-		compatible = "socionext,uniphier-ld20-soc-glue-debug",
-			     "simple-mfd";
-		#address-cells = <1>;
-		#size-cells = <1>;
-		ranges = <0x0 0x5f900000 0x2000>;
-
-		efuse@100 {
-			compatible = "socionext,uniphier-efuse";
-			reg = <0x100 0x28>;
-		};
-
-		efuse@200 {
-			compatible = "socionext,uniphier-efuse";
-			reg = <0x200 0x68>;
-			#address-cells = <1>;
-			#size-cells = <1>;
-
-			/* Data cells */
-			usb_mon: usb-mon@54 {
-				reg = <0x54 0xc>;
-			};
-		};
-	};
-
-= Data consumers =
-Are device nodes which consume nvmem data cells.
-
-Example:
-
-	usb {
-		...
-		nvmem-cells = <&usb_mon>;
-		nvmem-cell-names = "usb_mon";
-	}
-- 
2.7.4


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

* Re: [PATCH v2 1/2] dt-bindings: nvmem: Extend patternProperties to optionally indicate bit position
  2021-07-19  2:31 ` [PATCH v2 1/2] dt-bindings: nvmem: Extend patternProperties to optionally indicate bit position Kunihiko Hayashi
@ 2021-07-29 18:47   ` Rob Herring
  2021-07-29 18:47   ` Rob Herring
  1 sibling, 0 replies; 6+ messages in thread
From: Rob Herring @ 2021-07-29 18:47 UTC (permalink / raw)
  To: Kunihiko Hayashi
  Cc: Srinivas Kandagatla, devicetree, linux-arm-kernel, linux-kernel,
	Masami Hiramatsu

On Mon, Jul 19, 2021 at 11:31:03AM +0900, Kunihiko Hayashi wrote:
> Allow to extend expression of sub nodes to optionally indicate bit
> position. This extension is needed to distinguish between different bit
> positions in the same address.
> 
> For example, there are two nvmem nodes starting with bit 4 and bit 0
> at the same address 0x54. In this case, it can be expressed as follows.
> 
>     trim@54,4 {
>         reg = <0x54 1>;
>         bits = <4 2>;
>     };
>     trim@54,0 {
>         reg = <0x54 1>;
>         bits = <0 4>;
>     };
> 
> Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
> ---
>  Documentation/devicetree/bindings/nvmem/nvmem.yaml | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/Documentation/devicetree/bindings/nvmem/nvmem.yaml b/Documentation/devicetree/bindings/nvmem/nvmem.yaml
> index b8dc3d2..9dfe196 100644
> --- a/Documentation/devicetree/bindings/nvmem/nvmem.yaml
> +++ b/Documentation/devicetree/bindings/nvmem/nvmem.yaml
> @@ -40,7 +40,7 @@ properties:
>      maxItems: 1
>  
>  patternProperties:
> -  "^.*@[0-9a-f]+$":
> +  "^.*@[0-9a-f]+(,[0-9]+)?$":

The bit offset should be hex. But I think the max would be 7 as we can 
assume 'reg' starts at a byte boundary.

I'll fix up when applying.

Rob

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

* Re: [PATCH v2 1/2] dt-bindings: nvmem: Extend patternProperties to optionally indicate bit position
  2021-07-19  2:31 ` [PATCH v2 1/2] dt-bindings: nvmem: Extend patternProperties to optionally indicate bit position Kunihiko Hayashi
  2021-07-29 18:47   ` Rob Herring
@ 2021-07-29 18:47   ` Rob Herring
  1 sibling, 0 replies; 6+ messages in thread
From: Rob Herring @ 2021-07-29 18:47 UTC (permalink / raw)
  To: Kunihiko Hayashi
  Cc: Rob Herring, Masami Hiramatsu, Srinivas Kandagatla, devicetree,
	linux-kernel, linux-arm-kernel

On Mon, 19 Jul 2021 11:31:03 +0900, Kunihiko Hayashi wrote:
> Allow to extend expression of sub nodes to optionally indicate bit
> position. This extension is needed to distinguish between different bit
> positions in the same address.
> 
> For example, there are two nvmem nodes starting with bit 4 and bit 0
> at the same address 0x54. In this case, it can be expressed as follows.
> 
>     trim@54,4 {
>         reg = <0x54 1>;
>         bits = <4 2>;
>     };
>     trim@54,0 {
>         reg = <0x54 1>;
>         bits = <0 4>;
>     };
> 
> Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
> ---
>  Documentation/devicetree/bindings/nvmem/nvmem.yaml | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 

Applied, thanks!

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

* Re: [PATCH v2 2/2] dt-bindings: nvmem: Convert UniPhier eFuse bindings to json-schema
  2021-07-19  2:31 ` [PATCH v2 2/2] dt-bindings: nvmem: Convert UniPhier eFuse bindings to json-schema Kunihiko Hayashi
@ 2021-07-29 18:49   ` Rob Herring
  0 siblings, 0 replies; 6+ messages in thread
From: Rob Herring @ 2021-07-29 18:49 UTC (permalink / raw)
  To: Kunihiko Hayashi
  Cc: Srinivas Kandagatla, devicetree, linux-kernel, linux-arm-kernel,
	Keiji Hayashibara, Masami Hiramatsu, Rob Herring

On Mon, 19 Jul 2021 11:31:04 +0900, Kunihiko Hayashi wrote:
> Convert the UniPhier eFuse binding to DT schema format.
> 
> Cc: Keiji Hayashibara <hayashibara.keiji@socionext.com>
> Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
> ---
>  .../bindings/nvmem/socionext,uniphier-efuse.yaml   | 95 ++++++++++++++++++++++
>  .../devicetree/bindings/nvmem/uniphier-efuse.txt   | 49 -----------
>  2 files changed, 95 insertions(+), 49 deletions(-)
>  create mode 100644 Documentation/devicetree/bindings/nvmem/socionext,uniphier-efuse.yaml
>  delete mode 100644 Documentation/devicetree/bindings/nvmem/uniphier-efuse.txt
> 

Applied, thanks!

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

end of thread, other threads:[~2021-07-29 18:49 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-19  2:31 [PATCH v2 0/2] dt-bindings: Update nvmem and UniPhier eFuse bindings Kunihiko Hayashi
2021-07-19  2:31 ` [PATCH v2 1/2] dt-bindings: nvmem: Extend patternProperties to optionally indicate bit position Kunihiko Hayashi
2021-07-29 18:47   ` Rob Herring
2021-07-29 18:47   ` Rob Herring
2021-07-19  2:31 ` [PATCH v2 2/2] dt-bindings: nvmem: Convert UniPhier eFuse bindings to json-schema Kunihiko Hayashi
2021-07-29 18:49   ` Rob Herring

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).