[1/2] dt-bindings: nvmem: add binding doc for i.MX OCOTP/ELE

Message ID 20230505091733.1819521-1-peng.fan@oss.nxp.com
State New
Headers
Series [1/2] dt-bindings: nvmem: add binding doc for i.MX OCOTP/ELE |

Commit Message

Peng Fan (OSS) May 5, 2023, 9:17 a.m. UTC
  From: Peng Fan <peng.fan@nxp.com>

There are two parts of i.MX93 OCOTP, with 1st part Fuse shadow block(fsb),
2nd part managed by ELE firmware. This binding doc supports both.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
 .../bindings/nvmem/imx-ocotp-ele.yaml         | 65 +++++++++++++++++++
 1 file changed, 65 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/nvmem/imx-ocotp-ele.yaml
  

Comments

Marco Felsch May 5, 2023, 10:24 a.m. UTC | #1
Hi,

On 23-05-05, Peng Fan (OSS) wrote:
> From: Peng Fan <peng.fan@nxp.com>

...

> +examples:
> +  - |
> +    #include <dt-bindings/clock/imx6sx-clock.h>
> +
> +    ocotp: efuse@21bc000 {
> +        #address-cells = <1>;
> +        #size-cells = <1>;
> +        compatible = "fsl,imx6sx-ocotp", "syscon";
> +        reg = <0x021bc000 0x4000>;
> +        clocks = <&clks IMX6SX_CLK_OCOTP>;

Nit: the "compatible" should be the first property followed by the "reg"
property.

Regards,
  Marco

> +
> +        cpu_speed_grade: speed-grade@10 {
> +            reg = <0x10 4>;
> +        };
> +
> +        tempmon_calib: calib@38 {
> +            reg = <0x38 4>;
> +        };
> +
> +        tempmon_temp_grade: temp-grade@20 {
> +            reg = <0x20 4>;
> +        };
> +    };
> +
> +...
> -- 
> 2.37.1
> 
> 
>
  
Krzysztof Kozlowski May 5, 2023, 12:01 p.m. UTC | #2
On 05/05/2023 11:17, Peng Fan (OSS) wrote:
> From: Peng Fan <peng.fan@nxp.com>
> 
> There are two parts of i.MX93 OCOTP, with 1st part Fuse shadow block(fsb),
> 2nd part managed by ELE firmware. This binding doc supports both.

Subject: drop second/last, redundant "binding doc for". The
"dt-bindings" prefix is already stating that these are bindings and
documentation.

> 
> Signed-off-by: Peng Fan <peng.fan@nxp.com>
> ---
>  .../bindings/nvmem/imx-ocotp-ele.yaml         | 65 +++++++++++++++++++
>  1 file changed, 65 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/nvmem/imx-ocotp-ele.yaml
> 
> diff --git a/Documentation/devicetree/bindings/nvmem/imx-ocotp-ele.yaml b/Documentation/devicetree/bindings/nvmem/imx-ocotp-ele.yaml
> new file mode 100644
> index 000000000000..024594a2bcb4
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/nvmem/imx-ocotp-ele.yaml

Filename matching compatible style. fsl,imx93-ocotp.yaml


> @@ -0,0 +1,65 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/nvmem/imx-ocotp-ele.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: NXP i.MX9 On-Chip OTP Controller (OCOTP)
> +
> +maintainers:
> +  - Peng Fan <peng.fan@nxp.com>
> +
> +allOf:
> +  - $ref: nvmem.yaml#
> +
> +properties:
> +  compatible:
> +    oneOf:
> +      - items:
> +          - const: fsl,imx93-ocotp-fsb
> +          - const: syscon
> +      - items:
> +          - const: fsl,imx93-ocotp-ele
> +
> +  reg:
> +    maxItems: 1
> +
> +  "#address-cells":
> +    const: 1

Drop

> +
> +  "#size-cells":
> +    const: 1

Drop

> +
> +  clocks:
> +    maxItems: 1
> +
> +required:
> +  - compatible

Also: reg and clocks

> +
> +unevaluatedProperties: false
> +
Best regards,
Krzysztof
  
Krzysztof Kozlowski May 5, 2023, 12:09 p.m. UTC | #3
On 05/05/2023 14:01, Krzysztof Kozlowski wrote:
> On 05/05/2023 11:17, Peng Fan (OSS) wrote:
>> From: Peng Fan <peng.fan@nxp.com>
>>
>> There are two parts of i.MX93 OCOTP, with 1st part Fuse shadow block(fsb),
>> 2nd part managed by ELE firmware. This binding doc supports both.
> 
> Subject: drop second/last, redundant "binding doc for". The
> "dt-bindings" prefix is already stating that these are bindings and
> documentation.
> 
>>
>> Signed-off-by: Peng Fan <peng.fan@nxp.com>
>> ---
>>  .../bindings/nvmem/imx-ocotp-ele.yaml         | 65 +++++++++++++++++++
>>  1 file changed, 65 insertions(+)
>>  create mode 100644 Documentation/devicetree/bindings/nvmem/imx-ocotp-ele.yaml
>>
>> diff --git a/Documentation/devicetree/bindings/nvmem/imx-ocotp-ele.yaml b/Documentation/devicetree/bindings/nvmem/imx-ocotp-ele.yaml
>> new file mode 100644
>> index 000000000000..024594a2bcb4
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/nvmem/imx-ocotp-ele.yaml
> 
> Filename matching compatible style. fsl,imx93-ocotp.yaml
> 
> 
>> @@ -0,0 +1,65 @@
>> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
>> +%YAML 1.2
>> +---
>> +$id: http://devicetree.org/schemas/nvmem/imx-ocotp-ele.yaml#
>> +$schema: http://devicetree.org/meta-schemas/core.yaml#
>> +
>> +title: NXP i.MX9 On-Chip OTP Controller (OCOTP)
>> +
>> +maintainers:
>> +  - Peng Fan <peng.fan@nxp.com>
>> +
>> +allOf:
>> +  - $ref: nvmem.yaml#
>> +
>> +properties:
>> +  compatible:
>> +    oneOf:
>> +      - items:
>> +          - const: fsl,imx93-ocotp-fsb
>> +          - const: syscon
>> +      - items:
>> +          - const: fsl,imx93-ocotp-ele
>> +

Actually this is the same as existing bindings. Just squash it.

However I wonder - why this is syscon?

Best regards,
Krzysztof
  
Peng Fan May 6, 2023, 2:58 a.m. UTC | #4
> Subject: Re: [PATCH 1/2] dt-bindings: nvmem: add binding doc for i.MX
> OCOTP/ELE
> 
> On 05/05/2023 14:01, Krzysztof Kozlowski wrote:
> > On 05/05/2023 11:17, Peng Fan (OSS) wrote:
> >> From: Peng Fan <peng.fan@nxp.com>
> >>
> >> There are two parts of i.MX93 OCOTP, with 1st part Fuse shadow
> >> block(fsb), 2nd part managed by ELE firmware. This binding doc supports
> both.
> >
> > Subject: drop second/last, redundant "binding doc for". The
> > "dt-bindings" prefix is already stating that these are bindings and
> > documentation.
> >
> >>
> >> Signed-off-by: Peng Fan <peng.fan@nxp.com>
> >> ---
> >>  .../bindings/nvmem/imx-ocotp-ele.yaml         | 65 +++++++++++++++++++
> >>  1 file changed, 65 insertions(+)
> >>  create mode 100644
> >> Documentation/devicetree/bindings/nvmem/imx-ocotp-ele.yaml
> >>
> >> diff --git
> >> a/Documentation/devicetree/bindings/nvmem/imx-ocotp-ele.yaml
> >> b/Documentation/devicetree/bindings/nvmem/imx-ocotp-ele.yaml
> >> new file mode 100644
> >> index 000000000000..024594a2bcb4
> >> --- /dev/null
> >> +++ b/Documentation/devicetree/bindings/nvmem/imx-ocotp-ele.yaml
> >
> > Filename matching compatible style. fsl,imx93-ocotp.yaml
> >
> >
> >> @@ -0,0 +1,65 @@
> >> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) %YAML 1.2
> >> +---
> >> +$id:
> >>
> +https://eur01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fdev
> >> +icetree.org%2Fschemas%2Fnvmem%2Fimx-ocotp-
> ele.yaml%23&data=05%7C01%7
> >>
> +Cpeng.fan%40nxp.com%7Cd779f2b1abe94a0d493208db4d618fd9%7C686e
> a1d3bc2
> >>
> +b4c6fa92cd99c5c301635%7C0%7C0%7C638188853636582816%7CUnknown
> %7CTWFpb
> >>
> +GZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXV
> CI6M
> >>
> +n0%3D%7C3000%7C%7C%7C&sdata=2uIFOmUqlbgPIRasl%2FyO0CdZAFPhV
> 2qpHnhwKB
> >> +OZ008%3D&reserved=0
> >> +$schema:
> >>
> +https://eur01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fdev
> >> +icetree.org%2Fmeta-
> schemas%2Fcore.yaml%23&data=05%7C01%7Cpeng.fan%40
> >>
> +nxp.com%7Cd779f2b1abe94a0d493208db4d618fd9%7C686ea1d3bc2b4c6f
> a92cd99
> >>
> +c5c301635%7C0%7C0%7C638188853636582816%7CUnknown%7CTWFpbG
> Zsb3d8eyJWI
> >>
> +joiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7
> C3000
> >>
> +%7C%7C%7C&sdata=iKJpzjsi7TuqxDim7sUjHmwFR1eK9hFNp2ygMap9bq8%
> 3D&reser
> >> +ved=0
> >> +
> >> +title: NXP i.MX9 On-Chip OTP Controller (OCOTP)
> >> +
> >> +maintainers:
> >> +  - Peng Fan <peng.fan@nxp.com>
> >> +
> >> +allOf:
> >> +  - $ref: nvmem.yaml#
> >> +
> >> +properties:
> >> +  compatible:
> >> +    oneOf:
> >> +      - items:
> >> +          - const: fsl,imx93-ocotp-fsb
> >> +          - const: syscon
> >> +      - items:
> >> +          - const: fsl,imx93-ocotp-ele
> >> +
> 
> Actually this is the same as existing bindings. Just squash it.

