All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH V2 00/10] mmc_of_parse() adaptations, DT support for Sheevaplugs
@ 2013-05-13 21:18 ` Simon Baatz
  0 siblings, 0 replies; 43+ messages in thread
From: Simon Baatz @ 2013-05-13 21:18 UTC (permalink / raw)
  To: linux-arm-kernel, linux-mmc, devicetree-discuss
  Cc: Jason Cooper, Andrew Lunn, Chris Ball, Guennadi Liakhovetski,
	Thomas Petazzoni

While adding DT support for the Sheevaplugs by Globalscale Technologies
(Kirkwood), it turned out that the DT binding of mvsdio lacked features to
properly support the hardware (active high/low of CD and WP pins could not
be described in DT).

This is standard functionality provided by the mmc_of_parse() helper
function.  However, mmc_of_parse() may allocate GPIO lines.  If the
allocation fails, it outputs an error, but does not return an error to its
caller.  Therefore, a proposal to handle errors in mmc_of_parse() is made.

The patch set is structured as follows:

1   Adapt mmc_of_parse() to return errors
2-6 Handle errors in current drivers using mmc_of_parse() (compile tested
    only)
7-8 Convert mvsdio and respective dts files to mmc_of_parse() (tested on
    kirkwood)
9   Add dts files for (eSATA) Sheevaplug
10  Add DT support for (eSATA) Sheevaplug


I could only test on an eSATA Sheevaplug. I found patches with
different LEDs for the Sheevaplug.  Thus, I would highly appreciate if
someone with the hardware could give this a spin on a non-eSATA
version.  Some additional testing of the change detect and write
protect behaviour for mvsdio can't hurt either.  I hope that there aren't
board revisions with different CD/WP pins out there.

Simon Baatz (10):
  mmc: return mmc_of_parse() errors to caller
  mmc: sh_mmcif: handle mmc_of_parse() errors during probe
  mmc: tmio-mmc: handle mmc_of_parse() errors during probe
  mmc: mxcmmc: handle mmc_of_parse() errors during probe
  mmc: sdhi-pxav3: handle mmc_of_parse() errors during probe
  mmc: tegra: handle mmc_of_parse() errors during probe
  ARM: mvebu: Use standard MMC binding for all users of mvsdio
  mmc: mvsdio: use standard MMC device-tree binding parser
    mmc_of_parse()
  ARM: Kirkwood: Add dts files for Sheevaplug and eSATA Sheevaplug
  ARM: Kirkwood: add DT support for Sheevaplug and Sheevaplug eSATA

 arch/arm/boot/dts/Makefile                         |    2 +
 arch/arm/boot/dts/armada-370-db.dts                |    1 +
 arch/arm/boot/dts/armada-370-mirabox.dts           |    1 +
 arch/arm/boot/dts/armada-370-rd.dts                |    1 +
 arch/arm/boot/dts/armada-370-xp.dtsi               |    4 +
 arch/arm/boot/dts/armada-xp-db.dts                 |    1 +
 arch/arm/boot/dts/kirkwood-dreamplug.dts           |    1 +
 .../arm/boot/dts/kirkwood-guruplug-server-plus.dts |    2 +
 arch/arm/boot/dts/kirkwood-mplcec4.dts             |    2 +-
 arch/arm/boot/dts/kirkwood-sheevaplug-common.dtsi  |   97 ++++++++++++++++++++
 arch/arm/boot/dts/kirkwood-sheevaplug-esata.dts    |   40 ++++++++
 arch/arm/boot/dts/kirkwood-sheevaplug.dts          |   45 +++++++++
 arch/arm/boot/dts/kirkwood-topkick.dts             |    1 +
 arch/arm/boot/dts/kirkwood.dtsi                    |    4 +
 arch/arm/mach-kirkwood/Kconfig                     |    7 ++
 arch/arm/mach-kirkwood/Makefile                    |    1 +
 arch/arm/mach-kirkwood/board-dt.c                  |    4 +
 arch/arm/mach-kirkwood/board-sheevaplug.c          |   27 ++++++
 arch/arm/mach-kirkwood/common.h                    |    5 +
 drivers/mmc/core/host.c                            |   24 ++++-
 drivers/mmc/host/mvsdio.c                          |   73 ++++++++-------
 drivers/mmc/host/mxcmmc.c                          |    4 +-
 drivers/mmc/host/sdhci-pxav3.c                     |    7 +-
 drivers/mmc/host/sdhci-tegra.c                     |    9 +-
 drivers/mmc/host/sh_mmcif.c                        |    7 +-
 drivers/mmc/host/tmio_mmc_pio.c                    |    4 +-
 include/linux/mmc/host.h                           |    2 +-
 27 files changed, 328 insertions(+), 48 deletions(-)
 create mode 100644 arch/arm/boot/dts/kirkwood-sheevaplug-common.dtsi
 create mode 100644 arch/arm/boot/dts/kirkwood-sheevaplug-esata.dts
 create mode 100644 arch/arm/boot/dts/kirkwood-sheevaplug.dts
 create mode 100644 arch/arm/mach-kirkwood/board-sheevaplug.c

-- 
1.7.9.5


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

* [PATCH V2 00/10] mmc_of_parse() adaptations, DT support for Sheevaplugs
@ 2013-05-13 21:18 ` Simon Baatz
  0 siblings, 0 replies; 43+ messages in thread
From: Simon Baatz @ 2013-05-13 21:18 UTC (permalink / raw)
  To: linux-arm-kernel

While adding DT support for the Sheevaplugs by Globalscale Technologies
(Kirkwood), it turned out that the DT binding of mvsdio lacked features to
properly support the hardware (active high/low of CD and WP pins could not
be described in DT).

This is standard functionality provided by the mmc_of_parse() helper
function.  However, mmc_of_parse() may allocate GPIO lines.  If the
allocation fails, it outputs an error, but does not return an error to its
caller.  Therefore, a proposal to handle errors in mmc_of_parse() is made.

The patch set is structured as follows:

1   Adapt mmc_of_parse() to return errors
2-6 Handle errors in current drivers using mmc_of_parse() (compile tested
    only)
7-8 Convert mvsdio and respective dts files to mmc_of_parse() (tested on
    kirkwood)
9   Add dts files for (eSATA) Sheevaplug
10  Add DT support for (eSATA) Sheevaplug


I could only test on an eSATA Sheevaplug. I found patches with
different LEDs for the Sheevaplug.  Thus, I would highly appreciate if
someone with the hardware could give this a spin on a non-eSATA
version.  Some additional testing of the change detect and write
protect behaviour for mvsdio can't hurt either.  I hope that there aren't
board revisions with different CD/WP pins out there.

Simon Baatz (10):
  mmc: return mmc_of_parse() errors to caller
  mmc: sh_mmcif: handle mmc_of_parse() errors during probe
  mmc: tmio-mmc: handle mmc_of_parse() errors during probe
  mmc: mxcmmc: handle mmc_of_parse() errors during probe
  mmc: sdhi-pxav3: handle mmc_of_parse() errors during probe
  mmc: tegra: handle mmc_of_parse() errors during probe
  ARM: mvebu: Use standard MMC binding for all users of mvsdio
  mmc: mvsdio: use standard MMC device-tree binding parser
    mmc_of_parse()
  ARM: Kirkwood: Add dts files for Sheevaplug and eSATA Sheevaplug
  ARM: Kirkwood: add DT support for Sheevaplug and Sheevaplug eSATA

 arch/arm/boot/dts/Makefile                         |    2 +
 arch/arm/boot/dts/armada-370-db.dts                |    1 +
 arch/arm/boot/dts/armada-370-mirabox.dts           |    1 +
 arch/arm/boot/dts/armada-370-rd.dts                |    1 +
 arch/arm/boot/dts/armada-370-xp.dtsi               |    4 +
 arch/arm/boot/dts/armada-xp-db.dts                 |    1 +
 arch/arm/boot/dts/kirkwood-dreamplug.dts           |    1 +
 .../arm/boot/dts/kirkwood-guruplug-server-plus.dts |    2 +
 arch/arm/boot/dts/kirkwood-mplcec4.dts             |    2 +-
 arch/arm/boot/dts/kirkwood-sheevaplug-common.dtsi  |   97 ++++++++++++++++++++
 arch/arm/boot/dts/kirkwood-sheevaplug-esata.dts    |   40 ++++++++
 arch/arm/boot/dts/kirkwood-sheevaplug.dts          |   45 +++++++++
 arch/arm/boot/dts/kirkwood-topkick.dts             |    1 +
 arch/arm/boot/dts/kirkwood.dtsi                    |    4 +
 arch/arm/mach-kirkwood/Kconfig                     |    7 ++
 arch/arm/mach-kirkwood/Makefile                    |    1 +
 arch/arm/mach-kirkwood/board-dt.c                  |    4 +
 arch/arm/mach-kirkwood/board-sheevaplug.c          |   27 ++++++
 arch/arm/mach-kirkwood/common.h                    |    5 +
 drivers/mmc/core/host.c                            |   24 ++++-
 drivers/mmc/host/mvsdio.c                          |   73 ++++++++-------
 drivers/mmc/host/mxcmmc.c                          |    4 +-
 drivers/mmc/host/sdhci-pxav3.c                     |    7 +-
 drivers/mmc/host/sdhci-tegra.c                     |    9 +-
 drivers/mmc/host/sh_mmcif.c                        |    7 +-
 drivers/mmc/host/tmio_mmc_pio.c                    |    4 +-
 include/linux/mmc/host.h                           |    2 +-
 27 files changed, 328 insertions(+), 48 deletions(-)
 create mode 100644 arch/arm/boot/dts/kirkwood-sheevaplug-common.dtsi
 create mode 100644 arch/arm/boot/dts/kirkwood-sheevaplug-esata.dts
 create mode 100644 arch/arm/boot/dts/kirkwood-sheevaplug.dts
 create mode 100644 arch/arm/mach-kirkwood/board-sheevaplug.c

-- 
1.7.9.5

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

* [PATCH V2 01/10] mmc: return mmc_of_parse() errors to caller
  2013-05-13 21:18 ` Simon Baatz
@ 2013-05-13 21:18   ` Simon Baatz
  -1 siblings, 0 replies; 43+ messages in thread
From: Simon Baatz @ 2013-05-13 21:18 UTC (permalink / raw)
  To: linux-arm-kernel, linux-mmc, devicetree-discuss
  Cc: Jason Cooper, Andrew Lunn, Chris Ball, Guennadi Liakhovetski,
	Thomas Petazzoni

In addition to just logging errors encountered during DT parsing or
allocating GPIO slots for CD/WP, mmc_of_parse() now returns with an
error.

Signed-off-by: Simon Baatz <gmbnomis@gmail.com>
---
 drivers/mmc/core/host.c  |   24 +++++++++++++++++++-----
 include/linux/mmc/host.h |    2 +-
 2 files changed, 20 insertions(+), 6 deletions(-)

diff --git a/drivers/mmc/core/host.c b/drivers/mmc/core/host.c
index 2a3593d..45122cc 100644
--- a/drivers/mmc/core/host.c
+++ b/drivers/mmc/core/host.c
@@ -306,7 +306,7 @@ static inline void mmc_host_clk_sysfs_init(struct mmc_host *host)
  * parse the properties and set respective generic mmc-host flags and
  * parameters.
  */
-void mmc_of_parse(struct mmc_host *host)
+int mmc_of_parse(struct mmc_host *host)
 {
 	struct device_node *np;
 	u32 bus_width;
@@ -315,7 +315,7 @@ void mmc_of_parse(struct mmc_host *host)
 	int len, ret, gpio;
 
 	if (!host->parent || !host->parent->of_node)
-		return;
+		return 0;
 
 	np = host->parent->of_node;
 
@@ -338,6 +338,7 @@ void mmc_of_parse(struct mmc_host *host)
 	default:
 		dev_err(host->parent,
 			"Invalid \"bus-width\" value %ud!\n", bus_width);
+		return -EINVAL;
 	}
 
 	/* f_max is obtained from the optional "max-frequency" property */
@@ -372,13 +373,15 @@ void mmc_of_parse(struct mmc_host *host)
 				gpio_inv_cd = true;
 
 			ret = mmc_gpio_request_cd(host, gpio);
-			if (ret < 0)
+			if (ret < 0) {
 				dev_err(host->parent,
 					"Failed to request CD GPIO #%d: %d!\n",
 					gpio, ret);
-			else
+				return ret;
+			} else {
 				dev_info(host->parent, "Got CD GPIO #%d.\n",
 					 gpio);
+			}
 		}
 
 		if (explicit_inv_cd ^ gpio_inv_cd)
@@ -394,9 +397,14 @@ void mmc_of_parse(struct mmc_host *host)
 			gpio_inv_wp = true;
 
 		ret = mmc_gpio_request_ro(host, gpio);
-		if (ret < 0)
+		if (ret < 0) {
 			dev_err(host->parent,
 				"Failed to request WP GPIO: %d!\n", ret);
+			goto out;
+		} else {
+				dev_info(host->parent, "Got WP GPIO #%d.\n",
+					 gpio);
+		}
 	}
 	if (explicit_inv_wp ^ gpio_inv_wp)
 		host->caps2 |= MMC_CAP2_RO_ACTIVE_HIGH;
@@ -413,6 +421,12 @@ void mmc_of_parse(struct mmc_host *host)
 		host->pm_caps |= MMC_PM_KEEP_POWER;
 	if (of_find_property(np, "enable-sdio-wakeup", &len))
 		host->pm_caps |= MMC_PM_WAKE_SDIO_IRQ;
+
+	return 0;
+
+out:
+	mmc_gpio_free_cd(host);
+	return ret;
 }
 
 EXPORT_SYMBOL(mmc_of_parse);
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
index e326ae2..c8c4fbc 100644
--- a/include/linux/mmc/host.h
+++ b/include/linux/mmc/host.h
@@ -369,7 +369,7 @@ struct mmc_host *mmc_alloc_host(int extra, struct device *);
 int mmc_add_host(struct mmc_host *);
 void mmc_remove_host(struct mmc_host *);
 void mmc_free_host(struct mmc_host *);
-void mmc_of_parse(struct mmc_host *host);
+int mmc_of_parse(struct mmc_host *host);
 
 static inline void *mmc_priv(struct mmc_host *host)
 {
-- 
1.7.9.5


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

* [PATCH V2 01/10] mmc: return mmc_of_parse() errors to caller
@ 2013-05-13 21:18   ` Simon Baatz
  0 siblings, 0 replies; 43+ messages in thread
From: Simon Baatz @ 2013-05-13 21:18 UTC (permalink / raw)
  To: linux-arm-kernel

In addition to just logging errors encountered during DT parsing or
allocating GPIO slots for CD/WP, mmc_of_parse() now returns with an
error.

Signed-off-by: Simon Baatz <gmbnomis@gmail.com>
---
 drivers/mmc/core/host.c  |   24 +++++++++++++++++++-----
 include/linux/mmc/host.h |    2 +-
 2 files changed, 20 insertions(+), 6 deletions(-)

diff --git a/drivers/mmc/core/host.c b/drivers/mmc/core/host.c
index 2a3593d..45122cc 100644
--- a/drivers/mmc/core/host.c
+++ b/drivers/mmc/core/host.c
@@ -306,7 +306,7 @@ static inline void mmc_host_clk_sysfs_init(struct mmc_host *host)
  * parse the properties and set respective generic mmc-host flags and
  * parameters.
  */
-void mmc_of_parse(struct mmc_host *host)
+int mmc_of_parse(struct mmc_host *host)
 {
 	struct device_node *np;
 	u32 bus_width;
@@ -315,7 +315,7 @@ void mmc_of_parse(struct mmc_host *host)
 	int len, ret, gpio;
 
 	if (!host->parent || !host->parent->of_node)
-		return;
+		return 0;
 
 	np = host->parent->of_node;
 
@@ -338,6 +338,7 @@ void mmc_of_parse(struct mmc_host *host)
 	default:
 		dev_err(host->parent,
 			"Invalid \"bus-width\" value %ud!\n", bus_width);
+		return -EINVAL;
 	}
 
 	/* f_max is obtained from the optional "max-frequency" property */
@@ -372,13 +373,15 @@ void mmc_of_parse(struct mmc_host *host)
 				gpio_inv_cd = true;
 
 			ret = mmc_gpio_request_cd(host, gpio);
-			if (ret < 0)
+			if (ret < 0) {
 				dev_err(host->parent,
 					"Failed to request CD GPIO #%d: %d!\n",
 					gpio, ret);
-			else
+				return ret;
+			} else {
 				dev_info(host->parent, "Got CD GPIO #%d.\n",
 					 gpio);
+			}
 		}
 
 		if (explicit_inv_cd ^ gpio_inv_cd)
@@ -394,9 +397,14 @@ void mmc_of_parse(struct mmc_host *host)
 			gpio_inv_wp = true;
 
 		ret = mmc_gpio_request_ro(host, gpio);
-		if (ret < 0)
+		if (ret < 0) {
 			dev_err(host->parent,
 				"Failed to request WP GPIO: %d!\n", ret);
+			goto out;
+		} else {
+				dev_info(host->parent, "Got WP GPIO #%d.\n",
+					 gpio);
+		}
 	}
 	if (explicit_inv_wp ^ gpio_inv_wp)
 		host->caps2 |= MMC_CAP2_RO_ACTIVE_HIGH;
@@ -413,6 +421,12 @@ void mmc_of_parse(struct mmc_host *host)
 		host->pm_caps |= MMC_PM_KEEP_POWER;
 	if (of_find_property(np, "enable-sdio-wakeup", &len))
 		host->pm_caps |= MMC_PM_WAKE_SDIO_IRQ;
+
+	return 0;
+
+out:
+	mmc_gpio_free_cd(host);
+	return ret;
 }
 
 EXPORT_SYMBOL(mmc_of_parse);
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
index e326ae2..c8c4fbc 100644
--- a/include/linux/mmc/host.h
+++ b/include/linux/mmc/host.h
@@ -369,7 +369,7 @@ struct mmc_host *mmc_alloc_host(int extra, struct device *);
 int mmc_add_host(struct mmc_host *);
 void mmc_remove_host(struct mmc_host *);
 void mmc_free_host(struct mmc_host *);
-void mmc_of_parse(struct mmc_host *host);
+int mmc_of_parse(struct mmc_host *host);
 
 static inline void *mmc_priv(struct mmc_host *host)
 {
-- 
1.7.9.5

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

* [PATCH V2 02/10] mmc: sh_mmcif: handle mmc_of_parse() errors during probe
  2013-05-13 21:18 ` Simon Baatz
@ 2013-05-13 21:18   ` Simon Baatz
  -1 siblings, 0 replies; 43+ messages in thread
From: Simon Baatz @ 2013-05-13 21:18 UTC (permalink / raw)
  To: linux-arm-kernel, linux-mmc, devicetree-discuss
  Cc: Jason Cooper, Andrew Lunn, Chris Ball, Guennadi Liakhovetski,
	Thomas Petazzoni


Signed-off-by: Simon Baatz <gmbnomis@gmail.com>
---
 drivers/mmc/host/sh_mmcif.c |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/mmc/host/sh_mmcif.c b/drivers/mmc/host/sh_mmcif.c
index ba76a53..6ded7fb 100644
--- a/drivers/mmc/host/sh_mmcif.c
+++ b/drivers/mmc/host/sh_mmcif.c
@@ -1369,7 +1369,11 @@ static int sh_mmcif_probe(struct platform_device *pdev)
 		ret = -ENOMEM;
 		goto ealloch;
 	}
-	mmc_of_parse(mmc);
+
+	ret = mmc_of_parse(mmc);
+	if (ret < 0)
+		goto eofparse;
+
 	host		= mmc_priv(mmc);
 	host->mmc	= mmc;
 	host->addr	= reg;
@@ -1464,6 +1468,7 @@ eclkupdate:
 	clk_put(host->hclk);
 eclkget:
 	pm_runtime_disable(&pdev->dev);
+eofparse:
 	mmc_free_host(mmc);
 ealloch:
 	iounmap(reg);
-- 
1.7.9.5


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

* [PATCH V2 02/10] mmc: sh_mmcif: handle mmc_of_parse() errors during probe
@ 2013-05-13 21:18   ` Simon Baatz
  0 siblings, 0 replies; 43+ messages in thread
From: Simon Baatz @ 2013-05-13 21:18 UTC (permalink / raw)
  To: linux-arm-kernel


Signed-off-by: Simon Baatz <gmbnomis@gmail.com>
---
 drivers/mmc/host/sh_mmcif.c |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/mmc/host/sh_mmcif.c b/drivers/mmc/host/sh_mmcif.c
index ba76a53..6ded7fb 100644
--- a/drivers/mmc/host/sh_mmcif.c
+++ b/drivers/mmc/host/sh_mmcif.c
@@ -1369,7 +1369,11 @@ static int sh_mmcif_probe(struct platform_device *pdev)
 		ret = -ENOMEM;
 		goto ealloch;
 	}
-	mmc_of_parse(mmc);
+
+	ret = mmc_of_parse(mmc);
+	if (ret < 0)
+		goto eofparse;
+
 	host		= mmc_priv(mmc);
 	host->mmc	= mmc;
 	host->addr	= reg;
@@ -1464,6 +1468,7 @@ eclkupdate:
 	clk_put(host->hclk);
 eclkget:
 	pm_runtime_disable(&pdev->dev);
+eofparse:
 	mmc_free_host(mmc);
 ealloch:
 	iounmap(reg);
-- 
1.7.9.5

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

* [PATCH V2 03/10] mmc: tmio-mmc: handle mmc_of_parse() errors during probe
  2013-05-13 21:18 ` Simon Baatz
@ 2013-05-13 21:18   ` Simon Baatz
  -1 siblings, 0 replies; 43+ messages in thread
From: Simon Baatz @ 2013-05-13 21:18 UTC (permalink / raw)
  To: linux-arm-kernel, linux-mmc, devicetree-discuss
  Cc: Jason Cooper, Andrew Lunn, Chris Ball, Guennadi Liakhovetski,
	Thomas Petazzoni


Signed-off-by: Simon Baatz <gmbnomis@gmail.com>
---
 drivers/mmc/host/tmio_mmc_pio.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c
index f508ecb..f1a9d4a 100644
--- a/drivers/mmc/host/tmio_mmc_pio.c
+++ b/drivers/mmc/host/tmio_mmc_pio.c
@@ -988,7 +988,9 @@ int tmio_mmc_host_probe(struct tmio_mmc_host **host,
 	if (!mmc)
 		return -ENOMEM;
 
-	mmc_of_parse(mmc);
+	ret = mmc_of_parse(mmc);
+	if (ret < 0)
+		goto host_free;
 
 	pdata->dev = &pdev->dev;
 	_host = mmc_priv(mmc);
-- 
1.7.9.5


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

* [PATCH V2 03/10] mmc: tmio-mmc: handle mmc_of_parse() errors during probe
@ 2013-05-13 21:18   ` Simon Baatz
  0 siblings, 0 replies; 43+ messages in thread
From: Simon Baatz @ 2013-05-13 21:18 UTC (permalink / raw)
  To: linux-arm-kernel


Signed-off-by: Simon Baatz <gmbnomis@gmail.com>
---
 drivers/mmc/host/tmio_mmc_pio.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c
index f508ecb..f1a9d4a 100644
--- a/drivers/mmc/host/tmio_mmc_pio.c
+++ b/drivers/mmc/host/tmio_mmc_pio.c
@@ -988,7 +988,9 @@ int tmio_mmc_host_probe(struct tmio_mmc_host **host,
 	if (!mmc)
 		return -ENOMEM;
 
-	mmc_of_parse(mmc);
+	ret = mmc_of_parse(mmc);
+	if (ret < 0)
+		goto host_free;
 
 	pdata->dev = &pdev->dev;
 	_host = mmc_priv(mmc);
-- 
1.7.9.5

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

* [PATCH V2 04/10] mmc: mxcmmc: handle mmc_of_parse() errors during probe
  2013-05-13 21:18 ` Simon Baatz
@ 2013-05-13 21:18   ` Simon Baatz
  -1 siblings, 0 replies; 43+ messages in thread
From: Simon Baatz @ 2013-05-13 21:18 UTC (permalink / raw)
  To: linux-arm-kernel, linux-mmc, devicetree-discuss
  Cc: Jason Cooper, Andrew Lunn, Chris Ball, Guennadi Liakhovetski,
	Thomas Petazzoni


Signed-off-by: Simon Baatz <gmbnomis@gmail.com>
---
 drivers/mmc/host/mxcmmc.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/mmc/host/mxcmmc.c b/drivers/mmc/host/mxcmmc.c
index d503635..f47546f 100644
--- a/drivers/mmc/host/mxcmmc.c
+++ b/drivers/mmc/host/mxcmmc.c
@@ -1067,7 +1067,9 @@ static int mxcmci_probe(struct platform_device *pdev)
 		goto out_release_mem;
 	}
 
-	mmc_of_parse(mmc);
+	ret = mmc_of_parse(mmc);
+	if (ret)
+		goto out_free;
 	mmc->ops = &mxcmci_ops;
 
 	/* For devicetree parsing, the bus width is read from devicetree */
-- 
1.7.9.5


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

* [PATCH V2 04/10] mmc: mxcmmc: handle mmc_of_parse() errors during probe
@ 2013-05-13 21:18   ` Simon Baatz
  0 siblings, 0 replies; 43+ messages in thread
From: Simon Baatz @ 2013-05-13 21:18 UTC (permalink / raw)
  To: linux-arm-kernel


Signed-off-by: Simon Baatz <gmbnomis@gmail.com>
---
 drivers/mmc/host/mxcmmc.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/mmc/host/mxcmmc.c b/drivers/mmc/host/mxcmmc.c
index d503635..f47546f 100644
--- a/drivers/mmc/host/mxcmmc.c
+++ b/drivers/mmc/host/mxcmmc.c
@@ -1067,7 +1067,9 @@ static int mxcmci_probe(struct platform_device *pdev)
 		goto out_release_mem;
 	}
 
-	mmc_of_parse(mmc);
+	ret = mmc_of_parse(mmc);
+	if (ret)
+		goto out_free;
 	mmc->ops = &mxcmci_ops;
 
 	/* For devicetree parsing, the bus width is read from devicetree */
-- 
1.7.9.5

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

* [PATCH V2 05/10] mmc: sdhi-pxav3: handle mmc_of_parse() errors during probe
  2013-05-13 21:18 ` Simon Baatz
@ 2013-05-13 21:18   ` Simon Baatz
  -1 siblings, 0 replies; 43+ messages in thread
From: Simon Baatz @ 2013-05-13 21:18 UTC (permalink / raw)
  To: linux-arm-kernel, linux-mmc, devicetree-discuss
  Cc: Jason Cooper, Andrew Lunn, Chris Ball, Guennadi Liakhovetski,
	Thomas Petazzoni


Signed-off-by: Simon Baatz <gmbnomis@gmail.com>
---
 drivers/mmc/host/sdhci-pxav3.c |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/mmc/host/sdhci-pxav3.c b/drivers/mmc/host/sdhci-pxav3.c
index 1ae358e..67ea388 100644
--- a/drivers/mmc/host/sdhci-pxav3.c
+++ b/drivers/mmc/host/sdhci-pxav3.c
@@ -252,7 +252,9 @@ static int sdhci_pxav3_probe(struct platform_device *pdev)
 
 	match = of_match_device(of_match_ptr(sdhci_pxav3_of_match), &pdev->dev);
 	if (match) {
-		mmc_of_parse(host->mmc);
+		ret = mmc_of_parse(host->mmc);
+		if (ret)
+			goto err_of_parse;
 		sdhci_get_of_property(pdev);
 		pdata = pxav3_get_mmc_pdata(dev);
 	} else if (pdata) {
@@ -313,10 +315,11 @@ static int sdhci_pxav3_probe(struct platform_device *pdev)
 
 	return 0;
 
+err_of_parse:
+err_cd_req:
 err_add_host:
 	clk_disable_unprepare(clk);
 	clk_put(clk);
-err_cd_req:
 err_clk_get:
 	sdhci_pltfm_free(pdev);
 	kfree(pxa);
-- 
1.7.9.5


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

* [PATCH V2 05/10] mmc: sdhi-pxav3: handle mmc_of_parse() errors during probe
@ 2013-05-13 21:18   ` Simon Baatz
  0 siblings, 0 replies; 43+ messages in thread
From: Simon Baatz @ 2013-05-13 21:18 UTC (permalink / raw)
  To: linux-arm-kernel


Signed-off-by: Simon Baatz <gmbnomis@gmail.com>
---
 drivers/mmc/host/sdhci-pxav3.c |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/mmc/host/sdhci-pxav3.c b/drivers/mmc/host/sdhci-pxav3.c
index 1ae358e..67ea388 100644
--- a/drivers/mmc/host/sdhci-pxav3.c
+++ b/drivers/mmc/host/sdhci-pxav3.c
@@ -252,7 +252,9 @@ static int sdhci_pxav3_probe(struct platform_device *pdev)
 
 	match = of_match_device(of_match_ptr(sdhci_pxav3_of_match), &pdev->dev);
 	if (match) {
-		mmc_of_parse(host->mmc);
+		ret = mmc_of_parse(host->mmc);
+		if (ret)
+			goto err_of_parse;
 		sdhci_get_of_property(pdev);
 		pdata = pxav3_get_mmc_pdata(dev);
 	} else if (pdata) {
@@ -313,10 +315,11 @@ static int sdhci_pxav3_probe(struct platform_device *pdev)
 
 	return 0;
 
+err_of_parse:
+err_cd_req:
 err_add_host:
 	clk_disable_unprepare(clk);
 	clk_put(clk);
-err_cd_req:
 err_clk_get:
 	sdhci_pltfm_free(pdev);
 	kfree(pxa);
-- 
1.7.9.5

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

* [PATCH V2 06/10] mmc: tegra: handle mmc_of_parse() errors during probe
  2013-05-13 21:18 ` Simon Baatz
@ 2013-05-13 21:18   ` Simon Baatz
  -1 siblings, 0 replies; 43+ messages in thread
From: Simon Baatz @ 2013-05-13 21:18 UTC (permalink / raw)
  To: linux-arm-kernel, linux-mmc, devicetree-discuss
  Cc: Jason Cooper, Andrew Lunn, Chris Ball, Guennadi Liakhovetski,
	Thomas Petazzoni


Signed-off-by: Simon Baatz <gmbnomis@gmail.com>
---
 drivers/mmc/host/sdhci-tegra.c |    9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/mmc/host/sdhci-tegra.c b/drivers/mmc/host/sdhci-tegra.c
index e0dba74..7eb62f8 100644
--- a/drivers/mmc/host/sdhci-tegra.c
+++ b/drivers/mmc/host/sdhci-tegra.c
@@ -205,7 +205,7 @@ static const struct of_device_id sdhci_tegra_dt_match[] = {
 };
 MODULE_DEVICE_TABLE(of, sdhci_tegra_dt_match);
 
-static void sdhci_tegra_parse_dt(struct device *dev)
+static int sdhci_tegra_parse_dt(struct device *dev)
 {
 	struct device_node *np = dev->of_node;
 	struct sdhci_host *host = dev_get_drvdata(dev);
@@ -213,7 +213,7 @@ static void sdhci_tegra_parse_dt(struct device *dev)
 	struct sdhci_tegra *tegra_host = pltfm_host->priv;
 
 	tegra_host->power_gpio = of_get_named_gpio(np, "power-gpios", 0);
-	mmc_of_parse(host->mmc);
+	return mmc_of_parse(host->mmc);
 }
 
 static int sdhci_tegra_probe(struct platform_device *pdev)
@@ -245,7 +245,9 @@ static int sdhci_tegra_probe(struct platform_device *pdev)
 	tegra_host->soc_data = soc_data;
 	pltfm_host->priv = tegra_host;
 
-	sdhci_tegra_parse_dt(&pdev->dev);
+	rc = sdhci_tegra_parse_dt(&pdev->dev);
+	if (rc)
+		goto err_parse_dt;
 
 	if (gpio_is_valid(tegra_host->power_gpio)) {
 		rc = gpio_request(tegra_host->power_gpio, "sdhci_power");
@@ -278,6 +280,7 @@ err_add_host:
 err_clk_get:
 	if (gpio_is_valid(tegra_host->power_gpio))
 		gpio_free(tegra_host->power_gpio);
+err_parse_dt:
 err_power_req:
 err_alloc_tegra_host:
 	sdhci_pltfm_free(pdev);
-- 
1.7.9.5


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

* [PATCH V2 06/10] mmc: tegra: handle mmc_of_parse() errors during probe
@ 2013-05-13 21:18   ` Simon Baatz
  0 siblings, 0 replies; 43+ messages in thread
From: Simon Baatz @ 2013-05-13 21:18 UTC (permalink / raw)
  To: linux-arm-kernel


Signed-off-by: Simon Baatz <gmbnomis@gmail.com>
---
 drivers/mmc/host/sdhci-tegra.c |    9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/mmc/host/sdhci-tegra.c b/drivers/mmc/host/sdhci-tegra.c
index e0dba74..7eb62f8 100644
--- a/drivers/mmc/host/sdhci-tegra.c
+++ b/drivers/mmc/host/sdhci-tegra.c
@@ -205,7 +205,7 @@ static const struct of_device_id sdhci_tegra_dt_match[] = {
 };
 MODULE_DEVICE_TABLE(of, sdhci_tegra_dt_match);
 
-static void sdhci_tegra_parse_dt(struct device *dev)
+static int sdhci_tegra_parse_dt(struct device *dev)
 {
 	struct device_node *np = dev->of_node;
 	struct sdhci_host *host = dev_get_drvdata(dev);
@@ -213,7 +213,7 @@ static void sdhci_tegra_parse_dt(struct device *dev)
 	struct sdhci_tegra *tegra_host = pltfm_host->priv;
 
 	tegra_host->power_gpio = of_get_named_gpio(np, "power-gpios", 0);
-	mmc_of_parse(host->mmc);
+	return mmc_of_parse(host->mmc);
 }
 
 static int sdhci_tegra_probe(struct platform_device *pdev)
@@ -245,7 +245,9 @@ static int sdhci_tegra_probe(struct platform_device *pdev)
 	tegra_host->soc_data = soc_data;
 	pltfm_host->priv = tegra_host;
 
-	sdhci_tegra_parse_dt(&pdev->dev);
+	rc = sdhci_tegra_parse_dt(&pdev->dev);
+	if (rc)
+		goto err_parse_dt;
 
 	if (gpio_is_valid(tegra_host->power_gpio)) {
 		rc = gpio_request(tegra_host->power_gpio, "sdhci_power");
@@ -278,6 +280,7 @@ err_add_host:
 err_clk_get:
 	if (gpio_is_valid(tegra_host->power_gpio))
 		gpio_free(tegra_host->power_gpio);
+err_parse_dt:
 err_power_req:
 err_alloc_tegra_host:
 	sdhci_pltfm_free(pdev);
-- 
1.7.9.5

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

* [PATCH V2 07/10] ARM: mvebu: Use standard MMC binding for all users of mvsdio
  2013-05-13 21:18 ` Simon Baatz
@ 2013-05-13 21:18   ` Simon Baatz
  -1 siblings, 0 replies; 43+ messages in thread
From: Simon Baatz @ 2013-05-13 21:18 UTC (permalink / raw)
  To: linux-arm-kernel, linux-mmc, devicetree-discuss
  Cc: Jason Cooper, Andrew Lunn, Chris Ball, Guennadi Liakhovetski,
	Thomas Petazzoni

In order to prepare the switch to the standard MMC device tree parser
for mvsdio, adapt all current uses of mvsdio in the dts files to the
standard format.

Signed-off-by: Simon Baatz <gmbnomis@gmail.com>
---
 arch/arm/boot/dts/armada-370-db.dts                |    1 +
 arch/arm/boot/dts/armada-370-mirabox.dts           |    1 +
 arch/arm/boot/dts/armada-370-rd.dts                |    1 +
 arch/arm/boot/dts/armada-370-xp.dtsi               |    4 ++++
 arch/arm/boot/dts/armada-xp-db.dts                 |    1 +
 arch/arm/boot/dts/kirkwood-dreamplug.dts           |    1 +
 .../arm/boot/dts/kirkwood-guruplug-server-plus.dts |    2 ++
 arch/arm/boot/dts/kirkwood-mplcec4.dts             |    2 +-
 arch/arm/boot/dts/kirkwood-topkick.dts             |    1 +
 arch/arm/boot/dts/kirkwood.dtsi                    |    4 ++++
 10 files changed, 17 insertions(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/armada-370-db.dts b/arch/arm/boot/dts/armada-370-db.dts
index 2353b1f..beee169 100644
--- a/arch/arm/boot/dts/armada-370-db.dts
+++ b/arch/arm/boot/dts/armada-370-db.dts
@@ -74,6 +74,7 @@
 				 */
 				status = "disabled";
 				/* No CD or WP GPIOs */
+				broken-cd;
 			};
 
 			usb@50000 {
diff --git a/arch/arm/boot/dts/armada-370-mirabox.dts b/arch/arm/boot/dts/armada-370-mirabox.dts
index 14e36e1..45b1077 100644
--- a/arch/arm/boot/dts/armada-370-mirabox.dts
+++ b/arch/arm/boot/dts/armada-370-mirabox.dts
@@ -99,6 +99,7 @@
 				 * No CD or WP GPIOs: SDIO interface used for
 				 * Wifi/Bluetooth chip
 				 */
+				 broken-cd;
 			};
 
 			usb@50000 {
diff --git a/arch/arm/boot/dts/armada-370-rd.dts b/arch/arm/boot/dts/armada-370-rd.dts
index 130f839..89c2110 100644
--- a/arch/arm/boot/dts/armada-370-rd.dts
+++ b/arch/arm/boot/dts/armada-370-rd.dts
@@ -64,6 +64,7 @@
 				pinctrl-names = "default";
 				status = "okay";
 				/* No CD or WP GPIOs */
+				broken-cd;
 			};
 
 			usb@50000 {
diff --git a/arch/arm/boot/dts/armada-370-xp.dtsi b/arch/arm/boot/dts/armada-370-xp.dtsi
index 272bbc6..031894e 100644
--- a/arch/arm/boot/dts/armada-370-xp.dtsi
+++ b/arch/arm/boot/dts/armada-370-xp.dtsi
@@ -142,6 +142,10 @@
 				reg = <0xd4000 0x200>;
 				interrupts = <54>;
 				clocks = <&gateclk 17>;
+				bus-width = <4>;
+				cap-sdio-irq;
+				cap-sd-highspeed;
+				cap-mmc-highspeed;
 				status = "disabled";
 			};
 
diff --git a/arch/arm/boot/dts/armada-xp-db.dts b/arch/arm/boot/dts/armada-xp-db.dts
index d6cc8bf..7c22a20 100644
--- a/arch/arm/boot/dts/armada-xp-db.dts
+++ b/arch/arm/boot/dts/armada-xp-db.dts
@@ -97,6 +97,7 @@
 				pinctrl-names = "default";
 				status = "okay";
 				/* No CD or WP GPIOs */
+				broken-cd;
 			};
 
 			usb@50000 {
diff --git a/arch/arm/boot/dts/kirkwood-dreamplug.dts b/arch/arm/boot/dts/kirkwood-dreamplug.dts
index 289e51d..be16a84 100644
--- a/arch/arm/boot/dts/kirkwood-dreamplug.dts
+++ b/arch/arm/boot/dts/kirkwood-dreamplug.dts
@@ -79,6 +79,7 @@
 			pinctrl-names = "default";
 			status = "okay";
 			/* No CD or WP GPIOs */
+			broken-cd;
 		};
 	};
 
diff --git a/arch/arm/boot/dts/kirkwood-guruplug-server-plus.dts b/arch/arm/boot/dts/kirkwood-guruplug-server-plus.dts
index 44fd97d..484a2a6 100644
--- a/arch/arm/boot/dts/kirkwood-guruplug-server-plus.dts
+++ b/arch/arm/boot/dts/kirkwood-guruplug-server-plus.dts
@@ -72,6 +72,8 @@
 
 		mvsdio@90000 {
 			status = "okay";
+			/* No CD or WP GPIOs */
+			broken-cd;
 		};
 	};
 
diff --git a/arch/arm/boot/dts/kirkwood-mplcec4.dts b/arch/arm/boot/dts/kirkwood-mplcec4.dts
index 7588241..bf3a58c 100644
--- a/arch/arm/boot/dts/kirkwood-mplcec4.dts
+++ b/arch/arm/boot/dts/kirkwood-mplcec4.dts
@@ -136,7 +136,7 @@
 			pinctrl-0 = <&pmx_sdio &pmx_sdio_cd>;
 			pinctrl-names = "default";
 			status = "okay";
-			cd-gpios = <&gpio1 15 0>;
+			cd-gpios = <&gpio1 15 1>;
 			/* No WP GPIO */
 		};
 	};
diff --git a/arch/arm/boot/dts/kirkwood-topkick.dts b/arch/arm/boot/dts/kirkwood-topkick.dts
index 66eb45b..7dc14f4 100644
--- a/arch/arm/boot/dts/kirkwood-topkick.dts
+++ b/arch/arm/boot/dts/kirkwood-topkick.dts
@@ -154,6 +154,7 @@
 			pinctrl-names = "default";
 			status = "okay";
 			/* No CD or WP GPIOs */
+			broken-cd;
 		};
 	};
 
diff --git a/arch/arm/boot/dts/kirkwood.dtsi b/arch/arm/boot/dts/kirkwood.dtsi
index fada7e6..e2a28db 100644
--- a/arch/arm/boot/dts/kirkwood.dtsi
+++ b/arch/arm/boot/dts/kirkwood.dtsi
@@ -200,6 +200,10 @@
 			reg = <0x90000 0x200>;
 			interrupts = <28>;
 			clocks = <&gate_clk 4>;
+			bus-width = <4>;
+			cap-sdio-irq;
+			cap-sd-highspeed;
+			cap-mmc-highspeed;
 			status = "disabled";
 		};
 	};
-- 
1.7.9.5


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

* [PATCH V2 07/10] ARM: mvebu: Use standard MMC binding for all users of mvsdio
@ 2013-05-13 21:18   ` Simon Baatz
  0 siblings, 0 replies; 43+ messages in thread
From: Simon Baatz @ 2013-05-13 21:18 UTC (permalink / raw)
  To: linux-arm-kernel

In order to prepare the switch to the standard MMC device tree parser
for mvsdio, adapt all current uses of mvsdio in the dts files to the
standard format.

Signed-off-by: Simon Baatz <gmbnomis@gmail.com>
---
 arch/arm/boot/dts/armada-370-db.dts                |    1 +
 arch/arm/boot/dts/armada-370-mirabox.dts           |    1 +
 arch/arm/boot/dts/armada-370-rd.dts                |    1 +
 arch/arm/boot/dts/armada-370-xp.dtsi               |    4 ++++
 arch/arm/boot/dts/armada-xp-db.dts                 |    1 +
 arch/arm/boot/dts/kirkwood-dreamplug.dts           |    1 +
 .../arm/boot/dts/kirkwood-guruplug-server-plus.dts |    2 ++
 arch/arm/boot/dts/kirkwood-mplcec4.dts             |    2 +-
 arch/arm/boot/dts/kirkwood-topkick.dts             |    1 +
 arch/arm/boot/dts/kirkwood.dtsi                    |    4 ++++
 10 files changed, 17 insertions(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/armada-370-db.dts b/arch/arm/boot/dts/armada-370-db.dts
index 2353b1f..beee169 100644
--- a/arch/arm/boot/dts/armada-370-db.dts
+++ b/arch/arm/boot/dts/armada-370-db.dts
@@ -74,6 +74,7 @@
 				 */
 				status = "disabled";
 				/* No CD or WP GPIOs */
+				broken-cd;
 			};
 
 			usb at 50000 {
diff --git a/arch/arm/boot/dts/armada-370-mirabox.dts b/arch/arm/boot/dts/armada-370-mirabox.dts
index 14e36e1..45b1077 100644
--- a/arch/arm/boot/dts/armada-370-mirabox.dts
+++ b/arch/arm/boot/dts/armada-370-mirabox.dts
@@ -99,6 +99,7 @@
 				 * No CD or WP GPIOs: SDIO interface used for
 				 * Wifi/Bluetooth chip
 				 */
+				 broken-cd;
 			};
 
 			usb at 50000 {
diff --git a/arch/arm/boot/dts/armada-370-rd.dts b/arch/arm/boot/dts/armada-370-rd.dts
index 130f839..89c2110 100644
--- a/arch/arm/boot/dts/armada-370-rd.dts
+++ b/arch/arm/boot/dts/armada-370-rd.dts
@@ -64,6 +64,7 @@
 				pinctrl-names = "default";
 				status = "okay";
 				/* No CD or WP GPIOs */
+				broken-cd;
 			};
 
 			usb at 50000 {
diff --git a/arch/arm/boot/dts/armada-370-xp.dtsi b/arch/arm/boot/dts/armada-370-xp.dtsi
index 272bbc6..031894e 100644
--- a/arch/arm/boot/dts/armada-370-xp.dtsi
+++ b/arch/arm/boot/dts/armada-370-xp.dtsi
@@ -142,6 +142,10 @@
 				reg = <0xd4000 0x200>;
 				interrupts = <54>;
 				clocks = <&gateclk 17>;
+				bus-width = <4>;
+				cap-sdio-irq;
+				cap-sd-highspeed;
+				cap-mmc-highspeed;
 				status = "disabled";
 			};
 
diff --git a/arch/arm/boot/dts/armada-xp-db.dts b/arch/arm/boot/dts/armada-xp-db.dts
index d6cc8bf..7c22a20 100644
--- a/arch/arm/boot/dts/armada-xp-db.dts
+++ b/arch/arm/boot/dts/armada-xp-db.dts
@@ -97,6 +97,7 @@
 				pinctrl-names = "default";
 				status = "okay";
 				/* No CD or WP GPIOs */
+				broken-cd;
 			};
 
 			usb at 50000 {
diff --git a/arch/arm/boot/dts/kirkwood-dreamplug.dts b/arch/arm/boot/dts/kirkwood-dreamplug.dts
index 289e51d..be16a84 100644
--- a/arch/arm/boot/dts/kirkwood-dreamplug.dts
+++ b/arch/arm/boot/dts/kirkwood-dreamplug.dts
@@ -79,6 +79,7 @@
 			pinctrl-names = "default";
 			status = "okay";
 			/* No CD or WP GPIOs */
+			broken-cd;
 		};
 	};
 
diff --git a/arch/arm/boot/dts/kirkwood-guruplug-server-plus.dts b/arch/arm/boot/dts/kirkwood-guruplug-server-plus.dts
index 44fd97d..484a2a6 100644
--- a/arch/arm/boot/dts/kirkwood-guruplug-server-plus.dts
+++ b/arch/arm/boot/dts/kirkwood-guruplug-server-plus.dts
@@ -72,6 +72,8 @@
 
 		mvsdio at 90000 {
 			status = "okay";
+			/* No CD or WP GPIOs */
+			broken-cd;
 		};
 	};
 
diff --git a/arch/arm/boot/dts/kirkwood-mplcec4.dts b/arch/arm/boot/dts/kirkwood-mplcec4.dts
index 7588241..bf3a58c 100644
--- a/arch/arm/boot/dts/kirkwood-mplcec4.dts
+++ b/arch/arm/boot/dts/kirkwood-mplcec4.dts
@@ -136,7 +136,7 @@
 			pinctrl-0 = <&pmx_sdio &pmx_sdio_cd>;
 			pinctrl-names = "default";
 			status = "okay";
-			cd-gpios = <&gpio1 15 0>;
+			cd-gpios = <&gpio1 15 1>;
 			/* No WP GPIO */
 		};
 	};
diff --git a/arch/arm/boot/dts/kirkwood-topkick.dts b/arch/arm/boot/dts/kirkwood-topkick.dts
index 66eb45b..7dc14f4 100644
--- a/arch/arm/boot/dts/kirkwood-topkick.dts
+++ b/arch/arm/boot/dts/kirkwood-topkick.dts
@@ -154,6 +154,7 @@
 			pinctrl-names = "default";
 			status = "okay";
 			/* No CD or WP GPIOs */
+			broken-cd;
 		};
 	};
 
diff --git a/arch/arm/boot/dts/kirkwood.dtsi b/arch/arm/boot/dts/kirkwood.dtsi
index fada7e6..e2a28db 100644
--- a/arch/arm/boot/dts/kirkwood.dtsi
+++ b/arch/arm/boot/dts/kirkwood.dtsi
@@ -200,6 +200,10 @@
 			reg = <0x90000 0x200>;
 			interrupts = <28>;
 			clocks = <&gate_clk 4>;
+			bus-width = <4>;
+			cap-sdio-irq;
+			cap-sd-highspeed;
+			cap-mmc-highspeed;
 			status = "disabled";
 		};
 	};
-- 
1.7.9.5

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

* [PATCH V2 08/10] mmc: mvsdio: use standard MMC device-tree binding parser mmc_of_parse()
  2013-05-13 21:18 ` Simon Baatz
@ 2013-05-13 21:18   ` Simon Baatz
  -1 siblings, 0 replies; 43+ messages in thread
From: Simon Baatz @ 2013-05-13 21:18 UTC (permalink / raw)
  To: linux-arm-kernel, linux-mmc, devicetree-discuss
  Cc: Jason Cooper, Andrew Lunn, Chris Ball, Guennadi Liakhovetski,
	Thomas Petazzoni

Instead of parsing the DT binding on our own, use the standard parser
mmc_of_parse(), introduced by commit 6c56e7a.

Signed-off-by: Simon Baatz <gmbnomis@gmail.com>
---
 drivers/mmc/host/mvsdio.c |   73 +++++++++++++++++++++++++--------------------
 1 file changed, 40 insertions(+), 33 deletions(-)

diff --git a/drivers/mmc/host/mvsdio.c b/drivers/mmc/host/mvsdio.c
index 8960fc8..edfc481 100644
--- a/drivers/mmc/host/mvsdio.c
+++ b/drivers/mmc/host/mvsdio.c
@@ -35,7 +35,7 @@
 
 #define DRIVER_NAME	"mvsdio"
 
-static int maxfreq = MVSD_CLOCKRATE_MAX;
+static int maxfreq;
 static int nodma;
 
 struct mvsd_host {
@@ -685,7 +685,6 @@ static int __init mvsd_probe(struct platform_device *pdev)
 	const struct mbus_dram_target_info *dram;
 	struct resource *r;
 	int ret, irq;
-	int gpio_card_detect, gpio_write_protect;
 	struct pinctrl *pinctrl;
 
 	r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
@@ -718,6 +717,20 @@ static int __init mvsd_probe(struct platform_device *pdev)
 	if (!IS_ERR(host->clk))
 		clk_prepare_enable(host->clk);
 
+	mmc->ops = &mvsd_ops;
+
+	mmc->ocr_avail = MMC_VDD_32_33 | MMC_VDD_33_34;
+
+	mmc->f_min = DIV_ROUND_UP(host->base_clock, MVSD_BASE_DIV_MAX);
+	mmc->f_max = MVSD_CLOCKRATE_MAX;
+
+	mmc->max_blk_size = 2048;
+	mmc->max_blk_count = 65535;
+
+	mmc->max_segs = 1;
+	mmc->max_seg_size = mmc->max_blk_size * mmc->max_blk_count;
+	mmc->max_req_size = mmc->max_blk_size * mmc->max_blk_count;
+
 	if (np) {
 		if (IS_ERR(host->clk)) {
 			dev_err(&pdev->dev, "DT platforms must have a clock associated\n");
@@ -726,35 +739,38 @@ static int __init mvsd_probe(struct platform_device *pdev)
 		}
 
 		host->base_clock = clk_get_rate(host->clk) / 2;
-		gpio_card_detect = of_get_named_gpio(np, "cd-gpios", 0);
-		gpio_write_protect = of_get_named_gpio(np, "wp-gpios", 0);
+		ret = mmc_of_parse(mmc);
+		if (ret < 0)
+			goto out;
 	} else {
 		const struct mvsdio_platform_data *mvsd_data;
+
 		mvsd_data = pdev->dev.platform_data;
 		if (!mvsd_data) {
 			ret = -ENXIO;
 			goto out;
 		}
+		mmc->caps = MMC_CAP_4_BIT_DATA | MMC_CAP_SDIO_IRQ |
+			    MMC_CAP_SD_HIGHSPEED | MMC_CAP_MMC_HIGHSPEED;
 		host->base_clock = mvsd_data->clock / 2;
-		gpio_card_detect = mvsd_data->gpio_card_detect ? : -EINVAL;
-		gpio_write_protect = mvsd_data->gpio_write_protect ? : -EINVAL;
-	}
-
-	mmc->ops = &mvsd_ops;
-
-	mmc->ocr_avail = MMC_VDD_32_33 | MMC_VDD_33_34;
-	mmc->caps = MMC_CAP_4_BIT_DATA | MMC_CAP_SDIO_IRQ |
-		    MMC_CAP_SD_HIGHSPEED | MMC_CAP_MMC_HIGHSPEED;
-
-	mmc->f_min = DIV_ROUND_UP(host->base_clock, MVSD_BASE_DIV_MAX);
-	mmc->f_max = maxfreq;
+		/* GPIO 0 regarded as invalid for backward compatibility */
+		if (mvsd_data->gpio_card_detect &&
+		    gpio_is_valid(mvsd_data->gpio_card_detect)) {
+			ret = mmc_gpio_request_cd(mmc,
+						  mvsd_data->gpio_card_detect);
+			if (ret)
+				goto out;
+		} else {
+			mmc->caps |= MMC_CAP_NEEDS_POLL;
+		}
 
-	mmc->max_blk_size = 2048;
-	mmc->max_blk_count = 65535;
+		if (mvsd_data->gpio_write_protect &&
+		    gpio_is_valid(mvsd_data->gpio_write_protect))
+			mmc_gpio_request_ro(mmc, mvsd_data->gpio_write_protect);
+	}
 
-	mmc->max_segs = 1;
-	mmc->max_seg_size = mmc->max_blk_size * mmc->max_blk_count;
-	mmc->max_req_size = mmc->max_blk_size * mmc->max_blk_count;
+	if (maxfreq)
+		mmc->f_max = maxfreq;
 
 	spin_lock_init(&host->lock);
 
@@ -777,15 +793,6 @@ static int __init mvsd_probe(struct platform_device *pdev)
 		goto out;
 	}
 
-	if (gpio_is_valid(gpio_card_detect)) {
-		ret = mmc_gpio_request_cd(mmc, gpio_card_detect);
-		if (ret)
-			goto out;
-	} else
-		mmc->caps |= MMC_CAP_NEEDS_POLL;
-
-	mmc_gpio_request_ro(mmc, gpio_write_protect);
-
 	setup_timer(&host->timer, mvsd_timeout_timer, (unsigned long)host);
 	platform_set_drvdata(pdev, mmc);
 	ret = mmc_add_host(mmc);
@@ -793,10 +800,10 @@ static int __init mvsd_probe(struct platform_device *pdev)
 		goto out;
 
 	if (!(mmc->caps & MMC_CAP_NEEDS_POLL))
-		dev_notice(&pdev->dev, "using GPIO %d for card detection\n",
-			   gpio_card_detect);
+		dev_notice(&pdev->dev, "using GPIO for card detection\n");
 	else
-		dev_notice(&pdev->dev, "lacking card detect (fall back to polling)\n");
+		dev_notice(&pdev->dev,
+			   "lacking card detect (fall back to polling)\n");
 	return 0;
 
 out:
-- 
1.7.9.5


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

* [PATCH V2 08/10] mmc: mvsdio: use standard MMC device-tree binding parser mmc_of_parse()
@ 2013-05-13 21:18   ` Simon Baatz
  0 siblings, 0 replies; 43+ messages in thread
From: Simon Baatz @ 2013-05-13 21:18 UTC (permalink / raw)
  To: linux-arm-kernel

Instead of parsing the DT binding on our own, use the standard parser
mmc_of_parse(), introduced by commit 6c56e7a.

Signed-off-by: Simon Baatz <gmbnomis@gmail.com>
---
 drivers/mmc/host/mvsdio.c |   73 +++++++++++++++++++++++++--------------------
 1 file changed, 40 insertions(+), 33 deletions(-)

diff --git a/drivers/mmc/host/mvsdio.c b/drivers/mmc/host/mvsdio.c
index 8960fc8..edfc481 100644
--- a/drivers/mmc/host/mvsdio.c
+++ b/drivers/mmc/host/mvsdio.c
@@ -35,7 +35,7 @@
 
 #define DRIVER_NAME	"mvsdio"
 
-static int maxfreq = MVSD_CLOCKRATE_MAX;
+static int maxfreq;
 static int nodma;
 
 struct mvsd_host {
@@ -685,7 +685,6 @@ static int __init mvsd_probe(struct platform_device *pdev)
 	const struct mbus_dram_target_info *dram;
 	struct resource *r;
 	int ret, irq;
-	int gpio_card_detect, gpio_write_protect;
 	struct pinctrl *pinctrl;
 
 	r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
@@ -718,6 +717,20 @@ static int __init mvsd_probe(struct platform_device *pdev)
 	if (!IS_ERR(host->clk))
 		clk_prepare_enable(host->clk);
 
+	mmc->ops = &mvsd_ops;
+
+	mmc->ocr_avail = MMC_VDD_32_33 | MMC_VDD_33_34;
+
+	mmc->f_min = DIV_ROUND_UP(host->base_clock, MVSD_BASE_DIV_MAX);
+	mmc->f_max = MVSD_CLOCKRATE_MAX;
+
+	mmc->max_blk_size = 2048;
+	mmc->max_blk_count = 65535;
+
+	mmc->max_segs = 1;
+	mmc->max_seg_size = mmc->max_blk_size * mmc->max_blk_count;
+	mmc->max_req_size = mmc->max_blk_size * mmc->max_blk_count;
+
 	if (np) {
 		if (IS_ERR(host->clk)) {
 			dev_err(&pdev->dev, "DT platforms must have a clock associated\n");
@@ -726,35 +739,38 @@ static int __init mvsd_probe(struct platform_device *pdev)
 		}
 
 		host->base_clock = clk_get_rate(host->clk) / 2;
-		gpio_card_detect = of_get_named_gpio(np, "cd-gpios", 0);
-		gpio_write_protect = of_get_named_gpio(np, "wp-gpios", 0);
+		ret = mmc_of_parse(mmc);
+		if (ret < 0)
+			goto out;
 	} else {
 		const struct mvsdio_platform_data *mvsd_data;
+
 		mvsd_data = pdev->dev.platform_data;
 		if (!mvsd_data) {
 			ret = -ENXIO;
 			goto out;
 		}
+		mmc->caps = MMC_CAP_4_BIT_DATA | MMC_CAP_SDIO_IRQ |
+			    MMC_CAP_SD_HIGHSPEED | MMC_CAP_MMC_HIGHSPEED;
 		host->base_clock = mvsd_data->clock / 2;
-		gpio_card_detect = mvsd_data->gpio_card_detect ? : -EINVAL;
-		gpio_write_protect = mvsd_data->gpio_write_protect ? : -EINVAL;
-	}
-
-	mmc->ops = &mvsd_ops;
-
-	mmc->ocr_avail = MMC_VDD_32_33 | MMC_VDD_33_34;
-	mmc->caps = MMC_CAP_4_BIT_DATA | MMC_CAP_SDIO_IRQ |
-		    MMC_CAP_SD_HIGHSPEED | MMC_CAP_MMC_HIGHSPEED;
-
-	mmc->f_min = DIV_ROUND_UP(host->base_clock, MVSD_BASE_DIV_MAX);
-	mmc->f_max = maxfreq;
+		/* GPIO 0 regarded as invalid for backward compatibility */
+		if (mvsd_data->gpio_card_detect &&
+		    gpio_is_valid(mvsd_data->gpio_card_detect)) {
+			ret = mmc_gpio_request_cd(mmc,
+						  mvsd_data->gpio_card_detect);
+			if (ret)
+				goto out;
+		} else {
+			mmc->caps |= MMC_CAP_NEEDS_POLL;
+		}
 
-	mmc->max_blk_size = 2048;
-	mmc->max_blk_count = 65535;
+		if (mvsd_data->gpio_write_protect &&
+		    gpio_is_valid(mvsd_data->gpio_write_protect))
+			mmc_gpio_request_ro(mmc, mvsd_data->gpio_write_protect);
+	}
 
-	mmc->max_segs = 1;
-	mmc->max_seg_size = mmc->max_blk_size * mmc->max_blk_count;
-	mmc->max_req_size = mmc->max_blk_size * mmc->max_blk_count;
+	if (maxfreq)
+		mmc->f_max = maxfreq;
 
 	spin_lock_init(&host->lock);
 
@@ -777,15 +793,6 @@ static int __init mvsd_probe(struct platform_device *pdev)
 		goto out;
 	}
 
-	if (gpio_is_valid(gpio_card_detect)) {
-		ret = mmc_gpio_request_cd(mmc, gpio_card_detect);
-		if (ret)
-			goto out;
-	} else
-		mmc->caps |= MMC_CAP_NEEDS_POLL;
-
-	mmc_gpio_request_ro(mmc, gpio_write_protect);
-
 	setup_timer(&host->timer, mvsd_timeout_timer, (unsigned long)host);
 	platform_set_drvdata(pdev, mmc);
 	ret = mmc_add_host(mmc);
@@ -793,10 +800,10 @@ static int __init mvsd_probe(struct platform_device *pdev)
 		goto out;
 
 	if (!(mmc->caps & MMC_CAP_NEEDS_POLL))
-		dev_notice(&pdev->dev, "using GPIO %d for card detection\n",
-			   gpio_card_detect);
+		dev_notice(&pdev->dev, "using GPIO for card detection\n");
 	else
-		dev_notice(&pdev->dev, "lacking card detect (fall back to polling)\n");
+		dev_notice(&pdev->dev,
+			   "lacking card detect (fall back to polling)\n");
 	return 0;
 
 out:
-- 
1.7.9.5

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

* [PATCH V2 09/10] ARM: Kirkwood: Add dts files for Sheevaplug and eSATA Sheevaplug
  2013-05-13 21:18 ` Simon Baatz
@ 2013-05-13 21:19   ` Simon Baatz
  -1 siblings, 0 replies; 43+ messages in thread
From: Simon Baatz @ 2013-05-13 21:19 UTC (permalink / raw)
  To: linux-arm-kernel, linux-mmc, devicetree-discuss
  Cc: Jason Cooper, Andrew Lunn, Chris Ball, Guennadi Liakhovetski,
	Thomas Petazzoni


Signed-off-by: Simon Baatz <gmbnomis@gmail.com>
---
 arch/arm/boot/dts/Makefile                        |    2 +
 arch/arm/boot/dts/kirkwood-sheevaplug-common.dtsi |   97 +++++++++++++++++++++
 arch/arm/boot/dts/kirkwood-sheevaplug-esata.dts   |   40 +++++++++
 arch/arm/boot/dts/kirkwood-sheevaplug.dts         |   45 ++++++++++
 4 files changed, 184 insertions(+)
 create mode 100644 arch/arm/boot/dts/kirkwood-sheevaplug-common.dtsi
 create mode 100644 arch/arm/boot/dts/kirkwood-sheevaplug-esata.dts
 create mode 100644 arch/arm/boot/dts/kirkwood-sheevaplug.dts

diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index b9f7121..e81a387 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -84,6 +84,8 @@ dtb-$(CONFIG_ARCH_KIRKWOOD) += kirkwood-cloudbox.dtb \
 	kirkwood-ns2max.dtb \
 	kirkwood-ns2mini.dtb \
 	kirkwood-nsa310.dtb \
+	kirkwood-sheevaplug.dtb \
+	kirkwood-sheevaplug-esata.dtb \
 	kirkwood-topkick.dtb \
 	kirkwood-ts219-6281.dtb \
 	kirkwood-ts219-6282.dtb \
diff --git a/arch/arm/boot/dts/kirkwood-sheevaplug-common.dtsi b/arch/arm/boot/dts/kirkwood-sheevaplug-common.dtsi
new file mode 100644
index 0000000..9d59475
--- /dev/null
+++ b/arch/arm/boot/dts/kirkwood-sheevaplug-common.dtsi
@@ -0,0 +1,97 @@
+/*
+ * kirkwood-sheevaplug-common.dts - Common parts for Sheevaplugs
+ *
+ * Copyright (C) 2013 Simon Baatz <gmbnomis@gmail.com>
+ *
+ * Licensed under GPLv2
+ */
+
+/include/ "kirkwood.dtsi"
+/include/ "kirkwood-6281.dtsi"
+
+/ {
+	memory {
+		device_type = "memory";
+		reg = <0x00000000 0x20000000>;
+	};
+
+	chosen {
+		bootargs = "console=ttyS0,115200n8 earlyprintk";
+	};
+
+	ocp@f1000000 {
+		pinctrl: pinctrl@10000 {
+
+			pmx_usb_power_enable: pmx-usb-power-enable {
+				marvell,pins = "mpp29";
+				marvell,function = "gpio";
+			};
+			pmx_led_red: pmx-led-red {
+				marvell,pins = "mpp46";
+				marvell,function = "gpio";
+			};
+			pmx_led_blue: pmx-led-blue {
+				marvell,pins = "mpp49";
+				marvell,function = "gpio";
+			};
+			pmx_sdio_cd: pmx-sdio-cd {
+				marvell,pins = "mpp44";
+				marvell,function = "gpio";
+			};
+			pmx_sdio_wp: pmx-sdio-wp {
+				marvell,pins = "mpp47";
+				marvell,function = "gpio";
+			};
+		};
+		serial@12000 {
+			status = "okay";
+		};
+
+		nand@3000000 {
+			status = "okay";
+
+			partition@0 {
+				label = "u-boot";
+				reg = <0x0000000 0x100000>;
+			};
+
+			partition@100000 {
+				label = "uImage";
+				reg = <0x0100000 0x400000>;
+			};
+
+			partition@500000 {
+				label = "root";
+				reg = <0x0500000 0x1fb00000>;
+			};
+		};
+	};
+
+	regulators {
+		compatible = "simple-bus";
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		usb_power: regulator@1 {
+			compatible = "regulator-fixed";
+			reg = <1>;
+			regulator-name = "USB Power";
+			regulator-min-microvolt = <5000000>;
+			regulator-max-microvolt = <5000000>;
+			enable-active-high;
+			regulator-always-on;
+			regulator-boot-on;
+			gpio = <&gpio0 29 0>;
+		};
+	};
+
+	gpio-leds {
+		compatible = "gpio-leds";
+
+		health {
+			label = "sheevaplug:blue:health";
+			gpios = <&gpio1 17 1>;
+			linux,default-trigger = "default-on";
+		};
+	};
+};
diff --git a/arch/arm/boot/dts/kirkwood-sheevaplug-esata.dts b/arch/arm/boot/dts/kirkwood-sheevaplug-esata.dts
new file mode 100644
index 0000000..1c6946a
--- /dev/null
+++ b/arch/arm/boot/dts/kirkwood-sheevaplug-esata.dts
@@ -0,0 +1,40 @@
+/*
+ * kirkwood-sheevaplug-esata.dts - Device tree file for eSATA Sheevaplug
+ *
+ * Copyright (C) 2013 Simon Baatz <gmbnomis@gmail.com>
+ *
+ * Licensed under GPLv2
+ */
+
+/dts-v1/;
+
+/include/ "kirkwood-sheevaplug-common.dtsi"
+
+/ {
+	model = "Globalscale Technologies eSATA SheevaPlug";
+	compatible = "globalscale,sheevaplug-esata-rev13", "globalscale,sheevaplug-esata", "globalscale,sheevaplug", "marvell,kirkwood-88f6281", "marvell,kirkwood";
+
+	ocp@f1000000 {
+		pinctrl: pinctrl@10000 {
+
+			pinctrl-0 = < &pmx_nand &pmx_uart0
+				      &pmx_usb_power_enable
+				      &pmx_led_blue>;
+			pinctrl-names = "default";
+
+		};
+
+		sata@80000 {
+			status = "okay";
+			nr-ports = <2>;
+		};
+
+		mvsdio@90000 {
+			pinctrl-0 = <&pmx_sdio &pmx_sdio_cd &pmx_sdio_wp>;
+			pinctrl-names = "default";
+			status = "okay";
+			cd-gpios = <&gpio1 12 1>;
+			wp-gpios = <&gpio1 15 0>;
+		};
+	};
+};
diff --git a/arch/arm/boot/dts/kirkwood-sheevaplug.dts b/arch/arm/boot/dts/kirkwood-sheevaplug.dts
new file mode 100644
index 0000000..f7684066
--- /dev/null
+++ b/arch/arm/boot/dts/kirkwood-sheevaplug.dts
@@ -0,0 +1,45 @@
+/*
+ * kirkwood-sheevaplug-esata.dts - Device tree file for Sheevaplug
+ *
+ * Copyright (C) 2013 Simon Baatz <gmbnomis@gmail.com>
+ *
+ * Licensed under GPLv2
+ */
+
+/dts-v1/;
+
+/include/ "kirkwood-sheevaplug-common.dtsi"
+
+/ {
+	model = "Globalscale Technologies SheevaPlug";
+	compatible = "globalscale,sheevaplug", "marvell,kirkwood-88f6281", "marvell,kirkwood";
+
+	ocp@f1000000 {
+		pinctrl: pinctrl@10000 {
+
+			pinctrl-0 = < &pmx_nand &pmx_uart0
+				      &pmx_usb_power_enable
+				      &pmx_led_red
+				      &pmx_led_blue>;
+			pinctrl-names = "default";
+
+		};
+
+		mvsdio@90000 {
+			pinctrl-0 = <&pmx_sdio>;
+			pinctrl-names = "default";
+			status = "okay";
+			/* No CD or WP GPIOs */
+			broken-cd;
+		};
+	};
+
+	gpio-leds {
+		compatible = "gpio-leds";
+
+		misc {
+			label = "sheevaplug:red:misc";
+			gpios = <&gpio1 14 1>;
+		};
+	};
+};
-- 
1.7.9.5


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

