Linux MultiMedia Card development
 help / color / mirror / Atom feed
* [PATCH v2 0/9] mmc: sdhci-cadence: add SD6HC support and Agilex5 enablement
@ 2026-06-27 20:14 Tanmay Kathpalia
  2026-06-27 20:14 ` [PATCH v2 1/9] dt-bindings: reset: altr: add COMBOPHY_RESET for Agilex5 Tanmay Kathpalia
                   ` (8 more replies)
  0 siblings, 9 replies; 24+ messages in thread
From: Tanmay Kathpalia @ 2026-06-27 20:14 UTC (permalink / raw)
  To: linux-mmc; +Cc: ulf.hansson, Tanmay Kathpalia, Philipp Zabel

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.

Patches 1-2: DT bindings
  Patch 1 adds COMBOPHY_RESET to the Agilex5 reset manager binding.
  Patch 2 extends cdns,sdhci.yaml with SD6HC compatible strings, clock,
  reset and IOMMU constraints, and three PHY timing properties; per-
  variant allOf conditionals enforce which properties apply to sd4hc vs.
  sd6hc hardware.

Patches 3-5: Device tree
  Patch 3 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 4 registers the intel,socfpga-agilex5-socdk-emmc board variant
  in the arm/altera binding.
  Patch 5 adds socfpga_agilex5_socdk_emmc.dts for eMMC-only operation
  (8-bit, HS200/HS400, 1.8 V IO, 200 MHz).

Patches 6-9: Driver
  Patch 6 renames SD4HC-specific functions and structures with a "cdns4"
  prefix to separate them from shared driver paths.
  Patch 7 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 8 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 9 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 to supply the base clock directly from
  the platform clock since CAP_CLOCK_BASE_BROKEN prevents reading it
  from the capabilities register, and an init hook that sequences the
  three named resets correctly.

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

Signed-off-by: Tanmay Kathpalia <tanmay.kathpalia@altera.com>

---
Changes in v2:

  [drivers]
  - Rename sdhci-cadence4.c -> sdhci-cadence-core.c and
    sdhci-cadence6.c -> sdhci-cadence-phy-v6.c to better reflect each
    file's role (patch 8).
  - Add SDHCI_QUIRK_CAP_CLOCK_BASE_BROKEN to Agilex5 platform quirks
    and set .get_max_clock to sdhci_pltfm_clk_get_max_clock so the base
    clock is supplied directly from the platform clock rather than the
    broken capabilities register; this replaces the sdhci-caps-mask/
    sdhci-caps DT workaround used in v1 (patches 3, 9).
  - Add sdhci_cdns6_agilex5_init() to handle Agilex5-specific reset
    sequencing: the combophy reset is shared with other peripheral
    (NAND) and is obtained with
    devm_reset_control_get_shared_deasserted(); sdhc-reset and sdmmc-ocp
    are asserted together before being released so both clock domains
    cross the reset boundary simultaneously (patch 9).
  - Convert init_timings[] from positional to designated initializers
    ([MMC_TIMING_LEGACY] = ...) so the table is robust against any future
    reordering of MMC_TIMING_* values (patch 8).
  - Add min_t(u8, cp_io_mask_start, 7) clamp to prevent overflow of the
    3-bit GENMASK(26,24) hardware field (patch 8).
  - Fix trailing whitespace in sdhci-cadence-phy-v6.c (patch 8).
  - Fix declaration ordering in sdhci_cdns_set_dma_mask() to follow the
    reverse-xmas-tree convention; drop the unused mmc intermediate
    variable (patch 9).

  [DT]
  - Move board-specific regulators (vmmc, vqmmc-gpio) out of
    socfpga_agilex5.dtsi into the board-level DTS files; regulator nodes
    describe board circuitry, not SoC IP (patch 3).
  - Remove fifo-depth from the SD6HC controller DTSI node; the controller
    operates in DMA mode and has no software FIFO (patch 3).
  - Remove sdhci-caps-mask and sdhci-caps from the SOCDK board node; the
    clock override is now handled by the CAP_CLOCK_BASE_BROKEN driver
    quirk (patches 3, 9).

Link: https://lore.kernel.org/linux-mmc/20260511202132.5597-1-tanmay.kathpalia@altera.com/

