public inbox for devicetree@vger.kernel.org
 help / color / mirror / Atom feed
From: Conor Dooley <conor@kernel.org>
To: Ben Zong-You Xie <ben717@andestech.com>
Cc: paul.walmsley@sifive.com, palmer@dabbelt.com,
	aou@eecs.berkeley.edu, alex@ghiti.fr, robh@kernel.org,
	krzk+dt@kernel.org, conor+dt@kernel.org, tglx@linutronix.de,
	daniel.lezcano@linaro.org,
	prabhakar.mahadev-lad.rj@bp.renesas.com,
	devicetree@vger.kernel.org, linux-riscv@lists.infradead.org,
	linux-kernel@vger.kernel.org, tim609@andestech.com
Subject: Re: [PATCH v3 6/9] dt-bindings: cache: add QiLai compatible to ax45mp
Date: Tue, 13 May 2025 16:53:09 +0100	[thread overview]
Message-ID: <20250513-duplex-collage-5a52f50b74bb@spud> (raw)
In-Reply-To: <20250513094933.1631493-7-ben717@andestech.com>

[-- Attachment #1: Type: text/plain, Size: 3302 bytes --]

On Tue, May 13, 2025 at 05:49:30PM +0800, Ben Zong-You Xie wrote:
> Add a new compatible string for ax45mp-cache on QiLai SoC.
> 
> Also, add allOf constraints to enforce specific cache-sets and cache-size
> values for each compatible string.

"Also" is a massive hint that this should be two patches. I think the
Renesas part (if it can only do 1024/262144, and is not configurable)
should be a patch of its own, since it is valid independent of this
being added.

> 
> Signed-off-by: Ben Zong-You Xie <ben717@andestech.com>
> ---
>  .../cache/andestech,ax45mp-cache.yaml         | 52 +++++++++++++++++--
>  1 file changed, 47 insertions(+), 5 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/cache/andestech,ax45mp-cache.yaml b/Documentation/devicetree/bindings/cache/andestech,ax45mp-cache.yaml
> index df8bba14f758..dc03ffae6c9f 100644
> --- a/Documentation/devicetree/bindings/cache/andestech,ax45mp-cache.yaml
> +++ b/Documentation/devicetree/bindings/cache/andestech,ax45mp-cache.yaml
> @@ -28,7 +28,9 @@ select:
>  properties:
>    compatible:
>      items:
> -      - const: renesas,r9a07g043f-ax45mp-cache
> +      - enum:
> +          - andestech,qilai-ax45mp-cache
> +          - renesas,r9a07g043f-ax45mp-cache
>        - const: andestech,ax45mp-cache
>        - const: cache
>  
> @@ -44,11 +46,9 @@ properties:
>    cache-level:
>      const: 2
>  
> -  cache-sets:
> -    enum: [1024, 2048]

^^ this and...

> +  cache-sets: true
>  
> -  cache-size:
> -    enum: [131072, 262144, 524288, 1048576, 2097152]

... ^^ this should remain at the top level...

> +  cache-size: true
>  
>    cache-unified: true
>  
> @@ -66,7 +66,49 @@ required:
>    - cache-size
>    - cache-unified
>  
> +allOf:
> +  - if:
> +      properties:
> +        compatible:
> +          contains:
> +            const: andestech,qilai-ax45mp-cache
> +
> +    then:
> +      properties:
> +        cache-sets:
> +          const: 2048
> +        cache-size:
> +          const: 2097152

...and you just constrain things here. Effectively this means just
restore the enum outside the if/then/else.

> +
> +  - if:
> +      properties:
> +        compatible:
> +          contains:
> +            const: renesas,r9a07g043f-ax45mp-cache
> +
> +    then:
> +      properties:
> +        cache-sets:
> +          const: 1024
> +        cache-size:
> +          const: 262144
> +
>  examples:
> +  - |
> +    #include <dt-bindings/interrupt-controller/irq.h>

Honestly, just delete this whole example, it doesn't do anything
meaningfully different from the existing one.

> +    l2_cache: cache-controller@200000 {

But if you don't delete the example, remove the "l2_cache" label cos it
is unused.


Cheers,
Conor.

> +        compatible = "andestech,qilai-ax45mp-cache", "andestech,ax45mp-cache",
> +                     "cache";
> +        reg = <0x00200000 0x100000>;
> +        interrupts = <16 IRQ_TYPE_LEVEL_HIGH>;
> +        cache-line-size = <64>;
> +        cache-level = <2>;
> +        cache-sets = <2048>;
> +        cache-size = <2097152>;
> +        cache-unified;
> +    };
> +
>    - |
>      #include <dt-bindings/interrupt-controller/irq.h>
>  
> -- 
> 2.34.1
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

  reply	other threads:[~2025-05-13 15:53 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-13  9:49 [PATCH v3 0/9] add Voyager board support Ben Zong-You Xie
2025-05-13  9:49 ` [PATCH v3 1/9] riscv: add Andes SoC family Kconfig support Ben Zong-You Xie
2025-05-13  9:49 ` [PATCH v3 2/9] dt-bindings: riscv: add Andes QiLai SoC and the Voyager board bindings Ben Zong-You Xie
2025-05-13  9:49 ` [PATCH v3 3/9] dt-bindings: interrupt-controller: add Andes QiLai PLIC Ben Zong-You Xie
2025-05-13  9:49 ` [PATCH v3 4/9] dt-bindings: interrupt-controller: add Andes machine-level software interrupt controller Ben Zong-You Xie
2025-05-13  9:49 ` [PATCH v3 5/9] dt-bindings: timer: add Andes machine timer Ben Zong-You Xie
2025-05-13  9:49 ` [PATCH v3 6/9] dt-bindings: cache: add QiLai compatible to ax45mp Ben Zong-You Xie
2025-05-13 15:53   ` Conor Dooley [this message]
2025-05-13  9:49 ` [PATCH v3 7/9] riscv: dts: andes: add QiLai SoC device tree Ben Zong-You Xie
2025-05-13  9:49 ` [PATCH v3 8/9] riscv: dts: andes: add Voyager board " Ben Zong-You Xie
2025-05-13  9:49 ` [PATCH v3 9/9] riscv: defconfig: enable Andes SoC Ben Zong-You Xie

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250513-duplex-collage-5a52f50b74bb@spud \
    --to=conor@kernel.org \
    --cc=alex@ghiti.fr \
    --cc=aou@eecs.berkeley.edu \
    --cc=ben717@andestech.com \
    --cc=conor+dt@kernel.org \
    --cc=daniel.lezcano@linaro.org \
    --cc=devicetree@vger.kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=palmer@dabbelt.com \
    --cc=paul.walmsley@sifive.com \
    --cc=prabhakar.mahadev-lad.rj@bp.renesas.com \
    --cc=robh@kernel.org \
    --cc=tglx@linutronix.de \
    --cc=tim609@andestech.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox