All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 1/2] dt-bindings: sifive: add cache-set value of 2048
@ 2022-06-08 23:39 ` Atul Khare
  0 siblings, 0 replies; 4+ messages in thread
From: Atul Khare @ 2022-06-08 23:39 UTC (permalink / raw)
  To: Palmer Dabbelt, Conor Dooley, Atul Khare
  Cc: linux-i2c, devicetree, linux-kernel, linux-mmc, linux-riscv, Rob Herring

Fixes Running device tree schema validation error messages like
'... cache-sets:0:0: 1024 was expected'.

The existing bindings had a single enumerated value of 1024, which
trips up the dt-schema checks. The ISA permits any arbitrary power
of two for the cache-sets value, but we decided to add the single
additional value of 2048 because we couldn't spot an obvious way
to express the constraint in the schema.

Signed-off-by: Atul Khare <atulkhare@rivosinc.com>
---
Changes since v1 [1]: Rebased on latest version
[1]: https://tinyurl.com/yvdvmsjd
---
---
 Documentation/devicetree/bindings/riscv/sifive-l2-cache.yaml | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/riscv/sifive-l2-cache.yaml
b/Documentation/devicetree/bindings/riscv/sifive-l2-cache.yaml
index e2d330bd4608..309517b78e84 100644
--- a/Documentation/devicetree/bindings/riscv/sifive-l2-cache.yaml
+++ b/Documentation/devicetree/bindings/riscv/sifive-l2-cache.yaml
@@ -46,7 +46,9 @@ properties:
     const: 2

   cache-sets:
-    const: 1024
+    # Note: Technically this can be any power of 2, but we didn't see
an obvious way
+    # to express the constraint in Yaml
+    enum: [1024, 2048]

   cache-size:
     const: 2097152
--
2.34.1

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

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

* [PATCH v2 1/2] dt-bindings: sifive: add cache-set value of 2048
@ 2022-06-08 23:39 ` Atul Khare
  0 siblings, 0 replies; 4+ messages in thread
From: Atul Khare @ 2022-06-08 23:39 UTC (permalink / raw)
  To: Palmer Dabbelt, Conor Dooley, Atul Khare
  Cc: linux-i2c, devicetree, linux-kernel, linux-mmc, linux-riscv, Rob Herring

Fixes Running device tree schema validation error messages like
'... cache-sets:0:0: 1024 was expected'.

The existing bindings had a single enumerated value of 1024, which
trips up the dt-schema checks. The ISA permits any arbitrary power
of two for the cache-sets value, but we decided to add the single
additional value of 2048 because we couldn't spot an obvious way
to express the constraint in the schema.

Signed-off-by: Atul Khare <atulkhare@rivosinc.com>
---
Changes since v1 [1]: Rebased on latest version
[1]: https://tinyurl.com/yvdvmsjd
---
---
 Documentation/devicetree/bindings/riscv/sifive-l2-cache.yaml | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/riscv/sifive-l2-cache.yaml
b/Documentation/devicetree/bindings/riscv/sifive-l2-cache.yaml
index e2d330bd4608..309517b78e84 100644
--- a/Documentation/devicetree/bindings/riscv/sifive-l2-cache.yaml
+++ b/Documentation/devicetree/bindings/riscv/sifive-l2-cache.yaml
@@ -46,7 +46,9 @@ properties:
     const: 2

   cache-sets:
-    const: 1024
+    # Note: Technically this can be any power of 2, but we didn't see
an obvious way
+    # to express the constraint in Yaml
+    enum: [1024, 2048]

   cache-size:
     const: 2097152
--
2.34.1

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

* Re: [PATCH v2 1/2] dt-bindings: sifive: add cache-set value of 2048
  2022-06-08 23:39 ` Atul Khare
@ 2022-06-09 15:08   ` Rob Herring
  -1 siblings, 0 replies; 4+ messages in thread
From: Rob Herring @ 2022-06-09 15:08 UTC (permalink / raw)
  To: Atul Khare
  Cc: Palmer Dabbelt, Conor Dooley, linux-i2c, devicetree,
	linux-kernel, linux-mmc, linux-riscv

On Wed, Jun 08, 2022 at 04:39:31PM -0700, Atul Khare wrote:
> Fixes Running device tree schema validation error messages like
> '... cache-sets:0:0: 1024 was expected'.
> 
> The existing bindings had a single enumerated value of 1024, which
> trips up the dt-schema checks. The ISA permits any arbitrary power
> of two for the cache-sets value, but we decided to add the single
> additional value of 2048 because we couldn't spot an obvious way
> to express the constraint in the schema.

