public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: "Zhengnan Chen (陈征南)" <Zhengnan.Chen@mediatek.com>
To: "krzk@kernel.org" <krzk@kernel.org>
Cc: "linux-mediatek@lists.infradead.org"
	<linux-mediatek@lists.infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"Yong Wu (吴勇)" <Yong.Wu@mediatek.com>,
	"conor+dt@kernel.org" <conor+dt@kernel.org>,
	"robh@kernel.org" <robh@kernel.org>,
	Project_Global_Chrome_Upstream_Group
	<Project_Global_Chrome_Upstream_Group@mediatek.com>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"matthias.bgg@gmail.com" <matthias.bgg@gmail.com>,
	"AngeloGioacchino Del Regno"
	<angelogioacchino.delregno@collabora.com>
Subject: Re: [RESEND,v2 1/2] dt-bindings: memory-controllers: mtk-smi: Add support for mt8189
Date: Thu, 30 Apr 2026 07:22:57 +0000	[thread overview]
Message-ID: <9f5275a4ab003b9dbc44afa8e506ea96b19ea41c.camel@mediatek.com> (raw)
In-Reply-To: <20260428-topaz-turtle-of-support-f5b9ec@quoll>

On Tue, 2026-04-28 at 08:26 +0200, Krzysztof Kozlowski wrote:
> On Mon, Apr 27, 2026 at 03:04:28PM +0800, mtk20898 wrote:
> >  properties:
> >    compatible:
> >      oneOf:
> > @@ -40,6 +55,8 @@ properties:
> >            - mediatek,mt8186-smi-common
> >            - mediatek,mt8188-smi-common-vdo
> >            - mediatek,mt8188-smi-common-vpp
> > +          - mediatek,mt8189-smi-common
> > +          - mediatek,mt8189-smi-sub-common
> >            - mediatek,mt8192-smi-common
> >            - mediatek,mt8195-smi-common-vdo
> >            - mediatek,mt8195-smi-common-vpp
> > @@ -108,19 +125,23 @@ allOf:
> >          compatible:
> >            contains:
> >              enum:
> > +              - mediatek,mt8189-smi-sub-common
> >                - mediatek,mt8195-smi-sub-common
> >      then:
> >        required:
> >          - mediatek,smi
> >        properties:
> >          clocks:
> > -          minItems: 3
> > +          minItems: 2
> 
> Same problem as v2 before resend.
> 
> Please explain me how mt8195 requires three clocks. You can prove it
> by
> trying a malformed DTS (past here the snippet/diff) and pasting here
> the
> validation error.
> 
> 
> Best regards,
> Krzysztof
> 
The mt8195 smi-sub-comm has a three-clock configuration, for example:
smi_sub_common_cam_7x1: smi@16005000 {
	 compatible = "mediatek,mt8195-smi-sub-common";
	 reg = <0 0x16005000 0 0x1000>;
	 clocks = <&camsys CLK_CAM_LARB14>,
			  <&camsys CLK_CAM_CAM2MM1_GALS>,
			  <&vppsys0 CLK_VPP0_GALS_IMGSYS_CAMSYS>;
	 clock-names = "apb", "smi", "gals0";
	 mediatek,smi = <&smi_common_vpp>;
	 power-domains = <&spm MT8195_POWER_DOMAIN_CAM>;
};

but mt8189 smi-sub-comm only requires 2 clock cycles,
there is no case where three clock cycles are needed, for example:
smi_cam_3x1_sub_comm: smi@1a00c000 {
	compatible = "mediatek,mt8189-smi-sub-common";
	reg = <0 0x1a00c000 0 0x1000>;
	clocks = <&camsys_main_clk CLK_CAM_M_CAM2MM_GALS>,
		 <&camsys_main_clk CLK_CAM_M_CAM2MM_GALS>;
	clock-names = "apb", "smi";
	power-domains = <&spm MT8189_POWER_DOMAIN_CAM_MAIN>;
	mediatek,smi = <&smi_disp_common>;
};

Our current approach is rather lenient. 

If stricter restrictions are needed, it should be revised. 
We want to change it to a format similar to the following:

allOf:
  # Generic rule: only sub-common nodes can have mediatek,smi
  - if:
      properties:
        compatible:
          contains:
            pattern: "^mediatek,mt[0-9]+-smi-sub-common$"
    then:
      required:
        - mediatek,smi
    else:
      properties:
        mediatek,smi: false

  # Group A: sub-common SoCs with exactly 2 clocks
  - if:
      properties:
        compatible:
          contains:
            enum:
              - mediatek,mt8189-smi-sub-common
    then:
      properties:
        clocks:
          minItems: 2
          maxItems: 2
        clock-names:
          minItems: 2
          maxItems: 2
          items:
            - const: apb
            - const: smi

  # Group B: sub-common SoCs with exactly 3 clocks
  - if:
      properties:
        compatible:
          contains:
            enum:
              - mediatek,mt8195-smi-sub-common
    then:
      properties:
        clocks:
          minItems: 3
          maxItems: 3
        clock-names:
          minItems: 3
          maxItems: 3
          items:
            - const: apb
            - const: smi
            - const: gals0
			
Is this writing okay?

  reply	other threads:[~2026-04-30  7:23 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-27  7:04 [RESEND,v2 0/2] MT8189 SMI SUPPORT mtk20898
2026-04-27  7:04 ` [RESEND,v2 1/2] dt-bindings: memory-controllers: mtk-smi: Add support for mt8189 mtk20898
2026-04-28  6:26   ` Krzysztof Kozlowski
2026-04-30  7:22     ` Zhengnan Chen (陈征南) [this message]
2026-04-27  7:04 ` [RESEND,v2 2/2] memory: mtk-smi: Add mt8189 support mtk20898

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=9f5275a4ab003b9dbc44afa8e506ea96b19ea41c.camel@mediatek.com \
    --to=zhengnan.chen@mediatek.com \
    --cc=Project_Global_Chrome_Upstream_Group@mediatek.com \
    --cc=Yong.Wu@mediatek.com \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=krzk@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=matthias.bgg@gmail.com \
    --cc=robh@kernel.org \
    /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