aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-shmobile/board-mackerel.c
diff options
context:
space:
mode:
authorYusuke Goda <yusuke.goda.sx@renesas.com>2010-12-15 03:31:04 -0500
committerPaul Mundt <lethal@linux-sh.org>2010-12-17 05:46:31 -0500
commit41491b9adc6ba47b73100991e9295ae70c58db0f (patch)
tree26ebb5ecdc2b24980ad3a0f4384bcf325c6b6794 /arch/arm/mach-shmobile/board-mackerel.c
parent6dff7da2adbba9c5cd1b3a3f67191fe3471c663c (diff)
ARM: mach-shmobile: mackerel: Add mmcif support
v2 Add comment of J22 and OCR field. Signed-off-by: Yusuke Goda <yusuke.goda.sx@renesas.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/arm/mach-shmobile/board-mackerel.c')
-rw-r--r--arch/arm/mach-shmobile/board-mackerel.c67
1 files changed, 66 insertions, 1 deletions
diff --git a/arch/arm/mach-shmobile/board-mackerel.c b/arch/arm/mach-shmobile/board-mackerel.c
index f62f9b9ea5f2..fd46f067e8b2 100644
--- a/arch/arm/mach-shmobile/board-mackerel.c
+++ b/arch/arm/mach-shmobile/board-mackerel.c
@@ -34,6 +34,7 @@
34#include <linux/mfd/sh_mobile_sdhi.h> 34#include <linux/mfd/sh_mobile_sdhi.h>
35#include <linux/mfd/tmio.h> 35#include <linux/mfd/tmio.h>
36#include <linux/mmc/host.h> 36#include <linux/mmc/host.h>
37#include <linux/mmc/sh_mmcif.h>
37#include <linux/mtd/mtd.h> 38#include <linux/mtd/mtd.h>
38#include <linux/mtd/partitions.h> 39#include <linux/mtd/partitions.h>
39#include <linux/mtd/physmap.h> 40#include <linux/mtd/physmap.h>
@@ -153,10 +154,14 @@
153 * I/O voltage : 1.8v 154 * I/O voltage : 1.8v
154 * 155 *
155 * Power voltage : 1.8v or 3.3v 156 * Power voltage : 1.8v or 3.3v
156 * J22 : select power voltage 157 * J22 : select power voltage *1
157 * 1-2 pin : 1.8v 158 * 1-2 pin : 1.8v
158 * 2-3 pin : 3.3v 159 * 2-3 pin : 3.3v
159 * 160 *
161 * *1
162 * Please change J22 depends the card to be used.
163 * MMC's OCR field set to support either voltage for the card inserted.
164 *
160 * SW1 | SW33 165 * SW1 | SW33
161 * | bit1 | bit2 | bit3 | bit4 166 * | bit1 | bit2 | bit3 | bit4
162 * -------------+------+------+------+------- 167 * -------------+------+------+------+-------
@@ -481,6 +486,7 @@ static struct platform_device sdhi0_device = {
481 }, 486 },
482}; 487};
483 488
489#if !defined(CONFIG_MMC_SH_MMCIF)
484/* SDHI1 */ 490/* SDHI1 */
485static struct sh_mobile_sdhi_info sdhi1_info = { 491static struct sh_mobile_sdhi_info sdhi1_info = {
486 .dma_slave_tx = SHDMA_SLAVE_SDHI1_TX, 492 .dma_slave_tx = SHDMA_SLAVE_SDHI1_TX,
@@ -514,6 +520,7 @@ static struct platform_device sdhi1_device = {
514 .platform_data = &sdhi1_info, 520 .platform_data = &sdhi1_info,
515 }, 521 },
516}; 522};
523#endif
517 524
518/* SDHI2 */ 525/* SDHI2 */
519static struct sh_mobile_sdhi_info sdhi2_info = { 526static struct sh_mobile_sdhi_info sdhi2_info = {
@@ -547,6 +554,47 @@ static struct platform_device sdhi2_device = {
547 }, 554 },
548}; 555};
549 556
557/* SH_MMCIF */
558static struct resource sh_mmcif_resources[] = {
559 [0] = {
560 .name = "MMCIF",
561 .start = 0xE6BD0000,
562 .end = 0xE6BD00FF,
563 .flags = IORESOURCE_MEM,
564 },
565 [1] = {
566 /* MMC ERR */
567 .start = evt2irq(0x1ac0),
568 .flags = IORESOURCE_IRQ,
569 },
570 [2] = {
571 /* MMC NOR */
572 .start = evt2irq(0x1ae0),
573 .flags = IORESOURCE_IRQ,
574 },
575};
576
577static struct sh_mmcif_plat_data sh_mmcif_plat = {
578 .sup_pclk = 0,
579 .ocr = MMC_VDD_165_195 | MMC_VDD_32_33 | MMC_VDD_33_34,
580 .caps = MMC_CAP_4_BIT_DATA |
581 MMC_CAP_8_BIT_DATA |
582 MMC_CAP_NEEDS_POLL,
583 .get_cd = slot_cn7_get_cd,
584};
585
586static struct platform_device sh_mmcif_device = {
587 .name = "sh_mmcif",
588 .id = 0,
589 .dev = {
590 .dma_mask = NULL,
591 .coherent_dma_mask = 0xffffffff,
592 .platform_data = &sh_mmcif_plat,
593 },
594 .num_resources = ARRAY_SIZE(sh_mmcif_resources),
595 .resource = sh_mmcif_resources,
596};
597
550static struct platform_device *mackerel_devices[] __initdata = { 598static struct platform_device *mackerel_devices[] __initdata = {
551 &nor_flash_device, 599 &nor_flash_device,
552 &smc911x_device, 600 &smc911x_device,
@@ -556,8 +604,11 @@ static struct platform_device *mackerel_devices[] __initdata = {
556 &fsi_device, 604 &fsi_device,
557 &fsi_ak4643_device, 605 &fsi_ak4643_device,
558 &sdhi0_device, 606 &sdhi0_device,
607#if !defined(CONFIG_MMC_SH_MMCIF)
559 &sdhi1_device, 608 &sdhi1_device,
609#endif
560 &sdhi2_device, 610 &sdhi2_device,
611 &sh_mmcif_device,
561}; 612};
562 613
563/* Keypad Initialization */ 614/* Keypad Initialization */
@@ -723,6 +774,7 @@ static void __init mackerel_init(void)
723 gpio_request(GPIO_FN_SDHID0_1, NULL); 774 gpio_request(GPIO_FN_SDHID0_1, NULL);
724 gpio_request(GPIO_FN_SDHID0_0, NULL); 775 gpio_request(GPIO_FN_SDHID0_0, NULL);
725 776
777#if !defined(CONFIG_MMC_SH_MMCIF)
726 /* enable SDHI1 */ 778 /* enable SDHI1 */
727 gpio_request(GPIO_FN_SDHICMD1, NULL); 779 gpio_request(GPIO_FN_SDHICMD1, NULL);
728 gpio_request(GPIO_FN_SDHICLK1, NULL); 780 gpio_request(GPIO_FN_SDHICLK1, NULL);
@@ -730,6 +782,7 @@ static void __init mackerel_init(void)
730 gpio_request(GPIO_FN_SDHID1_2, NULL); 782 gpio_request(GPIO_FN_SDHID1_2, NULL);
731 gpio_request(GPIO_FN_SDHID1_1, NULL); 783 gpio_request(GPIO_FN_SDHID1_1, NULL);
732 gpio_request(GPIO_FN_SDHID1_0, NULL); 784 gpio_request(GPIO_FN_SDHID1_0, NULL);
785#endif
733 /* card detect pin for MMC slot (CN7) */ 786 /* card detect pin for MMC slot (CN7) */
734 gpio_request(GPIO_PORT41, NULL); 787 gpio_request(GPIO_PORT41, NULL);
735 gpio_direction_input(GPIO_PORT41); 788 gpio_direction_input(GPIO_PORT41);
@@ -742,6 +795,18 @@ static void __init mackerel_init(void)
742 gpio_request(GPIO_FN_SDHID2_1, NULL); 795 gpio_request(GPIO_FN_SDHID2_1, NULL);
743 gpio_request(GPIO_FN_SDHID2_0, NULL); 796 gpio_request(GPIO_FN_SDHID2_0, NULL);
744 797
798 /* MMCIF */
799 gpio_request(GPIO_FN_MMCD0_0, NULL);
800 gpio_request(GPIO_FN_MMCD0_1, NULL);
801 gpio_request(GPIO_FN_MMCD0_2, NULL);
802 gpio_request(GPIO_FN_MMCD0_3, NULL);
803 gpio_request(GPIO_FN_MMCD0_4, NULL);
804 gpio_request(GPIO_FN_MMCD0_5, NULL);
805 gpio_request(GPIO_FN_MMCD0_6, NULL);
806 gpio_request(GPIO_FN_MMCD0_7, NULL);
807 gpio_request(GPIO_FN_MMCCMD0, NULL);
808 gpio_request(GPIO_FN_MMCCLK0, NULL);
809
745 i2c_register_board_info(0, i2c0_devices, 810 i2c_register_board_info(0, i2c0_devices,
746 ARRAY_SIZE(i2c0_devices)); 811 ARRAY_SIZE(i2c0_devices));
747 i2c_register_board_info(1, i2c1_devices, 812 i2c_register_board_info(1, i2c1_devices,