* [PATCH V2 09/10] ARM: Kirkwood: Add dts files for Sheevaplug and eSATA Sheevaplug
@ 2013-05-13 21:19   ` Simon Baatz
  0 siblings, 0 replies; 43+ messages in thread
From: Simon Baatz @ 2013-05-13 21:19 UTC (permalink / raw)
  To: linux-arm-kernel


Signed-off-by: Simon Baatz <gmbnomis@gmail.com>
---
 arch/arm/boot/dts/Makefile                        |    2 +
 arch/arm/boot/dts/kirkwood-sheevaplug-common.dtsi |   97 +++++++++++++++++++++
 arch/arm/boot/dts/kirkwood-sheevaplug-esata.dts   |   40 +++++++++
 arch/arm/boot/dts/kirkwood-sheevaplug.dts         |   45 ++++++++++
 4 files changed, 184 insertions(+)
 create mode 100644 arch/arm/boot/dts/kirkwood-sheevaplug-common.dtsi
 create mode 100644 arch/arm/boot/dts/kirkwood-sheevaplug-esata.dts
 create mode 100644 arch/arm/boot/dts/kirkwood-sheevaplug.dts

diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index b9f7121..e81a387 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -84,6 +84,8 @@ dtb-$(CONFIG_ARCH_KIRKWOOD) += kirkwood-cloudbox.dtb \
 	kirkwood-ns2max.dtb \
 	kirkwood-ns2mini.dtb \
 	kirkwood-nsa310.dtb \
+	kirkwood-sheevaplug.dtb \
+	kirkwood-sheevaplug-esata.dtb \
 	kirkwood-topkick.dtb \
 	kirkwood-ts219-6281.dtb \
 	kirkwood-ts219-6282.dtb \
diff --git a/arch/arm/boot/dts/kirkwood-sheevaplug-common.dtsi b/arch/arm/boot/dts/kirkwood-sheevaplug-common.dtsi
new file mode 100644
index 0000000..9d59475
--- /dev/null
+++ b/arch/arm/boot/dts/kirkwood-sheevaplug-common.dtsi
@@ -0,0 +1,97 @@
+/*
+ * kirkwood-sheevaplug-common.dts - Common parts for Sheevaplugs
+ *
+ * Copyright (C) 2013 Simon Baatz <gmbnomis@gmail.com>
+ *
+ * Licensed under GPLv2
+ */
+
+/include/ "kirkwood.dtsi"
+/include/ "kirkwood-6281.dtsi"
+
+/ {
+	memory {
+		device_type = "memory";
+		reg = <0x00000000 0x20000000>;
+	};
+
+	chosen {
+		bootargs = "console=ttyS0,115200n8 earlyprintk";
+	};
+
+	ocp at f1000000 {
+		pinctrl: pinctrl at 10000 {
+
+			pmx_usb_power_enable: pmx-usb-power-enable {
+				marvell,pins = "mpp29";
+				marvell,function = "gpio";
+			};
+			pmx_led_red: pmx-led-red {
+				marvell,pins = "mpp46";
+				marvell,function = "gpio";
+			};
+			pmx_led_blue: pmx-led-blue {
+				marvell,pins = "mpp49";
+				marvell,function = "gpio";
+			};
+			pmx_sdio_cd: pmx-sdio-cd {
+				marvell,pins = "mpp44";
+				marvell,function = "gpio";
+			};
+			pmx_sdio_wp: pmx-sdio-wp {
+				marvell,pins = "mpp47";
+				marvell,function = "gpio";
+			};
+		};
+		serial at 12000 {
+			status = "okay";
+		};
+
+		nand at 3000000 {
+			status = "okay";
+
+			partition at 0 {
+				label = "u-boot";
+				reg = <0x0000000 0x100000>;
+			};
+
+			partition at 100000 {
+				label = "uImage";
+				reg = <0x0100000 0x400000>;
+			};
+
+			partition at 500000 {
+				label = "root";
+				reg = <0x0500000 0x1fb00000>;
+			};
+		};
+	};
+
+	regulators {
+		compatible = "simple-bus";
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		usb_power: regulator at 1 {
+			compatible = "regulator-fixed";
+			reg = <1>;
+			regulator-name = "USB Power";
+			regulator-min-microvolt = <5000000>;
+			regulator-max-microvolt = <5000000>;
+			enable-active-high;
+			regulator-always-on;
+			regulator-boot-on;
+			gpio = <&gpio0 29 0>;
+		};
+	};
+
+	gpio-leds {
+		compatible = "gpio-leds";
+
+		health {
+			label = "sheevaplug:blue:health";
+			gpios = <&gpio1 17 1>;
+			linux,default-trigger = "default-on";
+		};
+	};
+};
diff --git a/arch/arm/boot/dts/kirkwood-sheevaplug-esata.dts b/arch/arm/boot/dts/kirkwood-sheevaplug-esata.dts
new file mode 100644
index 0000000..1c6946a
--- /dev/null
+++ b/arch/arm/boot/dts/kirkwood-sheevaplug-esata.dts
@@ -0,0 +1,40 @@
+/*
+ * kirkwood-sheevaplug-esata.dts - Device tree file for eSATA Sheevaplug
+ *
+ * Copyright (C) 2013 Simon Baatz <gmbnomis@gmail.com>
+ *
+ * Licensed under GPLv2
+ */
+
+/dts-v1/;
+
+/include/ "kirkwood-sheevaplug-common.dtsi"
+
+/ {
+	model = "Globalscale Technologies eSATA SheevaPlug";
+	compatible = "globalscale,sheevaplug-esata-rev13", "globalscale,sheevaplug-esata", "globalscale,sheevaplug", "marvell,kirkwood-88f6281", "marvell,kirkwood";
+
+	ocp at f1000000 {
+		pinctrl: pinctrl at 10000 {
+
+			pinctrl-0 = < &pmx_nand &pmx_uart0
+				      &pmx_usb_power_enable
+				      &pmx_led_blue>;
+			pinctrl-names = "default";
+
+		};
+
+		sata at 80000 {
+			status = "okay";
+			nr-ports = <2>;
+		};
+
+		mvsdio at 90000 {
+			pinctrl-0 = <&pmx_sdio &pmx_sdio_cd &pmx_sdio_wp>;
+			pinctrl-names = "default";
+			status = "okay";
+			cd-gpios = <&gpio1 12 1>;
+			wp-gpios = <&gpio1 15 0>;
+		};
+	};
+};
diff --git a/arch/arm/boot/dts/kirkwood-sheevaplug.dts b/arch/arm/boot/dts/kirkwood-sheevaplug.dts
new file mode 100644
index 0000000..f7684066
--- /dev/null
+++ b/arch/arm/boot/dts/kirkwood-sheevaplug.dts
@@ -0,0 +1,45 @@
+/*
+ * kirkwood-sheevaplug-esata.dts - Device tree file for Sheevaplug
+ *
+ * Copyright (C) 2013 Simon Baatz <gmbnomis@gmail.com>
+ *
+ * Licensed under GPLv2
+ */
+
+/dts-v1/;
+
+/include/ "kirkwood-sheevaplug-common.dtsi"
+
+/ {
+	model = "Globalscale Technologies SheevaPlug";
+	compatible = "globalscale,sheevaplug", "marvell,kirkwood-88f6281", "marvell,kirkwood";
+
+	ocp at f1000000 {
+		pinctrl: pinctrl at 10000 {
+
+			pinctrl-0 = < &pmx_nand &pmx_uart0
+				      &pmx_usb_power_enable
+				      &pmx_led_red
+				      &pmx_led_blue>;
+			pinctrl-names = "default";
+
+		};
+
+		mvsdio at 90000 {
+			pinctrl-0 = <&pmx_sdio>;
+			pinctrl-names = "default";
+			status = "okay";
+			/* No CD or WP GPIOs */
+			broken-cd;
+		};
+	};
+
+	gpio-leds {
+		compatible = "gpio-leds";
+
+		misc {
+			label = "sheevaplug:red:misc";
+			gpios = <&gpio1 14 1>;
+		};
+	};
+};
-- 
1.7.9.5

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

* [PATCH V2 10/10] ARM: Kirkwood: add DT support for Sheevaplug and Sheevaplug eSATA
  2013-05-13 21:18 ` Simon Baatz
@ 2013-05-13 21:19   ` Simon Baatz
  -1 siblings, 0 replies; 43+ messages in thread
From: Simon Baatz @ 2013-05-13 21:19 UTC (permalink / raw)
  To: linux-arm-kernel, linux-mmc, devicetree-discuss
  Cc: Jason Cooper, Andrew Lunn, Chris Ball, Guennadi Liakhovetski,
	Thomas Petazzoni


Signed-off-by: Simon Baatz <gmbnomis@gmail.com>
---
 arch/arm/mach-kirkwood/Kconfig            |    7 +++++++
 arch/arm/mach-kirkwood/Makefile           |    1 +
 arch/arm/mach-kirkwood/board-dt.c         |    4 ++++
 arch/arm/mach-kirkwood/board-sheevaplug.c |   27 +++++++++++++++++++++++++++
 arch/arm/mach-kirkwood/common.h           |    5 +++++
 5 files changed, 44 insertions(+)
 create mode 100644 arch/arm/mach-kirkwood/board-sheevaplug.c

diff --git a/arch/arm/mach-kirkwood/Kconfig b/arch/arm/mach-kirkwood/Kconfig
index 7509a89..58518a2 100644
--- a/arch/arm/mach-kirkwood/Kconfig
+++ b/arch/arm/mach-kirkwood/Kconfig
@@ -296,6 +296,13 @@ config MACH_READYNAS_DT
 	  Say 'Y' here if you want your kernel to support the
 	  NETGEAR ReadyNAS Duo v2 using Fattened Device Tree.
 
+config MACH_SHEEVAPLUG_DT
+	bool "Marvell (eSATA) SheevaPlug (Flattened Device Tree)"
+	select ARCH_KIRKWOOD_DT
+	help
+	  Say 'Y' here if you want your kernel to support the
+	  Marvell (eSATA) SheevaPlug (Flattened Device Tree).
+
 config MACH_TOPKICK_DT
 	bool "USI Topkick (Flattened Device Tree)"
 	select ARCH_KIRKWOOD_DT
diff --git a/arch/arm/mach-kirkwood/Makefile b/arch/arm/mach-kirkwood/Makefile
index e1f3735..8846abf 100644
--- a/arch/arm/mach-kirkwood/Makefile
+++ b/arch/arm/mach-kirkwood/Makefile
@@ -40,5 +40,6 @@ obj-$(CONFIG_MACH_NETSPACE_V2_DT)	+= board-ns2.o
 obj-$(CONFIG_MACH_NSA310_DT)		+= board-nsa310.o
 obj-$(CONFIG_MACH_OPENBLOCKS_A6_DT)	+= board-openblocks_a6.o
 obj-$(CONFIG_MACH_READYNAS_DT)		+= board-readynas.o
+obj-$(CONFIG_MACH_SHEEVAPLUG_DT)	+= board-sheevaplug.o
 obj-$(CONFIG_MACH_TOPKICK_DT)		+= board-usi_topkick.o
 obj-$(CONFIG_MACH_TS219_DT)		+= board-ts219.o tsx1x-common.o
diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c
index e9647b8..a09dbac 100644
--- a/arch/arm/mach-kirkwood/board-dt.c
+++ b/arch/arm/mach-kirkwood/board-dt.c
@@ -112,6 +112,9 @@ static void __init kirkwood_dt_init(void)
 	if (of_machine_is_compatible("globalscale,guruplug"))
 		guruplug_dt_init();
 
+	if (of_machine_is_compatible("globalscale,sheevaplug"))
+		sheevaplug_dt_init();
+
 	if (of_machine_is_compatible("dlink,dns-kirkwood"))
 		dnskw_init();
 
@@ -165,6 +168,7 @@ static void __init kirkwood_dt_init(void)
 static const char * const kirkwood_dt_board_compat[] = {
 	"globalscale,dreamplug",
 	"globalscale,guruplug",
+	"globalscale,sheevaplug",
 	"dlink,dns-320",
 	"dlink,dns-325",
 	"iom,iconnect",
diff --git a/arch/arm/mach-kirkwood/board-sheevaplug.c b/arch/arm/mach-kirkwood/board-sheevaplug.c
new file mode 100644
index 0000000..fa38937
--- /dev/null
+++ b/arch/arm/mach-kirkwood/board-sheevaplug.c
@@ -0,0 +1,27 @@
+/*
+ * arch/arm/mach-kirkwood/board-sheevaplug.c
+ *
+ * Marvell Sheevaplug Reference Board Init for drivers not converted to
+ * flattened device tree yet.
+ *
+ * This file is licensed under the terms of the GNU General Public
+ * License version 2.  This program is licensed "as is" without any
+ * warranty of any kind, whether express or implied.
+ */
+
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/mv643xx_eth.h>
+#include "common.h"
+
+static struct mv643xx_eth_platform_data sheevaplug_ge00_data = {
+	.phy_addr	= MV643XX_ETH_PHY_ADDR(0),
+};
+
+void __init sheevaplug_dt_init(void)
+{
+	/*
+	 * Basic setup. Needs to be called early.
+	 */
+	kirkwood_ge00_init(&sheevaplug_ge00_data);
+}
diff --git a/arch/arm/mach-kirkwood/common.h b/arch/arm/mach-kirkwood/common.h
index 21da3b1..974442e 100644
--- a/arch/arm/mach-kirkwood/common.h
+++ b/arch/arm/mach-kirkwood/common.h
@@ -65,6 +65,11 @@ void guruplug_dt_init(void);
 #else
 static inline void guruplug_dt_init(void) {};
 #endif
+#ifdef CONFIG_MACH_SHEEVAPLUG_DT
+void sheevaplug_dt_init(void);
+#else
+static inline void sheevaplug_dt_init(void) {};
+#endif
 #ifdef CONFIG_MACH_TS219_DT
 void qnap_dt_ts219_init(void);
 #else
-- 
1.7.9.5


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

* [PATCH V2 10/10] ARM: Kirkwood: add DT support for Sheevaplug and Sheevaplug eSATA
@ 2013-05-13 21:19   ` Simon Baatz
  0 siblings, 0 replies; 43+ messages in thread
From: Simon Baatz @ 2013-05-13 21:19 UTC (permalink / raw)
  To: linux-arm-kernel


Signed-off-by: Simon Baatz <gmbnomis@gmail.com>
---
 arch/arm/mach-kirkwood/Kconfig            |    7 +++++++
 arch/arm/mach-kirkwood/Makefile           |    1 +
 arch/arm/mach-kirkwood/board-dt.c         |    4 ++++
 arch/arm/mach-kirkwood/board-sheevaplug.c |   27 +++++++++++++++++++++++++++
 arch/arm/mach-kirkwood/common.h           |    5 +++++
 5 files changed, 44 insertions(+)
 create mode 100644 arch/arm/mach-kirkwood/board-sheevaplug.c

diff --git a/arch/arm/mach-kirkwood/Kconfig b/arch/arm/mach-kirkwood/Kconfig
index 7509a89..58518a2 100644
--- a/arch/arm/mach-kirkwood/Kconfig
+++ b/arch/arm/mach-kirkwood/Kconfig
@@ -296,6 +296,13 @@ config MACH_READYNAS_DT
 	  Say 'Y' here if you want your kernel to support the
 	  NETGEAR ReadyNAS Duo v2 using Fattened Device Tree.
 
+config MACH_SHEEVAPLUG_DT
+	bool "Marvell (eSATA) SheevaPlug (Flattened Device Tree)"
+	select ARCH_KIRKWOOD_DT
+	help
+	  Say 'Y' here if you want your kernel to support the
+	  Marvell (eSATA) SheevaPlug (Flattened Device Tree).
+
 config MACH_TOPKICK_DT
 	bool "USI Topkick (Flattened Device Tree)"
 	select ARCH_KIRKWOOD_DT
diff --git a/arch/arm/mach-kirkwood/Makefile b/arch/arm/mach-kirkwood/Makefile
index e1f3735..8846abf 100644
--- a/arch/arm/mach-kirkwood/Makefile
+++ b/arch/arm/mach-kirkwood/Makefile
@@ -40,5 +40,6 @@ obj-$(CONFIG_MACH_NETSPACE_V2_DT)	+= board-ns2.o
 obj-$(CONFIG_MACH_NSA310_DT)		+= board-nsa310.o
 obj-$(CONFIG_MACH_OPENBLOCKS_A6_DT)	+= board-openblocks_a6.o
 obj-$(CONFIG_MACH_READYNAS_DT)		+= board-readynas.o
+obj-$(CONFIG_MACH_SHEEVAPLUG_DT)	+= board-sheevaplug.o
 obj-$(CONFIG_MACH_TOPKICK_DT)		+= board-usi_topkick.o
 obj-$(CONFIG_MACH_TS219_DT)		+= board-ts219.o tsx1x-common.o
diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c
index e9647b8..a09dbac 100644
--- a/arch/arm/mach-kirkwood/board-dt.c
+++ b/arch/arm/mach-kirkwood/board-dt.c
@@ -112,6 +112,9 @@ static void __init kirkwood_dt_init(void)
 	if (of_machine_is_compatible("globalscale,guruplug"))
 		guruplug_dt_init();
 
+	if (of_machine_is_compatible("globalscale,sheevaplug"))
+		sheevaplug_dt_init();
+
 	if (of_machine_is_compatible("dlink,dns-kirkwood"))
 		dnskw_init();
 
@@ -165,6 +168,7 @@ static void __init kirkwood_dt_init(void)
 static const char * const kirkwood_dt_board_compat[] = {
 	"globalscale,dreamplug",
 	"globalscale,guruplug",
+	"globalscale,sheevaplug",
 	"dlink,dns-320",
 	"dlink,dns-325",
 	"iom,iconnect",
diff --git a/arch/arm/mach-kirkwood/board-sheevaplug.c b/arch/arm/mach-kirkwood/board-sheevaplug.c
new file mode 100644
index 0000000..fa38937
--- /dev/null
+++ b/arch/arm/mach-kirkwood/board-sheevaplug.c
@@ -0,0 +1,27 @@
+/*
+ * arch/arm/mach-kirkwood/board-sheevaplug.c
+ *
+ * Marvell Sheevaplug Reference Board Init for drivers not converted to
+ * flattened device tree yet.
+ *
+ * This file is licensed under the terms of the GNU General Public
+ * License version 2.  This program is licensed "as is" without any
+ * warranty of any kind, whether express or implied.
+ */
+
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/mv643xx_eth.h>
+#include "common.h"
+
+static struct mv643xx_eth_platform_data sheevaplug_ge00_data = {
+	.phy_addr	= MV643XX_ETH_PHY_ADDR(0),
+};
+
+void __init sheevaplug_dt_init(void)
+{
+	/*
+	 * Basic setup. Needs to be called early.
+	 */
+	kirkwood_ge00_init(&sheevaplug_ge00_data);
+}
diff --git a/arch/arm/mach-kirkwood/common.h b/arch/arm/mach-kirkwood/common.h
index 21da3b1..974442e 100644
--- a/arch/arm/mach-kirkwood/common.h
+++ b/arch/arm/mach-kirkwood/common.h
@@ -65,6 +65,11 @@ void guruplug_dt_init(void);
 #else
 static inline void guruplug_dt_init(void) {};
 #endif
+#ifdef CONFIG_MACH_SHEEVAPLUG_DT
+void sheevaplug_dt_init(void);
+#else
+static inline void sheevaplug_dt_init(void) {};
+#endif
 #ifdef CONFIG_MACH_TS219_DT
 void qnap_dt_ts219_init(void);
 #else
-- 
1.7.9.5

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

* Re: [PATCH V2 07/10] ARM: mvebu: Use standard MMC binding for all users of mvsdio
  2013-05-13 21:18   ` Simon Baatz
@ 2013-05-13 23:09       ` Jason Cooper
  -1 siblings, 0 replies; 43+ messages in thread
From: Jason Cooper @ 2013-05-13 23:09 UTC (permalink / raw)
  To: Simon Baatz
  Cc: Andrew Lunn, devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	linux-mmc-u79uwXL29TY76Z2rM5mHXA, Chris Ball,
	Guennadi Liakhovetski,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On Mon, May 13, 2013 at 11:18:58PM +0200, Simon Baatz wrote:
> In order to prepare the switch to the standard MMC device tree parser
> for mvsdio, adapt all current uses of mvsdio in the dts files to the
> standard format.
> 
> Signed-off-by: Simon Baatz <gmbnomis-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> ---
...
> diff --git a/arch/arm/boot/dts/kirkwood-mplcec4.dts b/arch/arm/boot/dts/kirkwood-mplcec4.dts
> index 7588241..bf3a58c 100644
> --- a/arch/arm/boot/dts/kirkwood-mplcec4.dts
> +++ b/arch/arm/boot/dts/kirkwood-mplcec4.dts
> @@ -136,7 +136,7 @@
>  			pinctrl-0 = <&pmx_sdio &pmx_sdio_cd>;
>  			pinctrl-names = "default";
>  			status = "okay";
> -			cd-gpios = <&gpio1 15 0>;
> +			cd-gpios = <&gpio1 15 1>;

Is this a bugfix that should be backported?

thx,

Jason.

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

* [PATCH V2 07/10] ARM: mvebu: Use standard MMC binding for all users of mvsdio
@ 2013-05-13 23:09       ` Jason Cooper
  0 siblings, 0 replies; 43+ messages in thread
From: Jason Cooper @ 2013-05-13 23:09 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, May 13, 2013 at 11:18:58PM +0200, Simon Baatz wrote:
> In order to prepare the switch to the standard MMC device tree parser
> for mvsdio, adapt all current uses of mvsdio in the dts files to the
> standard format.
> 
> Signed-off-by: Simon Baatz <gmbnomis@gmail.com>
> ---
...
> diff --git a/arch/arm/boot/dts/kirkwood-mplcec4.dts b/arch/arm/boot/dts/kirkwood-mplcec4.dts
> index 7588241..bf3a58c 100644
> --- a/arch/arm/boot/dts/kirkwood-mplcec4.dts
> +++ b/arch/arm/boot/dts/kirkwood-mplcec4.dts
> @@ -136,7 +136,7 @@
>  			pinctrl-0 = <&pmx_sdio &pmx_sdio_cd>;
>  			pinctrl-names = "default";
>  			status = "okay";
> -			cd-gpios = <&gpio1 15 0>;
> +			cd-gpios = <&gpio1 15 1>;

Is this a bugfix that should be backported?

thx,

Jason.

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

* Re: [PATCH V2 07/10] ARM: mvebu: Use standard MMC binding for all users of mvsdio
  2013-05-13 23:09       ` Jason Cooper
@ 2013-05-14  5:37         ` Simon Baatz
  -1 siblings, 0 replies; 43+ messages in thread
From: Simon Baatz @ 2013-05-14  5:37 UTC (permalink / raw)
  To: Jason Cooper
  Cc: linux-arm-kernel, linux-mmc, devicetree-discuss, Andrew Lunn,
	Chris Ball, Guennadi Liakhovetski, Thomas Petazzoni

Hi Jason,

On Mon, May 13, 2013 at 07:09:18PM -0400, Jason Cooper wrote:
> On Mon, May 13, 2013 at 11:18:58PM +0200, Simon Baatz wrote:
> > In order to prepare the switch to the standard MMC device tree parser
> > for mvsdio, adapt all current uses of mvsdio in the dts files to the
> > standard format.
> > 
> > Signed-off-by: Simon Baatz <gmbnomis@gmail.com>
> > ---
> ...
> > diff --git a/arch/arm/boot/dts/kirkwood-mplcec4.dts b/arch/arm/boot/dts/kirkwood-mplcec4.dts
> > index 7588241..bf3a58c 100644
> > --- a/arch/arm/boot/dts/kirkwood-mplcec4.dts
> > +++ b/arch/arm/boot/dts/kirkwood-mplcec4.dts
> > @@ -136,7 +136,7 @@
> >  			pinctrl-0 = <&pmx_sdio &pmx_sdio_cd>;
> >  			pinctrl-names = "default";
> >  			status = "okay";
> > -			cd-gpios = <&gpio1 15 0>;
> > +			cd-gpios = <&gpio1 15 1>;
> 
> Is this a bugfix that should be backported?

No, that should not be necessary. The old code implicitly used "1"
here regardless of the actual flag value.

- Simon

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

* [PATCH V2 07/10] ARM: mvebu: Use standard MMC binding for all users of mvsdio
@ 2013-05-14  5:37         ` Simon Baatz
  0 siblings, 0 replies; 43+ messages in thread
From: Simon Baatz @ 2013-05-14  5:37 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Jason,

On Mon, May 13, 2013 at 07:09:18PM -0400, Jason Cooper wrote:
> On Mon, May 13, 2013 at 11:18:58PM +0200, Simon Baatz wrote:
> > In order to prepare the switch to the standard MMC device tree parser
> > for mvsdio, adapt all current uses of mvsdio in the dts files to the
> > standard format.
> > 
> > Signed-off-by: Simon Baatz <gmbnomis@gmail.com>
> > ---
> ...
> > diff --git a/arch/arm/boot/dts/kirkwood-mplcec4.dts b/arch/arm/boot/dts/kirkwood-mplcec4.dts
> > index 7588241..bf3a58c 100644
> > --- a/arch/arm/boot/dts/kirkwood-mplcec4.dts
> > +++ b/arch/arm/boot/dts/kirkwood-mplcec4.dts
> > @@ -136,7 +136,7 @@
> >  			pinctrl-0 = <&pmx_sdio &pmx_sdio_cd>;
> >  			pinctrl-names = "default";
> >  			status = "okay";
> > -			cd-gpios = <&gpio1 15 0>;
> > +			cd-gpios = <&gpio1 15 1>;
> 
> Is this a bugfix that should be backported?

No, that should not be necessary. The old code implicitly used "1"
here regardless of the actual flag value.

- Simon

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

* Re: [PATCH V2 00/10] mmc_of_parse() adaptations, DT support for Sheevaplugs
  2013-05-13 21:18 ` Simon Baatz
@ 2013-05-14  6:37   ` Guennadi Liakhovetski
  -1 siblings, 0 replies; 43+ messages in thread
From: Guennadi Liakhovetski @ 2013-05-14  6:37 UTC (permalink / raw)
  To: Simon Baatz
  Cc: linux-arm-kernel, linux-mmc, devicetree-discuss, Jason Cooper,
	Andrew Lunn, Chris Ball, Thomas Petazzoni

Hi Simon

On Mon, 13 May 2013, Simon Baatz wrote:

> While adding DT support for the Sheevaplugs by Globalscale Technologies
> (Kirkwood), it turned out that the DT binding of mvsdio lacked features to
> properly support the hardware (active high/low of CD and WP pins could not
> be described in DT).
> 
> This is standard functionality provided by the mmc_of_parse() helper
> function.  However, mmc_of_parse() may allocate GPIO lines.  If the
> allocation fails, it outputs an error, but does not return an error to its
> caller.  Therefore, a proposal to handle errors in mmc_of_parse() is made.

Thanks for the patches. In principle I'm fine either way. It is a policy 
decision IMHO. E.g. consider a situation. You have a DT with an SD-card 
slot, where card-detection is performed by a GPIO. OTOH the same pin is 
used on some other (optional) interface on the same board. If that other 
competing interface is unused, the driver isn't loaded, you can use the 
GPIO for card-detection. However, if that other interface is used, your 
attempt to get the card-detect pin will fail, but you still can use the 
interface in polling mode. No, I don't think this is a good example of 
hardware design :) User experience would depend on driver probing order, 
but in principle it is imaginable. So, with the current mmc_of_parse() 
you're more tolerant. You get a warning in the log, but the interface 
might still be usable. And if you're surprised why your write protection 
status hasn't been properly detected - just look in the log.

You're proposing a change in behaviour. After your change any failure to 
obtain a resource in mmc_of_parse() will fail interface probing. 
Personally I don't think there are any users around, who would notice this 
change, still, we have to be aware of it. And I don't know whether we 
should do that. You know, we don't break user-space ;-)

So, technically I'm ok with the changes, but policy-wise I'm not sure how 
severe this change would be. We could go a bit slower and first add a 
return code as in your patch #1, but not fail drivers, like in your 
patches #2, 3,... but WARN_ON(mmc_of_parse() < 0); and continue for now. 
In 3.12 we could then replace those warnings with real failures. But maybe 
I'm just overcautious and we can just go ahead with your patches. You can 
add my

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

for patches 1-3, and let's see what Chris thinks about this change.

Thanks
Guennadi

> The patch set is structured as follows:
> 
> 1   Adapt mmc_of_parse() to return errors
> 2-6 Handle errors in current drivers using mmc_of_parse() (compile tested
>     only)
> 7-8 Convert mvsdio and respective dts files to mmc_of_parse() (tested on
>     kirkwood)
> 9   Add dts files for (eSATA) Sheevaplug
> 10  Add DT support for (eSATA) Sheevaplug
> 
> 
> I could only test on an eSATA Sheevaplug. I found patches with
> different LEDs for the Sheevaplug.  Thus, I would highly appreciate if
> someone with the hardware could give this a spin on a non-eSATA
> version.  Some additional testing of the change detect and write
> protect behaviour for mvsdio can't hurt either.  I hope that there aren't
> board revisions with different CD/WP pins out there.
> 
> Simon Baatz (10):
>   mmc: return mmc_of_parse() errors to caller
>   mmc: sh_mmcif: handle mmc_of_parse() errors during probe
>   mmc: tmio-mmc: handle mmc_of_parse() errors during probe
>   mmc: mxcmmc: handle mmc_of_parse() errors during probe
>   mmc: sdhi-pxav3: handle mmc_of_parse() errors during probe
>   mmc: tegra: handle mmc_of_parse() errors during probe
>   ARM: mvebu: Use standard MMC binding for all users of mvsdio
>   mmc: mvsdio: use standard MMC device-tree binding parser
>     mmc_of_parse()
>   ARM: Kirkwood: Add dts files for Sheevaplug and eSATA Sheevaplug
>   ARM: Kirkwood: add DT support for Sheevaplug and Sheevaplug eSATA

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

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

* [PATCH V2 00/10] mmc_of_parse() adaptations, DT support for Sheevaplugs
@ 2013-05-14  6:37   ` Guennadi Liakhovetski
  0 siblings, 0 replies; 43+ messages in thread
From: Guennadi Liakhovetski @ 2013-05-14  6:37 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Simon

On Mon, 13 May 2013, Simon Baatz wrote:

> While adding DT support for the Sheevaplugs by Globalscale Technologies
> (Kirkwood), it turned out that the DT binding of mvsdio lacked features to
> properly support the hardware (active high/low of CD and WP pins could not
> be described in DT).
> 
> This is standard functionality provided by the mmc_of_parse() helper
> function.  However, mmc_of_parse() may allocate GPIO lines.  If the
> allocation fails, it outputs an error, but does not return an error to its
> caller.  Therefore, a proposal to handle errors in mmc_of_parse() is made.

Thanks for the patches. In principle I'm fine either way. It is a policy 
decision IMHO. E.g. consider a situation. You have a DT with an SD-card 
slot, where card-detection is performed by a GPIO. OTOH the same pin is 
used on some other (optional) interface on the same board. If that other 
competing interface is unused, the driver isn't loaded, you can use the 
GPIO for card-detection. However, if that other interface is used, your 
attempt to get the card-detect pin will fail, but you still can use the 
interface in polling mode. No, I don't think this is a good example of 
hardware design :) User experience would depend on driver probing order, 
but in principle it is imaginable. So, with the current mmc_of_parse() 
you're more tolerant. You get a warning in the log, but the interface 
might still be usable. And if you're surprised why your write protection 
status hasn't been properly detected - just look in the log.

You're proposing a change in behaviour. After your change any failure to 
obtain a resource in mmc_of_parse() will fail interface probing. 
Personally I don't think there are any users around, who would notice this 
change, still, we have to be aware of it. And I don't know whether we 
should do that. You know, we don't break user-space ;-)

So, technically I'm ok with the changes, but policy-wise I'm not sure how 
severe this change would be. We could go a bit slower and first add a 
return code as in your patch #1, but not fail drivers, like in your 
patches #2, 3,... but WARN_ON(mmc_of_parse() < 0); and continue for now. 
In 3.12 we could then replace those warnings with real failures. But maybe 
I'm just overcautious and we can just go ahead with your patches. You can 
add my

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

for patches 1-3, and let's see what Chris thinks about this change.

Thanks
Guennadi

> The patch set is structured as follows:
> 
> 1   Adapt mmc_of_parse() to return errors
> 2-6 Handle errors in current drivers using mmc_of_parse() (compile tested
>     only)
> 7-8 Convert mvsdio and respective dts files to mmc_of_parse() (tested on
>     kirkwood)
> 9   Add dts files for (eSATA) Sheevaplug
> 10  Add DT support for (eSATA) Sheevaplug
> 
> 
> I could only test on an eSATA Sheevaplug. I found patches with
> different LEDs for the Sheevaplug.  Thus, I would highly appreciate if
> someone with the hardware could give this a spin on a non-eSATA
> version.  Some additional testing of the change detect and write
> protect behaviour for mvsdio can't hurt either.  I hope that there aren't
> board revisions with different CD/WP pins out there.
> 
> Simon Baatz (10):
>   mmc: return mmc_of_parse() errors to caller
>   mmc: sh_mmcif: handle mmc_of_parse() errors during probe
>   mmc: tmio-mmc: handle mmc_of_parse() errors during probe
>   mmc: mxcmmc: handle mmc_of_parse() errors during probe
>   mmc: sdhi-pxav3: handle mmc_of_parse() errors during probe
>   mmc: tegra: handle mmc_of_parse() errors during probe
>   ARM: mvebu: Use standard MMC binding for all users of mvsdio
>   mmc: mvsdio: use standard MMC device-tree binding parser
>     mmc_of_parse()
>   ARM: Kirkwood: Add dts files for Sheevaplug and eSATA Sheevaplug
>   ARM: Kirkwood: add DT support for Sheevaplug and Sheevaplug eSATA

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

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

* Re: [PATCH V2 05/10] mmc: sdhi-pxav3: handle mmc_of_parse() errors during probe
  2013-05-13 21:18   ` Simon Baatz
@ 2013-05-14  6:38       ` Guennadi Liakhovetski
  -1 siblings, 0 replies; 43+ messages in thread
From: Guennadi Liakhovetski @ 2013-05-14  6:38 UTC (permalink / raw)
  To: Simon Baatz
  Cc: Andrew Lunn, Jason Cooper,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	linux-mmc-u79uwXL29TY76Z2rM5mHXA, Chris Ball,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

There's a typo in the subject line - it's sdhci, not sdhi :)

Thanks
Guennadi

On Mon, 13 May 2013, Simon Baatz wrote:

> 
> Signed-off-by: Simon Baatz <gmbnomis-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> ---
>  drivers/mmc/host/sdhci-pxav3.c |    7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/mmc/host/sdhci-pxav3.c b/drivers/mmc/host/sdhci-pxav3.c
> index 1ae358e..67ea388 100644
> --- a/drivers/mmc/host/sdhci-pxav3.c
> +++ b/drivers/mmc/host/sdhci-pxav3.c
> @@ -252,7 +252,9 @@ static int sdhci_pxav3_probe(struct platform_device *pdev)
>  
>  	match = of_match_device(of_match_ptr(sdhci_pxav3_of_match), &pdev->dev);
>  	if (match) {
> -		mmc_of_parse(host->mmc);
> +		ret = mmc_of_parse(host->mmc);
> +		if (ret)
> +			goto err_of_parse;
>  		sdhci_get_of_property(pdev);
>  		pdata = pxav3_get_mmc_pdata(dev);
>  	} else if (pdata) {
> @@ -313,10 +315,11 @@ static int sdhci_pxav3_probe(struct platform_device *pdev)
>  
>  	return 0;
>  
> +err_of_parse:
> +err_cd_req:
>  err_add_host:
>  	clk_disable_unprepare(clk);
>  	clk_put(clk);
> -err_cd_req:
>  err_clk_get:
>  	sdhci_pltfm_free(pdev);
>  	kfree(pxa);
> -- 
> 1.7.9.5
> 

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

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

* [PATCH V2 05/10] mmc: sdhi-pxav3: handle mmc_of_parse() errors during probe
@ 2013-05-14  6:38       ` Guennadi Liakhovetski
  0 siblings, 0 replies; 43+ messages in thread
From: Guennadi Liakhovetski @ 2013-05-14  6:38 UTC (permalink / raw)
  To: linux-arm-kernel

There's a typo in the subject line - it's sdhci, not sdhi :)

Thanks
Guennadi

On Mon, 13 May 2013, Simon Baatz wrote:

