diff options
| -rw-r--r-- | drivers/mmc/host/Kconfig | 13 | ||||
| -rw-r--r-- | drivers/mmc/host/Makefile | 1 | ||||
| -rw-r--r-- | drivers/mmc/host/sdhci-of-core.c | 3 | ||||
| -rw-r--r-- | drivers/mmc/host/sdhci-of-hlwd.c | 65 | ||||
| -rw-r--r-- | drivers/mmc/host/sdhci-of.h | 1 |
5 files changed, 82 insertions, 1 deletions
diff --git a/drivers/mmc/host/Kconfig b/drivers/mmc/host/Kconfig index d9234648199a..ce1d28884e29 100644 --- a/drivers/mmc/host/Kconfig +++ b/drivers/mmc/host/Kconfig | |||
| @@ -55,7 +55,7 @@ config MMC_SDHCI_BIG_ENDIAN_32BIT_BYTE_SWAPPER | |||
| 55 | has the effect of scrambling the addresses and formats of data | 55 | has the effect of scrambling the addresses and formats of data |
| 56 | accessed in sizes other than the datum size. | 56 | accessed in sizes other than the datum size. |
| 57 | 57 | ||
| 58 | This is the case for the Freescale eSDHC. | 58 | This is the case for the Freescale eSDHC and Nintendo Wii SDHCI. |
| 59 | 59 | ||
| 60 | config MMC_SDHCI_PCI | 60 | config MMC_SDHCI_PCI |
| 61 | tristate "SDHCI support on PCI bus" | 61 | tristate "SDHCI support on PCI bus" |
| @@ -103,6 +103,17 @@ config MMC_SDHCI_OF_ESDHC | |||
| 103 | 103 | ||
| 104 | If unsure, say N. | 104 | If unsure, say N. |
| 105 | 105 | ||
| 106 | config MMC_SDHCI_OF_HLWD | ||
| 107 | bool "SDHCI OF support for the Nintendo Wii SDHCI controllers" | ||
| 108 | depends on MMC_SDHCI_OF | ||
| 109 | select MMC_SDHCI_BIG_ENDIAN_32BIT_BYTE_SWAPPER | ||
| 110 | help | ||
| 111 | This selects the Secure Digital Host Controller Interface (SDHCI) | ||
| 112 | found in the "Hollywood" chipset of the Nintendo Wii video game | ||
| 113 | console. | ||
| 114 | |||
| 115 | If unsure, say N. | ||
| 116 | |||
| 106 | config MMC_SDHCI_PLTFM | 117 | config MMC_SDHCI_PLTFM |
| 107 | tristate "SDHCI support on the platform specific bus" | 118 | tristate "SDHCI support on the platform specific bus" |
| 108 | depends on MMC_SDHCI | 119 | depends on MMC_SDHCI |
diff --git a/drivers/mmc/host/Makefile b/drivers/mmc/host/Makefile index cbda9b2b912b..3d253dd4240f 100644 --- a/drivers/mmc/host/Makefile +++ b/drivers/mmc/host/Makefile | |||
| @@ -39,6 +39,7 @@ obj-$(CONFIG_SDH_BFIN) += bfin_sdh.o | |||
| 39 | obj-$(CONFIG_MMC_SDHCI_OF) += sdhci-of.o | 39 | obj-$(CONFIG_MMC_SDHCI_OF) += sdhci-of.o |
| 40 | sdhci-of-y := sdhci-of-core.o | 40 | sdhci-of-y := sdhci-of-core.o |
| 41 | sdhci-of-$(CONFIG_MMC_SDHCI_OF_ESDHC) += sdhci-of-esdhc.o | 41 | sdhci-of-$(CONFIG_MMC_SDHCI_OF_ESDHC) += sdhci-of-esdhc.o |
| 42 | sdhci-of-$(CONFIG_MMC_SDHCI_OF_HLWD) += sdhci-of-hlwd.o | ||
| 42 | 43 | ||
| 43 | ifeq ($(CONFIG_CB710_DEBUG),y) | 44 | ifeq ($(CONFIG_CB710_DEBUG),y) |
| 44 | CFLAGS-cb710-mmc += -DDEBUG | 45 | CFLAGS-cb710-mmc += -DDEBUG |
diff --git a/drivers/mmc/host/sdhci-of-core.c b/drivers/mmc/host/sdhci-of-core.c index add2008d890d..55e33135edb4 100644 --- a/drivers/mmc/host/sdhci-of-core.c +++ b/drivers/mmc/host/sdhci-of-core.c | |||
| @@ -196,6 +196,9 @@ static const struct of_device_id sdhci_of_match[] = { | |||
| 196 | { .compatible = "fsl,mpc8536-esdhc", .data = &sdhci_esdhc, }, | 196 | { .compatible = "fsl,mpc8536-esdhc", .data = &sdhci_esdhc, }, |
| 197 | { .compatible = "fsl,esdhc", .data = &sdhci_esdhc, }, | 197 | { .compatible = "fsl,esdhc", .data = &sdhci_esdhc, }, |
| 198 | #endif | 198 | #endif |
| 199 | #ifdef CONFIG_MMC_SDHCI_OF_HLWD | ||
| 200 | { .compatible = "nintendo,hollywood-sdhci", .data = &sdhci_hlwd, }, | ||
| 201 | #endif | ||
| 199 | { .compatible = "generic-sdhci", }, | 202 | { .compatible = "generic-sdhci", }, |
| 200 | {}, | 203 | {}, |
| 201 | }; | 204 | }; |
diff --git a/drivers/mmc/host/sdhci-of-hlwd.c b/drivers/mmc/host/sdhci-of-hlwd.c new file mode 100644 index 000000000000..35117f3ed757 --- /dev/null +++ b/drivers/mmc/host/sdhci-of-hlwd.c | |||
| @@ -0,0 +1,65 @@ | |||
| 1 | /* | ||
| 2 | * drivers/mmc/host/sdhci-of-hlwd.c | ||
| 3 | * | ||
| 4 | * Nintendo Wii Secure Digital Host Controller Interface. | ||
| 5 | * Copyright (C) 2009 The GameCube Linux Team | ||
| 6 | * Copyright (C) 2009 Albert Herranz | ||
| 7 | * | ||
| 8 | * Based on sdhci-of-esdhc.c | ||
| 9 | * | ||
| 10 | * Copyright (c) 2007 Freescale Semiconductor, Inc. | ||
| 11 | * Copyright (c) 2009 MontaVista Software, Inc. | ||
| 12 | * | ||
| 13 | * Authors: Xiaobo Xie <X.Xie@freescale.com> | ||
| 14 | * Anton Vorontsov <avorontsov@ru.mvista.com> | ||
| 15 | * | ||
| 16 | * This program is free software; you can redistribute it and/or modify | ||
| 17 | * it under the terms of the GNU General Public License as published by | ||
| 18 | * the Free Software Foundation; either version 2 of the License, or (at | ||
| 19 | * your option) any later version. | ||
| 20 | */ | ||
| 21 | |||
| 22 | #include <linux/delay.h> | ||
| 23 | #include <linux/mmc/host.h> | ||
| 24 | #include "sdhci-of.h" | ||
| 25 | #include "sdhci.h" | ||
| 26 | |||
| 27 | /* | ||
| 28 | * Ops and quirks for the Nintendo Wii SDHCI controllers. | ||
| 29 | */ | ||
| 30 | |||
| 31 | /* | ||
| 32 | * We need a small delay after each write, or things go horribly wrong. | ||
| 33 | */ | ||
| 34 | #define SDHCI_HLWD_WRITE_DELAY 5 /* usecs */ | ||
| 35 | |||
| 36 | static void sdhci_hlwd_writel(struct sdhci_host *host, u32 val, int reg) | ||
| 37 | { | ||
| 38 | sdhci_be32bs_writel(host, val, reg); | ||
| 39 | udelay(SDHCI_HLWD_WRITE_DELAY); | ||
| 40 | } | ||
| 41 | |||
| 42 | static void sdhci_hlwd_writew(struct sdhci_host *host, u16 val, int reg) | ||
| 43 | { | ||
| 44 | sdhci_be32bs_writew(host, val, reg); | ||
| 45 | udelay(SDHCI_HLWD_WRITE_DELAY); | ||
| 46 | } | ||
| 47 | |||
| 48 | static void sdhci_hlwd_writeb(struct sdhci_host *host, u8 val, int reg) | ||
| 49 | { | ||
| 50 | sdhci_be32bs_writeb(host, val, reg); | ||
| 51 | udelay(SDHCI_HLWD_WRITE_DELAY); | ||
| 52 | } | ||
| 53 | |||
| 54 | struct sdhci_of_data sdhci_hlwd = { | ||
| 55 | .quirks = SDHCI_QUIRK_32BIT_DMA_ADDR | | ||
| 56 | SDHCI_QUIRK_32BIT_DMA_SIZE, | ||
| 57 | .ops = { | ||
| 58 | .readl = sdhci_be32bs_readl, | ||
| 59 | .readw = sdhci_be32bs_readw, | ||
| 60 | .readb = sdhci_be32bs_readb, | ||
| 61 | .writel = sdhci_hlwd_writel, | ||
| 62 | .writew = sdhci_hlwd_writew, | ||
| 63 | .writeb = sdhci_hlwd_writeb, | ||
| 64 | }, | ||
| 65 | }; | ||
diff --git a/drivers/mmc/host/sdhci-of.h b/drivers/mmc/host/sdhci-of.h index 17e873d3baaf..ad09ad9915d8 100644 --- a/drivers/mmc/host/sdhci-of.h +++ b/drivers/mmc/host/sdhci-of.h | |||
| @@ -37,5 +37,6 @@ extern void sdhci_be32bs_writew(struct sdhci_host *host, u16 val, int reg); | |||
| 37 | extern void sdhci_be32bs_writeb(struct sdhci_host *host, u8 val, int reg); | 37 | extern void sdhci_be32bs_writeb(struct sdhci_host *host, u8 val, int reg); |
| 38 | 38 | ||
| 39 | extern struct sdhci_of_data sdhci_esdhc; | 39 | extern struct sdhci_of_data sdhci_esdhc; |
| 40 | extern struct sdhci_of_data sdhci_hlwd; | ||
| 40 | 41 | ||
| 41 | #endif /* __SDHCI_OF_H */ | 42 | #endif /* __SDHCI_OF_H */ |