Tanmay Kathpalia (9):
  dt-bindings: reset: altr: add COMBOPHY_RESET for Agilex5
  dt-bindings: mmc: cdns,sdhci: add SD6HC support and PHY properties
  arm64: dts: agilex5: add Cadence SD6HC controller and SOCDK enablement
  dt-bindings: arm: intel: add Agilex5 SOCDK eMMC board variant
  arm64: dts: agilex5: add SOCDK eMMC daughter board support
  mmc: sdhci-cadence: rename V4 functions for V6 controller 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,sdhci.yaml   | 122 ++-
 MAINTAINERS                                   |   7 +
 arch/arm64/boot/dts/intel/Makefile            |   1 +
 .../arm64/boot/dts/intel/socfpga_agilex5.dtsi |  25 +
 .../boot/dts/intel/socfpga_agilex5_socdk.dts  |  31 +
 .../dts/intel/socfpga_agilex5_socdk_emmc.dts  | 120 +++
 drivers/mmc/host/Makefile                     |   3 +-
 .../{sdhci-cadence.c => sdhci-cadence-core.c} | 318 ++++--
 drivers/mmc/host/sdhci-cadence-phy-v6.c       | 965 ++++++++++++++++++
 drivers/mmc/host/sdhci-cadence.h              | 114 +++
 include/dt-bindings/reset/altr,rst-mgr-s10.h  |   2 +-
 12 files changed, 1620 insertions(+), 89 deletions(-)
 create mode 100644 arch/arm64/boot/dts/intel/socfpga_agilex5_socdk_emmc.dts
 rename drivers/mmc/host/{sdhci-cadence.c => sdhci-cadence-core.c} (66%)
 create mode 100644 drivers/mmc/host/sdhci-cadence-phy-v6.c
 create mode 100644 drivers/mmc/host/sdhci-cadence.h

-- 
2.43.7


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

end of thread, other threads:[~2026-07-04 11:18 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-27 20:14 [PATCH v2 0/9] mmc: sdhci-cadence: add SD6HC support and Agilex5 enablement Tanmay Kathpalia
2026-06-27 20:14 ` [PATCH v2 1/9] dt-bindings: reset: altr: add COMBOPHY_RESET for Agilex5 Tanmay Kathpalia
2026-07-02 15:53   ` (subset) " Philipp Zabel
2026-06-27 20:14 ` [PATCH v2 2/9] dt-bindings: mmc: cdns,sdhci: add SD6HC support and PHY properties Tanmay Kathpalia
2026-06-29  7:04   ` Krzysztof Kozlowski
2026-07-02  8:58     ` Kathpalia, Tanmay
2026-06-27 20:14 ` [PATCH v2 3/9] arm64: dts: agilex5: add Cadence SD6HC controller and SOCDK enablement Tanmay Kathpalia
2026-06-29  7:06   ` Krzysztof Kozlowski
2026-07-02  9:01     ` Kathpalia, Tanmay
2026-06-27 20:14 ` [PATCH v2 4/9] dt-bindings: arm: intel: add Agilex5 SOCDK eMMC board variant Tanmay Kathpalia
2026-06-29  7:06   ` Krzysztof Kozlowski
2026-07-02  9:07     ` Kathpalia, Tanmay
2026-06-27 20:14 ` [PATCH v2 5/9] arm64: dts: agilex5: add SOCDK eMMC daughter board support Tanmay Kathpalia
2026-06-29  7:07   ` Krzysztof Kozlowski
2026-07-02  9:07     ` Kathpalia, Tanmay
2026-06-27 20:14 ` [PATCH v2 6/9] mmc: sdhci-cadence: rename V4 functions for V6 controller groundwork Tanmay Kathpalia
2026-07-04 11:17   ` Adrian Hunter
2026-06-27 20:14 ` [PATCH v2 7/9] mmc: sdhci-cadence: refactor driver structure for V6 controller support Tanmay Kathpalia
2026-06-27 20:14 ` [PATCH v2 8/9] mmc: sdhci-cadence: add Cadence SD6HC support Tanmay Kathpalia
2026-07-04 11:18   ` Adrian Hunter
2026-06-27 20:14 ` [PATCH v2 9/9] mmc: sdhci-cadence: add Altera Agilex5 " Tanmay Kathpalia
2026-06-29  7:08   ` Krzysztof Kozlowski
2026-07-02  9:04     ` Kathpalia, Tanmay
2026-07-04 11:18   ` Adrian Hunter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox