All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] spi-orion: add device tree binding
@ 2012-06-03 20:17 ` Michael Walle
  0 siblings, 0 replies; 12+ messages in thread
From: Michael Walle @ 2012-06-03 20:17 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Grant Likely, devicetree-discuss, Michael Walle, Jason Cooper

Signed-off-by: Michael Walle <michael@walle.cc>
---
 .../devicetree/bindings/spi/spi-orion.txt          |    5 +++++
 drivers/spi/spi-orion.c                            |   11 +++++++++++
 2 files changed, 16 insertions(+), 0 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/spi/spi-orion.txt

diff --git a/Documentation/devicetree/bindings/spi/spi-orion.txt b/Documentation/devicetree/bindings/spi/spi-orion.txt
new file mode 100644
index 0000000..e68597a
--- /dev/null
+++ b/Documentation/devicetree/bindings/spi/spi-orion.txt
@@ -0,0 +1,5 @@
+Marvell Orion SPI device
+
+Required properties:
+- compatible : should be "marvell,orion-spi".
+- reg : offset and length of the register set for the device
diff --git a/drivers/spi/spi-orion.c b/drivers/spi/spi-orion.c
index 2760450..2de58bb 100644
--- a/drivers/spi/spi-orion.c
+++ b/drivers/spi/spi-orion.c
@@ -17,6 +17,7 @@
 #include <linux/io.h>
 #include <linux/spi/spi.h>
 #include <linux/module.h>
+#include <linux/of.h>
 #include <linux/clk.h>
 #include <asm/unaligned.h>
 
@@ -506,6 +507,7 @@ static int __init orion_spi_probe(struct platform_device *pdev)
 	if (orion_spi_reset(spi) < 0)
 		goto out_rel_mem;
 
+	master->dev.of_node = pdev->dev.of_node;
 	status = spi_register_master(master);
 	if (status < 0)
 		goto out_rel_mem;
@@ -547,10 +549,19 @@ static int __exit orion_spi_remove(struct platform_device *pdev)
 
 MODULE_ALIAS("platform:" DRIVER_NAME);
 
+#ifdef CONFIG_OF
+static const struct of_device_id orion_spi_of_match_table[] __devinitdata = {
+	{ .compatible = "mrvl,orion-spi", },
+	{}
+};
+MODULE_DEVICE_TABLE(of, orion_spi_of_match_table);
+#endif
+
 static struct platform_driver orion_spi_driver = {
 	.driver = {
 		.name	= DRIVER_NAME,
 		.owner	= THIS_MODULE,
+		.of_match_table = of_match_ptr(orion_spi_of_match_table),
 	},
 	.remove		= __exit_p(orion_spi_remove),
 };
-- 
1.7.2.5

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

* [PATCH 1/3] spi-orion: add device tree binding
@ 2012-06-03 20:17 ` Michael Walle
  0 siblings, 0 replies; 12+ messages in thread
From: Michael Walle @ 2012-06-03 20:17 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Michael Walle <michael@walle.cc>
---
 .../devicetree/bindings/spi/spi-orion.txt          |    5 +++++
 drivers/spi/spi-orion.c                            |   11 +++++++++++
 2 files changed, 16 insertions(+), 0 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/spi/spi-orion.txt

diff --git a/Documentation/devicetree/bindings/spi/spi-orion.txt b/Documentation/devicetree/bindings/spi/spi-orion.txt
new file mode 100644
index 0000000..e68597a
--- /dev/null
+++ b/Documentation/devicetree/bindings/spi/spi-orion.txt
@@ -0,0 +1,5 @@
+Marvell Orion SPI device
+
+Required properties:
+- compatible : should be "marvell,orion-spi".
+- reg : offset and length of the register set for the device
diff --git a/drivers/spi/spi-orion.c b/drivers/spi/spi-orion.c
index 2760450..2de58bb 100644
--- a/drivers/spi/spi-orion.c
+++ b/drivers/spi/spi-orion.c
@@ -17,6 +17,7 @@
 #include <linux/io.h>
 #include <linux/spi/spi.h>
 #include <linux/module.h>
+#include <linux/of.h>
 #include <linux/clk.h>
 #include <asm/unaligned.h>
 
@@ -506,6 +507,7 @@ static int __init orion_spi_probe(struct platform_device *pdev)
 	if (orion_spi_reset(spi) < 0)
 		goto out_rel_mem;
 
+	master->dev.of_node = pdev->dev.of_node;
 	status = spi_register_master(master);
 	if (status < 0)
 		goto out_rel_mem;
@@ -547,10 +549,19 @@ static int __exit orion_spi_remove(struct platform_device *pdev)
 
 MODULE_ALIAS("platform:" DRIVER_NAME);
 
+#ifdef CONFIG_OF
+static const struct of_device_id orion_spi_of_match_table[] __devinitdata = {
+	{ .compatible = "mrvl,orion-spi", },
+	{}
+};
+MODULE_DEVICE_TABLE(of, orion_spi_of_match_table);
+#endif
+
 static struct platform_driver orion_spi_driver = {
 	.driver = {
 		.name	= DRIVER_NAME,
 		.owner	= THIS_MODULE,
+		.of_match_table = of_match_ptr(orion_spi_of_match_table),
 	},
 	.remove		= __exit_p(orion_spi_remove),
 };
