diff options
author | Kevin Hilman <khilman@deeprootsystems.com> | 2009-05-11 18:55:03 -0400 |
---|---|---|
committer | Kevin Hilman <khilman@deeprootsystems.com> | 2009-05-26 10:18:16 -0400 |
commit | 2dbf56aeb7986b54651c93ed171877e8179289bc (patch) | |
tree | ecdc2e340ed799a884812abb200aac23279cb79b /arch/arm/mach-davinci/board-dm355-leopard.c | |
parent | 35652fe1858e664707cfa32e80547b210cc41f78 (diff) |
davinci: MMC platform support
Add SoC and platform-specific data and init for MMC driver.
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
Diffstat (limited to 'arch/arm/mach-davinci/board-dm355-leopard.c')
-rw-r--r-- | arch/arm/mach-davinci/board-dm355-leopard.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/arch/arm/mach-davinci/board-dm355-leopard.c b/arch/arm/mach-davinci/board-dm355-leopard.c index 22f16f38a0ba..d4562f5ff93b 100644 --- a/arch/arm/mach-davinci/board-dm355-leopard.c +++ b/arch/arm/mach-davinci/board-dm355-leopard.c | |||
@@ -35,6 +35,7 @@ | |||
35 | #include <mach/i2c.h> | 35 | #include <mach/i2c.h> |
36 | #include <mach/serial.h> | 36 | #include <mach/serial.h> |
37 | #include <mach/nand.h> | 37 | #include <mach/nand.h> |
38 | #include <mach/mmc.h> | ||
38 | 39 | ||
39 | #define DAVINCI_ASYNC_EMIF_CONTROL_BASE 0x01e10000 | 40 | #define DAVINCI_ASYNC_EMIF_CONTROL_BASE 0x01e10000 |
40 | #define DAVINCI_ASYNC_EMIF_DATA_CE0_BASE 0x02000000 | 41 | #define DAVINCI_ASYNC_EMIF_DATA_CE0_BASE 0x02000000 |
@@ -190,6 +191,30 @@ static void __init dm355_leopard_map_io(void) | |||
190 | dm355_init(); | 191 | dm355_init(); |
191 | } | 192 | } |
192 | 193 | ||
194 | static int dm355leopard_mmc_get_cd(int module) | ||
195 | { | ||
196 | if (!gpio_is_valid(leopard_mmc_gpio)) | ||
197 | return -ENXIO; | ||
198 | /* low == card present */ | ||
199 | return !gpio_get_value_cansleep(leopard_mmc_gpio + 2 * module + 1); | ||
200 | } | ||
201 | |||
202 | static int dm355leopard_mmc_get_ro(int module) | ||
203 | { | ||
204 | if (!gpio_is_valid(leopard_mmc_gpio)) | ||
205 | return -ENXIO; | ||
206 | /* high == card's write protect switch active */ | ||
207 | return gpio_get_value_cansleep(leopard_mmc_gpio + 2 * module + 0); | ||
208 | } | ||
209 | |||
210 | static struct davinci_mmc_config dm355leopard_mmc_config = { | ||
211 | .get_cd = dm355leopard_mmc_get_cd, | ||
212 | .get_ro = dm355leopard_mmc_get_ro, | ||
213 | .wires = 4, | ||
214 | .max_freq = 50000000, | ||
215 | .caps = MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED, | ||
216 | }; | ||
217 | |||
193 | /* Don't connect anything to J10 unless you're only using USB host | 218 | /* Don't connect anything to J10 unless you're only using USB host |
194 | * mode *and* have to do so with some kind of gender-bender. If | 219 | * mode *and* have to do so with some kind of gender-bender. If |
195 | * you have proper Mini-B or Mini-A cables (or Mini-A adapters) | 220 | * you have proper Mini-B or Mini-A cables (or Mini-A adapters) |
@@ -248,6 +273,9 @@ static __init void dm355_leopard_init(void) | |||
248 | /* irlml6401 switches over 1A in under 8 msec */ | 273 | /* irlml6401 switches over 1A in under 8 msec */ |
249 | setup_usb(500, 8); | 274 | setup_usb(500, 8); |
250 | 275 | ||
276 | davinci_setup_mmc(0, &dm355leopard_mmc_config); | ||
277 | davinci_setup_mmc(1, &dm355leopard_mmc_config); | ||
278 | |||
251 | dm355_init_spi0(BIT(0), dm355_leopard_spi_info, | 279 | dm355_init_spi0(BIT(0), dm355_leopard_spi_info, |
252 | ARRAY_SIZE(dm355_leopard_spi_info)); | 280 | ARRAY_SIZE(dm355_leopard_spi_info)); |
253 | } | 281 | } |