linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] Fixes and DT conversion for QNAP TS219
@ 2013-01-26 15:10 Andrew Lunn
  2013-01-26 15:10 ` [PATCH 1/3] NET: mv643xx: Get clk from device tree Andrew Lunn
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Andrew Lunn @ 2013-01-26 15:10 UTC (permalink / raw)
  To: linux-arm-kernel

This patchset contains fixes to the patchset "ARM: kirkwood: cleanup
DT conversion" from Jason Cooper, and converts QNAP TS219 ethernet to
DT.

Probably the best way to use these patches:

place "NET: mv643xx: Get clk from device tree." directly after Ian
Moltons "mv643xx.c: Add basic device tree support" patch.

Squash "ARM: Kirkwood: Revert clkdev changes." into
"ARM: kirkwood: mv643xx_eth dt conversion"

Put "ARM: Kirkwood: Convert QNAP TS219 Ethernet to DT."
at the end of the set.

Andrew Lunn (3):
  NET: mv643xx: Get clk from device tree.
  ARM: Kirkwood: Revert clkdev changes.
  ARM: Kirkwood: Convert QNAP TS219 Ethernet to DT.

 arch/arm/boot/dts/kirkwood-ts219-6281.dts  |    9 +++++++
 arch/arm/boot/dts/kirkwood-ts219-6282.dts  |   10 ++++++++
 arch/arm/mach-kirkwood/Kconfig             |   17 ++-----------
 arch/arm/mach-kirkwood/Makefile            |    1 -
 arch/arm/mach-kirkwood/board-dt.c          |    7 ++----
 arch/arm/mach-kirkwood/board-ts219.c       |   37 ----------------------------
 arch/arm/mach-kirkwood/common.h            |    6 -----
 drivers/net/ethernet/marvell/mv643xx_eth.c |    5 +++-
 8 files changed, 27 insertions(+), 65 deletions(-)
 delete mode 100644 arch/arm/mach-kirkwood/board-ts219.c

-- 
1.7.10.4

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

* [PATCH 1/3] NET: mv643xx: Get clk from device tree.
  2013-01-26 15:10 [PATCH 0/3] Fixes and DT conversion for QNAP TS219 Andrew Lunn
@ 2013-01-26 15:10 ` Andrew Lunn
  2013-01-26 15:46   ` Jason Cooper
  2013-01-26 15:10 ` [PATCH 2/3] ARM: Kirkwood: Revert clkdev changes Andrew Lunn
  2013-01-26 15:10 ` [PATCH 3/3] ARM: Kirkwood: Convert QNAP TS219 Ethernet to DT Andrew Lunn
  2 siblings, 1 reply; 7+ messages in thread
From: Andrew Lunn @ 2013-01-26 15:10 UTC (permalink / raw)
  To: linux-arm-kernel

If we are passed a device tree node pointer, get the clock from it.
This avoids problems with con_id when using clk_get().

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
---
 drivers/net/ethernet/marvell/mv643xx_eth.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/marvell/mv643xx_eth.c b/drivers/net/ethernet/marvell/mv643xx_eth.c
index 7048d7c..296beec 100644
--- a/drivers/net/ethernet/marvell/mv643xx_eth.c
+++ b/drivers/net/ethernet/marvell/mv643xx_eth.c
@@ -2955,7 +2955,10 @@ static int mv643xx_eth_probe(struct platform_device *pdev)
 	 */
 	mp->t_clk = 133000000;
 #if defined(CONFIG_HAVE_CLK)
-	mp->clk = clk_get(&pdev->dev, (pdev->id ? "1" : "0"));
+	if (pdev->dev.of_node)
+		mp->clk = of_clk_get(pdev->dev.of_node, 0);
+	else
+		mp->clk = clk_get(&pdev->dev, (pdev->id ? "1" : "0"));
 	if (!IS_ERR(mp->clk)) {
 		clk_prepare_enable(mp->clk);
 		mp->t_clk = clk_get_rate(mp->clk);
-- 
1.7.10.4

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

* [PATCH 2/3] ARM: Kirkwood: Revert clkdev changes.
  2013-01-26 15:10 [PATCH 0/3] Fixes and DT conversion for QNAP TS219 Andrew Lunn
  2013-01-26 15:10 ` [PATCH 1/3] NET: mv643xx: Get clk from device tree Andrew Lunn
