Re: [PATCH v4 3/3] mmc: sdhci-cadence6: tune SD6HC DDR50/DDR52 read path

From: NG, TZE YEE

Date: Wed Nov 25 2026 - 02:49:06 EST




On 23/11/2026 3:06 am, Kathpalia, Tanmay wrote:

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?



Hi Tanmay,

Yes, DDR50 still works on the modular SoM in v4. Dropping the
cdns,ddr-phony-dqs-timing override leaves phony_dqs_timing at the
derived 1 on the SoM (same as the other Agilex5 variants). At the
soldered-board read delay (96) that does hang the SoM on the first read,
but the SoM's phony read eye sits at a much lower read_dqs_delay, so it
only needs a smaller cdns,ddr-read-dqs-delay. Sweeping it on the SoM
(phony, phony_dqs_timing=1):

read_dqs_delay result
0 pass
12 pass
24 pass
36 pass, 2 data-CRC (marginal)
48 data-CRC errors
96 hang (first read)

So now the modular DTS uses cdns,ddr-read-dqs-delay = <24>. In v1 I centred the SoM by shifting the phony strobe (phony_dqs_timing=0) at delay 96 (follows other Agilex5 variants); v4 reaches a valid capture point on the SoM with the read_dqs_delay knob alone, so the extra phony_dqs_timing override was no longer needed.

Thanks,
Tze Yee