> 
> Signed-off-by: Simon Baatz <gmbnomis@gmail.com>
> ---
>  drivers/mmc/host/sdhci-pxav3.c |    7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/mmc/host/sdhci-pxav3.c b/drivers/mmc/host/sdhci-pxav3.c
> index 1ae358e..67ea388 100644
> --- a/drivers/mmc/host/sdhci-pxav3.c
> +++ b/drivers/mmc/host/sdhci-pxav3.c
> @@ -252,7 +252,9 @@ static int sdhci_pxav3_probe(struct platform_device *pdev)
>  
>  	match = of_match_device(of_match_ptr(sdhci_pxav3_of_match), &pdev->dev);
>  	if (match) {
> -		mmc_of_parse(host->mmc);
> +		ret = mmc_of_parse(host->mmc);
> +		if (ret)
> +			goto err_of_parse;
>  		sdhci_get_of_property(pdev);
>  		pdata = pxav3_get_mmc_pdata(dev);
>  	} else if (pdata) {
> @@ -313,10 +315,11 @@ static int sdhci_pxav3_probe(struct platform_device *pdev)
>  
>  	return 0;
>  
> +err_of_parse:
> +err_cd_req:
>  err_add_host:
>  	clk_disable_unprepare(clk);
>  	clk_put(clk);
> -err_cd_req:
>  err_clk_get:
>  	sdhci_pltfm_free(pdev);
>  	kfree(pxa);
> -- 
> 1.7.9.5
> 

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

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

* Re: [PATCH V2 01/10] mmc: return mmc_of_parse() errors to caller
  2013-05-13 21:18   ` Simon Baatz
@ 2013-05-14  7:20     ` Ulf Hansson
  -1 siblings, 0 replies; 43+ messages in thread
From: Ulf Hansson @ 2013-05-14  7:20 UTC (permalink / raw)
  To: Simon Baatz
  Cc: linux-arm-kernel, linux-mmc, devicetree-discuss, Jason Cooper,
	Andrew Lunn, Chris Ball, Guennadi Liakhovetski, Thomas Petazzoni

On 13 May 2013 23:18, Simon Baatz <gmbnomis@gmail.com> wrote:
> In addition to just logging errors encountered during DT parsing or
> allocating GPIO slots for CD/WP, mmc_of_parse() now returns with an
> error.
>
> Signed-off-by: Simon Baatz <gmbnomis@gmail.com>
> ---
>  drivers/mmc/core/host.c  |   24 +++++++++++++++++++-----
>  include/linux/mmc/host.h |    2 +-
>  2 files changed, 20 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/mmc/core/host.c b/drivers/mmc/core/host.c
> index 2a3593d..45122cc 100644
> --- a/drivers/mmc/core/host.c
> +++ b/drivers/mmc/core/host.c
> @@ -306,7 +306,7 @@ static inline void mmc_host_clk_sysfs_init(struct mmc_host *host)
>   * parse the properties and set respective generic mmc-host flags and
>   * parameters.
>   */
> -void mmc_of_parse(struct mmc_host *host)
> +int mmc_of_parse(struct mmc_host *host)
>  {
>         struct device_node *np;
>         u32 bus_width;
> @@ -315,7 +315,7 @@ void mmc_of_parse(struct mmc_host *host)
>         int len, ret, gpio;
>
>         if (!host->parent || !host->parent->of_node)
> -               return;
> +               return 0;
>
>         np = host->parent->of_node;
>
> @@ -338,6 +338,7 @@ void mmc_of_parse(struct mmc_host *host)
>         default:
>                 dev_err(host->parent,
>                         "Invalid \"bus-width\" value %ud!\n", bus_width);
> +               return -EINVAL;
>         }
>
>         /* f_max is obtained from the optional "max-frequency" property */
> @@ -372,13 +373,15 @@ void mmc_of_parse(struct mmc_host *host)
>                                 gpio_inv_cd = true;
>
>                         ret = mmc_gpio_request_cd(host, gpio);
> -                       if (ret < 0)
> +                       if (ret < 0) {
>                                 dev_err(host->parent,
>                                         "Failed to request CD GPIO #%d: %d!\n",
>                                         gpio, ret);
> -                       else
> +                               return ret;
> +                       } else {
>                                 dev_info(host->parent, "Got CD GPIO #%d.\n",
>                                          gpio);
> +                       }
>                 }
>
>                 if (explicit_inv_cd ^ gpio_inv_cd)
> @@ -394,9 +397,14 @@ void mmc_of_parse(struct mmc_host *host)
>                         gpio_inv_wp = true;
>
>                 ret = mmc_gpio_request_ro(host, gpio);
> -               if (ret < 0)
> +               if (ret < 0) {
>                         dev_err(host->parent,
>                                 "Failed to request WP GPIO: %d!\n", ret);
> +                       goto out;
> +               } else {
> +                               dev_info(host->parent, "Got WP GPIO #%d.\n",
> +                                        gpio);
> +               }
>         }
>         if (explicit_inv_wp ^ gpio_inv_wp)
>                 host->caps2 |= MMC_CAP2_RO_ACTIVE_HIGH;
> @@ -413,6 +421,12 @@ void mmc_of_parse(struct mmc_host *host)
>                 host->pm_caps |= MMC_PM_KEEP_POWER;
>         if (of_find_property(np, "enable-sdio-wakeup", &len))
>                 host->pm_caps |= MMC_PM_WAKE_SDIO_IRQ;
> +
> +       return 0;
> +
> +out:
> +       mmc_gpio_free_cd(host);
> +       return ret;
>  }
>
>  EXPORT_SYMBOL(mmc_of_parse);
> diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
> index e326ae2..c8c4fbc 100644
> --- a/include/linux/mmc/host.h
> +++ b/include/linux/mmc/host.h
> @@ -369,7 +369,7 @@ struct mmc_host *mmc_alloc_host(int extra, struct device *);
>  int mmc_add_host(struct mmc_host *);
>  void mmc_remove_host(struct mmc_host *);
>  void mmc_free_host(struct mmc_host *);
> -void mmc_of_parse(struct mmc_host *host);
> +int mmc_of_parse(struct mmc_host *host);
>
>  static inline void *mmc_priv(struct mmc_host *host)
>  {
> --
> 1.7.9.5
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>

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

* [PATCH V2 01/10] mmc: return mmc_of_parse() errors to caller
@ 2013-05-14  7:20     ` Ulf Hansson
  0 siblings, 0 replies; 43+ messages in thread
From: Ulf Hansson @ 2013-05-14  7:20 UTC (permalink / raw)
  To: linux-arm-kernel

On 13 May 2013 23:18, Simon Baatz <gmbnomis@gmail.com> wrote:
> In addition to just logging errors encountered during DT parsing or
> allocating GPIO slots for CD/WP, mmc_of_parse() now returns with an
> error.
>
> Signed-off-by: Simon Baatz <gmbnomis@gmail.com>
> ---
>  drivers/mmc/core/host.c  |   24 +++++++++++++++++++-----
>  include/linux/mmc/host.h |    2 +-
>  2 files changed, 20 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/mmc/core/host.c b/drivers/mmc/core/host.c
> index 2a3593d..45122cc 100644
> --- a/drivers/mmc/core/host.c
> +++ b/drivers/mmc/core/host.c
> @@ -306,7 +306,7 @@ static inline void mmc_host_clk_sysfs_init(struct mmc_host *host)
>   * parse the properties and set respective generic mmc-host flags and
>   * parameters.
>   */
> -void mmc_of_parse(struct mmc_host *host)
> +int mmc_of_parse(struct mmc_host *host)
>  {
>         struct device_node *np;
>         u32 bus_width;
> @@ -315,7 +315,7 @@ void mmc_of_parse(struct mmc_host *host)
>         int len, ret, gpio;
>
>         if (!host->parent || !host->parent->of_node)
> -               return;
> +               return 0;
>
>         np = host->parent->of_node;
>
> @@ -338,6 +338,7 @@ void mmc_of_parse(struct mmc_host *host)
>         default:
>                 dev_err(host->parent,
>                         "Invalid \"bus-width\" value %ud!\n", bus_width);
> +               return -EINVAL;
>         }
>
>         /* f_max is obtained from the optional "max-frequency" property */
> @@ -372,13 +373,15 @@ void mmc_of_parse(struct mmc_host *host)
>                                 gpio_inv_cd = true;
>
>                         ret = mmc_gpio_request_cd(host, gpio);
> -                       if (ret < 0)
> +                       if (ret < 0) {
>                                 dev_err(host->parent,
>                                         "Failed to request CD GPIO #%d: %d!\n",
>                                         gpio, ret);
> -                       else
> +                               return ret;
> +                       } else {
>                                 dev_info(host->parent, "Got CD GPIO #%d.\n",
>                                          gpio);
> +                       }
>                 }
>
>                 if (explicit_inv_cd ^ gpio_inv_cd)
> @@ -394,9 +397,14 @@ void mmc_of_parse(struct mmc_host *host)
>                         gpio_inv_wp = true;
>
>                 ret = mmc_gpio_request_ro(host, gpio);
> -               if (ret < 0)
> +               if (ret < 0) {
>                         dev_err(host->parent,
>                                 "Failed to request WP GPIO: %d!\n", ret);
> +                       goto out;
> +               } else {
> +                               dev_info(host->parent, "Got WP GPIO #%d.\n",
> +                                        gpio);
> +               }
>         }
>         if (explicit_inv_wp ^ gpio_inv_wp)
>                 host->caps2 |= MMC_CAP2_RO_ACTIVE_HIGH;
> @@ -413,6 +421,12 @@ void mmc_of_parse(struct mmc_host *host)
>                 host->pm_caps |= MMC_PM_KEEP_POWER;
>         if (of_find_property(np, "enable-sdio-wakeup", &len))
>                 host->pm_caps |= MMC_PM_WAKE_SDIO_IRQ;
> +
> +       return 0;
> +
> +out:
> +       mmc_gpio_free_cd(host);
> +       return ret;
>  }
>
>  EXPORT_SYMBOL(mmc_of_parse);
> diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
> index e326ae2..c8c4fbc 100644
> --- a/include/linux/mmc/host.h
> +++ b/include/linux/mmc/host.h
> @@ -369,7 +369,7 @@ struct mmc_host *mmc_alloc_host(int extra, struct device *);
>  int mmc_add_host(struct mmc_host *);
>  void mmc_remove_host(struct mmc_host *);
>  void mmc_free_host(struct mmc_host *);
> -void mmc_of_parse(struct mmc_host *host);
> +int mmc_of_parse(struct mmc_host *host);
>
>  static inline void *mmc_priv(struct mmc_host *host)
>  {
> --
> 1.7.9.5
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
> the body of a message to majordomo at vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>

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

* Re: [PATCH V2 00/10] mmc_of_parse() adaptations, DT support for Sheevaplugs
  2013-05-14  6:37   ` Guennadi Liakhovetski
@ 2013-05-14 16:26     ` Simon Baatz
  -1 siblings, 0 replies; 43+ messages in thread
From: Simon Baatz @ 2013-05-14 16:26 UTC (permalink / raw)
  To: Guennadi Liakhovetski
  Cc: linux-arm-kernel, linux-mmc, devicetree-discuss, Jason Cooper,
	Andrew Lunn, Chris Ball, Thomas Petazzoni

Hi Guennadi,

On Tue, May 14, 2013 at 08:37:47AM +0200, Guennadi Liakhovetski wrote:
> On Mon, 13 May 2013, Simon Baatz wrote:
> 
> > While adding DT support for the Sheevaplugs by Globalscale Technologies
> > (Kirkwood), it turned out that the DT binding of mvsdio lacked features to
> > properly support the hardware (active high/low of CD and WP pins could not
> > be described in DT).
> > 
> > This is standard functionality provided by the mmc_of_parse() helper
> > function.  However, mmc_of_parse() may allocate GPIO lines.  If the
> > allocation fails, it outputs an error, but does not return an error to its
> > caller.  Therefore, a proposal to handle errors in mmc_of_parse() is made.
> 
> Thanks for the patches. In principle I'm fine either way. It is a policy 
> decision IMHO. E.g. consider a situation. You have a DT with an SD-card 
> slot, where card-detection is performed by a GPIO. OTOH the same pin is 
> used on some other (optional) interface on the same board. If that other 
> competing interface is unused, the driver isn't loaded, you can use the 
> GPIO for card-detection. However, if that other interface is used, your 
> attempt to get the card-detect pin will fail, but you still can use the 
> interface in polling mode. No, I don't think this is a good example of 
> hardware design :) User experience would depend on driver probing order, 
> but in principle it is imaginable. So, with the current mmc_of_parse() 
> you're more tolerant. You get a warning in the log, but the interface 
> might still be usable. And if you're surprised why your write protection 
> status hasn't been properly detected - just look in the log.

Yes, there is value in both ways. As should be clear by now, I prefer
being more strict here :-).  But in the end, it is a policy decision
as you say.

There is also a "middle way" to split off the gpio allocation. This
has already been proposed in some other thread IIRC.

For example, split the current mmc_of_parse() into:

- mmc_of_parse(): Parses everything except the cd, wp gpios. It can't
  return an error and assumes sensible default values in case of a
  parse error (as it does today).

- mmc_of_gpio_cd(), mmc_of_gpio_wp(): Parses the cd/wp parts and
  requests the respective gpio (returning an error if that fails).

However, this means up to three calls instead of one in the
driver (and the respective error checking if needed).

On the other hand, it offers more flexibility: the driver can decide
whether to ignore the error, fall back to MMC_CAP_NEEDS_POLL or abort
the probe.

> You're proposing a change in behaviour. After your change any failure to 
> obtain a resource in mmc_of_parse() will fail interface probing. 
> Personally I don't think there are any users around, who would notice this 
> change, still, we have to be aware of it. And I don't know whether we 
> should do that. You know, we don't break user-space ;-)
> 
> So, technically I'm ok with the changes, but policy-wise I'm not sure how 
> severe this change would be. We could go a bit slower and first add a 
> return code as in your patch #1, but not fail drivers, like in your 
> patches #2, 3,... but WARN_ON(mmc_of_parse() < 0); and continue for now. 
> In 3.12 we could then replace those warnings with real failures. But maybe 
> I'm just overcautious and we can just go ahead with your patches. You can 
> add my
> 
> Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
> 
> for patches 1-3, and let's see what Chris thinks about this change.

Thanks for the review and the ack! Of course, I am fine with a more
cautious way if that's required.

- Simon

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

* [PATCH V2 00/10] mmc_of_parse() adaptations, DT support for Sheevaplugs
@ 2013-05-14 16:26     ` Simon Baatz
  0 siblings, 0 replies; 43+ messages in thread
From: Simon Baatz @ 2013-05-14 16:26 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Guennadi,

On Tue, May 14, 2013 at 08:37:47AM +0200, Guennadi Liakhovetski wrote:
> On Mon, 13 May 2013, Simon Baatz wrote:
> 
> > While adding DT support for the Sheevaplugs by Globalscale Technologies
> > (Kirkwood), it turned out that the DT binding of mvsdio lacked features to
> > properly support the hardware (active high/low of CD and WP pins could not
> > be described in DT).
> > 
> > This is standard functionality provided by the mmc_of_parse() helper
> > function.  However, mmc_of_parse() may allocate GPIO lines.  If the
> > allocation fails, it outputs an error, but does not return an error to its
> > caller.  Therefore, a proposal to handle errors in mmc_of_parse() is made.
> 
> Thanks for the patches. In principle I'm fine either way. It is a policy 
> decision IMHO. E.g. consider a situation. You have a DT with an SD-card 
> slot, where card-detection is performed by a GPIO. OTOH the same pin is 
> used on some other (optional) interface on the same board. If that other 
> competing interface is unused, the driver isn't loaded, you can use the 
> GPIO for card-detection. However, if that other interface is used, your 
> attempt to get the card-detect pin will fail, but you still can use the 
> interface in polling mode. No, I don't think this is a good example of 
> hardware design :) User experience would depend on driver probing order, 
> but in principle it is imaginable. So, with the current mmc_of_parse() 
> you're more tolerant. You get a warning in the log, but the interface 
> might still be usable. And if you're surprised why your write protection 
> status hasn't been properly detected - just look in the log.

Yes, there is value in both ways. As should be clear by now, I prefer
being more strict here :-).  But in the end, it is a policy decision
as you say.

There is also a "middle way" to split off the gpio allocation. This
has already been proposed in some other thread IIRC.

For example, split the current mmc_of_parse() into:

- mmc_of_parse(): Parses everything except the cd, wp gpios. It can't
  return an error and assumes sensible default values in case of a
  parse error (as it does today).

- mmc_of_gpio_cd(), mmc_of_gpio_wp(): Parses the cd/wp parts and
  requests the respective gpio (returning an error if that fails).

However, this means up to three calls instead of one in the
driver (and the respective error checking if needed).

On the other hand, it offers more flexibility: the driver can decide
whether to ignore the error, fall back to MMC_CAP_NEEDS_POLL or abort
the probe.

> You're proposing a change in behaviour. After your change any failure to 
> obtain a resource in mmc_of_parse() will fail interface probing. 
> Personally I don't think there are any users around, who would notice this 
> change, still, we have to be aware of it. And I don't know whether we 
> should do that. You know, we don't break user-space ;-)
> 
> So, technically I'm ok with the changes, but policy-wise I'm not sure how 
> severe this change would be. We could go a bit slower and first add a 
> return code as in your patch #1, but not fail drivers, like in your 
> patches #2, 3,... but WARN_ON(mmc_of_parse() < 0); and continue for now. 
> In 3.12 we could then replace those warnings with real failures. But maybe 
> I'm just overcautious and we can just go ahead with your patches. You can 
> add my
> 
> Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
> 
> for patches 1-3, and let's see what Chris thinks about this change.

Thanks for the review and the ack! Of course, I am fine with a more
cautious way if that's required.

- Simon

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

* Re: [PATCH V2 07/10] ARM: mvebu: Use standard MMC binding for all users of mvsdio
  2013-05-13 21:18   ` Simon Baatz
@ 2013-05-15  0:29       ` Jason Cooper
  -1 siblings, 0 replies; 43+ messages in thread
From: Jason Cooper @ 2013-05-15  0:29 UTC (permalink / raw)
  To: Simon Baatz
  Cc: Andrew Lunn, devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	linux-mmc-u79uwXL29TY76Z2rM5mHXA, Chris Ball,
	Guennadi Liakhovetski,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On Mon, May 13, 2013 at 11:18:58PM +0200, Simon Baatz wrote:
> In order to prepare the switch to the standard MMC device tree parser
> for mvsdio, adapt all current uses of mvsdio in the dts files to the
> standard format.
> 
> Signed-off-by: Simon Baatz <gmbnomis-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> ---
>  arch/arm/boot/dts/armada-370-db.dts                |    1 +
>  arch/arm/boot/dts/armada-370-mirabox.dts           |    1 +
>  arch/arm/boot/dts/armada-370-rd.dts                |    1 +
>  arch/arm/boot/dts/armada-370-xp.dtsi               |    4 ++++
>  arch/arm/boot/dts/armada-xp-db.dts                 |    1 +
>  arch/arm/boot/dts/kirkwood-dreamplug.dts           |    1 +
>  .../arm/boot/dts/kirkwood-guruplug-server-plus.dts |    2 ++
>  arch/arm/boot/dts/kirkwood-mplcec4.dts             |    2 +-
>  arch/arm/boot/dts/kirkwood-topkick.dts             |    1 +
>  arch/arm/boot/dts/kirkwood.dtsi                    |    4 ++++
>  10 files changed, 17 insertions(+), 1 deletion(-)

