Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F168106738
D58631.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D58631.diff
View Options
diff --git a/sys/dev/sdhci/sdhci.h b/sys/dev/sdhci/sdhci.h
--- a/sys/dev/sdhci/sdhci.h
+++ b/sys/dev/sdhci/sdhci.h
@@ -95,6 +95,8 @@
#define SDHCI_QUIRK_MMC_HS400_IF_CAN_SDR104 (1 << 29)
/* SDMA boundary in SDHCI_BLOCK_SIZE broken - use front-end supplied value. */
#define SDHCI_QUIRK_BROKEN_SDMA_BOUNDARY (1 << 30)
+/* Controller doesn't fire Transfer Complete on R1B busy de-assert. */
+#define SDHCI_QUIRK_NO_BUSY_IRQ (1U << 31)
/*
* Controller registers
diff --git a/sys/dev/sdhci/sdhci.c b/sys/dev/sdhci/sdhci.c
--- a/sys/dev/sdhci/sdhci.c
+++ b/sys/dev/sdhci/sdhci.c
@@ -1918,6 +1918,18 @@
slot->curcmd->resp[0], slot->curcmd->resp[1],
slot->curcmd->resp[2], slot->curcmd->resp[3]);
+ /*
+ * NO_BUSY_IRQ quirk: on hardware that doesn't fire Transfer Complete
+ * when the R1B busy signal releases, we can't wait for it. Treat an
+ * R1B-without-data command as complete at response time; the next
+ * command's sdhci_start_command inhibit polling (CIHB/CDIHB) will
+ * naturally wait for the card to release DAT0 busy before issuing.
+ */
+ if ((slot->quirks & SDHCI_QUIRK_NO_BUSY_IRQ) &&
+ (slot->curcmd->flags & MMC_RSP_BUSY) &&
+ slot->curcmd->data == NULL)
+ slot->data_done = 1;
+
/* If data ready - finish. */
if (slot->data_done)
sdhci_start(slot);
diff --git a/sys/dev/sdhci/sdhci_fsl_fdt.c b/sys/dev/sdhci/sdhci_fsl_fdt.c
--- a/sys/dev/sdhci/sdhci_fsl_fdt.c
+++ b/sys/dev/sdhci/sdhci_fsl_fdt.c
@@ -1020,6 +1020,17 @@
sc->vendor_ver = (RD4(sc, SDHCI_FSL_HOST_VERSION) &
SDHCI_VENDOR_VER_MASK) >> SDHCI_VENDOR_VER_SHIFT;
+ /*
+ * Pre-V23 eSDHC doesn't assert Transfer Complete when the card
+ * releases DAT0 busy after an R1B response. Enable the core's
+ * NO_BUSY_IRQ short-circuit so R1B-without-data commands don't
+ * hang waiting for a TC that never arrives; the subsequent
+ * command's CIHB/CDIHB inhibit poll waits for busy release
+ * before actually issuing.
+ */
+ if (sc->vendor_ver <= SDHCI_FSL_VENDOR_V22)
+ sc->slot.quirks |= SDHCI_QUIRK_NO_BUSY_IRQ;
+
sdhci_fsl_fdt_of_parse(dev);
sc->maxclk_hz = host->f_max ? host->f_max : sc->baseclk_hz;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Aug 27, 10:22 AM (19 h, 32 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
37374321
Default Alt Text
D58631.diff (2 KB)
Attached To
Mode
D58631: sdhci: Add new quirk for hardware that can't signal R1B busy
Attached
Detach File
Event Timeline
Log In to Comment