You mean add the compatible to imx-ocotp.yaml?

> 
> However I wonder - why this is syscon?

Someone may wanna to use syscon_to_regmap?
I just follow imx-ocotp.yaml.

Regards,
Peng.

> 
> Best regards,
> Krzysztof
  
Krzysztof Kozlowski May 6, 2023, 6:34 a.m. UTC | #5
On 06/05/2023 04:58, Peng Fan wrote:
>> Subject: Re: [PATCH 1/2] dt-bindings: nvmem: add binding doc for i.MX
>> OCOTP/ELE
>>
>> On 05/05/2023 14:01, Krzysztof Kozlowski wrote:
>>> On 05/05/2023 11:17, Peng Fan (OSS) wrote:
>>>> From: Peng Fan <peng.fan@nxp.com>
>>>>
>>>> There are two parts of i.MX93 OCOTP, with 1st part Fuse shadow
>>>> block(fsb), 2nd part managed by ELE firmware. This binding doc supports
>> both.
>>>
>>> Subject: drop second/last, redundant "binding doc for". The
>>> "dt-bindings" prefix is already stating that these are bindings and
>>> documentation.
>>>
>>>>
>>>> Signed-off-by: Peng Fan <peng.fan@nxp.com>
>>>> ---
>>>>  .../bindings/nvmem/imx-ocotp-ele.yaml         | 65 +++++++++++++++++++
>>>>  1 file changed, 65 insertions(+)
>>>>  create mode 100644
>>>> Documentation/devicetree/bindings/nvmem/imx-ocotp-ele.yaml
>>>>
>>>> diff --git
>>>> a/Documentation/devicetree/bindings/nvmem/imx-ocotp-ele.yaml
>>>> b/Documentation/devicetree/bindings/nvmem/imx-ocotp-ele.yaml
>>>> new file mode 100644
>>>> index 000000000000..024594a2bcb4
>>>> --- /dev/null
>>>> +++ b/Documentation/devicetree/bindings/nvmem/imx-ocotp-ele.yaml
>>>
>>> Filename matching compatible style. fsl,imx93-ocotp.yaml
>>>
>>>
>>>> @@ -0,0 +1,65 @@
>>>> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) %YAML 1.2
>>>> +---
>>>> +$id:
>>>>
>> +https://eur01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fdev
>>>> +icetree.org%2Fschemas%2Fnvmem%2Fimx-ocotp-
>> ele.yaml%23&data=05%7C01%7
>>>>
>> +Cpeng.fan%40nxp.com%7Cd779f2b1abe94a0d493208db4d618fd9%7C686e
>> a1d3bc2
>>>>
>> +b4c6fa92cd99c5c301635%7C0%7C0%7C638188853636582816%7CUnknown
>> %7CTWFpb
>>>>
>> +GZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXV
>> CI6M
>>>>
>> +n0%3D%7C3000%7C%7C%7C&sdata=2uIFOmUqlbgPIRasl%2FyO0CdZAFPhV
>> 2qpHnhwKB
>>>> +OZ008%3D&reserved=0
>>>> +$schema:
>>>>
>> +https://eur01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fdev
>>>> +icetree.org%2Fmeta-
>> schemas%2Fcore.yaml%23&data=05%7C01%7Cpeng.fan%40
>>>>
>> +nxp.com%7Cd779f2b1abe94a0d493208db4d618fd9%7C686ea1d3bc2b4c6f
>> a92cd99
>>>>
>> +c5c301635%7C0%7C0%7C638188853636582816%7CUnknown%7CTWFpbG
>> Zsb3d8eyJWI
>>>>
>> +joiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7
>> C3000
>>>>
>> +%7C%7C%7C&sdata=iKJpzjsi7TuqxDim7sUjHmwFR1eK9hFNp2ygMap9bq8%
>> 3D&reser
>>>> +ved=0
>>>> +
>>>> +title: NXP i.MX9 On-Chip OTP Controller (OCOTP)
>>>> +
>>>> +maintainers:
>>>> +  - Peng Fan <peng.fan@nxp.com>
>>>> +
>>>> +allOf:
>>>> +  - $ref: nvmem.yaml#
>>>> +
>>>> +properties:
>>>> +  compatible:
>>>> +    oneOf:
>>>> +      - items:
>>>> +          - const: fsl,imx93-ocotp-fsb
>>>> +          - const: syscon
>>>> +      - items:
>>>> +          - const: fsl,imx93-ocotp-ele
>>>> +
>>
>> Actually this is the same as existing bindings. Just squash it.
> 
> You mean add the compatible to imx-ocotp.yaml?

