From: "Sascha Hauer" <s.hauer@pengutronix.de>
To: "Ahmad Fatoum" <a.fatoum@pengutronix.de>
Cc: BAREBOX <barebox@lists.infradead.org>,
"Claude Opus 4.7" <noreply@anthropic.com>
Subject: Re: [PATCH 05/10] mci: add HS400 Enhanced Strobe (HS400ES) selection
Date: Mon, 18 May 2026 13:06:08 +0000 [thread overview]
Message-ID: <E1wOxfc-0000000EuG7-0XXj@pty.whiteo.stw.pengutronix.de> (raw)
In-Reply-To: <4a67d330-a2a7-47f4-a43a-a2e444c47f55@pengutronix.de>
On 2026-05-18 11:54, Ahmad Fatoum wrote:
> Hi,
>
> On 5/11/26 2:08 PM, Sascha Hauer wrote:
> > HS400ES bypasses HS200 tuning entirely: the eMMC drives a data strobe
> > line which the controller samples on, so the read path doesn't need
> > software-tuned phase. It still ends up in MMC_TIMING_MMC_HS400.
> >
> > Detection: a card advertises HS400ES via EXT_CSD_STROBE_SUPPORT[184],
> > which sits outside DEVICE_TYPE; record it as a synthetic
> > EXT_CSD_CARD_TYPE_HS400ES bit in mmc_avail_type when the host
> > declares MMC_CAP2_HS400_ES (mmc-hs400-enhanced-strobe in DT) and the
> > card has both STROBE_SUPPORT set and one of the HS400 voltage variants.
> >
> > Transition (mmc_select_hs400es):
> > 1. Negotiate 8-bit bus in HS mode (HS400 needs 8-bit).
> > 2. CMD6 EXT_CSD_HS_TIMING = HS, host to HS rate.
> > 3. CMD6 EXT_CSD_BUS_WIDTH = 8-bit DDR | STROBE bit, so the card
> > starts driving the strobe line.
> > 4. CMD6 EXT_CSD_HS_TIMING = HS400, host to HS400 timing at
> > hs200_max_dtr (200 MHz, DDR-sampled => 400 MT/s).
> > 5. Call host->ops.hs400_enhanced_strobe so the controller enables
> > enhanced strobe sampling.
> >
> > mmc_select_timing prefers HS400ES over HS200 + HS400; on any failure
> > it clears the flag and falls back to HS200. mci_startup_mmc returns
> > early when mmc_select_timing already landed us in HS400 (HS400ES has
> > no follow-up tuning step).
> >
> > mci_ops gains an optional hs400_enhanced_strobe hook for the
> > controller's enhanced-strobe enable.
> >
> > Assisted-by: Claude Opus 4.7 <noreply@anthropic.com>
> > Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
> > ---
> > drivers/mci/mci-core.c | 108 ++++++++++++++++++++++++++++++++++++++++++++++++-
> > include/mci.h | 4 ++
> > 2 files changed, 111 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/mci/mci-core.c b/drivers/mci/mci-core.c
> > index 58b28ec653..0cfddb8d43 100644
> > --- a/drivers/mci/mci-core.c
> > +++ b/drivers/mci/mci-core.c
> > @@ -1798,6 +1798,16 @@ static void mmc_select_max_dtr(struct mci *mci)
> > avail_type |= EXT_CSD_CARD_TYPE_HS400_1_2V;
> > }
> >
> > + /*
> > + * HS400ES capability is reported in EXT_CSD_STROBE_SUPPORT (byte 184),
> > + * not in DEVICE_TYPE. Combine with one of the HS400 voltage variants;
> > + * which voltage is used follows the same negotiation as HS400.
> > + */
> > + if ((caps2 & MMC_CAP2_HS400_ES) &&
> > + mci->ext_csd[EXT_CSD_STROBE_SUPPORT] &&
>
> Please add to mci_print_caps()
ok.
>
> Also, please extend mci_timing_tostr() to return "HS400ES" for enhanced
> strobe.
There is no separate mode for HS400ES, it is still MMC_TIMING_MMC_HS400,
that's why it's decoded separately by the caller.
> > +
> > + /* Step 4: 8-bit DDR with strobe enabled */
> > + val = EXT_CSD_DDR_BUS_WIDTH_8 | EXT_CSD_BUS_WIDTH_STROBE;
> > + err = mci_switch(mci, EXT_CSD_BUS_WIDTH, val);
> > + if (err) {
> > + dev_err(&mci->dev, "switch to DDR8 with strobe failed: %d\n", err);
> > + return err;
> > + }
> > +> + /* Step 5: switch card to HS400 */
> > + val = EXT_CSD_TIMING_HS400 | (host->drive_strength << EXT_CSD_DRV_STR_SHIFT);
>
> The drive_strength is initialized by mmc_select_driver_type() and it
> seems no one will have called it for HS400ES?
Ok, will add it at the same place the kernel has it.
>
> > + err = mci_switch(mci, EXT_CSD_HS_TIMING, val);
> > + if (err) {
> > + dev_err(&mci->dev, "switch to HS400 for HS400ES failed: %d\n", err);
> > + return err;
> > + }
> > +
> > + /* Step 6: host to HS400 timing and final clock */
> > + mci_set_timing(mci, MMC_TIMING_MMC_HS400);
> > + mmc_set_bus_speed(mci);
> > +
> > + err = mci_switch_status(mci, true);
> > + if (err)
> > + return err;
>
> Should this not be _after_ the enhanced strobe setting, so we are able
> to propagate an error on issues?
Ok.
> > @@ -2698,7 +2803,8 @@ static void mci_info(struct device *dev)
> > bw = 1;
> >
> > printf(" current buswidth: %d\n", bw);
> > - printf(" current timing: %s\n", mci_timing_tostr(host->ios.timing));
> > + printf(" current timing: %s%s\n", mci_timing_tostr(host->ios.timing),
> > + host->ios.enhanced_strobe ? " (Enhanced Strobe)" : "");
>
> I would just append an ES suffix.
Ok.
--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
next prev parent reply other threads:[~2026-05-18 13:07 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-11 12:07 [PATCH 00/10] mci: rockchip-dwcmshc: add HS400(ES) support Sascha Hauer
2026-05-11 12:07 ` [PATCH 01/10] mci: sdhci: define VDD_180 and shrink UHS_MASK to bits 0..2 Sascha Hauer
2026-05-18 8:58 ` Ahmad Fatoum
2026-05-11 12:07 ` [PATCH 02/10] mci: mmc_send_tuning: actually point data.dest at the buffer Sascha Hauer
2026-05-11 12:49 ` Ahmad Fatoum
2026-05-11 12:07 ` [PATCH 03/10] mci: sdhci: add ADMA2 descriptor helpers Sascha Hauer
2026-05-18 9:18 ` Ahmad Fatoum
2026-05-18 12:16 ` Sascha Hauer
2026-05-18 12:20 ` Ahmad Fatoum
2026-05-11 12:07 ` [PATCH 04/10] mci: add HS400 mode selection Sascha Hauer
2026-05-18 9:36 ` Ahmad Fatoum
2026-05-18 12:35 ` Sascha Hauer
2026-05-11 12:08 ` [PATCH 05/10] mci: add HS400 Enhanced Strobe (HS400ES) selection Sascha Hauer
2026-05-18 9:54 ` Ahmad Fatoum
2026-05-18 13:06 ` Sascha Hauer [this message]
2026-05-11 12:08 ` [PATCH 06/10] mci: rockchip-dwcmshc-sdhci: use ADMA2 Sascha Hauer
2026-05-11 12:55 ` Ahmad Fatoum
2026-05-11 14:01 ` Sascha Hauer
2026-05-11 14:06 ` Ahmad Fatoum
2026-05-11 12:08 ` [PATCH 07/10] mci: sdhci: rockchip: set TX-path source-select bit in DWCMSHC_EMMC_DLL_TXCLK Sascha Hauer
2026-05-18 9:57 ` Ahmad Fatoum
2026-05-11 12:08 ` [PATCH 08/10] mci: sdhci: rockchip: distinguish IP revision 0 (rk3568) from 1 (rk3576/rk3588) Sascha Hauer
2026-05-18 9:59 ` Ahmad Fatoum
2026-05-11 12:08 ` [PATCH 09/10] mci: sdhci: rockchip: support HS400 Sascha Hauer
2026-05-18 10:09 ` Ahmad Fatoum
2026-05-11 12:08 ` [PATCH 10/10] mci: sdhci: rockchip: support HS400 Enhanced Strobe Sascha Hauer
2026-05-18 10:10 ` Ahmad Fatoum
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=E1wOxfc-0000000EuG7-0XXj@pty.whiteo.stw.pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=a.fatoum@pengutronix.de \
--cc=barebox@lists.infradead.org \
--cc=noreply@anthropic.com \
/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