All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4 0/3] mmc: sdhci-cadence: SD6HC DDR50/DDR52 read-path tuning and fixes
@ 2026-11-19  9:45 tze.yee.ng
  2026-11-19  9:45 ` [PATCH v4 1/3] mmc: sdhci-cadence: abort failed tuning command on SD6HC tze.yee.ng
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: tze.yee.ng @ 2026-11-19  9:45 UTC (permalink / raw)
  To: Adrian Hunter, Tanmay Kathpalia, linux-mmc, linux-kernel,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, devicetree,
	Ulf Hansson

From: Tze Yee Ng <tze.yee.ng@altera.com>

This series enables the extended-read DDR modes - SD DDR50 and eMMC
DDR52 - on the Cadence SD6HC (SD/eMMC v6) PHY. Neither mode runs a host
tuning sequence (CMD19/CMD21), so the read path must be centred by
static, board/SoC-characterised PHY settings. Bringing it up on Agilex5
also exposed PHY issues affecting the existing tuned modes.

  - Patch 1: abort a failed tuning command on SD6HC. The software tuning
    loop never aborted a command that errored, so after a CMD21 command
    error the eMMC could stay in the Data state and time out the CMD6
    that HS400 selection issues next; mmc_send_abort_tuning() clears it
    (a no-op for SD). Limited to SD6HC since the path is shared with the
    untested SD4HC.
  - Patch 2: document two optional SD6HC read-path properties for the
    extended-read DDR modes (SD DDR50, eMMC DDR52).
  - Patch 3: program PHONY_DQS_TIMING, which was left 0 in all modes; in
    extended-read mode it must be the rebar pulse width in clk_phy
    cycles minus 1, else one DDR beat is duplicated. The width is now
    derived from the SDCLK/sdmclk divider rather than hard-coded. The
    same patch reads the new properties at probe and applies them in
    DDR50 and DDR52, and makes the DQS_TIMING update clear USE_LPBK_DQS
    before reprogramming it so the loopback/phony selection takes
    effect.

The new cdns,ddr-* properties are unused in this series; they will be
consumed by the socfpga_agilex5_socdk and socfpga_agilex5_socdk_emmc
device trees, submitted as a separate series.

Tested on Agilex5 SoCDK: SD DDR50, eMMC DDR52 and eMMC HS400.

Signed-off-by: Tze Yee Ng <tze.yee.ng@altera.com>
---
Changes in v4:
- Merged v3 2/4 (PHONY_DQS_TIMING) and v3 4/4 (read DDR tuning from
  device tree) into a single driver patch, now 3/3, and moved it after
  the binding patch. The series is now 3 patches. (Tanmay Kathpalia)
- Patch 1: limited the abort to SD6HC (host->version >= SDHCI_SPEC_420)
  because sdhci_cdns_execute_tuning() is shared with SD4HC, which has
  not been tested; reworded the commit message accordingly. Added Tanmay's
  Reviewed-by.
- Patch 2: dropped the cdns,ddr-phony-dqs-timing property; the phony DQS
  timing is always derived by the driver. (Tanmay Kathpalia)
- Patch 2: dropped Krzysztof's Reviewed-by since property set changed. The
  two remaining properties are unchanged from v3; Krzysztof, happy to 
  carry your tag again if the reduced binding looks fine.
- Patch 3: derive the PHONY_DQS_TIMING rebar pulse width from the
  SDCLK/sdmclk divider (t_sdclk / (2 * t_sdmclk) - 1, clamped to the 6-bit
  field) instead of the hard-coded 2 clk_phy cycles, and apply it in every
  extended-read mode instead of only DDR50/DDR52. Dropped the
  cdns,ddr-phony-dqs-timing override. Stored ddr_read_dqs_delay as u8.
- Patch 3: dropped Adrian's Acked-by from v3 2/4 since the patch was
  merged and substantially reworked; Adrian, please re-review.

Changes in v3:
- Patch 1: replaced the post-tuning PHY settle (v2 1/4) with aborting
  the failed tuning command. Added Suggested-by. (Tanmay Kathpalia)
- Patch 2: unchanged; retains Adrian's Acked-by.
- Patch 3: re-expressed cdns,ddr-read-dqs-delay-ps as
  cdns,ddr-read-dqs-delay - a count of DLL delay elements (0-255, each
  cdns,delay-element-ps wide) that maps 1:1 to the 8-bit PHY field -
  instead of a picosecond value; added $ref uint32 and maximum: 255,
  dropped the redundant minimum: 0, and used plain description: text.
  (Krzysztof Kozlowski)
- Patch 4: read cdns,ddr-read-dqs-delay directly as the delay-element
  count and write it to the 8-bit field, dropping the v2 ps->element
  conversion (divide by cdns,delay-element-ps) and the FIELD_MAX()
  clamp. Hoisted the repeated DDR-mode test to a local, removed the
  probe-time firmware-value warning, and unwrapped lines to 100 cols.
  (Adrian Hunter, Krzysztof Kozlowski)

- Link to v3: https://lore.kernel.org/all/20261106-sd_cadence_ddr50_v3-v3-0-cb50afece614@altera.com/
- Link to v2: https://lore.kernel.org/all/cover.1791459448.git.tze.yee.ng@altera.com/
- Link to v1: https://lore.kernel.org/all/cover.1790074790.git.tze.yee.ng@altera.com/
---
To: Adrian Hunter <adrian.hunter@intel.com>
To: Tanmay Kathpalia <tanmay.kathpalia@altera.com>
To: Ulf Hansson <ulfh@kernel.org>
To: Rob Herring <robh@kernel.org>
To: Krzysztof Kozlowski <krzk+dt@kernel.org>
To: Conor Dooley <conor+dt@kernel.org>
Cc: linux-mmc@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Cc: devicetree@vger.kernel.org

---
Tze Yee Ng (3):
      mmc: sdhci-cadence: abort failed tuning command on SD6HC
      dt-bindings: mmc: cdns,sd6hc: add SD6HC DDR50 read-path tuning
      mmc: sdhci-cadence6: tune SD6HC DDR50/DDR52 read path

 .../devicetree/bindings/mmc/cdns,sd6hc.yaml        | 19 ++++++++
 drivers/mmc/host/sdhci-cadence-core.c              | 12 ++++-
 drivers/mmc/host/sdhci-cadence-phy-v6.c            | 52 +++++++++++++++++++++-
 3 files changed, 81 insertions(+), 2 deletions(-)
---
base-commit: 2febfc8acbf712439b6d30c99b108641d881fd75
change-id: 20261106-sd_cadence_ddr50_v3-35f970f31364

Best regards,
--  
Tze Yee Ng <tze.yee.ng@altera.com>


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

end of thread, other threads:[~2026-11-19  9:53 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-19  9:45 [PATCH v4 0/3] mmc: sdhci-cadence: SD6HC DDR50/DDR52 read-path tuning and fixes tze.yee.ng
2026-11-19  9:45 ` [PATCH v4 1/3] mmc: sdhci-cadence: abort failed tuning command on SD6HC tze.yee.ng
2026-11-19  9:53   ` sashiko-bot
2026-11-19  9:45 ` [PATCH v4 2/3] dt-bindings: mmc: cdns,sd6hc: add SD6HC DDR50 read-path tuning tze.yee.ng
2026-11-19  9:45 ` [PATCH v4 3/3] mmc: sdhci-cadence6: tune SD6HC DDR50/DDR52 read path tze.yee.ng

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.