diff mbox series

[1/2] dt-bindings: lan966x-otpc: document Lan966X OTPC

Message ID 20220818164405.1953698-2-horatiu.vultur@microchip.com
State Changes Requested, archived
Headers show
Series nvmem: lan966x-otpc: add support | expand

Checks

Context Check Description
robh/checkpatch success
robh/patch-applied success
robh/dtbs-check warning build log
robh/dt-meta-schema success

Commit Message

Horatiu Vultur Aug. 18, 2022, 4:44 p.m. UTC
Document Lan966x OTP controller.

Signed-off-by: Horatiu Vultur <horatiu.vultur@microchip.com>
---
 .../nvmem/microchip,lan966x-otpc.yaml         | 42 +++++++++++++++++++
 1 file changed, 42 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/nvmem/microchip,lan966x-otpc.yaml

Comments

Krzysztof Kozlowski Aug. 19, 2022, 6:52 a.m. UTC | #1
On 18/08/2022 19:44, Horatiu Vultur wrote:
> Document Lan966x OTP controller.
> 
> Signed-off-by: Horatiu Vultur <horatiu.vultur@microchip.com>
> ---
>  .../nvmem/microchip,lan966x-otpc.yaml         | 42 +++++++++++++++++++
>  1 file changed, 42 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/nvmem/microchip,lan966x-otpc.yaml
> 
> diff --git a/Documentation/devicetree/bindings/nvmem/microchip,lan966x-otpc.yaml b/Documentation/devicetree/bindings/nvmem/microchip,lan966x-otpc.yaml
> new file mode 100644
> index 000000000000..b19465971930
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/nvmem/microchip,lan966x-otpc.yaml
> @@ -0,0 +1,42 @@
> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/nvmem/microchip,lan966x-otpc.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Microchip LAN966X OTP Controller (OTPC)
> +
> +maintainers:
> +  - Horatiu Vultur <horatiu.vultur@microchip.com>
> +
> +description: |
> +  OTP controller drives a NVMEM memory where system specific data
> +  (e.g. hardware configuration settings, chip identifiers) or
> +  user specific data could be stored.
> +
> +allOf:
> +  - $ref: "nvmem.yaml#"

No need for quotes.

> +
> +properties:
> +  compatible:
> +    items:
> +      - const: microchip,lan966x-otpc

No wildcards in compatible (which will also affect the file name as it
should match the compatible).

> +      - const: syscon

Is OTP controller also system controller register region? This is a bit
odd and looks like hack not to use nvmem subsystem.

> +
> +  reg:
> +    maxItems: 1
> +
> +required:
> +  - compatible
> +  - reg
> +
> +unevaluatedProperties: false
> +
> +examples:
> +  - |
> +    otpc: otp@e0021000 {
> +        compatible = "microchip,lan966x-otpc", "syscon";
> +        reg = <0xe0021000 0x300>;
> +    };
> +
> +...


Best regards,
Krzysztof
Horatiu Vultur Aug. 22, 2022, 6:04 a.m. UTC | #2
The 08/19/2022 09:52, Krzysztof Kozlowski wrote:

Hi Krzysztof,

> 
> On 18/08/2022 19:44, Horatiu Vultur wrote:
> > Document Lan966x OTP controller.
> >
> > +
> > +properties:
> > +  compatible:
> > +    items:
> > +      - const: microchip,lan966x-otpc
> 
> No wildcards in compatible (which will also affect the file name as it
> should match the compatible).

Ok, I will replace lan966x with lan966 as the SoC is defined (SOC_LAN966)

> 
> > +      - const: syscon
> 
> Is OTP controller also system controller register region? This is a bit
> odd and looks like hack not to use nvmem subsystem.

That was a copy paste mistake. The OTP controller is not a system
controller register region.

> 
> > +
> > +  reg:
> > +    maxItems: 1
> > +
> > +required:
> > +  - compatible
> > +  - reg
> > +
> > +unevaluatedProperties: false
> > +
> > +examples:
> > +  - |
> > +    otpc: otp@e0021000 {
> > +        compatible = "microchip,lan966x-otpc", "syscon";
> > +        reg = <0xe0021000 0x300>;
> > +    };
> > +
> > +...
> 
> 
> Best regards,
> Krzysztof
Rob Herring Aug. 22, 2022, 6:17 p.m. UTC | #3
On Mon, Aug 22, 2022 at 08:04:56AM +0200, Horatiu Vultur wrote:
> The 08/19/2022 09:52, Krzysztof Kozlowski wrote:
> 
> Hi Krzysztof,
> 
> > 
> > On 18/08/2022 19:44, Horatiu Vultur wrote:
> > > Document Lan966x OTP controller.
> > >
> > > +
> > > +properties:
> > > +  compatible:
> > > +    items:
> > > +      - const: microchip,lan966x-otpc
> > 
> > No wildcards in compatible (which will also affect the file name as it
> > should match the compatible).
> 
> Ok, I will replace lan966x with lan966 as the SoC is defined (SOC_LAN966)

Pretty sure that's still a wildcard for the SoC family. 9668 or 9662 are 
the ones we already have. Yes, there's already a bunch of 966x 
compatibles, but that's not a pattern that should continue.

Rob
Horatiu Vultur Aug. 22, 2022, 8:10 p.m. UTC | #4
The 08/22/2022 13:17, Rob Herring wrote:

Hi Rob,

> 
> > > On 18/08/2022 19:44, Horatiu Vultur wrote:
> > > > Document Lan966x OTP controller.
> > > >
> > > > +
> > > > +properties:
> > > > +  compatible:
> > > > +    items:
> > > > +      - const: microchip,lan966x-otpc
> > >
> > > No wildcards in compatible (which will also affect the file name as it
> > > should match the compatible).
> >
> > Ok, I will replace lan966x with lan966 as the SoC is defined (SOC_LAN966)
> 
> Pretty sure that's still a wildcard for the SoC family. 9668 or 9662 are
> the ones we already have. Yes, there's already a bunch of 966x
> compatibles, but that's not a pattern that should continue.

OK, I can use the lan9668 and lan9662 as compatible string.
But then how should the file be named? As it need to match the
compatible string.

> 
> Rob
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/nvmem/microchip,lan966x-otpc.yaml b/Documentation/devicetree/bindings/nvmem/microchip,lan966x-otpc.yaml
new file mode 100644
index 000000000000..b19465971930
--- /dev/null
+++ b/Documentation/devicetree/bindings/nvmem/microchip,lan966x-otpc.yaml
@@ -0,0 +1,42 @@ 
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/nvmem/microchip,lan966x-otpc.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Microchip LAN966X OTP Controller (OTPC)
+
+maintainers:
+  - Horatiu Vultur <horatiu.vultur@microchip.com>
+
+description: |
+  OTP controller drives a NVMEM memory where system specific data
+  (e.g. hardware configuration settings, chip identifiers) or
+  user specific data could be stored.
+
+allOf:
+  - $ref: "nvmem.yaml#"
+
+properties:
+  compatible:
+    items:
+      - const: microchip,lan966x-otpc
+      - const: syscon
+
+  reg:
+    maxItems: 1
+
+required:
+  - compatible
+  - reg
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    otpc: otp@e0021000 {
+        compatible = "microchip,lan966x-otpc", "syscon";
+        reg = <0xe0021000 0x300>;
+    };
+
+...