linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Nicolas Frattaroli <nicolas.frattaroli@collabora.com>
To: "Peter Wang (王信友)" <peter.wang@mediatek.com>,
	"Chunfeng Yun (云春峰)" <Chunfeng.Yun@mediatek.com>,
	"kishon@kernel.org" <kishon@kernel.org>,
	"avri.altman@wdc.com" <avri.altman@wdc.com>,
	"bvanassche@acm.org" <bvanassche@acm.org>,
	"martin.petersen@oracle.com" <martin.petersen@oracle.com>,
	"broonie@kernel.org" <broonie@kernel.org>,
	"alim.akhtar@samsung.com" <alim.akhtar@samsung.com>,
	"chu.stanley@gmail.com" <chu.stanley@gmail.com>,
	"conor+dt@kernel.org" <conor+dt@kernel.org>,
	"p.zabel@pengutronix.de" <p.zabel@pengutronix.de>,
	"robh@kernel.org" <robh@kernel.org>,
	"James.Bottomley@HansenPartnership.com"
	<James.Bottomley@hansenpartnership.com>,
	"lgirdwood@gmail.com" <lgirdwood@gmail.com>,
	"vkoul@kernel.org" <vkoul@kernel.org>,
	"matthias.bgg@gmail.com" <matthias.bgg@gmail.com>,
	"neil.armstrong@linaro.org" <neil.armstrong@linaro.org>,
	"krzk+dt@kernel.org" <krzk+dt@kernel.org>,
	"AngeloGioacchino Del Regno"
	<angelogioacchino.delregno@collabora.com>,
	"Chaotian Jing (井朝天)" <Chaotian.Jing@mediatek.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-mediatek@lists.infradead.org"
	<linux-mediatek@lists.infradead.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"kernel@collabora.com" <kernel@collabora.com>,
	Louis-Alexis Eyraud <louisalexis.eyraud@collabora.com>,
	"linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"linux-phy@lists.infradead.org" <linux-phy@lists.infradead.org>
Subject: Re: [PATCH v4 02/25] dt-bindings: ufs: mediatek,ufs: Complete the binding
Date: Mon, 05 Jan 2026 09:00:17 +0100	[thread overview]
Message-ID: <5067251.31r3eYUQgx@workhorse> (raw)
In-Reply-To: <e30abc4cbda3d655d9e0ef2beeac1456b93febb5.camel@mediatek.com>

On Wednesday, 24 December 2025 06:33:42 Central European Standard Time Chaotian Jing (井朝天) wrote:
> On Thu, 2025-12-18 at 13:54 +0100, Nicolas Frattaroli wrote:
> > External email : Please do not click links or open attachments until
> > you have verified the sender or the content.
> > 
> > 
> > As it stands, the mediatek,ufs.yaml binding is startlingly
> > incomplete.
> > Its one example, which is the only real "user" of this binding in
> > mainline, uses the deprecated freq-table-hz property.
> > 
> > The resets, of which there are three optional ones, are completely
> > absent.
> > 
> > The clock description for MT8195 is incomplete, as is the one for
> > MT8192. It's not known if the one clock binding for MT8183 is even
> > correct, but I do not have access to the necessary code and
> > documentation to find this out myself.
> > 
> > The power supply situation is not much better; the binding describes
> > one
> > required power supply, but it's the UFS card supply, not any of the
> > supplies feeding the controller silicon.
> > 
> > No second example is present in the binding, making verification
> > difficult.
> > 
> > Disallow freq-table-hz and move to operating-points-v2. It's fine to
> > break compatibility here, as the binding is currently unused and
> > would
> > be impossible to correctly use in its current state.
> > 
> > Add the three resets and the corresponding reset-names property.
> > These
> > resets appear to be optional, i.e. not required for the functioning
> > of
> > the device.
> > 
> > Move the list of clock names out of the if condition, and expand it
> > for
> > the confirmed clocks I could find by cross-referencing several clock
> > drivers. For MT8195, increase the minimum number of clocks to include
> > the crypt and rx_symbol ones, as they're internal to the SoC and
> > should
> > always be present, and should therefore not be omitted.
> > 
> > MT8192 gets to have at least 3 clocks, as these were the ones I could
> > quickly confirm from a glance at various trees. I can't say this was
> > an
> > exhaustive search though, but it's better than the current situation.
> > 
> > Properly document all supplies, with which pin name on the SoCs they
> > supply. Complete the example with them.
> > 
> > Also add a MT8195 example to the binding, using supply labels that I
> > am
> > pretty sure would be the right ones for e.g. the Radxa NIO 12L.
> > 
> > Signed-off-by: Nicolas Frattaroli <nicolas.frattaroli@collabora.com>
> > ---
> >  .../devicetree/bindings/ufs/mediatek,ufs.yaml      | 117
> > ++++++++++++++++++---
> >  1 file changed, 100 insertions(+), 17 deletions(-)
> > 
> > diff --git a/Documentation/devicetree/bindings/ufs/mediatek,ufs.yaml
> > b/Documentation/devicetree/bindings/ufs/mediatek,ufs.yaml
> > index 15c347f5e660..e0aef3e5f56b 100644
> > --- a/Documentation/devicetree/bindings/ufs/mediatek,ufs.yaml
> > +++ b/Documentation/devicetree/bindings/ufs/mediatek,ufs.yaml
> > @@ -19,11 +19,28 @@ properties:
> > 
> >    clocks:
> >      minItems: 1
> > -    maxItems: 8
> > +    maxItems: 13
> > 
> >    clock-names:
> >      minItems: 1
> > -    maxItems: 8
> > +    items:
> > +      - const: ufs
> > +      - const: ufs_aes
> > +      - const: ufs_tick
> > +      - const: unipro_sysclk
> > +      - const: unipro_tick
> > +      - const: unipro_mp_bclk
> > +      - const: ufs_tx_symbol
> > +      - const: ufs_mem_sub
> > +      - const: crypt_mux
> > +      - const: crypt_lp
> > +      - const: crypt_perf
> > +      - const: ufs_rx_symbol0
> > +      - const: ufs_rx_symbol1
> > +
> > +  operating-points-v2: true
> > +
> > +  freq-table-hz: false
> > 
> >    phys:
> >      maxItems: 1
> > @@ -31,8 +48,36 @@ properties:
> >    reg:
> >      maxItems: 1
> > 
> > +  resets:
> > +    items:
> > +      - description: reset for the UniPro layer
> > +      - description: reset for the cryptography engine
> > +      - description: reset for the host controller
> > +
> > +  reset-names:
> > +    items:
> > +      - const: unipro
> > +      - const: crypto
> > +      - const: hci
> > +
> > +  avdd09-supply:
> > +    description: Phandle to the 0.9V supply powering the AVDD09_UFS
> > pin
> > +
> > +  avdd12-supply:
> > +    description: Phandle to the 1.2V supply powering the AVDD12_UFS
> > pin
> > +
> > +  avdd12-ckbuf-supply:
> > +    description: Phandle to the 1.2V supply powering the
> > AVDD12_CKBUF_UFS pin
> > +
> > +  avdd18-supply:
> > +    description: Phandle to the 1.8V supply powering the AVDD18_UFS
> > pin
> > +
> >    vcc-supply: true
> > 
> > +  vccq-supply: true
> > +
> > +  vccq2-supply: true
> > +
> >    mediatek,ufs-disable-mcq:
> >      $ref: /schemas/types.yaml#/definitions/flag
> >      description: The mask to disable MCQ (Multi-Circular Queue) for
> > UFS host.
> > @@ -54,29 +99,41 @@ allOf:
> >        properties:
> >          compatible:
> >            contains:
> > -            enum:
> > -              - mediatek,mt8195-ufshci
> > +            const: mediatek,mt8183-ufshci
> >      then:
> >        properties:
> >          clocks:
> > -          minItems: 8
> > +          maxItems: 1
> >          clock-names:
> >            items:
> >              - const: ufs
> > -            - const: ufs_aes
> > -            - const: ufs_tick
> > -            - const: unipro_sysclk
> > -            - const: unipro_tick
> > -            - const: unipro_mp_bclk
> > -            - const: ufs_tx_symbol
> > -            - const: ufs_mem_sub
> > -    else:
> > +        avdd12-ckbuf-supply: false
> > +  - if:
> > +      properties:
> > +        compatible:
> > +          contains:
> > +            const: mediatek,mt8192-ufshci
> > +    then:
> >        properties:
> >          clocks:
> > -          maxItems: 1
> > +          minItems: 3
> > +          maxItems: 3
> > +        clocks-names:
> > +          minItems: 3
> > +          maxItems: 3
> > +        avdd09-supply: false
> > +  - if:
> > +      properties:
> > +        compatible:
> > +          contains:
> > +            const: mediatek,mt8195-ufshci
> > +    then:
> > +      properties:
> > +        clocks:
> > +          minItems: 13
> >          clock-names:
> > -          items:
> > -            - const: ufs
> > +          minItems: 13
> > +        avdd09-supply: false
> > 
> >  examples:
> >    - |
> > @@ -95,8 +152,34 @@ examples:
> > 
> >              clocks = <&infracfg_ao CLK_INFRA_UFS>;
> >              clock-names = "ufs";
> > -            freq-table-hz = <0 0>;
> > 
> >              vcc-supply = <&mt_pmic_vemc_ldo_reg>;
> >          };
> >      };
> > +  - |
> > +    ufshci@11270000 {
> > +        compatible = "mediatek,mt8195-ufshci";
> > +        reg = <0x11270000 0x2300>;
> > +        interrupts = <GIC_SPI 137 IRQ_TYPE_LEVEL_HIGH>;
> > +        phys = <&ufsphy>;
> > +        clocks = <&infracfg_ao 63>, <&infracfg_ao 64>, <&infracfg_ao
> > 65>,
> > +                 <&infracfg_ao 54>, <&infracfg_ao 55>,
> > +                 <&infracfg_ao 56>, <&infracfg_ao 90>,
> > +                 <&infracfg_ao 93>, <&topckgen 60>, <&topckgen 152>,
> > +                 <&topckgen 125>, <&topckgen 212>, <&topckgen 215>;
> > +        clock-names = "ufs", "ufs_aes", "ufs_tick",
> > +                      "unipro_sysclk", "unipro_tick",
> > +                      "unipro_mp_bclk", "ufs_tx_symbol",
> > +                      "ufs_mem_sub", "crypt_mux", "crypt_lp",
> > +                      "crypt_perf", "ufs_rx_symbol0",
> > "ufs_rx_symbol1";
> > +
> > +        operating-points-v2 = <&ufs_opp_table>;
> > +
> > +        avdd12-supply = <&mt6359_vrf12_ldo_reg>;
> > +        avdd12-ckbuf-supply = <&mt6359_vbbck_ldo_reg>;
> > +        avdd18-supply = <&mt6359_vio18_ldo_reg>;
> Do not add the avdd12/avdd12-clkbuf/avdd18! these analog power cannot
> be power off. even that the system is in suspend state!

That does not matter. If a supply cannot be powered off, it should
have the regulator-always-on property in the DTS. The relationship
still needs to be properly described in the binding. If you want the
driver to not do those calls, then please comment this on the driver
series.

> > +        vcc-supply = <&mt6359_vemc_1_ldo_reg>;
> > +        vccq2-supply = <&mt6359_vufs_ldo_reg>;
> > +
> > +        mediatek,ufs-disable-mcq;
> > +    };
> > 
> > --
> > 2.52.0
> > 
> 






  reply	other threads:[~2026-01-05  8:00 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-18 12:54 [PATCH v4 00/25] MediaTek UFS Cleanup and MT8196 Enablement Nicolas Frattaroli
2025-12-18 12:54 ` [PATCH v4 01/25] dt-bindings: phy: Add mediatek,mt8196-ufsphy variant Nicolas Frattaroli
2025-12-18 19:25   ` Conor Dooley
2025-12-23 17:39   ` Vinod Koul
2025-12-18 12:54 ` [PATCH v4 02/25] dt-bindings: ufs: mediatek,ufs: Complete the binding Nicolas Frattaroli
2025-12-18 19:38   ` Conor Dooley
2025-12-23 17:39   ` Vinod Koul
2025-12-24  5:33   ` Chaotian Jing (井朝天)
2026-01-05  8:00     ` Nicolas Frattaroli [this message]
2025-12-18 12:54 ` [PATCH v4 03/25] dt-bindings: ufs: mediatek,ufs: Add mt8196 variant Nicolas Frattaroli
2025-12-18 19:26   ` Conor Dooley
2025-12-23 17:39   ` Vinod Koul
2025-12-18 12:54 ` [PATCH v4 04/25] scsi: ufs: mediatek: Move MTK_SIP_UFS_CONTROL to mtk_sip_svc.h Nicolas Frattaroli
2025-12-18 12:54 ` [PATCH v4 05/25] phy: mediatek: ufs: Add support for resets Nicolas Frattaroli
2025-12-23 17:39   ` Vinod Koul
2025-12-18 12:54 ` [PATCH v4 06/25] scsi: ufs: mediatek: Rework resets Nicolas Frattaroli
2025-12-18 12:54 ` [PATCH v4 07/25] scsi: ufs: mediatek: Rework 0.9V regulator Nicolas Frattaroli
2025-12-23  9:35   ` Peter Wang (王信友)
2025-12-23 16:13     ` Nicolas Frattaroli
2025-12-24  6:13       ` Peter Wang (王信友)
2025-12-18 12:54 ` [PATCH v4 08/25] scsi: ufs: mediatek: Rework init function Nicolas Frattaroli
2025-12-24  6:14   ` Peter Wang (王信友)
2025-12-18 12:54 ` [PATCH v4 09/25] scsi: ufs: mediatek: Rework the crypt-boost stuff Nicolas Frattaroli
2025-12-24  6:16   ` Peter Wang (王信友)
2026-01-05  8:05     ` Nicolas Frattaroli
2026-01-06 13:22       ` Peter Wang (王信友)
2025-12-18 12:55 ` [PATCH v4 10/25] scsi: ufs: mediatek: Handle misc host voltage regulators Nicolas Frattaroli
2025-12-24  5:34   ` Chaotian Jing (井朝天)
2025-12-18 12:55 ` [PATCH v4 11/25] scsi: ufs: mediatek: Rework probe function Nicolas Frattaroli
2026-01-06 13:23   ` Peter Wang (王信友)
2025-12-18 12:55 ` [PATCH v4 12/25] scsi: ufs: mediatek: Remove vendor kernel quirks cruft Nicolas Frattaroli
2026-01-06 13:25   ` Peter Wang (王信友)
2025-12-18 12:55 ` [PATCH v4 13/25] scsi: ufs: mediatek: Use the common PHY framework Nicolas Frattaroli
2025-12-18 12:55 ` [PATCH v4 14/25] scsi: ufs: mediatek: Switch to newer PM ops helpers Nicolas Frattaroli
2025-12-18 12:55 ` [PATCH v4 15/25] scsi: ufs: mediatek: Remove mediatek,ufs-broken-rtc property Nicolas Frattaroli
2025-12-18 12:55 ` [PATCH v4 16/25] scsi: ufs: mediatek: Rework _ufs_mtk_clk_scale error paths Nicolas Frattaroli
2025-12-18 12:55 ` [PATCH v4 17/25] scsi: ufs: mediatek: Add vendor prefix to clk-scale-up-vcore-min Nicolas Frattaroli
2025-12-18 12:55 ` [PATCH v4 18/25] scsi: ufs: mediatek: Clean up logging prints Nicolas Frattaroli
2025-12-18 12:55 ` [PATCH v4 19/25] scsi: ufs: mediatek: Rework ufs_mtk_wait_idle_state Nicolas Frattaroli
2025-12-18 12:55 ` [PATCH v4 20/25] scsi: ufs: mediatek: Don't acquire dvfsrc-vcore twice Nicolas Frattaroli
2025-12-18 12:55 ` [PATCH v4 21/25] scsi: ufs: mediatek: Rework hardware version reading Nicolas Frattaroli
2025-12-18 12:55 ` [PATCH v4 22/25] scsi: ufs: mediatek: Back up idle timer in per-instance struct Nicolas Frattaroli
2025-12-18 12:55 ` [PATCH v4 23/25] scsi: ufs: mediatek: Make scale_us in setup_clk_gating const Nicolas Frattaroli
2025-12-18 12:55 ` [PATCH v4 24/25] scsi: ufs: mediatek: Remove ret local from link_startup_notify Nicolas Frattaroli
2025-12-18 12:55 ` [PATCH v4 25/25] scsi: ufs: mediatek: Add MT8196 compatible, update copyright Nicolas Frattaroli
2025-12-23 12:04 ` [PATCH v4 00/25] MediaTek UFS Cleanup and MT8196 Enablement AngeloGioacchino Del Regno

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=5067251.31r3eYUQgx@workhorse \
    --to=nicolas.frattaroli@collabora.com \
    --cc=Chaotian.Jing@mediatek.com \
    --cc=Chunfeng.Yun@mediatek.com \
    --cc=James.Bottomley@hansenpartnership.com \
    --cc=alim.akhtar@samsung.com \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=avri.altman@wdc.com \
    --cc=broonie@kernel.org \
    --cc=bvanassche@acm.org \
    --cc=chu.stanley@gmail.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=kernel@collabora.com \
    --cc=kishon@kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-phy@lists.infradead.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=louisalexis.eyraud@collabora.com \
    --cc=martin.petersen@oracle.com \
    --cc=matthias.bgg@gmail.com \
    --cc=neil.armstrong@linaro.org \
    --cc=p.zabel@pengutronix.de \
    --cc=peter.wang@mediatek.com \
    --cc=robh@kernel.org \
    --cc=vkoul@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;
as well as URLs for NNTP newsgroup(s).