All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] tmio: Support board-specified voltages
@ 2010-05-14 10:34 ` Guennadi Liakhovetski
  0 siblings, 0 replies; 12+ messages in thread
From: Guennadi Liakhovetski @ 2010-05-14 10:34 UTC (permalink / raw)
  To: linux-sh; +Cc: Ian Molton, Samuel Ortiz, linux-mmc, Magnus Damm

This patch series allows users to specify, which card voltages their 
system supports, when using the tmio_mmc driver. Also applied to the 
ap4evb sh7372 board. Applies on top of all my previoud patches for tmio / 
sdhi.

Thanks
Guennadi
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH 0/3] tmio: Support board-specified voltages
@ 2010-05-14 10:34 ` Guennadi Liakhovetski
  0 siblings, 0 replies; 12+ messages in thread
From: Guennadi Liakhovetski @ 2010-05-14 10:34 UTC (permalink / raw)
  To: linux-sh; +Cc: Ian Molton, Samuel Ortiz, linux-mmc, Magnus Damm

This patch series allows users to specify, which card voltages their 
system supports, when using the tmio_mmc driver. Also applied to the 
ap4evb sh7372 board. Applies on top of all my previoud patches for tmio / 
sdhi.

Thanks
Guennadi
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH 1/3] mmc: let MFD's provide supported Vdd card voltages to
  2010-05-14 10:34 ` Guennadi Liakhovetski
@ 2010-05-14 10:34   ` Guennadi Liakhovetski
  -1 siblings, 0 replies; 12+ messages in thread
From: Guennadi Liakhovetski @ 2010-05-14 10:34 UTC (permalink / raw)
  To: linux-sh; +Cc: Ian Molton, Samuel Ortiz, linux-mmc, Magnus Damm

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
---
 drivers/mmc/host/tmio_mmc.c |    5 ++++-
 include/linux/mfd/tmio.h    |    1 +
 2 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/drivers/mmc/host/tmio_mmc.c b/drivers/mmc/host/tmio_mmc.c
index a295328..73f6c3d 100644
--- a/drivers/mmc/host/tmio_mmc.c
+++ b/drivers/mmc/host/tmio_mmc.c
@@ -845,7 +845,10 @@ static int __devinit tmio_mmc_probe(struct platform_device *dev)
 	mmc->caps |= pdata->capabilities;
 	mmc->f_max = pdata->hclk;
 	mmc->f_min = mmc->f_max / 512;
