mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "NG, TZE YEE" <tze.yee.ng@altera.com>
To: "Kathpalia, Tanmay" <tanmay.kathpalia@altera.com>,
	Adrian Hunter <adrian.hunter@intel.com>,
	linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	devicetree@vger.kernel.org, Ulf Hansson <ulfh@kernel.org>
Subject: Re: [PATCH v4 3/3] mmc: sdhci-cadence6: tune SD6HC DDR50/DDR52 read path
Date: Thu, 3 Dec 2026 16:44:46 +0800	[thread overview]
Message-ID: <3c7c58d6-c11f-41f9-a114-81cec932d083@altera.com> (raw)
In-Reply-To: <984535fe-7076-4972-8e4a-f8e54386a7cb@altera.com>

Hi Tanmay,

On 2/12/2026 4:12 pm, Kathpalia, Tanmay wrote:
> 
> On 25-11-2026 13:18, NG, TZE YEE wrote:
>>
>>
>> On 23/11/2026 3:06 am, Kathpalia, Tanmay wrote:
>>>
>>> On 19-11-2026 15:15, tze.yee.ng@altera.com wrote:
>>>> From: Tze Yee Ng <tze.yee.ng@altera.com>
>>>>
>>>> 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@altera.com>
>>>> ---
>>>> 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 for confirming DDR50 works on the modular SoM with v4.
> 
>  >     bool cp_use_phony_dqs;        /* bit [20] */
>  >     bool cp_use_phony_dqs_cmd;    /* bit [19] */
>  > +    bool cp_use_lpbk_dqs;        /* bit [21] */
> 
> One nit: Please put bit 21 above bit 20 so the new field
> follows the sequence.
> 
> Reviewed-by: Tanmay Kathpalia <tanmay.kathpalia@altera.com>

Thanks for the review. I will fix the bit sequence in v5.

Thanks,
Tze Yee


  reply	other threads:[~2026-12-03  8:44 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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-12-02  7:50   ` Adrian Hunter
2026-12-03  8:38     ` NG, TZE YEE
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-22 16:03   ` Krzysztof Kozlowski
2026-11-22 19:05   ` Kathpalia, Tanmay
2026-11-25  7:26     ` NG, TZE YEE
2026-12-02  8:22       ` Kathpalia, Tanmay
2026-11-19  9:45 ` [PATCH v4 3/3] mmc: sdhci-cadence6: tune SD6HC DDR50/DDR52 read path tze.yee.ng
2026-11-22 19:06   ` Kathpalia, Tanmay
2026-11-25  7:48     ` NG, TZE YEE
2026-12-02  8:12       ` Kathpalia, Tanmay
2026-12-03  8:44         ` NG, TZE YEE [this message]
2026-12-02  7:50   ` Adrian Hunter
2026-12-03  8:51     ` NG, TZE YEE
2026-11-22 16:03 ` [PATCH v4 0/3] mmc: sdhci-cadence: SD6HC DDR50/DDR52 read-path tuning and fixes Krzysztof Kozlowski
2026-11-25  6:38   ` NG, TZE YEE

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3c7c58d6-c11f-41f9-a114-81cec932d083@altera.com \
    --to=tze.yee.ng@altera.com \
    --cc=adrian.hunter@intel.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=robh@kernel.org \
    --cc=tanmay.kathpalia@altera.com \
    --cc=ulfh@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®