From: Yusuke Goda <yusuke.goda.sx@renesas.com>
To: linux-sh@vger.kernel.org
Subject: [PATCH] ARM: mach-shmobile: mackerel: Add sdhi support
Date: Tue, 14 Dec 2010 05:18:03 +0000 [thread overview]
Message-ID: <4D06FE0B.3080809@renesas.com> (raw)
In-Reply-To: <w3p7hfw4po7.wl%kuninori.morimoto.gx@renesas.com>
Signed-off-by: Yusuke Goda <yusuke.goda.sx@renesas.com>
---
arch/arm/mach-shmobile/board-mackerel.c | 175 +++++++++++++++++++++++++++++++
1 files changed, 175 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mach-shmobile/board-mackerel.c b/arch/arm/mach-shmobile/board-mackerel.c
index 3e30a52..f62f9b9 100644
--- a/arch/arm/mach-shmobile/board-mackerel.c
+++ b/arch/arm/mach-shmobile/board-mackerel.c
@@ -31,6 +31,9 @@
#include <linux/io.h>
#include <linux/i2c.h>
#include <linux/leds.h>
+#include <linux/mfd/sh_mobile_sdhi.h>
+#include <linux/mfd/tmio.h>
+#include <linux/mmc/host.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/partitions.h>
#include <linux/mtd/physmap.h>
@@ -139,6 +142,38 @@
*/
/*
+ * SDHI0 (CN12)
+ *
+ * SW56 : OFF
+ *
+ */
+
+/* MMC /SDHI1 (CN7)
+ *
+ * I/O voltage : 1.8v
+ *
+ * Power voltage : 1.8v or 3.3v
+ * J22 : select power voltage
+ * 1-2 pin : 1.8v
+ * 2-3 pin : 3.3v
+ *
+ * SW1 | SW33
+ * | bit1 | bit2 | bit3 | bit4
+ * -------------+------+------+------+-------
+ * MMC0 OFF | OFF | ON | ON | X
+ * MMC1 ON | OFF | ON | X | ON
+ * SDHI1 OFF | ON | X | OFF | ON
+ *
+ */
+
+/*
+ * SDHI2 (CN23)
+ *
+ * microSD card sloct
+ *
+ */
+
+/*
* FIXME !!
*
* gpio_no_direction
@@ -404,6 +439,114 @@ static struct platform_device fsi_ak4643_device = {
.name = "sh_fsi2_a_ak4643",
};
+/*
+ * The card detect pin of the top SD/MMC slot (CN7) is active low and is
+ * connected to GPIO A22 of SH7372 (GPIO_PORT41).
+ */
+static int slot_cn7_get_cd(struct platform_device *pdev)
+{
+ if (gpio_is_valid(GPIO_PORT41))
+ return !gpio_get_value(GPIO_PORT41);
+ else
+ return -ENXIO;
+}
+
+/* SDHI0 */
+static struct sh_mobile_sdhi_info sdhi0_info = {
+ .dma_slave_tx = SHDMA_SLAVE_SDHI0_TX,
+ .dma_slave_rx = SHDMA_SLAVE_SDHI0_RX,
+ .tmio_caps = MMC_CAP_SD_HIGHSPEED,
+};
+
+static struct resource sdhi0_resources[] = {
+ [0] = {
+ .name = "SDHI0",
+ .start = 0xe6850000,
+ .end = 0xe68501ff,
+ .flags = IORESOURCE_MEM,
+ },
+ [1] = {
+ .start = evt2irq(0x0e00) /* SDHI0 */,
+ .flags = IORESOURCE_IRQ,
+ },
+};
+
+static struct platform_device sdhi0_device = {
+ .name = "sh_mobile_sdhi",
+ .num_resources = ARRAY_SIZE(sdhi0_resources),
+ .resource = sdhi0_resources,
+ .id = 0,
+ .dev = {
+ .platform_data = &sdhi0_info,
+ },
+};
+
+/* SDHI1 */
+static struct sh_mobile_sdhi_info sdhi1_info = {
+ .dma_slave_tx = SHDMA_SLAVE_SDHI1_TX,
+ .dma_slave_rx = SHDMA_SLAVE_SDHI1_RX,
+ .tmio_ocr_mask = MMC_VDD_165_195,
+ .tmio_flags = TMIO_MMC_WRPROTECT_DISABLE,
+ .tmio_caps = MMC_CAP_SD_HIGHSPEED |
+ MMC_CAP_NEEDS_POLL,
+ .get_cd = slot_cn7_get_cd,
+};
+
+static struct resource sdhi1_resources[] = {
+ [0] = {
+ .name = "SDHI1",
+ .start = 0xe6860000,
+ .end = 0xe68601ff,
+ .flags = IORESOURCE_MEM,
+ },
+ [1] = {
+ .start = evt2irq(0x0e80),
+ .flags = IORESOURCE_IRQ,
+ },
+};
+
+static struct platform_device sdhi1_device = {
+ .name = "sh_mobile_sdhi",
+ .num_resources = ARRAY_SIZE(sdhi1_resources),
+ .resource = sdhi1_resources,
+ .id = 1,
+ .dev = {
+ .platform_data = &sdhi1_info,
+ },
+};
+
+/* SDHI2 */
+static struct sh_mobile_sdhi_info sdhi2_info = {
+ .dma_slave_tx = SHDMA_SLAVE_SDHI2_TX,
+ .dma_slave_rx = SHDMA_SLAVE_SDHI2_RX,
+ .tmio_flags = TMIO_MMC_WRPROTECT_DISABLE,
+ .tmio_caps = MMC_CAP_SD_HIGHSPEED |
+ MMC_CAP_NEEDS_POLL,
+};
+
+static struct resource sdhi2_resources[] = {
+ [0] = {
+ .name = "SDHI2",
+ .start = 0xe6870000,
+ .end = 0xe68701ff,
+ .flags = IORESOURCE_MEM,
+ },
+ [1] = {
+ .start = evt2irq(0x1200),
+ .flags = IORESOURCE_IRQ,
+ },
+};
+
+static struct platform_device sdhi2_device = {
+ .name = "sh_mobile_sdhi",
+ .num_resources = ARRAY_SIZE(sdhi2_resources),
+ .resource = sdhi2_resources,
+ .id = 2,
+ .dev = {
+ .platform_data = &sdhi2_info,
+ },
+};
+
static struct platform_device *mackerel_devices[] __initdata = {
&nor_flash_device,
&smc911x_device,
@@ -412,6 +555,9 @@ static struct platform_device *mackerel_devices[] __initdata = {
&leds_device,
&fsi_device,
&fsi_ak4643_device,
+ &sdhi0_device,
+ &sdhi1_device,
+ &sdhi2_device,
};
/* Keypad Initialization */
@@ -567,6 +713,35 @@ static void __init mackerel_init(void)
gpio_request(GPIO_FN_IRQ21, NULL);
set_irq_type(IRQ21, IRQ_TYPE_LEVEL_HIGH);
+ /* enable SDHI0 */
+ gpio_request(GPIO_FN_SDHICD0, NULL);
+ gpio_request(GPIO_FN_SDHIWP0, NULL);
+ gpio_request(GPIO_FN_SDHICMD0, NULL);
+ gpio_request(GPIO_FN_SDHICLK0, NULL);
+ gpio_request(GPIO_FN_SDHID0_3, NULL);
+ gpio_request(GPIO_FN_SDHID0_2, NULL);
+ gpio_request(GPIO_FN_SDHID0_1, NULL);
+ gpio_request(GPIO_FN_SDHID0_0, NULL);
+
+ /* enable SDHI1 */
+ gpio_request(GPIO_FN_SDHICMD1, NULL);
+ gpio_request(GPIO_FN_SDHICLK1, NULL);
+ gpio_request(GPIO_FN_SDHID1_3, NULL);
+ gpio_request(GPIO_FN_SDHID1_2, NULL);
+ gpio_request(GPIO_FN_SDHID1_1, NULL);
+ gpio_request(GPIO_FN_SDHID1_0, NULL);
+ /* card detect pin for MMC slot (CN7) */
+ gpio_request(GPIO_PORT41, NULL);
+ gpio_direction_input(GPIO_PORT41);
+
+ /* enable SDHI2 */
+ gpio_request(GPIO_FN_SDHICMD2, NULL);
+ gpio_request(GPIO_FN_SDHICLK2, NULL);
+ gpio_request(GPIO_FN_SDHID2_3, NULL);
+ gpio_request(GPIO_FN_SDHID2_2, NULL);
+ gpio_request(GPIO_FN_SDHID2_1, NULL);
+ gpio_request(GPIO_FN_SDHID2_0, NULL);
+
i2c_register_board_info(0, i2c0_devices,
ARRAY_SIZE(i2c0_devices));
i2c_register_board_info(1, i2c1_devices,
--
1.5.6.5
next prev parent reply other threads:[~2010-12-14 5:18 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-29 6:19 [PATCH] ARM: mach-shmobile: mackerel: Add lost GPIO_FN_LCDD 18 - 23 Kuninori Morimoto
2010-11-29 8:26 ` Paul Mundt
2010-11-30 4:37 ` [PATCH] ARM: mach-shmobile: mackerel: Add USB1(Host) support Kuninori Morimoto
2010-11-30 5:18 ` Paul Mundt
2010-11-30 6:52 ` [PATCH] ARM: mach-shmobile: mackerel: Add LEDs support Kuninori Morimoto
2010-12-01 0:31 ` [PATCH] ARM: mach-shmobile: mackerel: Add FSI-AK4643 support Kuninori Morimoto
2010-12-01 7:09 ` [PATCH] ARM: mach-shmobile: mackerel: Add LEDs support Paul Mundt
2010-12-07 9:12 ` [PATCH] ARM: mach-shmobile: mackerel: Add Accelerometer sensor support sim.chinyeow
2010-12-08 5:37 ` Paul Mundt
2010-12-09 1:55 ` [PATCH] ARM: mach-shmobile: mackerel: Add keypad tca6408a support chinyeow.sim.xt
2010-12-13 5:10 ` Paul Mundt
2010-12-14 5:18 ` Yusuke Goda [this message]
2010-12-14 9:50 ` [PATCH] ARM: mach-shmobile: mackerel: Add sdhi support Paul Mundt
2010-12-15 4:08 ` [PATCH] ARM: mach-shmobile: mackerel: Add mmcif support Yusuke Goda
2010-12-15 6:02 ` Paul Mundt
2010-12-15 6:40 ` Magnus Damm
2010-12-15 6:43 ` Magnus Damm
2010-12-15 7:35 ` Yusuke Goda
2010-12-15 7:39 ` Magnus Damm
2010-12-15 7:59 ` Yusuke Goda
2010-12-20 1:06 ` [PATCH] ARM: mach-shmobile: mackerel: Add GPS support Yusuke Goda
2010-12-20 16:15 ` Paul Mundt
2010-12-23 6:36 ` [PATCH] ARM: mach-shmobile: mackerel: Add sdhi support Simon Horman
2011-01-07 9:48 ` [PATCH] ARM: mach-shmobile: mackerel: Add support get_cd in CN23 Yusuke Goda
2011-01-11 0:47 ` [PATCH] ARM: mach-shmobile: mackerel: Add touchscreen ST1232 support chinyeow.sim.xt
2011-01-11 3:53 ` [PATCH] ARM: mach-shmobile: mackerel: Add support get_cd in CN23 Paul Mundt
2011-01-11 3:57 ` [PATCH] ARM: mach-shmobile: mackerel: Add touchscreen ST1232 support Paul Mundt
2011-01-11 9:27 ` [PATCH] ARM: mach-shmobile: mackerel: Add sdhi support Yusuke Goda
2011-01-11 22:48 ` Simon Horman
2012-01-19 0:37 ` [PATCH] ARM: mach-shmobile: mackerel: add ak4642 amixer settings on comment Kuninori Morimoto
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4D06FE0B.3080809@renesas.com \
--to=yusuke.goda.sx@renesas.com \
--cc=linux-sh@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).