[PATCH v3 0/8] mmc: sdhci-cadence: add SD6HC support and Agilex5 enablement

Tanmay Kathpalia <[email protected]> Fri, 24 Jul 2026 08:00:39 -0700
Newsgroups org.kernel.vger.linux-mmc,org.kernel.vger.linux-devicetree
Message-ID <[email protected]>
This series adds support for the Cadence SD6HC (sixth-generation) SDHCI
controller and enables it on Altera Agilex5 SoCs.

The SD6HC PHY architecture differs substantially from the SD4HC: it
requires dedicated per-speed-mode IO cell timing parameters and a
DLL-based delay line to achieve correct signal margins across all speed
grades from Default Speed through HS400. These are programmed through a
new sdhci-cadence-phy-v6.c file; shared driver infrastructure lives in
sdhci-cadence-core.c.

Note: this series depends on commit ab45ecfab540 ("dt-bindings: reset:
altr: add COMBOPHY_RESET for Agilex5"), which is already in mainline via
the reset tree. It is not yet in mmc/next; apply or merge that commit
when building/testing this series on top of mmc/next. The previous v1/v2
reset binding patch is therefore omitted from this series.

Patch 1: DT binding
  Adds a dedicated cdns,sd6hc.yaml binding with SD6HC compatible strings,
  clock/reset/IOMMU constraints, and PHY timing properties.

Patches 2-4: Device tree
  Patch 2 adds the SD6HC controller node to the Agilex5 SoC DTSI and
  enables SD card operation (4-bit, SDR104, 200 MHz) on the SOCDK board
  with GPIO-switched IO-voltage regulation.
  Patch 3 registers the intel,socfpga-agilex5-socdk-emmc board variant
  in the arm/altera binding.
  Patch 4 adds socfpga_agilex5_socdk_emmc.dts for eMMC-only operation
  (8-bit, HS200/HS400, 1.8 V IO, 200 MHz).

Patches 5-8: Driver
  Patch 5 renames SD4HC-specific functions and structures with a "cdns4"
  prefix to separate them from shared driver paths.
  Patch 6 encapsulates SD4HC PHY probing in sdhci_cdns4_phy_probe() and
  makes every of_device_id entry carry explicit platform data, removing
  the silent fallback.
  Patch 7 introduces the SD6HC PHY driver (sdhci-cadence-phy-v6.c): DLL
  lock/bypass, per-speed-mode IO cell timing, tuning, and HW reset. The
  common driver core selects between v4 and v6 PHY operations based on
  the SDHCI specification version reported by the controller.
  Patch 8 adds the Agilex5 platform overlay under altr,agilex5-sd6hc:
  40-bit DMA mask for the SMMU address space, quirks for
  CAP_CLOCK_BASE_BROKEN, PRESET_VALUE_BROKEN, ACMD23_BROKEN and
  MULTIBLOCK_READ_ACMD12, .get_max_clock set to
  sdhci_pltfm_clk_get_max_clock, and an init hook that asserts and
  deasserts the three named resets together.

Tested on Agilex5 SOCDK:
  - SD card: Default Speed, High Speed, SDR25, SDR50, SDR104
  - eMMC daughter board: HS200, HS400

Signed-off-by: Tanmay Kathpalia <[email protected]>

---
Changes in v3:

  [bindings]
  - Drop the COMBOPHY_RESET binding patch; it is already in mainline as
    commit ab45ecfab540 via the reset tree.
  - Split SD6HC into a dedicated cdns,sd6hc.yaml binding instead of
    extending cdns,sdhci.yaml (Krzysztof).
  - Rename PHY timing properties with standard unit suffixes:
    cdns,iocell-*-delay-ps and cdns,delay-element-ps (Krzysztof).
  - Define clock-names and reset-names in the SD6HC binding, and keep
    iommus / dma-coherent at the top level (Krzysztof).
  - Rewrite binding/driver commit messages to describe the hardware
    rather than restating the diff (Krzysztof).
  - Fix alphabetical order of the SOCDK eMMC board compatible in
    altera.yaml, and retitle the patch as dt-bindings: arm: altera
    (Krzysztof).

  [drivers]
  - Trim sdhci-cadence.h to include only what it uses (types.h,
    compiler.h, spinlock.h, sdhci-pltfm.h) and keep direct includes in
    the .c files that need them (Adrian) (patch 7).
  - Pulse combophy with sdhc-reset and sdmmc-ocp (exclusive assert /
    deassert together). SoftPHY is shared with NAND at the SoC level,
    but only one of SDMMC or NAND is enabled on a given board
    (replaces shared_deasserted-only handling from v2) (patch 8).
  - Keep #include <linux/iopoll.h> when adding dma-mapping.h (patch 8).
  - Unwrap dev_err_probe() lines that already fit in 100 columns
    (Adrian) (patch 8).

Link V2: https://lore.kernel.org/linux-mmc/[email protected]/
Link V1: https://lore.kernel.org/linux-mmc/[email protected]/

Tanmay Kathpalia (8):
  dt-bindings: mmc: add Cadence SD6HC binding
  arm64: dts: agilex5: add SD/eMMC host controller
  dt-bindings: arm: altera: add Agilex5 SOCDK eMMC board variant
  arm64: dts: agilex5: add SOCDK eMMC daughter board
  mmc: sdhci-cadence: rename SD4HC symbols for SD6HC groundwork
  mmc: sdhci-cadence: refactor driver structure for V6 controller
    support
  mmc: sdhci-cadence: add Cadence SD6HC support
  mmc: sdhci-cadence: add Altera Agilex5 SD6HC support

 .../devicetree/bindings/arm/altera.yaml       |   1 +
 .../devicetree/bindings/mmc/cdns,sd6hc.yaml   | 114 +++
 MAINTAINERS                                   |   7 +
 arch/arm64/boot/dts/intel/Makefile            |   1 +
 .../arm64/boot/dts/intel/socfpga_agilex5.dtsi |  25 +
 .../boot/dts/intel/socfpga_agilex5_socdk.dts  |  38 +-
 .../dts/intel/socfpga_agilex5_socdk_emmc.dts  | 127 +++
 drivers/mmc/host/Makefile                     |   1 +
 .../{sdhci-cadence.c => sdhci-cadence-core.c} | 314 ++++--
 drivers/mmc/host/sdhci-cadence-phy-v6.c       | 929 ++++++++++++++++++
 drivers/mmc/host/sdhci-cadence.h              | 111 +++
 11 files changed, 1596 insertions(+), 72 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/mmc/cdns,sd6hc.yaml
 create mode 100644 arch/arm64/boot/dts/intel/socfpga_agilex5_socdk_emmc.dts
 rename drivers/mmc/host/{sdhci-cadence.c => sdhci-cadence-core.c} (65%)
 create mode 100644 drivers/mmc/host/sdhci-cadence-phy-v6.c
 create mode 100644 drivers/mmc/host/sdhci-cadence.h

-- 
2.43.7