linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] dt-bindings: nvmem: add "data-size" property
@ 2023-12-13 15:47 Rafał Miłecki
  2023-12-13 15:47 ` [PATCH 2/2] dt-bindings: nvmem: u-boot,env: describe " Rafał Miłecki
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Rafał Miłecki @ 2023-12-13 15:47 UTC (permalink / raw)
  To: Srinivas Kandagatla, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley
  Cc: Greg Kroah-Hartman, devicetree, linux-arm-kernel, linux-kernel,
	Rafał Miłecki, Christian Marangi

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

Allow specifying NVMEM device content size in case it differs from
device total size.

Cc: Christian Marangi <ansuelsmth@gmail.com>
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
---
 Documentation/devicetree/bindings/nvmem/nvmem.yaml | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/Documentation/devicetree/bindings/nvmem/nvmem.yaml b/Documentation/devicetree/bindings/nvmem/nvmem.yaml
index 4fd015d402ce..095aed4250de 100644
--- a/Documentation/devicetree/bindings/nvmem/nvmem.yaml
+++ b/Documentation/devicetree/bindings/nvmem/nvmem.yaml
@@ -26,6 +26,13 @@ properties:
   "#size-cells":
     const: 1
 
+  data-size:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description:
+      NVMEM device actual data (content) size. It may be need to be specified
+      if it differs by design from the total NVMEM device size and it's
+      impossible to determine it on runtime.
+
   read-only:
     $ref: /schemas/types.yaml#/definitions/flag
     description:
-- 
2.35.3


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 2/2] dt-bindings: nvmem: u-boot,env: describe "data-size" property
  2023-12-13 15:47 [PATCH 1/2] dt-bindings: nvmem: add "data-size" property Rafał Miłecki
@ 2023-12-13 15:47 ` Rafał Miłecki
  2023-12-13 15:49 ` [PATCH 1/2] dt-bindings: nvmem: add " Rafał Miłecki
  2023-12-15 15:22 ` Rob Herring
  2 siblings, 0 replies; 4+ messages in thread
From: Rafał Miłecki @ 2023-12-13 15:47 UTC (permalink / raw)
  To: Srinivas Kandagatla, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley
  Cc: Greg Kroah-Hartman, devicetree, linux-arm-kernel, linux-kernel,
	Rafał Miłecki, Christian Marangi

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

Describe what "data-size" means in U-Boot env context and why it may be
needed. It's a generic property but giving it some extra meaning in
U-Boot context may be helpful.

Cc: Christian Marangi <ansuelsmth@gmail.com>
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
---
 .../devicetree/bindings/nvmem/u-boot,env.yaml          | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/Documentation/devicetree/bindings/nvmem/u-boot,env.yaml b/Documentation/devicetree/bindings/nvmem/u-boot,env.yaml
index 9c36afc7084b..0006f022d0af 100644
--- a/Documentation/devicetree/bindings/nvmem/u-boot,env.yaml
+++ b/Documentation/devicetree/bindings/nvmem/u-boot,env.yaml
@@ -44,6 +44,15 @@ properties:
   reg:
     maxItems: 1
 
+  data-size:
+    description:
+      U-Boot environment data size is set and hardcoded during compilation using
+      CONFIG_ENV_SIZE. Knowing it is critical for CRC32 checksum calculation.
+
+      This property allows specifying it in case it differs from NVMEM device
+      size. It may happen if device partitioning was designed with different
+      concepts in mind (like block alignment or future-proof size).
+
   bootcmd:
     type: object
     description: Command to use for automatic booting
