Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 29 Jul 2026 19:25:24 +0000
From:      Adrian Chadd <adrian@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Cc:        Abdelkader Boudih <freebsd@seuros.com>
Subject:   git: 248d537e4ca7 - main - sdhci: don't infer a non-removable slot on Apollo Lake SDXC
Message-ID:  <6a6a53a4.449ad.76f9417e@gitrepo.freebsd.org>

index | next in thread | raw e-mail

The branch main has been updated by adrian:

URL: https://cgit.FreeBSD.org/src/commit/?id=248d537e4ca7295a08bab60e82633d332d36e525

commit 248d537e4ca7295a08bab60e82633d332d36e525
Author:     Abdelkader Boudih <freebsd@seuros.com>
AuthorDate: 2026-07-29 19:24:46 +0000
Commit:     Adrian Chadd <adrian@FreeBSD.org>
CommitDate: 2026-07-29 19:24:49 +0000

    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
---
 sys/dev/sdhci/sdhci.c     | 3 ++-
 sys/dev/sdhci/sdhci.h     | 2 ++
 sys/dev/sdhci/sdhci_pci.c | 1 +
 3 files changed, 5 insertions(+), 1 deletion(-)

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 */


home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6a6a53a4.449ad.76f9417e>