There is not any way to express power of 2, so you have to list values. 
Rather than just adding 1 more value, I would add at least a few more so 
we're not adding these one by one. This is for a specific cache 
implementation, so it can't really be *any* power of 2. Designs have 
some limits or physics does.

> 
> Signed-off-by: Atul Khare <atulkhare@rivosinc.com>
> ---
> Changes since v1 [1]: Rebased on latest version

What version is that because this did not apply to v5.19-rc1 for some 
reason.

> [1]: https://tinyurl.com/yvdvmsjd
> ---
> ---
>  Documentation/devicetree/bindings/riscv/sifive-l2-cache.yaml | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/Documentation/devicetree/bindings/riscv/sifive-l2-cache.yaml
> b/Documentation/devicetree/bindings/riscv/sifive-l2-cache.yaml
> index e2d330bd4608..309517b78e84 100644
> --- a/Documentation/devicetree/bindings/riscv/sifive-l2-cache.yaml
> +++ b/Documentation/devicetree/bindings/riscv/sifive-l2-cache.yaml
> @@ -46,7 +46,9 @@ properties:
>      const: 2
> 
>    cache-sets:
> -    const: 1024
> +    # Note: Technically this can be any power of 2, but we didn't see
> an obvious way
> +    # to express the constraint in Yaml
> +    enum: [1024, 2048]
> 
>    cache-size:
>      const: 2097152

Surely this is not fixed either?

> --
> 2.34.1
> 

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

* Re: [PATCH v2 1/2] dt-bindings: sifive: add cache-set value of 2048
@ 2022-06-09 15:08   ` Rob Herring
  0 siblings, 0 replies; 4+ messages in thread
From: Rob Herring @ 2022-06-09 15:08 UTC (permalink / raw)
  To: Atul Khare
  Cc: Palmer Dabbelt, Conor Dooley, linux-i2c, devicetree,
	linux-kernel, linux-mmc, linux-riscv

On Wed, Jun 08, 2022 at 04:39:31PM -0700, Atul Khare wrote:
> Fixes Running device tree schema validation error messages like
> '... cache-sets:0:0: 1024 was expected'.
> 
> The existing bindings had a single enumerated value of 1024, which
> trips up the dt-schema checks. The ISA permits any arbitrary power
> of two for the cache-sets value, but we decided to add the single
> additional value of 2048 because we couldn't spot an obvious way
> to express the constraint in the schema.

There is not any way to express power of 2, so you have to list values. 
Rather than just adding 1 more value, I would add at least a few more so 
we're not adding these one by one. This is for a specific cache 
implementation, so it can't really be *any* power of 2. Designs have 
some limits or physics does.

> 
> Signed-off-by: Atul Khare <atulkhare@rivosinc.com>
> ---
> Changes since v1 [1]: Rebased on latest version

What version is that because this did not apply to v5.19-rc1 for some 
reason.

> [1]: https://tinyurl.com/yvdvmsjd
> ---
> ---
>  Documentation/devicetree/bindings/riscv/sifive-l2-cache.yaml | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/Documentation/devicetree/bindings/riscv/sifive-l2-cache.yaml
> b/Documentation/devicetree/bindings/riscv/sifive-l2-cache.yaml
> index e2d330bd4608..309517b78e84 100644
> --- a/Documentation/devicetree/bindings/riscv/sifive-l2-cache.yaml
> +++ b/Documentation/devicetree/bindings/riscv/sifive-l2-cache.yaml
> @@ -46,7 +46,9 @@ properties:
>      const: 2
> 
>    cache-sets:
> -    const: 1024
> +    # Note: Technically this can be any power of 2, but we didn't see
> an obvious way
> +    # to express the constraint in Yaml
> +    enum: [1024, 2048]
> 
>    cache-size:
>      const: 2097152

Surely this is not fixed either?

> --
> 2.34.1
> 

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

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

end of thread, other threads:[~2022-06-09 15:08 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-08 23:39 [PATCH v2 1/2] dt-bindings: sifive: add cache-set value of 2048 Atul Khare
2022-06-08 23:39 ` Atul Khare
2022-06-09 15:08 ` Rob Herring
2022-06-09 15:08   ` Rob Herring

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.