-	mmc->ocr_avail = MMC_VDD_32_33 | MMC_VDD_33_34;
+	if (pdata->ocr_mask)
+		mmc->ocr_avail = pdata->ocr_mask;
+	else
+		mmc->ocr_avail = MMC_VDD_32_33 | MMC_VDD_33_34;
 
 	/* Tell the MFD core we are ready to be enabled */
 	if (cell->enable) {
diff --git a/include/linux/mfd/tmio.h b/include/linux/mfd/tmio.h
index feeed0b..f07425b 100644
--- a/include/linux/mfd/tmio.h
+++ b/include/linux/mfd/tmio.h
@@ -70,6 +70,7 @@ struct tmio_mmc_data {
 	unsigned int			hclk;
 	unsigned long			capabilities;
 	unsigned long			flags;
+	u32				ocr_mask;	/* available voltages */
 	struct tmio_mmc_dma		*dma;
 	void (*set_pwr)(struct platform_device *host, int state);
 	void (*set_clk_div)(struct platform_device *host, int state);
-- 
1.6.2.4


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 1/3] mmc: let MFD's provide supported Vdd card voltages to tmio_mmc
@ 2010-05-14 10:34   ` Guennadi Liakhovetski
  0 siblings, 0 replies; 12+ messages in thread
From: Guennadi Liakhovetski @ 2010-05-14 10:34 UTC (permalink / raw)
  To: linux-sh; +Cc: Ian Molton, Samuel Ortiz, linux-mmc, Magnus Damm

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
---
 drivers/mmc/host/tmio_mmc.c |    5 ++++-
 include/linux/mfd/tmio.h    |    1 +
 2 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/drivers/mmc/host/tmio_mmc.c b/drivers/mmc/host/tmio_mmc.c
index a295328..73f6c3d 100644
--- a/drivers/mmc/host/tmio_mmc.c
+++ b/drivers/mmc/host/tmio_mmc.c
@@ -845,7 +845,10 @@ static int __devinit tmio_mmc_probe(struct platform_device *dev)
 	mmc->caps |= pdata->capabilities;
 	mmc->f_max = pdata->hclk;
 	mmc->f_min = mmc->f_max / 512;
-	mmc->ocr_avail = MMC_VDD_32_33 | MMC_VDD_33_34;
+	if (pdata->ocr_mask)
+		mmc->ocr_avail = pdata->ocr_mask;
+	else
+		mmc->ocr_avail = MMC_VDD_32_33 | MMC_VDD_33_34;
 
 	/* Tell the MFD core we are ready to be enabled */
 	if (cell->enable) {
diff --git a/include/linux/mfd/tmio.h b/include/linux/mfd/tmio.h
index feeed0b..f07425b 100644
--- a/include/linux/mfd/tmio.h
+++ b/include/linux/mfd/tmio.h
@@ -70,6 +70,7 @@ struct tmio_mmc_data {
 	unsigned int			hclk;
 	unsigned long			capabilities;
 	unsigned long			flags;
+	u32				ocr_mask;	/* available voltages */
 	struct tmio_mmc_dma		*dma;
 	void (*set_pwr)(struct platform_device *host, int state);
 	void (*set_clk_div)(struct platform_device *host, int state);
-- 
1.6.2.4


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 2/3] sh: allow platforms to specify SD-card supported voltages
  2010-05-14 10:34 ` Guennadi Liakhovetski
@ 2010-05-14 10:34   ` Guennadi Liakhovetski
  -1 siblings, 0 replies; 12+ messages in thread
From: Guennadi Liakhovetski @ 2010-05-14 10:34 UTC (permalink / raw)
  To: linux-sh; +Cc: Ian Molton, Samuel Ortiz, linux-mmc, Magnus Damm

Boards can have different supplied voltages on different SD card slots. This
information has to be passed down to the SD/MMC driver.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
---
 drivers/mfd/sh_mobile_sdhi.c       |    4 +++-
 include/linux/mfd/sh_mobile_sdhi.h |    3 +++
 2 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/drivers/mfd/sh_mobile_sdhi.c b/drivers/mfd/sh_mobile_sdhi.c
index 7970fe8..d9e4701 100644
--- a/drivers/mfd/sh_mobile_sdhi.c
+++ b/drivers/mfd/sh_mobile_sdhi.c
@@ -106,8 +106,10 @@ static int __init sh_mobile_sdhi_probe(struct platform_device *pdev)
 	mmc_data->hclk = clk_get_rate(priv->clk);
 	mmc_data->set_pwr = sh_mobile_sdhi_set_pwr;
 	mmc_data->capabilities = MMC_CAP_MMC_HIGHSPEED;
-	if (p)
+	if (p) {
 		mmc_data->flags = p->tmio_flags;
+		mmc_data->ocr_mask = p->tmio_ocr_mask;
+	}
 
 	if (p && p->dma_slave_tx >= 0 && p->dma_slave_rx >= 0) {
 		priv->param_tx.slave_id = p->dma_slave_tx;
diff --git a/include/linux/mfd/sh_mobile_sdhi.h b/include/linux/mfd/sh_mobile_sdhi.h
index c7b47f8..4906780 100644
--- a/include/linux/mfd/sh_mobile_sdhi.h
+++ b/include/linux/mfd/sh_mobile_sdhi.h
@@ -1,10 +1,13 @@
 #ifndef __SH_MOBILE_SDHI_H__
 #define __SH_MOBILE_SDHI_H__
 
+#include <linux/types.h>
+
 struct sh_mobile_sdhi_info {
 	int dma_slave_tx;
 	int dma_slave_rx;
 	unsigned long tmio_flags;
+	u32 tmio_ocr_mask;	/* available MMC voltages */
 	void (*set_pwr)(struct platform_device *pdev, int state);
 };
 
-- 
1.6.2.4


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 2/3] sh: allow platforms to specify SD-card supported voltages
@ 2010-05-14 10:34   ` Guennadi Liakhovetski
  0 siblings, 0 replies; 12+ messages in thread
From: Guennadi Liakhovetski @ 2010-05-14 10:34 UTC (permalink / raw)
  To: linux-sh; +Cc: Ian Molton, Samuel Ortiz, linux-mmc, Magnus Damm

Boards can have different supplied voltages on different SD card slots. This
information has to be passed down to the SD/MMC driver.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
---
 drivers/mfd/sh_mobile_sdhi.c       |    4 +++-
 include/linux/mfd/sh_mobile_sdhi.h |    3 +++
 2 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/drivers/mfd/sh_mobile_sdhi.c b/drivers/mfd/sh_mobile_sdhi.c
index 7970fe8..d9e4701 100644
--- a/drivers/mfd/sh_mobile_sdhi.c
+++ b/drivers/mfd/sh_mobile_sdhi.c
@@ -106,8 +106,10 @@ static int __init sh_mobile_sdhi_probe(struct platform_device *pdev)
 	mmc_data->hclk = clk_get_rate(priv->clk);
 	mmc_data->set_pwr = sh_mobile_sdhi_set_pwr;
 	mmc_data->capabilities = MMC_CAP_MMC_HIGHSPEED;
-	if (p)
+	if (p) {
 		mmc_data->flags = p->tmio_flags;
+		mmc_data->ocr_mask = p->tmio_ocr_mask;
+	}
 
 	if (p && p->dma_slave_tx >= 0 && p->dma_slave_rx >= 0) {
 		priv->param_tx.slave_id = p->dma_slave_tx;
diff --git a/include/linux/mfd/sh_mobile_sdhi.h b/include/linux/mfd/sh_mobile_sdhi.h
index c7b47f8..4906780 100644
--- a/include/linux/mfd/sh_mobile_sdhi.h
+++ b/include/linux/mfd/sh_mobile_sdhi.h
@@ -1,10 +1,13 @@
 #ifndef __SH_MOBILE_SDHI_H__
 #define __SH_MOBILE_SDHI_H__
 
+#include <linux/types.h>
+
 struct sh_mobile_sdhi_info {
 	int dma_slave_tx;
 	int dma_slave_rx;
 	unsigned long tmio_flags;
+	u32 tmio_ocr_mask;	/* available MMC voltages */
 	void (*set_pwr)(struct platform_device *pdev, int state);
 };
 
-- 
1.6.2.4


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 3/3] ARM: add support for the second SD-/MMC-card slot on
  2010-05-14 10:34 ` Guennadi Liakhovetski
@ 2010-05-14 10:34   ` Guennadi Liakhovetski
  -1 siblings, 0 replies; 12+ messages in thread
From: Guennadi Liakhovetski @ 2010-05-14 10:34 UTC (permalink / raw)
  To: linux-sh; +Cc: Ian Molton, Samuel Ortiz, linux-mmc, Magnus Damm

The ap4evb board is equipped with two card slots: one SD-card slot and one
SD-/MMC-card slot. The latter is connected to the second SDHI interface on
sh7372 (SDHI1). Its power supply can be jumpered either to 1.8 or 3.3V, we fix
it at default 1.8V for now.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
---
 arch/arm/mach-shmobile/board-ap4evb.c |   44 +++++++++++++++++++++++++++++++-
 1 files changed, 42 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-shmobile/board-ap4evb.c b/arch/arm/mach-shmobile/board-ap4evb.c
index 865e024..9faed01 100644
--- a/arch/arm/mach-shmobile/board-ap4evb.c
+++ b/arch/arm/mach-shmobile/board-ap4evb.c
@@ -25,6 +25,7 @@
 #include <linux/platform_device.h>
 #include <linux/delay.h>
 #include <linux/mfd/sh_mobile_sdhi.h>
+#include <linux/mmc/host.h>
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/partitions.h>
 #include <linux/mtd/physmap.h>
@@ -217,8 +218,8 @@ static struct platform_device keysc_device = {
 
 /* SDHI0 */
 static struct sh_mobile_sdhi_info sdhi0_info = {
-	.dma_slave_tx = SHDMA_SLAVE_SDHI0_TX,
-	.dma_slave_rx = SHDMA_SLAVE_SDHI0_RX,
+	.dma_slave_tx	= SHDMA_SLAVE_SDHI0_TX,
+	.dma_slave_rx	= SHDMA_SLAVE_SDHI0_RX,
 };
 
 static struct resource sdhi0_resources[] = {
@@ -244,6 +245,36 @@ static struct platform_device sdhi0_device = {
 	},
 };
 
+/* 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,
+};
+
+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,
+	},
+};
+
 static struct sh_mobile_lcdc_info sh_mobile_lcdc_info = {
 	.clock_source = LCDC_CLK_PERIPHERAL, /* One of interface clocks */
 	.ch[0] = {
@@ -322,6 +353,7 @@ static struct platform_device *ap4evb_devices[] __initdata = {
 	&smc911x_device,
 	&keysc_device,
 	&sdhi0_device,
+	&sdhi1_device,
 	&lcdc_device,
 	&mipidsi0_device,
 };
@@ -448,6 +480,14 @@ static void __init ap4evb_init(void)
 	gpio_request(GPIO_FN_SDHID0_1, NULL);
 	gpio_request(GPIO_FN_SDHID0_0, NULL);
 
+	/* 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);
+
 	sh7372_add_standard_devices();
 
 	platform_add_devices(ap4evb_devices, ARRAY_SIZE(ap4evb_devices));
-- 
1.6.2.4


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 3/3] ARM: add support for the second SD-/MMC-card slot on ap4evb
@ 2010-05-14 10:34   ` Guennadi Liakhovetski
  0 siblings, 0 replies; 12+ messages in thread
From: Guennadi Liakhovetski @ 2010-05-14 10:34 UTC (permalink / raw)
  To: linux-sh; +Cc: Ian Molton, Samuel Ortiz, linux-mmc, Magnus Damm

The ap4evb board is equipped with two card slots: one SD-card slot and one
SD-/MMC-card slot. The latter is connected to the second SDHI interface on
sh7372 (SDHI1). Its power supply can be jumpered either to 1.8 or 3.3V, we fix
it at default 1.8V for now.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
---
 arch/arm/mach-shmobile/board-ap4evb.c |   44 +++++++++++++++++++++++++++++++-
 1 files changed, 42 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-shmobile/board-ap4evb.c b/arch/arm/mach-shmobile/board-ap4evb.c
index 865e024..9faed01 100644
--- a/arch/arm/mach-shmobile/board-ap4evb.c
+++ b/arch/arm/mach-shmobile/board-ap4evb.c
@@ -25,6 +25,7 @@
 #include <linux/platform_device.h>
 #include <linux/delay.h>
 #include <linux/mfd/sh_mobile_sdhi.h>
+#include <linux/mmc/host.h>
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/partitions.h>
 #include <linux/mtd/physmap.h>
@@ -217,8 +218,8 @@ static struct platform_device keysc_device = {
 
 /* SDHI0 */
 static struct sh_mobile_sdhi_info sdhi0_info = {
-	.dma_slave_tx = SHDMA_SLAVE_SDHI0_TX,
-	.dma_slave_rx = SHDMA_SLAVE_SDHI0_RX,
+	.dma_slave_tx	= SHDMA_SLAVE_SDHI0_TX,
+	.dma_slave_rx	= SHDMA_SLAVE_SDHI0_RX,
 };
 
 static struct resource sdhi0_resources[] = {
@@ -244,6 +245,36 @@ static struct platform_device sdhi0_device = {
 	},
 };
 
+/* 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,
+};
+
+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,
+	},
+};
+
 static struct sh_mobile_lcdc_info sh_mobile_lcdc_info = {
 	.clock_source = LCDC_CLK_PERIPHERAL, /* One of interface clocks */
 	.ch[0] = {
@@ -322,6 +353,7 @@ static struct platform_device *ap4evb_devices[] __initdata = {
 	&smc911x_device,
 	&keysc_device,
 	&sdhi0_device,
+	&sdhi1_device,
 	&lcdc_device,
 	&mipidsi0_device,
 };
@@ -448,6 +480,14 @@ static void __init ap4evb_init(void)
 	gpio_request(GPIO_FN_SDHID0_1, NULL);
 	gpio_request(GPIO_FN_SDHID0_0, NULL);
 
+	/* 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);
+
 	sh7372_add_standard_devices();
 
 	platform_add_devices(ap4evb_devices, ARRAY_SIZE(ap4evb_devices));
-- 
1.6.2.4


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 3/3 v2] ARM: mach-shmobile: add support for the second
  2010-05-14 10:34   ` [PATCH 3/3] ARM: add support for the second SD-/MMC-card slot on ap4evb Guennadi Liakhovetski
@ 2010-05-23 14:12     ` Guennadi Liakhovetski
  -1 siblings, 0 replies; 12+ messages in thread
From: Guennadi Liakhovetski @ 2010-05-23 14:12 UTC (permalink / raw)
  To: linux-sh; +Cc: Ian Molton, Samuel Ortiz, linux-mmc, Magnus Damm

The ap4evb board is equipped with two card slots: one SD-card slot and one
SD-/MMC-card slot. The latter is connected to the second SDHI interface on
sh7372 (SDHI1). Its power supply can be jumpered either to 1.8 or 3.3V, we fix
it at default 1.8V for now.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
---

v1 -> v2:

updated to the current genesis tree

 arch/arm/mach-shmobile/board-ap4evb.c |   44 +++++++++++++++++++++++++++++++-
 1 files changed, 42 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-shmobile/board-ap4evb.c b/arch/arm/mach-shmobile/board-ap4evb.c
index e02e09a..6c23d74 100644
--- a/arch/arm/mach-shmobile/board-ap4evb.c
+++ b/arch/arm/mach-shmobile/board-ap4evb.c
@@ -25,6 +25,7 @@
 #include <linux/platform_device.h>
 #include <linux/delay.h>
 #include <linux/mfd/sh_mobile_sdhi.h>
+#include <linux/mmc/host.h>
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/partitions.h>
 #include <linux/mtd/physmap.h>
@@ -233,8 +234,8 @@ static struct platform_device keysc_device = {
 
 /* SDHI0 */
 static struct sh_mobile_sdhi_info sdhi0_info = {
-	.dma_slave_tx = SHDMA_SLAVE_SDHI0_TX,
-	.dma_slave_rx = SHDMA_SLAVE_SDHI0_RX,
+	.dma_slave_tx	= SHDMA_SLAVE_SDHI0_TX,
+	.dma_slave_rx	= SHDMA_SLAVE_SDHI0_RX,
 };
 
 static struct resource sdhi0_resources[] = {
@@ -260,6 +261,36 @@ static struct platform_device sdhi0_device = {
 	},
 };
 
+/* 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,
+};
+
+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,
+	},
+};
+
 /* USB1 */
 void usb1_host_port_power(int port, int power)
 {
@@ -379,6 +410,7 @@ static struct platform_device *ap4evb_devices[] __initdata = {
 	&smc911x_device,
 	&keysc_device,
 	&sdhi0_device,
+	&sdhi1_device,
 	&usb1_host_device,
 	&lcdc_device,
 	&mipidsi0_device,
@@ -544,6 +576,14 @@ static void __init ap4evb_init(void)
 	/* setup USB phy */
 	__raw_writew(0x8a0a, 0xE6058130);	/* USBCR2 */
 
+	/* 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);
+
 	sh7372_add_standard_devices();
 
 	platform_add_devices(ap4evb_devices, ARRAY_SIZE(ap4evb_devices));
-- 
1.6.2.4


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 3/3 v2] ARM: mach-shmobile: add support for the second SD-/MMC-card slot on ap4evb
@ 2010-05-23 14:12     ` Guennadi Liakhovetski
  0 siblings, 0 replies; 12+ messages in thread
From: Guennadi Liakhovetski @ 2010-05-23 14:12 UTC (permalink / raw)
  To: linux-sh; +Cc: Ian Molton, Samuel Ortiz, linux-mmc, Magnus Damm

The ap4evb board is equipped with two card slots: one SD-card slot and one
SD-/MMC-card slot. The latter is connected to the second SDHI interface on
sh7372 (SDHI1). Its power supply can be jumpered either to 1.8 or 3.3V, we fix
it at default 1.8V for now.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
---

v1 -> v2:

updated to the current genesis tree

 arch/arm/mach-shmobile/board-ap4evb.c |   44 +++++++++++++++++++++++++++++++-
 1 files changed, 42 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-shmobile/board-ap4evb.c b/arch/arm/mach-shmobile/board-ap4evb.c
index e02e09a..6c23d74 100644
--- a/arch/arm/mach-shmobile/board-ap4evb.c
+++ b/arch/arm/mach-shmobile/board-ap4evb.c
@@ -25,6 +25,7 @@
 #include <linux/platform_device.h>
 #include <linux/delay.h>
 #include <linux/mfd/sh_mobile_sdhi.h>
+#include <linux/mmc/host.h>
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/partitions.h>
 #include <linux/mtd/physmap.h>
@@ -233,8 +234,8 @@ static struct platform_device keysc_device = {
 
 /* SDHI0 */
 static struct sh_mobile_sdhi_info sdhi0_info = {
-	.dma_slave_tx = SHDMA_SLAVE_SDHI0_TX,
-	.dma_slave_rx = SHDMA_SLAVE_SDHI0_RX,
+	.dma_slave_tx	= SHDMA_SLAVE_SDHI0_TX,
+	.dma_slave_rx	= SHDMA_SLAVE_SDHI0_RX,
 };
 
 static struct resource sdhi0_resources[] = {
@@ -260,6 +261,36 @@ static struct platform_device sdhi0_device = {
 	},
 };
 
+/* 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,
+};
+
+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,
+	},
+};
+
 /* USB1 */
 void usb1_host_port_power(int port, int power)
 {
@@ -379,6 +410,7 @@ static struct platform_device *ap4evb_devices[] __initdata = {
 	&smc911x_device,
 	&keysc_device,
 	&sdhi0_device,
+	&sdhi1_device,
 	&usb1_host_device,
 	&lcdc_device,
 	&mipidsi0_device,
@@ -544,6 +576,14 @@ static void __init ap4evb_init(void)
 	/* setup USB phy */
 	__raw_writew(0x8a0a, 0xE6058130);	/* USBCR2 */
 
+	/* 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);
+
 	sh7372_add_standard_devices();
 
 	platform_add_devices(ap4evb_devices, ARRAY_SIZE(ap4evb_devices));
-- 
1.6.2.4


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [PATCH 3/3 v2] ARM: mach-shmobile: add support for the second SD-/MMC-card slot on ap4evb
  2010-05-23 14:12     ` [PATCH 3/3 v2] ARM: mach-shmobile: add support for the second SD-/MMC-card slot on ap4evb Guennadi Liakhovetski
@ 2010-05-31  4:49       ` Paul Mundt
  -1 siblings, 0 replies; 12+ messages in thread
From: Paul Mundt @ 2010-05-31  4:49 UTC (permalink / raw)
  To: Guennadi Liakhovetski
  Cc: linux-sh, Ian Molton, Samuel Ortiz, linux-mmc, Magnus Damm

On Sun, May 23, 2010 at 04:12:46PM +0200, Guennadi Liakhovetski wrote:
> The ap4evb board is equipped with two card slots: one SD-card slot and one
> SD-/MMC-card slot. The latter is connected to the second SDHI interface on
> sh7372 (SDHI1). Its power supply can be jumpered either to 1.8 or 3.3V, we fix
> it at default 1.8V for now.
> 
> Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>

Now that all of the dependencies are out of the way, I've applied this
too.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 3/3 v2] ARM: mach-shmobile: add support for the second SD-/MMC-card slot on ap4evb
@ 2010-05-31  4:49       ` Paul Mundt
  0 siblings, 0 replies; 12+ messages in thread
From: Paul Mundt @ 2010-05-31  4:49 UTC (permalink / raw)
  To: Guennadi Liakhovetski
  Cc: linux-sh, Ian Molton, Samuel Ortiz, linux-mmc, Magnus Damm

On Sun, May 23, 2010 at 04:12:46PM +0200, Guennadi Liakhovetski wrote:
> The ap4evb board is equipped with two card slots: one SD-card slot and one
> SD-/MMC-card slot. The latter is connected to the second SDHI interface on
> sh7372 (SDHI1). Its power supply can be jumpered either to 1.8 or 3.3V, we fix
> it at default 1.8V for now.
> 
> Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>

Now that all of the dependencies are out of the way, I've applied this
too.

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2010-05-31  4:49 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-05-14 10:34 [PATCH 0/3] tmio: Support board-specified voltages Guennadi Liakhovetski
2010-05-14 10:34 ` Guennadi Liakhovetski
2010-05-14 10:34 ` [PATCH 1/3] mmc: let MFD's provide supported Vdd card voltages to Guennadi Liakhovetski
2010-05-14 10:34   ` [PATCH 1/3] mmc: let MFD's provide supported Vdd card voltages to tmio_mmc Guennadi Liakhovetski
2010-05-14 10:34 ` [PATCH 2/3] sh: allow platforms to specify SD-card supported voltages Guennadi Liakhovetski
2010-05-14 10:34   ` Guennadi Liakhovetski
2010-05-14 10:34 ` [PATCH 3/3] ARM: add support for the second SD-/MMC-card slot on Guennadi Liakhovetski
2010-05-14 10:34   ` [PATCH 3/3] ARM: add support for the second SD-/MMC-card slot on ap4evb Guennadi Liakhovetski
2010-05-23 14:12   ` [PATCH 3/3 v2] ARM: mach-shmobile: add support for the second Guennadi Liakhovetski
2010-05-23 14:12     ` [PATCH 3/3 v2] ARM: mach-shmobile: add support for the second SD-/MMC-card slot on ap4evb Guennadi Liakhovetski
2010-05-31  4:49     ` Paul Mundt
2010-05-31  4:49       ` Paul Mundt

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.