mail archive of the barebox mailing list
 help / color / mirror / Atom feed
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 04/10] mci: add HS400 mode selection
Date: Mon, 18 May 2026 12:35:23 +0000	[thread overview]
Message-ID: <E1wOxBr-0000000EtwA-2G4Z@pty.whiteo.stw.pengutronix.de> (raw)
In-Reply-To: <728c7f06-aec9-41a4-87e2-b4e0fe14a55f@pengutronix.de>

On 2026-05-18 11:36, Ahmad Fatoum wrote:
> Hello Sascha,
> 
> On 5/11/26 2:07 PM, Sascha Hauer wrote:
> > eMMC HS400 transitions through HS and 8-bit DDR per JEDEC, on top of
> > a card already tuned in HS200. Wire that up in the core:
> > 
> > - mmc_select_max_dtr() now records EXT_CSD_CARD_TYPE_HS400_{1_8V,1_2V}
> >   in mmc_avail_type when both the host (mmc-hs400-1_8v / mmc-hs400-1_2v
> >   in DT) and the card advertise it. HS400 reuses hs200_max_dtr (200 MHz)
> >   since it's the same SDCLK rate, just DDR-sampled.
> > 
> > - mmc_set_bus_speed() treats HS200 and HS400 as the same rate tier.
> > 
> > - mmc_select_hs400() implements the JEDEC sequence:
> >     1. CMD6 EXT_CSD_HS_TIMING = HS
> >     2. host: MMC_TIMING_MMC_HS, clock = hs_max_dtr
> >     3. CMD6 EXT_CSD_BUS_WIDTH = EXT_CSD_DDR_BUS_WIDTH_8
> >     4. CMD6 EXT_CSD_HS_TIMING = HS400
> >     5. host: MMC_TIMING_MMC_HS400, clock back to 200 MHz
> > 
> >   Bails early if the card lacks HS400 capability or the bus isn't 8-bit.
> > 
> > - mci_startup_mmc() runs mmc_select_hs400() right after a successful
> >   HS200 tuning when EXT_CSD_CARD_TYPE_HS400 is in mmc_avail_type.
> > 
> > - mmc_card_hs400() helper added in mci.h, mirroring mmc_card_hs200().
> > 
> > Host drivers must additionally handle MMC_TIMING_MMC_HS400 in their
> > set_ios / set_clock paths (e.g. setting the controller-specific HS400
> > bit in HOST_CONTROL2, configuring data-strobe sampling). Without that
> > the core will run the transition but the host won't sample correctly.
> 
> This patch is missing the downgrade code. If HS400 doesn't work out, we
> should fallback to HS200.

If a switch to HS400 fails we do not know in which mode the card
actually is, so we do not have a reliable way to talk to the card. Is it
DDR or SDR? So our only chance would be to re-do the whole card
initialization.

> > @@ -1783,6 +1786,18 @@ static void mmc_select_max_dtr(struct mci *mci)
> >  		avail_type |= EXT_CSD_CARD_TYPE_HS200_1_2V;
> >  	}
> >  
> > +	if ((caps2 & MMC_CAP2_HS400_1_8V) &&
> 
> This bit is not decoded in mci_print_caps (same or _1_2V)

Ok, will add.

Sascha

--
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 |



  reply	other threads:[~2026-05-18 12:36 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 [this message]
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
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=E1wOxBr-0000000EtwA-2G4Z@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