Skip to content

Commit

Permalink
dt-bindings: riscv: fix SiFive l2-cache's cache-sets
Browse files Browse the repository at this point in the history
Fix device tree schema validation error messages for the SiFive
Unmatched: ' cache-sets:0:0: 1024 was expected'.

The existing bindings allow for just 1024 cache-sets but the fu740 on
Unmatched the has 2048 cache-sets. The ISA itself permits any arbitrary
power of two, however this is not supported by dt-schema. The RTL for
the IP, to which the number of cache-sets is a tunable parameter, has
been released publicly so speculatively adding a small number of
"reasonable" values seems unwise also.

Instead, as the binding only supports two distinct controllers: add 2048
and explicitly lock it to the fu740's l2 cache while limiting 1024 to
the l2 cache on the fu540.

Fixes: af951c3 ("dt-bindings: riscv: Update l2 cache DT documentation to add support for SiFive FU740")
Reported-by: Atul Khare <atulkhare@rivosinc.com>
Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20220803185359.942928-1-mail@conchuod.ie
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
  • Loading branch information
Conor Dooley authored and Palmer Dabbelt committed Aug 11, 2022
1 parent 87df2b5 commit b60cf8e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Documentation/devicetree/bindings/riscv/sifive-l2-cache.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ properties:
const: 2

cache-sets:
const: 1024
enum: [1024, 2048]

cache-size:
const: 2097152
Expand Down Expand Up @@ -84,13 +84,17 @@ then:
description: |
Must contain entries for DirError, DataError and DataFail signals.
maxItems: 3
cache-sets:
const: 1024

else:
properties:
interrupts:
description: |
Must contain entries for DirError, DataError, DataFail, DirFail signals.
minItems: 4
cache-sets:
const: 2048

additionalProperties: false

Expand Down

0 comments on commit b60cf8e

Please sign in to comment.