@ 2013-01-26 15:10 ` Andrew Lunn
  2013-01-26 19:59   ` Jason Cooper
  2013-01-26 15:10 ` [PATCH 3/3] ARM: Kirkwood: Convert QNAP TS219 Ethernet to DT Andrew Lunn
  2 siblings, 1 reply; 7+ messages in thread
From: Andrew Lunn @ 2013-01-26 15:10 UTC (permalink / raw)
  To: linux-arm-kernel

Now that the Ethernet driver can get its clock from device tree,
revert this change which broken non-DT probing of the ethernet device.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
---
 arch/arm/mach-kirkwood/board-dt.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c
index 7ab92e5..edb1215 100644
--- a/arch/arm/mach-kirkwood/board-dt.c
+++ b/arch/arm/mach-kirkwood/board-dt.c
@@ -48,7 +48,7 @@ static void __init kirkwood_legacy_clk_init(void)
 	clkspec.args_count = 1;
 
 	clkspec.args[0] = CGC_BIT_GE0;
-	orion_clkdev_add(NULL, "f1072000.egiga0",
+	orion_clkdev_add(NULL, "mv643xx_eth_port.0",
 			 of_clk_get_from_provider(&clkspec));
 
 	clkspec.args[0] = CGC_BIT_PEX0;
@@ -60,7 +60,7 @@ static void __init kirkwood_legacy_clk_init(void)
 			 of_clk_get_from_provider(&clkspec));
 
 	clkspec.args[0] = CGC_BIT_GE1;
-	orion_clkdev_add(NULL, "f1076000.egiga1",
+	orion_clkdev_add(NULL, "mv643xx_eth_port.1",
 			 of_clk_get_from_provider(&clkspec));
 }
 
-- 
1.7.10.4

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

* [PATCH 3/3] ARM: Kirkwood: Convert QNAP TS219 Ethernet to DT.
  2013-01-26 15:10 [PATCH 0/3] Fixes and DT conversion for QNAP TS219 Andrew Lunn
  2013-01-26 15:10 ` [PATCH 1/3] NET: mv643xx: Get clk from device tree Andrew Lunn
  2013-01-26 15:10 ` [PATCH 2/3] ARM: Kirkwood: Revert clkdev changes Andrew Lunn
@ 2013-01-26 15:10 ` Andrew Lunn
  2013-01-26 20:10   ` Jason Cooper
  2 siblings, 1 reply; 7+ messages in thread
From: Andrew Lunn @ 2013-01-26 15:10 UTC (permalink / raw)
  To: linux-arm-kernel

Add DT nodes for the Ethernet ports and remove the C code. The PHY
addresses depends on which SoC is used, so place the nodes into the
SoC specific DTS files.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
---
 arch/arm/boot/dts/kirkwood-ts219-6281.dts |    9 +++++++
 arch/arm/boot/dts/kirkwood-ts219-6282.dts |   10 ++++++++
 arch/arm/mach-kirkwood/Kconfig            |   17 ++-----------
 arch/arm/mach-kirkwood/Makefile           |    1 -
 arch/arm/mach-kirkwood/board-dt.c         |    3 ---
 arch/arm/mach-kirkwood/board-ts219.c      |   37 -----------------------------
 arch/arm/mach-kirkwood/common.h           |    6 -----
 7 files changed, 21 insertions(+), 62 deletions(-)
 delete mode 100644 arch/arm/mach-kirkwood/board-ts219.c

diff --git a/arch/arm/boot/dts/kirkwood-ts219-6281.dts b/arch/arm/boot/dts/kirkwood-ts219-6281.dts
index 8295c83..00b2c7f 100644
--- a/arch/arm/boot/dts/kirkwood-ts219-6281.dts
+++ b/arch/arm/boot/dts/kirkwood-ts219-6281.dts
@@ -32,6 +32,15 @@
 				marvell,function = "gpio";
 			};
 		};
+
+		smi0: mdio at 72000 {
+			status = "ok";
+		};
+
+		egiga0 {
+			phy_addr = <0x88>;
+			status = "ok";
+		};
 	};
 
 	gpio_keys {
diff --git a/arch/arm/boot/dts/kirkwood-ts219-6282.dts b/arch/arm/boot/dts/kirkwood-ts219-6282.dts
index df3f95d..61d69f5 100644
--- a/arch/arm/boot/dts/kirkwood-ts219-6282.dts
+++ b/arch/arm/boot/dts/kirkwood-ts219-6282.dts
@@ -32,6 +32,16 @@
 				marvell,function = "gpio";
 			};
 		};
+
+		smi0: mdio at 72000 {
+			status = "ok";
+		};
+
+		egiga0 {
+			phy_addr = <0x80>;
+			status = "ok";
+		};
+
 	};
 
 	gpio_keys {
diff --git a/arch/arm/mach-kirkwood/Kconfig b/arch/arm/mach-kirkwood/Kconfig
index 188651b..9ea5725 100644
--- a/arch/arm/mach-kirkwood/Kconfig
+++ b/arch/arm/mach-kirkwood/Kconfig
@@ -46,9 +46,11 @@ config MACH_GURUPLUG
 
 config ARCH_KIRKWOOD_DT
 	bool "Marvell Kirkwood Flattened Device Tree"
+	select ARM_APPENDED_DTB
 	select POWER_SUPPLY
 	select POWER_RESET
 	select POWER_RESET_GPIO
+	select POWER_RESET_QNAP
 	select REGULATOR
 	select REGULATOR_FIXED_VOLTAGE
 	select MVEBU_CLK_CORE
@@ -66,21 +68,6 @@ config MACH_DLINK_KIRKWOOD_DT
 	  Kirkwood-based D-Link NASes such as DNS-320 & DNS-325,
 	  using Flattened Device Tree.
 
-config MACH_TS219_DT
-	bool "Device Tree for QNAP TS-11X, TS-21X NAS"
-	select ARCH_KIRKWOOD_DT
-	select ARM_APPENDED_DTB
-	select ARM_ATAG_DTB_COMPAT
-	select POWER_RESET_QNAP
-	help
-	  Say 'Y' here if you want your kernel to support the QNAP
-	  TS-110, TS-119, TS-119P+, TS-210, TS-219, TS-219P and
-	  TS-219P+ Turbo NAS devices using Fattened Device Tree.
-	  There are two different Device Tree descriptions, depending
-	  on if the device is based on an if the board uses the MV6281
-	  or MV6282. If you have the wrong one, the buttons will not
-	  work.
-
 config MACH_IOMEGA_IX2_200_DT
 	bool "Iomega StorCenter ix2-200 (Flattened Device Tree)"
 	select ARCH_KIRKWOOD_DT
diff --git a/arch/arm/mach-kirkwood/Makefile b/arch/arm/mach-kirkwood/Makefile
index ab739b0..e94973c 100644
--- a/arch/arm/mach-kirkwood/Makefile
+++ b/arch/arm/mach-kirkwood/Makefile
@@ -21,6 +21,5 @@ obj-$(CONFIG_MACH_T5325)		+= t5325-setup.o
 
 obj-$(CONFIG_ARCH_KIRKWOOD_DT)		+= board-dt.o
 obj-$(CONFIG_MACH_DLINK_KIRKWOOD_DT)	+= board-dnskw.o
-obj-$(CONFIG_MACH_TS219_DT)		+= board-ts219.o tsx1x-common.o
 obj-$(CONFIG_MACH_IOMEGA_IX2_200_DT)	+= board-iomega_ix2_200.o
 obj-$(CONFIG_MACH_KM_KIRKWOOD_DT)	+= board-km_kirkwood.o
diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c
index edb1215..70c8d7d 100644
--- a/arch/arm/mach-kirkwood/board-dt.c
+++ b/arch/arm/mach-kirkwood/board-dt.c
@@ -121,9 +121,6 @@ static void __init kirkwood_dt_init(void)
 	if (of_machine_is_compatible("dlink,dns-kirkwood"))
 		dnskw_init();
 
-	if (of_machine_is_compatible("qnap,ts219"))
-		qnap_dt_ts219_init();
-
 	if (of_machine_is_compatible("iom,ix2-200"))
 		iomega_ix2_200_init();
 
diff --git a/arch/arm/mach-kirkwood/board-ts219.c b/arch/arm/mach-kirkwood/board-ts219.c
deleted file mode 100644
index f00c0a9..0000000
--- a/arch/arm/mach-kirkwood/board-ts219.c
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- *
- * QNAP TS-11x/TS-21x Turbo NAS Board Setup via DT
- *
- * Copyright (C) 2012 Andrew Lunn <andrew@lunn.ch>
- *
- * Based on the board file ts219-setup.c:
- *
- * Copyright (C) 2009  Martin Michlmayr <tbm@cyrius.com>
- * Copyright (C) 2008  Byron Bradley <byron.bbradley@gmail.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version
- * 2 of the License, or (at your option) any later version.
- */
-
-#include <linux/kernel.h>
-#include <linux/init.h>
-#include <linux/mv643xx_eth.h>
-#include <mach/kirkwood.h>
-#include "common.h"
-
-static struct mv643xx_eth_platform_data qnap_ts219_ge00_data = {
-	.phy_addr	= MV643XX_ETH_PHY_ADDR(8),
-};
-
-void __init qnap_dt_ts219_init(void)
-{
-	u32 dev, rev;
-
-	kirkwood_pcie_id(&dev, &rev);
-	if (dev == MV88F6282_DEV_ID)
-		qnap_ts219_ge00_data.phy_addr = MV643XX_ETH_PHY_ADDR(0);
-
-	kirkwood_ge00_init(&qnap_ts219_ge00_data);
-}
diff --git a/arch/arm/mach-kirkwood/common.h b/arch/arm/mach-kirkwood/common.h
index ba6eb9c..8f98b67 100644
--- a/arch/arm/mach-kirkwood/common.h
+++ b/arch/arm/mach-kirkwood/common.h
@@ -55,12 +55,6 @@ void kirkwood_restart(char, const char *);
 void kirkwood_clk_init(void);
 
 /* board init functions for boards not fully converted to fdt */
-#ifdef CONFIG_MACH_TS219_DT
-void qnap_dt_ts219_init(void);
-#else
-static inline void qnap_dt_ts219_init(void) {};
-#endif
-
 #ifdef CONFIG_MACH_DLINK_KIRKWOOD_DT
 void dnskw_init(void);
 #else
-- 
1.7.10.4

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

* [PATCH 1/3] NET: mv643xx: Get clk from device tree.
  2013-01-26 15:10 ` [PATCH 1/3] NET: mv643xx: Get clk from device tree Andrew Lunn
@ 2013-01-26 15:46   ` Jason Cooper
  0 siblings, 0 replies; 7+ messages in thread
From: Jason Cooper @ 2013-01-26 15:46 UTC (permalink / raw)
  To: linux-arm-kernel

On Sat, Jan 26, 2013 at 04:10:28PM +0100, Andrew Lunn wrote:
> If we are passed a device tree node pointer, get the clock from it.
> This avoids problems with con_id when using clk_get().
> 
> Signed-off-by: Andrew Lunn <andrew@lunn.ch>
> ---
>  drivers/net/ethernet/marvell/mv643xx_eth.c |    5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)

I like this much better than what I hacked together, thanks.

Jason.

> diff --git a/drivers/net/ethernet/marvell/mv643xx_eth.c b/drivers/net/ethernet/marvell/mv643xx_eth.c
> index 7048d7c..296beec 100644
> --- a/drivers/net/ethernet/marvell/mv643xx_eth.c
> +++ b/drivers/net/ethernet/marvell/mv643xx_eth.c
> @@ -2955,7 +2955,10 @@ static int mv643xx_eth_probe(struct platform_device *pdev)
>  	 */
>  	mp->t_clk = 133000000;
>  #if defined(CONFIG_HAVE_CLK)
> -	mp->clk = clk_get(&pdev->dev, (pdev->id ? "1" : "0"));
> +	if (pdev->dev.of_node)
> +		mp->clk = of_clk_get(pdev->dev.of_node, 0);
> +	else
> +		mp->clk = clk_get(&pdev->dev, (pdev->id ? "1" : "0"));
>  	if (!IS_ERR(mp->clk)) {
>  		clk_prepare_enable(mp->clk);
>  		mp->t_clk = clk_get_rate(mp->clk);
> -- 
> 1.7.10.4
> 

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

* [PATCH 2/3] ARM: Kirkwood: Revert clkdev changes.
  2013-01-26 15:10 ` [PATCH 2/3] ARM: Kirkwood: Revert clkdev changes Andrew Lunn
