summaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-davinci/board-dm355-evm.c
diff options
context:
space:
mode:
authorKevin Hilman <khilman@deeprootsystems.com>2009-05-11 15:55:03 -0700
committerKevin Hilman <khilman@deeprootsystems.com>2009-05-26 07:18:16 -0700
commit2dbf56aeb7986b54651c93ed171877e8179289bc (patch)
treeecdc2e340ed799a884812abb200aac23279cb79b /arch/arm/mach-davinci/board-dm355-evm.c
parent35652fe1858e664707cfa32e80547b210cc41f78 (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-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 6af3c6c863a..087441313dd 100644
--- a/arch/arm/mach-davinci/board-dm355-evm.c
+++ b/arch/arm/mach-davinci/board-dm355-evm.c
@@ -36,6 +36,7 @@
#include <mach/i2c.h>
#include <mach/serial.h>
#include <mach/nand.h>
+#include <mach/mmc.h>
#define DAVINCI_ASYNC_EMIF_CONTROL_BASE 0x01e10000
#define DAVINCI_ASYNC_EMIF_DATA_CE0_BASE 0x02000000
@@ -191,6 +192,31 @@ static void __init dm355_evm_map_io(void)
dm355_init();
}
+static int dm355evm_mmc_get_cd(int module)
+{
+ if (!gpio_is_valid(dm355evm_mmc_gpios))
+ return -ENXIO;
+ /* low == card present */
+ return !gpio_get_value_cansleep(dm355evm_mmc_gpios + 2 * module + 1);
+}
+
+static int dm355evm_mmc_get_ro(int module)
+{
+ if (!gpio_is_valid(dm355evm_mmc_gpios))
+ return -ENXIO;
+ /* high == card's write protect switch active */
+ return gpio_get_value_cansleep(dm355evm_mmc_gpios + 2 * module + 0);
+}
+
+static struct davinci_mmc_config dm355evm_mmc_config = {
+ .get_cd = dm355evm_mmc_get_cd,
+ .get_ro = dm355evm_mmc_get_ro,
+ .wires = 4,
+ .max_freq = 50000000,
+ .caps = MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED,
+ .version = MMC_CTLR_VERSION_1,
+};
+
/* Don't connect anything to J10 unless you're only using USB host
* mode *and* have to do so with some kind of gender-bender. If
* you have proper Mini-B or Mini-A cables (or Mini-A adapters)
@@ -249,6 +275,9 @@ static __init void dm355_evm_init(void)
/* irlml6401 switches over 1A in under 8 msec */
setup_usb(500, 8);
+ davinci_setup_mmc(0, &dm355evm_mmc_config);
+ davinci_setup_mmc(1, &dm355evm_mmc_config);
+
dm355_init_spi0(BIT(0), dm355_evm_spi_info,
ARRAY_SIZE(dm355_evm_spi_info));
}