svn commit: r353651 - head/sys/dev/sdhci

Ian Lepore ian at FreeBSD.org
Wed Oct 16 16:03:20 UTC 2019


Author: ian
Date: Wed Oct 16 16:03:19 2019
New Revision: 353651
URL: https://svnweb.freebsd.org/changeset/base/353651

Log:
  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

Modified:
  head/sys/dev/sdhci/sdhci.c

Modified: head/sys/dev/sdhci/sdhci.c
==============================================================================
--- head/sys/dev/sdhci/sdhci.c	Wed Oct 16 15:50:12 2019	(r353650)
+++ head/sys/dev/sdhci/sdhci.c	Wed Oct 16 16:03:19 2019	(r353651)
@@ -919,8 +919,13 @@ sdhci_init_slot(device_t dev, struct sdhci_slot *slot,
 	    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 "


More information about the svn-src-head mailing list