Hello All!
We would like TI to clarify to us the timing of the MMC reset, specifically the timing of all the steps specified in the RTM, '0->1' and '1->0', that are described in spruhl7i RTM, 17.5.1.18 SD_SYSCTL, SRC and SRD bits.
Problem:
We have observed on our system* a random 20ms blockage of RT applications.
(*System: Linux RT, kernel v5.10, SDK v8.0-ish. ARM runs at 300MHz. MMCSD is clocked at 48MHz.)
Investigations have localized the issue to the "broken-cd" handling of the SD card interface connected to MMCSD1. (We couldn't connect the CD due to lack of free pins on the SoC. The issue disappears if the SD card is inserted.)
Analyzing the code* and comparing it to RTM (chapter 17.5.1.18 SD_SYSCTL Register in "spruhl7i") we don't understand were from the 20ms timeout comes. (The "MMC_TIMEOUT_US" in the Linux driver.)
(*Code: https://elixir.bootlin.com/linux/v5.10.149/source/drivers/mmc/host/omap_hsmmc.c#L975 )
(From RTM, briefly, SRC/SRD resets: set reset bit to 1; wait for transition of the bit from 0 to 1; wait for transition of the bit from 1 to 0.)
The timing of the reset is not specified in the RTM. (Longest time I could find in the RTM was 80 cycles for some internal initialization, which at 48MHz (clock of our MMC) is way way shorter than 20ms.)
It appears that sometimes this reset is triggered from interrupt context, and thus blocks most/all of the system for 20ms. (On RT Linux tests where wee see RT errors, sometimes it appears to block everything except for the WDT interrupt.)
It's unclear why the reset routine waits full 20ms (as if running into timeout) yet doesn't produce the error message. And the SD cards works when plugged.
Right now my assumption is that MMCSD1 performs reset faster than the ARM/driver could detect the 0->1 transition, and thus driver is stuck waiting 20ms for the start of reset, while in fact the MMCSD1 has long resetted itself (the '0' that is being read back is indicator that reset had been finished, thus no error message).
We would like TI to clarify to us the timing of the MMC reset, specifically the timing of all the steps specified in the RTM, '0->1' and '1->0'.