Intel MID support for SDHCI devices
cover Intel MID support for SDHCI devices
The Intel MID platforms need various workarounda and helpers. This series of patches introduces two things
- A set of overrides for basic operations (as opposed to yet more quirk flags)
- The supporting logic to propogate those new operations through the PCI sdhci code as far as is needed in each case.
Several of the other quirks could now be removed and rephrased using the hooks more cleanly. I've not done so as I don't have all the relevant other embedded platform hardware to test any such changes.
---
Alan Cox (3):
mmc: serialization support
sdhci: Allow the probe handler to override slots
sdhci: Rework some of the quirk behaviour
Xiaochen Shen (1):
sdhci: Intel Medfield support
drivers/mmc/core/core.c | 30 ++++++ drivers/mmc/host/Kconfig | 11 ++ drivers/mmc/host/Makefile | 1 drivers/mmc/host/sdhci-intel-mid.c | 170 ++++++++++++++++++++++++++++++++++++ drivers/mmc/host/sdhci-pci.c | 107 ++++++++++++++++++++++- drivers/mmc/host/sdhci.c | 73 +++++++++++++-- drivers/mmc/host/sdhci.h | 19 ++++ include/linux/mmc/core.h | 1 include/linux/mmc/host.h | 3 + include/linux/pci_ids.h | 7 + 10 files changed, 403 insertions(+), 19 deletions(-) create mode 100644 drivers/mmc/host/sdhci-intel-mid.c
Signature · 2 lines
"Knowledge has no value or use for the solitary owner: to be
enjoyed it must be communicated" -- Charles Pratt, 1st Earl CamdenPATCH 1/4 sdhci: Rework some of the quirk behaviour
As the quirks go ever more complex it's getting harder and harder to integrate new drivers. The Intel MID devices add a whole further collection of new quirks so instead of quirks start moving some stuff to overridable functions.
We also introduce an sdhci_reset_all helper which is told if the reset is being done during init (which needs to be avoided by some hw) or on exit in which case it doesn't.
Arguably the driver wants to be lots of drivers and "libsdhci" but that would be a massive undertaking.
---
drivers/mmc/host/Kconfig | 11 ++ drivers/mmc/host/Makefile | 1 drivers/mmc/host/sdhci-intel-mid.c | 173 ++++++++++++++++++++++++++++++++++++ drivers/mmc/host/sdhci-pci.c | 60 ++++++++++++ drivers/mmc/host/sdhci.c | 55 +++++++++-- drivers/mmc/host/sdhci.h | 18 ++++ include/linux/pci_ids.h | 2 7 files changed, 305 insertions(+), 15 deletions(-) create mode 100644 drivers/mmc/host/sdhci-intel-mid.c
drivers/mmc/host/Kconfig +11 -0
@@ -81,6 +81,17 @@ config MMC_RICOH_MMC If unsure, say Y. +config MMC_SDHCI_INTEL_MID + tristate "SDHCI support on Intel MID platforms" + depends on MMC_SDHCI_PCI + help + This includes support for the SDHCI controllers found on Intel + MID platform systems. + + If you have a controller with this interface, say Y or M here. + + If unsure, say N. + config MMC_SDHCI_OF tristate "SDHCI support on OpenFirmware platforms" depends on MMC_SDHCI && PPC_OF
drivers/mmc/host/Makefile +1 -0
@@ -13,6 +13,7 @@ obj-$(CONFIG_MMC_MXC) += mxcmmc.o obj-$(CONFIG_MMC_SDHCI) += sdhci.o obj-$(CONFIG_MMC_SDHCI_MV) += sdhci-mv.o obj-$(CONFIG_MMC_SDHCI_PCI) += sdhci-pci.o +obj-$(CONFIG_MMC_SDHCI_MID) += sdhci-intel-mid.o obj-$(CONFIG_MMC_SDHCI_S3C) += sdhci-s3c.o obj-$(CONFIG_MMC_SDHCI_SPEAR) += sdhci-spear.o obj-$(CONFIG_MMC_WBSD) += wbsd.o
drivers/mmc/host/sdhci-intel-mid.c new file +173 -0
173 lines not on this page · raw message
drivers/mmc/host/sdhci-pci.c +58 -2
96 lines not on this page · raw message
drivers/mmc/host/sdhci.c +42 -13
134 lines not on this page · raw message
drivers/mmc/host/sdhci.h +18 -0
@@ -323,6 +323,17 @@ struct sdhci_ops {unsigned int (*get_max_clock)(struct sdhci_host *host);unsigned int (*get_min_clock)(struct sdhci_host *host);unsigned int (*get_timeout_clock)(struct sdhci_host *host); + +/* Interface hooks to allow drivers to override standard behaviour */ +void (*reset)(struct sdhci_host *host,u8 mask); +void (*reset_all)(struct sdhci_host *host,int down); +void (*init)(struct sdhci_host *host,int soft); +void (*write_command)(struct sdhci_host *host, +struct mmc_command *cmd,int flags); +void (*set_ios)(struct sdhci_host *host, +struct mmc_ios *ios,u8 ctrl); +void (*set_caps)(struct sdhci_host *host); +void (*unexpected_cmd_irq)(struct sdhci_host *host,u32 intmask); };#ifdef CONFIG_MMC_SDHCI_IO_ACCESSORS
@@ -427,4 +438,11 @@ extern int sdhci_suspend_host(struct sdhci_host *host, pm_message_t state);extern int sdhci_resume_host (struct sdhci_host *host);#endif +extern void sdhci_clear_set_irqs (struct sdhci_host *host,u32 clear,u32 set); +extern int sdhci_pci_enable_dma (struct sdhci_host *host); + +/* Host function sets from driver support files */ +extern struct sdhci_ops sdhci_intel_mrst_hc; + +#endif /* __SDHCI_H */
include/linux/pci_ids.h +2 -0
@@ -2410,6 +2410,8 @@#define PCI_DEVICE_ID_INTEL_82375 0x0482#define PCI_DEVICE_ID_INTEL_82424 0x0483#define PCI_DEVICE_ID_INTEL_82378 0x0484 +#define PCI_DEVICE_ID_INTEL_MRST_SD0 0x0807 +#define PCI_DEVICE_ID_INTEL_MRST_SD1 0x0808#define PCI_DEVICE_ID_INTEL_I960 0x0960#define PCI_DEVICE_ID_INTEL_I960RM 0x0962#define PCI_DEVICE_ID_INTEL_8257X_SOL 0x1062
PATCH 2/4 sdhci: Allow the probe handler to override slots
In reply to Alan CoxCurrently we write it to the chip data, but if the probe handler overrides it we ignore the new value and keep using our cached one. Fix this so that a probe handler can adjust the slot count
---
drivers/mmc/host/sdhci-pci.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
drivers/mmc/host/sdhci-pci.c +2 -0
@@ -874,6 +874,8 @@ static int __devinit sdhci_pci_probe(struct pci_dev *pdev, goto free; } + slots = chip->num_slots;/* Quirk may have changed this */ +for (i =0 ;i < slots;i++) { slot =sdhci_pci_probe_slot (pdev, chip, first_bar + i);if (IS_ERR (slot)) {