summaryrefslogtreecommitdiffstats
path: root/sys/dev/sdhci/sdhci_acpi.c
diff options
context:
space:
mode:
authormarius <marius@FreeBSD.org>2017-05-18 21:00:50 +0000
committermarius <marius@FreeBSD.org>2017-05-18 21:00:50 +0000
commit5ff68c0f86e336bcd04c4d03111777b30d56efc2 (patch)
tree339e415699835b349745ae1fe76797f3a639a26a /sys/dev/sdhci/sdhci_acpi.c
parent27866749f09178fba0028c9f041af292815041c8 (diff)
downloadFreeBSD-src-5ff68c0f86e336bcd04c4d03111777b30d56efc2.zip
FreeBSD-src-5ff68c0f86e336bcd04c4d03111777b30d56efc2.tar.gz
MFC: r318282
- Unlike as in the PCI case, when attached to ACPI, Intel Bay Trail and Braswell eMMC and SDXC controllers share the same IDs. Like in the PCI case, Braswell eMMC needs the SDHCI_QUIRK_DATA_TIMEOUT_1MHZ quirk (see r311794 for the corresponding change to the sdhci(4) PCI PCI front-end), though. However, due to the shared ACPI IDs, this is trickier to do. - Intel Apollo Lake eMMC and SDXC controllers are affected by the APL18 ("Using 32-bit Addressing Mode With SD/eMMC Controller May Lead to Unpredictable System Behavior") silicon bug. When this erratum hits, typically both SDHCI and XHCI controllers wedge. According to Intel, using ADMA2 with 64-bit addressing and 96-bit descriptors serves as a workaround. Until such times when sdhci(4) has ADMA2 support, flag DMA as broken for affected interfaces. This turns out to work around the problem, too, at the cost of performance. - In the sdhci(4) ACPI front-end, probe the Intel Apollo Lake eMMC and SDXC controllers, too.
Diffstat (limited to 'sys/dev/sdhci/sdhci_acpi.c')
-rw-r--r--sys/dev/sdhci/sdhci_acpi.c25
1 files changed, 22 insertions, 3 deletions
diff --git a/sys/dev/sdhci/sdhci_acpi.c b/sys/dev/sdhci/sdhci_acpi.c
index 54c2c56..ea5ed70 100644
--- a/sys/dev/sdhci/sdhci_acpi.c
+++ b/sys/dev/sdhci/sdhci_acpi.c
@@ -57,25 +57,39 @@ static const struct sdhci_acpi_device {
const char *desc;
u_int quirks;
} sdhci_acpi_devices[] = {
- { "80860F14", 1, "Intel Bay Trail eMMC 4.5 Controller",
+ { "80860F14", 1, "Intel Bay Trail/Braswell eMMC 4.5/4.5.1 Controller",
SDHCI_QUIRK_ALL_SLOTS_NON_REMOVABLE |
SDHCI_QUIRK_INTEL_POWER_UP_RESET |
SDHCI_QUIRK_WAIT_WHILE_BUSY |
SDHCI_QUIRK_MMC_DDR52 |
SDHCI_QUIRK_CAPS_BIT63_FOR_MMC_HS400 |
SDHCI_QUIRK_PRESET_VALUE_BROKEN },
- { "80860F14", 3, "Intel Bay Trail SDXC Controller",
+ { "80860F14", 3, "Intel Bay Trail/Braswell SDXC Controller",
SDHCI_QUIRK_WAIT_WHILE_BUSY |
SDHCI_QUIRK_PRESET_VALUE_BROKEN },
- { "80860F16", 0, "Intel Bay Trail SDXC Controller",
+ { "80860F16", 0, "Intel Bay Trail/Braswell SDXC Controller",
SDHCI_QUIRK_WAIT_WHILE_BUSY |
SDHCI_QUIRK_PRESET_VALUE_BROKEN },
+ { "80865ACA", 0, "Intel Apollo Lake SDXC Controller",
+ SDHCI_QUIRK_BROKEN_DMA | /* APL18 erratum */
+ SDHCI_QUIRK_WAIT_WHILE_BUSY |
+ SDHCI_QUIRK_PRESET_VALUE_BROKEN },
+ { "80865ACC", 0, "Intel Apollo Lake eMMC 5.0 Controller",
+ SDHCI_QUIRK_BROKEN_DMA | /* APL18 erratum */
+ SDHCI_QUIRK_ALL_SLOTS_NON_REMOVABLE |
+ SDHCI_QUIRK_INTEL_POWER_UP_RESET |
+ SDHCI_QUIRK_WAIT_WHILE_BUSY |
+ SDHCI_QUIRK_MMC_DDR52 |
+ SDHCI_QUIRK_CAPS_BIT63_FOR_MMC_HS400 |
+ SDHCI_QUIRK_PRESET_VALUE_BROKEN },
{ NULL, 0, NULL, 0}
};
static char *sdhci_ids[] = {
"80860F14",
"80860F16",
+ "80865ACA",
+ "80865ACC",
NULL
};
@@ -249,6 +263,11 @@ sdhci_acpi_attach(device_t dev)
return (ENOMEM);
}
+ /* Intel Braswell eMMC 4.5.1 controller quirk */
+ if (strcmp(acpi_dev->hid, "80860F14") == 0 && acpi_dev->uid == 1 &&
+ SDHCI_READ_4(dev, &sc->slot, SDHCI_CAPABILITIES) == 0x446cc8b2 &&
+ SDHCI_READ_4(dev, &sc->slot, SDHCI_CAPABILITIES2) == 0x00000807)
+ sc->quirks |= SDHCI_QUIRK_DATA_TIMEOUT_1MHZ;
sc->quirks &= ~sdhci_quirk_clear;
sc->quirks |= sdhci_quirk_set;
sc->slot.quirks = sc->quirks;
OpenPOWER on IntegriCloud