mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Michael Tretter <m.tretter@pengutronix.de>
To: barebox@lists.infradead.org
Subject: Radxa ROCK 5T: SD card startup failure
Date: Fri, 9 Jan 2026 16:10:39 +0100	[thread overview]
Message-ID: <aWEab3b5tMev5AU4@pengutronix.de> (raw)

Hi,

since Commit a3bf6c16f77d ("dts: update to v6.19-rc1"), barebox fails to
initialize the SD card on my Radxa ROCK T5 board.

I tracked the failure down to a change of the pinctrl setting for the
card detect pin to RK_FUNC_GPIO (see sdmmc_det_pin). If I change the
pinctrl mux back to 1, the SD card is initialized correctly.

If the error happens, the dw_mmc driver reports a DATA ERROR on CMD13
with BIT(13) set (DWMCI_INTMSK_SBE) and runs into a timeout afterward:

	dw_mmc fe2c0000.mmc@fe2c0000.of: registered as mmc1
	dw_mmc fe2c0000.mmc@fe2c0000.of: Using fifo-depth=256
	mmc1: clock 0.0MHz width 1 timing legacy
	dw_mmc fe2c0000.mmc@fe2c0000.of: Buswidth = 0, clock: 0
	mmc1: clock 0.400000MHz width 1 timing legacy
	dw_mmc fe2c0000.mmc@fe2c0000.of: Buswidth = 0, clock: 400000
	dw_mmc fe2c0000.mmc@fe2c0000.of: Sending CMD0
	dw_mmc fe2c0000.mmc@fe2c0000.of: Sending CMD8
	mmc1: SD Card Rev. 2.00 or later detected
	dw_mmc fe2c0000.mmc@fe2c0000.of: Sending CMD55
	dw_mmc fe2c0000.mmc@fe2c0000.of: Sending CMD41
	dw_mmc fe2c0000.mmc@fe2c0000.of: Sending CMD55
	dw_mmc fe2c0000.mmc@fe2c0000.of: Sending CMD41
	dw_mmc fe2c0000.mmc@fe2c0000.of: Sending CMD55
	dw_mmc fe2c0000.mmc@fe2c0000.of: Sending CMD41
	dw_mmc fe2c0000.mmc@fe2c0000.of: Sending CMD55
	dw_mmc fe2c0000.mmc@fe2c0000.of: Sending CMD41
	dw_mmc fe2c0000.mmc@fe2c0000.of: Sending CMD55
	dw_mmc fe2c0000.mmc@fe2c0000.of: Sending CMD41
	mmc1: Put the Card in Identify Mode
	dw_mmc fe2c0000.mmc@fe2c0000.of: Sending CMD2
	mmc1: Card's identification data is: 03534453-44333247-8555412B-AC0191F5
	mmc1: Get/Set relative address
	dw_mmc fe2c0000.mmc@fe2c0000.of: Sending CMD3
	mmc1: Get card's specific data
	dw_mmc fe2c0000.mmc@fe2c0000.of: Sending CMD9
	mmc1: Card's specific data is: 400E0032-5B590000-EDC87F80-0A4040C3
	mmc1: Transfer speed: 25000000
	mmc1: Max. block length are: Write=512, Read=512 Bytes
	mmc1: Read block length: 512, Write block length: 512
	mmc1: Select the card, and put it into Transfer Mode
	dw_mmc fe2c0000.mmc@fe2c0000.of: Sending CMD7
	mmc1: Changing transfer frequency
	dw_mmc fe2c0000.mmc@fe2c0000.of: Sending CMD55
	mmc1: Trying to read the SCR (try 1 of 3)
	dw_mmc fe2c0000.mmc@fe2c0000.of: desc@ 0x00000000ad25b000 0x8000001c 0x00000008 0xad25aac0 0xad25b010
	dw_mmc fe2c0000.mmc@fe2c0000.of: Sending CMD51
	dw_mmc fe2c0000.mmc@fe2c0000.of: desc@ 0x00000000ad25b000 0x8000001c 0x00000040 0xad25aac0 0xad25b010
	dw_mmc fe2c0000.mmc@fe2c0000.of: Sending CMD6
	dw_mmc fe2c0000.mmc@fe2c0000.of: desc@ 0x00000000ad25b000 0x8000001c 0x00000040 0xad25aac0 0xad25b010
	dw_mmc fe2c0000.mmc@fe2c0000.of: Sending CMD6
	mmc1: detected SD card version 2.0
	mmc1: Capacity: 30436 MiB
	mmc1: Erase group is 1 sector(s). Trim not supported
	mmc1: Prepare for bus width change
	dw_mmc fe2c0000.mmc@fe2c0000.of: Sending CMD55
	mmc1: Set SD bus width to 4 bit
	dw_mmc fe2c0000.mmc@fe2c0000.of: Sending CMD6
	mmc1: clock 0.400000MHz width 4 timing legacy
	dw_mmc fe2c0000.mmc@fe2c0000.of: Buswidth = 2, clock: 400000
	mmc1: clock 50.0MHz width 4 timing SD HS
	dw_mmc fe2c0000.mmc@fe2c0000.of: Buswidth = 2, clock: 50000000
	dw_mmc fe2c0000.mmc@fe2c0000.of: Sending CMD55
	dw_mmc fe2c0000.mmc@fe2c0000.of: desc@ 0x00000000ad25b000 0x8000001c 0x00000040 0xad25d780 0xad25b010
	dw_mmc fe2c0000.mmc@fe2c0000.of: Sending CMD13
	dw_mmc fe2c0000.mmc@fe2c0000.of: DATA ERROR!
	dw_mmc fe2c0000.mmc@fe2c0000.of: desc@ 0x00000000ad25b000 0x8000001c 0x00000040 0xad25d780 0xad25b010
	dw_mmc fe2c0000.mmc@fe2c0000.of: Sending CMD13
	dw_mmc fe2c0000.mmc@fe2c0000.of: Send command timeout..
	dw_mmc fe2c0000.mmc@fe2c0000.of: desc@ 0x00000000ad25b000 0x8000001c 0x00000040 0xad25d780 0xad25b010
	dw_mmc fe2c0000.mmc@fe2c0000.of: Sending CMD13
	dw_mmc fe2c0000.mmc@fe2c0000.of: Send command timeout..
	dw_mmc fe2c0000.mmc@fe2c0000.of: desc@ 0x00000000ad25b000 0x8000001c 0x00000040 0xad25d780 0xad25b010
	dw_mmc fe2c0000.mmc@fe2c0000.of: Sending CMD13
	dw_mmc fe2c0000.mmc@fe2c0000.of: Send command timeout..
	mmc1: unable to read ssr: Connection timed out
	dw_mmc fe2c0000.mmc@fe2c0000.of: Sending CMD16
	dw_mmc fe2c0000.mmc@fe2c0000.of: Send command timeout..
	dw_mmc fe2c0000.mmc@fe2c0000.of: Sending CMD16
	dw_mmc fe2c0000.mmc@fe2c0000.of: Send command timeout..
	dw_mmc fe2c0000.mmc@fe2c0000.of: Sending CMD16
	dw_mmc fe2c0000.mmc@fe2c0000.of: Send command timeout..
	dw_mmc fe2c0000.mmc@fe2c0000.of: Sending CMD16
	dw_mmc fe2c0000.mmc@fe2c0000.of: Send command timeout..
	dw_mmc fe2c0000.mmc@fe2c0000.of: Sending CMD16
	dw_mmc fe2c0000.mmc@fe2c0000.of: Send command timeout..
	WARNING: mmc1: Card's startup fails with -110

It seems to me that the SD host controller fails to correctly initialize
if the card detect it directly muxed as GPIO instead of muxing it to the
SD host controller. At least that's what I understand from
https://lore.kernel.org/linux-rockchip/4920950.GXAFRqVoOG@diego/.

May there be some configuration in the SD host controller that needs to
be changed to ignore the card detect?

Michael



                 reply	other threads:[~2026-01-09 15:11 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=aWEab3b5tMev5AU4@pengutronix.de \
    --to=m.tretter@pengutronix.de \
    --cc=barebox@lists.infradead.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