-- 
1.7.2.5

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

* [PATCH 2/3] ARM: kirkwood: use devicetree for orion-spi
  2012-06-03 20:17 ` Michael Walle
@ 2012-06-03 20:17   ` Michael Walle
  -1 siblings, 0 replies; 12+ messages in thread
From: Michael Walle @ 2012-06-03 20:17 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Grant Likely, devicetree-discuss, Michael Walle, Jason Cooper

Populate the devices with auxdata to set the device names which are used by
clkdev to lookup the clocks.

Signed-off-by: Michael Walle <michael@walle.cc>
---
 arch/arm/boot/dts/kirkwood.dtsi   |    9 +++++++++
 arch/arm/mach-kirkwood/board-dt.c |    8 +++++++-
 2 files changed, 16 insertions(+), 1 deletions(-)

diff --git a/arch/arm/boot/dts/kirkwood.dtsi b/arch/arm/boot/dts/kirkwood.dtsi
index 926528b..46223b3 100644
--- a/arch/arm/boot/dts/kirkwood.dtsi
+++ b/arch/arm/boot/dts/kirkwood.dtsi
@@ -33,6 +33,15 @@
 			interrupts = <53>;
 		};
 
+		spi@10600 {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			cell-index = <0>;
+			compatible = "mrvl,orion-spi";
+			reg = <0x10600 0x28>;
+			status = "disabled";
+		};
+
 		nand@3000000 {
 			#address-cells = <1>;
 			#size-cells = <1>;
diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c
index edc3f8a..cf1e141 100644
--- a/arch/arm/mach-kirkwood/board-dt.c
+++ b/arch/arm/mach-kirkwood/board-dt.c
@@ -25,6 +25,11 @@ static struct of_device_id kirkwood_dt_match_table[] __initdata = {
 	{ }
 };
 
+struct of_dev_auxdata kirkwood_auxdata_lookup[] __initdata = {
+	OF_DEV_AUXDATA("mrvl,orion-spi", 0xf1010600, "orion_spi.0", NULL),
+	{}
+};
+
 static void __init kirkwood_dt_init(void)
 {
 	pr_info("Kirkwood: %s, TCLK=%d.\n", kirkwood_id(), kirkwood_tclk);
@@ -68,7 +73,8 @@ static void __init kirkwood_dt_init(void)
 	if (of_machine_is_compatible("raidsonic,ib-nas62x0"))
 		ib62x0_init();
 
-	of_platform_populate(NULL, kirkwood_dt_match_table, NULL, NULL);
+	of_platform_populate(NULL, kirkwood_dt_match_table,
+				kirkwood_auxdata_lookup, NULL);
 }
 
 static const char *kirkwood_dt_board_compat[] = {
-- 
1.7.2.5

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

* [PATCH 2/3] ARM: kirkwood: use devicetree for orion-spi
@ 2012-06-03 20:17   ` Michael Walle
  0 siblings, 0 replies; 12+ messages in thread
From: Michael Walle @ 2012-06-03 20:17 UTC (permalink / raw)
  To: linux-arm-kernel

Populate the devices with auxdata to set the device names which are used by
clkdev to lookup the clocks.

Signed-off-by: Michael Walle <michael@walle.cc>
---
 arch/arm/boot/dts/kirkwood.dtsi   |    9 +++++++++
 arch/arm/mach-kirkwood/board-dt.c |    8 +++++++-
 2 files changed, 16 insertions(+), 1 deletions(-)

diff --git a/arch/arm/boot/dts/kirkwood.dtsi b/arch/arm/boot/dts/kirkwood.dtsi
index 926528b..46223b3 100644
--- a/arch/arm/boot/dts/kirkwood.dtsi
+++ b/arch/arm/boot/dts/kirkwood.dtsi
@@ -33,6 +33,15 @@
 			interrupts = <53>;
 		};
 
+		spi at 10600 {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			cell-index = <0>;
+			compatible = "mrvl,orion-spi";
+			reg = <0x10600 0x28>;
+			status = "disabled";
+		};
+
 		nand at 3000000 {
 			#address-cells = <1>;
 			#size-cells = <1>;
diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c
index edc3f8a..cf1e141 100644
--- a/arch/arm/mach-kirkwood/board-dt.c
+++ b/arch/arm/mach-kirkwood/board-dt.c
@@ -25,6 +25,11 @@ static struct of_device_id kirkwood_dt_match_table[] __initdata = {
 	{ }
 };
 
+struct of_dev_auxdata kirkwood_auxdata_lookup[] __initdata = {
+	OF_DEV_AUXDATA("mrvl,orion-spi", 0xf1010600, "orion_spi.0", NULL),
+	{}
+};
+
 static void __init kirkwood_dt_init(void)
 {
 	pr_info("Kirkwood: %s, TCLK=%d.\n", kirkwood_id(), kirkwood_tclk);
@@ -68,7 +73,8 @@ static void __init kirkwood_dt_init(void)
 	if (of_machine_is_compatible("raidsonic,ib-nas62x0"))
 		ib62x0_init();
 
-	of_platform_populate(NULL, kirkwood_dt_match_table, NULL, NULL);
+	of_platform_populate(NULL, kirkwood_dt_match_table,
+				kirkwood_auxdata_lookup, NULL);
 }
 
 static const char *kirkwood_dt_board_compat[] = {
-- 
1.7.2.5

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

* [PATCH 3/3] ARM: kirkwood: use devicetree for SPI on dreamplug
  2012-06-03 20:17 ` Michael Walle
@ 2012-06-03 20:17   ` Michael Walle
  -1 siblings, 0 replies; 12+ messages in thread
From: Michael Walle @ 2012-06-03 20:17 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Grant Likely, devicetree-discuss, Michael Walle, Jason Cooper

Use the device tree for the SPI driver and partition layout.

Signed-off-by: Michael Walle <michael@walle.cc>
---
 arch/arm/boot/dts/kirkwood-dreamplug.dts |   28 +++++++++++++++++++++
 arch/arm/mach-kirkwood/board-dreamplug.c |   40 ------------------------------
 2 files changed, 28 insertions(+), 40 deletions(-)

diff --git a/arch/arm/boot/dts/kirkwood-dreamplug.dts b/arch/arm/boot/dts/kirkwood-dreamplug.dts
index a5376b8..f31d2b5 100644
--- a/arch/arm/boot/dts/kirkwood-dreamplug.dts
+++ b/arch/arm/boot/dts/kirkwood-dreamplug.dts
@@ -20,5 +20,33 @@
 			clock-frequency = <200000000>;
 			status = "ok";
 		};
+
+		spi@10600 {
+			status = "okay";
+
+			m25p40@0 {
+				#address-cells = <1>;
+				#size-cells = <1>;
+				compatible = "mx25l1606e";
+				reg = <0>;
+				spi-max-frequency = <50000000>;
+				mode = <0>;
+
+				partition@0 {
+					reg = <0x0 0x80000>;
+					label = "u-boot";
+				};
+
+				partition@100000 {
+					reg = <0x100000 0x10000>;
+					label = "u-boot env";
+				};
+
+				partition@180000 {
+					reg = <0x180000 0x10000>;
+					label = "dtb";
+				};
+			};
+		};
 	};
 };
diff --git a/arch/arm/mach-kirkwood/board-dreamplug.c b/arch/arm/mach-kirkwood/board-dreamplug.c
index 55e357a..b3aba7d 100644
--- a/arch/arm/mach-kirkwood/board-dreamplug.c
+++ b/arch/arm/mach-kirkwood/board-dreamplug.c
@@ -36,42 +36,6 @@
 #include "common.h"
 #include "mpp.h"
 
-struct mtd_partition dreamplug_partitions[] = {
-	{
-		.name	= "u-boot",
-		.size	= SZ_512K,
-		.offset = 0,
-	},
-	{
-		.name	= "u-boot env",
-		.size	= SZ_64K,
-		.offset = SZ_512K + SZ_512K,
-	},
-	{
-		.name	= "dtb",
-		.size	= SZ_64K,
-		.offset = SZ_512K + SZ_512K + SZ_512K,
-	},
-};
-
-static const struct flash_platform_data dreamplug_spi_slave_data = {
-	.type		= "mx25l1606e",
-	.name		= "spi_flash",
-	.parts		= dreamplug_partitions,
-	.nr_parts	= ARRAY_SIZE(dreamplug_partitions),
-};
-
-static struct spi_board_info __initdata dreamplug_spi_slave_info[] = {
-	{
-		.modalias	= "m25p80",
-		.platform_data	= &dreamplug_spi_slave_data,
-		.irq		= -1,
-		.max_speed_hz	= 50000000,
-		.bus_num	= 0,
-		.chip_select	= 0,
-	},
-};
-
 static struct mv643xx_eth_platform_data dreamplug_ge00_data = {
 	.phy_addr	= MV643XX_ETH_PHY_ADDR(0),
 };
@@ -137,10 +101,6 @@ void __init dreamplug_init(void)
 	 */
 	kirkwood_mpp_conf(dreamplug_mpp_config);
 
-	spi_register_board_info(dreamplug_spi_slave_info,
-				ARRAY_SIZE(dreamplug_spi_slave_info));
-	kirkwood_spi_init();
-
 	kirkwood_ehci_init();
 	kirkwood_ge00_init(&dreamplug_ge00_data);
 	kirkwood_ge01_init(&dreamplug_ge01_data);
-- 
1.7.2.5

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

* [PATCH 3/3] ARM: kirkwood: use devicetree for SPI on dreamplug
@ 2012-06-03 20:17   ` Michael Walle
  0 siblings, 0 replies; 12+ messages in thread
From: Michael Walle @ 2012-06-03 20:17 UTC (permalink / raw)
  To: linux-arm-kernel

Use the device tree for the SPI driver and partition layout.

Signed-off-by: Michael Walle <michael@walle.cc>
---
 arch/arm/boot/dts/kirkwood-dreamplug.dts |   28 +++++++++++++++++++++
 arch/arm/mach-kirkwood/board-dreamplug.c |   40 ------------------------------
 2 files changed, 28 insertions(+), 40 deletions(-)

diff --git a/arch/arm/boot/dts/kirkwood-dreamplug.dts b/arch/arm/boot/dts/kirkwood-dreamplug.dts
index a5376b8..f31d2b5 100644
--- a/arch/arm/boot/dts/kirkwood-dreamplug.dts
+++ b/arch/arm/boot/dts/kirkwood-dreamplug.dts
@@ -20,5 +20,33 @@
 			clock-frequency = <200000000>;
 			status = "ok";
 		};
+
+		spi at 10600 {
+			status = "okay";
+
+			m25p40 at 0 {
+				#address-cells = <1>;
+				#size-cells = <1>;
+				compatible = "mx25l1606e";
+				reg = <0>;
+				spi-max-frequency = <50000000>;
+				mode = <0>;
+
+				partition at 0 {
+					reg = <0x0 0x80000>;
+					label = "u-boot";
+				};
+
+				partition at 100000 {
+					reg = <0x100000 0x10000>;
+					label = "u-boot env";
+				};
+
+				partition at 180000 {
+					reg = <0x180000 0x10000>;
+					label = "dtb";
+				};
+			};
+		};
 	};
 };
