diff mbox

[v2,13/20] arm: kirkwood: mplcec4: use Device Tree to probe SDIO

Message ID 1356101359-6054-14-git-send-email-thomas.petazzoni@free-electrons.com (mailing list archive)
State New, archived
Headers show

Commit Message

Thomas Petazzoni Dec. 21, 2012, 2:49 p.m. UTC
Now that the mvsdio driver has a Device Tree binding, and the SDIO
controller is declared in kirkwood.dtsi, migrate the mplcec4 board to
use the Device Tree to probe the SDIO controller and to mux the pins
of the SDIO interface correctly.

This patch has not been tested, it remains to be tested by a person
having access to the hardware.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Stefan Peter <s.peter@mpl.ch>
---
Changes since v1:
 * Remove the useless header inclusion from board-mplcec4.c, now
   that the SDIO interface is probed from the Device Tree.
 * Reference the pmx_sdio muxing option from the DT node describing
   the SDIO interface, in order to get proper muxing of this
   interface.
---
 arch/arm/boot/dts/kirkwood-mplcec4.dts |   11 +++++++++--
 arch/arm/mach-kirkwood/board-mplcec4.c |    7 -------
 2 files changed, 9 insertions(+), 9 deletions(-)

Comments

Stefan Peter Dec. 27, 2012, 12:32 p.m. UTC | #1
on 21.12.2012 15:49, Thomas Petazzoni wrote:
> Now that the mvsdio driver has a Device Tree binding, and the SDIO
> controller is declared in kirkwood.dtsi, migrate the mplcec4 board to
> use the Device Tree to probe the SDIO controller and to mux the pins
> of the SDIO interface correctly.
> 
> This patch has not been tested, it remains to be tested by a person
> having access to the hardware.
> 
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> Cc: Stefan Peter <s.peter@mpl.ch>
> ---
> Changes since v1:
>  * Remove the useless header inclusion from board-mplcec4.c, now
>    that the SDIO interface is probed from the Device Tree.
>  * Reference the pmx_sdio muxing option from the DT node describing
>    the SDIO interface, in order to get proper muxing of this
>    interface.
> ---
>  arch/arm/boot/dts/kirkwood-mplcec4.dts |   11 +++++++++--
>  arch/arm/mach-kirkwood/board-mplcec4.c |    7 -------
>  2 files changed, 9 insertions(+), 9 deletions(-)
> 
> diff --git a/arch/arm/boot/dts/kirkwood-mplcec4.dts b/arch/arm/boot/dts/kirkwood-mplcec4.dts
> index 262c654..662dfd8 100644
> --- a/arch/arm/boot/dts/kirkwood-mplcec4.dts
> +++ b/arch/arm/boot/dts/kirkwood-mplcec4.dts
> @@ -20,12 +20,11 @@
>  		pinctrl: pinctrl@10000 {
>  
>  			pinctrl-0 = < &pmx_nand &pmx_uart0
> -				      &pmx_led_health &pmx_sdio
> +				      &pmx_led_health
>  				      &pmx_sata0 &pmx_sata1
>  				      &pmx_led_user1o
>  				      &pmx_led_user1g &pmx_led_user0o
>  				      &pmx_led_user0g &pmx_led_misc
> -				      &pmx_sdio_cd
>  				    >;
>  			pinctrl-names = "default";
>  
> @@ -133,6 +132,14 @@
>  			status = "okay";
>  
>  		};
> +
> +		mvsdio@90000 {
> +			pinctrl-0 = <&pmx_sdio &pmx_sdio_cd>;
> +			pinctrl-names = "default";
> +			status = "okay";
> +			cd-gpios = <&gpio1 15 0>;
> +			/* No WP GPIO */
> +		};
>  	};
>  
>  	gpio-leds {
> diff --git a/arch/arm/mach-kirkwood/board-mplcec4.c b/arch/arm/mach-kirkwood/board-mplcec4.c
> index 56bfe5a..73a0332 100644
> --- a/arch/arm/mach-kirkwood/board-mplcec4.c
> +++ b/arch/arm/mach-kirkwood/board-mplcec4.c
> @@ -12,7 +12,6 @@
>  #include <linux/kernel.h>
>  #include <linux/init.h>
>  #include <linux/mv643xx_eth.h>
> -#include <linux/platform_data/mmc-mvsdio.h>
>  #include "common.h"
>  #include "mpp.h"
>  
> @@ -24,11 +23,6 @@ static struct mv643xx_eth_platform_data mplcec4_ge01_data = {
>  	.phy_addr	= MV643XX_ETH_PHY_ADDR(2),
>  };
>  
> -static struct mvsdio_platform_data mplcec4_mvsdio_data = {
> -	.gpio_card_detect = 47,	/* MPP47 used as SD card detect */
> -};
> -
> -
>  void __init mplcec4_init(void)
>  {
>  	/*
> @@ -36,7 +30,6 @@ void __init mplcec4_init(void)
>  	 */
>  	kirkwood_ge00_init(&mplcec4_ge00_data);
>  	kirkwood_ge01_init(&mplcec4_ge01_data);
> -	kirkwood_sdio_init(&mplcec4_mvsdio_data);
>  	kirkwood_pcie_init(KW_PCIE0);
>  }
>  
> 

After applying "Fixes for 3.8-rc1" and"ARM: Kirkwood: Fix missing clk
for USB device" from Andrew to 3.8-rc1, I was able to test these patches
on the MPL CEC4 under 3.8-rc1. The mvsdio was fully functional.


Regards

Stefan Peter
Thomas Petazzoni Dec. 27, 2012, 12:43 p.m. UTC | #2
Dear Stefan Peter,

On Thu, 27 Dec 2012 13:32:00 +0100, Stefan Peter wrote:

> After applying "Fixes for 3.8-rc1" and"ARM: Kirkwood: Fix missing clk
> for USB device" from Andrew to 3.8-rc1, I was able to test these patches
> on the MPL CEC4 under 3.8-rc1. The mvsdio was fully functional.

Excellent, thanks for the test!

Thomas
Jason Cooper Dec. 27, 2012, 4:45 p.m. UTC | #3
On Thu, Dec 27, 2012 at 01:32:00PM +0100, Stefan Peter wrote:
> on 21.12.2012 15:49, Thomas Petazzoni wrote:
> > Now that the mvsdio driver has a Device Tree binding, and the SDIO
> > controller is declared in kirkwood.dtsi, migrate the mplcec4 board to
> > use the Device Tree to probe the SDIO controller and to mux the pins
> > of the SDIO interface correctly.
> > 
> > This patch has not been tested, it remains to be tested by a person
> > having access to the hardware.
> > 
> > Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> > Cc: Stefan Peter <s.peter@mpl.ch>
...
> After applying "Fixes for 3.8-rc1" and"ARM: Kirkwood: Fix missing clk
> for USB device" from Andrew to 3.8-rc1, I was able to test these patches
> on the MPL CEC4 under 3.8-rc1. The mvsdio was fully functional.

If you are comfortable saying so, please add a "Tested-by: ..." We don't
like to assume ;-)

thx,

Jason.
Stefan Peter Dec. 27, 2012, 10:22 p.m. UTC | #4
Hi Jason

On 27.12.2012 17:45, Jason Cooper wrote:
> On Thu, Dec 27, 2012 at 01:32:00PM +0100, Stefan Peter wrote:
>> on 21.12.2012 15:49, Thomas Petazzoni wrote:
>>> Now that the mvsdio driver has a Device Tree binding, and the SDIO
>>> controller is declared in kirkwood.dtsi, migrate the mplcec4 board to
>>> use the Device Tree to probe the SDIO controller and to mux the pins
>>> of the SDIO interface correctly.
>>>
>>> This patch has not been tested, it remains to be tested by a person
>>> having access to the hardware.
>>>
>>> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
>>> Cc: Stefan Peter <s.peter@mpl.ch>
> ...
>> After applying "Fixes for 3.8-rc1" and"ARM: Kirkwood: Fix missing clk
>> for USB device" from Andrew to 3.8-rc1, I was able to test these patches
>> on the MPL CEC4 under 3.8-rc1. The mvsdio was fully functional.
> 
> If you are comfortable saying so, please add a "Tested-by: ..." We don't
> like to assume ;-)
> 

I will do so as soon as I don't need two additional patches to get it
working. However, if you are interested in getting a Tested-by for the
"Fixes for 3.8-rc1" and"ARM: Kirkwood: Fix missing clk for USB device"
from Andrew, let my know.

Regards

Stefan Peter
Jason Cooper Dec. 27, 2012, 10:29 p.m. UTC | #5
On Thu, Dec 27, 2012 at 11:22:47PM +0100, Stefan Peter wrote:
> Hi Jason
> 
> On 27.12.2012 17:45, Jason Cooper wrote:
> > On Thu, Dec 27, 2012 at 01:32:00PM +0100, Stefan Peter wrote:
> >> on 21.12.2012 15:49, Thomas Petazzoni wrote:
> >>> Now that the mvsdio driver has a Device Tree binding, and the SDIO
> >>> controller is declared in kirkwood.dtsi, migrate the mplcec4 board to
> >>> use the Device Tree to probe the SDIO controller and to mux the pins
> >>> of the SDIO interface correctly.
> >>>
> >>> This patch has not been tested, it remains to be tested by a person
> >>> having access to the hardware.
> >>>
> >>> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> >>> Cc: Stefan Peter <s.peter@mpl.ch>
> > ...
> >> After applying "Fixes for 3.8-rc1" and"ARM: Kirkwood: Fix missing clk
> >> for USB device" from Andrew to 3.8-rc1, I was able to test these patches
> >> on the MPL CEC4 under 3.8-rc1. The mvsdio was fully functional.
> > 
> > If you are comfortable saying so, please add a "Tested-by: ..." We don't
> > like to assume ;-)
> > 
> 
> I will do so as soon as I don't need two additional patches to get it
> working. However, if you are interested in getting a Tested-by for the
> "Fixes for 3.8-rc1" and"ARM: Kirkwood: Fix missing clk for USB device"
> from Andrew, let my know.

Please do.  In the future it's ok to put the qualifier about
dependencies on a Tested-by:, as I'll be making sure the patches are
merged in the correct order to satisfy those dependencies.

thx,

Jason.
Stefan Peter Dec. 27, 2012, 10:57 p.m. UTC | #6
On 21.12.2012 15:49, Thomas Petazzoni wrote:
> Now that the mvsdio driver has a Device Tree binding, and the SDIO
> controller is declared in kirkwood.dtsi, migrate the mplcec4 board to
> use the Device Tree to probe the SDIO controller and to mux the pins
> of the SDIO interface correctly.
> 
> This patch has not been tested, it remains to be tested by a person
> having access to the hardware.
> 
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> Cc: Stefan Peter <s.peter@mpl.ch>
> ---
> Changes since v1:
>  * Remove the useless header inclusion from board-mplcec4.c, now
>    that the SDIO interface is probed from the Device Tree.
>  * Reference the pmx_sdio muxing option from the DT node describing
>    the SDIO interface, in order to get proper muxing of this
>    interface.
> ---
>  arch/arm/boot/dts/kirkwood-mplcec4.dts |   11 +++++++++--
>  arch/arm/mach-kirkwood/board-mplcec4.c |    7 -------
>  2 files changed, 9 insertions(+), 9 deletions(-)
> 
> diff --git a/arch/arm/boot/dts/kirkwood-mplcec4.dts b/arch/arm/boot/dts/kirkwood-mplcec4.dts
> index 262c654..662dfd8 100644
> --- a/arch/arm/boot/dts/kirkwood-mplcec4.dts
> +++ b/arch/arm/boot/dts/kirkwood-mplcec4.dts
> @@ -20,12 +20,11 @@
>  		pinctrl: pinctrl@10000 {
>  
>  			pinctrl-0 = < &pmx_nand &pmx_uart0
> -				      &pmx_led_health &pmx_sdio
> +				      &pmx_led_health
>  				      &pmx_sata0 &pmx_sata1
>  				      &pmx_led_user1o
>  				      &pmx_led_user1g &pmx_led_user0o
>  				      &pmx_led_user0g &pmx_led_misc
> -				      &pmx_sdio_cd
>  				    >;
>  			pinctrl-names = "default";
>  
> @@ -133,6 +132,14 @@
>  			status = "okay";
>  
>  		};
> +
> +		mvsdio@90000 {
> +			pinctrl-0 = <&pmx_sdio &pmx_sdio_cd>;
> +			pinctrl-names = "default";
> +			status = "okay";
> +			cd-gpios = <&gpio1 15 0>;
> +			/* No WP GPIO */
> +		};
>  	};
>  
>  	gpio-leds {
> diff --git a/arch/arm/mach-kirkwood/board-mplcec4.c b/arch/arm/mach-kirkwood/board-mplcec4.c
> index 56bfe5a..73a0332 100644
> --- a/arch/arm/mach-kirkwood/board-mplcec4.c
> +++ b/arch/arm/mach-kirkwood/board-mplcec4.c
> @@ -12,7 +12,6 @@
>  #include <linux/kernel.h>
>  #include <linux/init.h>
>  #include <linux/mv643xx_eth.h>
> -#include <linux/platform_data/mmc-mvsdio.h>
>  #include "common.h"
>  #include "mpp.h"
>  
> @@ -24,11 +23,6 @@ static struct mv643xx_eth_platform_data mplcec4_ge01_data = {
>  	.phy_addr	= MV643XX_ETH_PHY_ADDR(2),
>  };
>  
> -static struct mvsdio_platform_data mplcec4_mvsdio_data = {
> -	.gpio_card_detect = 47,	/* MPP47 used as SD card detect */
> -};
> -
> -
>  void __init mplcec4_init(void)
>  {
>  	/*
> @@ -36,7 +30,6 @@ void __init mplcec4_init(void)
>  	 */
>  	kirkwood_ge00_init(&mplcec4_ge00_data);
>  	kirkwood_ge01_init(&mplcec4_ge01_data);
> -	kirkwood_sdio_init(&mplcec4_mvsdio_data);
>  	kirkwood_pcie_init(KW_PCIE0);
>  }
>  
> 

Requires "Fixes for 3.8-rc1" and "ARM: Kirkwood: Fix missing clk for USB
device" from Andrew Lunn. With these patches,

Tested-by: Stefan Peter <s.peter@mpl.ch>
diff mbox

Patch

diff --git a/arch/arm/boot/dts/kirkwood-mplcec4.dts b/arch/arm/boot/dts/kirkwood-mplcec4.dts
index 262c654..662dfd8 100644
--- a/arch/arm/boot/dts/kirkwood-mplcec4.dts
+++ b/arch/arm/boot/dts/kirkwood-mplcec4.dts
@@ -20,12 +20,11 @@ 
 		pinctrl: pinctrl@10000 {
 
 			pinctrl-0 = < &pmx_nand &pmx_uart0
-				      &pmx_led_health &pmx_sdio
+				      &pmx_led_health
 				      &pmx_sata0 &pmx_sata1
 				      &pmx_led_user1o
 				      &pmx_led_user1g &pmx_led_user0o
 				      &pmx_led_user0g &pmx_led_misc
-				      &pmx_sdio_cd
 				    >;
 			pinctrl-names = "default";
 
@@ -133,6 +132,14 @@ 
 			status = "okay";
 
 		};
+
+		mvsdio@90000 {
+			pinctrl-0 = <&pmx_sdio &pmx_sdio_cd>;
+			pinctrl-names = "default";
+			status = "okay";
+			cd-gpios = <&gpio1 15 0>;
+			/* No WP GPIO */
+		};
 	};
 
 	gpio-leds {
diff --git a/arch/arm/mach-kirkwood/board-mplcec4.c b/arch/arm/mach-kirkwood/board-mplcec4.c
index 56bfe5a..73a0332 100644
--- a/arch/arm/mach-kirkwood/board-mplcec4.c
+++ b/arch/arm/mach-kirkwood/board-mplcec4.c
@@ -12,7 +12,6 @@ 
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/mv643xx_eth.h>
-#include <linux/platform_data/mmc-mvsdio.h>
 #include "common.h"
 #include "mpp.h"
 
@@ -24,11 +23,6 @@  static struct mv643xx_eth_platform_data mplcec4_ge01_data = {
 	.phy_addr	= MV643XX_ETH_PHY_ADDR(2),
 };
 
-static struct mvsdio_platform_data mplcec4_mvsdio_data = {
-	.gpio_card_detect = 47,	/* MPP47 used as SD card detect */
-};
-
-
 void __init mplcec4_init(void)
 {
 	/*
@@ -36,7 +30,6 @@  void __init mplcec4_init(void)
 	 */
 	kirkwood_ge00_init(&mplcec4_ge00_data);
 	kirkwood_ge01_init(&mplcec4_ge01_data);
-	kirkwood_sdio_init(&mplcec4_mvsdio_data);
 	kirkwood_pcie_init(KW_PCIE0);
 }