aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAbdelkader Boudih <freebsd@seuros.com>2026-07-29 19:24:46 +0000
committerAdrian Chadd <adrian@FreeBSD.org>2026-07-29 19:24:49 +0000
commit248d537e4ca7295a08bab60e82633d332d36e525 (patch)
tree09b5eee881d79951f3f45293d13d1272def656fd
parent5f74217c05a99f38a31a6e4950220964595d4ac8 (diff)
sdhci: don't infer a non-removable slot on Apollo Lake SDXC
Intel Apollo Lake SDXC controller reports a Slot Type of "Embedded Slot for One Device" in SDHCI_CAPABILITIES bits, even when the slot is a removable card reader. This caused 48 timeouts before the boot sequence resumed. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D58467
-rw-r--r--sys/dev/sdhci/sdhci.c3
-rw-r--r--sys/dev/sdhci/sdhci.h2
-rw-r--r--sys/dev/sdhci/sdhci_pci.c1
3 files changed, 5 insertions, 1 deletions
diff --git a/sys/dev/sdhci/sdhci.c b/sys/dev/sdhci/sdhci.c
index 0426d9d27916..b536e273d4bf 100644
--- a/sys/dev/sdhci/sdhci.c
+++ b/sys/dev/sdhci/sdhci.c
@@ -901,7 +901,8 @@ sdhci_init_slot(device_t dev, struct sdhci_slot *slot, int num)
SDHCI_LOCK_DESTROY(slot);
return (ENXIO);
} else if ((caps & SDHCI_SLOTTYPE_MASK) ==
- SDHCI_SLOTTYPE_EMBEDDED) {
+ SDHCI_SLOTTYPE_EMBEDDED &&
+ !(slot->quirks & SDHCI_QUIRK_SLOTTYPE_BROKEN)) {
slot->opt |= SDHCI_SLOT_EMBEDDED | SDHCI_NON_REMOVABLE;
}
}
diff --git a/sys/dev/sdhci/sdhci.h b/sys/dev/sdhci/sdhci.h
index c5b2f24061ae..7f18ce2325c3 100644
--- 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)
+/* Slot type in SDHCI_CAPABILITIES reads as embedded, but slot is removable. */
+#define SDHCI_QUIRK_SLOTTYPE_BROKEN (1U << 31)
/*
* Controller registers
diff --git a/sys/dev/sdhci/sdhci_pci.c b/sys/dev/sdhci/sdhci_pci.c
index 4f9bbfec50fb..3ede3a666578 100644
--- a/sys/dev/sdhci/sdhci_pci.c
+++ b/sys/dev/sdhci/sdhci_pci.c
@@ -142,6 +142,7 @@ static const struct sdhci_device {
{ 0x5aca8086, 0xffff, "Intel Apollo Lake SDXC Controller",
SDHCI_QUIRK_BROKEN_DMA | /* APL18 erratum */
SDHCI_QUIRK_WAIT_WHILE_BUSY |
+ SDHCI_QUIRK_SLOTTYPE_BROKEN |
SDHCI_QUIRK_PRESET_VALUE_BROKEN },
{ 0x5acc8086, 0xffff, "Intel Apollo Lake eMMC 5.0 Controller",
SDHCI_QUIRK_BROKEN_DMA | /* APL18 erratum */