Re: [PATCH v4 3/3] mmc: sdhci-cadence6: tune SD6HC DDR50/DDR52 read path
From: Kathpalia, Tanmay
Date: Sun Nov 22 2026 - 14:07:28 EST
On 19-11-2026 15:15, tze.yee.ng@xxxxxxxxxx wrote:
From: Tze Yee Ng <tze.yee.ng@xxxxxxxxxx>
DDR50 and DDR52 have no CMD19 tuning, so the SD6HC extended-read path
relies on static PHY settings. Two things are needed to make it work.
First, PHONY_DQS_TIMING (phy_ctrl_reg[9:4]) was left at 0 in every mode.
In extended-read mode the RE# (rebar) pulse is held high for half an
SDCLK period, so its width in clk_phy (sdmclk) cycles is the SDCLK/sdmclk
divider / 2, and the field must hold that width minus 1 (0 otherwise).
Leaving it at 0 in extended-read DDR duplicates one DDR edge and corrupts
reads. Derive the width from the clock divider so it tracks the
integration rather than a hard-coded value: e.g. 1 at divide-by-4,
confirmed on DDR50 hardware where 1 captures both beats and 0 corrupts
reads. The field only takes effect when the fabricated phony DQS is
selected, so the computed value is written in every extended-read mode
and clamped to the 6-bit field. This timing model follows the Cadence
SD6HC PHY documentation.
Second, the remaining read-path knobs need board/SoC characterisation, so
read them from device tree at PHY probe and apply them in the
extended-read DDR modes (DDR50 and DDR52):
- cdns,ddr-read-dqs-delay: read-DQS delay as a count of DLL delay
elements (each cdns,delay-element-ps wide), written to the 8-bit PHY
field (0-255);
- cdns,ddr-no-lpbk-dqs: fall back from the recommended loopback DQS to
the fabricated phony DQS.
Signed-off-by: Tze Yee Ng <tze.yee.ng@xxxxxxxxxx>
---
Changes in v4:
- Merged v3 2/4 (PHONY_DQS_TIMING) and v3 4/4 (read DDR tuning from
device tree)
- 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.
In v1 you mentioned that the modular SoM needs ddr-phony-dqs-timing
at 0. With the override gone the driver writes 1 there at 50 MHz.
Does DDR still work on the SoM with v4?