[PATCH v2 00/10] Add S32N79RDB UFS support
From: Larisa Grigore
Date: Mon Sep 14 2026 - 10:58:47 EST
This series adds support for the UFS host controller found on the NXP S32N79
platform. The controller is based on the Synopsys DesignWare (DWC) UFS host
architecture and requires S32N79-specific M-PHY initialization/calibration
sequence. It is compliant with JESD-223D "Universal Flash Storage Host
Controller Interface" v3.0, and supports up to HS-Gear 4 speed grade. It is
compatible with UFS 2.1, 3.0 and 3.1 devices. The MIPI UniPro is compliant with
"MIPI Alliance Specification for Unified Protocol", v1.8. The MIPI M-PHY is
compliant to version 4.1.
In order to keep the S32N79 platform driver small and avoid duplicating common
DWC code across platform glue drivers, the series also refactors and exports a
few reusable DWC helpers. In particular, M-PHY CREG (CBCREG*) register access
helpers are moved from the existing AMD Versal2 glue driver into the common
ufshcd-dwc layer, and are then used by the platform drivers. The series also
introduces a generic Hibern8 TX-FSM polling helper so that multiple platforms
can reuse the same pre-link checks.
Device tree binding documentation for the S32N79 UFS controller is included,
along with SoC and board DTS updates to instantiate and enable the controller.
Changes in v2:
ufs: unipro: Move Tx/Rx FSM state definitions to unipro.h:
- Improved the enum comments. They now cite the MIPI M-PHY v6.0 tables.
ufs: unipro: Add TX/RX FSM state attributes:
- Added Reviewed-by: Frank Li.
ufs: host: Add common Hibern8 TX FSM polling helper:
- Moved the helper into the UFS core (ufshcd.c).
- Split out an inner per-lane poller, ufshcd_poll_tx_hibern8_lanes().
- Expanded the commit message to document the -ETIMEDOUT normalization done
when converting the qcom/hisi checks to the helper. No code behaviour change.
scsi: ufs: Move Versal2 M-PHY CREG access helpers into ufshcd-dwc:
- Made the DME attribute arrays const. They are now initialized inline instead
of by later field assignments.
scsi: ufs: dwc: Export common clock divider and link status helpers:
- Added Reviewed-by: Frank Li.
dt-bindings: ufs: Add NXP S32N79 UFS host controller:
- Renamed the patch subject and simplified the commit message.
- Renamed the binding file to nxp,s32n79-ufshc.yaml so it matches the
nxp,s32n79-ufshc compatible string.
- Removed the nxp,mphy-boot-mode property.
- Made reg-names and clocks required.
- Removed the conditional if/then/else schema.
- Removed clock-names.
- Changed the compatible from jedec,ufs-3.0 to jedec,ufs-2.0.
- Updated the example clocks to <&clks 0x92>.
scsi: ufs: Add NXP S32N79 UFS host controller driver:
- Removed the nxp,mphy-boot-mode handling and the mphy_boot_mode enum. The
M-PHY firmware always runs from ROM now.
- Added a struct s32n_soc_data for SoC match data.
- Moved the calibration writes out to static const tables.
- Renamed struct phy_reg_cfg to s32n_phy_reg.
- Moved the rate-select sequence out of link_startup_post_change() into a new
pwr_change_notify() pre-change path.
- Used devm_clk_get(dev, NULL) and dropped the redundant core_clk NULL check.
- Switched to *_PM_OPS() macros and pm_ptr() for the PM ops.
- Clarified the Hibern8 poll timeout comment.
- Enabled Auto-Hibern8 instead of setting UFSHCD_QUIRK_BROKEN_AUTO_HIBERN8.
- Reworked and improved the M-PHY initialization sequence.
arm64: dts: freescale: s32n79: Add UFS host controller:
- Changed the compatible from jedec,ufs-3.0 to jedec,ufs-2.0.
- Removed clock-names.
arm64: dts: freescale: s32n79-rdb: Enable UFS:
- Removed the nxp,mphy-boot-mode property.
Larisa Grigore (10):
ufs: unipro: Move Tx/Rx FSM state definitions to unipro.h
ufs: unipro: Add TX/RX FSM state attributes
ufs: host: Add common Hibern8 TX FSM polling helper
scsi: ufs: Move Versal2 M-PHY CREG access helpers into ufshcd-dwc
scsi: ufs: dwc: Export common clock divider and link status helpers
dt-bindings: ufs: Add NXP S32N79 UFS host controller
scsi: ufs: Add NXP S32N79 UFS host controller driver
arm64: dts: freescale: s32n79: Add UFS host controller
arm64: dts: freescale: s32n79-rdb: Enable UFS
MAINTAINERS: Add NXP S32N7 UFS host controller entry
.../bindings/ufs/nxp,s32n79-ufshc.yaml | 61 ++
MAINTAINERS | 8 +
arch/arm64/boot/dts/freescale/s32n79-rdb.dts | 5 +
arch/arm64/boot/dts/freescale/s32n79.dtsi | 10 +
drivers/ufs/core/ufshcd.c | 78 +++
drivers/ufs/host/Kconfig | 12 +
drivers/ufs/host/Makefile | 1 +
drivers/ufs/host/ufs-amd-versal2.c | 89 +--
drivers/ufs/host/ufs-hisi.c | 48 +-
drivers/ufs/host/ufs-hisi.h | 6 -
drivers/ufs/host/ufs-nxp-s32n7.c | 538 ++++++++++++++++++
drivers/ufs/host/ufs-qcom.c | 42 +-
drivers/ufs/host/ufs-qcom.h | 2 -
drivers/ufs/host/ufshcd-dwc.c | 75 ++-
drivers/ufs/host/ufshcd-dwc.h | 39 +-
drivers/ufs/host/ufshcd-pltfrm.c | 1 +
drivers/ufs/host/ufshci-dwc.h | 6 +
include/ufs/ufshcd.h | 3 +
include/ufs/unipro.h | 22 +
19 files changed, 855 insertions(+), 191 deletions(-)
create mode 100644 Documentation/devicetree/bindings/ufs/nxp,s32n79-ufshc.yaml
create mode 100644 drivers/ufs/host/ufs-nxp-s32n7.c
--
2.43.0