diff --git a/arch/arm/mach-kirkwood/board-dreamplug.c b/arch/arm/mach-kirkwood/board-dreamplug.c
index 55e357a..b3aba7d 100644
--- a/arch/arm/mach-kirkwood/board-dreamplug.c
+++ b/arch/arm/mach-kirkwood/board-dreamplug.c
@@ -36,42 +36,6 @@
 #include "common.h"
 #include "mpp.h"
 
-struct mtd_partition dreamplug_partitions[] = {
-	{
-		.name	= "u-boot",
-		.size	= SZ_512K,
-		.offset = 0,
-	},
-	{
-		.name	= "u-boot env",
-		.size	= SZ_64K,
-		.offset = SZ_512K + SZ_512K,
-	},
-	{
-		.name	= "dtb",
-		.size	= SZ_64K,
-		.offset = SZ_512K + SZ_512K + SZ_512K,
-	},
-};
-
-static const struct flash_platform_data dreamplug_spi_slave_data = {
-	.type		= "mx25l1606e",
-	.name		= "spi_flash",
-	.parts		= dreamplug_partitions,
-	.nr_parts	= ARRAY_SIZE(dreamplug_partitions),
-};
-
-static struct spi_board_info __initdata dreamplug_spi_slave_info[] = {
-	{
-		.modalias	= "m25p80",
-		.platform_data	= &dreamplug_spi_slave_data,
-		.irq		= -1,
-		.max_speed_hz	= 50000000,
-		.bus_num	= 0,
-		.chip_select	= 0,
-	},
-};
-
 static struct mv643xx_eth_platform_data dreamplug_ge00_data = {
 	.phy_addr	= MV643XX_ETH_PHY_ADDR(0),
 };
@@ -137,10 +101,6 @@ void __init dreamplug_init(void)
 	 */
 	kirkwood_mpp_conf(dreamplug_mpp_config);
 
-	spi_register_board_info(dreamplug_spi_slave_info,
-				ARRAY_SIZE(dreamplug_spi_slave_info));
-	kirkwood_spi_init();
-
 	kirkwood_ehci_init();
 	kirkwood_ge00_init(&dreamplug_ge00_data);
 	kirkwood_ge01_init(&dreamplug_ge01_data);
-- 
1.7.2.5

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

* Re: [PATCH 1/3] spi-orion: add device tree binding
  2012-06-03 20:17 ` Michael Walle
@ 2012-06-03 21:01   ` Jason Cooper
  -1 siblings, 0 replies; 12+ messages in thread
From: Jason Cooper @ 2012-06-03 21:01 UTC (permalink / raw)
  To: Michael Walle; +Cc: Grant Likely, devicetree-discuss, linux-arm-kernel

On Sun, Jun 03, 2012 at 10:17:56PM +0200, Michael Walle wrote:
> Signed-off-by: Michael Walle <michael@walle.cc>
> ---
>  .../devicetree/bindings/spi/spi-orion.txt          |    5 +++++
>  drivers/spi/spi-orion.c                            |   11 +++++++++++
>  2 files changed, 16 insertions(+), 0 deletions(-)
>  create mode 100644 Documentation/devicetree/bindings/spi/spi-orion.txt
> 
> diff --git a/Documentation/devicetree/bindings/spi/spi-orion.txt b/Documentation/devicetree/bindings/spi/spi-orion.txt
> new file mode 100644
> index 0000000..e68597a
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/spi/spi-orion.txt
> @@ -0,0 +1,5 @@
> +Marvell Orion SPI device
> +
> +Required properties:
> +- compatible : should be "marvell,orion-spi".

The above is correct, and a change in policy from when dreamplug DT
support was first added.

> +- reg : offset and length of the register set for the device
> diff --git a/drivers/spi/spi-orion.c b/drivers/spi/spi-orion.c
> index 2760450..2de58bb 100644
> --- a/drivers/spi/spi-orion.c
> +++ b/drivers/spi/spi-orion.c
> @@ -17,6 +17,7 @@
>  #include <linux/io.h>
>  #include <linux/spi/spi.h>
>  #include <linux/module.h>
> +#include <linux/of.h>
>  #include <linux/clk.h>
>  #include <asm/unaligned.h>
>  
> @@ -506,6 +507,7 @@ static int __init orion_spi_probe(struct platform_device *pdev)
>  	if (orion_spi_reset(spi) < 0)
>  		goto out_rel_mem;
>  
> +	master->dev.of_node = pdev->dev.of_node;
>  	status = spi_register_master(master);
>  	if (status < 0)
>  		goto out_rel_mem;
> @@ -547,10 +549,19 @@ static int __exit orion_spi_remove(struct platform_device *pdev)
>  
>  MODULE_ALIAS("platform:" DRIVER_NAME);
>  
> +#ifdef CONFIG_OF
> +static const struct of_device_id orion_spi_of_match_table[] __devinitdata = {
> +	{ .compatible = "mrvl,orion-spi", },

Please make this consistent with the documentation, "marvell,orion-spi",
thanks.  That'll be one less to convert over later.

thx,

Jason.

> +	{}
> +};
> +MODULE_DEVICE_TABLE(of, orion_spi_of_match_table);
> +#endif
> +
>  static struct platform_driver orion_spi_driver = {
>  	.driver = {
>  		.name	= DRIVER_NAME,
>  		.owner	= THIS_MODULE,
> +		.of_match_table = of_match_ptr(orion_spi_of_match_table),
>  	},
>  	.remove		= __exit_p(orion_spi_remove),
>  };
> -- 
> 1.7.2.5
> 
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 1/3] spi-orion: add device tree binding
@ 2012-06-03 21:01   ` Jason Cooper
  0 siblings, 0 replies; 12+ messages in thread
From: Jason Cooper @ 2012-06-03 21:01 UTC (permalink / raw)
  To: linux-arm-kernel

On Sun, Jun 03, 2012 at 10:17:56PM +0200, Michael Walle wrote:
> Signed-off-by: Michael Walle <michael@walle.cc>
> ---
>  .../devicetree/bindings/spi/spi-orion.txt          |    5 +++++
>  drivers/spi/spi-orion.c                            |   11 +++++++++++
>  2 files changed, 16 insertions(+), 0 deletions(-)
>  create mode 100644 Documentation/devicetree/bindings/spi/spi-orion.txt
> 
> diff --git a/Documentation/devicetree/bindings/spi/spi-orion.txt b/Documentation/devicetree/bindings/spi/spi-orion.txt
> new file mode 100644
> index 0000000..e68597a
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/spi/spi-orion.txt
> @@ -0,0 +1,5 @@
> +Marvell Orion SPI device
> +
> +Required properties:
> +- compatible : should be "marvell,orion-spi".

The above is correct, and a change in policy from when dreamplug DT
support was first added.

> +- reg : offset and length of the register set for the device
> diff --git a/drivers/spi/spi-orion.c b/drivers/spi/spi-orion.c
> index 2760450..2de58bb 100644
> --- a/drivers/spi/spi-orion.c
> +++ b/drivers/spi/spi-orion.c
> @@ -17,6 +17,7 @@
>  #include <linux/io.h>
>  #include <linux/spi/spi.h>
>  #include <linux/module.h>
> +#include <linux/of.h>
>  #include <linux/clk.h>
>  #include <asm/unaligned.h>
>  
> @@ -506,6 +507,7 @@ static int __init orion_spi_probe(struct platform_device *pdev)
>  	if (orion_spi_reset(spi) < 0)
>  		goto out_rel_mem;
>  
> +	master->dev.of_node = pdev->dev.of_node;
>  	status = spi_register_master(master);
>  	if (status < 0)
>  		goto out_rel_mem;
> @@ -547,10 +549,19 @@ static int __exit orion_spi_remove(struct platform_device *pdev)
>  
>  MODULE_ALIAS("platform:" DRIVER_NAME);
>  
> +#ifdef CONFIG_OF
> +static const struct of_device_id orion_spi_of_match_table[] __devinitdata = {
> +	{ .compatible = "mrvl,orion-spi", },

Please make this consistent with the documentation, "marvell,orion-spi",
thanks.  That'll be one less to convert over later.

thx,

Jason.

> +	{}
> +};
> +MODULE_DEVICE_TABLE(of, orion_spi_of_match_table);
> +#endif
> +
>  static struct platform_driver orion_spi_driver = {
>  	.driver = {
>  		.name	= DRIVER_NAME,
>  		.owner	= THIS_MODULE,
> +		.of_match_table = of_match_ptr(orion_spi_of_match_table),
>  	},
>  	.remove		= __exit_p(orion_spi_remove),
>  };
> -- 
> 1.7.2.5
> 
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH 1/3] spi-orion: add device tree binding
  2012-06-03 21:01   ` Jason Cooper
@ 2012-06-03 21:48       ` Michael Walle
  -1 siblings, 0 replies; 12+ messages in thread
From: Michael Walle @ 2012-06-03 21:48 UTC (permalink / raw)
  To: Jason Cooper
  Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

Hi Jason,

Am Sonntag 03 Juni 2012, 23:01:23 schrieb Jason Cooper:
> On Sun, Jun 03, 2012 at 10:17:56PM +0200, Michael Walle wrote:
> > Signed-off-by: Michael Walle <michael-QKn5cuLxLXY@public.gmane.org>
> > ---
> > 
> >  .../devicetree/bindings/spi/spi-orion.txt          |    5 +++++
> >  drivers/spi/spi-orion.c                            |   11 +++++++++++
> >  2 files changed, 16 insertions(+), 0 deletions(-)
> >  create mode 100644 Documentation/devicetree/bindings/spi/spi-orion.txt
> > 
> > diff --git a/Documentation/devicetree/bindings/spi/spi-orion.txt
> > b/Documentation/devicetree/bindings/spi/spi-orion.txt new file mode
> > 100644
> > index 0000000..e68597a
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/spi/spi-orion.txt
> > @@ -0,0 +1,5 @@
> > +Marvell Orion SPI device
> > +
> > +Required properties:
> > +- compatible : should be "marvell,orion-spi".
> 
> The above is correct, and a change in policy from when dreamplug DT
> support was first added.
> 
> > +- reg : offset and length of the register set for the device
> > diff --git a/drivers/spi/spi-orion.c b/drivers/spi/spi-orion.c
> > index 2760450..2de58bb 100644
> > --- a/drivers/spi/spi-orion.c
> > +++ b/drivers/spi/spi-orion.c
> > @@ -17,6 +17,7 @@
> > 
> >  #include <linux/io.h>
> >  #include <linux/spi/spi.h>
> >  #include <linux/module.h>
> > 
> > +#include <linux/of.h>
> > 
> >  #include <linux/clk.h>
> >  #include <asm/unaligned.h>
> > 
> > @@ -506,6 +507,7 @@ static int __init orion_spi_probe(struct
> > platform_device *pdev)
> > 
> >  	if (orion_spi_reset(spi) < 0)
> >  	
> >  		goto out_rel_mem;
> > 
> > +	master->dev.of_node = pdev->dev.of_node;
> > 
> >  	status = spi_register_master(master);
> >  	if (status < 0)
> >  	
> >  		goto out_rel_mem;
> > 
> > @@ -547,10 +549,19 @@ static int __exit orion_spi_remove(struct
> > platform_device *pdev)
> > 
> >  MODULE_ALIAS("platform:" DRIVER_NAME);
> > 
> > +#ifdef CONFIG_OF
> > +static const struct of_device_id orion_spi_of_match_table[]
> > __devinitdata = { +	{ .compatible = "mrvl,orion-spi", },
> 
> Please make this consistent with the documentation, "marvell,orion-spi",
> thanks.  That'll be one less to convert over later.

oh, actually i forgot to change the documentation. wasnt the convention to use 
the name used in the stock exchange?

eg. the nand driver uses mrvl,orion-nand, or kirkwood itself is named 
"mrvl,kirkwood".

Or did i miss sth, because you wrote "one less to convert over later"?

-- 
michael

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

* [PATCH 1/3] spi-orion: add device tree binding
@ 2012-06-03 21:48       ` Michael Walle
  0 siblings, 0 replies; 12+ messages in thread
From: Michael Walle @ 2012-06-03 21:48 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Jason,

Am Sonntag 03 Juni 2012, 23:01:23 schrieb Jason Cooper:
> On Sun, Jun 03, 2012 at 10:17:56PM +0200, Michael Walle wrote:
> > Signed-off-by: Michael Walle <michael@walle.cc>
> > ---
> > 
> >  .../devicetree/bindings/spi/spi-orion.txt          |    5 +++++
> >  drivers/spi/spi-orion.c                            |   11 +++++++++++
> >  2 files changed, 16 insertions(+), 0 deletions(-)
> >  create mode 100644 Documentation/devicetree/bindings/spi/spi-orion.txt
> > 
> > diff --git a/Documentation/devicetree/bindings/spi/spi-orion.txt
> > b/Documentation/devicetree/bindings/spi/spi-orion.txt new file mode
> > 100644
> > index 0000000..e68597a
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/spi/spi-orion.txt
> > @@ -0,0 +1,5 @@
> > +Marvell Orion SPI device
> > +
> > +Required properties:
> > +- compatible : should be "marvell,orion-spi".
> 
> The above is correct, and a change in policy from when dreamplug DT
> support was first added.
> 
> > +- reg : offset and length of the register set for the device
> > diff --git a/drivers/spi/spi-orion.c b/drivers/spi/spi-orion.c
> > index 2760450..2de58bb 100644
> > --- a/drivers/spi/spi-orion.c
> > +++ b/drivers/spi/spi-orion.c
> > @@ -17,6 +17,7 @@
> > 
> >  #include <linux/io.h>
> >  #include <linux/spi/spi.h>
> >  #include <linux/module.h>
> > 
> > +#include <linux/of.h>
> > 
> >  #include <linux/clk.h>
> >  #include <asm/unaligned.h>
> > 
> > @@ -506,6 +507,7 @@ static int __init orion_spi_probe(struct
> > platform_device *pdev)
> > 
> >  	if (orion_spi_reset(spi) < 0)
> >  	
> >  		goto out_rel_mem;
> > 
> > +	master->dev.of_node = pdev->dev.of_node;
> > 
> >  	status = spi_register_master(master);
> >  	if (status < 0)
> >  	
> >  		goto out_rel_mem;
> > 
> > @@ -547,10 +549,19 @@ static int __exit orion_spi_remove(struct
> > platform_device *pdev)
> > 
> >  MODULE_ALIAS("platform:" DRIVER_NAME);
> > 
> > +#ifdef CONFIG_OF
> > +static const struct of_device_id orion_spi_of_match_table[]
> > __devinitdata = { +	{ .compatible = "mrvl,orion-spi", },
> 
> Please make this consistent with the documentation, "marvell,orion-spi",
> thanks.  That'll be one less to convert over later.

oh, actually i forgot to change the documentation. wasnt the convention to use 
the name used in the stock exchange?

eg. the nand driver uses mrvl,orion-nand, or kirkwood itself is named 
"mrvl,kirkwood".

Or did i miss sth, because you wrote "one less to convert over later"?

-- 
michael

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

* Re: [PATCH 1/3] spi-orion: add device tree binding
  2012-06-03 21:48       ` Michael Walle
@ 2012-06-07 20:27           ` Jason Cooper
  -1 siblings, 0 replies; 12+ messages in thread
From: Jason Cooper @ 2012-06-07 20:27 UTC (permalink / raw)
  To: Michael Walle
  Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On Sun, Jun 03, 2012 at 11:48:49PM +0200, Michael Walle wrote:
> Hi Jason,
> 
> Am Sonntag 03 Juni 2012, 23:01:23 schrieb Jason Cooper:
> > On Sun, Jun 03, 2012 at 10:17:56PM +0200, Michael Walle wrote:
> > > Signed-off-by: Michael Walle <michael-QKn5cuLxLXY@public.gmane.org>
> > > ---
> > > 
> > >  .../devicetree/bindings/spi/spi-orion.txt          |    5 +++++
> > >  drivers/spi/spi-orion.c                            |   11 +++++++++++
> > >  2 files changed, 16 insertions(+), 0 deletions(-)
> > >  create mode 100644 Documentation/devicetree/bindings/spi/spi-orion.txt
> > > 
> > > diff --git a/Documentation/devicetree/bindings/spi/spi-orion.txt
> > > b/Documentation/devicetree/bindings/spi/spi-orion.txt new file mode
> > > 100644
> > > index 0000000..e68597a
> > > --- /dev/null
> > > +++ b/Documentation/devicetree/bindings/spi/spi-orion.txt
> > > @@ -0,0 +1,5 @@
> > > +Marvell Orion SPI device
> > > +
> > > +Required properties:
> > > +- compatible : should be "marvell,orion-spi".
> > 
> > The above is correct, and a change in policy from when dreamplug DT
> > support was first added.
> > 
> > > +- reg : offset and length of the register set for the device
> > > diff --git a/drivers/spi/spi-orion.c b/drivers/spi/spi-orion.c
> > > index 2760450..2de58bb 100644
> > > --- a/drivers/spi/spi-orion.c
> > > +++ b/drivers/spi/spi-orion.c
> > > @@ -17,6 +17,7 @@
> > > 
> > >  #include <linux/io.h>
> > >  #include <linux/spi/spi.h>
> > >  #include <linux/module.h>
> > > 
> > > +#include <linux/of.h>
> > > 
> > >  #include <linux/clk.h>
> > >  #include <asm/unaligned.h>
> > > 
> > > @@ -506,6 +507,7 @@ static int __init orion_spi_probe(struct
> > > platform_device *pdev)
> > > 
> > >  	if (orion_spi_reset(spi) < 0)
> > >  	
> > >  		goto out_rel_mem;
> > > 
> > > +	master->dev.of_node = pdev->dev.of_node;
> > > 
> > >  	status = spi_register_master(master);
> > >  	if (status < 0)
> > >  	
> > >  		goto out_rel_mem;
> > > 
> > > @@ -547,10 +549,19 @@ static int __exit orion_spi_remove(struct
> > > platform_device *pdev)
> > > 
> > >  MODULE_ALIAS("platform:" DRIVER_NAME);
> > > 
> > > +#ifdef CONFIG_OF
> > > +static const struct of_device_id orion_spi_of_match_table[]
> > > __devinitdata = { +	{ .compatible = "mrvl,orion-spi", },
> > 
> > Please make this consistent with the documentation, "marvell,orion-spi",
> > thanks.  That'll be one less to convert over later.
> 
> oh, actually i forgot to change the documentation. wasnt the convention to use 
> the name used in the stock exchange?

It was, but after discussing this recently with Russell, Arnd, and
Nicolas, we decided this was a bad idea because powerpc has used
"marvell" for years and has devices in the field using it that way.
Since there was no technical justification for the change, we opted to
follow powerpc's lead.

This was brought up in the discussion thread around the proposed
'mach-armada/' patch series.

hth,

Jason.

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

* [PATCH 1/3] spi-orion: add device tree binding
@ 2012-06-07 20:27           ` Jason Cooper
  0 siblings, 0 replies; 12+ messages in thread
From: Jason Cooper @ 2012-06-07 20:27 UTC (permalink / raw)
  To: linux-arm-kernel

On Sun, Jun 03, 2012 at 11:48:49PM +0200, Michael Walle wrote:
> Hi Jason,
> 
> Am Sonntag 03 Juni 2012, 23:01:23 schrieb Jason Cooper:
> > On Sun, Jun 03, 2012 at 10:17:56PM +0200, Michael Walle wrote:
> > > Signed-off-by: Michael Walle <michael@walle.cc>
> > > ---
> > > 
> > >  .../devicetree/bindings/spi/spi-orion.txt          |    5 +++++
> > >  drivers/spi/spi-orion.c                            |   11 +++++++++++
> > >  2 files changed, 16 insertions(+), 0 deletions(-)
> > >  create mode 100644 Documentation/devicetree/bindings/spi/spi-orion.txt
> > > 
> > > diff --git a/Documentation/devicetree/bindings/spi/spi-orion.txt
> > > b/Documentation/devicetree/bindings/spi/spi-orion.txt new file mode
> > > 100644
> > > index 0000000..e68597a
> > > --- /dev/null
> > > +++ b/Documentation/devicetree/bindings/spi/spi-orion.txt
> > > @@ -0,0 +1,5 @@
> > > +Marvell Orion SPI device
> > > +
> > > +Required properties:
> > > +- compatible : should be "marvell,orion-spi".
> > 
> > The above is correct, and a change in policy from when dreamplug DT
> > support was first added.
> > 
> > > +- reg : offset and length of the register set for the device
> > > diff --git a/drivers/spi/spi-orion.c b/drivers/spi/spi-orion.c
> > > index 2760450..2de58bb 100644
> > > --- a/drivers/spi/spi-orion.c
> > > +++ b/drivers/spi/spi-orion.c
> > > @@ -17,6 +17,7 @@
> > > 
> > >  #include <linux/io.h>
> > >  #include <linux/spi/spi.h>
> > >  #include <linux/module.h>
> > > 
> > > +#include <linux/of.h>
> > > 
> > >  #include <linux/clk.h>
> > >  #include <asm/unaligned.h>
> > > 
> > > @@ -506,6 +507,7 @@ static int __init orion_spi_probe(struct
> > > platform_device *pdev)
> > > 
> > >  	if (orion_spi_reset(spi) < 0)
> > >  	
> > >  		goto out_rel_mem;
> > > 
> > > +	master->dev.of_node = pdev->dev.of_node;
> > > 
> > >  	status = spi_register_master(master);
> > >  	if (status < 0)
> > >  	
> > >  		goto out_rel_mem;
> > > 
> > > @@ -547,10 +549,19 @@ static int __exit orion_spi_remove(struct
> > > platform_device *pdev)
> > > 
> > >  MODULE_ALIAS("platform:" DRIVER_NAME);
> > > 
> > > +#ifdef CONFIG_OF
> > > +static const struct of_device_id orion_spi_of_match_table[]
> > > __devinitdata = { +	{ .compatible = "mrvl,orion-spi", },
> > 
> > Please make this consistent with the documentation, "marvell,orion-spi",
> > thanks.  That'll be one less to convert over later.
> 
> oh, actually i forgot to change the documentation. wasnt the convention to use 
> the name used in the stock exchange?

It was, but after discussing this recently with Russell, Arnd, and
Nicolas, we decided this was a bad idea because powerpc has used
"marvell" for years and has devices in the field using it that way.
Since there was no technical justification for the change, we opted to
follow powerpc's lead.

This was brought up in the discussion thread around the proposed
'mach-armada/' patch series.

hth,

Jason.

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

end of thread, other threads:[~2012-06-07 20:27 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-03 20:17 [PATCH 1/3] spi-orion: add device tree binding Michael Walle
2012-06-03 20:17 ` Michael Walle
2012-06-03 20:17 ` [PATCH 2/3] ARM: kirkwood: use devicetree for orion-spi Michael Walle
2012-06-03 20:17   ` Michael Walle
2012-06-03 20:17 ` [PATCH 3/3] ARM: kirkwood: use devicetree for SPI on dreamplug Michael Walle
2012-06-03 20:17   ` Michael Walle
2012-06-03 21:01 ` [PATCH 1/3] spi-orion: add device tree binding Jason Cooper
2012-06-03 21:01   ` Jason Cooper
     [not found]   ` <20120603210123.GL14756-u4khhh1J0LxI1Ri9qeTfzeTW4wlIGRCZ@public.gmane.org>
2012-06-03 21:48     ` Michael Walle
2012-06-03 21:48       ` Michael Walle
     [not found]       ` <201206032348.49208.michael-QKn5cuLxLXY@public.gmane.org>
2012-06-07 20:27         ` Jason Cooper
2012-06-07 20:27           ` 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.