summaryrefslogtreecommitdiffstats
path: root/drivers/mmc
diff options
context:
space:
mode:
authorernest.zhang <ernest.zhang@bayhubtech.com>2018-07-16 02:26:51 -0400
committerUlf Hansson <ulf.hansson@linaro.org>2018-07-30 08:23:37 -0400
commit57322d542ffe01076c9df10d38e3ec0a58f9d83a (patch)
tree17e2327f1c98902e4ca887ef2deda61741987f7d /drivers/mmc
parent44350993d01c901cc201ef2663fd0fded2e03d06 (diff)
mmc: sdhci: Add support for O2 eMMC HS200 mode
When use eMMC as boot device, the eMMC signaling voltage is tied to 1.8v fixed output voltage, bios can set o2 sd host controller PCI configuration register 0x308 bit4 to 1 to let driver skip 3.3v signaling voltage and direct use 1.8v singling voltage in eMMC initialize process. Signed-off-by: ernest.zhang <ernest.zhang@bayhubtech.com> Acked-by: Adrian Hunter <adrian.hunter@intel.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Diffstat (limited to 'drivers/mmc')
-rw-r--r--drivers/mmc/host/sdhci-pci-o2micro.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/mmc/host/sdhci-pci-o2micro.c b/drivers/mmc/host/sdhci-pci-o2micro.c
index 555970a29c94..ba59db6a126c 100644
--- a/drivers/mmc/host/sdhci-pci-o2micro.c
+++ b/drivers/mmc/host/sdhci-pci-o2micro.c
@@ -3,6 +3,7 @@
3 * 3 *
4 * Authors: Peter Guo <peter.guo@bayhubtech.com> 4 * Authors: Peter Guo <peter.guo@bayhubtech.com>
5 * Adam Lee <adam.lee@canonical.com> 5 * Adam Lee <adam.lee@canonical.com>
6 * Ernest Zhang <ernest.zhang@bayhubtech.com>
6 * 7 *
7 * This software is licensed under the terms of the GNU General Public 8 * This software is licensed under the terms of the GNU General Public
8 * License version 2, as published by the Free Software Foundation, and 9 * License version 2, as published by the Free Software Foundation, and
@@ -39,6 +40,7 @@
39#define O2_SD_MISC_CTRL4 0xFC 40#define O2_SD_MISC_CTRL4 0xFC
40#define O2_SD_TUNING_CTRL 0x300 41#define O2_SD_TUNING_CTRL 0x300
41#define O2_SD_PLL_SETTING 0x304 42#define O2_SD_PLL_SETTING 0x304
43#define O2_SD_MISC_SETTING 0x308
42#define O2_SD_CLK_SETTING 0x328 44#define O2_SD_CLK_SETTING 0x328
43#define O2_SD_CAP_REG2 0x330 45#define O2_SD_CAP_REG2 0x330
44#define O2_SD_CAP_REG0 0x334 46#define O2_SD_CAP_REG0 0x334
@@ -184,6 +186,7 @@ int sdhci_pci_o2_probe_slot(struct sdhci_pci_slot *slot)
184 struct sdhci_pci_chip *chip; 186 struct sdhci_pci_chip *chip;
185 struct sdhci_host *host; 187 struct sdhci_host *host;
186 u32 reg; 188 u32 reg;
189 int ret;
187 190
188 chip = slot->chip; 191 chip = slot->chip;
189 host = slot->host; 192 host = slot->host;
@@ -197,6 +200,21 @@ int sdhci_pci_o2_probe_slot(struct sdhci_pci_slot *slot)
197 if (reg & 0x1) 200 if (reg & 0x1)
198 host->quirks |= SDHCI_QUIRK_MULTIBLOCK_READ_ACMD12; 201 host->quirks |= SDHCI_QUIRK_MULTIBLOCK_READ_ACMD12;
199 202
203 if (chip->pdev->device == PCI_DEVICE_ID_O2_SEABIRD0) {
204 ret = pci_read_config_dword(chip->pdev,
205 O2_SD_MISC_SETTING, &reg);
206 if (ret)
207 return -EIO;
208 if (reg & (1 << 4)) {
209 pr_info("%s: emmc 1.8v flag is set, force 1.8v signaling voltage\n",
210 mmc_hostname(host->mmc));
211 host->flags &= ~SDHCI_SIGNALING_330;
212 host->flags |= SDHCI_SIGNALING_180;
213 host->mmc->caps2 |= MMC_CAP2_NO_SD;
214 host->mmc->caps2 |= MMC_CAP2_NO_SDIO;
215 }
216 }
217
200 if (chip->pdev->device != PCI_DEVICE_ID_O2_FUJIN2) 218 if (chip->pdev->device != PCI_DEVICE_ID_O2_FUJIN2)
201 break; 219 break;
202 /* set dll watch dog timer */ 220 /* set dll watch dog timer */