2020-05-12 18:20:49

by Ravi Kumar Bokka

[permalink] [raw]
Subject: [RFC v1 1/3] dt-bindings: nvmem: Add devicetree bindings for qfprom-efuse

This patch adds dt-bindings document for qfprom-efuse controller.

Signed-off-by: Ravi Kumar Bokka <[email protected]>
---
.../devicetree/bindings/nvmem/qfprom-efuse.yaml | 40 ++++++++++++++++++++++
1 file changed, 40 insertions(+)
create mode 100644 Documentation/devicetree/bindings/nvmem/qfprom-efuse.yaml

diff --git a/Documentation/devicetree/bindings/nvmem/qfprom-efuse.yaml b/Documentation/devicetree/bindings/nvmem/qfprom-efuse.yaml
new file mode 100644
index 0000000..d262c99
--- /dev/null
+++ b/Documentation/devicetree/bindings/nvmem/qfprom-efuse.yaml
@@ -0,0 +1,40 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/nvmem/qfprom-efuse.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Qualcomm Technologies Inc, QFPROM Efuse bindings
+
+maintainers:
+ - Ravi Kumar Bokka <[email protected]>
+
+allOf:
+ - $ref: "nvmem.yaml#"
+
+properties:
+ compatible:
+ enum:
+ - qcom,sc7180-qfprom-efuse
+
+ reg:
+ maxItems: 3
+
+required:
+ - compatible
+ - reg
+ - clocks
+ - clock-names
+
+examples:
+ - |
+ #include <dt-bindings/clock/qcom,gcc-sc7180.h>
+
+ efuse@780000 {
+ compatible = "qcom,sc7180-qfprom-efuse";
+ reg = <0 0x00780000 0 0x100>,
+ <0 0x00780120 0 0x7a0>,
+ <0 0x00782000 0 0x100>;
+ clocks = <&gcc GCC_SEC_CTRL_CLK_SRC>;
+ clock-names = "secclk";
+ };
--
Qualcomm INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, hosted by the Linux Foundation.


2020-05-12 22:39:47

by Rob Herring (Arm)

[permalink] [raw]
Subject: Re: [RFC v1 1/3] dt-bindings: nvmem: Add devicetree bindings for qfprom-efuse

On Tue, 12 May 2020 23:47:58 +0530, Ravi Kumar Bokka wrote:
> This patch adds dt-bindings document for qfprom-efuse controller.
>
> Signed-off-by: Ravi Kumar Bokka <[email protected]>
> ---
> .../devicetree/bindings/nvmem/qfprom-efuse.yaml | 40 ++++++++++++++++++++++
> 1 file changed, 40 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/nvmem/qfprom-efuse.yaml
>


My bot found errors running 'make dt_binding_check' on your patch:

Documentation/devicetree/bindings/nvmem/qfprom-efuse.yaml: while scanning a block scalar
in "<unicode string>", line 30, column 5
found a tab character where an indentation space is expected
in "<unicode string>", line 34, column 1
Documentation/devicetree/bindings/Makefile:12: recipe for target 'Documentation/devicetree/bindings/nvmem/qfprom-efuse.example.dts' failed
make[1]: *** [Documentation/devicetree/bindings/nvmem/qfprom-efuse.example.dts] Error 1
make[1]: *** Waiting for unfinished jobs....
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/nvmem/qfprom-efuse.yaml: ignoring, error parsing file
warning: no schema found in file: ./Documentation/devicetree/bindings/nvmem/qfprom-efuse.yaml
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/nvmem/qfprom-efuse.yaml: ignoring, error parsing file
warning: no schema found in file: ./Documentation/devicetree/bindings/nvmem/qfprom-efuse.yaml
Makefile:1300: recipe for target 'dt_binding_check' failed
make: *** [dt_binding_check] Error 2

See https://patchwork.ozlabs.org/patch/1288685

If you already ran 'make dt_binding_check' and didn't see the above
error(s), then make sure dt-schema is up to date:

pip3 install git+https://github.com/devicetree-org/dt-schema.git@master --upgrade

Please check and re-submit.

2020-05-12 23:05:50

by Doug Anderson

[permalink] [raw]
Subject: Re: [RFC v1 1/3] dt-bindings: nvmem: Add devicetree bindings for qfprom-efuse

Hi,

On Tue, May 12, 2020 at 11:18 AM Ravi Kumar Bokka <[email protected]> wrote:
>
> This patch adds dt-bindings document for qfprom-efuse controller.
>
> Signed-off-by: Ravi Kumar Bokka <[email protected]>
> ---
> .../devicetree/bindings/nvmem/qfprom-efuse.yaml | 40 ++++++++++++++++++++++
> 1 file changed, 40 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/nvmem/qfprom-efuse.yaml
>
> diff --git a/Documentation/devicetree/bindings/nvmem/qfprom-efuse.yaml b/Documentation/devicetree/bindings/nvmem/qfprom-efuse.yaml
> new file mode 100644
> index 0000000..d262c99
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/nvmem/qfprom-efuse.yaml
> @@ -0,0 +1,40 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/nvmem/qfprom-efuse.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Qualcomm Technologies Inc, QFPROM Efuse bindings
> +
> +maintainers:
> + - Ravi Kumar Bokka <[email protected]>
> +
> +allOf:
> + - $ref: "nvmem.yaml#"
> +
> +properties:
> + compatible:
> + enum:
> + - qcom,sc7180-qfprom-efuse
> +
> + reg:
> + maxItems: 3

Instead of this, add descriptions for the 3 items. AKA:

reg:
items:
- description: The base of the qfprom.
- description: The start of the raw region.
- description: The start of the mem region.

...but do you really need to break this down into 3 ranges? Why can't
you just do:

reg = <0 0x00780000 0 0x2100>;

Then you really don't need any description and you'd just have:

reg:
maxItems: 1


> +

Need something for clocks and clock-names, like:

clocks:
maxItems: 1

clock-names:
items:
- const: sec


> +required:
> + - compatible
> + - reg
> + - clocks
> + - clock-names
> +
> +examples:
> + - |
> + #include <dt-bindings/clock/qcom,gcc-sc7180.h>
> +
> + efuse@780000 {
> + compatible = "qcom,sc7180-qfprom-efuse";
> + reg = <0 0x00780000 0 0x100>,
> + <0 0x00780120 0 0x7a0>,
> + <0 0x00782000 0 0x100>;
> + clocks = <&gcc GCC_SEC_CTRL_CLK_SRC>;
> + clock-names = "secclk";

nit: Folks usually don't like the names of clocks to end in "clk". We
know it's a clock. Just name this "sec" or even a local name like
"core".