mmc: sdhci-pci: add 8-bit bus width support for Medfield eMMCs
Adrian Hunter
maintainercover mmc: sdhci-pci: add 8-bit bus width support for Medfield eMMCs
Hi
Just setting some MMC_CAP_8_BIT_DATA bits.
Adrian Hunter (1):
mmc: sdhci-pci: allow 8-bit bus width for Intel Medfield eMMCs
Major Lee (1):
mmc: sdhci-pci: add 8-bit bus width support for mrst hc0
drivers/mmc/host/sdhci-pci.c | 54 ++++++++++++++++++++++++++++++++++++++---- 1 files changed, 49 insertions(+), 5 deletions(-)
Regards
Adrian Hunter
Adrian Hunter
maintainerPATCH 1/2 mmc: sdhci-pci: add 8-bit bus width support for mrst hc0
From: Major Lee <[email protected]>
And hook platform_8bit_width to support 8-bit bus width.
--- drivers/mmc/host/sdhci-pci.c | 33 +++++++++++++++++++++++++++++++++ 1 files changed, 33 insertions(+), 0 deletions(-)
drivers/mmc/host/sdhci-pci.c +33 -0
@@ -143,6 +143,12 @@ static const struct sdhci_pci_fixes sdhci_cafe = { SDHCI_QUIRK_BROKEN_TIMEOUT_VAL, }; +static int mrst_hc_probe_slot (struct sdhci_pci_slot *slot) +{ + slot->host->mmc->caps |=MMC_CAP_8_BIT_DATA ; +return 0 ; +} +/* * ADMA operation is disabled for Moorestown platform due to * hardware bugs.
@@ -159,6 +165,7 @@ static int mrst_hc_probe(struct sdhci_pci_chip *chip)static const struct sdhci_pci_fixes sdhci_intel_mrst_hc0 = { .quirks =SDHCI_QUIRK_BROKEN_ADMA |SDHCI_QUIRK_NO_HISPD_BIT , + .probe_slot = mrst_hc_probe_slot, };static const struct sdhci_pci_fixes sdhci_intel_mrst_hc1_hc2 = {
@@ -789,8 +796,34 @@ static int sdhci_pci_enable_dma(struct sdhci_host *host)return 0 ; } +static int sdhci_pci_8bit_width (struct sdhci_host *host,int width) +{ +u8 ctrl; + + ctrl =sdhci_readb (host,SDHCI_HOST_CONTROL ); + +switch (width) { +case MMC_BUS_WIDTH_8 : + ctrl |=SDHCI_CTRL_8BITBUS ; + ctrl &= ~SDHCI_CTRL_4BITBUS ; +break ; +case MMC_BUS_WIDTH_4 : + ctrl |=SDHCI_CTRL_4BITBUS ; + ctrl &= ~SDHCI_CTRL_8BITBUS ; +break ; +default : + ctrl &= ~(SDHCI_CTRL_8BITBUS |SDHCI_CTRL_4BITBUS ); +break ; + } + +sdhci_writeb (host, ctrl,SDHCI_HOST_CONTROL ); + +return 0 ; +} +static struct sdhci_ops sdhci_pci_ops = { .enable_dma = sdhci_pci_enable_dma, + .platform_8bit_width = sdhci_pci_8bit_width, };/*****************************************************************************\
Signature · 1 line
1.7.4.4
Adrian Hunter
maintainerPATCH 2/2 mmc: sdhci-pci: allow 8-bit bus width for Intel Medfield eMMCs
In reply to Adrian HunterUnless MMC_CAP_8_BIT_DATA is set, the bus width defaults to 4.
--- drivers/mmc/host/sdhci-pci.c | 21 ++++++++++++++++----- 1 files changed, 16 insertions(+), 5 deletions(-)
drivers/mmc/host/sdhci-pci.c +16 -5
@@ -163,6 +163,12 @@ static int mrst_hc_probe(struct sdhci_pci_chip *chip)return 0 ; } +static int mfd_emmc_probe_slot (struct sdhci_pci_slot *slot) +{ + slot->host->mmc->caps |=MMC_CAP_8_BIT_DATA ; +return 0 ; +} +static const struct sdhci_pci_fixes sdhci_intel_mrst_hc0 = { .quirks =SDHCI_QUIRK_BROKEN_ADMA |SDHCI_QUIRK_NO_HISPD_BIT , .probe_slot = mrst_hc_probe_slot,
@@ -177,8 +183,13 @@ static const struct sdhci_pci_fixes sdhci_intel_mfd_sd = { .quirks = SDHCI_QUIRK_NO_ENDATTR_IN_NOPDESC, }; -static const struct sdhci_pci_fixes sdhci_intel_mfd_emmc_sdio = { +static const struct sdhci_pci_fixes sdhci_intel_mfd_sdio = { + .quirks =SDHCI_QUIRK_NO_ENDATTR_IN_NOPDESC , +}; + +static const struct sdhci_pci_fixes sdhci_intel_mfd_emmc = { .quirks =SDHCI_QUIRK_NO_ENDATTR_IN_NOPDESC , + .probe_slot = mfd_emmc_probe_slot, };/* O2Micro extra registers */
@@ -689,7 +700,7 @@ static const struct pci_device_id pci_ids[] __devinitdata = { .device = PCI_DEVICE_ID_INTEL_MFD_SDIO1, .subvendor = PCI_ANY_ID, .subdevice = PCI_ANY_ID, - .driver_data = (kernel_ulong_t)&sdhci_intel_mfd_emmc_sdio, + .driver_data = (kernel_ulong_t)&sdhci_intel_mfd_sdio, }, {
@@ -697,7 +708,7 @@ static const struct pci_device_id pci_ids[] __devinitdata = { .device = PCI_DEVICE_ID_INTEL_MFD_SDIO2, .subvendor = PCI_ANY_ID, .subdevice = PCI_ANY_ID, - .driver_data = (kernel_ulong_t)&sdhci_intel_mfd_emmc_sdio, + .driver_data = (kernel_ulong_t)&sdhci_intel_mfd_sdio, }, {
@@ -705,7 +716,7 @@ static const struct pci_device_id pci_ids[] __devinitdata = { .device = PCI_DEVICE_ID_INTEL_MFD_EMMC0, .subvendor = PCI_ANY_ID, .subdevice = PCI_ANY_ID, - .driver_data = (kernel_ulong_t)&sdhci_intel_mfd_emmc_sdio, + .driver_data = (kernel_ulong_t)&sdhci_intel_mfd_emmc, }, {
@@ -713,7 +724,7 @@ static const struct pci_device_id pci_ids[] __devinitdata = { .device = PCI_DEVICE_ID_INTEL_MFD_EMMC1, .subvendor = PCI_ANY_ID, .subdevice = PCI_ANY_ID, - .driver_data = (kernel_ulong_t)&sdhci_intel_mfd_emmc_sdio, + .driver_data = (kernel_ulong_t)&sdhci_intel_mfd_emmc, }, {
Signature · 1 line
1.7.4.4
Chris Ball
AppliedHi Adrian,
Quoted 8 lines · Adrian Hunter
Just setting some
MMC_CAP_8_BIT_DATAbits.Adrian Hunter (1):
mmc: sdhci-pci: allow 8-bit bus width for Intel Medfield eMMCsMajor Lee (1):
mmc: sdhci-pci: add 8-bit bus width support for mrst hc0
Pushed to mmc-next for 3.1, thanks.
- Chris.
Signature · 2 lines
Chris Ball <[email protected]> <http://printf.net/> One Laptop Per Child