All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] ARM: Kirkwood: Add DT support for (eSATA) Sheevaplug
@ 2013-04-22 19:54 ` Simon Baatz
  0 siblings, 0 replies; 28+ messages in thread
From: Simon Baatz @ 2013-04-22 19:54 UTC (permalink / raw)
  To: linux-arm-kernel, linux-mmc; +Cc: jason, andrew, cjb, thomas.petazzoni

These patches add DT support for the Sheevaplugs by Globalscale
Technologies.  There exists two versions, one with an eSATA port and
one without.

Surprisingly, the conversion was not straight forward. In the eSATA
version (board revision 1.3), the CD and WP pins are connected to GPIO
lines, but I could not get this to work.  Apparently, I am not the only
one ([1]).  I found that the pins are reversed on my hardware and use
different active low/active high settings.

Thus, the first patch adds support for the GPIO active low/high flag in
DT to the mvsdio driver.

With that, everything except the Gigabit Ethernet can be described in
the DTS.  I have split the DTS and the board support files into two
patches.  This way, we can drop the last patch once we can describe
everything in the DTS or we can squash them together if we don't want
to wait.

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 sdio can't hurt either.  I hope that there aren't
board revisions with different CD/WP pins out there.

[1] http://lists.infradead.org/pipermail/linux-arm-kernel/2011-August/062567.html

Simon Baatz (3):
  mmc: mvsdio: Support inverted CD and WP GPIO lines
  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/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         |   43 +++++++++
 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/host/mvsdio.c                         |   14 ++-
 11 files changed, 239 insertions(+), 3 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] 28+ messages in thread

* [PATCH 0/3] ARM: Kirkwood: Add DT support for (eSATA) Sheevaplug
@ 2013-04-22 19:54 ` Simon Baatz
  0 siblings, 0 replies; 28+ messages in thread
From: Simon Baatz @ 2013-04-22 19:54 UTC (permalink / raw)
  To: linux-arm-kernel

These patches add DT support for the Sheevaplugs by Globalscale
Technologies.  There exists two versions, one with an eSATA port and
one without.

Surprisingly, the conversion was not straight forward. In the eSATA
version (board revision 1.3), the CD and WP pins are connected to GPIO
lines, but I could not get this to work.  Apparently, I am not the only
one ([1]).  I found that the pins are reversed on my hardware and use
different active low/active high settings.

Thus, the first patch adds support for the GPIO active low/high flag in
DT to the mvsdio driver.

With that, everything except the Gigabit Ethernet can be described in
the DTS.  I have split the DTS and the board support files into two
patches.  This way, we can drop the last patch once we can describe
everything in the DTS or we can squash them together if we don't want
to wait.

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 sdio can't hurt either.  I hope that there aren't
board revisions with different CD/WP pins out there.

[1] http://lists.infradead.org/pipermail/linux-arm-kernel/2011-August/062567.html

Simon Baatz (3):
  mmc: mvsdio: Support inverted CD and WP GPIO lines
  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/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         |   43 +++++++++
 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/host/mvsdio.c                         |   14 ++-
 11 files changed, 239 insertions(+), 3 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] 28+ messages in thread

* [PATCH 1/3] mmc: mvsdio: Support inverted CD and WP GPIO lines
  2013-04-22 19:54 ` Simon Baatz
@ 2013-04-22 19:54   ` Simon Baatz
  -1 siblings, 0 replies; 28+ messages in thread
From: Simon Baatz @ 2013-04-22 19:54 UTC (permalink / raw)
  To: linux-arm-kernel, linux-mmc; +Cc: jason, andrew, cjb, thomas.petazzoni

The slot-gpio helper functions allow to specify whether card detect and
write protect GPIO lines are active high or active low.  Since DT
allows to specify active low/high for GPIO lines as well, we can simply
initialize the flags for slot-gpio using the GPIO flags to support all
cases.

We need to adapt the dts files that use CD/WP via GPIO accordingly.
Only the dts for "MPL CEC4" is affected by this change.

Signed-off-by: Simon Baatz <gmbnomis@gmail.com>
---
 arch/arm/boot/dts/kirkwood-mplcec4.dts |    2 +-
 drivers/mmc/host/mvsdio.c              |   14 ++++++++++++--
 2 files changed, 13 insertions(+), 3 deletions(-)

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/drivers/mmc/host/mvsdio.c b/drivers/mmc/host/mvsdio.c
index 145cdaf..d444efd 100644
--- a/drivers/mmc/host/mvsdio.c
+++ b/drivers/mmc/host/mvsdio.c
@@ -691,6 +691,7 @@ static int __init mvsd_probe(struct platform_device *pdev)
 	struct resource *r;
 	int ret, irq;
 	int gpio_card_detect, gpio_write_protect;
+	enum of_gpio_flags gpio_flags;
 	struct pinctrl *pinctrl;
 
 	r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
@@ -731,8 +732,17 @@ 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);
+		gpio_card_detect = of_get_named_gpio_flags(np, "cd-gpios", 0,
+						     &gpio_flags);
+		if (gpio_is_valid(gpio_card_detect) &&
+		    !(gpio_flags & OF_GPIO_ACTIVE_LOW))
+			mmc->caps2 |= MMC_CAP2_CD_ACTIVE_HIGH;
+
+		gpio_write_protect = of_get_named_gpio_flags(np, "wp-gpios", 0,
+						       &gpio_flags);
+		if (gpio_is_valid(gpio_write_protect) &&
+		    !(gpio_flags & OF_GPIO_ACTIVE_LOW))
+			mmc->caps2 |= MMC_CAP2_RO_ACTIVE_HIGH;
 	} else {
 		const struct mvsdio_platform_data *mvsd_data;
 		mvsd_data = pdev->dev.platform_data;
-- 
1.7.9.5


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

* [PATCH 1/3] mmc: mvsdio: Support inverted CD and WP GPIO lines
@ 2013-04-22 19:54   ` Simon Baatz
  0 siblings, 0 replies; 28+ messages in thread
From: Simon Baatz @ 2013-04-22 19:54 UTC (permalink / raw)
  To: linux-arm-kernel

The slot-gpio helper functions allow to specify whether card detect and
write protect GPIO lines are active high or active low.  Since DT
allows to specify active low/high for GPIO lines as well, we can simply
initialize the flags for slot-gpio using the GPIO flags to support all
cases.

We need to adapt the dts files that use CD/WP via GPIO accordingly.
Only the dts for "MPL CEC4" is affected by this change.

Signed-off-by: Simon Baatz <gmbnomis@gmail.com>
---
 arch/arm/boot/dts/kirkwood-mplcec4.dts |    2 +-
 drivers/mmc/host/mvsdio.c              |   14 ++++++++++++--
 2 files changed, 13 insertions(+), 3 deletions(-)

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/drivers/mmc/host/mvsdio.c b/drivers/mmc/host/mvsdio.c
index 145cdaf..d444efd 100644
--- a/drivers/mmc/host/mvsdio.c
+++ b/drivers/mmc/host/mvsdio.c
@@ -691,6 +691,7 @@ static int __init mvsd_probe(struct platform_device *pdev)
 	struct resource *r;
 	int ret, irq;
 	int gpio_card_detect, gpio_write_protect;
+	enum of_gpio_flags gpio_flags;
 	struct pinctrl *pinctrl;
 
 	r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
@@ -731,8 +732,17 @@ 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);
+		gpio_card_detect = of_get_named_gpio_flags(np, "cd-gpios", 0,
+						     &gpio_flags);
+		if (gpio_is_valid(gpio_card_detect) &&
+		    !(gpio_flags & OF_GPIO_ACTIVE_LOW))
+			mmc->caps2 |= MMC_CAP2_CD_ACTIVE_HIGH;
+
+		gpio_write_protect = of_get_named_gpio_flags(np, "wp-gpios", 0,
+						       &gpio_flags);
+		if (gpio_is_valid(gpio_write_protect) &&
+		    !(gpio_flags & OF_GPIO_ACTIVE_LOW))
+			mmc->caps2 |= MMC_CAP2_RO_ACTIVE_HIGH;
 	} else {
 		const struct mvsdio_platform_data *mvsd_data;
 		mvsd_data = pdev->dev.platform_data;
-- 
1.7.9.5

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

* [PATCH 2/3] ARM: Kirkwood: Add dts files for Sheevaplug and eSATA Sheevaplug
  2013-04-22 19:54 ` Simon Baatz
@ 2013-04-22 19:54   ` Simon Baatz
  -1 siblings, 0 replies; 28+ messages in thread
From: Simon Baatz @ 2013-04-22 19:54 UTC (permalink / raw)
  To: linux-arm-kernel, linux-mmc; +Cc: jason, andrew, cjb, 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         |   43 +++++++++
 4 files changed, 182 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 9c62558..c2f52db 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -70,6 +70,8 @@ dtb-$(CONFIG_ARCH_KIRKWOOD) += kirkwood-dns320.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..ca2ac1c
--- /dev/null
+++ b/arch/arm/boot/dts/kirkwood-sheevaplug.dts
@@ -0,0 +1,43 @@
+/*
+ * 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";
+		};
+	};
+
+	gpio-leds {
+		compatible = "gpio-leds";
+
+		misc {
+			label = "sheevaplug:red:misc";
+			gpios = <&gpio1 14 1>;
+		};
+	};
+};
-- 
1.7.9.5


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

* [PATCH 2/3] ARM: Kirkwood: Add dts files for Sheevaplug and eSATA Sheevaplug
@ 2013-04-22 19:54   ` Simon Baatz
  0 siblings, 0 replies; 28+ messages in thread
From: Simon Baatz @ 2013-04-22 19:54 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         |   43 +++++++++
 4 files changed, 182 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 9c62558..c2f52db 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -70,6 +70,8 @@ dtb-$(CONFIG_ARCH_KIRKWOOD) += kirkwood-dns320.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..ca2ac1c
--- /dev/null
+++ b/arch/arm/boot/dts/kirkwood-sheevaplug.dts
@@ -0,0 +1,43 @@
+/*
+ * 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";
+		};
+	};
+
+	gpio-leds {
+		compatible = "gpio-leds";
+
+		misc {
+			label = "sheevaplug:red:misc";
+			gpios = <&gpio1 14 1>;
+		};
+	};
+};
-- 
1.7.9.5

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

* [PATCH 3/3] ARM: Kirkwood: Add DT support for Sheevaplug and Sheevaplug eSATA
  2013-04-22 19:54 ` Simon Baatz
@ 2013-04-22 19:55   ` Simon Baatz
  -1 siblings, 0 replies; 28+ messages in thread
From: Simon Baatz @ 2013-04-22 19:55 UTC (permalink / raw)
  To: linux-arm-kernel, linux-mmc; +Cc: jason, andrew, cjb, 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 7b6a64b..5bf6642 100644
--- a/arch/arm/mach-kirkwood/Kconfig
+++ b/arch/arm/mach-kirkwood/Kconfig
@@ -58,6 +58,13 @@ config ARCH_KIRKWOOD_DT
 	  Say 'Y' here if you want your kernel to support the
 	  Marvell Kirkwood using flattened 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_GURUPLUG_DT
 	bool "Marvell GuruPlug Reference Board (Flattened Device Tree)"
 	select ARCH_KIRKWOOD_DT
diff --git a/arch/arm/mach-kirkwood/Makefile b/arch/arm/mach-kirkwood/Makefile
index 4cc4bee..71cb451 100644
--- a/arch/arm/mach-kirkwood/Makefile
+++ b/arch/arm/mach-kirkwood/Makefile
@@ -22,6 +22,7 @@ obj-$(CONFIG_MACH_T5325)		+= t5325-setup.o
 obj-$(CONFIG_ARCH_KIRKWOOD_DT)		+= board-dt.o
 obj-$(CONFIG_MACH_DREAMPLUG_DT)		+= board-dreamplug.o
 obj-$(CONFIG_MACH_GURUPLUG_DT)		+= board-guruplug.o
+obj-$(CONFIG_MACH_SHEEVAPLUG_DT)	+= board-sheevaplug.o
 obj-$(CONFIG_MACH_ICONNECT_DT)		+= board-iconnect.o
 obj-$(CONFIG_MACH_DLINK_KIRKWOOD_DT)	+= board-dnskw.o
 obj-$(CONFIG_MACH_IB62X0_DT)		+= board-ib62x0.o
diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c
index d367aa6..0e3ac29 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();
 
@@ -161,6 +164,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 5ed7056..4944201 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] 28+ messages in thread

* [PATCH 3/3] ARM: Kirkwood: Add DT support for Sheevaplug and Sheevaplug eSATA
@ 2013-04-22 19:55   ` Simon Baatz
  0 siblings, 0 replies; 28+ messages in thread
From: Simon Baatz @ 2013-04-22 19:55 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 7b6a64b..5bf6642 100644
--- a/arch/arm/mach-kirkwood/Kconfig
+++ b/arch/arm/mach-kirkwood/Kconfig
@@ -58,6 +58,13 @@ config ARCH_KIRKWOOD_DT
 	  Say 'Y' here if you want your kernel to support the
 	  Marvell Kirkwood using flattened 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_GURUPLUG_DT
 	bool "Marvell GuruPlug Reference Board (Flattened Device Tree)"
 	select ARCH_KIRKWOOD_DT
diff --git a/arch/arm/mach-kirkwood/Makefile b/arch/arm/mach-kirkwood/Makefile
index 4cc4bee..71cb451 100644
--- a/arch/arm/mach-kirkwood/Makefile
+++ b/arch/arm/mach-kirkwood/Makefile
@@ -22,6 +22,7 @@ obj-$(CONFIG_MACH_T5325)		+= t5325-setup.o
 obj-$(CONFIG_ARCH_KIRKWOOD_DT)		+= board-dt.o
 obj-$(CONFIG_MACH_DREAMPLUG_DT)		+= board-dreamplug.o
 obj-$(CONFIG_MACH_GURUPLUG_DT)		+= board-guruplug.o
+obj-$(CONFIG_MACH_SHEEVAPLUG_DT)	+= board-sheevaplug.o
 obj-$(CONFIG_MACH_ICONNECT_DT)		+= board-iconnect.o
 obj-$(CONFIG_MACH_DLINK_KIRKWOOD_DT)	+= board-dnskw.o
 obj-$(CONFIG_MACH_IB62X0_DT)		+= board-ib62x0.o
diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c
index d367aa6..0e3ac29 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();
 
@@ -161,6 +164,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 5ed7056..4944201 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] 28+ messages in thread

* Re: [PATCH 1/3] mmc: mvsdio: Support inverted CD and WP GPIO lines
  2013-04-22 19:54   ` Simon Baatz
@ 2013-04-22 20:03     ` Chris Ball
  -1 siblings, 0 replies; 28+ messages in thread
From: Chris Ball @ 2013-04-22 20:03 UTC (permalink / raw)
  To: Simon Baatz
  Cc: linux-arm-kernel, linux-mmc, jason, andrew, thomas.petazzoni,
	Guennadi Liakhovetski

Hi Simon,

On Mon, Apr 22 2013, Simon Baatz wrote:
> diff --git a/drivers/mmc/host/mvsdio.c b/drivers/mmc/host/mvsdio.c
> index 145cdaf..d444efd 100644
> --- a/drivers/mmc/host/mvsdio.c
> +++ b/drivers/mmc/host/mvsdio.c
> @@ -691,6 +691,7 @@ static int __init mvsd_probe(struct platform_device *pdev)
>  	struct resource *r;
>  	int ret, irq;
>  	int gpio_card_detect, gpio_write_protect;
> +	enum of_gpio_flags gpio_flags;
>  	struct pinctrl *pinctrl;
>  
>  	r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> @@ -731,8 +732,17 @@ 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);
> +		gpio_card_detect = of_get_named_gpio_flags(np, "cd-gpios", 0,
> +						     &gpio_flags);
> +		if (gpio_is_valid(gpio_card_detect) &&
> +		    !(gpio_flags & OF_GPIO_ACTIVE_LOW))
> +			mmc->caps2 |= MMC_CAP2_CD_ACTIVE_HIGH;
> +
> +		gpio_write_protect = of_get_named_gpio_flags(np, "wp-gpios", 0,
> +						       &gpio_flags);
> +		if (gpio_is_valid(gpio_write_protect) &&
> +		    !(gpio_flags & OF_GPIO_ACTIVE_LOW))
> +			mmc->caps2 |= MMC_CAP2_RO_ACTIVE_HIGH;
>  	} else {
>  		const struct mvsdio_platform_data *mvsd_data;
>  		mvsd_data = pdev->dev.platform_data;

The core function mmc_of_parse() (new in 3.9) will do all of this DT
parsing for you, and will also take care of the driver's later calls
to mmc_gpio_request_{cd,wp}().  Could you try using that function
instead, please?

Thanks,

- Chris.
-- 
Chris Ball   <cjb@laptop.org>   <http://printf.net/>
One Laptop Per Child

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

* [PATCH 1/3] mmc: mvsdio: Support inverted CD and WP GPIO lines
@ 2013-04-22 20:03     ` Chris Ball
  0 siblings, 0 replies; 28+ messages in thread
From: Chris Ball @ 2013-04-22 20:03 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Simon,

On Mon, Apr 22 2013, Simon Baatz wrote:
> diff --git a/drivers/mmc/host/mvsdio.c b/drivers/mmc/host/mvsdio.c
> index 145cdaf..d444efd 100644
> --- a/drivers/mmc/host/mvsdio.c
> +++ b/drivers/mmc/host/mvsdio.c
> @@ -691,6 +691,7 @@ static int __init mvsd_probe(struct platform_device *pdev)
>  	struct resource *r;
>  	int ret, irq;
>  	int gpio_card_detect, gpio_write_protect;
> +	enum of_gpio_flags gpio_flags;
>  	struct pinctrl *pinctrl;
>  
>  	r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> @@ -731,8 +732,17 @@ 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);
> +		gpio_card_detect = of_get_named_gpio_flags(np, "cd-gpios", 0,
> +						     &gpio_flags);
> +		if (gpio_is_valid(gpio_card_detect) &&
> +		    !(gpio_flags & OF_GPIO_ACTIVE_LOW))
> +			mmc->caps2 |= MMC_CAP2_CD_ACTIVE_HIGH;
> +
> +		gpio_write_protect = of_get_named_gpio_flags(np, "wp-gpios", 0,
> +						       &gpio_flags);
> +		if (gpio_is_valid(gpio_write_protect) &&
> +		    !(gpio_flags & OF_GPIO_ACTIVE_LOW))
> +			mmc->caps2 |= MMC_CAP2_RO_ACTIVE_HIGH;
>  	} else {
>  		const struct mvsdio_platform_data *mvsd_data;
>  		mvsd_data = pdev->dev.platform_data;

The core function mmc_of_parse() (new in 3.9) will do all of this DT
parsing for you, and will also take care of the driver's later calls
to mmc_gpio_request_{cd,wp}().  Could you try using that function
instead, please?

Thanks,

- Chris.
-- 
Chris Ball   <cjb@laptop.org>   <http://printf.net/>
One Laptop Per Child

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

* Re: [PATCH 1/3] mmc: mvsdio: Support inverted CD and WP GPIO lines
  2013-04-22 20:03     ` Chris Ball
@ 2013-04-22 20:37       ` Andrew Lunn
  -1 siblings, 0 replies; 28+ messages in thread
From: Andrew Lunn @ 2013-04-22 20:37 UTC (permalink / raw)
  To: Chris Ball
  Cc: Simon Baatz, linux-arm-kernel, linux-mmc, jason, andrew,
	thomas.petazzoni, Guennadi Liakhovetski

On Mon, Apr 22, 2013 at 04:03:15PM -0400, Chris Ball wrote:
> Hi Simon,
> 
> On Mon, Apr 22 2013, Simon Baatz wrote:
> > diff --git a/drivers/mmc/host/mvsdio.c b/drivers/mmc/host/mvsdio.c
> > index 145cdaf..d444efd 100644
> > --- a/drivers/mmc/host/mvsdio.c
> > +++ b/drivers/mmc/host/mvsdio.c
> > @@ -691,6 +691,7 @@ static int __init mvsd_probe(struct platform_device *pdev)
> >  	struct resource *r;
> >  	int ret, irq;
> >  	int gpio_card_detect, gpio_write_protect;
> > +	enum of_gpio_flags gpio_flags;
> >  	struct pinctrl *pinctrl;
> >  
> >  	r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> > @@ -731,8 +732,17 @@ 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);
> > +		gpio_card_detect = of_get_named_gpio_flags(np, "cd-gpios", 0,
> > +						     &gpio_flags);
> > +		if (gpio_is_valid(gpio_card_detect) &&
> > +		    !(gpio_flags & OF_GPIO_ACTIVE_LOW))
> > +			mmc->caps2 |= MMC_CAP2_CD_ACTIVE_HIGH;
> > +
> > +		gpio_write_protect = of_get_named_gpio_flags(np, "wp-gpios", 0,
> > +						       &gpio_flags);
> > +		if (gpio_is_valid(gpio_write_protect) &&
> > +		    !(gpio_flags & OF_GPIO_ACTIVE_LOW))
> > +			mmc->caps2 |= MMC_CAP2_RO_ACTIVE_HIGH;
> >  	} else {
> >  		const struct mvsdio_platform_data *mvsd_data;
> >  		mvsd_data = pdev->dev.platform_data;
> 
> The core function mmc_of_parse() (new in 3.9) will do all of this DT
> parsing for you, and will also take care of the driver's later calls
> to mmc_gpio_request_{cd,wp}().  Could you try using that function
> instead, please?

Hi Chris, Simon

I have a vague recollection that Thomas Petazzoni already did this
conversion. Take a look in linux-next, or maybe Jason can point you at
a branch.

  Andrew

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

* [PATCH 1/3] mmc: mvsdio: Support inverted CD and WP GPIO lines
@ 2013-04-22 20:37       ` Andrew Lunn
  0 siblings, 0 replies; 28+ messages in thread
From: Andrew Lunn @ 2013-04-22 20:37 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Apr 22, 2013 at 04:03:15PM -0400, Chris Ball wrote:
> Hi Simon,
> 
> On Mon, Apr 22 2013, Simon Baatz wrote:
> > diff --git a/drivers/mmc/host/mvsdio.c b/drivers/mmc/host/mvsdio.c
> > index 145cdaf..d444efd 100644
> > --- a/drivers/mmc/host/mvsdio.c
> > +++ b/drivers/mmc/host/mvsdio.c
> > @@ -691,6 +691,7 @@ static int __init mvsd_probe(struct platform_device *pdev)
> >  	struct resource *r;
> >  	int ret, irq;
> >  	int gpio_card_detect, gpio_write_protect;
> > +	enum of_gpio_flags gpio_flags;
> >  	struct pinctrl *pinctrl;
> >  
> >  	r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> > @@ -731,8 +732,17 @@ 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);
> > +		gpio_card_detect = of_get_named_gpio_flags(np, "cd-gpios", 0,
> > +						     &gpio_flags);
> > +		if (gpio_is_valid(gpio_card_detect) &&
> > +		    !(gpio_flags & OF_GPIO_ACTIVE_LOW))
> > +			mmc->caps2 |= MMC_CAP2_CD_ACTIVE_HIGH;
> > +
> > +		gpio_write_protect = of_get_named_gpio_flags(np, "wp-gpios", 0,
> > +						       &gpio_flags);
> > +		if (gpio_is_valid(gpio_write_protect) &&
> > +		    !(gpio_flags & OF_GPIO_ACTIVE_LOW))
> > +			mmc->caps2 |= MMC_CAP2_RO_ACTIVE_HIGH;
> >  	} else {
> >  		const struct mvsdio_platform_data *mvsd_data;
> >  		mvsd_data = pdev->dev.platform_data;
> 
> The core function mmc_of_parse() (new in 3.9) will do all of this DT
> parsing for you, and will also take care of the driver's later calls
> to mmc_gpio_request_{cd,wp}().  Could you try using that function
> instead, please?

Hi Chris, Simon

I have a vague recollection that Thomas Petazzoni already did this
conversion. Take a look in linux-next, or maybe Jason can point you at
a branch.

  Andrew

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

* Re: [PATCH 1/3] mmc: mvsdio: Support inverted CD and WP GPIO lines
  2013-04-22 20:37       ` Andrew Lunn
@ 2013-04-22 21:09         ` Jason Cooper
  -1 siblings, 0 replies; 28+ messages in thread
From: Jason Cooper @ 2013-04-22 21:09 UTC (permalink / raw)
  To: Andrew Lunn
  Cc: Chris Ball, gmbnomis, linux-arm-kernel, linux-mmc,
	thomas.petazzoni, Guennadi Liakhovetski

On Mon, Apr 22, 2013 at 10:37:23PM +0200, Andrew Lunn wrote:
> On Mon, Apr 22, 2013 at 04:03:15PM -0400, Chris Ball wrote:
> > Hi Simon,
> > 
> > On Mon, Apr 22 2013, Simon Baatz wrote:
> > > diff --git a/drivers/mmc/host/mvsdio.c b/drivers/mmc/host/mvsdio.c
> > > index 145cdaf..d444efd 100644
> > > --- a/drivers/mmc/host/mvsdio.c
> > > +++ b/drivers/mmc/host/mvsdio.c
> > > @@ -691,6 +691,7 @@ static int __init mvsd_probe(struct platform_device *pdev)
> > >  	struct resource *r;
> > >  	int ret, irq;
> > >  	int gpio_card_detect, gpio_write_protect;
> > > +	enum of_gpio_flags gpio_flags;
> > >  	struct pinctrl *pinctrl;
> > >  
> > >  	r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> > > @@ -731,8 +732,17 @@ 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);
> > > +		gpio_card_detect = of_get_named_gpio_flags(np, "cd-gpios", 0,
> > > +						     &gpio_flags);
> > > +		if (gpio_is_valid(gpio_card_detect) &&
> > > +		    !(gpio_flags & OF_GPIO_ACTIVE_LOW))
> > > +			mmc->caps2 |= MMC_CAP2_CD_ACTIVE_HIGH;
> > > +
> > > +		gpio_write_protect = of_get_named_gpio_flags(np, "wp-gpios", 0,
> > > +						       &gpio_flags);
> > > +		if (gpio_is_valid(gpio_write_protect) &&
> > > +		    !(gpio_flags & OF_GPIO_ACTIVE_LOW))
> > > +			mmc->caps2 |= MMC_CAP2_RO_ACTIVE_HIGH;
> > >  	} else {
> > >  		const struct mvsdio_platform_data *mvsd_data;
> > >  		mvsd_data = pdev->dev.platform_data;
> > 
> > The core function mmc_of_parse() (new in 3.9) will do all of this DT
> > parsing for you, and will also take care of the driver's later calls
> > to mmc_gpio_request_{cd,wp}().  Could you try using that function
> > instead, please?
> 
> Hi Chris, Simon
> 
> I have a vague recollection that Thomas Petazzoni already did this
> conversion. Take a look in linux-next, or maybe Jason can point you at
> a branch.

Andrew,

Thomas did a board conversion here (slated for v3.11 in /pcie branch):

  cd2bde5 arm: kirkwood: convert db-88f6281 to the Device Tree

And Sebastian did some mvsdio WP and CD pin work here:

  0d0644eARM: Kirkwood: fix unused mvsdio gpio pins

Nothing else really jumps out though.  Where either of these what you
were thinking of?

thx,

Jason.

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

* [PATCH 1/3] mmc: mvsdio: Support inverted CD and WP GPIO lines
@ 2013-04-22 21:09         ` Jason Cooper
  0 siblings, 0 replies; 28+ messages in thread
From: Jason Cooper @ 2013-04-22 21:09 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Apr 22, 2013 at 10:37:23PM +0200, Andrew Lunn wrote:
> On Mon, Apr 22, 2013 at 04:03:15PM -0400, Chris Ball wrote:
> > Hi Simon,
> > 
> > On Mon, Apr 22 2013, Simon Baatz wrote:
> > > diff --git a/drivers/mmc/host/mvsdio.c b/drivers/mmc/host/mvsdio.c
> > > index 145cdaf..d444efd 100644
> > > --- a/drivers/mmc/host/mvsdio.c
> > > +++ b/drivers/mmc/host/mvsdio.c
> > > @@ -691,6 +691,7 @@ static int __init mvsd_probe(struct platform_device *pdev)
> > >  	struct resource *r;
> > >  	int ret, irq;
> > >  	int gpio_card_detect, gpio_write_protect;
> > > +	enum of_gpio_flags gpio_flags;
> > >  	struct pinctrl *pinctrl;
> > >  
> > >  	r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> > > @@ -731,8 +732,17 @@ 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);
> > > +		gpio_card_detect = of_get_named_gpio_flags(np, "cd-gpios", 0,
> > > +						     &gpio_flags);
> > > +		if (gpio_is_valid(gpio_card_detect) &&
> > > +		    !(gpio_flags & OF_GPIO_ACTIVE_LOW))
> > > +			mmc->caps2 |= MMC_CAP2_CD_ACTIVE_HIGH;
> > > +
> > > +		gpio_write_protect = of_get_named_gpio_flags(np, "wp-gpios", 0,
> > > +						       &gpio_flags);
> > > +		if (gpio_is_valid(gpio_write_protect) &&
> > > +		    !(gpio_flags & OF_GPIO_ACTIVE_LOW))
> > > +			mmc->caps2 |= MMC_CAP2_RO_ACTIVE_HIGH;
> > >  	} else {
> > >  		const struct mvsdio_platform_data *mvsd_data;
> > >  		mvsd_data = pdev->dev.platform_data;
> > 
> > The core function mmc_of_parse() (new in 3.9) will do all of this DT
> > parsing for you, and will also take care of the driver's later calls
> > to mmc_gpio_request_{cd,wp}().  Could you try using that function
> > instead, please?
> 
> Hi Chris, Simon
> 
> I have a vague recollection that Thomas Petazzoni already did this
> conversion. Take a look in linux-next, or maybe Jason can point you at
> a branch.

Andrew,

Thomas did a board conversion here (slated for v3.11 in /pcie branch):

  cd2bde5 arm: kirkwood: convert db-88f6281 to the Device Tree

And Sebastian did some mvsdio WP and CD pin work here:

  0d0644eARM: Kirkwood: fix unused mvsdio gpio pins

Nothing else really jumps out though.  Where either of these what you
were thinking of?

thx,

Jason.

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

* Re: [PATCH 1/3] mmc: mvsdio: Support inverted CD and WP GPIO lines
  2013-04-22 21:09         ` Jason Cooper
@ 2013-04-22 21:45           ` Andrew Lunn
  -1 siblings, 0 replies; 28+ messages in thread
From: Andrew Lunn @ 2013-04-22 21:45 UTC (permalink / raw)
  To: Jason Cooper
  Cc: Andrew Lunn, Chris Ball, gmbnomis, linux-arm-kernel, linux-mmc,
	thomas.petazzoni, Guennadi Liakhovetski

> > > The core function mmc_of_parse() (new in 3.9) will do all of this DT
> > > parsing for you, and will also take care of the driver's later calls
> > > to mmc_gpio_request_{cd,wp}().  Could you try using that function
> > > instead, please?
> > 
> > Hi Chris, Simon
> > 
> > I have a vague recollection that Thomas Petazzoni already did this
> > conversion. Take a look in linux-next, or maybe Jason can point you at
> > a branch.
> 
> Andrew,
> 
> Thomas did a board conversion here (slated for v3.11 in /pcie branch):
> 
>   cd2bde5 arm: kirkwood: convert db-88f6281 to the Device Tree
> 
> And Sebastian did some mvsdio WP and CD pin work here:
> 
>   0d0644eARM: Kirkwood: fix unused mvsdio gpio pins
> 
> Nothing else really jumps out though.  Where either of these what you
> were thinking of?

http://lists.infradead.org/pipermail/linux-arm-kernel/2012-December/138514.html

and

http://lists.infradead.org/pipermail/linux-arm-kernel/2012-December/138513.html

	Andrew

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

* [PATCH 1/3] mmc: mvsdio: Support inverted CD and WP GPIO lines
@ 2013-04-22 21:45           ` Andrew Lunn
  0 siblings, 0 replies; 28+ messages in thread
From: Andrew Lunn @ 2013-04-22 21:45 UTC (permalink / raw)
  To: linux-arm-kernel

> > > The core function mmc_of_parse() (new in 3.9) will do all of this DT
> > > parsing for you, and will also take care of the driver's later calls
> > > to mmc_gpio_request_{cd,wp}().  Could you try using that function
> > > instead, please?
> > 
> > Hi Chris, Simon
> > 
> > I have a vague recollection that Thomas Petazzoni already did this
> > conversion. Take a look in linux-next, or maybe Jason can point you at
> > a branch.
> 
> Andrew,
> 
> Thomas did a board conversion here (slated for v3.11 in /pcie branch):
> 
>   cd2bde5 arm: kirkwood: convert db-88f6281 to the Device Tree
> 
> And Sebastian did some mvsdio WP and CD pin work here:
> 
>   0d0644eARM: Kirkwood: fix unused mvsdio gpio pins
> 
> Nothing else really jumps out though.  Where either of these what you
> were thinking of?

http://lists.infradead.org/pipermail/linux-arm-kernel/2012-December/138514.html

and

http://lists.infradead.org/pipermail/linux-arm-kernel/2012-December/138513.html

	Andrew

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

* Re: [PATCH 1/3] mmc: mvsdio: Support inverted CD and WP GPIO lines
  2013-04-22 21:45           ` Andrew Lunn
@ 2013-04-22 21:50             ` Chris Ball
  -1 siblings, 0 replies; 28+ messages in thread
From: Chris Ball @ 2013-04-22 21:50 UTC (permalink / raw)
  To: Andrew Lunn
  Cc: Jason Cooper, gmbnomis, linux-arm-kernel, linux-mmc,
	thomas.petazzoni, Guennadi Liakhovetski

Hi,

On Mon, Apr 22 2013, Andrew Lunn wrote:
>> Nothing else really jumps out though.  Where either of these what you
>> were thinking of?
>
> http://lists.infradead.org/pipermail/linux-arm-kernel/2012-December/138514.html
>
> and
>
> http://lists.infradead.org/pipermail/linux-arm-kernel/2012-December/138513.html

These patches move mvsdio to slot-gpio, which is a prerequisite for
using the shared mmc_of_parse(), but they don't go all the way to
using mmc_of_parse().

(Which makes sense; mmc_of_parse() was merged to mmc-next in February,
so it wasn't available for this patchset in December.)

Thanks,

- Chris.
-- 
Chris Ball   <cjb@laptop.org>   <http://printf.net/>
One Laptop Per Child

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

* [PATCH 1/3] mmc: mvsdio: Support inverted CD and WP GPIO lines
@ 2013-04-22 21:50             ` Chris Ball
  0 siblings, 0 replies; 28+ messages in thread
From: Chris Ball @ 2013-04-22 21:50 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

On Mon, Apr 22 2013, Andrew Lunn wrote:
>> Nothing else really jumps out though.  Where either of these what you
>> were thinking of?
>
> http://lists.infradead.org/pipermail/linux-arm-kernel/2012-December/138514.html
>
> and
>
> http://lists.infradead.org/pipermail/linux-arm-kernel/2012-December/138513.html

These patches move mvsdio to slot-gpio, which is a prerequisite for
using the shared mmc_of_parse(), but they don't go all the way to
using mmc_of_parse().

(Which makes sense; mmc_of_parse() was merged to mmc-next in February,
so it wasn't available for this patchset in December.)

Thanks,

- Chris.
-- 
Chris Ball   <cjb@laptop.org>   <http://printf.net/>
One Laptop Per Child

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

* Re: [PATCH 1/3] mmc: mvsdio: Support inverted CD and WP GPIO lines
  2013-04-22 21:45           ` Andrew Lunn
@ 2013-04-22 22:54             ` Jason Cooper
  -1 siblings, 0 replies; 28+ messages in thread
From: Jason Cooper @ 2013-04-22 22:54 UTC (permalink / raw)
  To: Andrew Lunn
  Cc: Chris Ball, gmbnomis, linux-arm-kernel, linux-mmc,
	thomas.petazzoni, Guennadi Liakhovetski

On Mon, Apr 22, 2013 at 11:45:43PM +0200, Andrew Lunn wrote:
> > > > The core function mmc_of_parse() (new in 3.9) will do all of this DT
> > > > parsing for you, and will also take care of the driver's later calls
> > > > to mmc_gpio_request_{cd,wp}().  Could you try using that function
> > > > instead, please?
> > > 
> > > Hi Chris, Simon
> > > 
> > > I have a vague recollection that Thomas Petazzoni already did this
> > > conversion. Take a look in linux-next, or maybe Jason can point you at
> > > a branch.
> > 
> > Andrew,
> > 
> > Thomas did a board conversion here (slated for v3.11 in /pcie branch):
> > 
> >   cd2bde5 arm: kirkwood: convert db-88f6281 to the Device Tree
> > 
> > And Sebastian did some mvsdio WP and CD pin work here:
> > 
> >   0d0644eARM: Kirkwood: fix unused mvsdio gpio pins
> > 
> > Nothing else really jumps out though.  Where either of these what you
> > were thinking of?
> 
> http://lists.infradead.org/pipermail/linux-arm-kernel/2012-December/138514.html
> 
> and
> 
> http://lists.infradead.org/pipermail/linux-arm-kernel/2012-December/138513.html

Ahh, they were with the original submission for mvsdio:

  07728b7 mmc: mvsdio: use slot-gpio for card detect gpio
  3724482 mmc: mvsdio: use slot-gpio infrastructure for write protect gpio

I thought you were referring to a newer patch.

thx,

Jason.

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

* [PATCH 1/3] mmc: mvsdio: Support inverted CD and WP GPIO lines
@ 2013-04-22 22:54             ` Jason Cooper
  0 siblings, 0 replies; 28+ messages in thread
From: Jason Cooper @ 2013-04-22 22:54 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Apr 22, 2013 at 11:45:43PM +0200, Andrew Lunn wrote:
> > > > The core function mmc_of_parse() (new in 3.9) will do all of this DT
> > > > parsing for you, and will also take care of the driver's later calls
> > > > to mmc_gpio_request_{cd,wp}().  Could you try using that function
> > > > instead, please?
> > > 
> > > Hi Chris, Simon
> > > 
> > > I have a vague recollection that Thomas Petazzoni already did this
> > > conversion. Take a look in linux-next, or maybe Jason can point you at
> > > a branch.
> > 
> > Andrew,
> > 
> > Thomas did a board conversion here (slated for v3.11 in /pcie branch):
> > 
> >   cd2bde5 arm: kirkwood: convert db-88f6281 to the Device Tree
> > 
> > And Sebastian did some mvsdio WP and CD pin work here:
> > 
> >   0d0644eARM: Kirkwood: fix unused mvsdio gpio pins
> > 
> > Nothing else really jumps out though.  Where either of these what you
> > were thinking of?
> 
> http://lists.infradead.org/pipermail/linux-arm-kernel/2012-December/138514.html
> 
> and
> 
> http://lists.infradead.org/pipermail/linux-arm-kernel/2012-December/138513.html

Ahh, they were with the original submission for mvsdio:

  07728b7 mmc: mvsdio: use slot-gpio for card detect gpio
  3724482 mmc: mvsdio: use slot-gpio infrastructure for write protect gpio

I thought you were referring to a newer patch.

thx,

Jason.

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

* Re: [PATCH 1/3] mmc: mvsdio: Support inverted CD and WP GPIO lines
  2013-04-22 21:50             ` Chris Ball
@ 2013-04-23  1:48               ` Thomas Petazzoni
  -1 siblings, 0 replies; 28+ messages in thread
From: Thomas Petazzoni @ 2013-04-23  1:48 UTC (permalink / raw)
  To: Chris Ball
  Cc: Andrew Lunn, Jason Cooper, gmbnomis, linux-arm-kernel, linux-mmc,
	Guennadi Liakhovetski

Dear Chris Ball,

On Mon, 22 Apr 2013 17:50:17 -0400, Chris Ball wrote:

> On Mon, Apr 22 2013, Andrew Lunn wrote:
> >> Nothing else really jumps out though.  Where either of these what you
> >> were thinking of?
> >
> > http://lists.infradead.org/pipermail/linux-arm-kernel/2012-December/138514.html
> >
> > and
> >
> > http://lists.infradead.org/pipermail/linux-arm-kernel/2012-December/138513.html
> 
> These patches move mvsdio to slot-gpio, which is a prerequisite for
> using the shared mmc_of_parse(), but they don't go all the way to
> using mmc_of_parse().
> 
> (Which makes sense; mmc_of_parse() was merged to mmc-next in February,
> so it wasn't available for this patchset in December.)

Correct. I used the slot-gpio infrastructure in mvsdio, but I wasn't
aware of the new mmc_of_parse() thing, and I don't have any patch that
converts mvsdio to use it for the moment.

Best regards,

Thomas
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

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

* [PATCH 1/3] mmc: mvsdio: Support inverted CD and WP GPIO lines
@ 2013-04-23  1:48               ` Thomas Petazzoni
  0 siblings, 0 replies; 28+ messages in thread
From: Thomas Petazzoni @ 2013-04-23  1:48 UTC (permalink / raw)
  To: linux-arm-kernel

Dear Chris Ball,

On Mon, 22 Apr 2013 17:50:17 -0400, Chris Ball wrote:

> On Mon, Apr 22 2013, Andrew Lunn wrote:
> >> Nothing else really jumps out though.  Where either of these what you
> >> were thinking of?
> >
> > http://lists.infradead.org/pipermail/linux-arm-kernel/2012-December/138514.html
> >
> > and
> >
> > http://lists.infradead.org/pipermail/linux-arm-kernel/2012-December/138513.html
> 
> These patches move mvsdio to slot-gpio, which is a prerequisite for
> using the shared mmc_of_parse(), but they don't go all the way to
> using mmc_of_parse().
> 
> (Which makes sense; mmc_of_parse() was merged to mmc-next in February,
> so it wasn't available for this patchset in December.)

Correct. I used the slot-gpio infrastructure in mvsdio, but I wasn't
aware of the new mmc_of_parse() thing, and I don't have any patch that
converts mvsdio to use it for the moment.

Best regards,

Thomas
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

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

* Re: [PATCH 0/3] ARM: Kirkwood: Add DT support for (eSATA) Sheevaplug
  2013-04-22 19:54 ` Simon Baatz
@ 2013-04-23  5:00   ` Andrew Lunn
  -1 siblings, 0 replies; 28+ messages in thread
From: Andrew Lunn @ 2013-04-23  5:00 UTC (permalink / raw)
  To: Simon Baatz
  Cc: linux-arm-kernel, linux-mmc, jason, andrew, cjb, thomas.petazzoni

On Mon, Apr 22, 2013 at 09:54:57PM +0200, Simon Baatz wrote:
> These patches add DT support for the Sheevaplugs by Globalscale
> Technologies.  There exists two versions, one with an eSATA port and
> one without.
> 
> Surprisingly, the conversion was not straight forward. In the eSATA
> version (board revision 1.3), the CD and WP pins are connected to GPIO
> lines, but I could not get this to work.  Apparently, I am not the only
> one ([1]).  I found that the pins are reversed on my hardware and use
> different active low/active high settings.
> 
> Thus, the first patch adds support for the GPIO active low/high flag in
> DT to the mvsdio driver.
> 
> With that, everything except the Gigabit Ethernet can be described in
> the DTS.  I have split the DTS and the board support files into two
> patches.  This way, we can drop the last patch once we can describe
> everything in the DTS or we can squash them together if we don't want
> to wait.
> 
> 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 sdio can't hurt either.  I hope that there aren't
> board revisions with different CD/WP pins out there.

Hi Simon

Patches 2 and 3 look good to me. If you submit a new version with the
SDIO issue resolved i can give you a Acked-by:

     Thanks
	Andrew

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

* [PATCH 0/3] ARM: Kirkwood: Add DT support for (eSATA) Sheevaplug
@ 2013-04-23  5:00   ` Andrew Lunn
  0 siblings, 0 replies; 28+ messages in thread
From: Andrew Lunn @ 2013-04-23  5:00 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Apr 22, 2013 at 09:54:57PM +0200, Simon Baatz wrote:
> These patches add DT support for the Sheevaplugs by Globalscale
> Technologies.  There exists two versions, one with an eSATA port and
> one without.
> 
> Surprisingly, the conversion was not straight forward. In the eSATA
> version (board revision 1.3), the CD and WP pins are connected to GPIO
> lines, but I could not get this to work.  Apparently, I am not the only
> one ([1]).  I found that the pins are reversed on my hardware and use
> different active low/active high settings.
> 
> Thus, the first patch adds support for the GPIO active low/high flag in
> DT to the mvsdio driver.
> 
> With that, everything except the Gigabit Ethernet can be described in
> the DTS.  I have split the DTS and the board support files into two
> patches.  This way, we can drop the last patch once we can describe
> everything in the DTS or we can squash them together if we don't want
> to wait.
> 
> 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 sdio can't hurt either.  I hope that there aren't
> board revisions with different CD/WP pins out there.

Hi Simon

Patches 2 and 3 look good to me. If you submit a new version with the
SDIO issue resolved i can give you a Acked-by:

     Thanks
	Andrew

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

* Re: [PATCH 1/3] mmc: mvsdio: Support inverted CD and WP GPIO lines
  2013-04-22 21:50             ` Chris Ball
@ 2013-04-23 21:22               ` Simon Baatz
  -1 siblings, 0 replies; 28+ messages in thread
From: Simon Baatz @ 2013-04-23 21:22 UTC (permalink / raw)
  To: Chris Ball, Guennadi Liakhovetski
  Cc: Andrew Lunn, Jason Cooper, linux-arm-kernel, linux-mmc, thomas.petazzoni

Hi Chris, Guennadi,

On Mon, Apr 22, 2013 at 05:50:17PM -0400, Chris Ball wrote:
> Hi,
> 
> On Mon, Apr 22 2013, Andrew Lunn wrote:
> >> Nothing else really jumps out though.  Where either of these what you
> >> were thinking of?
> >
> > http://lists.infradead.org/pipermail/linux-arm-kernel/2012-December/138514.html
> >
> > and
> >
> > http://lists.infradead.org/pipermail/linux-arm-kernel/2012-December/138513.html
> 
> These patches move mvsdio to slot-gpio, which is a prerequisite for
> using the shared mmc_of_parse(), but they don't go all the way to
> using mmc_of_parse().

That's nice functionality, I was not aware of that. I will convert this
to mmc_of_parse() once I find some time.

One question already: Why does mmc_of_parse() not return errors to
the caller?  If, for example, a GPIO line was given for CD in the DT,
but it could not be obtained, shouldn't the caller at least have the
possibility to handle this as an error?  (mvsdio currently
aborts the probe if it can't get the GPIO line).

- Simon

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

* [PATCH 1/3] mmc: mvsdio: Support inverted CD and WP GPIO lines
@ 2013-04-23 21:22               ` Simon Baatz
  0 siblings, 0 replies; 28+ messages in thread
From: Simon Baatz @ 2013-04-23 21:22 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Chris, Guennadi,

On Mon, Apr 22, 2013 at 05:50:17PM -0400, Chris Ball wrote:
> Hi,
> 
> On Mon, Apr 22 2013, Andrew Lunn wrote:
> >> Nothing else really jumps out though.  Where either of these what you
> >> were thinking of?
> >
> > http://lists.infradead.org/pipermail/linux-arm-kernel/2012-December/138514.html
> >
> > and
> >
> > http://lists.infradead.org/pipermail/linux-arm-kernel/2012-December/138513.html
> 
> These patches move mvsdio to slot-gpio, which is a prerequisite for
> using the shared mmc_of_parse(), but they don't go all the way to
> using mmc_of_parse().

That's nice functionality, I was not aware of that. I will convert this
to mmc_of_parse() once I find some time.

One question already: Why does mmc_of_parse() not return errors to
the caller?  If, for example, a GPIO line was given for CD in the DT,
but it could not be obtained, shouldn't the caller at least have the
possibility to handle this as an error?  (mvsdio currently
aborts the probe if it can't get the GPIO line).

- Simon

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

* Re: [PATCH 0/3] ARM: Kirkwood: Add DT support for (eSATA) Sheevaplug
  2013-04-22 19:54 ` Simon Baatz
@ 2013-05-13 17:30   ` Jason Cooper
  -1 siblings, 0 replies; 28+ messages in thread
From: Jason Cooper @ 2013-05-13 17:30 UTC (permalink / raw)
  To: Simon Baatz; +Cc: linux-arm-kernel, linux-mmc, thomas.petazzoni, andrew, cjb

On Mon, Apr 22, 2013 at 09:54:57PM +0200, Simon Baatz wrote:
> These patches add DT support for the Sheevaplugs by Globalscale
> Technologies.  There exists two versions, one with an eSATA port and
> one without.
> 
> Surprisingly, the conversion was not straight forward. In the eSATA
> version (board revision 1.3), the CD and WP pins are connected to GPIO
> lines, but I could not get this to work.  Apparently, I am not the only
> one ([1]).  I found that the pins are reversed on my hardware and use
> different active low/active high settings.
> 
> Thus, the first patch adds support for the GPIO active low/high flag in
> DT to the mvsdio driver.
> 
> With that, everything except the Gigabit Ethernet can be described in
> the DTS.  I have split the DTS and the board support files into two
> patches.  This way, we can drop the last patch once we can describe
> everything in the DTS or we can squash them together if we don't want
> to wait.
> 
> 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 sdio can't hurt either.  I hope that there aren't
> board revisions with different CD/WP pins out there.
> 
> [1] http://lists.infradead.org/pipermail/linux-arm-kernel/2011-August/062567.html
> 
> Simon Baatz (3):
>   mmc: mvsdio: Support inverted CD and WP GPIO lines
>   ARM: Kirkwood: Add dts files for Sheevaplug and eSATA Sheevaplug
>   ARM: Kirkwood: Add DT support for Sheevaplug and Sheevaplug eSATA

Simon,

Were you able to find any time to work on this?

thx,

Jason.

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

* [PATCH 0/3] ARM: Kirkwood: Add DT support for (eSATA) Sheevaplug
@ 2013-05-13 17:30   ` Jason Cooper
  0 siblings, 0 replies; 28+ messages in thread
From: Jason Cooper @ 2013-05-13 17:30 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Apr 22, 2013 at 09:54:57PM +0200, Simon Baatz wrote:
> These patches add DT support for the Sheevaplugs by Globalscale
> Technologies.  There exists two versions, one with an eSATA port and
> one without.
> 
> Surprisingly, the conversion was not straight forward. In the eSATA
> version (board revision 1.3), the CD and WP pins are connected to GPIO
> lines, but I could not get this to work.  Apparently, I am not the only
> one ([1]).  I found that the pins are reversed on my hardware and use
> different active low/active high settings.
> 
> Thus, the first patch adds support for the GPIO active low/high flag in
> DT to the mvsdio driver.
> 
> With that, everything except the Gigabit Ethernet can be described in
> the DTS.  I have split the DTS and the board support files into two
> patches.  This way, we can drop the last patch once we can describe
> everything in the DTS or we can squash them together if we don't want
> to wait.
> 
> 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 sdio can't hurt either.  I hope that there aren't
> board revisions with different CD/WP pins out there.
> 
> [1] http://lists.infradead.org/pipermail/linux-arm-kernel/2011-August/062567.html
> 
> Simon Baatz (3):
>   mmc: mvsdio: Support inverted CD and WP GPIO lines
>   ARM: Kirkwood: Add dts files for Sheevaplug and eSATA Sheevaplug
>   ARM: Kirkwood: Add DT support for Sheevaplug and Sheevaplug eSATA

Simon,

Were you able to find any time to work on this?

thx,

Jason.

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

end of thread, other threads:[~2013-05-13 17:30 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-04-22 19:54 [PATCH 0/3] ARM: Kirkwood: Add DT support for (eSATA) Sheevaplug Simon Baatz
2013-04-22 19:54 ` Simon Baatz
2013-04-22 19:54 ` [PATCH 1/3] mmc: mvsdio: Support inverted CD and WP GPIO lines Simon Baatz
2013-04-22 19:54   ` Simon Baatz
2013-04-22 20:03   ` Chris Ball
2013-04-22 20:03     ` Chris Ball
2013-04-22 20:37     ` Andrew Lunn
2013-04-22 20:37       ` Andrew Lunn
2013-04-22 21:09       ` Jason Cooper
2013-04-22 21:09         ` Jason Cooper
2013-04-22 21:45         ` Andrew Lunn
2013-04-22 21:45           ` Andrew Lunn
2013-04-22 21:50           ` Chris Ball
2013-04-22 21:50             ` Chris Ball
2013-04-23  1:48             ` Thomas Petazzoni
2013-04-23  1:48               ` Thomas Petazzoni
2013-04-23 21:22             ` Simon Baatz
2013-04-23 21:22               ` Simon Baatz
2013-04-22 22:54           ` Jason Cooper
2013-04-22 22:54             ` Jason Cooper
2013-04-22 19:54 ` [PATCH 2/3] ARM: Kirkwood: Add dts files for Sheevaplug and eSATA Sheevaplug Simon Baatz
2013-04-22 19:54   ` Simon Baatz
2013-04-22 19:55 ` [PATCH 3/3] ARM: Kirkwood: Add DT support for Sheevaplug and Sheevaplug eSATA Simon Baatz
2013-04-22 19:55   ` Simon Baatz
2013-04-23  5:00 ` [PATCH 0/3] ARM: Kirkwood: Add DT support for (eSATA) Sheevaplug Andrew Lunn
2013-04-23  5:00   ` Andrew Lunn
2013-05-13 17:30 ` Jason Cooper
2013-05-13 17:30   ` Jason Cooper

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.