linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v4 00/25] MediaTek UFS Cleanup and MT8196 Enablement
@ 2025-12-18 12:54 Nicolas Frattaroli
  2025-12-18 12:54 ` [PATCH v4 01/25] dt-bindings: phy: Add mediatek,mt8196-ufsphy variant Nicolas Frattaroli
                   ` (25 more replies)
  0 siblings, 26 replies; 41+ messages in thread
From: Nicolas Frattaroli @ 2025-12-18 12:54 UTC (permalink / raw)
  To: Alim Akhtar, Avri Altman, Bart Van Assche, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Matthias Brugger,
	AngeloGioacchino Del Regno, Chunfeng Yun, Vinod Koul,
	Kishon Vijay Abraham I, Peter Wang, Stanley Jhu,
	James E.J. Bottomley, Martin K. Petersen, Philipp Zabel,
	Liam Girdwood, Mark Brown, Chaotian Jing, Neil Armstrong
  Cc: Louis-Alexis Eyraud, kernel, linux-scsi, devicetree, linux-kernel,
	linux-arm-kernel, linux-mediatek, linux-phy, Nicolas Frattaroli

In this series, the existing MediaTek UFS binding is expanded and
completed to correctly describe not just the existing compatibles, but
also to introduce a new compatible in the from of the MT8196 SoC.

The resets, which until now were completely absent from both the UFS
host controller binding and the UFS PHY binding, are introduced to both.
This also means the driver's undocumented and, in mainline, unused reset
logic is reworked. In particular, the PHY reset is no longer a reset of
the host controller node, but of the PHY node.

This means the host controller can reset the PHY through the common PHY
framework.

The resets remain optional.

Additionally, a massive number of driver cleanups are introduced. These
were prompted by me inspecting the driver more closely as I was
adjusting it to correspond to the binding.

The driver still implements vendor properties that are undocumented in
the binding. I did not touch most of those, as I neither want to
convince the bindings maintainers that they are needed without knowing
precisely what they're for, nor do I want to argue with the driver
authors when removing them.

Due to the "Marie Kondo with a chainsaw" nature of the driver cleanup
patches, I humbly request that reviewers do not comment on displeasing
code they see in the context portion of a patch before they've read the
whole patch series, as that displeasing code may in fact be reworked in
a subsequent patch of this series. Please keep comments focused on the
changed lines of the diff; I know there's more that can be done, but it
doesn't necessarily need to be part of this series.

Signed-off-by: Nicolas Frattaroli <nicolas.frattaroli@collabora.com>
---
Changes in v4:
- bindings: Redo the supply situation, as the avdd pins don't describe
  the vcc(q2) card supplies.
- bindings: format clock in mt8196 example more tersely.
- phy: use devm_reset_control_get_optional_exclusive directly
- driver: get and enable/disable the aforementioned avdd supplies.
- Link to v3: https://lore.kernel.org/r/20251023-mt8196-ufs-v3-0-0f04b4a795ff@collabora.com

Changes in v3:
- Split mediatek,ufs bindings change into two patches, one for
  completing the existing binding, one for the MT8196
- Add over a dozen driver cleanup patches
- Add explicit support for the MT8196 compatible to the driver
- Note: next-20251023, on which I based this, currently has a broken
  build due to an unrelated OPP core change that was merged with no
  build testing. I can't use next-20251022 either, as that lacks the
  recent mediatek UFS changes. It is what it is.
- Link to v2: https://lore.kernel.org/r/20251016-mt8196-ufs-v2-0-c373834c4e7a@collabora.com

Changes in v2:
- Reorder define in mtk_sip_svc.h
- Use bulk reset APIs in UFS host driver
- Link to v1: https://lore.kernel.org/r/20251014-mt8196-ufs-v1-0-195dceb83bc8@collabora.com

---
Nicolas Frattaroli (25):
      dt-bindings: phy: Add mediatek,mt8196-ufsphy variant
      dt-bindings: ufs: mediatek,ufs: Complete the binding
      dt-bindings: ufs: mediatek,ufs: Add mt8196 variant
      scsi: ufs: mediatek: Move MTK_SIP_UFS_CONTROL to mtk_sip_svc.h
      phy: mediatek: ufs: Add support for resets
      scsi: ufs: mediatek: Rework resets
      scsi: ufs: mediatek: Rework 0.9V regulator
      scsi: ufs: mediatek: Rework init function
      scsi: ufs: mediatek: Rework the crypt-boost stuff
      scsi: ufs: mediatek: Handle misc host voltage regulators
      scsi: ufs: mediatek: Rework probe function
      scsi: ufs: mediatek: Remove vendor kernel quirks cruft
      scsi: ufs: mediatek: Use the common PHY framework
      scsi: ufs: mediatek: Switch to newer PM ops helpers
      scsi: ufs: mediatek: Remove mediatek,ufs-broken-rtc property
      scsi: ufs: mediatek: Rework _ufs_mtk_clk_scale error paths
      scsi: ufs: mediatek: Add vendor prefix to clk-scale-up-vcore-min
      scsi: ufs: mediatek: Clean up logging prints
      scsi: ufs: mediatek: Rework ufs_mtk_wait_idle_state
      scsi: ufs: mediatek: Don't acquire dvfsrc-vcore twice
      scsi: ufs: mediatek: Rework hardware version reading
      scsi: ufs: mediatek: Back up idle timer in per-instance struct
      scsi: ufs: mediatek: Make scale_us in setup_clk_gating const
      scsi: ufs: mediatek: Remove ret local from link_startup_notify
      scsi: ufs: mediatek: Add MT8196 compatible, update copyright

 .../devicetree/bindings/phy/mediatek,ufs-phy.yaml  |  16 +
 .../devicetree/bindings/ufs/mediatek,ufs.yaml      | 173 +++-
 drivers/phy/mediatek/phy-mtk-ufs.c                 |  71 ++
 drivers/ufs/host/ufs-mediatek-sip.h                |   9 -
 drivers/ufs/host/ufs-mediatek.c                    | 996 +++++++++------------
 drivers/ufs/host/ufs-mediatek.h                    |  19 +-
 include/linux/soc/mediatek/mtk_sip_svc.h           |   3 +
 7 files changed, 690 insertions(+), 597 deletions(-)
---
base-commit: 3e7f562e20ee87a25e104ef4fce557d39d62fa85
change-id: 20251014-mt8196-ufs-cec4b9a97e53

Best regards,
-- 
Nicolas Frattaroli <nicolas.frattaroli@collabora.com>



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

end of thread, other threads:[~2025-12-24  6:16 UTC | newest]

Thread overview: 41+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 (井朝天)
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 (王信友)
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
2025-12-18 12:55 ` [PATCH v4 12/25] scsi: ufs: mediatek: Remove vendor kernel quirks cruft Nicolas Frattaroli
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

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).