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

Horatiu Vultur posted 2 patches 3 years, 7 months ago
[PATCH 1/2] dt-bindings: lan966x-otpc: document Lan966X OTPC
Posted by Horatiu Vultur 3 years, 7 months ago
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#"
+
+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>;
+    };
+
+...
-- 
2.33.0
Re: [PATCH 1/2] dt-bindings: lan966x-otpc: document Lan966X OTPC
Posted by Krzysztof Kozlowski 3 years, 7 months ago
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
Re: [PATCH 1/2] dt-bindings: lan966x-otpc: document Lan966X OTPC
Posted by Horatiu Vultur 3 years, 7 months ago
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

-- 
/Horatiu
Re: [PATCH 1/2] dt-bindings: lan966x-otpc: document Lan966X OTPC
Posted by Rob Herring 3 years, 7 months ago
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
Re: [PATCH 1/2] dt-bindings: lan966x-otpc: document Lan966X OTPC
Posted by Horatiu Vultur 3 years, 7 months ago
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

-- 
/Horatiu