Applied to mvebu/dt

thx,

Jason.

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

* [PATCH V2 07/10] ARM: mvebu: Use standard MMC binding for all users of mvsdio
@ 2013-05-15  0:29       ` Jason Cooper
  0 siblings, 0 replies; 43+ messages in thread
From: Jason Cooper @ 2013-05-15  0:29 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, May 13, 2013 at 11:18:58PM +0200, Simon Baatz wrote:
> In order to prepare the switch to the standard MMC device tree parser
> for mvsdio, adapt all current uses of mvsdio in the dts files to the
> standard format.
> 
> Signed-off-by: Simon Baatz <gmbnomis@gmail.com>
> ---
>  arch/arm/boot/dts/armada-370-db.dts                |    1 +
>  arch/arm/boot/dts/armada-370-mirabox.dts           |    1 +
>  arch/arm/boot/dts/armada-370-rd.dts                |    1 +
>  arch/arm/boot/dts/armada-370-xp.dtsi               |    4 ++++
>  arch/arm/boot/dts/armada-xp-db.dts                 |    1 +
>  arch/arm/boot/dts/kirkwood-dreamplug.dts           |    1 +
>  .../arm/boot/dts/kirkwood-guruplug-server-plus.dts |    2 ++
>  arch/arm/boot/dts/kirkwood-mplcec4.dts             |    2 +-
>  arch/arm/boot/dts/kirkwood-topkick.dts             |    1 +
>  arch/arm/boot/dts/kirkwood.dtsi                    |    4 ++++
>  10 files changed, 17 insertions(+), 1 deletion(-)

Applied to mvebu/dt

thx,

Jason.

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

* Re: [PATCH V2 09/10] ARM: Kirkwood: Add dts files for Sheevaplug and eSATA Sheevaplug
  2013-05-13 21:19   ` Simon Baatz
@ 2013-05-15  0:31       ` Jason Cooper
  -1 siblings, 0 replies; 43+ messages in thread
From: Jason Cooper @ 2013-05-15  0:31 UTC (permalink / raw)
  To: Simon Baatz
  Cc: Andrew Lunn, devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	linux-mmc-u79uwXL29TY76Z2rM5mHXA, Chris Ball,
	Guennadi Liakhovetski,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On Mon, May 13, 2013 at 11:19:00PM +0200, Simon Baatz wrote:
> 
> Signed-off-by: Simon Baatz <gmbnomis-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> ---
>  arch/arm/boot/dts/Makefile                        |    2 +
>  arch/arm/boot/dts/kirkwood-sheevaplug-common.dtsi |   97 +++++++++++++++++++++
>  arch/arm/boot/dts/kirkwood-sheevaplug-esata.dts   |   40 +++++++++
>  arch/arm/boot/dts/kirkwood-sheevaplug.dts         |   45 ++++++++++
>  4 files changed, 184 insertions(+)
>  create mode 100644 arch/arm/boot/dts/kirkwood-sheevaplug-common.dtsi
>  create mode 100644 arch/arm/boot/dts/kirkwood-sheevaplug-esata.dts
>  create mode 100644 arch/arm/boot/dts/kirkwood-sheevaplug.dts

Applied to mvebu/dt

thx,

Jason.

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

* [PATCH V2 09/10] ARM: Kirkwood: Add dts files for Sheevaplug and eSATA Sheevaplug
@ 2013-05-15  0:31       ` Jason Cooper
  0 siblings, 0 replies; 43+ messages in thread
From: Jason Cooper @ 2013-05-15  0:31 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, May 13, 2013 at 11:19:00PM +0200, Simon Baatz wrote:
> 
> Signed-off-by: Simon Baatz <gmbnomis@gmail.com>
> ---
>  arch/arm/boot/dts/Makefile                        |    2 +
>  arch/arm/boot/dts/kirkwood-sheevaplug-common.dtsi |   97 +++++++++++++++++++++
>  arch/arm/boot/dts/kirkwood-sheevaplug-esata.dts   |   40 +++++++++
>  arch/arm/boot/dts/kirkwood-sheevaplug.dts         |   45 ++++++++++
>  4 files changed, 184 insertions(+)
>  create mode 100644 arch/arm/boot/dts/kirkwood-sheevaplug-common.dtsi
>  create mode 100644 arch/arm/boot/dts/kirkwood-sheevaplug-esata.dts
>  create mode 100644 arch/arm/boot/dts/kirkwood-sheevaplug.dts

Applied to mvebu/dt

thx,

Jason.

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

* Re: [PATCH V2 10/10] ARM: Kirkwood: add DT support for Sheevaplug and Sheevaplug eSATA
  2013-05-13 21:19   ` Simon Baatz
@ 2013-05-15  0:42       ` Jason Cooper
  -1 siblings, 0 replies; 43+ messages in thread
From: Jason Cooper @ 2013-05-15  0:42 UTC (permalink / raw)
  To: Simon Baatz
  Cc: Andrew Lunn, devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	linux-mmc-u79uwXL29TY76Z2rM5mHXA, Chris Ball,
	Guennadi Liakhovetski,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On Mon, May 13, 2013 at 11:19:01PM +0200, Simon Baatz wrote:
> 
> Signed-off-by: Simon Baatz <gmbnomis-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> ---
>  arch/arm/mach-kirkwood/Kconfig            |    7 +++++++
>  arch/arm/mach-kirkwood/Makefile           |    1 +
>  arch/arm/mach-kirkwood/board-dt.c         |    4 ++++
>  arch/arm/mach-kirkwood/board-sheevaplug.c |   27 +++++++++++++++++++++++++++
>  arch/arm/mach-kirkwood/common.h           |    5 +++++
>  5 files changed, 44 insertions(+)
>  create mode 100644 arch/arm/mach-kirkwood/board-sheevaplug.c

Applied to mvebu/boards

thx,

Jason.

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

* [PATCH V2 10/10] ARM: Kirkwood: add DT support for Sheevaplug and Sheevaplug eSATA
@ 2013-05-15  0:42       ` Jason Cooper
  0 siblings, 0 replies; 43+ messages in thread
From: Jason Cooper @ 2013-05-15  0:42 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, May 13, 2013 at 11:19:01PM +0200, Simon Baatz wrote:
> 
> Signed-off-by: Simon Baatz <gmbnomis@gmail.com>
> ---
>  arch/arm/mach-kirkwood/Kconfig            |    7 +++++++
>  arch/arm/mach-kirkwood/Makefile           |    1 +
>  arch/arm/mach-kirkwood/board-dt.c         |    4 ++++
>  arch/arm/mach-kirkwood/board-sheevaplug.c |   27 +++++++++++++++++++++++++++
>  arch/arm/mach-kirkwood/common.h           |    5 +++++
>  5 files changed, 44 insertions(+)
>  create mode 100644 arch/arm/mach-kirkwood/board-sheevaplug.c

Applied to mvebu/boards

thx,

Jason.

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

* [PATCH] ARM: kirkwood: enable Sheevaplug DT in defconfig
  2013-05-13 21:19   ` Simon Baatz
  (?)
  (?)
@ 2013-05-15  0:53   ` Jason Cooper
  -1 siblings, 0 replies; 43+ messages in thread
From: Jason Cooper @ 2013-05-15  0:53 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Jason Cooper <jason@lakedaemon.net>
---
Just a heads up I'm adding this to the mvebu/defconfig tree.  v3.10-rc1 changed
a few things for defconfig, but it's so little, I'm not worrying about breaking
it out.

 arch/arm/configs/kirkwood_defconfig | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/arch/arm/configs/kirkwood_defconfig b/arch/arm/configs/kirkwood_defconfig
index a1d8252..1916da6 100644
--- a/arch/arm/configs/kirkwood_defconfig
+++ b/arch/arm/configs/kirkwood_defconfig
@@ -1,4 +1,3 @@
-CONFIG_EXPERIMENTAL=y
 CONFIG_SYSVIPC=y
 CONFIG_NO_HZ=y
 CONFIG_HIGH_RES_TIMERS=y
@@ -50,6 +49,7 @@ CONFIG_MACH_NETSPACE_V2_DT=y
 CONFIG_MACH_NSA310_DT=y
 CONFIG_MACH_OPENBLOCKS_A6_DT=y
 CONFIG_MACH_READYNAS_DT=y
+CONFIG_MACH_SHEEVAPLUG_DT=y
 CONFIG_MACH_TOPKICK_DT=y
 CONFIG_MACH_TS219_DT=y
 # CONFIG_CPU_FEROCEON_OLD_ID is not set
@@ -68,14 +68,12 @@ CONFIG_IP_PNP=y
 CONFIG_IP_PNP_DHCP=y
 CONFIG_IP_PNP_BOOTP=y
 # CONFIG_IPV6 is not set
-CONFIG_NET_DSA=y
 CONFIG_NET_PKTGEN=m
 CONFIG_CFG80211=y
 CONFIG_MAC80211=y
 CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
 CONFIG_MTD=y
 CONFIG_MTD_CMDLINE_PARTS=y
-CONFIG_MTD_CHAR=y
 CONFIG_MTD_BLOCK=y
 CONFIG_MTD_CFI=y
 CONFIG_MTD_JEDECPROBE=y
-- 
1.8.2.1

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

* Re: [PATCH V2 00/10] mmc_of_parse() adaptations, DT support for Sheevaplugs
  2013-05-14 16:26     ` Simon Baatz
@ 2013-05-15 19:42       ` Simon Baatz
  -1 siblings, 0 replies; 43+ messages in thread
From: Simon Baatz @ 2013-05-15 19:42 UTC (permalink / raw)
  To: Guennadi Liakhovetski
  Cc: linux-arm-kernel, linux-mmc, devicetree-discuss, Jason Cooper,
	Andrew Lunn, Chris Ball, Thomas Petazzoni, Ulf Hansson

On Tue, May 14, 2013 at 06:26:52PM +0200, Simon Baatz wrote:
> On Tue, May 14, 2013 at 08:37:47AM +0200, Guennadi Liakhovetski wrote:
> > On Mon, 13 May 2013, Simon Baatz wrote:
> > 
> > > While adding DT support for the Sheevaplugs by Globalscale Technologies
> > > (Kirkwood), it turned out that the DT binding of mvsdio lacked features to
> > > properly support the hardware (active high/low of CD and WP pins could not
> > > be described in DT).
> > > 
> > > This is standard functionality provided by the mmc_of_parse() helper
> > > function.  However, mmc_of_parse() may allocate GPIO lines.  If the
> > > allocation fails, it outputs an error, but does not return an error to its
> > > caller.  Therefore, a proposal to handle errors in mmc_of_parse() is made.
> > 
> > Thanks for the patches. In principle I'm fine either way. It is a policy 
> > decision IMHO. E.g. consider a situation. You have a DT with an SD-card 
> > slot, where card-detection is performed by a GPIO. OTOH the same pin is 
> > used on some other (optional) interface on the same board. If that other 
> > competing interface is unused, the driver isn't loaded, you can use the 
> > GPIO for card-detection. However, if that other interface is used, your 
> > attempt to get the card-detect pin will fail, but you still can use the 
> > interface in polling mode. No, I don't think this is a good example of 
> > hardware design :) User experience would depend on driver probing order, 
> > but in principle it is imaginable. So, with the current mmc_of_parse() 
> > you're more tolerant. You get a warning in the log, but the interface 
> > might still be usable. And if you're surprised why your write protection 
> > status hasn't been properly detected - just look in the log.
> 
> Yes, there is value in both ways. As should be clear by now, I prefer
> being more strict here :-).  But in the end, it is a policy decision
> as you say.

I realized that I missed one use case: There are platforms on which a
driver may load earlier than the GPIO driver.  In this case,
EPROBE_DEFER can be used to retry the probe later.  Actually, mmci.c
is an example of such a driver.

Thus, when calling of_get_named_gpio_flags() in mmc_of_parse(), we
need to check for EPROBE_DEFER and return that to the caller. I will
update the patch accordingly.

- Simon

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

* [PATCH V2 00/10] mmc_of_parse() adaptations, DT support for Sheevaplugs
@ 2013-05-15 19:42       ` Simon Baatz
  0 siblings, 0 replies; 43+ messages in thread
From: Simon Baatz @ 2013-05-15 19:42 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, May 14, 2013 at 06:26:52PM +0200, Simon Baatz wrote:
> On Tue, May 14, 2013 at 08:37:47AM +0200, Guennadi Liakhovetski wrote:
> > On Mon, 13 May 2013, Simon Baatz wrote:
> > 
> > > While adding DT support for the Sheevaplugs by Globalscale Technologies
> > > (Kirkwood), it turned out that the DT binding of mvsdio lacked features to
> > > properly support the hardware (active high/low of CD and WP pins could not
> > > be described in DT).
> > > 
> > > This is standard functionality provided by the mmc_of_parse() helper
> > > function.  However, mmc_of_parse() may allocate GPIO lines.  If the
> > > allocation fails, it outputs an error, but does not return an error to its
> > > caller.  Therefore, a proposal to handle errors in mmc_of_parse() is made.
> > 
> > Thanks for the patches. In principle I'm fine either way. It is a policy 
> > decision IMHO. E.g. consider a situation. You have a DT with an SD-card 
> > slot, where card-detection is performed by a GPIO. OTOH the same pin is 
> > used on some other (optional) interface on the same board. If that other 
> > competing interface is unused, the driver isn't loaded, you can use the 
> > GPIO for card-detection. However, if that other interface is used, your 
> > attempt to get the card-detect pin will fail, but you still can use the 
> > interface in polling mode. No, I don't think this is a good example of 
> > hardware design :) User experience would depend on driver probing order, 
> > but in principle it is imaginable. So, with the current mmc_of_parse() 
> > you're more tolerant. You get a warning in the log, but the interface 
> > might still be usable. And if you're surprised why your write protection 
> > status hasn't been properly detected - just look in the log.
> 
> Yes, there is value in both ways. As should be clear by now, I prefer
> being more strict here :-).  But in the end, it is a policy decision
> as you say.

I realized that I missed one use case: There are platforms on which a
driver may load earlier than the GPIO driver.  In this case,
EPROBE_DEFER can be used to retry the probe later.  Actually, mmci.c
is an example of such a driver.

Thus, when calling of_get_named_gpio_flags() in mmc_of_parse(), we
need to check for EPROBE_DEFER and return that to the caller. I will
update the patch accordingly.

- Simon

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

end of thread, other threads:[~2013-05-15 19:42 UTC | newest]

Thread overview: 43+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-13 21:18 [PATCH V2 00/10] mmc_of_parse() adaptations, DT support for Sheevaplugs Simon Baatz
2013-05-13 21:18 ` Simon Baatz
2013-05-13 21:18 ` [PATCH V2 01/10] mmc: return mmc_of_parse() errors to caller Simon Baatz
2013-05-13 21:18   ` Simon Baatz
2013-05-14  7:20   ` Ulf Hansson
2013-05-14  7:20     ` Ulf Hansson
2013-05-13 21:18 ` [PATCH V2 02/10] mmc: sh_mmcif: handle mmc_of_parse() errors during probe Simon Baatz
2013-05-13 21:18   ` Simon Baatz
2013-05-13 21:18 ` [PATCH V2 03/10] mmc: tmio-mmc: " Simon Baatz
2013-05-13 21:18   ` Simon Baatz
2013-05-13 21:18 ` [PATCH V2 04/10] mmc: mxcmmc: " Simon Baatz
2013-05-13 21:18   ` Simon Baatz
2013-05-13 21:18 ` [PATCH V2 05/10] mmc: sdhi-pxav3: " Simon Baatz
2013-05-13 21:18   ` Simon Baatz
     [not found]   ` <1368479941-10084-6-git-send-email-gmbnomis-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2013-05-14  6:38     ` Guennadi Liakhovetski
2013-05-14  6:38       ` Guennadi Liakhovetski
2013-05-13 21:18 ` [PATCH V2 06/10] mmc: tegra: " Simon Baatz
2013-05-13 21:18   ` Simon Baatz
2013-05-13 21:18 ` [PATCH V2 07/10] ARM: mvebu: Use standard MMC binding for all users of mvsdio Simon Baatz
2013-05-13 21:18   ` Simon Baatz
     [not found]   ` <1368479941-10084-8-git-send-email-gmbnomis-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2013-05-13 23:09     ` Jason Cooper
2013-05-13 23:09       ` Jason Cooper
2013-05-14  5:37       ` Simon Baatz
2013-05-14  5:37         ` Simon Baatz
2013-05-15  0:29     ` Jason Cooper
2013-05-15  0:29       ` Jason Cooper
2013-05-13 21:18 ` [PATCH V2 08/10] mmc: mvsdio: use standard MMC device-tree binding parser mmc_of_parse() Simon Baatz
2013-05-13 21:18   ` Simon Baatz
2013-05-13 21:19 ` [PATCH V2 09/10] ARM: Kirkwood: Add dts files for Sheevaplug and eSATA Sheevaplug Simon Baatz
2013-05-13 21:19   ` Simon Baatz
     [not found]   ` <1368479941-10084-10-git-send-email-gmbnomis-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2013-05-15  0:31     ` Jason Cooper
2013-05-15  0:31       ` Jason Cooper
2013-05-13 21:19 ` [PATCH V2 10/10] ARM: Kirkwood: add DT support for Sheevaplug and Sheevaplug eSATA Simon Baatz
2013-05-13 21:19   ` Simon Baatz
     [not found]   ` <1368479941-10084-11-git-send-email-gmbnomis-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2013-05-15  0:42     ` Jason Cooper
2013-05-15  0:42       ` Jason Cooper
2013-05-15  0:53   ` [PATCH] ARM: kirkwood: enable Sheevaplug DT in defconfig Jason Cooper
2013-05-14  6:37 ` [PATCH V2 00/10] mmc_of_parse() adaptations, DT support for Sheevaplugs Guennadi Liakhovetski
2013-05-14  6:37   ` Guennadi Liakhovetski
2013-05-14 16:26   ` Simon Baatz
2013-05-14 16:26     ` Simon Baatz
2013-05-15 19:42     ` Simon Baatz
2013-05-15 19:42       ` Simon Baatz

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.