aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-shmobile/board-armadillo800eva.c
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2012-04-24 05:09:19 -0400
committerRafael J. Wysocki <rjw@sisk.pl>2012-05-12 16:33:06 -0400
commit49c01112d6afdb679276c172ffcd4f1205c1ff97 (patch)
tree4d699c975062a315e5318fd9fd38cc71c94446ce /arch/arm/mach-shmobile/board-armadillo800eva.c
parent1c96293e9f8b8ec9620201bcf7f776f0e0f89edb (diff)
ARM: mach-shmobile: armadillo800eva: add SDHI0 support
On armadillo800eva board, CD (= Card Detect) pin is not connected to SDHI0_CD. Then, we can use IRQ31 as card detect irq, but it needs chattering removal operation. We should use IRQ card detect in the future, but this patch use polling mode at this point. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Tested-by: Simon Horman <horms@verge.net.au> Acked-by: Magnus Damm <damm@opensource.se> Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Diffstat (limited to 'arch/arm/mach-shmobile/board-armadillo800eva.c')
-rw-r--r--arch/arm/mach-shmobile/board-armadillo800eva.c71
1 files changed, 71 insertions, 0 deletions
diff --git a/arch/arm/mach-shmobile/board-armadillo800eva.c b/arch/arm/mach-shmobile/board-armadillo800eva.c
index 1d25d5fee60..ed8568635bc 100644
--- a/arch/arm/mach-shmobile/board-armadillo800eva.c
+++ b/arch/arm/mach-shmobile/board-armadillo800eva.c
@@ -31,6 +31,9 @@
31#include <linux/sh_eth.h> 31#include <linux/sh_eth.h>
32#include <linux/videodev2.h> 32#include <linux/videodev2.h>
33#include <linux/usb/renesas_usbhs.h> 33#include <linux/usb/renesas_usbhs.h>
34#include <linux/mfd/tmio.h>
35#include <linux/mmc/host.h>
36#include <linux/mmc/sh_mobile_sdhi.h>
34#include <mach/common.h> 37#include <mach/common.h>
35#include <mach/irqs.h> 38#include <mach/irqs.h>
36#include <asm/page.h> 39#include <asm/page.h>
@@ -402,6 +405,55 @@ static struct platform_device gpio_keys_device = {
402 }, 405 },
403}; 406};
404 407
408/* SDHI0 */
409/*
410 * FIXME
411 *
412 * It use polling mode here, since
413 * CD (= Card Detect) pin is not connected to SDHI0_CD.
414 * We can use IRQ31 as card detect irq,
415 * but it needs chattering removal operation
416 */
417#define IRQ31 evt2irq(0x33E0)
418static struct sh_mobile_sdhi_info sdhi0_info = {
419 .tmio_caps = MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ |\
420 MMC_CAP_NEEDS_POLL,
421 .tmio_ocr_mask = MMC_VDD_165_195 | MMC_VDD_32_33 | MMC_VDD_33_34,
422 .tmio_flags = TMIO_MMC_HAS_IDLE_WAIT,
423};
424
425static struct resource sdhi0_resources[] = {
426 {
427 .name = "SDHI0",
428 .start = 0xe6850000,
429 .end = 0xe6850100 - 1,
430 .flags = IORESOURCE_MEM,
431 },
432 /*
433 * no SH_MOBILE_SDHI_IRQ_CARD_DETECT here
434 */
435 {
436 .name = SH_MOBILE_SDHI_IRQ_SDCARD,
437 .start = evt2irq(0x0E20),
438 .flags = IORESOURCE_IRQ,
439 },
440 {
441 .name = SH_MOBILE_SDHI_IRQ_SDIO,
442 .start = evt2irq(0x0E40),
443 .flags = IORESOURCE_IRQ,
444 },
445};
446
447static struct platform_device sdhi0_device = {
448 .name = "sh_mobile_sdhi",
449 .id = 0,
450 .dev = {
451 .platform_data = &sdhi0_info,
452 },
453 .num_resources = ARRAY_SIZE(sdhi0_resources),
454 .resource = sdhi0_resources,
455};
456
405/* I2C */ 457/* I2C */
406static struct i2c_board_info i2c0_devices[] = { 458static struct i2c_board_info i2c0_devices[] = {
407 { 459 {
@@ -417,6 +469,7 @@ static struct platform_device *eva_devices[] __initdata = {
417 &lcdc0_device, 469 &lcdc0_device,
418 &gpio_keys_device, 470 &gpio_keys_device,
419 &sh_eth_device, 471 &sh_eth_device,
472 &sdhi0_device,
420}; 473};
421 474
422static void __init eva_clock_init(void) 475static void __init eva_clock_init(void)
@@ -539,6 +592,24 @@ static void __init eva_init(void)
539 platform_device_register(&usbhsf_device); 592 platform_device_register(&usbhsf_device);
540 } 593 }
541 594
595 /* SDHI0 */
596 gpio_request(GPIO_FN_SDHI0_CMD, NULL);
597 gpio_request(GPIO_FN_SDHI0_CLK, NULL);
598 gpio_request(GPIO_FN_SDHI0_D0, NULL);
599 gpio_request(GPIO_FN_SDHI0_D1, NULL);
600 gpio_request(GPIO_FN_SDHI0_D2, NULL);
601 gpio_request(GPIO_FN_SDHI0_D3, NULL);
602 gpio_request(GPIO_FN_SDHI0_WP, NULL);
603
604 gpio_request(GPIO_PORT17, NULL); /* SDHI0_18/33_B */
605 gpio_request(GPIO_PORT74, NULL); /* SDHI0_PON */
606 gpio_request(GPIO_PORT75, NULL); /* SDSLOT1_PON */
607 gpio_direction_output(GPIO_PORT17, 0);
608 gpio_direction_output(GPIO_PORT74, 1);
609 gpio_direction_output(GPIO_PORT75, 1);
610
611 /* we can use GPIO_FN_IRQ31_PORT167 here for SDHI0 CD irq */
612
542 /* 613 /*
543 * CAUTION 614 * CAUTION
544 * 615 *