linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH dt-schema.git] schemas: add NVMEM cell with #nvmem-cell-cells
@ 2022-11-21 10:58 Rafał Miłecki
  2022-11-21 11:02 ` Michael Walle
  2022-11-21 11:25 ` Krzysztof Kozlowski
  0 siblings, 2 replies; 4+ messages in thread
From: Rafał Miłecki @ 2022-11-21 10:58 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski
  Cc: Michael Walle, Srinivas Kandagatla, Miquel Raynal,
	Richard Weinberger, Vignesh Raghavendra, linux-mtd, devicetree,
	linux-arm-kernel, linux-kernel, Rafał Miłecki

From: Rafał Miłecki <rafal@milecki.pl>

Some NVMEM cells may provide more than 1 value. An example can be base
MAC address that is used for calculating multiple MACs (for few
different devices). For specifying value to read phandle needs to be
used with an argument.

Cc: Srinivas Kandagatla" <srinivas.kandagatla@linaro.org>
Cc: Michael Walle <michael@walle.cc>
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
---
This bit is required for moving forward with the
[PATCH v2 00/20] nvmem: core: introduce NVMEM layouts
https://lore.kernel.org/linux-arm-kernel/20220901221857.2600340-1-michael@walle.cc/

As pointed out by Rob #nvmem-cell-cells should be added to the dt-schema
and not a Linux binding:
Re: [PATCH v2 15/20] dt-bindings: nvmem: add YAML schema for the sl28 vpd layout
https://lore.kernel.org/linux-arm-kernel/20220912192038.GA1661550-robh@kernel.org/

sl28 is one example that needs #nvmem-cell-cells
u-boot,env is another one

Please let me know if I got this binding right at all.
---
 dtschema/schemas/nvmem/nvmem-cell.yaml | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)
 create mode 100644 dtschema/schemas/nvmem/nvmem-cell.yaml

diff --git a/dtschema/schemas/nvmem/nvmem-cell.yaml b/dtschema/schemas/nvmem/nvmem-cell.yaml
new file mode 100644
index 0000000..dfa99b8
--- /dev/null
+++ b/dtschema/schemas/nvmem/nvmem-cell.yaml
@@ -0,0 +1,23 @@
+# SPDX-License-Identifier: BSD-2-Clause
+$id: "http://devicetree.org/schemas/nvmem/nvmem-cell.yaml#"
+$schema: "http://devicetree.org/meta-schemas/base.yaml#"
+
+title: NVMEM Cell Common Properties
+description: "Schema for NVMEM cell devicetree bindings"
+maintainers:
+  - Rafał Miłecki <rafal@milecki.pl>
+  - Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
+
+# always select the core schema
+select: true
+
+properties:
+  "#nvmem-cell-cells":
+    $ref: "/schemas/types.yaml#/definitions/uint32"
+    description: >
+      Some NVMEM cells may consist of raw data that requires some extra
+      processing. They may provide more than 1 value.
+
+      Passing extra argument(s) allows selecting data to access.
+
+additionalProperties: true
-- 
2.34.1


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH dt-schema.git] schemas: add NVMEM cell with #nvmem-cell-cells
  2022-11-21 10:58 [PATCH dt-schema.git] schemas: add NVMEM cell with #nvmem-cell-cells Rafał Miłecki
@ 2022-11-21 11:02 ` Michael Walle
  2022-11-21 11:25 ` Krzysztof Kozlowski
  1 sibling, 0 replies; 4+ messages in thread
From: Michael Walle @ 2022-11-21 11:02 UTC (permalink / raw)
  To: Rafał Miłecki
  Cc: Rob Herring, Krzysztof Kozlowski, Srinivas Kandagatla,
	Miquel Raynal, Richard Weinberger, Vignesh Raghavendra,
	linux-mtd, devicetree, linux-arm-kernel, linux-kernel,
	Rafał Miłecki

Am 2022-11-21 11:58, schrieb Rafał Miłecki:
> From: Rafał Miłecki <rafal@milecki.pl>
> 
> Some NVMEM cells may provide more than 1 value. An example can be base
> MAC address that is used for calculating multiple MACs (for few
> different devices). For specifying value to read phandle needs to be
> used with an argument.
> 
> Cc: Srinivas Kandagatla" <srinivas.kandagatla@linaro.org>
> Cc: Michael Walle <michael@walle.cc>
> Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
> ---
> This bit is required for moving forward with the
> [PATCH v2 00/20] nvmem: core: introduce NVMEM layouts
> https://lore.kernel.org/linux-arm-kernel/20220901221857.2600340-1-michael@walle.cc/
> 
> As pointed out by Rob #nvmem-cell-cells should be added to the 
> dt-schema
> and not a Linux binding:
> Re: [PATCH v2 15/20] dt-bindings: nvmem: add YAML schema for the sl28 
> vpd layout
> https://lore.kernel.org/linux-arm-kernel/20220912192038.GA1661550-robh@kernel.org/
> 
> sl28 is one example that needs #nvmem-cell-cells
> u-boot,env is another one
> 
> Please let me know if I got this binding right at all.

There is also a pull request:
https://github.com/devicetree-org/dt-schema/pull/89

I'm not sure about the correct way to submit patches to dtschema.

-michael


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH dt-schema.git] schemas: add NVMEM cell with #nvmem-cell-cells
  2022-11-21 10:58 [PATCH dt-schema.git] schemas: add NVMEM cell with #nvmem-cell-cells Rafał Miłecki
  2022-11-21 11:02 ` Michael Walle
@ 2022-11-21 11:25 ` Krzysztof Kozlowski
  2022-11-21 11:29   ` Rafał Miłecki
  1 sibling, 1 reply; 4+ messages in thread
From: Krzysztof Kozlowski @ 2022-11-21 11:25 UTC (permalink / raw)
  To: Rafał Miłecki, Rob Herring, Krzysztof Kozlowski
  Cc: Michael Walle, Srinivas Kandagatla, Miquel Raynal,
	Richard Weinberger, Vignesh Raghavendra, linux-mtd, devicetree,
	linux-arm-kernel, linux-kernel, Rafał Miłecki

On 21/11/2022 11:58, Rafał Miłecki wrote:
> From: Rafał Miłecki <rafal@milecki.pl>
> 
> Some NVMEM cells may provide more than 1 value. An example can be base
> MAC address that is used for calculating multiple MACs (for few
> different devices). For specifying value to read phandle needs to be
> used with an argument.
> 
> Cc: Srinivas Kandagatla" <srinivas.kandagatla@linaro.org>
> Cc: Michael Walle <michael@walle.cc>
> Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
> ---
> This bit is required for moving forward with the
> [PATCH v2 00/20] nvmem: core: introduce NVMEM layouts
> https://lore.kernel.org/linux-arm-kernel/20220901221857.2600340-1-michael@walle.cc/
> 
> As pointed out by Rob #nvmem-cell-cells should be added to the dt-schema
> and not a Linux binding:
> Re: [PATCH v2 15/20] dt-bindings: nvmem: add YAML schema for the sl28 vpd layout
> https://lore.kernel.org/linux-arm-kernel/20220912192038.GA1661550-robh@kernel.org/
> 
> sl28 is one example that needs #nvmem-cell-cells
> u-boot,env is another one
> 
> Please let me know if I got this binding right at all.
> ---
>  dtschema/schemas/nvmem/nvmem-cell.yaml | 23 +++++++++++++++++++++++
>  1 file changed, 23 insertions(+)
>  create mode 100644 dtschema/schemas/nvmem/nvmem-cell.yaml
> 
> diff --git a/dtschema/schemas/nvmem/nvmem-cell.yaml b/dtschema/schemas/nvmem/nvmem-cell.yaml
> new file mode 100644
> index 0000000..dfa99b8
> --- /dev/null
> +++ b/dtschema/schemas/nvmem/nvmem-cell.yaml
> @@ -0,0 +1,23 @@
> +# SPDX-License-Identifier: BSD-2-Clause
> +$id: "http://devicetree.org/schemas/nvmem/nvmem-cell.yaml#"
> +$schema: "http://devicetree.org/meta-schemas/base.yaml#"

Drop quotes from both.

> +
> +title: NVMEM Cell Common Properties
> +description: "Schema for NVMEM cell devicetree bindings"

Drop quotes.

> +maintainers:
> +  - Rafał Miłecki <rafal@milecki.pl>
> +  - Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
> +
> +# always select the core schema
> +select: true
> +
> +properties:
> +  "#nvmem-cell-cells":
> +    $ref: "/schemas/types.yaml#/definitions/uint32"

Drop quotes.

Rest looks fine to me, except a bit funny cell-cell name, but that's
just life. :)

> +    description: >
> +      Some NVMEM cells may consist of raw data that requires some extra
> +      processing. They may provide more than 1 value.
> +
> +      Passing extra argument(s) allows selecting data to access.
> +
> +additionalProperties: true

Best regards,
Krzysztof


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH dt-schema.git] schemas: add NVMEM cell with #nvmem-cell-cells
  2022-11-21 11:25 ` Krzysztof Kozlowski
