* [PATCH 00/07] sh: SuperH Mobile SDHI changes
@ 2009-10-02 2:21 Magnus Damm
2009-10-02 2:22 ` [PATCH 01/07] mfd: Add SuperH Mobile SDHI platform driver Magnus Damm
` (8 more replies)
0 siblings, 9 replies; 12+ messages in thread
From: Magnus Damm @ 2009-10-02 2:21 UTC (permalink / raw)
To: linux-sh; +Cc: linux-mmc, g.liakhovetski, ian, lethal, Magnus Damm, akpm
sh: SuperH Mobile SDHI changes
[PATCH 01/07] mfd: Add SuperH Mobile SDHI platform driver
[PATCH 02/07] mmc: Add SuperH to the tmio-mmc Kconfig
[PATCH 03/07] mmc: Remove const from tmio-mmc platform data
[PATCH 04/07] sh: SDHI platform data to the Migo-R board
[PATCH 05/07] sh: SDHI platform data to the AP325RXA board
[PATCH 06/07] sh: SDHI platform data to the SE7724 board
[PATCH 07/07] sh: SDHI platform data to the kfr2r09 board
These patches contain the SuperH specific changes needed for
the tmio-mmc driver to work with SuperH Mobile SDHI hardware.
The tmio-mmc patch 0001-MMC-hardware-abstraction-for-CNF-area.patch
by Ian Molton is needed for correct run time behaviour. Without
this patch the tmio-mmc probe() fails gracefully.
I suggest merging the series in the SuperH tree. Not sure about
the best way to merge the patch by Ian.
Signed-off-by: Magnus Damm <damm@opensource.se>
---
arch/sh/boards/board-ap325rxa.c | 52 ++++++------
arch/sh/boards/mach-kfr2r09/setup.c | 33 +++++++
arch/sh/boards/mach-migor/setup.c | 52 ++++++------
arch/sh/boards/mach-se/7724/setup.c | 33 +++++++
drivers/mfd/Kconfig | 8 +
drivers/mfd/Makefile | 1
drivers/mfd/sh_mobile_sdhi.c | 149 ++++++++++++++++++++++++++++++++++-
drivers/mmc/host/Kconfig | 2
include/linux/mfd/tmio.h | 2
9 files changed, 279 insertions(+), 53 deletions(-)
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH 01/07] mfd: Add SuperH Mobile SDHI platform driver
2009-10-02 2:21 [PATCH 00/07] sh: SuperH Mobile SDHI changes Magnus Damm
@ 2009-10-02 2:22 ` Magnus Damm
2009-10-02 2:22 ` [PATCH 02/07] mmc: Add SuperH to the tmio-mmc Kconfig Magnus Damm
` (7 subsequent siblings)
8 siblings, 0 replies; 12+ messages in thread
From: Magnus Damm @ 2009-10-02 2:22 UTC (permalink / raw)
To: linux-sh; +Cc: akpm, linux-mmc, ian, lethal, Magnus Damm, g.liakhovetski
From: Magnus Damm <damm@opensource.se>
This patch adds an MFD driver for the SuperH Mobile SDHI
hardware block. At this point the driver simply wraps the
tmio-mmc driver with some clock code. In the future this
driver is the place to put SDHI specific hotplug code.
Signed-off-by: Magnus Damm <damm@opensource.se>
---
drivers/mfd/Kconfig | 8 ++
drivers/mfd/Makefile | 1
drivers/mfd/sh_mobile_sdhi.c | 145 ++++++++++++++++++++++++++++++++++++++++++
3 files changed, 154 insertions(+)
--- 0001/drivers/mfd/Kconfig
+++ work/drivers/mfd/Kconfig 2009-10-01 11:22:18.000000000 +0900
@@ -35,6 +35,14 @@ config MFD_ASIC3
This driver supports the ASIC3 multifunction chip found on many
PDAs (mainly iPAQ and HTC based ones)
+config MFD_SH_MOBILE_SDHI
+ bool "Support for SuperH Mobile SDHI"
+ depends on SUPERH
+ select MFD_CORE
+ ---help---
+ This driver supports the SDHI hardware block found in many
+ SuperH Mobile SoC:s.
+
config MFD_DM355EVM_MSP
bool "DaVinci DM355 EVM microcontroller"
depends on I2C && MACH_DAVINCI_DM355_EVM
--- 0002/drivers/mfd/Makefile
+++ work/drivers/mfd/Makefile 2009-10-01 10:58:05.000000000 +0900
@@ -4,6 +4,7 @@
obj-$(CONFIG_MFD_SM501) += sm501.o
obj-$(CONFIG_MFD_ASIC3) += asic3.o
+obj-$(CONFIG_MFD_SH_MOBILE_SDHI) += sh_mobile_sdhi.o
obj-$(CONFIG_HTC_EGPIO) += htc-egpio.o
obj-$(CONFIG_HTC_PASIC3) += htc-pasic3.o
--- /dev/null
+++ work/drivers/mfd/sh_mobile_sdhi.c 2009-10-01 12:07:48.000000000 +0900
@@ -0,0 +1,145 @@
+/*
+ * SuperH Mobile SDHI
+ *
+ * Copyright (C) 2009 Magnus Damm
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * Based on "Compaq ASIC3 support":
+ *
+ * Copyright 2001 Compaq Computer Corporation.
+ * Copyright 2004-2005 Phil Blundell
+ * Copyright 2007-2008 OpenedHand Ltd.
+ *
+ * Authors: Phil Blundell <pb@handhelds.org>,
+ * Samuel Ortiz <sameo@openedhand.com>
+ *
+ */
+
+#include <linux/kernel.h>
+#include <linux/clk.h>
+#include <linux/platform_device.h>
+
+#include <linux/mfd/core.h>
+#include <linux/mfd/tmio.h>
+
+struct sh_mobile_sdhi {
+ struct clk *clk;
+ struct tmio_mmc_data mmc_data;
+ struct mfd_cell cell_mmc;
+};
+
+static struct resource sh_mobile_sdhi_resources[] = {
+ {
+ .start = 0x000,
+ .end = 0x1ff,
+ .flags = IORESOURCE_MEM,
+ },
+ {
+ .start = 0,
+ .end = 0,
+ .flags = IORESOURCE_IRQ,
+ },
+};
+
+static struct mfd_cell sh_mobile_sdhi_cell = {
+ .name = "tmio-mmc",
+ .num_resources = ARRAY_SIZE(sh_mobile_sdhi_resources),
+ .resources = sh_mobile_sdhi_resources,
+};
+
+static int __init sh_mobile_sdhi_probe(struct platform_device *pdev)
+{
+ struct sh_mobile_sdhi *priv;
+ struct resource *mem;
+ char clk_name[8];
+ int ret, irq;
+
+ mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+ if (!mem)
+ dev_err(&pdev->dev, "missing MEM resource\n");
+
+ irq = platform_get_irq(pdev, 0);
+ if (irq < 0)
+ dev_err(&pdev->dev, "missing IRQ resource\n");
+
+ if (!mem || (irq < 0))
+ return -EINVAL;
+
+ priv = kzalloc(sizeof(struct sh_mobile_sdhi), GFP_KERNEL);
+ if (priv = NULL) {
+ dev_err(&pdev->dev, "kzalloc failed\n");
+ return -ENOMEM;
+ }
+
+ snprintf(clk_name, sizeof(clk_name), "sdhi%d", pdev->id);
+ priv->clk = clk_get(&pdev->dev, clk_name);
+ if (IS_ERR(priv->clk)) {
+ dev_err(&pdev->dev, "cannot get clock \"%s\"\n", clk_name);
+ ret = PTR_ERR(priv->clk);
+ kfree(priv);
+ return ret;
+ }
+
+ clk_enable(priv->clk);
+
+ /* FIXME: silly const unsigned int hclk */
+ *(unsigned int *)&priv->mmc_data.hclk = clk_get_rate(priv->clk);
+
+ memcpy(&priv->cell_mmc, &sh_mobile_sdhi_cell, sizeof(priv->cell_mmc));
+ priv->cell_mmc.driver_data = &priv->mmc_data;
+ priv->cell_mmc.platform_data = &priv->cell_mmc;
+ priv->cell_mmc.data_size = sizeof(priv->cell_mmc);
+
+ platform_set_drvdata(pdev, priv);
+
+ ret = mfd_add_devices(&pdev->dev, pdev->id,
+ &priv->cell_mmc, 1, mem, irq);
+ if (ret) {
+ clk_disable(priv->clk);
+ clk_put(priv->clk);
+ kfree(priv);
+ }
+
+ return ret;
+}
+
+static int sh_mobile_sdhi_remove(struct platform_device *pdev)
+{
+ struct sh_mobile_sdhi *priv = platform_get_drvdata(pdev);
+
+ mfd_remove_devices(&pdev->dev);
+ clk_disable(priv->clk);
+ clk_put(priv->clk);
+ kfree(priv);
+
+ return 0;
+}
+
+static struct platform_driver sh_mobile_sdhi_driver = {
+ .driver = {
+ .name = "sh_mobile_sdhi",
+ .owner = THIS_MODULE,
+ },
+ .probe = sh_mobile_sdhi_probe,
+ .remove = __devexit_p(sh_mobile_sdhi_remove),
+};
+
+static int __init sh_mobile_sdhi_init(void)
+{
+ return platform_driver_register(&sh_mobile_sdhi_driver);
+}
+
+static void __exit sh_mobile_sdhi_exit(void)
+{
+ platform_driver_unregister(&sh_mobile_sdhi_driver);
+}
+
+module_init(sh_mobile_sdhi_init);
+module_exit(sh_mobile_sdhi_exit);
+
+MODULE_DESCRIPTION("SuperH Mobile SDHI driver");
+MODULE_AUTHOR("Magnus Damm");
+MODULE_LICENSE("GPL v2");
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH 02/07] mmc: Add SuperH to the tmio-mmc Kconfig
2009-10-02 2:21 [PATCH 00/07] sh: SuperH Mobile SDHI changes Magnus Damm
2009-10-02 2:22 ` [PATCH 01/07] mfd: Add SuperH Mobile SDHI platform driver Magnus Damm
@ 2009-10-02 2:22 ` Magnus Damm
2009-10-02 2:22 ` [PATCH 03/07] mmc: Remove const from tmio-mmc platform data Magnus Damm
` (6 subsequent siblings)
8 siblings, 0 replies; 12+ messages in thread
From: Magnus Damm @ 2009-10-02 2:22 UTC (permalink / raw)
To: linux-sh; +Cc: linux-mmc, g.liakhovetski, ian, lethal, Magnus Damm, akpm
From: Magnus Damm <damm@opensource.se>
Add SUPERH to the Kconfig dependencies for tmio_mmc.
This change allows us to drive the SDHI hardware blocks
found in SuperH Mobile with tmio_mmc.
Signed-off-by: Magnus Damm <damm@opensource.se>
---
drivers/mmc/host/Kconfig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- 0001/drivers/mmc/host/Kconfig
+++ work/drivers/mmc/host/Kconfig 2009-09-30 17:26:02.000000000 +0900
@@ -288,7 +288,7 @@ config MMC_SDRICOH_CS
config MMC_TMIO
tristate "Toshiba Mobile IO Controller (TMIO) MMC/SD function support"
- depends on MFD_TMIO || MFD_ASIC3
+ depends on MFD_TMIO || MFD_ASIC3 || SUPERH
help
This provides support for the SD/MMC cell found in TC6393XB,
T7L66XB and also HTC ASIC3
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH 03/07] mmc: Remove const from tmio-mmc platform data
2009-10-02 2:21 [PATCH 00/07] sh: SuperH Mobile SDHI changes Magnus Damm
2009-10-02 2:22 ` [PATCH 01/07] mfd: Add SuperH Mobile SDHI platform driver Magnus Damm
2009-10-02 2:22 ` [PATCH 02/07] mmc: Add SuperH to the tmio-mmc Kconfig Magnus Damm
@ 2009-10-02 2:22 ` Magnus Damm
2009-10-02 2:22 ` [PATCH 04/07] sh: SDHI platform data to the Migo-R board Magnus Damm
` (5 subsequent siblings)
8 siblings, 0 replies; 12+ messages in thread
From: Magnus Damm @ 2009-10-02 2:22 UTC (permalink / raw)
To: linux-sh; +Cc: akpm, linux-mmc, ian, lethal, Magnus Damm, g.liakhovetski
From: Magnus Damm <damm@opensource.se>
Remove const from the hclk member of the tmio-mmc platform
data. This to allow assigning a value dynamically to the
platform data in the SuperH Mobile SDHI driver.
Signed-off-by: Magnus Damm <damm@opensource.se>
---
Depends on the SuperH Mobile SDHI driver.
drivers/mfd/sh_mobile_sdhi.c | 4 +---
include/linux/mfd/tmio.h | 2 +-
2 files changed, 2 insertions(+), 4 deletions(-)
--- 0008/drivers/mfd/sh_mobile_sdhi.c
+++ work/drivers/mfd/sh_mobile_sdhi.c 2009-10-02 09:58:40.000000000 +0900
@@ -84,9 +84,7 @@ static int __init sh_mobile_sdhi_probe(s
}
clk_enable(priv->clk);
-
- /* FIXME: silly const unsigned int hclk */
- *(unsigned int *)&priv->mmc_data.hclk = clk_get_rate(priv->clk);
+ priv->mmc_data.hclk = clk_get_rate(priv->clk);
memcpy(&priv->cell_mmc, &sh_mobile_sdhi_cell, sizeof(priv->cell_mmc));
priv->cell_mmc.driver_data = &priv->mmc_data;
--- 0002/include/linux/mfd/tmio.h
+++ work/include/linux/mfd/tmio.h 2009-10-02 09:55:50.000000000 +0900
@@ -53,7 +53,7 @@ void tmio_core_mmc_clk_div(void __iomem
* data for the MMC controller
*/
struct tmio_mmc_data {
- const unsigned int hclk;
+ unsigned int hclk;
void (*set_pwr)(struct platform_device *host, int state);
void (*set_no_clk_div)(struct platform_device *host, int state);
};
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH 04/07] sh: SDHI platform data to the Migo-R board
2009-10-02 2:21 [PATCH 00/07] sh: SuperH Mobile SDHI changes Magnus Damm
` (2 preceding siblings ...)
2009-10-02 2:22 ` [PATCH 03/07] mmc: Remove const from tmio-mmc platform data Magnus Damm
@ 2009-10-02 2:22 ` Magnus Damm
2009-10-02 2:22 ` [PATCH 05/07] sh: SDHI platform data to the AP325RXA board Magnus Damm
` (4 subsequent siblings)
8 siblings, 0 replies; 12+ messages in thread
From: Magnus Damm @ 2009-10-02 2:22 UTC (permalink / raw)
To: linux-sh; +Cc: linux-mmc, g.liakhovetski, ian, lethal, Magnus Damm, akpm
From: Magnus Damm <damm@opensource.se>
Convert the Migo-R board to use sh_mobile_sdhi for the
SD Card connected to CN9 instead of mmc_spi.
Signed-off-by: Magnus Damm <damm@opensource.se>
---
arch/sh/boards/mach-migor/setup.c | 52 +++++++++++++++++++------------------
1 file changed, 28 insertions(+), 24 deletions(-)
--- 0001/arch/sh/boards/mach-migor/setup.c
+++ work/arch/sh/boards/mach-migor/setup.c 2009-10-02 09:41:19.000000000 +0900
@@ -18,8 +18,6 @@
#include <linux/delay.h>
#include <linux/clk.h>
#include <linux/gpio.h>
-#include <linux/spi/spi.h>
-#include <linux/spi/spi_gpio.h>
#include <video/sh_mobile_lcdc.h>
#include <media/sh_mobile_ceu.h>
#include <media/ov772x.h>
@@ -390,17 +388,25 @@ static struct platform_device migor_ceu_
},
};
-struct spi_gpio_platform_data sdcard_cn9_platform_data = {
- .sck = GPIO_PTD0,
- .mosi = GPIO_PTD1,
- .miso = GPIO_PTD2,
- .num_chipselect = 1,
+static struct resource sdhi_cn9_resources[] = {
+ [0] = {
+ .name = "SDHI",
+ .start = 0x04ce0000,
+ .end = 0x04ce01ff,
+ .flags = IORESOURCE_MEM,
+ },
+ [1] = {
+ .start = 101,
+ .flags = IORESOURCE_IRQ,
+ },
};
-static struct platform_device sdcard_cn9_device = {
- .name = "spi_gpio",
- .dev = {
- .platform_data = &sdcard_cn9_platform_data,
+static struct platform_device sdhi_cn9_device = {
+ .name = "sh_mobile_sdhi",
+ .num_resources = ARRAY_SIZE(sdhi_cn9_resources),
+ .resource = sdhi_cn9_resources,
+ .archdata = {
+ .hwblk_id = HWBLK_SDHI,
},
};
@@ -467,20 +473,11 @@ static struct platform_device *migor_dev
&migor_ceu_device,
&migor_nor_flash_device,
&migor_nand_flash_device,
- &sdcard_cn9_device,
+ &sdhi_cn9_device,
&migor_camera[0],
&migor_camera[1],
};
-static struct spi_board_info migor_spi_devices[] = {
- {
- .modalias = "mmc_spi",
- .max_speed_hz = 5000000,
- .chip_select = 0,
- .controller_data = (void *) GPIO_PTD5,
- },
-};
-
static int __init migor_devices_setup(void)
{
@@ -525,6 +522,16 @@ static int __init migor_devices_setup(vo
gpio_request(GPIO_PTA1, NULL);
gpio_direction_input(GPIO_PTA1);
+ /* SDHI */
+ gpio_request(GPIO_FN_SDHICD, NULL);
+ gpio_request(GPIO_FN_SDHIWP, NULL);
+ gpio_request(GPIO_FN_SDHID3, NULL);
+ gpio_request(GPIO_FN_SDHID2, NULL);
+ gpio_request(GPIO_FN_SDHID1, NULL);
+ gpio_request(GPIO_FN_SDHID0, NULL);
+ gpio_request(GPIO_FN_SDHICMD, NULL);
+ gpio_request(GPIO_FN_SDHICLK, NULL);
+
/* Touch Panel */
gpio_request(GPIO_FN_IRQ6, NULL);
@@ -612,9 +619,6 @@ static int __init migor_devices_setup(vo
i2c_register_board_info(0, migor_i2c_devices,
ARRAY_SIZE(migor_i2c_devices));
- spi_register_board_info(migor_spi_devices,
- ARRAY_SIZE(migor_spi_devices));
-
return platform_add_devices(migor_devices, ARRAY_SIZE(migor_devices));
}
arch_initcall(migor_devices_setup);
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH 05/07] sh: SDHI platform data to the AP325RXA board
2009-10-02 2:21 [PATCH 00/07] sh: SuperH Mobile SDHI changes Magnus Damm
` (3 preceding siblings ...)
2009-10-02 2:22 ` [PATCH 04/07] sh: SDHI platform data to the Migo-R board Magnus Damm
@ 2009-10-02 2:22 ` Magnus Damm
2009-10-02 2:23 ` [PATCH 06/07] sh: SDHI platform data to the SE7724 board Magnus Damm
` (3 subsequent siblings)
8 siblings, 0 replies; 12+ messages in thread
From: Magnus Damm @ 2009-10-02 2:22 UTC (permalink / raw)
To: linux-sh; +Cc: akpm, linux-mmc, ian, lethal, Magnus Damm, g.liakhovetski
From: Magnus Damm <damm@opensource.se>
Convert the AP325 board to use sh_mobile_sdhi for the
SD Card connected to CN3 instead of mmc_spi.
Signed-off-by: Magnus Damm <damm@opensource.se>
---
arch/sh/boards/board-ap325rxa.c | 52 +++++++++++++++++++++------------------
1 file changed, 28 insertions(+), 24 deletions(-)
--- 0001/arch/sh/boards/board-ap325rxa.c
+++ work/arch/sh/boards/board-ap325rxa.c 2009-10-02 09:44:21.000000000 +0900
@@ -20,8 +20,6 @@
#include <linux/i2c.h>
#include <linux/smsc911x.h>
#include <linux/gpio.h>
-#include <linux/spi/spi.h>
-#include <linux/spi/spi_gpio.h>
#include <media/ov772x.h>
#include <media/soc_camera.h>
#include <media/soc_camera_platform.h>
@@ -409,17 +407,25 @@ static struct platform_device ceu_device
},
};
-struct spi_gpio_platform_data sdcard_cn3_platform_data = {
- .sck = GPIO_PTD0,
- .mosi = GPIO_PTD1,
- .miso = GPIO_PTD2,
- .num_chipselect = 1,
+static struct resource sdhi0_cn3_resources[] = {
+ [0] = {
+ .name = "SDHI0",
+ .start = 0x04ce0000,
+ .end = 0x04ce01ff,
+ .flags = IORESOURCE_MEM,
+ },
+ [1] = {
+ .start = 101,
+ .flags = IORESOURCE_IRQ,
+ },
};
-static struct platform_device sdcard_cn3_device = {
- .name = "spi_gpio",
- .dev = {
- .platform_data = &sdcard_cn3_platform_data,
+static struct platform_device sdhi0_cn3_device = {
+ .name = "sh_mobile_sdhi",
+ .num_resources = ARRAY_SIZE(sdhi0_cn3_resources),
+ .resource = sdhi0_cn3_resources,
+ .archdata = {
+ .hwblk_id = HWBLK_SDHI0,
},
};
@@ -470,20 +476,11 @@ static struct platform_device *ap325rxa_
&lcdc_device,
&ceu_device,
&nand_flash_device,
- &sdcard_cn3_device,
+ &sdhi0_cn3_device,
&ap325rxa_camera[0],
&ap325rxa_camera[1],
};
-static struct spi_board_info ap325rxa_spi_devices[] = {
- {
- .modalias = "mmc_spi",
- .max_speed_hz = 5000000,
- .chip_select = 0,
- .controller_data = (void *) GPIO_PTD5,
- },
-};
-
static int __init ap325rxa_devices_setup(void)
{
/* LD3 and LD4 LEDs */
@@ -578,12 +575,19 @@ static int __init ap325rxa_devices_setup
platform_resource_setup_memory(&ceu_device, "ceu", 4 << 20);
+ /* SDHI0 */
+ gpio_request(GPIO_FN_SDHI0CD_PTD, NULL);
+ gpio_request(GPIO_FN_SDHI0WP_PTD, NULL);
+ gpio_request(GPIO_FN_SDHI0D3_PTD, NULL);
+ gpio_request(GPIO_FN_SDHI0D2_PTD, NULL);
+ gpio_request(GPIO_FN_SDHI0D1_PTD, NULL);
+ gpio_request(GPIO_FN_SDHI0D0_PTD, NULL);
+ gpio_request(GPIO_FN_SDHI0CMD_PTD, NULL);
+ gpio_request(GPIO_FN_SDHI0CLK_PTD, NULL);
+
i2c_register_board_info(0, ap325rxa_i2c_devices,
ARRAY_SIZE(ap325rxa_i2c_devices));
- spi_register_board_info(ap325rxa_spi_devices,
- ARRAY_SIZE(ap325rxa_spi_devices));
-
return platform_add_devices(ap325rxa_devices,
ARRAY_SIZE(ap325rxa_devices));
}
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH 06/07] sh: SDHI platform data to the SE7724 board
2009-10-02 2:21 [PATCH 00/07] sh: SuperH Mobile SDHI changes Magnus Damm
` (4 preceding siblings ...)
2009-10-02 2:22 ` [PATCH 05/07] sh: SDHI platform data to the AP325RXA board Magnus Damm
@ 2009-10-02 2:23 ` Magnus Damm
2009-10-02 2:23 ` [PATCH 07/07] sh: SDHI platform data to the kfr2r09 board Magnus Damm
` (2 subsequent siblings)
8 siblings, 0 replies; 12+ messages in thread
From: Magnus Damm @ 2009-10-02 2:23 UTC (permalink / raw)
To: linux-sh; +Cc: linux-mmc, g.liakhovetski, ian, lethal, Magnus Damm, akpm
From: Magnus Damm <damm@opensource.se>
Add SD Card support to the se7724 board using the
sh_mobile_sdhi driver hooked up to SDHI0 and CN7.
Signed-off-by: Magnus Damm <damm@opensource.se>
---
arch/sh/boards/mach-se/7724/setup.c | 33 +++++++++++++++++++++++++++++++++
1 file changed, 33 insertions(+)
--- 0001/arch/sh/boards/mach-se/7724/setup.c
+++ work/arch/sh/boards/mach-se/7724/setup.c 2009-10-02 09:46:17.000000000 +0900
@@ -448,6 +448,28 @@ static struct platform_device sh7724_usb
.resource = sh7724_usb1_gadget_resources,
};
+static struct resource sdhi0_cn7_resources[] = {
+ [0] = {
+ .name = "SDHI0",
+ .start = 0x04ce0000,
+ .end = 0x04ce01ff,
+ .flags = IORESOURCE_MEM,
+ },
+ [1] = {
+ .start = 101,
+ .flags = IORESOURCE_IRQ,
+ },
+};
+
+static struct platform_device sdhi0_cn7_device = {
+ .name = "sh_mobile_sdhi",
+ .num_resources = ARRAY_SIZE(sdhi0_cn7_resources),
+ .resource = sdhi0_cn7_resources,
+ .archdata = {
+ .hwblk_id = HWBLK_SDHI0,
+ },
+};
+
static struct platform_device *ms7724se_devices[] __initdata = {
&heartbeat_device,
&smc91x_eth_device,
@@ -460,6 +482,7 @@ static struct platform_device *ms7724se_
&sh7724_usb0_host_device,
&sh7724_usb1_gadget_device,
&fsi_device,
+ &sdhi0_cn7_device,
};
#define EEPROM_OP 0xBA206000
@@ -698,6 +721,16 @@ static int __init devices_setup(void)
clk_set_rate(&fsimcka_clk, 11000);
clk_put(fsia_clk);
+ /* SDHI0 connected to cn7 */
+ gpio_request(GPIO_FN_SDHI0CD, NULL);
+ gpio_request(GPIO_FN_SDHI0WP, NULL);
+ gpio_request(GPIO_FN_SDHI0D3, NULL);
+ gpio_request(GPIO_FN_SDHI0D2, NULL);
+ gpio_request(GPIO_FN_SDHI0D1, NULL);
+ gpio_request(GPIO_FN_SDHI0D0, NULL);
+ gpio_request(GPIO_FN_SDHI0CMD, NULL);
+ gpio_request(GPIO_FN_SDHI0CLK, NULL);
+
/*
* enable SH-Eth
*
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH 07/07] sh: SDHI platform data to the kfr2r09 board
2009-10-02 2:21 [PATCH 00/07] sh: SuperH Mobile SDHI changes Magnus Damm
` (5 preceding siblings ...)
2009-10-02 2:23 ` [PATCH 06/07] sh: SDHI platform data to the SE7724 board Magnus Damm
@ 2009-10-02 2:23 ` Magnus Damm
2009-10-02 18:23 ` [PATCH 00/07] sh: SuperH Mobile SDHI changes Ian Molton
2009-10-05 2:23 ` Paul Mundt
8 siblings, 0 replies; 12+ messages in thread
From: Magnus Damm @ 2009-10-02 2:23 UTC (permalink / raw)
To: linux-sh; +Cc: akpm, linux-mmc, ian, lethal, Magnus Damm, g.liakhovetski
From: Magnus Damm <damm@opensource.se>
Add SD Card support to the kfr2r09 board using the
sh_mobile_sdhi driver hooked up to SDHI0 and yc304.
Signed-off-by: Magnus Damm <damm@opensource.se>
---
arch/sh/boards/mach-kfr2r09/setup.c | 33 +++++++++++++++++++++++++++++++++
1 file changed, 33 insertions(+)
--- 0001/arch/sh/boards/mach-kfr2r09/setup.c
+++ work/arch/sh/boards/mach-kfr2r09/setup.c 2009-10-01 13:22:17.000000000 +0900
@@ -212,11 +212,34 @@ static struct platform_device kfr2r09_us
.resource = kfr2r09_usb0_gadget_resources,
};
+static struct resource kfr2r09_sh_sdhi0_resources[] = {
+ [0] = {
+ .name = "SDHI0",
+ .start = 0x04ce0000,
+ .end = 0x04ce01ff,
+ .flags = IORESOURCE_MEM,
+ },
+ [1] = {
+ .start = 101,
+ .flags = IORESOURCE_IRQ,
+ },
+};
+
+static struct platform_device kfr2r09_sh_sdhi0_device = {
+ .name = "sh_mobile_sdhi",
+ .num_resources = ARRAY_SIZE(kfr2r09_sh_sdhi0_resources),
+ .resource = kfr2r09_sh_sdhi0_resources,
+ .archdata = {
+ .hwblk_id = HWBLK_SDHI0,
+ },
+};
+
static struct platform_device *kfr2r09_devices[] __initdata = {
&kfr2r09_nor_flash_device,
&kfr2r09_nand_flash_device,
&kfr2r09_sh_keysc_device,
&kfr2r09_sh_lcdc_device,
+ &kfr2r09_sh_sdhi0_device,
};
#define BSC_CS0BCR 0xfec10004
@@ -361,6 +384,16 @@ static int __init kfr2r09_devices_setup(
if (kfr2r09_usb0_gadget_setup() = 0)
platform_device_register(&kfr2r09_usb0_gadget_device);
+ /* SDHI0 connected to yc304 */
+ gpio_request(GPIO_FN_SDHI0CD, NULL);
+ gpio_request(GPIO_FN_SDHI0WP, NULL);
+ gpio_request(GPIO_FN_SDHI0D3, NULL);
+ gpio_request(GPIO_FN_SDHI0D2, NULL);
+ gpio_request(GPIO_FN_SDHI0D1, NULL);
+ gpio_request(GPIO_FN_SDHI0D0, NULL);
+ gpio_request(GPIO_FN_SDHI0CMD, NULL);
+ gpio_request(GPIO_FN_SDHI0CLK, NULL);
+
return platform_add_devices(kfr2r09_devices,
ARRAY_SIZE(kfr2r09_devices));
}
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 00/07] sh: SuperH Mobile SDHI changes
2009-10-02 2:21 [PATCH 00/07] sh: SuperH Mobile SDHI changes Magnus Damm
` (6 preceding siblings ...)
2009-10-02 2:23 ` [PATCH 07/07] sh: SDHI platform data to the kfr2r09 board Magnus Damm
@ 2009-10-02 18:23 ` Ian Molton
2009-10-08 21:53 ` Andrew Morton
2009-10-05 2:23 ` Paul Mundt
8 siblings, 1 reply; 12+ messages in thread
From: Ian Molton @ 2009-10-02 18:23 UTC (permalink / raw)
To: Magnus Damm; +Cc: linux-sh, linux-mmc, g.liakhovetski, lethal, akpm
I'm ok with the superH patches now. Those that depend on my patchset
which will be waiting on ASIC3 (my patchset needs to support ASIC3 to
avoid breaking already merged drivers).
Andrew: am I passing MMC patches via you?
2009/10/2 Magnus Damm <magnus.damm@gmail.com>:
> sh: SuperH Mobile SDHI changes
>
> [PATCH 01/07] mfd: Add SuperH Mobile SDHI platform driver
> [PATCH 02/07] mmc: Add SuperH to the tmio-mmc Kconfig
> [PATCH 03/07] mmc: Remove const from tmio-mmc platform data
> [PATCH 04/07] sh: SDHI platform data to the Migo-R board
> [PATCH 05/07] sh: SDHI platform data to the AP325RXA board
> [PATCH 06/07] sh: SDHI platform data to the SE7724 board
> [PATCH 07/07] sh: SDHI platform data to the kfr2r09 board
>
> These patches contain the SuperH specific changes needed for
> the tmio-mmc driver to work with SuperH Mobile SDHI hardware.
>
> The tmio-mmc patch 0001-MMC-hardware-abstraction-for-CNF-area.patch
> by Ian Molton is needed for correct run time behaviour. Without
> this patch the tmio-mmc probe() fails gracefully.
>
> I suggest merging the series in the SuperH tree. Not sure about
> the best way to merge the patch by Ian.
>
> Signed-off-by: Magnus Damm <damm@opensource.se>
> ---
>
> arch/sh/boards/board-ap325rxa.c | 52 ++++++------
> arch/sh/boards/mach-kfr2r09/setup.c | 33 +++++++
> arch/sh/boards/mach-migor/setup.c | 52 ++++++------
> arch/sh/boards/mach-se/7724/setup.c | 33 +++++++
> drivers/mfd/Kconfig | 8 +
> drivers/mfd/Makefile | 1
> drivers/mfd/sh_mobile_sdhi.c | 149 ++++++++++++++++++++++++++++++++++-
> drivers/mmc/host/Kconfig | 2
> include/linux/mfd/tmio.h | 2
> 9 files changed, 279 insertions(+), 53 deletions(-)
>
--
Ian Molton
Linux, Automotive, and other hacking:
http://www.mnementh.co.uk/
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 00/07] sh: SuperH Mobile SDHI changes
2009-10-02 2:21 [PATCH 00/07] sh: SuperH Mobile SDHI changes Magnus Damm
` (7 preceding siblings ...)
2009-10-02 18:23 ` [PATCH 00/07] sh: SuperH Mobile SDHI changes Ian Molton
@ 2009-10-05 2:23 ` Paul Mundt
2009-10-05 20:02 ` Ian Molton
8 siblings, 1 reply; 12+ messages in thread
From: Paul Mundt @ 2009-10-05 2:23 UTC (permalink / raw)
To: Magnus Damm; +Cc: linux-sh, linux-mmc, g.liakhovetski, ian, akpm
On Fri, Oct 02, 2009 at 11:21:58AM +0900, Magnus Damm wrote:
> sh: SuperH Mobile SDHI changes
>
> [PATCH 01/07] mfd: Add SuperH Mobile SDHI platform driver
> [PATCH 02/07] mmc: Add SuperH to the tmio-mmc Kconfig
> [PATCH 03/07] mmc: Remove const from tmio-mmc platform data
> [PATCH 04/07] sh: SDHI platform data to the Migo-R board
> [PATCH 05/07] sh: SDHI platform data to the AP325RXA board
> [PATCH 06/07] sh: SDHI platform data to the SE7724 board
> [PATCH 07/07] sh: SDHI platform data to the kfr2r09 board
>
> These patches contain the SuperH specific changes needed for
> the tmio-mmc driver to work with SuperH Mobile SDHI hardware.
>
> The tmio-mmc patch 0001-MMC-hardware-abstraction-for-CNF-area.patch
> by Ian Molton is needed for correct run time behaviour. Without
> this patch the tmio-mmc probe() fails gracefully.
>
> I suggest merging the series in the SuperH tree. Not sure about
> the best way to merge the patch by Ian.
>
> Signed-off-by: Magnus Damm <damm@opensource.se>
At least patch 3/7 depends on Ian's patch being merged first, so there's
little point in merging this series until that hits upstream. So I'll
hold off on this for now.
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 00/07] sh: SuperH Mobile SDHI changes
2009-10-05 2:23 ` Paul Mundt
@ 2009-10-05 20:02 ` Ian Molton
0 siblings, 0 replies; 12+ messages in thread
From: Ian Molton @ 2009-10-05 20:02 UTC (permalink / raw)
To: Paul Mundt, Magnus Damm, linux-sh, linux-mmc, g.liakhovetski, ian,
akpm
Im awaiting a reply from the linux-next folk
2009/10/5 Paul Mundt <lethal@linux-sh.org>:
> On Fri, Oct 02, 2009 at 11:21:58AM +0900, Magnus Damm wrote:
>> sh: SuperH Mobile SDHI changes
>>
>> [PATCH 01/07] mfd: Add SuperH Mobile SDHI platform driver
>> [PATCH 02/07] mmc: Add SuperH to the tmio-mmc Kconfig
>> [PATCH 03/07] mmc: Remove const from tmio-mmc platform data
>> [PATCH 04/07] sh: SDHI platform data to the Migo-R board
>> [PATCH 05/07] sh: SDHI platform data to the AP325RXA board
>> [PATCH 06/07] sh: SDHI platform data to the SE7724 board
>> [PATCH 07/07] sh: SDHI platform data to the kfr2r09 board
>>
>> These patches contain the SuperH specific changes needed for
>> the tmio-mmc driver to work with SuperH Mobile SDHI hardware.
>>
>> The tmio-mmc patch 0001-MMC-hardware-abstraction-for-CNF-area.patch
>> by Ian Molton is needed for correct run time behaviour. Without
>> this patch the tmio-mmc probe() fails gracefully.
>>
>> I suggest merging the series in the SuperH tree. Not sure about
>> the best way to merge the patch by Ian.
>>
>> Signed-off-by: Magnus Damm <damm@opensource.se>
>
> At least patch 3/7 depends on Ian's patch being merged first, so there's
> little point in merging this series until that hits upstream. So I'll
> hold off on this for now.
>
--
Ian Molton
Linux, Automotive, and other hacking:
http://www.mnementh.co.uk/
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 00/07] sh: SuperH Mobile SDHI changes
2009-10-02 18:23 ` [PATCH 00/07] sh: SuperH Mobile SDHI changes Ian Molton
@ 2009-10-08 21:53 ` Andrew Morton
0 siblings, 0 replies; 12+ messages in thread
From: Andrew Morton @ 2009-10-08 21:53 UTC (permalink / raw)
To: Ian Molton; +Cc: Magnus Damm, linux-sh, linux-mmc, g.liakhovetski, lethal
On Fri, 2 Oct 2009 19:23:28 +0100
Ian Molton <ian@mnementh.co.uk> wrote:
> I'm ok with the superH patches now. Those that depend on my patchset
> which will be waiting on ASIC3 (my patchset needs to support ASIC3 to
> avoid breaking already merged drivers).
>
> Andrew: am I passing MMC patches via you?
>
yup.
I can't locate 0001-MMC-hardware-abstraction-for-CNF-area.patch
anywhere so I can't help with this merge.
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2009-10-08 21:53 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-02 2:21 [PATCH 00/07] sh: SuperH Mobile SDHI changes Magnus Damm
2009-10-02 2:22 ` [PATCH 01/07] mfd: Add SuperH Mobile SDHI platform driver Magnus Damm
2009-10-02 2:22 ` [PATCH 02/07] mmc: Add SuperH to the tmio-mmc Kconfig Magnus Damm
2009-10-02 2:22 ` [PATCH 03/07] mmc: Remove const from tmio-mmc platform data Magnus Damm
2009-10-02 2:22 ` [PATCH 04/07] sh: SDHI platform data to the Migo-R board Magnus Damm
2009-10-02 2:22 ` [PATCH 05/07] sh: SDHI platform data to the AP325RXA board Magnus Damm
2009-10-02 2:23 ` [PATCH 06/07] sh: SDHI platform data to the SE7724 board Magnus Damm
2009-10-02 2:23 ` [PATCH 07/07] sh: SDHI platform data to the kfr2r09 board Magnus Damm
2009-10-02 18:23 ` [PATCH 00/07] sh: SuperH Mobile SDHI changes Ian Molton
2009-10-08 21:53 ` Andrew Morton
2009-10-05 2:23 ` Paul Mundt
2009-10-05 20:02 ` Ian Molton
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).