On 5/14/2026 5:09 AM, Judith Mendez wrote:
Hi Tanmay, all,
On 10/21/25 3:45 PM, Tanmay Kathpalia wrote:
Some boards have SD card connectors where the power rail cannot be
switched
off by the driver. However there are various circumstances when a card
might be re-initialized, such as after system resume, warm re-boot, or
error handling. However, a UHS card will continue to use 1.8V signaling
unless it is power cycled.
If the card has not been power cycled, it may still be using 1.8V
signaling. According to the SD spec., the Bus Speed Mode (function
group 1)
bits 2 to 4 are zero if the card is initialized at 3.3V signal level.
Thus
they can be used to determine if the card has already switched to 1.8V
signaling. Detect that situation and try to initialize a UHS-I (1.8V)
transfer mode.
This implementation broke am65 IDK board SD card boot, I have still
to check why this breaks only one board, potentially there might
be a quirk only for this board... But for now sending the question
in case anyone might have an idea what is going on & save me some
time.
Thanks for reporting this. I had a deeper look at the code and found
an issue that is likely the root cause of the failure on am65 IDK.
During a normal cold boot with a UHS-capable host and UHS card, the
voltage switch to 1.8V is already performed inside sd_send_op_cond()
as part of the ACMD41 handshake, and this is recorded in mmc->ocr via
the S18R bit. By the time mmc_startup() calls sd_get_capabilities(),
the card is already operating at 1.8V and reports UHS bus speed modes,
causing mmc_sd_card_using_v18() to return true. The warm-reboot
recovery path then fires unconditionally and switches the host voltage
a second time, which on boards like am65 IDK can leave the controller
in a bad state.
The fix is to guard the recovery path so it only activates when the
voltage switch was not already performed during the current session:
- if (mmc_sd_card_using_v18(mmc)) {
+ if (!(mmc->ocr & OCR_S18R) && mmc_sd_card_using_v18(mmc)) {
Could you please try this change and let me know if it resolves the
failure on am65 IDK?
I will send the patch for review on the mailing list.
Regards,
Tanmay