@ 2022-11-21 11:29   ` Rafał Miłecki
  0 siblings, 0 replies; 4+ messages in thread
From: Rafał Miłecki @ 2022-11-21 11:29 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Rob Herring, Krzysztof Kozlowski
  Cc: Michael Walle, Srinivas Kandagatla, Miquel Raynal,
	Richard Weinberger, Vignesh Raghavendra, linux-mtd, devicetree,
	linux-arm-kernel, linux-kernel, Rafał Miłecki

On 21.11.2022 12:25, Krzysztof Kozlowski wrote:
> On 21/11/2022 11:58, Rafał Miłecki wrote:
>> From: Rafał Miłecki <rafal@milecki.pl>
>>
>> Some NVMEM cells may provide more than 1 value. An example can be base
>> MAC address that is used for calculating multiple MACs (for few
>> different devices). For specifying value to read phandle needs to be
>> used with an argument.
>>
>> Cc: Srinivas Kandagatla" <srinivas.kandagatla@linaro.org>
>> Cc: Michael Walle <michael@walle.cc>
>> Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
>> ---
>> This bit is required for moving forward with the
>> [PATCH v2 00/20] nvmem: core: introduce NVMEM layouts
>> https://lore.kernel.org/linux-arm-kernel/20220901221857.2600340-1-michael@walle.cc/
>>
>> As pointed out by Rob #nvmem-cell-cells should be added to the dt-schema
>> and not a Linux binding:
>> Re: [PATCH v2 15/20] dt-bindings: nvmem: add YAML schema for the sl28 vpd layout
>> https://lore.kernel.org/linux-arm-kernel/20220912192038.GA1661550-robh@kernel.org/
>>
>> sl28 is one example that needs #nvmem-cell-cells
>> u-boot,env is another one
>>
>> Please let me know if I got this binding right at all.
>> ---
>>   dtschema/schemas/nvmem/nvmem-cell.yaml | 23 +++++++++++++++++++++++
>>   1 file changed, 23 insertions(+)
>>   create mode 100644 dtschema/schemas/nvmem/nvmem-cell.yaml
>>
>> diff --git a/dtschema/schemas/nvmem/nvmem-cell.yaml b/dtschema/schemas/nvmem/nvmem-cell.yaml
>> new file mode 100644
>> index 0000000..dfa99b8
>> --- /dev/null
>> +++ b/dtschema/schemas/nvmem/nvmem-cell.yaml
>> @@ -0,0 +1,23 @@
>> +# SPDX-License-Identifier: BSD-2-Clause
>> +$id: "http://devicetree.org/schemas/nvmem/nvmem-cell.yaml#"
>> +$schema: "http://devicetree.org/meta-schemas/base.yaml#"
> 
> Drop quotes from both.
> 
>> +
>> +title: NVMEM Cell Common Properties
>> +description: "Schema for NVMEM cell devicetree bindings"
> 
> Drop quotes.
> 
>> +maintainers:
>> +  - Rafał Miłecki <rafal@milecki.pl>
>> +  - Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
>> +
>> +# always select the core schema
>> +select: true
>> +
>> +properties:
>> +  "#nvmem-cell-cells":
>> +    $ref: "/schemas/types.yaml#/definitions/uint32"
> 
> Drop quotes.
> 
> Rest looks fine to me, except a bit funny cell-cell name, but that's
> just life. :)

Bothers me a bit too, I was even thinking about renaming NVMEM cells to
NVMEM entries but I'm not sure if it's not too late for that.

We already have "nvmem-cells" and "nvmem-cell-names" properties so
adding "entries" not would be probably confusing.


>> +    description: >
>> +      Some NVMEM cells may consist of raw data that requires some extra
>> +      processing. They may provide more than 1 value.
>> +
>> +      Passing extra argument(s) allows selecting data to access.
>> +
>> +additionalProperties: true


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-11-21 11:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-21 10:58 [PATCH dt-schema.git] schemas: add NVMEM cell with #nvmem-cell-cells Rafał Miłecki
2022-11-21 11:02 ` Michael Walle
2022-11-21 11:25 ` Krzysztof Kozlowski
2022-11-21 11:29   ` Rafał Miłecki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).