[RFC PATCH v1 1/1] mmc: zynq_sdhci: Only evaluate card-stable signal if card was detected
lukas.funke-oss at weidmueller.com
lukas.funke-oss at weidmueller.com
Wed Apr 24 10:23:42 CEST 2024
From: Lukas Funke <lukas.funke at weidmueller.com>
On ZynqMp there seems to be a dependency between the card-stable bit and
the card-detect bit. The card-stable bit is set *if and only if*
the card-detect bit was set before, indicating that the signal was
stable and reliable during card insertion.
If the card-detect bit is *not* evaluated the corresponding check leads
to a timeout indicating that the card-detect was not stable.
Signed-off-by: Lukas Funke <lukas.funke at weidmueller.com>
---
drivers/mmc/zynq_sdhci.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/drivers/mmc/zynq_sdhci.c b/drivers/mmc/zynq_sdhci.c
index 935540d171..d0bccd41cc 100644
--- a/drivers/mmc/zynq_sdhci.c
+++ b/drivers/mmc/zynq_sdhci.c
@@ -1168,11 +1168,14 @@ static int arasan_sdhci_probe(struct udevice *dev)
*/
if (IS_ENABLED(CONFIG_ARCH_ZYNQMP) || IS_ENABLED(CONFIG_ARCH_VERSAL)) {
u32 timeout = 1000000;
+ u32 value;
- while (((sdhci_readl(host, SDHCI_PRESENT_STATE) &
- SDHCI_CARD_STATE_STABLE) == 0) && timeout) {
+ value = sdhci_readl(host, SDHCI_PRESENT_STATE);
+ while ((value & SDHCI_CARD_PRESENT) &&
+ ((value & SDHCI_CARD_STATE_STABLE) == 0) && timeout) {
udelay(1);
timeout--;
+ value = sdhci_readl(host, SDHCI_PRESENT_STATE);
}
if (!timeout) {
dev_err(dev, "Sdhci card detect state not stable\n");
--
2.30.2
More information about the U-Boot
mailing list