[1/2] dt-bindings: nvmem: Add sophgo,efuses

Message ID 20231119131332.999-2-jszhang@kernel.org
State New
Headers
Series nvmem: Add Sophgo eFuse driver |

Commit Message

Jisheng Zhang Nov. 19, 2023, 1:13 p.m. UTC
  Sophgo SoCs such as CV1800B come with eFuses used to store
factory-programmed data such as calibration settings for the built-in
ethernet PHY.

Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
---
 .../bindings/nvmem/sophgo,efuse.yaml          | 54 +++++++++++++++++++
 1 file changed, 54 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/nvmem/sophgo,efuse.yaml
  

Comments

Krzysztof Kozlowski Nov. 20, 2023, 10:42 a.m. UTC | #1
On 19/11/2023 14:13, Jisheng Zhang wrote:
> Sophgo SoCs such as CV1800B come with eFuses used to store
> factory-programmed data such as calibration settings for the built-in
> ethernet PHY.
> 
> Signed-off-by: Jisheng Zhang <jszhang@kernel.org>

Thank you for your patch. There is something to discuss/improve.


> ---
>  .../bindings/nvmem/sophgo,efuse.yaml          | 54 +++++++++++++++++++
>  1 file changed, 54 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/nvmem/sophgo,efuse.yaml
> 
> diff --git a/Documentation/devicetree/bindings/nvmem/sophgo,efuse.yaml b/Documentation/devicetree/bindings/nvmem/sophgo,efuse.yaml
> new file mode 100644
> index 000000000000..e4ae81a1742a
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/nvmem/sophgo,efuse.yaml

Filename should match the compatible, unless you already have other
devices coming.

> @@ -0,0 +1,54 @@
> +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/nvmem/sophgo,efuse.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Sophgo SoC eFuse-based NVMEM
> +
> +description: |

Do not need '|' unless you need to preserve formatting.

> +  Sophgo SoCs such as the CV1800B contain factory-programmed eFuses used to e.g. store

Please wrap at Linux coding style (so 80).

> +  calibration data for the built-in ethernet PHY.


Blank line here.

> +maintainers:
> +  - Jisheng Zhang <jszhang@kernel.org>
> +
> +allOf:
> +  - $ref: nvmem.yaml#
> +  - $ref: nvmem-deprecated-cells.yaml#
> +
> +properties:
> +  compatible:
> +    items:

Drop items, we keep just enum directly for such cases.

> +      - enum:
> +          - sophgo,cv1800b-efuse
> +
> +  reg:
> +    maxItems: 1
> +
> +  clocks:
> +    description:
> +      eFuse clock id.

Drop description, quite obvious.

> +    maxItems: 1
> +
> +required:
> +  - compatible
> +  - reg
> +  - clocks
> +
> +unevaluatedProperties: false
> +...

Best regards,
Krzysztof
  
Rob Herring Nov. 27, 2023, 6:24 p.m. UTC | #2
On Sun, Nov 19, 2023 at 09:13:31PM +0800, Jisheng Zhang wrote:
> Sophgo SoCs such as CV1800B come with eFuses used to store
> factory-programmed data such as calibration settings for the built-in
> ethernet PHY.
> 
> Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
> ---
>  .../bindings/nvmem/sophgo,efuse.yaml          | 54 +++++++++++++++++++
>  1 file changed, 54 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/nvmem/sophgo,efuse.yaml
> 
> diff --git a/Documentation/devicetree/bindings/nvmem/sophgo,efuse.yaml b/Documentation/devicetree/bindings/nvmem/sophgo,efuse.yaml
> new file mode 100644
> index 000000000000..e4ae81a1742a
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/nvmem/sophgo,efuse.yaml
> @@ -0,0 +1,54 @@
> +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/nvmem/sophgo,efuse.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Sophgo SoC eFuse-based NVMEM
> +
> +description: |
> +  Sophgo SoCs such as the CV1800B contain factory-programmed eFuses used to e.g. store
> +  calibration data for the built-in ethernet PHY.
> +maintainers:
> +  - Jisheng Zhang <jszhang@kernel.org>
> +
> +allOf:
> +  - $ref: nvmem.yaml#
> +  - $ref: nvmem-deprecated-cells.yaml#

Why does a new binding need to use the deprecated form?

Rob
  

Patch

diff --git a/Documentation/devicetree/bindings/nvmem/sophgo,efuse.yaml b/Documentation/devicetree/bindings/nvmem/sophgo,efuse.yaml
new file mode 100644
index 000000000000..e4ae81a1742a
--- /dev/null
+++ b/Documentation/devicetree/bindings/nvmem/sophgo,efuse.yaml
@@ -0,0 +1,54 @@ 
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/nvmem/sophgo,efuse.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Sophgo SoC eFuse-based NVMEM
+
+description: |
+  Sophgo SoCs such as the CV1800B contain factory-programmed eFuses used to e.g. store
+  calibration data for the built-in ethernet PHY.
+maintainers:
+  - Jisheng Zhang <jszhang@kernel.org>
+
+allOf:
+  - $ref: nvmem.yaml#
+  - $ref: nvmem-deprecated-cells.yaml#
+
+properties:
+  compatible:
+    items:
+      - enum:
+          - sophgo,cv1800b-efuse
+
+  reg:
+    maxItems: 1
+
+  clocks:
+    description:
+      eFuse clock id.
+    maxItems: 1
+
+required:
+  - compatible
+  - reg
+  - clocks
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    efuse@3050000 {
+        compatible = "sophgo,cv1800b-efuse";
+        reg = <0x3050000 0x1000>;
+        #address-cells = <1>;
+        #size-cells = <1>;
+        clocks = <&clk 1>;
+
+        ephy_txitune: ephy-txitune@24 {
+            reg = <0x24 0x4>;
+        };
+    };
+
+...