[coreboot-gerrit] Change in coreboot[master]: drivers/storage: Allow SOC to override more controller features

Lee Leahy (Code Review) gerrit at coreboot.org
Mon Mar 27 21:40:01 CEST 2017


Lee Leahy has uploaded a new change for review. ( https://review.coreboot.org/19013 )

Change subject: drivers/storage: Allow SOC to override more controller features
......................................................................

drivers/storage: Allow SOC to override more controller features

Instead of converting from SDHCI_PLATFORM_* to SDHCI_QUIRK_* to
MMC_MODE_*, call the SOC back with the SdhciHost and MmcCtrlr structures
to allow the necessary updates to support the controller quirks.

TEST=Build for reef

Change-Id: Ie2fc8a15727d6c487bafdf8ac5e530f1d2a73cce
Signed-off-by: Lee Leahy <Leroy.P.Leahy at intel.com>
---
M src/drivers/storage/sdhci.c
M src/include/device/sdhci.h
2 files changed, 21 insertions(+), 0 deletions(-)


  git pull ssh://review.coreboot.org:29418/coreboot refs/changes/13/19013/1

diff --git a/src/drivers/storage/sdhci.c b/src/drivers/storage/sdhci.c
index af5d162..f4fe256 100644
--- a/src/drivers/storage/sdhci.c
+++ b/src/drivers/storage/sdhci.c
@@ -713,11 +713,22 @@
 	if (caps & SDHCI_CAN_64BIT)
 		host->dma64 = 1;
 
+	/* Let the SOC adjust the configuration to handle controller quirks */
+	soc_sdhci_quirks(host);
+
+	/* Display the results */
+	mmc_trace("0x%08x: mmc_ctrlr.caps\n", host->mmc_ctrlr.caps);
+	mmc_trace("0x%08x: mmc_ctrlr.voltages\n", host->mmc_ctrlr.voltages);
+
 	sdhci_reset(host, SDHCI_RESET_ALL);
 
 	return 0;
 }
 
+__attribute__((weak)) void soc_sdhci_quirks(SdhciHost *host)
+{
+}
+
 static int sdhci_init(SdhciHost *host)
 {
 	int rv = sdhci_pre_init(host);
diff --git a/src/include/device/sdhci.h b/src/include/device/sdhci.h
index 661b85d..8976db6 100644
--- a/src/include/device/sdhci.h
+++ b/src/include/device/sdhci.h
@@ -365,6 +365,16 @@
 int sdhci_host_init(SdhciHost *host, void *ioaddr, int platform_info,
 	int clock_min, int clock_max, int clock_base);
 
+/* SOC specific routine to override host->mmc_ctrlr.caps and .voltages
+ *
+ * Set/clear the necessary MMC_MODE_xxx bits in host->mmc_ctrlr.caps
+ * to specify the controllers capabilities and driver workarounds.
+ *
+ * Set/clear the necessary MMC_VDD_xxx bits in host->mmc_ctrlr.voltages
+ * to specify the controllers power support.
+ */
+void soc_sdhci_quirks(SdhciHost *host);
+
 typedef uint32_t pcidev_t;
 
 /* Add SDHCI controller from PCI */

-- 
To view, visit https://review.coreboot.org/19013
To unsubscribe, visit https://review.coreboot.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie2fc8a15727d6c487bafdf8ac5e530f1d2a73cce
Gerrit-PatchSet: 1
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Owner: Lee Leahy <leroy.p.leahy at intel.com>



More information about the coreboot-gerrit mailing list