Relax the sdhci(4) check that filters out the 1.8v voltage option unless

the slot is flagged as 'embedded'.

The features related to embedded and shared slots were added in v3.0 of
the sdhci spec.  Hardware prior to v3 sometimes supported 1.8v on non-
removable devices in embedded systems, but had no way to indicate that
via the standard sdhci registers (instead they use out of band metadata
such as FDT data).

This change adds the controller specification version to the check for
whether to filter out the 1.8v selection.  On older hardware, the 1.8v
option is allowed to remain.  On 3.0 or later it still requires the
embedded-slot flag to remain.

This is part of the fix for PR 241301 (eMMC not detected on Beaglebone).
Changes to the sdhci_ti driver are also needed for a full fix.

PR:		241301
This commit is contained in:
Ian Lepore 2019-10-16 16:03:19 +00:00
parent b4efea53e0
commit 49dfdf633a

View File

@ -919,8 +919,13 @@ sdhci_init_slot(device_t dev, struct sdhci_slot *slot, int num)
slot->host.host_ocr |= MMC_OCR_320_330 | MMC_OCR_330_340;
if (caps & SDHCI_CAN_VDD_300)
slot->host.host_ocr |= MMC_OCR_290_300 | MMC_OCR_300_310;
/* 1.8V VDD is not supposed to be used for removable cards. */
if ((caps & SDHCI_CAN_VDD_180) && (slot->opt & SDHCI_SLOT_EMBEDDED))
/*
* 1.8V VDD is not supposed to be used for removable cards. Hardware
* prior to v3.0 had no way to indicate embedded slots, but did
* sometimes support 1.8v for non-removable devices.
*/
if ((caps & SDHCI_CAN_VDD_180) && (slot->version < SDHCI_SPEC_300 ||
(slot->opt & SDHCI_SLOT_EMBEDDED)))
slot->host.host_ocr |= MMC_OCR_LOW_VOLTAGE;
if (slot->host.host_ocr == 0) {
slot_printf(slot, "Hardware doesn't report any "