[SDHCI] Initialise Marvell CAFÉ controller with/without write-protect
David Woodhouse
dwmw2 at infradead.org
Tue Nov 7 22:38:30 EST 2006
Commit: 66b92381533d570263ea8c709049859229e408ff
Parent: bb5ae6ddf2ff42502d52d3cae843ba59589fff29
commit 66b92381533d570263ea8c709049859229e408ff
Author: David Woodhouse <dwmw2 at infradead.org>
AuthorDate: Fri Nov 3 11:10:50 2006 +0800
Commit: David Woodhouse <dwmw2 at infradead.org>
CommitDate: Fri Nov 3 11:10:50 2006 +0800
[SDHCI] Initialise Marvell CAFÉ controller with/without write-protect
Signed-off-by: David Woodhouse <dwmw2 at infradead.org>
---
drivers/mmc/sdhci.c | 21 ++++++++++++++++-----
1 files changed, 16 insertions(+), 5 deletions(-)
diff --git a/drivers/mmc/sdhci.c b/drivers/mmc/sdhci.c
index daafb82..5ad520d 100644
--- a/drivers/mmc/sdhci.c
+++ b/drivers/mmc/sdhci.c
@@ -156,17 +156,28 @@ static void sdhci_reset(struct sdhci_hos
}
}
+static int cafe_wp;
+module_param(cafe_wp, int, 0444);
+
static void sdhci_init(struct sdhci_host *host)
{
u32 intmask;
sdhci_reset(host, SDHCI_RESET_ALL);
- /* write bits to some magic register to turn on the device;
- * FIXME: this should only be done for CAFE chip! -dilinger */
- writeb(0x06, host->ioaddr + 0x3038);
- writel(0x60006, host->ioaddr + 0x315C);
- /* XXX: any delays necessary? */
+ if (host->chip->pdev->vendor == 0x11ab &&
+ host->chip->pdev->device == 0x4101) {
+ /* Marvell CAFÉ controller --
+ Write bits to some magic register to turn on the device. */
+ if (cafe_wp) {
+ writeb(0x04, host->ioaddr + 0x3038);
+ writel(0x40004, host->ioaddr + 0x315C);
+ } else {
+ writeb(0x06, host->ioaddr + 0x3038);
+ writel(0x60006, host->ioaddr + 0x315C);
+ }
+ /* XXX: any delays necessary? */
+ }
intmask = SDHCI_INT_BUS_POWER | SDHCI_INT_DATA_END_BIT |
SDHCI_INT_DATA_CRC | SDHCI_INT_DATA_TIMEOUT | SDHCI_INT_INDEX |
More information about the Commits-kernel
mailing list