@ 2013-01-26 19:59   ` Jason Cooper
  0 siblings, 0 replies; 7+ messages in thread
From: Jason Cooper @ 2013-01-26 19:59 UTC (permalink / raw)
  To: linux-arm-kernel

On Sat, Jan 26, 2013 at 04:10:29PM +0100, Andrew Lunn wrote:
> Now that the Ethernet driver can get its clock from device tree,
> revert this change which broken non-DT probing of the ethernet device.
> 
> Signed-off-by: Andrew Lunn <andrew@lunn.ch>
> ---
>  arch/arm/mach-kirkwood/board-dt.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Squashed in,

thx,

Jason.

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

* [PATCH 3/3] ARM: Kirkwood: Convert QNAP TS219 Ethernet to DT.
  2013-01-26 15:10 ` [PATCH 3/3] ARM: Kirkwood: Convert QNAP TS219 Ethernet to DT Andrew Lunn
@ 2013-01-26 20:10   ` Jason Cooper
  0 siblings, 0 replies; 7+ messages in thread
From: Jason Cooper @ 2013-01-26 20:10 UTC (permalink / raw)
  To: linux-arm-kernel

On Sat, Jan 26, 2013 at 04:10:30PM +0100, Andrew Lunn wrote:
> Add DT nodes for the Ethernet ports and remove the C code. The PHY
> addresses depends on which SoC is used, so place the nodes into the
> SoC specific DTS files.
> 
> Signed-off-by: Andrew Lunn <andrew@lunn.ch>
> ---
>  arch/arm/boot/dts/kirkwood-ts219-6281.dts |    9 +++++++
>  arch/arm/boot/dts/kirkwood-ts219-6282.dts |   10 ++++++++
>  arch/arm/mach-kirkwood/Kconfig            |   17 ++-----------
>  arch/arm/mach-kirkwood/Makefile           |    1 -
>  arch/arm/mach-kirkwood/board-dt.c         |    3 ---
>  arch/arm/mach-kirkwood/board-ts219.c      |   37 -----------------------------
>  arch/arm/mach-kirkwood/common.h           |    6 -----
>  7 files changed, 21 insertions(+), 62 deletions(-)
>  delete mode 100644 arch/arm/mach-kirkwood/board-ts219.c

Pulled into the series.  Thanks.

fyi - I also converted keymile.  The only one left is the iomega_ix2_200
board.  Which only inits ge01.

thx,

Jason.

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

end of thread, other threads:[~2013-01-26 20:10 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-26 15:10 [PATCH 0/3] Fixes and DT conversion for QNAP TS219 Andrew Lunn
2013-01-26 15:10 ` [PATCH 1/3] NET: mv643xx: Get clk from device tree Andrew Lunn
2013-01-26 15:46   ` Jason Cooper
2013-01-26 15:10 ` [PATCH 2/3] ARM: Kirkwood: Revert clkdev changes Andrew Lunn
2013-01-26 19:59   ` Jason Cooper
2013-01-26 15:10 ` [PATCH 3/3] ARM: Kirkwood: Convert QNAP TS219 Ethernet to DT Andrew Lunn
2013-01-26 20:10   ` Jason Cooper

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).