aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-davinci/board-dm355-evm.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-davinci/board-dm355-evm.c')
-rw-r--r--arch/arm/mach-davinci/board-dm355-evm.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/arch/arm/mach-davinci/board-dm355-evm.c b/arch/arm/mach-davinci/board-dm355-evm.c
index 6af3c6c863ab..087441313dd7 100644
--- a/arch/arm/mach-davinci/board-dm355-evm.c
+++ b/arch/arm/mach-davinci/board-dm355-evm.c
@@ -36,6 +36,7 @@
36#include <mach/i2c.h> 36#include <mach/i2c.h>
37#include <mach/serial.h> 37#include <mach/serial.h>
38#include <mach/nand.h> 38#include <mach/nand.h>
39#include <mach/mmc.h>
39 40
40#define DAVINCI_ASYNC_EMIF_CONTROL_BASE 0x01e10000 41#define DAVINCI_ASYNC_EMIF_CONTROL_BASE 0x01e10000
41#define DAVINCI_ASYNC_EMIF_DATA_CE0_BASE 0x02000000 42#define DAVINCI_ASYNC_EMIF_DATA_CE0_BASE 0x02000000
@@ -191,6 +192,31 @@ static void __init dm355_evm_map_io(void)
191 dm355_init(); 192 dm355_init();
192} 193}
193 194
195static int dm355evm_mmc_get_cd(int module)
196{
197 if (!gpio_is_valid(dm355evm_mmc_gpios))
198 return -ENXIO;
199 /* low == card present */
200 return !gpio_get_value_cansleep(dm355evm_mmc_gpios + 2 * module + 1);
201}
202
203static int dm355evm_mmc_get_ro(int module)
204{
205 if (!gpio_is_valid(dm355evm_mmc_gpios))
206 return -ENXIO;
207 /* high == card's write protect switch active */
208 return gpio_get_value_cansleep(dm355evm_mmc_gpios + 2 * module + 0);
209}
210
211static struct davinci_mmc_config dm355evm_mmc_config = {
212 .get_cd = dm355evm_mmc_get_cd,
213 .get_ro = dm355evm_mmc_get_ro,
214 .wires = 4,
215 .max_freq = 50000000,
216 .caps = MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED,
217 .version = MMC_CTLR_VERSION_1,
218};
219
194/* Don't connect anything to J10 unless you're only using USB host 220/* Don't connect anything to J10 unless you're only using USB host
195 * mode *and* have to do so with some kind of gender-bender. If 221 * mode *and* have to do so with some kind of gender-bender. If
196 * you have proper Mini-B or Mini-A cables (or Mini-A adapters) 222 * you have proper Mini-B or Mini-A cables (or Mini-A adapters)
@@ -249,6 +275,9 @@ static __init void dm355_evm_init(void)
249 /* irlml6401 switches over 1A in under 8 msec */ 275 /* irlml6401 switches over 1A in under 8 msec */
250 setup_usb(500, 8); 276 setup_usb(500, 8);
251 277
278 davinci_setup_mmc(0, &dm355evm_mmc_config);
279 davinci_setup_mmc(1, &dm355evm_mmc_config);
280
252 dm355_init_spi0(BIT(0), dm355_evm_spi_info, 281 dm355_init_spi0(BIT(0), dm355_evm_spi_info,
253 ARRAY_SIZE(dm355_evm_spi_info)); 282 ARRAY_SIZE(dm355_evm_spi_info));
254} 283}