I missed this file, I was thinking about mxs, but sure, can go to imx.
All of them are the same...

> 
>>
>> However I wonder - why this is syscon?
> 
> Someone may wanna to use syscon_to_regmap?
> I just follow imx-ocotp.yaml.

That's not a good reason to add syscon. Drop it.

Best regards,
Krzysztof
  

Patch

diff --git a/Documentation/devicetree/bindings/nvmem/imx-ocotp-ele.yaml b/Documentation/devicetree/bindings/nvmem/imx-ocotp-ele.yaml
new file mode 100644
index 000000000000..024594a2bcb4
--- /dev/null
+++ b/Documentation/devicetree/bindings/nvmem/imx-ocotp-ele.yaml
@@ -0,0 +1,65 @@ 
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/nvmem/imx-ocotp-ele.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: NXP i.MX9 On-Chip OTP Controller (OCOTP)
+
+maintainers:
+  - Peng Fan <peng.fan@nxp.com>
+
+allOf:
+  - $ref: nvmem.yaml#
+
+properties:
+  compatible:
+    oneOf:
+      - items:
+          - const: fsl,imx93-ocotp-fsb
+          - const: syscon
+      - items:
+          - const: fsl,imx93-ocotp-ele
+
+  reg:
+    maxItems: 1
+
+  "#address-cells":
+    const: 1
+
+  "#size-cells":
+    const: 1
+
+  clocks:
+    maxItems: 1
+
+required:
+  - compatible
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/clock/imx6sx-clock.h>
+
+    ocotp: efuse@21bc000 {
+        #address-cells = <1>;
+        #size-cells = <1>;
+        compatible = "fsl,imx6sx-ocotp", "syscon";
+        reg = <0x021bc000 0x4000>;
+        clocks = <&clks IMX6SX_CLK_OCOTP>;
+
+        cpu_speed_grade: speed-grade@10 {
+            reg = <0x10 4>;
+        };
+
+        tempmon_calib: calib@38 {
+            reg = <0x38 4>;
+        };
+
+        tempmon_temp_grade: temp-grade@20 {
+            reg = <0x20 4>;
+        };
+    };
+
+...