diff options
author | Pierre Ossman <drzeus@drzeus.cx> | 2006-06-30 05:22:29 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2006-07-02 11:54:53 -0400 |
commit | 4a9655051fb1efa568e53baf5dfb21e33bad6bf6 (patch) | |
tree | 4cafaf33d3d9c821f39c3604ebdeeb85c5b911ef /drivers/mmc | |
parent | fd2208d7c72ef5995b730f1e23b082261499e334 (diff) |
[MMC] sdhci: check controller version
Check the interface version of the controller and bail out if it's an unknown
version.
Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'drivers/mmc')
-rw-r--r-- | drivers/mmc/sdhci.c | 11 | ||||
-rw-r--r-- | drivers/mmc/sdhci.h | 4 |
2 files changed, 15 insertions, 0 deletions
diff --git a/drivers/mmc/sdhci.c b/drivers/mmc/sdhci.c index 5324eae6d720..e37c8149249f 100644 --- a/drivers/mmc/sdhci.c +++ b/drivers/mmc/sdhci.c | |||
@@ -1073,6 +1073,7 @@ static int sdhci_resume (struct pci_dev *pdev) | |||
1073 | static int __devinit sdhci_probe_slot(struct pci_dev *pdev, int slot) | 1073 | static int __devinit sdhci_probe_slot(struct pci_dev *pdev, int slot) |
1074 | { | 1074 | { |
1075 | int ret; | 1075 | int ret; |
1076 | unsigned int version; | ||
1076 | struct sdhci_chip *chip; | 1077 | struct sdhci_chip *chip; |
1077 | struct mmc_host *mmc; | 1078 | struct mmc_host *mmc; |
1078 | struct sdhci_host *host; | 1079 | struct sdhci_host *host; |
@@ -1131,6 +1132,16 @@ static int __devinit sdhci_probe_slot(struct pci_dev *pdev, int slot) | |||
1131 | goto release; | 1132 | goto release; |
1132 | } | 1133 | } |
1133 | 1134 | ||
1135 | version = readw(host->ioaddr + SDHCI_HOST_VERSION); | ||
1136 | version = (version & SDHCI_SPEC_VER_MASK) >> SDHCI_SPEC_VER_SHIFT; | ||
1137 | if (version != 0) { | ||
1138 | printk(KERN_ERR "%s: Unknown controller version (%d). " | ||
1139 | "Cowardly refusing to continue.\n", host->slot_descr, | ||
1140 | version); | ||
1141 | ret = -ENODEV; | ||
1142 | goto unmap; | ||
1143 | } | ||
1144 | |||
1134 | caps = readl(host->ioaddr + SDHCI_CAPABILITIES); | 1145 | caps = readl(host->ioaddr + SDHCI_CAPABILITIES); |
1135 | 1146 | ||
1136 | if ((caps & SDHCI_CAN_DO_DMA) && ((pdev->class & 0x0000FF) == 0x01)) | 1147 | if ((caps & SDHCI_CAN_DO_DMA) && ((pdev->class & 0x0000FF) == 0x01)) |
diff --git a/drivers/mmc/sdhci.h b/drivers/mmc/sdhci.h index b1aa3acf0906..758cf1c24364 100644 --- a/drivers/mmc/sdhci.h +++ b/drivers/mmc/sdhci.h | |||
@@ -149,6 +149,10 @@ | |||
149 | #define SDHCI_SLOT_INT_STATUS 0xFC | 149 | #define SDHCI_SLOT_INT_STATUS 0xFC |
150 | 150 | ||
151 | #define SDHCI_HOST_VERSION 0xFE | 151 | #define SDHCI_HOST_VERSION 0xFE |
152 | #define SDHCI_VENDOR_VER_MASK 0xFF00 | ||
153 | #define SDHCI_VENDOR_VER_SHIFT 8 | ||
154 | #define SDHCI_SPEC_VER_MASK 0x00FF | ||
155 | #define SDHCI_SPEC_VER_SHIFT 0 | ||
152 | 156 | ||
153 | struct sdhci_chip; | 157 | struct sdhci_chip; |
154 | 158 | ||