diff options
author | Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> | 2010-05-12 21:08:21 -0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2010-05-31 00:43:26 -0400 |
commit | c8ee3d4b5f9de761d65a588b5f243a7a7c01a722 (patch) | |
tree | dbf56366616a3724b775cb6de7847c0727240805 /arch/arm/mach-shmobile | |
parent | cb9215e1fa13860fa8fbe9941a59fcbc45781373 (diff) |
ARM: mach-shmobile: ap4evb: Add MMC support
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/arm/mach-shmobile')
-rw-r--r-- | arch/arm/mach-shmobile/board-ap4evb.c | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/arch/arm/mach-shmobile/board-ap4evb.c b/arch/arm/mach-shmobile/board-ap4evb.c index 8fb51f5157f9..8e8a6fb213fd 100644 --- a/arch/arm/mach-shmobile/board-ap4evb.c +++ b/arch/arm/mach-shmobile/board-ap4evb.c | |||
@@ -28,6 +28,8 @@ | |||
28 | #include <linux/mtd/mtd.h> | 28 | #include <linux/mtd/mtd.h> |
29 | #include <linux/mtd/partitions.h> | 29 | #include <linux/mtd/partitions.h> |
30 | #include <linux/mtd/physmap.h> | 30 | #include <linux/mtd/physmap.h> |
31 | #include <linux/mmc/host.h> | ||
32 | #include <linux/mmc/sh_mmcif.h> | ||
31 | #include <linux/i2c.h> | 33 | #include <linux/i2c.h> |
32 | #include <linux/i2c/tsc2007.h> | 34 | #include <linux/i2c/tsc2007.h> |
33 | #include <linux/io.h> | 35 | #include <linux/io.h> |
@@ -124,6 +126,18 @@ | |||
124 | * : OFF : Bluetooth Audio Mode | 126 | * : OFF : Bluetooth Audio Mode |
125 | */ | 127 | */ |
126 | 128 | ||
129 | /* | ||
130 | * MMC (CN7) | ||
131 | * | ||
132 | * J22 : 1-2: 1.8v for MMC | ||
133 | * 2-3: 3.3v for MMC | ||
134 | * SW1 : OFF | ||
135 | * SW33: bit1: OFF | ||
136 | * bit2: ON | ||
137 | * bit3: ON | ||
138 | * bit4: X | ||
139 | */ | ||
140 | |||
127 | /* MTD */ | 141 | /* MTD */ |
128 | static struct mtd_partition nor_flash_partitions[] = { | 142 | static struct mtd_partition nor_flash_partitions[] = { |
129 | { | 143 | { |
@@ -242,6 +256,46 @@ static struct platform_device keysc_device = { | |||
242 | }, | 256 | }, |
243 | }; | 257 | }; |
244 | 258 | ||
259 | /* SH_MMCIF */ | ||
260 | static struct resource sh_mmcif_resources[] = { | ||
261 | [0] = { | ||
262 | .name = "SH_MMCIF", | ||
263 | .start = 0xE6BD0000, | ||
264 | .end = 0xE6BD00FF, | ||
265 | .flags = IORESOURCE_MEM, | ||
266 | }, | ||
267 | [1] = { | ||
268 | /* MMC ERR */ | ||
269 | .start = 198, | ||
270 | .flags = IORESOURCE_IRQ, | ||
271 | }, | ||
272 | [2] = { | ||
273 | /* MMC NOR */ | ||
274 | .start = 199, | ||
275 | .flags = IORESOURCE_IRQ, | ||
276 | }, | ||
277 | }; | ||
278 | |||
279 | struct sh_mmcif_plat_data sh_mmcif_plat = { | ||
280 | .sup_pclk = 0, | ||
281 | .ocr = MMC_VDD_165_195 | MMC_VDD_32_33 | MMC_VDD_33_34, | ||
282 | .caps = MMC_CAP_4_BIT_DATA | | ||
283 | MMC_CAP_8_BIT_DATA | | ||
284 | MMC_CAP_NEEDS_POLL, | ||
285 | }; | ||
286 | |||
287 | static struct platform_device sh_mmcif_device = { | ||
288 | .name = "sh_mmcif", | ||
289 | .id = 0, | ||
290 | .dev = { | ||
291 | .dma_mask = NULL, | ||
292 | .coherent_dma_mask = 0xffffffff, | ||
293 | .platform_data = &sh_mmcif_plat, | ||
294 | }, | ||
295 | .num_resources = ARRAY_SIZE(sh_mmcif_resources), | ||
296 | .resource = sh_mmcif_resources, | ||
297 | }; | ||
298 | |||
245 | /* SDHI0 */ | 299 | /* SDHI0 */ |
246 | static struct sh_mobile_sdhi_info sdhi0_info = { | 300 | static struct sh_mobile_sdhi_info sdhi0_info = { |
247 | .dma_slave_tx = SHDMA_SLAVE_SDHI0_TX, | 301 | .dma_slave_tx = SHDMA_SLAVE_SDHI0_TX, |
@@ -447,6 +501,7 @@ static struct platform_device *ap4evb_devices[] __initdata = { | |||
447 | &lcdc_device, | 501 | &lcdc_device, |
448 | &mipidsi0_device, | 502 | &mipidsi0_device, |
449 | &fsi_device, | 503 | &fsi_device, |
504 | &sh_mmcif_device | ||
450 | }; | 505 | }; |
451 | 506 | ||
452 | /* TouchScreen (Needs SW3 set to OFF) */ | 507 | /* TouchScreen (Needs SW3 set to OFF) */ |
@@ -620,6 +675,18 @@ static void __init ap4evb_init(void) | |||
620 | gpio_request(GPIO_FN_IRQ28_123, NULL); | 675 | gpio_request(GPIO_FN_IRQ28_123, NULL); |
621 | set_irq_type(IRQ28, IRQ_TYPE_LEVEL_LOW); | 676 | set_irq_type(IRQ28, IRQ_TYPE_LEVEL_LOW); |
622 | 677 | ||
678 | /* MMCIF */ | ||
679 | gpio_request(GPIO_FN_MMCD0_0, NULL); | ||
680 | gpio_request(GPIO_FN_MMCD0_1, NULL); | ||
681 | gpio_request(GPIO_FN_MMCD0_2, NULL); | ||
682 | gpio_request(GPIO_FN_MMCD0_3, NULL); | ||
683 | gpio_request(GPIO_FN_MMCD0_4, NULL); | ||
684 | gpio_request(GPIO_FN_MMCD0_5, NULL); | ||
685 | gpio_request(GPIO_FN_MMCD0_6, NULL); | ||
686 | gpio_request(GPIO_FN_MMCD0_7, NULL); | ||
687 | gpio_request(GPIO_FN_MMCCMD0, NULL); | ||
688 | gpio_request(GPIO_FN_MMCCLK0, NULL); | ||
689 | |||
623 | /* USB enable */ | 690 | /* USB enable */ |
624 | gpio_request(GPIO_FN_VBUS0_1, NULL); | 691 | gpio_request(GPIO_FN_VBUS0_1, NULL); |
625 | gpio_request(GPIO_FN_IDIN_1_18, NULL); | 692 | gpio_request(GPIO_FN_IDIN_1_18, NULL); |