@@ -76,6 +85,7 @@ examples:
         env: partition@40000 {
             compatible = "u-boot,env";
             reg = <0x40000 0x10000>;
+            data-size = <0x4000>;
 
             mac: ethaddr {
                 #nvmem-cell-cells = <1>;
-- 
2.35.3


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH 1/2] dt-bindings: nvmem: add "data-size" property
  2023-12-13 15:47 [PATCH 1/2] dt-bindings: nvmem: add "data-size" property Rafał Miłecki
  2023-12-13 15:47 ` [PATCH 2/2] dt-bindings: nvmem: u-boot,env: describe " Rafał Miłecki
@ 2023-12-13 15:49 ` Rafał Miłecki
  2023-12-15 15:22 ` Rob Herring
  2 siblings, 0 replies; 4+ messages in thread
From: Rafał Miłecki @ 2023-12-13 15:49 UTC (permalink / raw)
  To: Srinivas Kandagatla, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley
  Cc: Greg Kroah-Hartman, devicetree, linux-arm-kernel, linux-kernel,
	Rafał Miłecki, Christian Marangi

On 13.12.2023 16:47, Rafał Miłecki wrote:
> From: Rafał Miłecki <rafal@milecki.pl>
> 
> Allow specifying NVMEM device content size in case it differs from
> device total size.
> 
> Cc: Christian Marangi <ansuelsmth@gmail.com>
> Signed-off-by: Rafał Miłecki <rafal@milecki.pl>

I forgot to link Rob's comment where he suggested we may need such a property:
https://patchwork.ozlabs.org/comment/3154781/

Let's now see if I got it right.


> ---
>   Documentation/devicetree/bindings/nvmem/nvmem.yaml | 7 +++++++
>   1 file changed, 7 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/nvmem/nvmem.yaml b/Documentation/devicetree/bindings/nvmem/nvmem.yaml
> index 4fd015d402ce..095aed4250de 100644
> --- a/Documentation/devicetree/bindings/nvmem/nvmem.yaml
> +++ b/Documentation/devicetree/bindings/nvmem/nvmem.yaml
> @@ -26,6 +26,13 @@ properties:
>     "#size-cells":
>       const: 1
>   
> +  data-size:
> +    $ref: /schemas/types.yaml#/definitions/uint32
> +    description:
> +      NVMEM device actual data (content) size. It may be need to be specified
> +      if it differs by design from the total NVMEM device size and it's
> +      impossible to determine it on runtime.
> +
>     read-only:
>       $ref: /schemas/types.yaml#/definitions/flag
>       description:


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH 1/2] dt-bindings: nvmem: add "data-size" property
  2023-12-13 15:47 [PATCH 1/2] dt-bindings: nvmem: add "data-size" property Rafał Miłecki
  2023-12-13 15:47 ` [PATCH 2/2] dt-bindings: nvmem: u-boot,env: describe " Rafał Miłecki
  2023-12-13 15:49 ` [PATCH 1/2] dt-bindings: nvmem: add " Rafał Miłecki
@ 2023-12-15 15:22 ` Rob Herring
  2 siblings, 0 replies; 4+ messages in thread
From: Rob Herring @ 2023-12-15 15:22 UTC (permalink / raw)
  To: Rafał Miłecki, Simon Glass
  Cc: Srinivas Kandagatla, Krzysztof Kozlowski, Conor Dooley,
	Greg Kroah-Hartman, devicetree, linux-arm-kernel, linux-kernel,
	Rafał Miłecki, Christian Marangi

On Wed, Dec 13, 2023 at 04:47:20PM +0100, Rafał Miłecki wrote:
> From: Rafał Miłecki <rafal@milecki.pl>
> 
> Allow specifying NVMEM device content size in case it differs from
> device total size.
> 
> Cc: Christian Marangi <ansuelsmth@gmail.com>
> Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
> ---
>  Documentation/devicetree/bindings/nvmem/nvmem.yaml | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/nvmem/nvmem.yaml b/Documentation/devicetree/bindings/nvmem/nvmem.yaml
> index 4fd015d402ce..095aed4250de 100644
> --- a/Documentation/devicetree/bindings/nvmem/nvmem.yaml
> +++ b/Documentation/devicetree/bindings/nvmem/nvmem.yaml
> @@ -26,6 +26,13 @@ properties:
>    "#size-cells":
>      const: 1
>  
> +  data-size:
> +    $ref: /schemas/types.yaml#/definitions/uint32
> +    description:
> +      NVMEM device actual data (content) size. It may be need to be specified
> +      if it differs by design from the total NVMEM device size and it's
> +      impossible to determine it on runtime.

'data-size' is already defined in 
Documentation/devicetree/bindings/eeprom/microchip,93lc46b.yaml.

That would be fine, but it's defining bits per word. So I think it's 
better if we call this something else. 'total-data-size' or 
'actual-data-size'?

I think Simon had something similar for binman.

Rob

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2023-12-15 15:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-13 15:47 [PATCH 1/2] dt-bindings: nvmem: add "data-size" property Rafał Miłecki
2023-12-13 15:47 ` [PATCH 2/2] dt-bindings: nvmem: u-boot,env: describe " Rafał Miłecki
2023-12-13 15:49 ` [PATCH 1/2] dt-bindings: nvmem: add " Rafał Miłecki
2023-12-15 15:22 ` Rob Herring

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).