All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH 0/6] ARM: kirkwood: cleanup DT conversion
@ 2013-01-23 23:34 Jason Cooper
  2013-01-23 23:34 ` [RFC PATCH 1/6] ARM: kirkwood: topkick: init mvsdio via DT Jason Cooper
                   ` (9 more replies)
  0 siblings, 10 replies; 102+ messages in thread
From: Jason Cooper @ 2013-01-23 23:34 UTC (permalink / raw)
  To: linux-arm-kernel

All,

This is a first cut at cleaning up mach-kirkwood/.  There are a few DT
conversions (topkick -> mvsdio, pinctrl) which, once reviewed, I'll put in the
normal pull request cycle.

The others which remove board-*.c files, I'll keep updating against
mvebu/for-next, and then apply at the end of the merge window.

Please test as you are able.

thx,

Jason.

Jason Cooper (6):
  ARM: kirkwood: topkick: init mvsdio via DT
  ARM: kirkwood: topkick: convert to pinctrl
  ARM: kirkwood: nsa310: cleanup includes and unneeded code
  ARM: kirkwood: nsa310: convert to pinctrl
  ARM: kirkwood: consolidate DT init of pcie
  ARM: kirkwood: consolidate mv643xx_eth init for DT

 arch/arm/boot/dts/kirkwood-nsa310.dts        |  99 +++++++++++++++++++
 arch/arm/boot/dts/kirkwood-topkick.dts       |  95 ++++++++++++++++++
 arch/arm/mach-kirkwood/Kconfig               | 101 -------------------
 arch/arm/mach-kirkwood/Makefile              |  15 ---
 arch/arm/mach-kirkwood/board-dnskw.c         |   7 --
 arch/arm/mach-kirkwood/board-dockstar.c      |  32 ------
 arch/arm/mach-kirkwood/board-dreamplug.c     |  35 -------
 arch/arm/mach-kirkwood/board-dt.c            | 140 ++++++++++++++++++++-------
 arch/arm/mach-kirkwood/board-goflexnet.c     |  34 -------
 arch/arm/mach-kirkwood/board-ib62x0.c        |  29 ------
 arch/arm/mach-kirkwood/board-iconnect.c      |  32 ------
 arch/arm/mach-kirkwood/board-lsxl.c          |  36 -------
 arch/arm/mach-kirkwood/board-mplcec4.c       |  36 -------
 arch/arm/mach-kirkwood/board-ns2.c           |  34 -------
 arch/arm/mach-kirkwood/board-nsa310.c        |  58 -----------
 arch/arm/mach-kirkwood/board-openblocks_a6.c |  26 -----
 arch/arm/mach-kirkwood/board-ts219.c         |  13 ---
 arch/arm/mach-kirkwood/board-usi_topkick.c   |  77 ---------------
 arch/arm/mach-kirkwood/common.h              |  69 -------------
 19 files changed, 298 insertions(+), 670 deletions(-)
 delete mode 100644 arch/arm/mach-kirkwood/board-dockstar.c
 delete mode 100644 arch/arm/mach-kirkwood/board-dreamplug.c
 delete mode 100644 arch/arm/mach-kirkwood/board-goflexnet.c
 delete mode 100644 arch/arm/mach-kirkwood/board-ib62x0.c
 delete mode 100644 arch/arm/mach-kirkwood/board-iconnect.c
 delete mode 100644 arch/arm/mach-kirkwood/board-lsxl.c
 delete mode 100644 arch/arm/mach-kirkwood/board-mplcec4.c
 delete mode 100644 arch/arm/mach-kirkwood/board-ns2.c
 delete mode 100644 arch/arm/mach-kirkwood/board-nsa310.c
 delete mode 100644 arch/arm/mach-kirkwood/board-openblocks_a6.c
 delete mode 100644 arch/arm/mach-kirkwood/board-usi_topkick.c

-- 
1.8.1.1

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

* [RFC PATCH 1/6] ARM: kirkwood: topkick: init mvsdio via DT
  2013-01-23 23:34 [RFC PATCH 0/6] ARM: kirkwood: cleanup DT conversion Jason Cooper
@ 2013-01-23 23:34 ` Jason Cooper
  2013-01-23 23:34 ` [RFC PATCH 2/6] ARM: kirkwood: topkick: convert to pinctrl Jason Cooper
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 102+ messages in thread
From: Jason Cooper @ 2013-01-23 23:34 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Jason Cooper <jason@lakedaemon.net>
---
 arch/arm/boot/dts/kirkwood-topkick.dts     | 7 +++++++
 arch/arm/mach-kirkwood/board-usi_topkick.c | 6 ------
 2 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/arch/arm/boot/dts/kirkwood-topkick.dts b/arch/arm/boot/dts/kirkwood-topkick.dts
index cd15452..23c2ddc 100644
--- a/arch/arm/boot/dts/kirkwood-topkick.dts
+++ b/arch/arm/boot/dts/kirkwood-topkick.dts
@@ -54,6 +54,13 @@
 			status = "okay";
 			nr-ports = <1>;
 		};
+
+		mvsdio at 90000 {
+			pinctrl-0 = <&pmx_sdio>;
+			pinctrl-names = "default";
+			status = "okay";
+			/* No CD or WP GPIOs */
+		};
 	};
 
 	gpio-leds {
diff --git a/arch/arm/mach-kirkwood/board-usi_topkick.c b/arch/arm/mach-kirkwood/board-usi_topkick.c
index 23d2dd1..95f0711 100644
--- a/arch/arm/mach-kirkwood/board-usi_topkick.c
+++ b/arch/arm/mach-kirkwood/board-usi_topkick.c
@@ -14,7 +14,6 @@
 #include <linux/init.h>
 #include <linux/mv643xx_eth.h>
 #include <linux/gpio.h>
-#include <linux/platform_data/mmc-mvsdio.h>
 #include "common.h"
 #include "mpp.h"
 
@@ -22,10 +21,6 @@ static struct mv643xx_eth_platform_data topkick_ge00_data = {
 	.phy_addr	= MV643XX_ETH_PHY_ADDR(0),
 };
 
-static struct mvsdio_platform_data topkick_mvsdio_data = {
-	/* unfortunately the CD signal has not been connected */
-};
-
 /*
  * GPIO LED layout
  *
@@ -73,5 +68,4 @@ void __init usi_topkick_init(void)
 
 
 	kirkwood_ge00_init(&topkick_ge00_data);
-	kirkwood_sdio_init(&topkick_mvsdio_data);
 }
-- 
1.8.1.1

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

* [RFC PATCH 2/6] ARM: kirkwood: topkick: convert to pinctrl
  2013-01-23 23:34 [RFC PATCH 0/6] ARM: kirkwood: cleanup DT conversion Jason Cooper
  2013-01-23 23:34 ` [RFC PATCH 1/6] ARM: kirkwood: topkick: init mvsdio via DT Jason Cooper
@ 2013-01-23 23:34 ` Jason Cooper
  2013-01-23 23:34 ` [RFC PATCH 3/6] ARM: kirkwood: nsa310: cleanup includes and unneeded code Jason Cooper
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 102+ messages in thread
From: Jason Cooper @ 2013-01-23 23:34 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Jason Cooper <jason@lakedaemon.net>
---
 arch/arm/boot/dts/kirkwood-topkick.dts     | 88 ++++++++++++++++++++++++++++++
 arch/arm/mach-kirkwood/board-usi_topkick.c | 42 --------------
 2 files changed, 88 insertions(+), 42 deletions(-)

diff --git a/arch/arm/boot/dts/kirkwood-topkick.dts b/arch/arm/boot/dts/kirkwood-topkick.dts
index 23c2ddc..d959873 100644
--- a/arch/arm/boot/dts/kirkwood-topkick.dts
+++ b/arch/arm/boot/dts/kirkwood-topkick.dts
@@ -1,6 +1,7 @@
 /dts-v1/;
 
 /include/ "kirkwood.dtsi"
+/include/ "kirkwood-6281.dtsi"
 
 / {
 	model = "Univeral Scientific Industrial Co. Topkick-1281P2";
@@ -16,6 +17,93 @@
 	};
 
 	ocp at f1000000 {
+		pinctrl: pinctrl at 10000 {
+			/*
+			 * GPIO LED layout
+			 *
+			 *       /-SYS_LED(2)
+			 *       |
+			 *       |   /-DISK_LED
+			 *       |   |
+			 *       |   |   /-WLAN_LED(2)
+			 *       |   |   |
+			 * [SW] [*] [*] [*]
+			 */
+
+			/*
+			 * Switch positions
+			 *
+			 *     /-SW_LEFT(2)
+			 *     |
+			 *     |   /-SW_IDLE
+			 *     |   |
+			 *     |   |   /-SW_RIGHT
+			 *     |   |   |
+			 * PS [L] [I] [R] LEDS
+			 */
+			pinctrl-0 = < &pmx_led_disk_yellow
+				      &pmx_sata0_pwr_enable
+				      &pmx_led_sys_red
+				      &pmx_led_sys_blue
+				      &pmx_led_wifi_green
+				      &pmx_sw_left
+				      &pmx_sw_right
+				      &pmx_sw_idle
+				      &pmx_sw_left2
+				      &pmx_led_wifi_yellow >;
+			pinctrl-names = "default";
+
+			pmx_led_disk_yellow: pmx-led-disk-yellow {
+				marvell,pins = "mpp21";
+				marvell,function = "gpio";
+			};
+
+			pmx_sata0_pwr_enable: pmx-sata0-pwr-enable {
+				marvell,pins = "mpp36";
+				marvell,function = "gpio";
+			};
+
+			pmx_led_sys_red: pmx-led-sys-red {
+				marvell,pins = "mpp37";
+				marvell,function = "gpio";
+			};
+
+			pmx_led_sys_blue: pmx-led-sys-blue {
+				marvell,pins = "mpp38";
+				marvell,function = "gpio";
+			};
+
+			pmx_led_wifi_green: pmx-led-wifi-green {
+				marvell,pins = "mpp39";
+				marvell,function = "gpio";
+			};
+
+			pmx_sw_left: pmx-sw-left {
+				marvell,pins = "mpp43";
+				marvell,function = "gpio";
+			};
+
+			pmx_sw_right: pmx-sw-right {
+				marvell,pins = "mpp44";
+				marvell,function = "gpio";
+			};
+
+			pmx_sw_idle: pmx-sw-idle {
+				marvell,pins = "mpp45";
+				marvell,function = "gpio";
+			};
+
+			pmx_sw_left2: pmx-sw-left2 {
+				marvell,pins = "mpp46";
+				marvell,function = "gpio";
+			};
+
+			pmx_led_wifi_yellow: pmx-led-wifi-yellow {
+				marvell,pins = "mpp48";
+				marvell,function = "gpio";
+			};
+		};
+
 		serial at 12000 {
 			clock-frequency = <200000000>;
 			status = "ok";
diff --git a/arch/arm/mach-kirkwood/board-usi_topkick.c b/arch/arm/mach-kirkwood/board-usi_topkick.c
index 95f0711..1cc04ec 100644
--- a/arch/arm/mach-kirkwood/board-usi_topkick.c
+++ b/arch/arm/mach-kirkwood/board-usi_topkick.c
@@ -15,57 +15,15 @@
 #include <linux/mv643xx_eth.h>
 #include <linux/gpio.h>
 #include "common.h"
-#include "mpp.h"
 
 static struct mv643xx_eth_platform_data topkick_ge00_data = {
 	.phy_addr	= MV643XX_ETH_PHY_ADDR(0),
 };
 
-/*
- * GPIO LED layout
- *
- *       /-SYS_LED(2)
- *       |
- *       |   /-DISK_LED
- *       |   |
- *       |   |   /-WLAN_LED(2)
- *       |   |   |
- * [SW] [*] [*] [*]
- */
-
-/*
- * Switch positions
- *
- *     /-SW_LEFT
- *     |
- *     |   /-SW_IDLE
- *     |   |
- *     |   |   /-SW_RIGHT
- *     |   |   |
- * PS [L] [I] [R] LEDS
- */
-
-static unsigned int topkick_mpp_config[] __initdata = {
-	MPP21_GPIO,	/* DISK_LED           (low active) - yellow */
-	MPP36_GPIO,	/* SATA0 power enable (high active) */
-	MPP37_GPIO,	/* SYS_LED2           (low active) - red */
-	MPP38_GPIO,	/* SYS_LED            (low active) - blue */
-	MPP39_GPIO,	/* WLAN_LED           (low active) - green */
-	MPP43_GPIO,	/* SW_LEFT            (low active) */
-	MPP44_GPIO,     /* SW_RIGHT           (low active) */
-	MPP45_GPIO,	/* SW_IDLE            (low active) */
-	MPP46_GPIO,     /* SW_LEFT            (low active) */
-	MPP48_GPIO,	/* WLAN_LED2          (low active) - yellow */
-	0
-};
-
 void __init usi_topkick_init(void)
 {
 	/*
 	 * Basic setup. Needs to be called early.
 	 */
-	kirkwood_mpp_conf(topkick_mpp_config);
-
-
 	kirkwood_ge00_init(&topkick_ge00_data);
 }
-- 
1.8.1.1

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

* [RFC PATCH 3/6] ARM: kirkwood: nsa310: cleanup includes and unneeded code
  2013-01-23 23:34 [RFC PATCH 0/6] ARM: kirkwood: cleanup DT conversion Jason Cooper
  2013-01-23 23:34 ` [RFC PATCH 1/6] ARM: kirkwood: topkick: init mvsdio via DT Jason Cooper
  2013-01-23 23:34 ` [RFC PATCH 2/6] ARM: kirkwood: topkick: convert to pinctrl Jason Cooper
@ 2013-01-23 23:34 ` Jason Cooper
  2013-01-24  5:50   ` Andrew Lunn
  2013-01-23 23:34 ` [RFC PATCH 4/6] ARM: kirkwood: nsa310: convert to pinctrl Jason Cooper
                   ` (6 subsequent siblings)
  9 siblings, 1 reply; 102+ messages in thread
From: Jason Cooper @ 2013-01-23 23:34 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Jason Cooper <jason@lakedaemon.net>
---
 arch/arm/mach-kirkwood/board-nsa310.c | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/arch/arm/mach-kirkwood/board-nsa310.c b/arch/arm/mach-kirkwood/board-nsa310.c
index 1bd328d..0b99533 100644
--- a/arch/arm/mach-kirkwood/board-nsa310.c
+++ b/arch/arm/mach-kirkwood/board-nsa310.c
@@ -10,11 +10,8 @@
 
 #include <linux/kernel.h>
 #include <linux/init.h>
-#include <linux/i2c.h>
-
-#include <asm/mach-types.h>
-#include <asm/mach/arch.h>
 #include <mach/kirkwood.h>
+#include <linux/of.h>
 #include "common.h"
 #include "mpp.h"
 
@@ -40,11 +37,7 @@ static unsigned int nsa310_mpp_config[] __initdata = {
 
 void __init nsa310_init(void)
 {
-	u32 dev, rev;
-
 	kirkwood_mpp_conf(nsa310_mpp_config);
-
-	kirkwood_pcie_id(&dev, &rev);
 }
 
 static int __init nsa310_pci_init(void)
-- 
1.8.1.1

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

* [RFC PATCH 4/6] ARM: kirkwood: nsa310: convert to pinctrl
  2013-01-23 23:34 [RFC PATCH 0/6] ARM: kirkwood: cleanup DT conversion Jason Cooper
                   ` (2 preceding siblings ...)
  2013-01-23 23:34 ` [RFC PATCH 3/6] ARM: kirkwood: nsa310: cleanup includes and unneeded code Jason Cooper
@ 2013-01-23 23:34 ` Jason Cooper
  2013-01-23 23:34 ` [RFC PATCH 5/6] ARM: kirkwood: consolidate DT init of pcie Jason Cooper
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 102+ messages in thread
From: Jason Cooper @ 2013-01-23 23:34 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Jason Cooper <jason@lakedaemon.net>
---
 arch/arm/boot/dts/kirkwood-nsa310.dts | 99 +++++++++++++++++++++++++++++++++++
 arch/arm/mach-kirkwood/board-dt.c     |  3 --
 arch/arm/mach-kirkwood/board-nsa310.c | 26 ---------
 arch/arm/mach-kirkwood/common.h       |  6 ---
 4 files changed, 99 insertions(+), 35 deletions(-)

diff --git a/arch/arm/boot/dts/kirkwood-nsa310.dts b/arch/arm/boot/dts/kirkwood-nsa310.dts
index dbb3551..3a178cf 100644
--- a/arch/arm/boot/dts/kirkwood-nsa310.dts
+++ b/arch/arm/boot/dts/kirkwood-nsa310.dts
@@ -16,6 +16,105 @@
 	};
 
 	ocp at f1000000 {
+		pinctrl: pinctrl at 10000 {
+			pinctrl-0 = < &pmx_led_esata_green
+				      &pmx_led_esata_red
+				      &pmx_led_usb_green
+				      &pmx_led_usb_red
+				      &pmx_usb_power_off
+				      &pmx_led_sys_green
+				      &pmx_led_sys_red
+				      &pmx_btn_reset
+				      &pmx_btn_copy
+				      &pmx_led_copy_green
+				      &pmx_led_copy_red
+				      &pmx_led_hdd_green
+				      &pmx_led_hdd_red
+				      &pmx_unknown
+				      &pmx_btn_power
+				      &pmx_pwr_off >;
+			pinctrl-names = "default";
+
+			pmx_led_esata_green: pmx-led-esata-green {
+				marvell,pins = "mpp12";
+				marvell,function = "gpio";
+			};
+
+			pmx_led_esata_red: pmx-led-esata-red {
+				marvell,pins = "mpp13";
+				marvell,function = "gpio";
+			};
+
+			pmx_led_usb_green: pmx-led-usb-green {
+				marvell,pins = "mpp15";
+				marvell,function = "gpio";
+			};
+
+			pmx_led_usb_red: pmx-led-usb-red {
+				marvell,pins = "mpp16";
+				marvell,function = "gpio";
+			};
+
+			pmx_usb_power_off: pmx-usb-power-off {
+				marvell,pins = "mpp21";
+				marvell,function = "gpio";
+			};
+
+			pmx_led_sys_green: pmx-led-sys-green {
+				marvell,pins = "mpp28";
+				marvell,function = "gpio";
+			};
+
+			pmx_led_sys_red: pmx-led-sys-red {
+				marvell,pins = "mpp29";
+				marvell,function = "gpio";
+			};
+
+			pmx_btn_reset: pmx-btn-reset {
+				marvell,pins = "mpp36";
+				marvell,function = "gpio";
+			};
+
+			pmx_btn_copy: pmx-btn-copy {
+				marvell,pins = "mpp37";
+				marvell,function = "gpio";
+			};
+
+			pmx_led_copy_green: pmx-led-copy-green {
+				marvell,pins = "mpp39";
+				marvell,function = "gpio";
+			};
+
+			pmx_led_copy_red: pmx-led-copy-red {
+				marvell,pins = "mpp40";
+				marvell,function = "gpio";
+			};
+
+			pmx_led_hdd_green: pmx-led-hdd-green {
+				marvell,pins = "mpp41";
+				marvell,function = "gpio";
+			};
+
+			pmx_led_hdd_red: pmx-led-hdd-red {
+				marvell,pins = "mpp42";
+				marvell,function = "gpio";
+			};
+
+			pmx_unknown: pmx-unknown {
+				marvell,pins = "mpp44";
+				marvell,function = "gpio";
+			};
+
+			pmx_btn_power: pmx-btn-power {
+				marvell,pins = "mpp46";
+				marvell,function = "gpio";
+			};
+
+			pmx_pwr_off: pmx-pwr-off {
+				marvell,pins = "mpp48";
+				marvell,function = "gpio";
+			};
+		};
 
 		serial at 12000 {
 			clock-frequency = <200000000>;
diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c
index 8eac548..8b35157 100644
--- a/arch/arm/mach-kirkwood/board-dt.c
+++ b/arch/arm/mach-kirkwood/board-dt.c
@@ -141,9 +141,6 @@ static void __init kirkwood_dt_init(void)
 	if (of_machine_is_compatible("usi,topkick"))
 		usi_topkick_init();
 
-	if (of_machine_is_compatible("zyxel,nsa310"))
-		nsa310_init();
-
 	of_platform_populate(NULL, kirkwood_dt_match_table, NULL, NULL);
 }
 
diff --git a/arch/arm/mach-kirkwood/board-nsa310.c b/arch/arm/mach-kirkwood/board-nsa310.c
index 0b99533..55ade93 100644
--- a/arch/arm/mach-kirkwood/board-nsa310.c
+++ b/arch/arm/mach-kirkwood/board-nsa310.c
@@ -13,32 +13,6 @@
 #include <mach/kirkwood.h>
 #include <linux/of.h>
 #include "common.h"
-#include "mpp.h"
-
-static unsigned int nsa310_mpp_config[] __initdata = {
-	MPP12_GPIO, /* led esata green */
-	MPP13_GPIO, /* led esata red */
-	MPP15_GPIO, /* led usb green */
-	MPP16_GPIO, /* led usb red */
-	MPP21_GPIO, /* control usb power off */
-	MPP28_GPIO, /* led sys green */
-	MPP29_GPIO, /* led sys red */
-	MPP36_GPIO, /* key reset */
-	MPP37_GPIO, /* key copy */
-	MPP39_GPIO, /* led copy green */
-	MPP40_GPIO, /* led copy red */
-	MPP41_GPIO, /* led hdd green */
-	MPP42_GPIO, /* led hdd red */
-	MPP44_GPIO, /* ?? */
-	MPP46_GPIO, /* key power */
-	MPP48_GPIO, /* control power off */
-	0
-};
-
-void __init nsa310_init(void)
-{
-	kirkwood_mpp_conf(nsa310_mpp_config);
-}
 
 static int __init nsa310_pci_init(void)
 {
diff --git a/arch/arm/mach-kirkwood/common.h b/arch/arm/mach-kirkwood/common.h
index e956d02..1c42cb8 100644
--- a/arch/arm/mach-kirkwood/common.h
+++ b/arch/arm/mach-kirkwood/common.h
@@ -130,12 +130,6 @@ void ns2_init(void);
 static inline void ns2_init(void) {};
 #endif
 
-#ifdef CONFIG_MACH_NSA310_DT
-void nsa310_init(void);
-#else
-static inline void nsa310_init(void) {};
-#endif
-
 #ifdef CONFIG_MACH_OPENBLOCKS_A6_DT
 void openblocks_a6_init(void);
 #else
-- 
1.8.1.1

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

* [RFC PATCH 5/6] ARM: kirkwood: consolidate DT init of pcie
  2013-01-23 23:34 [RFC PATCH 0/6] ARM: kirkwood: cleanup DT conversion Jason Cooper
                   ` (3 preceding siblings ...)
  2013-01-23 23:34 ` [RFC PATCH 4/6] ARM: kirkwood: nsa310: convert to pinctrl Jason Cooper
@ 2013-01-23 23:34 ` Jason Cooper
  2013-01-23 23:34 ` [RFC PATCH 6/6] ARM: kirkwood: consolidate mv643xx_eth init for DT Jason Cooper
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 102+ messages in thread
From: Jason Cooper @ 2013-01-23 23:34 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Jason Cooper <jason@lakedaemon.net>
---
 arch/arm/mach-kirkwood/Makefile         |  1 -
 arch/arm/mach-kirkwood/board-dt.c       | 23 +++++++++++++++++++++++
 arch/arm/mach-kirkwood/board-iconnect.c |  9 ---------
 arch/arm/mach-kirkwood/board-mplcec4.c  |  1 -
 arch/arm/mach-kirkwood/board-nsa310.c   | 25 -------------------------
 arch/arm/mach-kirkwood/board-ts219.c    | 13 -------------
 6 files changed, 23 insertions(+), 49 deletions(-)
 delete mode 100644 arch/arm/mach-kirkwood/board-nsa310.c

diff --git a/arch/arm/mach-kirkwood/Makefile b/arch/arm/mach-kirkwood/Makefile
index d665309..ee3aa77 100644
--- a/arch/arm/mach-kirkwood/Makefile
+++ b/arch/arm/mach-kirkwood/Makefile
@@ -36,6 +36,5 @@ obj-$(CONFIG_MACH_NETSPACE_V2_DT)	+= board-ns2.o
 obj-$(CONFIG_MACH_NETSPACE_MAX_V2_DT)	+= board-ns2.o
 obj-$(CONFIG_MACH_NETSPACE_LITE_V2_DT)	+= board-ns2.o
 obj-$(CONFIG_MACH_NETSPACE_MINI_V2_DT)	+= board-ns2.o
-obj-$(CONFIG_MACH_NSA310_DT)		+= board-nsa310.o
 obj-$(CONFIG_MACH_OPENBLOCKS_A6_DT)	+= board-openblocks_a6.o
 obj-$(CONFIG_MACH_TOPKICK_DT)		+= board-usi_topkick.o
diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c
index 8b35157..73b76e4 100644
--- a/arch/arm/mach-kirkwood/board-dt.c
+++ b/arch/arm/mach-kirkwood/board-dt.c
@@ -70,6 +70,29 @@ static void __init kirkwood_of_clk_init(void)
 	kirkwood_legacy_clk_init();
 }
 
+static const char * const kirkwood_dt_pcie0_compat[] = {
+	"iom,iconnect",
+	"mpl,cec4",
+	"qnap,ts219",
+	"zyxel,nsa310",
+	NULL
+};
+
+static int __init kirkwood_pcie_dt_init(void)
+{
+	int i;
+
+	for (i = 0; kirkwood_dt_pcie0_compat[i] != NULL; i++) {
+		if (of_machine_is_compatible(kirkwood_dt_pcie0_compat[i])) {
+			kirkwood_pcie_init(KW_PCIE0);
+			break;
+		}
+	}
+
+	return 0;
+}
+subsys_initcall(kirkwood_pcie_dt_init);
+
 static void __init kirkwood_dt_init(void)
 {
 	pr_info("Kirkwood: %s, TCLK=%d.\n", kirkwood_id(), kirkwood_tclk);
diff --git a/arch/arm/mach-kirkwood/board-iconnect.c b/arch/arm/mach-kirkwood/board-iconnect.c
index c8ebde4..ff042dc 100644
--- a/arch/arm/mach-kirkwood/board-iconnect.c
+++ b/arch/arm/mach-kirkwood/board-iconnect.c
@@ -10,7 +10,6 @@
 
 #include <linux/kernel.h>
 #include <linux/init.h>
-#include <linux/of.h>
 #include <linux/mv643xx_eth.h>
 #include "common.h"
 
@@ -22,11 +21,3 @@ void __init iconnect_init(void)
 {
 	kirkwood_ge00_init(&iconnect_ge00_data);
 }
-
-static int __init iconnect_pci_init(void)
-{
-	if (of_machine_is_compatible("iom,iconnect"))
-		kirkwood_pcie_init(KW_PCIE0);
-	return 0;
-}
-subsys_initcall(iconnect_pci_init);
diff --git a/arch/arm/mach-kirkwood/board-mplcec4.c b/arch/arm/mach-kirkwood/board-mplcec4.c
index 7d6dc66..938712e 100644
--- a/arch/arm/mach-kirkwood/board-mplcec4.c
+++ b/arch/arm/mach-kirkwood/board-mplcec4.c
@@ -29,7 +29,6 @@ void __init mplcec4_init(void)
 	 */
 	kirkwood_ge00_init(&mplcec4_ge00_data);
 	kirkwood_ge01_init(&mplcec4_ge01_data);
-	kirkwood_pcie_init(KW_PCIE0);
 }
 
 
diff --git a/arch/arm/mach-kirkwood/board-nsa310.c b/arch/arm/mach-kirkwood/board-nsa310.c
deleted file mode 100644
index 55ade93..0000000
--- a/arch/arm/mach-kirkwood/board-nsa310.c
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * arch/arm/mach-kirkwood/nsa-310-setup.c
- *
- * ZyXEL NSA-310 Setup
- *
- * 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 <mach/kirkwood.h>
-#include <linux/of.h>
-#include "common.h"
-
-static int __init nsa310_pci_init(void)
-{
-	if (of_machine_is_compatible("zyxel,nsa310"))
-		kirkwood_pcie_init(KW_PCIE0);
-
-	return 0;
-}
-
-subsys_initcall(nsa310_pci_init);
diff --git a/arch/arm/mach-kirkwood/board-ts219.c b/arch/arm/mach-kirkwood/board-ts219.c
index 10fb397..f00c0a9 100644
--- a/arch/arm/mach-kirkwood/board-ts219.c
+++ b/arch/arm/mach-kirkwood/board-ts219.c
@@ -17,10 +17,7 @@
 
 #include <linux/kernel.h>
 #include <linux/init.h>
-#include <linux/platform_device.h>
 #include <linux/mv643xx_eth.h>
-#include <asm/mach-types.h>
-#include <asm/mach/arch.h>
 #include <mach/kirkwood.h>
 #include "common.h"
 
@@ -38,13 +35,3 @@ void __init qnap_dt_ts219_init(void)
 
 	kirkwood_ge00_init(&qnap_ts219_ge00_data);
 }
-
-/* FIXME: Will not work with DT. Maybe use MPP40_GPIO? */
-static int __init ts219_pci_init(void)
-{
-	if (machine_is_ts219())
-		kirkwood_pcie_init(KW_PCIE0);
-
-	return 0;
-}
-subsys_initcall(ts219_pci_init);
-- 
1.8.1.1

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

* [RFC PATCH 6/6] ARM: kirkwood: consolidate mv643xx_eth init for DT
  2013-01-23 23:34 [RFC PATCH 0/6] ARM: kirkwood: cleanup DT conversion Jason Cooper
                   ` (4 preceding siblings ...)
  2013-01-23 23:34 ` [RFC PATCH 5/6] ARM: kirkwood: consolidate DT init of pcie Jason Cooper
@ 2013-01-23 23:34 ` Jason Cooper
  2013-01-24  1:39   ` Jason Cooper
  2013-01-24 13:37   ` Florian Fainelli
  2013-01-24  1:33 ` [RFC PATCH 0/6] ARM: kirkwood: cleanup DT conversion Jason Cooper
                   ` (3 subsequent siblings)
  9 siblings, 2 replies; 102+ messages in thread
From: Jason Cooper @ 2013-01-23 23:34 UTC (permalink / raw)
  To: linux-arm-kernel

replace a lot of unneeded code and files with a lookup table.

Signed-off-by: Jason Cooper <jason@lakedaemon.net>
---
 arch/arm/mach-kirkwood/Kconfig               | 101 ------------------------
 arch/arm/mach-kirkwood/Makefile              |  14 ----
 arch/arm/mach-kirkwood/board-dnskw.c         |   7 --
 arch/arm/mach-kirkwood/board-dockstar.c      |  32 --------
 arch/arm/mach-kirkwood/board-dreamplug.c     |  35 --------
 arch/arm/mach-kirkwood/board-dt.c            | 114 +++++++++++++++++++--------
 arch/arm/mach-kirkwood/board-goflexnet.c     |  34 --------
 arch/arm/mach-kirkwood/board-ib62x0.c        |  29 -------
 arch/arm/mach-kirkwood/board-iconnect.c      |  23 ------
 arch/arm/mach-kirkwood/board-lsxl.c          |  36 ---------
 arch/arm/mach-kirkwood/board-mplcec4.c       |  35 --------
 arch/arm/mach-kirkwood/board-ns2.c           |  34 --------
 arch/arm/mach-kirkwood/board-openblocks_a6.c |  26 ------
 arch/arm/mach-kirkwood/board-usi_topkick.c   |  29 -------
 arch/arm/mach-kirkwood/common.h              |  63 ---------------
 15 files changed, 81 insertions(+), 531 deletions(-)
 delete mode 100644 arch/arm/mach-kirkwood/board-dockstar.c
 delete mode 100644 arch/arm/mach-kirkwood/board-dreamplug.c
 delete mode 100644 arch/arm/mach-kirkwood/board-goflexnet.c
 delete mode 100644 arch/arm/mach-kirkwood/board-ib62x0.c
 delete mode 100644 arch/arm/mach-kirkwood/board-iconnect.c
 delete mode 100644 arch/arm/mach-kirkwood/board-lsxl.c
 delete mode 100644 arch/arm/mach-kirkwood/board-mplcec4.c
 delete mode 100644 arch/arm/mach-kirkwood/board-ns2.c
 delete mode 100644 arch/arm/mach-kirkwood/board-openblocks_a6.c
 delete mode 100644 arch/arm/mach-kirkwood/board-usi_topkick.c

diff --git a/arch/arm/mach-kirkwood/Kconfig b/arch/arm/mach-kirkwood/Kconfig
index 432bee0..188651b 100644
--- a/arch/arm/mach-kirkwood/Kconfig
+++ b/arch/arm/mach-kirkwood/Kconfig
@@ -58,19 +58,6 @@ config ARCH_KIRKWOOD_DT
 	  Say 'Y' here if you want your kernel to support the
 	  Marvell Kirkwood using flattened device tree.
 
-config MACH_DREAMPLUG_DT
-	bool "Marvell DreamPlug (Flattened Device Tree)"
-	select ARCH_KIRKWOOD_DT
-	help
-	  Say 'Y' here if you want your kernel to support the
-	  Marvell DreamPlug (Flattened Device Tree).
-
-config MACH_ICONNECT_DT
-	bool "Iomega Iconnect (Flattened Device Tree)"
-	select ARCH_KIRKWOOD_DT
-	help
-	  Say 'Y' here to enable Iomega Iconnect support.
-
 config MACH_DLINK_KIRKWOOD_DT
 	bool "D-Link Kirkwood-based NAS (Flattened Device Tree)"
 	select ARCH_KIRKWOOD_DT
@@ -79,14 +66,6 @@ config MACH_DLINK_KIRKWOOD_DT
 	  Kirkwood-based D-Link NASes such as DNS-320 & DNS-325,
 	  using Flattened Device Tree.
 
-config MACH_IB62X0_DT
-	bool "RaidSonic IB-NAS6210, IB-NAS6220 (Flattened Device Tree)"
-	select ARCH_KIRKWOOD_DT
-	help
-	  Say 'Y' here if you want your kernel to support the
-	  RaidSonic IB-NAS6210 & IB-NAS6220 devices, using
-	  Flattened Device Tree.
-
 config MACH_TS219_DT
 	bool "Device Tree for QNAP TS-11X, TS-21X NAS"
 	select ARCH_KIRKWOOD_DT
@@ -102,29 +81,6 @@ config MACH_TS219_DT
 	  or MV6282. If you have the wrong one, the buttons will not
 	  work.
 
-config MACH_DOCKSTAR_DT
-	bool "Seagate FreeAgent Dockstar (Flattened Device Tree)"
-	select ARCH_KIRKWOOD_DT
-	help
-	  Say 'Y' here if you want your kernel to support the
-	  Seagate FreeAgent Dockstar (Flattened Device Tree).
-
-config MACH_GOFLEXNET_DT
-	bool "Seagate GoFlex Net (Flattened Device Tree)"
-	select ARCH_KIRKWOOD_DT
-	help
-	  Say 'Y' here if you want your kernel to support the
-	  Seagate GoFlex Net (Flattened Device Tree).
-
-config MACH_LSXL_DT
-	bool "Buffalo Linkstation LS-XHL, LS-CHLv2 (Flattened Device Tree)"
-	select ARCH_KIRKWOOD_DT
-	select POWER_RESET_RESTART
-	help
-	  Say 'Y' here if you want your kernel to support the
-	  Buffalo Linkstation LS-XHL & LS-CHLv2 devices, using
-	  Flattened Device Tree.
-
 config MACH_IOMEGA_IX2_200_DT
 	bool "Iomega StorCenter ix2-200 (Flattened Device Tree)"
 	select ARCH_KIRKWOOD_DT
@@ -139,63 +95,6 @@ config MACH_KM_KIRKWOOD_DT
 	  Say 'Y' here if you want your kernel to support the
 	  Keymile Kirkwood Reference Desgin, using Flattened Device Tree.
 
-config MACH_INETSPACE_V2_DT
-	bool "LaCie Internet Space v2 NAS (Flattened Device Tree)"
-	select ARCH_KIRKWOOD_DT
-	help
-	  Say 'Y' here if you want your kernel to support the LaCie
-	  Internet Space v2 NAS, using Flattened Device Tree.
-
-config MACH_MPLCEC4_DT
-	bool "MPL CEC4 (Flattened Device Tree)"
-	select ARCH_KIRKWOOD_DT
-	help
-	  Say 'Y' here if you want your kernel to support the
-	  MPL CEC4 (Flattened Device Tree).
-
-config MACH_NETSPACE_V2_DT
-	bool "LaCie Network Space v2 NAS (Flattened Device Tree)"
-	select ARCH_KIRKWOOD_DT
-	help
-	  Say 'Y' here if you want your kernel to support the LaCie
-	  Network Space v2 NAS, using Flattened Device Tree.
-
-config MACH_NETSPACE_MAX_V2_DT
-	bool "LaCie Network Space Max v2 NAS (Flattened Device Tree)"
-	select ARCH_KIRKWOOD_DT
-	help
-	  Say 'Y' here if you want your kernel to support the LaCie
-	  Network Space Max v2 NAS, using Flattened Device Tree.
-
-config MACH_NETSPACE_LITE_V2_DT
-	bool "LaCie Network Space Lite v2 NAS (Flattened Device Tree)"
-	select ARCH_KIRKWOOD_DT
-	help
-	  Say 'Y' here if you want your kernel to support the LaCie
-	  Network Space Lite v2 NAS, using Flattened Device Tree.
-
-config MACH_NETSPACE_MINI_V2_DT
-	bool "LaCie Network Space Mini v2 NAS (Flattened Device Tree)"
-	select ARCH_KIRKWOOD_DT
-	help
-	  Say 'Y' here if you want your kernel to support the LaCie
-	  Network Space Mini v2 NAS (aka SafeBox), using Flattened
-	  Device Tree.
-
-config MACH_OPENBLOCKS_A6_DT
-	bool "Plat'Home OpenBlocks A6 (Flattened Device Tree)"
-	select ARCH_KIRKWOOD_DT
-	help
-	  Say 'Y' here if you want your kernel to support the
-	  Plat'Home OpenBlocks A6 (Flattened Device Tree).
-
-config MACH_TOPKICK_DT
-	bool "USI Topkick (Flattened Device Tree)"
-	select ARCH_KIRKWOOD_DT
-	help
-	  Say 'Y' here if you want your kernel to support the
-	  USI Topkick, using Flattened Device Tree
-
 config MACH_TS219
 	bool "QNAP TS-110, TS-119, TS-119P+, TS-210, TS-219, TS-219P and TS-219P+ Turbo NAS"
 	help
diff --git a/arch/arm/mach-kirkwood/Makefile b/arch/arm/mach-kirkwood/Makefile
index ee3aa77..ab739b0 100644
--- a/arch/arm/mach-kirkwood/Makefile
+++ b/arch/arm/mach-kirkwood/Makefile
@@ -20,21 +20,7 @@ obj-$(CONFIG_MACH_NET5BIG_V2)		+= netxbig_v2-setup.o lacie_v2-common.o
 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_ICONNECT_DT)		+= board-iconnect.o
 obj-$(CONFIG_MACH_DLINK_KIRKWOOD_DT)	+= board-dnskw.o
-obj-$(CONFIG_MACH_IB62X0_DT)		+= board-ib62x0.o
 obj-$(CONFIG_MACH_TS219_DT)		+= board-ts219.o tsx1x-common.o
-obj-$(CONFIG_MACH_DOCKSTAR_DT)		+= board-dockstar.o
-obj-$(CONFIG_MACH_GOFLEXNET_DT)		+= board-goflexnet.o
-obj-$(CONFIG_MACH_LSXL_DT)		+= board-lsxl.o
 obj-$(CONFIG_MACH_IOMEGA_IX2_200_DT)	+= board-iomega_ix2_200.o
 obj-$(CONFIG_MACH_KM_KIRKWOOD_DT)	+= board-km_kirkwood.o
-obj-$(CONFIG_MACH_INETSPACE_V2_DT)	+= board-ns2.o
-obj-$(CONFIG_MACH_MPLCEC4_DT)		+= board-mplcec4.o
-obj-$(CONFIG_MACH_NETSPACE_V2_DT)	+= board-ns2.o
-obj-$(CONFIG_MACH_NETSPACE_MAX_V2_DT)	+= board-ns2.o
-obj-$(CONFIG_MACH_NETSPACE_LITE_V2_DT)	+= board-ns2.o
-obj-$(CONFIG_MACH_NETSPACE_MINI_V2_DT)	+= board-ns2.o
-obj-$(CONFIG_MACH_OPENBLOCKS_A6_DT)	+= board-openblocks_a6.o
-obj-$(CONFIG_MACH_TOPKICK_DT)		+= board-usi_topkick.o
diff --git a/arch/arm/mach-kirkwood/board-dnskw.c b/arch/arm/mach-kirkwood/board-dnskw.c
index a1aa87f..2af7a95 100644
--- a/arch/arm/mach-kirkwood/board-dnskw.c
+++ b/arch/arm/mach-kirkwood/board-dnskw.c
@@ -14,14 +14,9 @@
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/platform_device.h>
-#include <linux/mv643xx_eth.h>
 #include <linux/gpio.h>
 #include "common.h"
 
-static struct mv643xx_eth_platform_data dnskw_ge00_data = {
-	.phy_addr	= MV643XX_ETH_PHY_ADDR(8),
-};
-
 /* Register any GPIO for output and set the value */
 static void __init dnskw_gpio_register(unsigned gpio, char *name, int def)
 {
@@ -36,8 +31,6 @@ static void __init dnskw_gpio_register(unsigned gpio, char *name, int def)
 
 void __init dnskw_init(void)
 {
-	kirkwood_ge00_init(&dnskw_ge00_data);
-
 	/* Set NAS to turn back on after a power failure */
 	dnskw_gpio_register(37, "dnskw:power:recover", 1);
 }
diff --git a/arch/arm/mach-kirkwood/board-dockstar.c b/arch/arm/mach-kirkwood/board-dockstar.c
deleted file mode 100644
index d7196db..0000000
--- a/arch/arm/mach-kirkwood/board-dockstar.c
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * arch/arm/mach-kirkwood/board-dockstar.c
- *
- * Seagate FreeAgent Dockstar 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.
- *
- * Copied and modified for Seagate GoFlex Net support by
- * Joshua Coombs <josh.coombs@gmail.com> based on ArchLinux ARM's
- * GoFlex kernel patches.
- *
- */
-
-#include <linux/kernel.h>
-#include <linux/init.h>
-#include <linux/mv643xx_eth.h>
-#include "common.h"
-
-static struct mv643xx_eth_platform_data dockstar_ge00_data = {
-	.phy_addr	= MV643XX_ETH_PHY_ADDR(0),
-};
-
-void __init dockstar_dt_init(void)
-{
-	/*
-	 * Basic setup. Needs to be called early.
-	 */
-	kirkwood_ge00_init(&dockstar_ge00_data);
-}
diff --git a/arch/arm/mach-kirkwood/board-dreamplug.c b/arch/arm/mach-kirkwood/board-dreamplug.c
deleted file mode 100644
index 0903242..0000000
--- a/arch/arm/mach-kirkwood/board-dreamplug.c
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright 2012 (C), Jason Cooper <jason@lakedaemon.net>
- *
- * arch/arm/mach-kirkwood/board-dreamplug.c
- *
- * Marvell DreamPlug 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 <linux/gpio.h>
-#include "common.h"
-
-static struct mv643xx_eth_platform_data dreamplug_ge00_data = {
-	.phy_addr	= MV643XX_ETH_PHY_ADDR(0),
-};
-
-static struct mv643xx_eth_platform_data dreamplug_ge01_data = {
-	.phy_addr	= MV643XX_ETH_PHY_ADDR(1),
-};
-
-void __init dreamplug_init(void)
-{
-	/*
-	 * Basic setup. Needs to be called early.
-	 */
-	kirkwood_ge00_init(&dreamplug_ge00_data);
-	kirkwood_ge01_init(&dreamplug_ge01_data);
-}
diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c
index 73b76e4..f5bd640 100644
--- a/arch/arm/mach-kirkwood/board-dt.c
+++ b/arch/arm/mach-kirkwood/board-dt.c
@@ -93,6 +93,86 @@ static int __init kirkwood_pcie_dt_init(void)
 }
 subsys_initcall(kirkwood_pcie_dt_init);
 
+struct kirkwood_dt_gige {
+	const char *compatible;
+	int phy_addr00;
+	int phy_addr01;
+};
+
+static struct kirkwood_dt_gige kw_dt_gige[] = {
+	{ .compatible = "buffalo,lsxl",
+	  .phy_addr00 = MV643XX_ETH_PHY_ADDR(0),
+	  .phy_addr01 = MV643XX_ETH_PHY_ADDR(8) },
+	{ .compatible = "dlink,dns-kirkwood",
+	  .phy_addr00 = MV643XX_ETH_PHY_ADDR(8),
+	  .phy_addr01 = MV643XX_ETH_PHY_NONE },
+	{ .compatible = "globalscale,dreamplug",
+	  .phy_addr00 = MV643XX_ETH_PHY_ADDR(0),
+	  .phy_addr01 = MV643XX_ETH_PHY_ADDR(1) },
+	{ .compatible = "iom,iconnect",
+	  .phy_addr00 = MV643XX_ETH_PHY_ADDR(11),
+	  .phy_addr01 = MV643XX_ETH_PHY_NONE },
+	{ .compatible = "lacie,inetspace_v2",
+	  .phy_addr00 = MV643XX_ETH_PHY_ADDR(8),
+	  .phy_addr01 = MV643XX_ETH_PHY_NONE },
+	{ .compatible = "lacie,netspace_v2",
+	  .phy_addr00 = MV643XX_ETH_PHY_ADDR(8),
+	  .phy_addr01 = MV643XX_ETH_PHY_NONE },
+	{ .compatible = "lacie,netspace_max_v2",
+	  .phy_addr00 = MV643XX_ETH_PHY_ADDR(8),
+	  .phy_addr01 = MV643XX_ETH_PHY_NONE },
+	{ .compatible = "lacie,netspace_lite_v2",
+	  .phy_addr00 = MV643XX_ETH_PHY_ADDR(0),
+	  .phy_addr01 = MV643XX_ETH_PHY_NONE },
+	{ .compatible = "lacie,netspace_mini_v2",
+	  .phy_addr00 = MV643XX_ETH_PHY_ADDR(0),
+	  .phy_addr01 = MV643XX_ETH_PHY_NONE },
+	{ .compatible = "mpl,cec4",
+	  .phy_addr00 = MV643XX_ETH_PHY_ADDR(1),
+	  .phy_addr01 = MV643XX_ETH_PHY_ADDR(2) },
+	{ .compatible = "plathome,openblocks-a6",
+	  .phy_addr00 = MV643XX_ETH_PHY_ADDR(0),
+	  .phy_addr01 = MV643XX_ETH_PHY_NONE },
+	{ .compatible = "raidsonic,ib-nas62x0",
+	  .phy_addr00 = MV643XX_ETH_PHY_ADDR(8),
+	  .phy_addr01 = MV643XX_ETH_PHY_NONE },
+	{ .compatible = "seagate,dockstar",
+	  .phy_addr00 = MV643XX_ETH_PHY_ADDR(0),
+	  .phy_addr01 = MV643XX_ETH_PHY_NONE },
+	{ .compatible = "seagate,goflexnet",
+	  .phy_addr00 = MV643XX_ETH_PHY_ADDR(0),
+	  .phy_addr01 = MV643XX_ETH_PHY_NONE },
+	{ .compatible = "usi,topkick",
+	  .phy_addr00 = MV643XX_ETH_PHY_ADDR(0),
+	  .phy_addr01 = MV643XX_ETH_PHY_NONE },
+	{ NULL, MV643XX_ETH_PHY_NONE, MV643XX_ETH_PHY_NONE },
+};
+
+static void kirkwood_gige_dt_init(void) {
+	int i;
+
+	for (i = 0; kw_dt_gige[i].compatible != NULL; i++) {
+		if (of_machine_is_compatible(kw_dt_gige[i].compatible)) {
+
+			if (kw_dt_gige[i].phy_addr00 != MV643XX_ETH_PHY_NONE) {
+				struct mv643xx_eth_platform_data d = {
+					.phy_addr = kw_dt_gige[i].phy_addr00,
+				};
+				kirkwood_ge00_init(&d);
+			}
+
+			if (kw_dt_gige[i].phy_addr01 != MV643XX_ETH_PHY_NONE) {
+				struct mv643xx_eth_platform_data d = {
+					.phy_addr = kw_dt_gige[i].phy_addr01,
+				};
+				kirkwood_ge01_init(&d);
+			}
+
+			break;
+		}
+	}
+}
+
 static void __init kirkwood_dt_init(void)
 {
 	pr_info("Kirkwood: %s, TCLK=%d.\n", kirkwood_id(), kirkwood_tclk);
@@ -118,52 +198,20 @@ static void __init kirkwood_dt_init(void)
 	kexec_reinit = kirkwood_enable_pcie;
 #endif
 
-	if (of_machine_is_compatible("globalscale,dreamplug"))
-		dreamplug_init();
+	kirkwood_gige_dt_init();
 
 	if (of_machine_is_compatible("dlink,dns-kirkwood"))
 		dnskw_init();
 
-	if (of_machine_is_compatible("iom,iconnect"))
-		iconnect_init();
-
-	if (of_machine_is_compatible("raidsonic,ib-nas62x0"))
-		ib62x0_init();
-
 	if (of_machine_is_compatible("qnap,ts219"))
 		qnap_dt_ts219_init();
 
-	if (of_machine_is_compatible("seagate,dockstar"))
-		dockstar_dt_init();
-
-	if (of_machine_is_compatible("seagate,goflexnet"))
-		goflexnet_init();
-
-	if (of_machine_is_compatible("buffalo,lsxl"))
-		lsxl_init();
-
 	if (of_machine_is_compatible("iom,ix2-200"))
 		iomega_ix2_200_init();
 
 	if (of_machine_is_compatible("keymile,km_kirkwood"))
 		km_kirkwood_init();
 
-	if (of_machine_is_compatible("lacie,inetspace_v2") ||
-	    of_machine_is_compatible("lacie,netspace_v2") ||
-	    of_machine_is_compatible("lacie,netspace_max_v2") ||
-	    of_machine_is_compatible("lacie,netspace_lite_v2") ||
-	    of_machine_is_compatible("lacie,netspace_mini_v2"))
-		ns2_init();
-
-	if (of_machine_is_compatible("mpl,cec4"))
-		mplcec4_init();
-
-	if (of_machine_is_compatible("plathome,openblocks-a6"))
-		openblocks_a6_init();
-
-	if (of_machine_is_compatible("usi,topkick"))
-		usi_topkick_init();
-
 	of_platform_populate(NULL, kirkwood_dt_match_table, NULL, NULL);
 }
 
diff --git a/arch/arm/mach-kirkwood/board-goflexnet.c b/arch/arm/mach-kirkwood/board-goflexnet.c
deleted file mode 100644
index 9db979a..0000000
--- a/arch/arm/mach-kirkwood/board-goflexnet.c
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright 2012 (C), Jason Cooper <jason@lakedaemon.net>
- *
- * arch/arm/mach-kirkwood/board-goflexnet.c
- *
- * Seagate GoFlext Net 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.
- *
- * Copied and modified for Seagate GoFlex Net support by
- * Joshua Coombs <josh.coombs@gmail.com> based on ArchLinux ARM's
- * GoFlex kernel patches.
- *
- */
-
-#include <linux/kernel.h>
-#include <linux/init.h>
-#include <linux/mv643xx_eth.h>
-#include "common.h"
-
-static struct mv643xx_eth_platform_data goflexnet_ge00_data = {
-	.phy_addr	= MV643XX_ETH_PHY_ADDR(0),
-};
-
-void __init goflexnet_init(void)
-{
-	/*
-	 * Basic setup. Needs to be called early.
-	 */
-	kirkwood_ge00_init(&goflexnet_ge00_data);
-}
diff --git a/arch/arm/mach-kirkwood/board-ib62x0.c b/arch/arm/mach-kirkwood/board-ib62x0.c
deleted file mode 100644
index 9a857ae..0000000
--- a/arch/arm/mach-kirkwood/board-ib62x0.c
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Copyright 2012 (C), Simon Baatz <gmbnomis@gmail.com>
- *
- * arch/arm/mach-kirkwood/board-ib62x0.c
- *
- * RaidSonic ICY BOX IB-NAS6210 & IB-NAS6220 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 ib62x0_ge00_data = {
-	.phy_addr	= MV643XX_ETH_PHY_ADDR(8),
-};
-
-void __init ib62x0_init(void)
-{
-	/*
-	 * Basic setup. Needs to be called early.
-	 */
-	kirkwood_ge00_init(&ib62x0_ge00_data);
-}
diff --git a/arch/arm/mach-kirkwood/board-iconnect.c b/arch/arm/mach-kirkwood/board-iconnect.c
deleted file mode 100644
index ff042dc..0000000
--- a/arch/arm/mach-kirkwood/board-iconnect.c
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * arch/arm/mach-kirkwood/board-iconnect.c
- *
- * Iomega i-connect Board Setup
- *
- * 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 iconnect_ge00_data = {
-	.phy_addr	= MV643XX_ETH_PHY_ADDR(11),
-};
-
-void __init iconnect_init(void)
-{
-	kirkwood_ge00_init(&iconnect_ge00_data);
-}
diff --git a/arch/arm/mach-kirkwood/board-lsxl.c b/arch/arm/mach-kirkwood/board-lsxl.c
deleted file mode 100644
index 3483952..0000000
--- a/arch/arm/mach-kirkwood/board-lsxl.c
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright 2012 (C), Michael Walle <michael@walle.cc>
- *
- * arch/arm/mach-kirkwood/board-lsxl.c
- *
- * Buffalo Linkstation LS-XHL and LS-CHLv2 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/platform_device.h>
-#include <linux/mv643xx_eth.h>
-#include "common.h"
-
-static struct mv643xx_eth_platform_data lsxl_ge00_data = {
-	.phy_addr	= MV643XX_ETH_PHY_ADDR(0),
-};
-
-static struct mv643xx_eth_platform_data lsxl_ge01_data = {
-	.phy_addr	= MV643XX_ETH_PHY_ADDR(8),
-};
-
-void __init lsxl_init(void)
-{
-	/*
-	 * Basic setup. Needs to be called early.
-	 */
-
-	kirkwood_ge00_init(&lsxl_ge00_data);
-	kirkwood_ge01_init(&lsxl_ge01_data);
-}
diff --git a/arch/arm/mach-kirkwood/board-mplcec4.c b/arch/arm/mach-kirkwood/board-mplcec4.c
deleted file mode 100644
index 938712e..0000000
--- a/arch/arm/mach-kirkwood/board-mplcec4.c
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright (C) 2012 MPL AG, Switzerland
- * Stefan Peter <s.peter@mpl.ch>
- *
- * arch/arm/mach-kirkwood/board-mplcec4.c
- *
- * 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 mplcec4_ge00_data = {
-	.phy_addr	= MV643XX_ETH_PHY_ADDR(1),
-};
-
-static struct mv643xx_eth_platform_data mplcec4_ge01_data = {
-	.phy_addr	= MV643XX_ETH_PHY_ADDR(2),
-};
-
-void __init mplcec4_init(void)
-{
-	/*
-	 * Basic setup. Needs to be called early.
-	 */
-	kirkwood_ge00_init(&mplcec4_ge00_data);
-	kirkwood_ge01_init(&mplcec4_ge01_data);
-}
-
-
-
diff --git a/arch/arm/mach-kirkwood/board-ns2.c b/arch/arm/mach-kirkwood/board-ns2.c
deleted file mode 100644
index f2ea3b7..0000000
--- a/arch/arm/mach-kirkwood/board-ns2.c
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright 2012 (C), Simon Guinot <simon.guinot@sequanux.org>
- *
- * arch/arm/mach-kirkwood/board-ns2.c
- *
- * LaCie Network Space v2 board (and parents) initialization 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/platform_device.h>
-#include <linux/mv643xx_eth.h>
-#include <linux/of.h>
-#include "common.h"
-
-static struct mv643xx_eth_platform_data ns2_ge00_data = {
-	.phy_addr	= MV643XX_ETH_PHY_ADDR(8),
-};
-
-void __init ns2_init(void)
-{
-	/*
-	 * Basic setup. Needs to be called early.
-	 */
-	if (of_machine_is_compatible("lacie,netspace_lite_v2") ||
-	    of_machine_is_compatible("lacie,netspace_mini_v2"))
-		ns2_ge00_data.phy_addr = MV643XX_ETH_PHY_ADDR(0);
-	kirkwood_ge00_init(&ns2_ge00_data);
-}
diff --git a/arch/arm/mach-kirkwood/board-openblocks_a6.c b/arch/arm/mach-kirkwood/board-openblocks_a6.c
deleted file mode 100644
index b11d8fd..0000000
--- a/arch/arm/mach-kirkwood/board-openblocks_a6.c
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Copyright 2012 Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
- *
- * arch/arm/mach-kirkwood/board-openblocks_a6.c
- *
- * 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 openblocks_ge00_data = {
-	.phy_addr	= MV643XX_ETH_PHY_ADDR(0),
-};
-
-void __init openblocks_a6_init(void)
-{
-	/*
-	 * Basic setup. Needs to be called early.
-	 */
-	kirkwood_ge00_init(&openblocks_ge00_data);
-}
diff --git a/arch/arm/mach-kirkwood/board-usi_topkick.c b/arch/arm/mach-kirkwood/board-usi_topkick.c
deleted file mode 100644
index 1cc04ec..0000000
--- a/arch/arm/mach-kirkwood/board-usi_topkick.c
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Copyright 2012 (C), Jason Cooper <jason@lakedaemon.net>
- *
- * arch/arm/mach-kirkwood/board-usi_topkick.c
- *
- * USI Topkick 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 <linux/gpio.h>
-#include "common.h"
-
-static struct mv643xx_eth_platform_data topkick_ge00_data = {
-	.phy_addr	= MV643XX_ETH_PHY_ADDR(0),
-};
-
-void __init usi_topkick_init(void)
-{
-	/*
-	 * Basic setup. Needs to be called early.
-	 */
-	kirkwood_ge00_init(&topkick_ge00_data);
-}
diff --git a/arch/arm/mach-kirkwood/common.h b/arch/arm/mach-kirkwood/common.h
index 1c42cb8..ba6eb9c 100644
--- a/arch/arm/mach-kirkwood/common.h
+++ b/arch/arm/mach-kirkwood/common.h
@@ -55,11 +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_DREAMPLUG_DT
-void dreamplug_init(void);
-#else
-static inline void dreamplug_init(void) {};
-#endif
 #ifdef CONFIG_MACH_TS219_DT
 void qnap_dt_ts219_init(void);
 #else
@@ -72,36 +67,6 @@ void dnskw_init(void);
 static inline void dnskw_init(void) {};
 #endif
 
-#ifdef CONFIG_MACH_ICONNECT_DT
-void iconnect_init(void);
-#else
-static inline void iconnect_init(void) {};
-#endif
-
-#ifdef CONFIG_MACH_IB62X0_DT
-void ib62x0_init(void);
-#else
-static inline void ib62x0_init(void) {};
-#endif
-
-#ifdef CONFIG_MACH_DOCKSTAR_DT
-void dockstar_dt_init(void);
-#else
-static inline void dockstar_dt_init(void) {};
-#endif
-
-#ifdef CONFIG_MACH_GOFLEXNET_DT
-void goflexnet_init(void);
-#else
-static inline void goflexnet_init(void) {};
-#endif
-
-#ifdef CONFIG_MACH_LSXL_DT
-void lsxl_init(void);
-#else
-static inline void lsxl_init(void) {};
-#endif
-
 #ifdef CONFIG_MACH_IOMEGA_IX2_200_DT
 void iomega_ix2_200_init(void);
 #else
@@ -114,34 +79,6 @@ void km_kirkwood_init(void);
 static inline void km_kirkwood_init(void) {};
 #endif
 
-#ifdef CONFIG_MACH_MPLCEC4_DT
-void mplcec4_init(void);
-#else
-static inline void mplcec4_init(void) {};
-#endif
-
-#if defined(CONFIG_MACH_INETSPACE_V2_DT) || \
-	defined(CONFIG_MACH_NETSPACE_V2_DT) || \
-	defined(CONFIG_MACH_NETSPACE_MAX_V2_DT) || \
-	defined(CONFIG_MACH_NETSPACE_LITE_V2_DT) || \
-	defined(CONFIG_MACH_NETSPACE_MINI_V2_DT)
-void ns2_init(void);
-#else
-static inline void ns2_init(void) {};
-#endif
-
-#ifdef CONFIG_MACH_OPENBLOCKS_A6_DT
-void openblocks_a6_init(void);
-#else
-static inline void openblocks_a6_init(void) {};
-#endif
-
-#ifdef CONFIG_MACH_TOPKICK_DT
-void usi_topkick_init(void);
-#else
-static inline void usi_topkick_init(void) {};
-#endif
-
 /* early init functions not converted to fdt yet */
 char *kirkwood_id(void);
 void kirkwood_l2_init(void);
-- 
1.8.1.1

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

* [RFC PATCH 0/6] ARM: kirkwood: cleanup DT conversion
  2013-01-23 23:34 [RFC PATCH 0/6] ARM: kirkwood: cleanup DT conversion Jason Cooper
                   ` (5 preceding siblings ...)
  2013-01-23 23:34 ` [RFC PATCH 6/6] ARM: kirkwood: consolidate mv643xx_eth init for DT Jason Cooper
@ 2013-01-24  1:33 ` Jason Cooper
  2013-01-25  5:32 ` [RFC V2 PATCH 0/8] " Jason Cooper
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 102+ messages in thread
From: Jason Cooper @ 2013-01-24  1:33 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Jan 23, 2013 at 11:34:18PM +0000, Jason Cooper wrote:
> All,
> 
> This is a first cut at cleaning up mach-kirkwood/.  There are a few DT
> conversions (topkick -> mvsdio, pinctrl) which, once reviewed, I'll put in the
> normal pull request cycle.
> 
> The others which remove board-*.c files, I'll keep updating against
> mvebu/for-next, and then apply at the end of the merge window.
> 
> Please test as you are able.

I should also mention, this was built against mvebu/for-next (not
stable) which is just the merging of all the mvebu/* branches and
arm-soc/for-next into one branch.

thx,

Jason.

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

* [RFC PATCH 6/6] ARM: kirkwood: consolidate mv643xx_eth init for DT
  2013-01-23 23:34 ` [RFC PATCH 6/6] ARM: kirkwood: consolidate mv643xx_eth init for DT Jason Cooper
@ 2013-01-24  1:39   ` Jason Cooper
  2013-01-24  6:23     ` Andrew Lunn
  2013-01-24 13:37   ` Florian Fainelli
  1 sibling, 1 reply; 102+ messages in thread
From: Jason Cooper @ 2013-01-24  1:39 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Jan 23, 2013 at 11:34:24PM +0000, Jason Cooper wrote:
> replace a lot of unneeded code and files with a lookup table.
> 
> Signed-off-by: Jason Cooper <jason@lakedaemon.net>
> ---
>  arch/arm/mach-kirkwood/Kconfig               | 101 ------------------------
>  arch/arm/mach-kirkwood/Makefile              |  14 ----
>  arch/arm/mach-kirkwood/board-dnskw.c         |   7 --
>  arch/arm/mach-kirkwood/board-dockstar.c      |  32 --------
>  arch/arm/mach-kirkwood/board-dreamplug.c     |  35 --------
>  arch/arm/mach-kirkwood/board-dt.c            | 114 +++++++++++++++++++--------
>  arch/arm/mach-kirkwood/board-goflexnet.c     |  34 --------
>  arch/arm/mach-kirkwood/board-ib62x0.c        |  29 -------
>  arch/arm/mach-kirkwood/board-iconnect.c      |  23 ------
>  arch/arm/mach-kirkwood/board-lsxl.c          |  36 ---------
>  arch/arm/mach-kirkwood/board-mplcec4.c       |  35 --------
>  arch/arm/mach-kirkwood/board-ns2.c           |  34 --------
>  arch/arm/mach-kirkwood/board-openblocks_a6.c |  26 ------
>  arch/arm/mach-kirkwood/board-usi_topkick.c   |  29 -------
>  arch/arm/mach-kirkwood/common.h              |  63 ---------------
>  15 files changed, 81 insertions(+), 531 deletions(-)
>  delete mode 100644 arch/arm/mach-kirkwood/board-dockstar.c
>  delete mode 100644 arch/arm/mach-kirkwood/board-dreamplug.c
>  delete mode 100644 arch/arm/mach-kirkwood/board-goflexnet.c
>  delete mode 100644 arch/arm/mach-kirkwood/board-ib62x0.c
>  delete mode 100644 arch/arm/mach-kirkwood/board-iconnect.c
>  delete mode 100644 arch/arm/mach-kirkwood/board-lsxl.c
>  delete mode 100644 arch/arm/mach-kirkwood/board-mplcec4.c
>  delete mode 100644 arch/arm/mach-kirkwood/board-ns2.c
>  delete mode 100644 arch/arm/mach-kirkwood/board-openblocks_a6.c
>  delete mode 100644 arch/arm/mach-kirkwood/board-usi_topkick.c
> 
> diff --git a/arch/arm/mach-kirkwood/Kconfig b/arch/arm/mach-kirkwood/Kconfig
> index 432bee0..188651b 100644
> --- a/arch/arm/mach-kirkwood/Kconfig
> +++ b/arch/arm/mach-kirkwood/Kconfig
> @@ -58,19 +58,6 @@ config ARCH_KIRKWOOD_DT
>  	  Say 'Y' here if you want your kernel to support the
>  	  Marvell Kirkwood using flattened device tree.
>  
> -config MACH_DREAMPLUG_DT
> -	bool "Marvell DreamPlug (Flattened Device Tree)"
> -	select ARCH_KIRKWOOD_DT
> -	help
> -	  Say 'Y' here if you want your kernel to support the
> -	  Marvell DreamPlug (Flattened Device Tree).
> -
> -config MACH_ICONNECT_DT
> -	bool "Iomega Iconnect (Flattened Device Tree)"
> -	select ARCH_KIRKWOOD_DT
> -	help
> -	  Say 'Y' here to enable Iomega Iconnect support.
> -
>  config MACH_DLINK_KIRKWOOD_DT
>  	bool "D-Link Kirkwood-based NAS (Flattened Device Tree)"
>  	select ARCH_KIRKWOOD_DT
> @@ -79,14 +66,6 @@ config MACH_DLINK_KIRKWOOD_DT
>  	  Kirkwood-based D-Link NASes such as DNS-320 & DNS-325,
>  	  using Flattened Device Tree.
>  
> -config MACH_IB62X0_DT
> -	bool "RaidSonic IB-NAS6210, IB-NAS6220 (Flattened Device Tree)"
> -	select ARCH_KIRKWOOD_DT
> -	help
> -	  Say 'Y' here if you want your kernel to support the
> -	  RaidSonic IB-NAS6210 & IB-NAS6220 devices, using
> -	  Flattened Device Tree.
> -
>  config MACH_TS219_DT
>  	bool "Device Tree for QNAP TS-11X, TS-21X NAS"
>  	select ARCH_KIRKWOOD_DT
> @@ -102,29 +81,6 @@ config MACH_TS219_DT
>  	  or MV6282. If you have the wrong one, the buttons will not
>  	  work.
>  
> -config MACH_DOCKSTAR_DT
> -	bool "Seagate FreeAgent Dockstar (Flattened Device Tree)"
> -	select ARCH_KIRKWOOD_DT
> -	help
> -	  Say 'Y' here if you want your kernel to support the
> -	  Seagate FreeAgent Dockstar (Flattened Device Tree).
> -
> -config MACH_GOFLEXNET_DT
> -	bool "Seagate GoFlex Net (Flattened Device Tree)"
> -	select ARCH_KIRKWOOD_DT
> -	help
> -	  Say 'Y' here if you want your kernel to support the
> -	  Seagate GoFlex Net (Flattened Device Tree).
> -
> -config MACH_LSXL_DT
> -	bool "Buffalo Linkstation LS-XHL, LS-CHLv2 (Flattened Device Tree)"
> -	select ARCH_KIRKWOOD_DT
> -	select POWER_RESET_RESTART
> -	help
> -	  Say 'Y' here if you want your kernel to support the
> -	  Buffalo Linkstation LS-XHL & LS-CHLv2 devices, using
> -	  Flattened Device Tree.
> -
>  config MACH_IOMEGA_IX2_200_DT
>  	bool "Iomega StorCenter ix2-200 (Flattened Device Tree)"
>  	select ARCH_KIRKWOOD_DT
> @@ -139,63 +95,6 @@ config MACH_KM_KIRKWOOD_DT
>  	  Say 'Y' here if you want your kernel to support the
>  	  Keymile Kirkwood Reference Desgin, using Flattened Device Tree.
>  
> -config MACH_INETSPACE_V2_DT
> -	bool "LaCie Internet Space v2 NAS (Flattened Device Tree)"
> -	select ARCH_KIRKWOOD_DT
> -	help
> -	  Say 'Y' here if you want your kernel to support the LaCie
> -	  Internet Space v2 NAS, using Flattened Device Tree.
> -
> -config MACH_MPLCEC4_DT
> -	bool "MPL CEC4 (Flattened Device Tree)"
> -	select ARCH_KIRKWOOD_DT
> -	help
> -	  Say 'Y' here if you want your kernel to support the
> -	  MPL CEC4 (Flattened Device Tree).
> -
> -config MACH_NETSPACE_V2_DT
> -	bool "LaCie Network Space v2 NAS (Flattened Device Tree)"
> -	select ARCH_KIRKWOOD_DT
> -	help
> -	  Say 'Y' here if you want your kernel to support the LaCie
> -	  Network Space v2 NAS, using Flattened Device Tree.
> -
> -config MACH_NETSPACE_MAX_V2_DT
> -	bool "LaCie Network Space Max v2 NAS (Flattened Device Tree)"
> -	select ARCH_KIRKWOOD_DT
> -	help
> -	  Say 'Y' here if you want your kernel to support the LaCie
> -	  Network Space Max v2 NAS, using Flattened Device Tree.
> -
> -config MACH_NETSPACE_LITE_V2_DT
> -	bool "LaCie Network Space Lite v2 NAS (Flattened Device Tree)"
> -	select ARCH_KIRKWOOD_DT
> -	help
> -	  Say 'Y' here if you want your kernel to support the LaCie
> -	  Network Space Lite v2 NAS, using Flattened Device Tree.
> -
> -config MACH_NETSPACE_MINI_V2_DT
> -	bool "LaCie Network Space Mini v2 NAS (Flattened Device Tree)"
> -	select ARCH_KIRKWOOD_DT
> -	help
> -	  Say 'Y' here if you want your kernel to support the LaCie
> -	  Network Space Mini v2 NAS (aka SafeBox), using Flattened
> -	  Device Tree.
> -
> -config MACH_OPENBLOCKS_A6_DT
> -	bool "Plat'Home OpenBlocks A6 (Flattened Device Tree)"
> -	select ARCH_KIRKWOOD_DT
> -	help
> -	  Say 'Y' here if you want your kernel to support the
> -	  Plat'Home OpenBlocks A6 (Flattened Device Tree).
> -
> -config MACH_TOPKICK_DT
> -	bool "USI Topkick (Flattened Device Tree)"
> -	select ARCH_KIRKWOOD_DT
> -	help
> -	  Say 'Y' here if you want your kernel to support the
> -	  USI Topkick, using Flattened Device Tree
> -
>  config MACH_TS219
>  	bool "QNAP TS-110, TS-119, TS-119P+, TS-210, TS-219, TS-219P and TS-219P+ Turbo NAS"
>  	help
> diff --git a/arch/arm/mach-kirkwood/Makefile b/arch/arm/mach-kirkwood/Makefile
> index ee3aa77..ab739b0 100644
> --- a/arch/arm/mach-kirkwood/Makefile
> +++ b/arch/arm/mach-kirkwood/Makefile
> @@ -20,21 +20,7 @@ obj-$(CONFIG_MACH_NET5BIG_V2)		+= netxbig_v2-setup.o lacie_v2-common.o
>  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_ICONNECT_DT)		+= board-iconnect.o
>  obj-$(CONFIG_MACH_DLINK_KIRKWOOD_DT)	+= board-dnskw.o
> -obj-$(CONFIG_MACH_IB62X0_DT)		+= board-ib62x0.o
>  obj-$(CONFIG_MACH_TS219_DT)		+= board-ts219.o tsx1x-common.o
> -obj-$(CONFIG_MACH_DOCKSTAR_DT)		+= board-dockstar.o
> -obj-$(CONFIG_MACH_GOFLEXNET_DT)		+= board-goflexnet.o
> -obj-$(CONFIG_MACH_LSXL_DT)		+= board-lsxl.o
>  obj-$(CONFIG_MACH_IOMEGA_IX2_200_DT)	+= board-iomega_ix2_200.o
>  obj-$(CONFIG_MACH_KM_KIRKWOOD_DT)	+= board-km_kirkwood.o
> -obj-$(CONFIG_MACH_INETSPACE_V2_DT)	+= board-ns2.o
> -obj-$(CONFIG_MACH_MPLCEC4_DT)		+= board-mplcec4.o
> -obj-$(CONFIG_MACH_NETSPACE_V2_DT)	+= board-ns2.o
> -obj-$(CONFIG_MACH_NETSPACE_MAX_V2_DT)	+= board-ns2.o
> -obj-$(CONFIG_MACH_NETSPACE_LITE_V2_DT)	+= board-ns2.o
> -obj-$(CONFIG_MACH_NETSPACE_MINI_V2_DT)	+= board-ns2.o
> -obj-$(CONFIG_MACH_OPENBLOCKS_A6_DT)	+= board-openblocks_a6.o
> -obj-$(CONFIG_MACH_TOPKICK_DT)		+= board-usi_topkick.o
> diff --git a/arch/arm/mach-kirkwood/board-dnskw.c b/arch/arm/mach-kirkwood/board-dnskw.c
> index a1aa87f..2af7a95 100644
> --- a/arch/arm/mach-kirkwood/board-dnskw.c
> +++ b/arch/arm/mach-kirkwood/board-dnskw.c
> @@ -14,14 +14,9 @@
>  #include <linux/kernel.h>
>  #include <linux/init.h>
>  #include <linux/platform_device.h>
> -#include <linux/mv643xx_eth.h>
>  #include <linux/gpio.h>
>  #include "common.h"
>  
> -static struct mv643xx_eth_platform_data dnskw_ge00_data = {
> -	.phy_addr	= MV643XX_ETH_PHY_ADDR(8),
> -};
> -
>  /* Register any GPIO for output and set the value */
>  static void __init dnskw_gpio_register(unsigned gpio, char *name, int def)
>  {
> @@ -36,8 +31,6 @@ static void __init dnskw_gpio_register(unsigned gpio, char *name, int def)
>  
>  void __init dnskw_init(void)
>  {
> -	kirkwood_ge00_init(&dnskw_ge00_data);
> -
>  	/* Set NAS to turn back on after a power failure */
>  	dnskw_gpio_register(37, "dnskw:power:recover", 1);
>  }
> diff --git a/arch/arm/mach-kirkwood/board-dockstar.c b/arch/arm/mach-kirkwood/board-dockstar.c
> deleted file mode 100644
> index d7196db..0000000
> --- a/arch/arm/mach-kirkwood/board-dockstar.c
> +++ /dev/null
> @@ -1,32 +0,0 @@
> -/*
> - * arch/arm/mach-kirkwood/board-dockstar.c
> - *
> - * Seagate FreeAgent Dockstar 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.
> - *
> - * Copied and modified for Seagate GoFlex Net support by
> - * Joshua Coombs <josh.coombs@gmail.com> based on ArchLinux ARM's
> - * GoFlex kernel patches.
> - *
> - */
> -
> -#include <linux/kernel.h>
> -#include <linux/init.h>
> -#include <linux/mv643xx_eth.h>
> -#include "common.h"
> -
> -static struct mv643xx_eth_platform_data dockstar_ge00_data = {
> -	.phy_addr	= MV643XX_ETH_PHY_ADDR(0),
> -};
> -
> -void __init dockstar_dt_init(void)
> -{
> -	/*
> -	 * Basic setup. Needs to be called early.
> -	 */
> -	kirkwood_ge00_init(&dockstar_ge00_data);
> -}
> diff --git a/arch/arm/mach-kirkwood/board-dreamplug.c b/arch/arm/mach-kirkwood/board-dreamplug.c
> deleted file mode 100644
> index 0903242..0000000
> --- a/arch/arm/mach-kirkwood/board-dreamplug.c
> +++ /dev/null
> @@ -1,35 +0,0 @@
> -/*
> - * Copyright 2012 (C), Jason Cooper <jason@lakedaemon.net>
> - *
> - * arch/arm/mach-kirkwood/board-dreamplug.c
> - *
> - * Marvell DreamPlug 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 <linux/gpio.h>
> -#include "common.h"
> -
> -static struct mv643xx_eth_platform_data dreamplug_ge00_data = {
> -	.phy_addr	= MV643XX_ETH_PHY_ADDR(0),
> -};
> -
> -static struct mv643xx_eth_platform_data dreamplug_ge01_data = {
> -	.phy_addr	= MV643XX_ETH_PHY_ADDR(1),
> -};
> -
> -void __init dreamplug_init(void)
> -{
> -	/*
> -	 * Basic setup. Needs to be called early.
> -	 */
> -	kirkwood_ge00_init(&dreamplug_ge00_data);
> -	kirkwood_ge01_init(&dreamplug_ge01_data);
> -}
> diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c
> index 73b76e4..f5bd640 100644
> --- a/arch/arm/mach-kirkwood/board-dt.c
> +++ b/arch/arm/mach-kirkwood/board-dt.c
> @@ -93,6 +93,86 @@ static int __init kirkwood_pcie_dt_init(void)
>  }
>  subsys_initcall(kirkwood_pcie_dt_init);
>  
> +struct kirkwood_dt_gige {
> +	const char *compatible;
> +	int phy_addr00;
> +	int phy_addr01;
> +};
> +
> +static struct kirkwood_dt_gige kw_dt_gige[] = {
> +	{ .compatible = "buffalo,lsxl",
> +	  .phy_addr00 = MV643XX_ETH_PHY_ADDR(0),
> +	  .phy_addr01 = MV643XX_ETH_PHY_ADDR(8) },
> +	{ .compatible = "dlink,dns-kirkwood",
> +	  .phy_addr00 = MV643XX_ETH_PHY_ADDR(8),
> +	  .phy_addr01 = MV643XX_ETH_PHY_NONE },
> +	{ .compatible = "globalscale,dreamplug",
> +	  .phy_addr00 = MV643XX_ETH_PHY_ADDR(0),
> +	  .phy_addr01 = MV643XX_ETH_PHY_ADDR(1) },
> +	{ .compatible = "iom,iconnect",
> +	  .phy_addr00 = MV643XX_ETH_PHY_ADDR(11),
> +	  .phy_addr01 = MV643XX_ETH_PHY_NONE },
> +	{ .compatible = "lacie,inetspace_v2",
> +	  .phy_addr00 = MV643XX_ETH_PHY_ADDR(8),
> +	  .phy_addr01 = MV643XX_ETH_PHY_NONE },
> +	{ .compatible = "lacie,netspace_v2",
> +	  .phy_addr00 = MV643XX_ETH_PHY_ADDR(8),
> +	  .phy_addr01 = MV643XX_ETH_PHY_NONE },
> +	{ .compatible = "lacie,netspace_max_v2",
> +	  .phy_addr00 = MV643XX_ETH_PHY_ADDR(8),
> +	  .phy_addr01 = MV643XX_ETH_PHY_NONE },
> +	{ .compatible = "lacie,netspace_lite_v2",
> +	  .phy_addr00 = MV643XX_ETH_PHY_ADDR(0),
> +	  .phy_addr01 = MV643XX_ETH_PHY_NONE },
> +	{ .compatible = "lacie,netspace_mini_v2",
> +	  .phy_addr00 = MV643XX_ETH_PHY_ADDR(0),
> +	  .phy_addr01 = MV643XX_ETH_PHY_NONE },
> +	{ .compatible = "mpl,cec4",
> +	  .phy_addr00 = MV643XX_ETH_PHY_ADDR(1),
> +	  .phy_addr01 = MV643XX_ETH_PHY_ADDR(2) },
> +	{ .compatible = "plathome,openblocks-a6",
> +	  .phy_addr00 = MV643XX_ETH_PHY_ADDR(0),
> +	  .phy_addr01 = MV643XX_ETH_PHY_NONE },
> +	{ .compatible = "raidsonic,ib-nas62x0",
> +	  .phy_addr00 = MV643XX_ETH_PHY_ADDR(8),
> +	  .phy_addr01 = MV643XX_ETH_PHY_NONE },
> +	{ .compatible = "seagate,dockstar",
> +	  .phy_addr00 = MV643XX_ETH_PHY_ADDR(0),
> +	  .phy_addr01 = MV643XX_ETH_PHY_NONE },
> +	{ .compatible = "seagate,goflexnet",
> +	  .phy_addr00 = MV643XX_ETH_PHY_ADDR(0),
> +	  .phy_addr01 = MV643XX_ETH_PHY_NONE },
> +	{ .compatible = "usi,topkick",
> +	  .phy_addr00 = MV643XX_ETH_PHY_ADDR(0),
> +	  .phy_addr01 = MV643XX_ETH_PHY_NONE },
> +	{ NULL, MV643XX_ETH_PHY_NONE, MV643XX_ETH_PHY_NONE },
> +};
> +
> +static void kirkwood_gige_dt_init(void) {
> +	int i;
> +
> +	for (i = 0; kw_dt_gige[i].compatible != NULL; i++) {
> +		if (of_machine_is_compatible(kw_dt_gige[i].compatible)) {
> +
> +			if (kw_dt_gige[i].phy_addr00 != MV643XX_ETH_PHY_NONE) {
> +				struct mv643xx_eth_platform_data d = {
> +					.phy_addr = kw_dt_gige[i].phy_addr00,
> +				};
> +				kirkwood_ge00_init(&d);
> +			}
> +
> +			if (kw_dt_gige[i].phy_addr01 != MV643XX_ETH_PHY_NONE) {
> +				struct mv643xx_eth_platform_data d = {
> +					.phy_addr = kw_dt_gige[i].phy_addr01,
> +				};
> +				kirkwood_ge01_init(&d);
> +			}
> +
> +			break;
> +		}

meh, hindsight is 50/50 :-)  Much more readable this way, I think:

		if (of_machine_is_compatible(kw_dt_gige[i].compatible)) {
			struct mv643xx_eth_platform_data d;

			if (kw_dt_gige[i].phy_addr00 != MV643XX_ETH_PHY_NONE) {
				d.phy_addr = kw_dt_gige[i].phy_addr00,
				kirkwood_ge00_init(&d);
			}

			if (kw_dt_gige[i].phy_addr01 != MV643XX_ETH_PHY_NONE) {
				d.phy_addr = kw_dt_gige[i].phy_addr01,
				kirkwood_ge01_init(&d);
			}

			break;
		}

thx,

Jason.

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

* [RFC PATCH 3/6] ARM: kirkwood: nsa310: cleanup includes and unneeded code
  2013-01-23 23:34 ` [RFC PATCH 3/6] ARM: kirkwood: nsa310: cleanup includes and unneeded code Jason Cooper
@ 2013-01-24  5:50   ` Andrew Lunn
  2013-01-24 13:43     ` Florian Fainelli
  2013-01-24 15:41     ` Jason Cooper
  0 siblings, 2 replies; 102+ messages in thread
From: Andrew Lunn @ 2013-01-24  5:50 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Jan 23, 2013 at 11:34:21PM +0000, Jason Cooper wrote:
> Signed-off-by: Jason Cooper <jason@lakedaemon.net>
> ---
>  arch/arm/mach-kirkwood/board-nsa310.c | 9 +--------
>  1 file changed, 1 insertion(+), 8 deletions(-)
> 
> diff --git a/arch/arm/mach-kirkwood/board-nsa310.c b/arch/arm/mach-kirkwood/board-nsa310.c
> index 1bd328d..0b99533 100644
> --- a/arch/arm/mach-kirkwood/board-nsa310.c
> +++ b/arch/arm/mach-kirkwood/board-nsa310.c
> @@ -10,11 +10,8 @@
>  
>  #include <linux/kernel.h>
>  #include <linux/init.h>
> -#include <linux/i2c.h>
> -
> -#include <asm/mach-types.h>
> -#include <asm/mach/arch.h>
>  #include <mach/kirkwood.h>
> +#include <linux/of.h>
>  #include "common.h"
>  #include "mpp.h"
>  
> @@ -40,11 +37,7 @@ static unsigned int nsa310_mpp_config[] __initdata = {
>  
>  void __init nsa310_init(void)
>  {
> -	u32 dev, rev;
> -
>  	kirkwood_mpp_conf(nsa310_mpp_config);
> -
> -	kirkwood_pcie_id(&dev, &rev);
>  }
>  
>  static int __init nsa310_pci_init(void)
> -- 
> 1.8.1.1
> 

Hi Jason, Tero

This board is rather unusual for a Kirkwood. It has no Ethernet
interfaces. Is this correct?

    Thanks
	Andrew

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

* [RFC PATCH 6/6] ARM: kirkwood: consolidate mv643xx_eth init for DT
  2013-01-24  1:39   ` Jason Cooper
@ 2013-01-24  6:23     ` Andrew Lunn
  2013-01-24 12:07       ` Jason Cooper
  0 siblings, 1 reply; 102+ messages in thread
From: Andrew Lunn @ 2013-01-24  6:23 UTC (permalink / raw)
  To: linux-arm-kernel

> > +static void kirkwood_gige_dt_init(void) {
> > +	int i;
> > +
> > +	for (i = 0; kw_dt_gige[i].compatible != NULL; i++) {
> > +		if (of_machine_is_compatible(kw_dt_gige[i].compatible)) {
> > +
> > +			if (kw_dt_gige[i].phy_addr00 != MV643XX_ETH_PHY_NONE) {
> > +				struct mv643xx_eth_platform_data d = {
> > +					.phy_addr = kw_dt_gige[i].phy_addr00,
> > +				};
> > +				kirkwood_ge00_init(&d);
> > +			}
> > +
> > +			if (kw_dt_gige[i].phy_addr01 != MV643XX_ETH_PHY_NONE) {
> > +				struct mv643xx_eth_platform_data d = {
> > +					.phy_addr = kw_dt_gige[i].phy_addr01,
> > +				};
> > +				kirkwood_ge01_init(&d);
> > +			}
> > +
> > +			break;
> > +		}
> 
> meh, hindsight is 50/50 :-)  Much more readable this way, I think:
> 
> 		if (of_machine_is_compatible(kw_dt_gige[i].compatible)) {
> 			struct mv643xx_eth_platform_data d;
> 
> 			if (kw_dt_gige[i].phy_addr00 != MV643XX_ETH_PHY_NONE) {
> 				d.phy_addr = kw_dt_gige[i].phy_addr00,
> 				kirkwood_ge00_init(&d);
> 			}
> 
> 			if (kw_dt_gige[i].phy_addr01 != MV643XX_ETH_PHY_NONE) {
> 				d.phy_addr = kw_dt_gige[i].phy_addr01,
> 				kirkwood_ge01_init(&d);
> 			}
> 
> 			break;
> 		}
> 
> thx,
> 
> Jason.

Hi Jason

Might it be better still to implement something like:

const struct of_device_id *of_match_machine(const struct of_device_id *matches)
{
        struct device_node *root;
	const struct of_device_id *match;

	if (!matches)
		return NULL;

	root = of_find_node_by_path("/");
	if (!root)
		return NULL;	

	match = of_match_node(matches, root);
	of_node_put(root);

	return match;
}

and then board-dt.c becomes

    match = of_match_machine(ge00_matches);
    if (match)
	krikwood_ge00_init(match->data)

    match = of_match_machine(ge01_matches);
    if (match)
	krikwood_ge01_init(match->data)

	Andrew

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

* [RFC PATCH 6/6] ARM: kirkwood: consolidate mv643xx_eth init for DT
  2013-01-24  6:23     ` Andrew Lunn
@ 2013-01-24 12:07       ` Jason Cooper
  0 siblings, 0 replies; 102+ messages in thread
From: Jason Cooper @ 2013-01-24 12:07 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Jan 24, 2013 at 07:23:23AM +0100, Andrew Lunn wrote:
> > > +static void kirkwood_gige_dt_init(void) {
> > > +	int i;
> > > +
> > > +	for (i = 0; kw_dt_gige[i].compatible != NULL; i++) {
> > > +		if (of_machine_is_compatible(kw_dt_gige[i].compatible)) {
> > > +
> > > +			if (kw_dt_gige[i].phy_addr00 != MV643XX_ETH_PHY_NONE) {
> > > +				struct mv643xx_eth_platform_data d = {
> > > +					.phy_addr = kw_dt_gige[i].phy_addr00,
> > > +				};
> > > +				kirkwood_ge00_init(&d);
> > > +			}
> > > +
> > > +			if (kw_dt_gige[i].phy_addr01 != MV643XX_ETH_PHY_NONE) {
> > > +				struct mv643xx_eth_platform_data d = {
> > > +					.phy_addr = kw_dt_gige[i].phy_addr01,
> > > +				};
> > > +				kirkwood_ge01_init(&d);
> > > +			}
> > > +
> > > +			break;
> > > +		}
> > 
> > meh, hindsight is 50/50 :-)  Much more readable this way, I think:
> > 
> > 		if (of_machine_is_compatible(kw_dt_gige[i].compatible)) {
> > 			struct mv643xx_eth_platform_data d;
> > 
> > 			if (kw_dt_gige[i].phy_addr00 != MV643XX_ETH_PHY_NONE) {
> > 				d.phy_addr = kw_dt_gige[i].phy_addr00,
> > 				kirkwood_ge00_init(&d);
> > 			}
> > 
> > 			if (kw_dt_gige[i].phy_addr01 != MV643XX_ETH_PHY_NONE) {
> > 				d.phy_addr = kw_dt_gige[i].phy_addr01,
> > 				kirkwood_ge01_init(&d);
> > 			}
> > 
> > 			break;
> > 		}
> > 
> > thx,
> > 
> > Jason.
> 
> Hi Jason
> 
> Might it be better still to implement something like:
> 
> const struct of_device_id *of_match_machine(const struct of_device_id *matches)
> {
>         struct device_node *root;
> 	const struct of_device_id *match;
> 
> 	if (!matches)
> 		return NULL;
> 
> 	root = of_find_node_by_path("/");
> 	if (!root)
> 		return NULL;	
> 
> 	match = of_match_node(matches, root);
> 	of_node_put(root);
> 
> 	return match;
> }

I actually went looking for something like this in linux/of.h and didn't
find it.  Perhaps it should be added?  Although I'm not sure I see a use
case after the conversion to DT is complete...

> 
> and then board-dt.c becomes
> 
>     match = of_match_machine(ge00_matches);
>     if (match)
> 	krikwood_ge00_init(match->data)
> 
>     match = of_match_machine(ge01_matches);
>     if (match)
> 	krikwood_ge01_init(match->data)

Much nicer, I'll do this for the next revision and see what the
devicetree guys think.

thx,

Jason.

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

* [RFC PATCH 6/6] ARM: kirkwood: consolidate mv643xx_eth init for DT
  2013-01-23 23:34 ` [RFC PATCH 6/6] ARM: kirkwood: consolidate mv643xx_eth init for DT Jason Cooper
  2013-01-24  1:39   ` Jason Cooper
@ 2013-01-24 13:37   ` Florian Fainelli
  2013-01-24 14:37     ` Jason Cooper
  1 sibling, 1 reply; 102+ messages in thread
From: Florian Fainelli @ 2013-01-24 13:37 UTC (permalink / raw)
  To: linux-arm-kernel

Hello Jason,

On 01/24/2013 12:34 AM, Jason Cooper wrote:
> replace a lot of unneeded code and files with a lookup table.

Would not it be better to keep all of this as-is and merge/improve Ian's 
mv643xx_eth device tree bindings [1], and then only remove these files? 
It is just 81 new lines, so it is not a big deal, just wondering here 
what is best.

[1]: http://patchwork.ozlabs.org/patch/175652/

>
> Signed-off-by: Jason Cooper <jason@lakedaemon.net>

--
Florian

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

* [RFC PATCH 3/6] ARM: kirkwood: nsa310: cleanup includes and unneeded code
  2013-01-24  5:50   ` Andrew Lunn
@ 2013-01-24 13:43     ` Florian Fainelli
  2013-01-24 14:39       ` Jason Cooper
  2013-01-24 15:41     ` Jason Cooper
  1 sibling, 1 reply; 102+ messages in thread
From: Florian Fainelli @ 2013-01-24 13:43 UTC (permalink / raw)
  To: linux-arm-kernel

On 01/24/2013 06:50 AM, Andrew Lunn wrote:
> On Wed, Jan 23, 2013 at 11:34:21PM +0000, Jason Cooper wrote:
>> Signed-off-by: Jason Cooper <jason@lakedaemon.net>
>> ---
>>   arch/arm/mach-kirkwood/board-nsa310.c | 9 +--------
>>   1 file changed, 1 insertion(+), 8 deletions(-)
>>
>> diff --git a/arch/arm/mach-kirkwood/board-nsa310.c b/arch/arm/mach-kirkwood/board-nsa310.c
>> index 1bd328d..0b99533 100644
>> --- a/arch/arm/mach-kirkwood/board-nsa310.c
>> +++ b/arch/arm/mach-kirkwood/board-nsa310.c
>> @@ -10,11 +10,8 @@
>>
>>   #include <linux/kernel.h>
>>   #include <linux/init.h>
>> -#include <linux/i2c.h>
>> -
>> -#include <asm/mach-types.h>
>> -#include <asm/mach/arch.h>
>>   #include <mach/kirkwood.h>
>> +#include <linux/of.h>
>>   #include "common.h"
>>   #include "mpp.h"
>>
>> @@ -40,11 +37,7 @@ static unsigned int nsa310_mpp_config[] __initdata = {
>>
>>   void __init nsa310_init(void)
>>   {
>> -	u32 dev, rev;
>> -
>>   	kirkwood_mpp_conf(nsa310_mpp_config);
>> -
>> -	kirkwood_pcie_id(&dev, &rev);
>>   }
>>
>>   static int __init nsa310_pci_init(void)
>> --
>> 1.8.1.1
>>
>
> Hi Jason, Tero
>
> This board is rather unusual for a Kirkwood. It has no Ethernet
> interfaces. Is this correct?

It seems like it really has an Gigabit Ethernet interface:
http://www.clubic.com/disque-dur-memoire/nas/article-465814-1-zyxel-nsa-310.html

(in french, but the pictures show a Gigabit Ethernet).
--
Florian

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

* [RFC PATCH 6/6] ARM: kirkwood: consolidate mv643xx_eth init for DT
  2013-01-24 13:37   ` Florian Fainelli
@ 2013-01-24 14:37     ` Jason Cooper
  2013-01-24 15:54       ` Arnd Bergmann
  0 siblings, 1 reply; 102+ messages in thread
From: Jason Cooper @ 2013-01-24 14:37 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Jan 24, 2013 at 02:37:55PM +0100, Florian Fainelli wrote:
> Hello Jason,
> 
> On 01/24/2013 12:34 AM, Jason Cooper wrote:
> >replace a lot of unneeded code and files with a lookup table.
> 
> Would not it be better to keep all of this as-is and merge/improve
> Ian's mv643xx_eth device tree bindings [1], and then only remove
> these files? It is just 81 new lines, so it is not a big deal, just
> wondering here what is best.

I agree, however, there is a long history with that patch.  That driver
has been in use by powerpc for many years.  We need to be mindful not to
break existing installations.  I don't think it'll be ready in time for
v3.9.  So, I'd like to do the cleanup now.

thx,

Jason.

> [1]: http://patchwork.ozlabs.org/patch/175652/

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

* [RFC PATCH 3/6] ARM: kirkwood: nsa310: cleanup includes and unneeded code
  2013-01-24 13:43     ` Florian Fainelli
@ 2013-01-24 14:39       ` Jason Cooper
  0 siblings, 0 replies; 102+ messages in thread
From: Jason Cooper @ 2013-01-24 14:39 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Jan 24, 2013 at 02:43:15PM +0100, Florian Fainelli wrote:
> On 01/24/2013 06:50 AM, Andrew Lunn wrote:
> >On Wed, Jan 23, 2013 at 11:34:21PM +0000, Jason Cooper wrote:
> >>Signed-off-by: Jason Cooper <jason@lakedaemon.net>
> >>---
> >>  arch/arm/mach-kirkwood/board-nsa310.c | 9 +--------
> >>  1 file changed, 1 insertion(+), 8 deletions(-)
> >>
> >>diff --git a/arch/arm/mach-kirkwood/board-nsa310.c b/arch/arm/mach-kirkwood/board-nsa310.c
> >>index 1bd328d..0b99533 100644
> >>--- a/arch/arm/mach-kirkwood/board-nsa310.c
> >>+++ b/arch/arm/mach-kirkwood/board-nsa310.c
> >>@@ -10,11 +10,8 @@
> >>
> >>  #include <linux/kernel.h>
> >>  #include <linux/init.h>
> >>-#include <linux/i2c.h>
> >>-
> >>-#include <asm/mach-types.h>
> >>-#include <asm/mach/arch.h>
> >>  #include <mach/kirkwood.h>
> >>+#include <linux/of.h>
> >>  #include "common.h"
> >>  #include "mpp.h"
> >>
> >>@@ -40,11 +37,7 @@ static unsigned int nsa310_mpp_config[] __initdata = {
> >>
> >>  void __init nsa310_init(void)
> >>  {
> >>-	u32 dev, rev;
> >>-
> >>  	kirkwood_mpp_conf(nsa310_mpp_config);
> >>-
> >>-	kirkwood_pcie_id(&dev, &rev);
> >>  }
> >>
> >>  static int __init nsa310_pci_init(void)
> >>--
> >>1.8.1.1
> >>
> >
> >Hi Jason, Tero
> >
> >This board is rather unusual for a Kirkwood. It has no Ethernet
> >interfaces. Is this correct?
> 
> It seems like it really has an Gigabit Ethernet interface:
> http://www.clubic.com/disque-dur-memoire/nas/article-465814-1-zyxel-nsa-310.html

It's easy enough to add, we just need to know the phy_addr.  Does anyone
have one to test?

thx,

Jason.

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

* [RFC PATCH 3/6] ARM: kirkwood: nsa310: cleanup includes and unneeded code
  2013-01-24  5:50   ` Andrew Lunn
  2013-01-24 13:43     ` Florian Fainelli
@ 2013-01-24 15:41     ` Jason Cooper
  1 sibling, 0 replies; 102+ messages in thread
From: Jason Cooper @ 2013-01-24 15:41 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Jan 24, 2013 at 06:50:52AM +0100, Andrew Lunn wrote:
> On Wed, Jan 23, 2013 at 11:34:21PM +0000, Jason Cooper wrote:
> > Signed-off-by: Jason Cooper <jason@lakedaemon.net>
> > ---
> >  arch/arm/mach-kirkwood/board-nsa310.c | 9 +--------
> >  1 file changed, 1 insertion(+), 8 deletions(-)
> > 
> > diff --git a/arch/arm/mach-kirkwood/board-nsa310.c b/arch/arm/mach-kirkwood/board-nsa310.c
> > index 1bd328d..0b99533 100644
> > --- a/arch/arm/mach-kirkwood/board-nsa310.c
> > +++ b/arch/arm/mach-kirkwood/board-nsa310.c
> > @@ -10,11 +10,8 @@
> >  
> >  #include <linux/kernel.h>
> >  #include <linux/init.h>
> > -#include <linux/i2c.h>
> > -
> > -#include <asm/mach-types.h>
> > -#include <asm/mach/arch.h>
> >  #include <mach/kirkwood.h>
> > +#include <linux/of.h>
> >  #include "common.h"
> >  #include "mpp.h"
> >  
> > @@ -40,11 +37,7 @@ static unsigned int nsa310_mpp_config[] __initdata = {
> >  
> >  void __init nsa310_init(void)
> >  {
> > -	u32 dev, rev;
> > -
> >  	kirkwood_mpp_conf(nsa310_mpp_config);
> > -
> > -	kirkwood_pcie_id(&dev, &rev);
> >  }
> >  
> >  static int __init nsa310_pci_init(void)
> > -- 
> > 1.8.1.1
> > 
> 
> Hi Jason, Tero
> 
> This board is rather unusual for a Kirkwood. It has no Ethernet
> interfaces. Is this correct?

Found this [1], it details some mpp we don't have, and a hwmon
interface.  No mention of ethernet, though. :-/  Apparently there's a
buzzer attached to mpp44, fun.

[2] for the nsa320 does initialize it.  Apparently auto-negotiation in
borked?

thx,

Jason.

[1] https://github.com/peeter123/linux-nsa320/blob/master/arch/arm/mach-kirkwood/nsa310-setup.c
[2] https://github.com/peeter123/linux-nsa320/blob/master/arch/arm/mach-kirkwood/nsa320-setup.c

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

* [RFC PATCH 6/6] ARM: kirkwood: consolidate mv643xx_eth init for DT
  2013-01-24 14:37     ` Jason Cooper
@ 2013-01-24 15:54       ` Arnd Bergmann
  2013-01-24 16:13         ` Jason Cooper
  0 siblings, 1 reply; 102+ messages in thread
From: Arnd Bergmann @ 2013-01-24 15:54 UTC (permalink / raw)
  To: linux-arm-kernel

On Thursday 24 January 2013, Jason Cooper wrote:
> I agree, however, there is a long history with that patch.  That driver
> has been in use by powerpc for many years.  We need to be mindful not to
> break existing installations.  I don't think it'll be ready in time for
> v3.9.  So, I'd like to do the cleanup now.
> 
> thx,
> 
> Jason.
> 
> > [1]: http://patchwork.ozlabs.org/patch/175652/

I actually think we can take that patch. The result of the discussion
back then was after all that we won't try to keep the bindings compatible,
and the powerpc version just uses the platform_device part of the driver
by fabricating platform_data from the arch code.

It should not have any impact on this, as long as you ensure that the
platform_data is still supported.

	Arnd

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

* [RFC PATCH 6/6] ARM: kirkwood: consolidate mv643xx_eth init for DT
  2013-01-24 15:54       ` Arnd Bergmann
@ 2013-01-24 16:13         ` Jason Cooper
  2013-01-24 17:51           ` Florian Fainelli
  0 siblings, 1 reply; 102+ messages in thread
From: Jason Cooper @ 2013-01-24 16:13 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Jan 24, 2013 at 03:54:27PM +0000, Arnd Bergmann wrote:
> On Thursday 24 January 2013, Jason Cooper wrote:
> > I agree, however, there is a long history with that patch.  That driver
> > has been in use by powerpc for many years.  We need to be mindful not to
> > break existing installations.  I don't think it'll be ready in time for
> > v3.9.  So, I'd like to do the cleanup now.
> > 
> > > [1]: http://patchwork.ozlabs.org/patch/175652/
> 
> I actually think we can take that patch.

Woot!

> The result of the discussion back then was after all that we won't try
> to keep the bindings compatible, and the powerpc version just uses the
> platform_device part of the driver by fabricating platform_data from
> the arch code.
> 
> It should not have any impact on this, as long as you ensure that the
> platform_data is still supported.

Ian's patch appears to do so.  I'll respin this series using it vice my
lookup table.

thx,

Jason.

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

* [RFC PATCH 6/6] ARM: kirkwood: consolidate mv643xx_eth init for DT
  2013-01-24 16:13         ` Jason Cooper
@ 2013-01-24 17:51           ` Florian Fainelli
  2013-01-24 18:16             ` Jason Cooper
  0 siblings, 1 reply; 102+ messages in thread
From: Florian Fainelli @ 2013-01-24 17:51 UTC (permalink / raw)
  To: linux-arm-kernel

On 01/24/2013 05:13 PM, Jason Cooper wrote:
> On Thu, Jan 24, 2013 at 03:54:27PM +0000, Arnd Bergmann wrote:
>> On Thursday 24 January 2013, Jason Cooper wrote:
>>> I agree, however, there is a long history with that patch.  That driver
>>> has been in use by powerpc for many years.  We need to be mindful not to
>>> break existing installations.  I don't think it'll be ready in time for
>>> v3.9.  So, I'd like to do the cleanup now.
>>>
>>>> [1]: http://patchwork.ozlabs.org/patch/175652/
>> I actually think we can take that patch.
> Woot!
>
>> The result of the discussion back then was after all that we won't try
>> to keep the bindings compatible, and the powerpc version just uses the
>> platform_device part of the driver by fabricating platform_data from
>> the arch code.
>>
>> It should not have any impact on this, as long as you ensure that the
>> platform_data is still supported.
> Ian's patch appears to do so.  I'll respin this series using it vice my
> lookup table.
Sounds good, while at it, I wonder if we could not simplify Ian's patch 
to be limited to the actual Ethernet MAC driver and use Thomas's mvdio 
device tree binding for the MDIO bits of mv643xx_eth. What do you think?
--
Florian

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

* [RFC PATCH 6/6] ARM: kirkwood: consolidate mv643xx_eth init for DT
  2013-01-24 17:51           ` Florian Fainelli
@ 2013-01-24 18:16             ` Jason Cooper
  2013-01-24 20:27               ` Florian Fainelli
  0 siblings, 1 reply; 102+ messages in thread
From: Jason Cooper @ 2013-01-24 18:16 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Jan 24, 2013 at 06:51:43PM +0100, Florian Fainelli wrote:
> On 01/24/2013 05:13 PM, Jason Cooper wrote:
> >On Thu, Jan 24, 2013 at 03:54:27PM +0000, Arnd Bergmann wrote:
> >>On Thursday 24 January 2013, Jason Cooper wrote:
> >>>I agree, however, there is a long history with that patch.  That driver
> >>>has been in use by powerpc for many years.  We need to be mindful not to
> >>>break existing installations.  I don't think it'll be ready in time for
> >>>v3.9.  So, I'd like to do the cleanup now.
> >>>
> >>>>[1]: http://patchwork.ozlabs.org/patch/175652/
> >>>
> >>I actually think we can take that patch.
> >
> >Woot!
> >
> >>The result of the discussion back then was after all that we won't try
> >>to keep the bindings compatible, and the powerpc version just uses the
> >>platform_device part of the driver by fabricating platform_data from
> >>the arch code.
> >>
> >>It should not have any impact on this, as long as you ensure that the
> >>platform_data is still supported.
> >
> >Ian's patch appears to do so.  I'll respin this series using it vice my
> >lookup table.
> >
> Sounds good, while at it, I wonder if we could not simplify Ian's
> patch to be limited to the actual Ethernet MAC driver and use
> Thomas's mvdio device tree binding for the MDIO bits of mv643xx_eth.
> What do you think?

It sounds like you just volunteered ;-)  Do you think you have the time
to knock it out for v3.9?

I'd like to drop most of these board-*.c files for v3.9.  They've been
bugging me since I added the first one (board-dreamplug.c).

thx,

Jason.

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

* [RFC PATCH 6/6] ARM: kirkwood: consolidate mv643xx_eth init for DT
  2013-01-24 18:16             ` Jason Cooper
@ 2013-01-24 20:27               ` Florian Fainelli
  2013-01-24 20:38                 ` Jason Cooper
  0 siblings, 1 reply; 102+ messages in thread
From: Florian Fainelli @ 2013-01-24 20:27 UTC (permalink / raw)
  To: linux-arm-kernel

On Thursday 24 January 2013 13:16:22 Jason Cooper wrote:
> > >Ian's patch appears to do so.  I'll respin this series using it vice my
> > >lookup table.
> > >
> > Sounds good, while at it, I wonder if we could not simplify Ian's
> > patch to be limited to the actual Ethernet MAC driver and use
> > Thomas's mvdio device tree binding for the MDIO bits of mv643xx_eth.
> > What do you think?
> 
> It sounds like you just volunteered ;-)  Do you think you have the time
> to knock it out for v3.9?

I do not have any kirkwood board at the moment and I really want to be able to 
test this properly especially with the "clock must be enabled for ethernet not 
be lost". Let me get one and I should be able to do it. Let's adopt your patch 
for the moment, and once I have a kirkwood board I can deal with the ethernet 
driver device tree bindings.

Does that sound ok with you?

> 
> I'd like to drop most of these board-*.c files for v3.9.  They've been
> bugging me since I added the first one (board-dreamplug.c).
> 
> thx,
> 
> Jason.
-- 
Florian

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

* [RFC PATCH 6/6] ARM: kirkwood: consolidate mv643xx_eth init for DT
  2013-01-24 20:27               ` Florian Fainelli
@ 2013-01-24 20:38                 ` Jason Cooper
  2013-01-24 20:52                   ` Florian Fainelli
  0 siblings, 1 reply; 102+ messages in thread
From: Jason Cooper @ 2013-01-24 20:38 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Jan 24, 2013 at 09:27:24PM +0100, Florian Fainelli wrote:
> On Thursday 24 January 2013 13:16:22 Jason Cooper wrote:
> > > >Ian's patch appears to do so.  I'll respin this series using it vice my
> > > >lookup table.
> > > >
> > > Sounds good, while at it, I wonder if we could not simplify Ian's
> > > patch to be limited to the actual Ethernet MAC driver and use
> > > Thomas's mvdio device tree binding for the MDIO bits of mv643xx_eth.
> > > What do you think?
> > 
> > It sounds like you just volunteered ;-)  Do you think you have the time
> > to knock it out for v3.9?
> 
> I do not have any kirkwood board at the moment and I really want to be able to 
> test this properly especially with the "clock must be enabled for ethernet not 
> be lost". Let me get one and I should be able to do it. Let's adopt your patch 
> for the moment, and once I have a kirkwood board I can deal with the ethernet 
> driver device tree bindings.
> 
> Does that sound ok with you?

using Ian's patch as is, I have the following in kirkwood.dtsi:

+
+               smi0: mdio at 72000 {
+                       compatible = "marvell,mdio-mv643xx";
+                       reg = <0x72000 0x4000>;
+                       interrupts = <46>;
+                       status = "disabled";
+               };
+
+               smi1: mdio at 76000 {
+                       compatible = "marvell,mdio-mv643xx";
+                       reg = <0x76000 0x4000>;
+                       interrupts = <47>;
+                       status = "disabled";
+               };
+
+               egiga0 {
+                       compatible = "marvell,mv643xx-eth";
+                       reg = <0x72000 0x4000>;
+                       mdio = <&smi0>;
+                       port_number = <0>;
+                       phy_addr = <0x80>;
+                       interrupts = <11>;
+                       clocks = <&gate_clk 0>;
+                       status = "disabled";
+               };
+
+               egiga1 {
+                       compatible = "marvell,mv643xx-eth";
+                       reg = <0x76000 0x4000>;
+                       mdio = <&smi1>;
+                       port_number = <1>;
+                       phy_addr = <0x81>;
+                       interrupts = <15>;
+                       clocks = <&gate_clk 19>;
+                       status = "disabled";
+               };

I'll see if I can get it working as is, then we can migrate to Thomas'
mdio bindings.

btw - it might be a shared smi, I haven't looked yet, and haven't
tested...

thx,

Jason.

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

* [RFC PATCH 6/6] ARM: kirkwood: consolidate mv643xx_eth init for DT
  2013-01-24 20:38                 ` Jason Cooper
@ 2013-01-24 20:52                   ` Florian Fainelli
  0 siblings, 0 replies; 102+ messages in thread
From: Florian Fainelli @ 2013-01-24 20:52 UTC (permalink / raw)
  To: linux-arm-kernel

On Thursday 24 January 2013 15:38:24 Jason Cooper wrote:
> On Thu, Jan 24, 2013 at 09:27:24PM +0100, Florian Fainelli wrote:
> > On Thursday 24 January 2013 13:16:22 Jason Cooper wrote:
> > > > >Ian's patch appears to do so.  I'll respin this series using it vice my
> > > > >lookup table.
> > > > >
> > > > Sounds good, while at it, I wonder if we could not simplify Ian's
> > > > patch to be limited to the actual Ethernet MAC driver and use
> > > > Thomas's mvdio device tree binding for the MDIO bits of mv643xx_eth.
> > > > What do you think?
> > > 
> > > It sounds like you just volunteered ;-)  Do you think you have the time
> > > to knock it out for v3.9?
> > 
> > I do not have any kirkwood board at the moment and I really want to be able to 
> > test this properly especially with the "clock must be enabled for ethernet not 
> > be lost". Let me get one and I should be able to do it. Let's adopt your patch 
> > for the moment, and once I have a kirkwood board I can deal with the ethernet 
> > driver device tree bindings.
> > 
> > Does that sound ok with you?
> 
> using Ian's patch as is, I have the following in kirkwood.dtsi:
> 
> +
> +               smi0: mdio at 72000 {
> +                       compatible = "marvell,mdio-mv643xx";
> +                       reg = <0x72000 0x4000>;
> +                       interrupts = <46>;
> +                       status = "disabled";
> +               };
> +
> +               smi1: mdio at 76000 {
> +                       compatible = "marvell,mdio-mv643xx";
> +                       reg = <0x76000 0x4000>;
> +                       interrupts = <47>;
> +                       status = "disabled";
> +               };
> +
> +               egiga0 {
> +                       compatible = "marvell,mv643xx-eth";
> +                       reg = <0x72000 0x4000>;
> +                       mdio = <&smi0>;
> +                       port_number = <0>;
> +                       phy_addr = <0x80>;
> +                       interrupts = <11>;
> +                       clocks = <&gate_clk 0>;
> +                       status = "disabled";
> +               };
> +
> +               egiga1 {
> +                       compatible = "marvell,mv643xx-eth";
> +                       reg = <0x76000 0x4000>;
> +                       mdio = <&smi1>;
> +                       port_number = <1>;
> +                       phy_addr = <0x81>;
> +                       interrupts = <15>;
> +                       clocks = <&gate_clk 19>;
> +                       status = "disabled";
> +               };
> 
> I'll see if I can get it working as is, then we can migrate to Thomas'
> mdio bindings.
> 
> btw - it might be a shared smi, I haven't looked yet, and haven't
> tested...

Ok, the existing mv643xx-eth SMI code also deals with an interrupt-driven SMI
completion scheme, which is not handled yet with Thomas's mvmdio driver.
-- 
Florian

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

* [RFC V2 PATCH 0/8] ARM: kirkwood: cleanup DT conversion
  2013-01-23 23:34 [RFC PATCH 0/6] ARM: kirkwood: cleanup DT conversion Jason Cooper
                   ` (6 preceding siblings ...)
  2013-01-24  1:33 ` [RFC PATCH 0/6] ARM: kirkwood: cleanup DT conversion Jason Cooper
@ 2013-01-25  5:32 ` Jason Cooper
  2013-01-25  5:32   ` [RFC V2 PATCH 1/8] ARM: kirkwood: topkick: init mvsdio via DT Jason Cooper
                     ` (8 more replies)
  2013-01-25 20:53 ` [PATCH V3 " Jason Cooper
  2013-01-26 20:50 ` [PATCH V4 0/8] ARM: kirkwood: cleanup DT conversion Jason Cooper
  9 siblings, 9 replies; 102+ messages in thread
From: Jason Cooper @ 2013-01-25  5:32 UTC (permalink / raw)
  To: linux-arm-kernel

All,

This is a second cut at cleaning up mach-kirkwood/.  There are a few DT
conversions (topkick -> mvsdio, pinctrl) which, once reviewed, I'll put in the
normal pull request cycle.

The others which remove board-*.c files, I'll keep updating against
mvebu/for-next, and then apply at the end of the merge window.

Please test as you are able.

Changes since V1:
 - Included Ian Molton's patch to add DT bindings to mv643xx_eth
 - little doc cleanup
 - tested on dreamplug
   - good: boots fine to bash prompt
   - bad: hangs within one minute of booting (even with init=/bin/sh)
     - no output, just frozen hard
     - will debug more tomorrow

thx,

Jason.


Ian Molton (1):
  mv643xx.c: Add basic device tree support.

Jason Cooper (7):
  ARM: kirkwood: topkick: init mvsdio via DT
  ARM: kirkwood: topkick: convert to pinctrl
  ARM: kirkwood: nsa310: cleanup includes and unneeded code
  ARM: kirkwood: nsa310: convert to pinctrl
  ARM: kirkwood: consolidate DT init of pcie
  ARM: mvebu: correct gated clock documentation
  ARM: kirkwood: mv643xx_eth dt conversion

 .../bindings/clock/mvebu-gated-clock.txt           |   2 +-
 Documentation/devicetree/bindings/net/mv643xx.txt  |  75 +++++++++++++++
 arch/arm/boot/dts/kirkwood-dnskw.dtsi              |   9 ++
 arch/arm/boot/dts/kirkwood-dockstar.dts            |   8 ++
 arch/arm/boot/dts/kirkwood-dreamplug.dts           |  16 ++++
 arch/arm/boot/dts/kirkwood-goflexnet.dts           |   7 ++
 arch/arm/boot/dts/kirkwood-ib62x0.dts              |   9 ++
 arch/arm/boot/dts/kirkwood-iconnect.dts            |   9 ++
 arch/arm/boot/dts/kirkwood-lsxl.dtsi               |  18 ++++
 arch/arm/boot/dts/kirkwood-mplcec4.dts             |  18 ++++
 arch/arm/boot/dts/kirkwood-ns2-common.dtsi         |   9 ++
 arch/arm/boot/dts/kirkwood-ns2lite.dts             |   5 +
 arch/arm/boot/dts/kirkwood-ns2mini.dts             |   5 +
 arch/arm/boot/dts/kirkwood-nsa310.dts              |  99 ++++++++++++++++++++
 arch/arm/boot/dts/kirkwood-openblocks_a6.dts       |   8 ++
 arch/arm/boot/dts/kirkwood-topkick.dts             | 103 +++++++++++++++++++++
 arch/arm/boot/dts/kirkwood.dtsi                    |  38 ++++++++
 arch/arm/mach-kirkwood/Kconfig                     | 101 --------------------
 arch/arm/mach-kirkwood/Makefile                    |  15 ---
 arch/arm/mach-kirkwood/board-dnskw.c               |   7 --
 arch/arm/mach-kirkwood/board-dockstar.c            |  32 -------
 arch/arm/mach-kirkwood/board-dreamplug.c           |  35 -------
 arch/arm/mach-kirkwood/board-dt.c                  |  68 +++++---------
 arch/arm/mach-kirkwood/board-goflexnet.c           |  34 -------
 arch/arm/mach-kirkwood/board-ib62x0.c              |  29 ------
 arch/arm/mach-kirkwood/board-iconnect.c            |  32 -------
 arch/arm/mach-kirkwood/board-lsxl.c                |  36 -------
 arch/arm/mach-kirkwood/board-mplcec4.c             |  36 -------
 arch/arm/mach-kirkwood/board-ns2.c                 |  34 -------
 arch/arm/mach-kirkwood/board-nsa310.c              |  58 ------------
 arch/arm/mach-kirkwood/board-openblocks_a6.c       |  26 ------
 arch/arm/mach-kirkwood/board-ts219.c               |  13 ---
 arch/arm/mach-kirkwood/board-usi_topkick.c         |  77 ---------------
 arch/arm/mach-kirkwood/common.h                    |  69 --------------
 drivers/net/ethernet/marvell/mv643xx_eth.c         |  93 +++++++++++++++++--
 35 files changed, 546 insertions(+), 687 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/net/mv643xx.txt
 delete mode 100644 arch/arm/mach-kirkwood/board-dockstar.c
 delete mode 100644 arch/arm/mach-kirkwood/board-dreamplug.c
 delete mode 100644 arch/arm/mach-kirkwood/board-goflexnet.c
 delete mode 100644 arch/arm/mach-kirkwood/board-ib62x0.c
 delete mode 100644 arch/arm/mach-kirkwood/board-iconnect.c
 delete mode 100644 arch/arm/mach-kirkwood/board-lsxl.c
 delete mode 100644 arch/arm/mach-kirkwood/board-mplcec4.c
 delete mode 100644 arch/arm/mach-kirkwood/board-ns2.c
 delete mode 100644 arch/arm/mach-kirkwood/board-nsa310.c
 delete mode 100644 arch/arm/mach-kirkwood/board-openblocks_a6.c
 delete mode 100644 arch/arm/mach-kirkwood/board-usi_topkick.c

-- 
1.8.1.1

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

* [RFC V2 PATCH 1/8] ARM: kirkwood: topkick: init mvsdio via DT
  2013-01-25  5:32 ` [RFC V2 PATCH 0/8] " Jason Cooper
@ 2013-01-25  5:32   ` Jason Cooper
  2013-01-25  5:32   ` [RFC V2 PATCH 2/8] ARM: kirkwood: topkick: convert to pinctrl Jason Cooper
                     ` (7 subsequent siblings)
  8 siblings, 0 replies; 102+ messages in thread
From: Jason Cooper @ 2013-01-25  5:32 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Jason Cooper <jason@lakedaemon.net>
---
 arch/arm/boot/dts/kirkwood-topkick.dts     | 7 +++++++
 arch/arm/mach-kirkwood/board-usi_topkick.c | 6 ------
 2 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/arch/arm/boot/dts/kirkwood-topkick.dts b/arch/arm/boot/dts/kirkwood-topkick.dts
index cd15452..23c2ddc 100644
--- a/arch/arm/boot/dts/kirkwood-topkick.dts
+++ b/arch/arm/boot/dts/kirkwood-topkick.dts
@@ -54,6 +54,13 @@
 			status = "okay";
 			nr-ports = <1>;
 		};
+
+		mvsdio at 90000 {
+			pinctrl-0 = <&pmx_sdio>;
+			pinctrl-names = "default";
+			status = "okay";
+			/* No CD or WP GPIOs */
+		};
 	};
 
 	gpio-leds {
diff --git a/arch/arm/mach-kirkwood/board-usi_topkick.c b/arch/arm/mach-kirkwood/board-usi_topkick.c
index 23d2dd1..95f0711 100644
--- a/arch/arm/mach-kirkwood/board-usi_topkick.c
+++ b/arch/arm/mach-kirkwood/board-usi_topkick.c
@@ -14,7 +14,6 @@
 #include <linux/init.h>
 #include <linux/mv643xx_eth.h>
 #include <linux/gpio.h>
-#include <linux/platform_data/mmc-mvsdio.h>
 #include "common.h"
 #include "mpp.h"
 
@@ -22,10 +21,6 @@ static struct mv643xx_eth_platform_data topkick_ge00_data = {
 	.phy_addr	= MV643XX_ETH_PHY_ADDR(0),
 };
 
-static struct mvsdio_platform_data topkick_mvsdio_data = {
-	/* unfortunately the CD signal has not been connected */
-};
-
 /*
  * GPIO LED layout
  *
@@ -73,5 +68,4 @@ void __init usi_topkick_init(void)
 
 
 	kirkwood_ge00_init(&topkick_ge00_data);
-	kirkwood_sdio_init(&topkick_mvsdio_data);
 }
-- 
1.8.1.1

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

* [RFC V2 PATCH 2/8] ARM: kirkwood: topkick: convert to pinctrl
  2013-01-25  5:32 ` [RFC V2 PATCH 0/8] " Jason Cooper
  2013-01-25  5:32   ` [RFC V2 PATCH 1/8] ARM: kirkwood: topkick: init mvsdio via DT Jason Cooper
@ 2013-01-25  5:32   ` Jason Cooper
  2013-01-25  5:32   ` [RFC V2 PATCH 3/8] ARM: kirkwood: nsa310: cleanup includes and unneeded code Jason Cooper
                     ` (6 subsequent siblings)
  8 siblings, 0 replies; 102+ messages in thread
From: Jason Cooper @ 2013-01-25  5:32 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Jason Cooper <jason@lakedaemon.net>
---
 arch/arm/boot/dts/kirkwood-topkick.dts     | 88 ++++++++++++++++++++++++++++++
 arch/arm/mach-kirkwood/board-usi_topkick.c | 42 --------------
 2 files changed, 88 insertions(+), 42 deletions(-)

diff --git a/arch/arm/boot/dts/kirkwood-topkick.dts b/arch/arm/boot/dts/kirkwood-topkick.dts
index 23c2ddc..d959873 100644
--- a/arch/arm/boot/dts/kirkwood-topkick.dts
+++ b/arch/arm/boot/dts/kirkwood-topkick.dts
@@ -1,6 +1,7 @@
 /dts-v1/;
 
 /include/ "kirkwood.dtsi"
+/include/ "kirkwood-6281.dtsi"
 
 / {
 	model = "Univeral Scientific Industrial Co. Topkick-1281P2";
@@ -16,6 +17,93 @@
 	};
 
 	ocp at f1000000 {
+		pinctrl: pinctrl at 10000 {
+			/*
+			 * GPIO LED layout
+			 *
+			 *       /-SYS_LED(2)
+			 *       |
+			 *       |   /-DISK_LED
+			 *       |   |
+			 *       |   |   /-WLAN_LED(2)
+			 *       |   |   |
+			 * [SW] [*] [*] [*]
+			 */
+
+			/*
+			 * Switch positions
+			 *
+			 *     /-SW_LEFT(2)
+			 *     |
+			 *     |   /-SW_IDLE
+			 *     |   |
+			 *     |   |   /-SW_RIGHT
+			 *     |   |   |
+			 * PS [L] [I] [R] LEDS
+			 */
+			pinctrl-0 = < &pmx_led_disk_yellow
+				      &pmx_sata0_pwr_enable
+				      &pmx_led_sys_red
+				      &pmx_led_sys_blue
+				      &pmx_led_wifi_green
+				      &pmx_sw_left
+				      &pmx_sw_right
+				      &pmx_sw_idle
+				      &pmx_sw_left2
+				      &pmx_led_wifi_yellow >;
+			pinctrl-names = "default";
+
+			pmx_led_disk_yellow: pmx-led-disk-yellow {
+				marvell,pins = "mpp21";
+				marvell,function = "gpio";
+			};
+
+			pmx_sata0_pwr_enable: pmx-sata0-pwr-enable {
+				marvell,pins = "mpp36";
+				marvell,function = "gpio";
+			};
+
+			pmx_led_sys_red: pmx-led-sys-red {
+				marvell,pins = "mpp37";
+				marvell,function = "gpio";
+			};
+
+			pmx_led_sys_blue: pmx-led-sys-blue {
+				marvell,pins = "mpp38";
+				marvell,function = "gpio";
+			};
+
+			pmx_led_wifi_green: pmx-led-wifi-green {
+				marvell,pins = "mpp39";
+				marvell,function = "gpio";
+			};
+
+			pmx_sw_left: pmx-sw-left {
+				marvell,pins = "mpp43";
+				marvell,function = "gpio";
+			};
+
+			pmx_sw_right: pmx-sw-right {
+				marvell,pins = "mpp44";
+				marvell,function = "gpio";
+			};
+
+			pmx_sw_idle: pmx-sw-idle {
+				marvell,pins = "mpp45";
+				marvell,function = "gpio";
+			};
+
+			pmx_sw_left2: pmx-sw-left2 {
+				marvell,pins = "mpp46";
+				marvell,function = "gpio";
+			};
+
+			pmx_led_wifi_yellow: pmx-led-wifi-yellow {
+				marvell,pins = "mpp48";
+				marvell,function = "gpio";
+			};
+		};
+
 		serial at 12000 {
 			clock-frequency = <200000000>;
 			status = "ok";
diff --git a/arch/arm/mach-kirkwood/board-usi_topkick.c b/arch/arm/mach-kirkwood/board-usi_topkick.c
index 95f0711..1cc04ec 100644
--- a/arch/arm/mach-kirkwood/board-usi_topkick.c
+++ b/arch/arm/mach-kirkwood/board-usi_topkick.c
@@ -15,57 +15,15 @@
 #include <linux/mv643xx_eth.h>
 #include <linux/gpio.h>
 #include "common.h"
-#include "mpp.h"
 
 static struct mv643xx_eth_platform_data topkick_ge00_data = {
 	.phy_addr	= MV643XX_ETH_PHY_ADDR(0),
 };
 
-/*
- * GPIO LED layout
- *
- *       /-SYS_LED(2)
- *       |
- *       |   /-DISK_LED
- *       |   |
- *       |   |   /-WLAN_LED(2)
- *       |   |   |
- * [SW] [*] [*] [*]
- */
-
-/*
- * Switch positions
- *
- *     /-SW_LEFT
- *     |
- *     |   /-SW_IDLE
- *     |   |
- *     |   |   /-SW_RIGHT
- *     |   |   |
- * PS [L] [I] [R] LEDS
- */
-
-static unsigned int topkick_mpp_config[] __initdata = {
-	MPP21_GPIO,	/* DISK_LED           (low active) - yellow */
-	MPP36_GPIO,	/* SATA0 power enable (high active) */
-	MPP37_GPIO,	/* SYS_LED2           (low active) - red */
-	MPP38_GPIO,	/* SYS_LED            (low active) - blue */
-	MPP39_GPIO,	/* WLAN_LED           (low active) - green */
-	MPP43_GPIO,	/* SW_LEFT            (low active) */
-	MPP44_GPIO,     /* SW_RIGHT           (low active) */
-	MPP45_GPIO,	/* SW_IDLE            (low active) */
-	MPP46_GPIO,     /* SW_LEFT            (low active) */
-	MPP48_GPIO,	/* WLAN_LED2          (low active) - yellow */
-	0
-};
-
 void __init usi_topkick_init(void)
 {
 	/*
 	 * Basic setup. Needs to be called early.
 	 */
-	kirkwood_mpp_conf(topkick_mpp_config);
-
-
 	kirkwood_ge00_init(&topkick_ge00_data);
 }
-- 
1.8.1.1

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

* [RFC V2 PATCH 3/8] ARM: kirkwood: nsa310: cleanup includes and unneeded code
  2013-01-25  5:32 ` [RFC V2 PATCH 0/8] " Jason Cooper
  2013-01-25  5:32   ` [RFC V2 PATCH 1/8] ARM: kirkwood: topkick: init mvsdio via DT Jason Cooper
  2013-01-25  5:32   ` [RFC V2 PATCH 2/8] ARM: kirkwood: topkick: convert to pinctrl Jason Cooper
@ 2013-01-25  5:32   ` Jason Cooper
  2013-01-26 20:08     ` Sergei Shtylyov
  2013-01-25  5:32   ` [RFC V2 PATCH 4/8] ARM: kirkwood: nsa310: convert to pinctrl Jason Cooper
                     ` (5 subsequent siblings)
  8 siblings, 1 reply; 102+ messages in thread
From: Jason Cooper @ 2013-01-25  5:32 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Jason Cooper <jason@lakedaemon.net>
---
 arch/arm/mach-kirkwood/board-nsa310.c | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/arch/arm/mach-kirkwood/board-nsa310.c b/arch/arm/mach-kirkwood/board-nsa310.c
index 1bd328d..0b99533 100644
--- a/arch/arm/mach-kirkwood/board-nsa310.c
+++ b/arch/arm/mach-kirkwood/board-nsa310.c
@@ -10,11 +10,8 @@
 
 #include <linux/kernel.h>
 #include <linux/init.h>
-#include <linux/i2c.h>
-
-#include <asm/mach-types.h>
-#include <asm/mach/arch.h>
 #include <mach/kirkwood.h>
+#include <linux/of.h>
 #include "common.h"
 #include "mpp.h"
 
@@ -40,11 +37,7 @@ static unsigned int nsa310_mpp_config[] __initdata = {
 
 void __init nsa310_init(void)
 {
-	u32 dev, rev;
-
 	kirkwood_mpp_conf(nsa310_mpp_config);
-
-	kirkwood_pcie_id(&dev, &rev);
 }
 
 static int __init nsa310_pci_init(void)
-- 
1.8.1.1

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

* [RFC V2 PATCH 4/8] ARM: kirkwood: nsa310: convert to pinctrl
  2013-01-25  5:32 ` [RFC V2 PATCH 0/8] " Jason Cooper
                     ` (2 preceding siblings ...)
  2013-01-25  5:32   ` [RFC V2 PATCH 3/8] ARM: kirkwood: nsa310: cleanup includes and unneeded code Jason Cooper
@ 2013-01-25  5:32   ` Jason Cooper
  2013-01-25  5:32   ` [RFC V2 PATCH 5/8] ARM: kirkwood: consolidate DT init of pcie Jason Cooper
                     ` (4 subsequent siblings)
  8 siblings, 0 replies; 102+ messages in thread
From: Jason Cooper @ 2013-01-25  5:32 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Jason Cooper <jason@lakedaemon.net>
---
 arch/arm/boot/dts/kirkwood-nsa310.dts | 99 +++++++++++++++++++++++++++++++++++
 arch/arm/mach-kirkwood/board-dt.c     |  3 --
 arch/arm/mach-kirkwood/board-nsa310.c | 26 ---------
 arch/arm/mach-kirkwood/common.h       |  6 ---
 4 files changed, 99 insertions(+), 35 deletions(-)

diff --git a/arch/arm/boot/dts/kirkwood-nsa310.dts b/arch/arm/boot/dts/kirkwood-nsa310.dts
index dbb3551..3a178cf 100644
--- a/arch/arm/boot/dts/kirkwood-nsa310.dts
+++ b/arch/arm/boot/dts/kirkwood-nsa310.dts
@@ -16,6 +16,105 @@
 	};
 
 	ocp at f1000000 {
+		pinctrl: pinctrl at 10000 {
+			pinctrl-0 = < &pmx_led_esata_green
+				      &pmx_led_esata_red
+				      &pmx_led_usb_green
+				      &pmx_led_usb_red
+				      &pmx_usb_power_off
+				      &pmx_led_sys_green
+				      &pmx_led_sys_red
+				      &pmx_btn_reset
+				      &pmx_btn_copy
+				      &pmx_led_copy_green
+				      &pmx_led_copy_red
+				      &pmx_led_hdd_green
+				      &pmx_led_hdd_red
+				      &pmx_unknown
+				      &pmx_btn_power
+				      &pmx_pwr_off >;
+			pinctrl-names = "default";
+
+			pmx_led_esata_green: pmx-led-esata-green {
+				marvell,pins = "mpp12";
+				marvell,function = "gpio";
+			};
+
+			pmx_led_esata_red: pmx-led-esata-red {
+				marvell,pins = "mpp13";
+				marvell,function = "gpio";
+			};
+
+			pmx_led_usb_green: pmx-led-usb-green {
+				marvell,pins = "mpp15";
+				marvell,function = "gpio";
+			};
+
+			pmx_led_usb_red: pmx-led-usb-red {
+				marvell,pins = "mpp16";
+				marvell,function = "gpio";
+			};
+
+			pmx_usb_power_off: pmx-usb-power-off {
+				marvell,pins = "mpp21";
+				marvell,function = "gpio";
+			};
+
+			pmx_led_sys_green: pmx-led-sys-green {
+				marvell,pins = "mpp28";
+				marvell,function = "gpio";
+			};
+
+			pmx_led_sys_red: pmx-led-sys-red {
+				marvell,pins = "mpp29";
+				marvell,function = "gpio";
+			};
+
+			pmx_btn_reset: pmx-btn-reset {
+				marvell,pins = "mpp36";
+				marvell,function = "gpio";
+			};
+
+			pmx_btn_copy: pmx-btn-copy {
+				marvell,pins = "mpp37";
+				marvell,function = "gpio";
+			};
+
+			pmx_led_copy_green: pmx-led-copy-green {
+				marvell,pins = "mpp39";
+				marvell,function = "gpio";
+			};
+
+			pmx_led_copy_red: pmx-led-copy-red {
+				marvell,pins = "mpp40";
+				marvell,function = "gpio";
+			};
+
+			pmx_led_hdd_green: pmx-led-hdd-green {
+				marvell,pins = "mpp41";
+				marvell,function = "gpio";
+			};
+
+			pmx_led_hdd_red: pmx-led-hdd-red {
+				marvell,pins = "mpp42";
+				marvell,function = "gpio";
+			};
+
+			pmx_unknown: pmx-unknown {
+				marvell,pins = "mpp44";
+				marvell,function = "gpio";
+			};
+
+			pmx_btn_power: pmx-btn-power {
+				marvell,pins = "mpp46";
+				marvell,function = "gpio";
+			};
+
+			pmx_pwr_off: pmx-pwr-off {
+				marvell,pins = "mpp48";
+				marvell,function = "gpio";
+			};
+		};
 
 		serial at 12000 {
 			clock-frequency = <200000000>;
diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c
index 8eac548..8b35157 100644
--- a/arch/arm/mach-kirkwood/board-dt.c
+++ b/arch/arm/mach-kirkwood/board-dt.c
@@ -141,9 +141,6 @@ static void __init kirkwood_dt_init(void)
 	if (of_machine_is_compatible("usi,topkick"))
 		usi_topkick_init();
 
-	if (of_machine_is_compatible("zyxel,nsa310"))
-		nsa310_init();
-
 	of_platform_populate(NULL, kirkwood_dt_match_table, NULL, NULL);
 }
 
diff --git a/arch/arm/mach-kirkwood/board-nsa310.c b/arch/arm/mach-kirkwood/board-nsa310.c
index 0b99533..55ade93 100644
--- a/arch/arm/mach-kirkwood/board-nsa310.c
+++ b/arch/arm/mach-kirkwood/board-nsa310.c
@@ -13,32 +13,6 @@
 #include <mach/kirkwood.h>
 #include <linux/of.h>
 #include "common.h"
-#include "mpp.h"
-
-static unsigned int nsa310_mpp_config[] __initdata = {
-	MPP12_GPIO, /* led esata green */
-	MPP13_GPIO, /* led esata red */
-	MPP15_GPIO, /* led usb green */
-	MPP16_GPIO, /* led usb red */
-	MPP21_GPIO, /* control usb power off */
-	MPP28_GPIO, /* led sys green */
-	MPP29_GPIO, /* led sys red */
-	MPP36_GPIO, /* key reset */
-	MPP37_GPIO, /* key copy */
-	MPP39_GPIO, /* led copy green */
-	MPP40_GPIO, /* led copy red */
-	MPP41_GPIO, /* led hdd green */
-	MPP42_GPIO, /* led hdd red */
-	MPP44_GPIO, /* ?? */
-	MPP46_GPIO, /* key power */
-	MPP48_GPIO, /* control power off */
-	0
-};
-
-void __init nsa310_init(void)
-{
-	kirkwood_mpp_conf(nsa310_mpp_config);
-}
 
 static int __init nsa310_pci_init(void)
 {
diff --git a/arch/arm/mach-kirkwood/common.h b/arch/arm/mach-kirkwood/common.h
index e956d02..1c42cb8 100644
--- a/arch/arm/mach-kirkwood/common.h
+++ b/arch/arm/mach-kirkwood/common.h
@@ -130,12 +130,6 @@ void ns2_init(void);
 static inline void ns2_init(void) {};
 #endif
 
-#ifdef CONFIG_MACH_NSA310_DT
-void nsa310_init(void);
-#else
-static inline void nsa310_init(void) {};
-#endif
-
 #ifdef CONFIG_MACH_OPENBLOCKS_A6_DT
 void openblocks_a6_init(void);
 #else
-- 
1.8.1.1

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

* [RFC V2 PATCH 5/8] ARM: kirkwood: consolidate DT init of pcie
  2013-01-25  5:32 ` [RFC V2 PATCH 0/8] " Jason Cooper
                     ` (3 preceding siblings ...)
  2013-01-25  5:32   ` [RFC V2 PATCH 4/8] ARM: kirkwood: nsa310: convert to pinctrl Jason Cooper
@ 2013-01-25  5:32   ` Jason Cooper
  2013-01-25  5:32   ` [RFC V2 PATCH 6/8] ARM: mvebu: correct gated clock documentation Jason Cooper
                     ` (3 subsequent siblings)
  8 siblings, 0 replies; 102+ messages in thread
From: Jason Cooper @ 2013-01-25  5:32 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Jason Cooper <jason@lakedaemon.net>
---
 arch/arm/mach-kirkwood/Makefile         |  1 -
 arch/arm/mach-kirkwood/board-dt.c       | 23 +++++++++++++++++++++++
 arch/arm/mach-kirkwood/board-iconnect.c |  9 ---------
 arch/arm/mach-kirkwood/board-mplcec4.c  |  1 -
 arch/arm/mach-kirkwood/board-nsa310.c   | 25 -------------------------
 arch/arm/mach-kirkwood/board-ts219.c    | 13 -------------
 6 files changed, 23 insertions(+), 49 deletions(-)
 delete mode 100644 arch/arm/mach-kirkwood/board-nsa310.c

diff --git a/arch/arm/mach-kirkwood/Makefile b/arch/arm/mach-kirkwood/Makefile
index d665309..ee3aa77 100644
--- a/arch/arm/mach-kirkwood/Makefile
+++ b/arch/arm/mach-kirkwood/Makefile
@@ -36,6 +36,5 @@ obj-$(CONFIG_MACH_NETSPACE_V2_DT)	+= board-ns2.o
 obj-$(CONFIG_MACH_NETSPACE_MAX_V2_DT)	+= board-ns2.o
 obj-$(CONFIG_MACH_NETSPACE_LITE_V2_DT)	+= board-ns2.o
 obj-$(CONFIG_MACH_NETSPACE_MINI_V2_DT)	+= board-ns2.o
-obj-$(CONFIG_MACH_NSA310_DT)		+= board-nsa310.o
 obj-$(CONFIG_MACH_OPENBLOCKS_A6_DT)	+= board-openblocks_a6.o
 obj-$(CONFIG_MACH_TOPKICK_DT)		+= board-usi_topkick.o
diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c
index 8b35157..73b76e4 100644
--- a/arch/arm/mach-kirkwood/board-dt.c
+++ b/arch/arm/mach-kirkwood/board-dt.c
@@ -70,6 +70,29 @@ static void __init kirkwood_of_clk_init(void)
 	kirkwood_legacy_clk_init();
 }
 
+static const char * const kirkwood_dt_pcie0_compat[] = {
+	"iom,iconnect",
+	"mpl,cec4",
+	"qnap,ts219",
+	"zyxel,nsa310",
+	NULL
+};
+
+static int __init kirkwood_pcie_dt_init(void)
+{
+	int i;
+
+	for (i = 0; kirkwood_dt_pcie0_compat[i] != NULL; i++) {
+		if (of_machine_is_compatible(kirkwood_dt_pcie0_compat[i])) {
+			kirkwood_pcie_init(KW_PCIE0);
+			break;
+		}
+	}
+
+	return 0;
+}
+subsys_initcall(kirkwood_pcie_dt_init);
+
 static void __init kirkwood_dt_init(void)
 {
 	pr_info("Kirkwood: %s, TCLK=%d.\n", kirkwood_id(), kirkwood_tclk);
diff --git a/arch/arm/mach-kirkwood/board-iconnect.c b/arch/arm/mach-kirkwood/board-iconnect.c
index c8ebde4..ff042dc 100644
--- a/arch/arm/mach-kirkwood/board-iconnect.c
+++ b/arch/arm/mach-kirkwood/board-iconnect.c
@@ -10,7 +10,6 @@
 
 #include <linux/kernel.h>
 #include <linux/init.h>
-#include <linux/of.h>
 #include <linux/mv643xx_eth.h>
 #include "common.h"
 
@@ -22,11 +21,3 @@ void __init iconnect_init(void)
 {
 	kirkwood_ge00_init(&iconnect_ge00_data);
 }
-
-static int __init iconnect_pci_init(void)
-{
-	if (of_machine_is_compatible("iom,iconnect"))
-		kirkwood_pcie_init(KW_PCIE0);
-	return 0;
-}
-subsys_initcall(iconnect_pci_init);
diff --git a/arch/arm/mach-kirkwood/board-mplcec4.c b/arch/arm/mach-kirkwood/board-mplcec4.c
index 7d6dc66..938712e 100644
--- a/arch/arm/mach-kirkwood/board-mplcec4.c
+++ b/arch/arm/mach-kirkwood/board-mplcec4.c
@@ -29,7 +29,6 @@ void __init mplcec4_init(void)
 	 */
 	kirkwood_ge00_init(&mplcec4_ge00_data);
 	kirkwood_ge01_init(&mplcec4_ge01_data);
-	kirkwood_pcie_init(KW_PCIE0);
 }
 
 
diff --git a/arch/arm/mach-kirkwood/board-nsa310.c b/arch/arm/mach-kirkwood/board-nsa310.c
deleted file mode 100644
index 55ade93..0000000
--- a/arch/arm/mach-kirkwood/board-nsa310.c
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * arch/arm/mach-kirkwood/nsa-310-setup.c
- *
- * ZyXEL NSA-310 Setup
- *
- * 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 <mach/kirkwood.h>
-#include <linux/of.h>
-#include "common.h"
-
-static int __init nsa310_pci_init(void)
-{
-	if (of_machine_is_compatible("zyxel,nsa310"))
-		kirkwood_pcie_init(KW_PCIE0);
-
-	return 0;
-}
-
-subsys_initcall(nsa310_pci_init);
diff --git a/arch/arm/mach-kirkwood/board-ts219.c b/arch/arm/mach-kirkwood/board-ts219.c
index 10fb397..f00c0a9 100644
--- a/arch/arm/mach-kirkwood/board-ts219.c
+++ b/arch/arm/mach-kirkwood/board-ts219.c
@@ -17,10 +17,7 @@
 
 #include <linux/kernel.h>
 #include <linux/init.h>
-#include <linux/platform_device.h>
 #include <linux/mv643xx_eth.h>
-#include <asm/mach-types.h>
-#include <asm/mach/arch.h>
 #include <mach/kirkwood.h>
 #include "common.h"
 
@@ -38,13 +35,3 @@ void __init qnap_dt_ts219_init(void)
 
 	kirkwood_ge00_init(&qnap_ts219_ge00_data);
 }
-
-/* FIXME: Will not work with DT. Maybe use MPP40_GPIO? */
-static int __init ts219_pci_init(void)
-{
-	if (machine_is_ts219())
-		kirkwood_pcie_init(KW_PCIE0);
-
-	return 0;
-}
-subsys_initcall(ts219_pci_init);
-- 
1.8.1.1

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

* [RFC V2 PATCH 6/8] ARM: mvebu: correct gated clock documentation
  2013-01-25  5:32 ` [RFC V2 PATCH 0/8] " Jason Cooper
                     ` (4 preceding siblings ...)
  2013-01-25  5:32   ` [RFC V2 PATCH 5/8] ARM: kirkwood: consolidate DT init of pcie Jason Cooper
@ 2013-01-25  5:32   ` Jason Cooper
  2013-01-25  5:32   ` [RFC V2 PATCH 7/8] mv643xx.c: Add basic device tree support Jason Cooper
                     ` (2 subsequent siblings)
  8 siblings, 0 replies; 102+ messages in thread
From: Jason Cooper @ 2013-01-25  5:32 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Jason Cooper <jason@lakedaemon.net>
---
 Documentation/devicetree/bindings/clock/mvebu-gated-clock.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/clock/mvebu-gated-clock.txt b/Documentation/devicetree/bindings/clock/mvebu-gated-clock.txt
index 7337005..cffc93d 100644
--- a/Documentation/devicetree/bindings/clock/mvebu-gated-clock.txt
+++ b/Documentation/devicetree/bindings/clock/mvebu-gated-clock.txt
@@ -89,7 +89,7 @@ ID	Clock	Peripheral
 16	xor1	XOR DMA 1
 17	crypto	CESA engine
 18	pex1	PCIe Cntrl 1
-19	ge1	Gigabit Ethernet 0
+19	ge1	Gigabit Ethernet 1
 20	tdm	Time Division Mplx
 
 Required properties:
-- 
1.8.1.1

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

* [RFC V2 PATCH 7/8] mv643xx.c: Add basic device tree support.
  2013-01-25  5:32 ` [RFC V2 PATCH 0/8] " Jason Cooper
                     ` (5 preceding siblings ...)
  2013-01-25  5:32   ` [RFC V2 PATCH 6/8] ARM: mvebu: correct gated clock documentation Jason Cooper
@ 2013-01-25  5:32   ` Jason Cooper
  2013-01-25  5:32   ` [RFC V2 PATCH 8/8] ARM: kirkwood: mv643xx_eth dt conversion Jason Cooper
  2013-01-25 11:15   ` [RFC V2 PATCH 0/8] ARM: kirkwood: cleanup DT conversion Arnd Bergmann
  8 siblings, 0 replies; 102+ messages in thread
From: Jason Cooper @ 2013-01-25  5:32 UTC (permalink / raw)
  To: linux-arm-kernel

From: Ian Molton <ian.molton@codethink.co.uk>

    This patch adds basic device tree support to the mv643xx ethernet driver.

    It should be enough for most current users of the device, and should allow
    a painless migration.

    Signed-off-by: Ian Molton <ian.molton@codethink.co.uk>

Signed-off-by: Jason Cooper <jason@lakedaemon.net>
---
 Documentation/devicetree/bindings/net/mv643xx.txt | 75 ++++++++++++++++++
 drivers/net/ethernet/marvell/mv643xx_eth.c        | 93 +++++++++++++++++++++--
 2 files changed, 161 insertions(+), 7 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/net/mv643xx.txt

diff --git a/Documentation/devicetree/bindings/net/mv643xx.txt b/Documentation/devicetree/bindings/net/mv643xx.txt
new file mode 100644
index 0000000..2727f798
--- /dev/null
+++ b/Documentation/devicetree/bindings/net/mv643xx.txt
@@ -0,0 +1,75 @@
+mv643xx related nodes.
+
+marvell,mdio-mv643xx:
+
+Required properties:
+
+ - interrupts : <a> where a is the SMI interrupt number.
+ - reg : the base address and size of the controllers register space.
+
+Optional properties:
+ - shared_smi : on some chips, the second PHY is "shared", meaning it is
+	really accessed via the first SMI controller. It is passed in this
+	way due to the present structure of the driver, which requires the
+	base address for the MAC to be passed in via the SMI controllers
+	platform data.
+ - tx_csum_limit : on some devices, this option is required for proper
+	operation wrt. jumbo frames.
+
+
+Example:
+
+smi0: mdio at 72000 {
+	compatible = "marvell,mdio-mv643xx";
+	reg = <0x72000 0x4000>;
+	interrupts = <46>;
+	tx_csum_limit = <1600>;
+	status = "disabled";
+};
+
+smi1: mdio at 76000 {
+	compatible = "marvell,mdio-mv643xx";
+	reg = <0x76000 0x4000>;
+	interrupts = <47>;
+	shared_smi = <&smi0>;
+	tx_csum_limit = <1600>;
+	status = "disabled";
+};
+
+
+
+marvell,mv643xx-eth:
+
+Required properties:
+ - interrupts : the port interrupt number.
+ - mdio : phandle of the smi device as drescribed above
+
+Optional properties:
+ - port_number : the port number on this bus.
+ - phy_addr : the PHY address.
+ - reg : should match the mdio reg this device is attached to.
+	this is a required hack for now due to the way the
+	driver is constructed. This allows the device clock to be
+	kept running so that the MAC is not lost after boot.
+
+
+Example:
+
+egiga0 {
+	compatible = "marvell,mv643xx-eth";
+	reg = <0x72000 0x4000>;
+	mdio = <&smi0>;
+	port_number = <0>;
+	phy_addr = <0x80>;
+	interrupts = <11>;
+};
+
+egiga1 {
+	compatible = "marvell,mv643xx-eth";
+	reg = <0x76000 0x4000>;
+	mdio = <&smi1>;
+	port_number = <0>;
+	phy_addr = <0x81>;
+	interrupts = <15>;
+};
+
diff --git a/drivers/net/ethernet/marvell/mv643xx_eth.c b/drivers/net/ethernet/marvell/mv643xx_eth.c
index 84c1326..7048d7c 100644
--- a/drivers/net/ethernet/marvell/mv643xx_eth.c
+++ b/drivers/net/ethernet/marvell/mv643xx_eth.c
@@ -48,6 +48,9 @@
 #include <linux/ethtool.h>
 #include <linux/platform_device.h>
 #include <linux/module.h>
+#include <linux/of.h>
+#include <linux/of_platform.h>
+#include <linux/of_irq.h>
 #include <linux/kernel.h>
 #include <linux/spinlock.h>
 #include <linux/workqueue.h>
@@ -2586,7 +2589,7 @@ static void infer_hw_params(struct mv643xx_eth_shared_private *msp)
 static int mv643xx_eth_shared_probe(struct platform_device *pdev)
 {
 	static int mv643xx_eth_version_printed;
-	struct mv643xx_eth_shared_platform_data *pd = pdev->dev.platform_data;
+	struct mv643xx_eth_shared_platform_data *pd;
 	struct mv643xx_eth_shared_private *msp;
 	const struct mbus_dram_target_info *dram;
 	struct resource *res;
@@ -2610,6 +2613,26 @@ static int mv643xx_eth_shared_probe(struct platform_device *pdev)
 	if (msp->base == NULL)
 		goto out_free;
 
+	if (pdev->dev.of_node) {
+		struct device_node *np = NULL;
+
+		/* when all users of this driver use FDT, we can remove this */
+		pd = kzalloc(sizeof(*pd), GFP_KERNEL);
+		if (!pd) {
+			dev_dbg(&pdev->dev, "Could not allocate platform data\n");
+			goto out_free;
+		}
+
+		of_property_read_u32(pdev->dev.of_node,
+			"tx_csum_limit", &pd->tx_csum_limit);
+
+		np = of_parse_phandle(pdev->dev.of_node, "shared_smi", 0);
+		if (np)
+			pd->shared_smi = of_find_device_by_node(np);
+
+	} else {
+		pd = pdev->dev.platform_data;
+	}
 	/*
 	 * Set up and register SMI bus.
 	 */
@@ -2642,7 +2665,6 @@ static int mv643xx_eth_shared_probe(struct platform_device *pdev)
 	res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
 	if (res != NULL) {
 		int err;
-
 		err = request_irq(res->start, mv643xx_eth_err_irq,
 				  IRQF_SHARED, "mv643xx_eth", msp);
 		if (!err) {
@@ -2660,6 +2682,10 @@ static int mv643xx_eth_shared_probe(struct platform_device *pdev)
 
 	msp->tx_csum_limit = (pd != NULL && pd->tx_csum_limit) ?
 					pd->tx_csum_limit : 9 * 1024;
+
+	if (pdev->dev.of_node)
+		kfree(pd);  /* If we created a fake pd, free it now */
+
 	infer_hw_params(msp);
 
 	platform_set_drvdata(pdev, msp);
@@ -2693,12 +2719,21 @@ static int mv643xx_eth_shared_remove(struct platform_device *pdev)
 	return 0;
 }
 
+#ifdef CONFIG_OF
+static struct of_device_id mv_mdio_dt_ids[] __devinitdata = {
+	{ .compatible = "marvell,mdio-mv643xx", },
+	{},
+};
+MODULE_DEVICE_TABLE(of, mv_mdio_dt_ids);
+#endif
+
 static struct platform_driver mv643xx_eth_shared_driver = {
 	.probe		= mv643xx_eth_shared_probe,
 	.remove		= mv643xx_eth_shared_remove,
 	.driver = {
 		.name	= MV643XX_ETH_SHARED_NAME,
 		.owner	= THIS_MODULE,
+		.of_match_table = of_match_ptr(mv_mdio_dt_ids),
 	},
 };
 
@@ -2858,7 +2893,36 @@ static int mv643xx_eth_probe(struct platform_device *pdev)
 	struct resource *res;
 	int err;
 
-	pd = pdev->dev.platform_data;
+	if (pdev->dev.of_node) {
+		struct device_node *np = NULL;
+
+		/* when all users of this driver use FDT, we can remove this */
+		pd = kzalloc(sizeof(*pd), GFP_KERNEL);
+		if (!pd) {
+			dev_dbg(&pdev->dev, "Could not allocate platform data\n");
+			return -ENOMEM;
+		}
+
+		of_property_read_u32(pdev->dev.of_node,
+			"port_number", &pd->port_number);
+
+		if (!of_property_read_u32(pdev->dev.of_node,
+				"phy_addr", &pd->phy_addr))
+			pd->phy_addr = MV643XX_ETH_PHY_ADDR(pd->phy_addr);
+		else
+			pd->phy_addr = MV643XX_ETH_PHY_ADDR_DEFAULT;
+
+		np = of_parse_phandle(pdev->dev.of_node, "mdio", 0);
+		if (np) {
+			pd->shared = of_find_device_by_node(np);
+		} else {
+			kfree(pd);
+			return -ENODEV;
+		}
+	} else {
+		pd = pdev->dev.platform_data;
+	}
+
 	if (pd == NULL) {
 		dev_err(&pdev->dev, "no mv643xx_eth_platform_data\n");
 		return -ENODEV;
@@ -2866,12 +2930,15 @@ static int mv643xx_eth_probe(struct platform_device *pdev)
 
 	if (pd->shared == NULL) {
 		dev_err(&pdev->dev, "no mv643xx_eth_platform_data->shared\n");
-		return -ENODEV;
+		err = -ENODEV;
+		goto out_free_pd;
 	}
 
 	dev = alloc_etherdev_mq(sizeof(struct mv643xx_eth_private), 8);
-	if (!dev)
-		return -ENOMEM;
+	if (!dev) {
+		err = -ENOMEM;
+		goto out_free_pd;
+	}
 
 	mp = netdev_priv(dev);
 	platform_set_drvdata(pdev, mp);
@@ -2908,6 +2975,8 @@ static int mv643xx_eth_probe(struct platform_device *pdev)
 
 	init_pscr(mp, pd->speed, pd->duplex);
 
+	if (pdev->dev.of_node)
+		kfree(pd); /* If we created a fake pd, free it now */
 
 	mib_counters_clear(mp);
 
@@ -2927,7 +2996,6 @@ static int mv643xx_eth_probe(struct platform_device *pdev)
 	mp->rx_oom.data = (unsigned long)mp;
 	mp->rx_oom.function = oom_timer_wrapper;
 
-
 	res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
 	BUG_ON(!res);
 	dev->irq = res->start;
@@ -2976,6 +3044,8 @@ out:
 	}
 #endif
 	free_netdev(dev);
+out_free_pd:
+	kfree(pd);
 
 	return err;
 }
@@ -3015,6 +3085,14 @@ static void mv643xx_eth_shutdown(struct platform_device *pdev)
 		port_reset(mp);
 }
 
+#ifdef CONFIG_OF
+static struct of_device_id mv_eth_dt_ids[] __devinitdata = {
+	{ .compatible = "marvell,mv643xx-eth", },
+	{},
+};
+MODULE_DEVICE_TABLE(of, mv_eth_dt_ids);
+#endif
+
 static struct platform_driver mv643xx_eth_driver = {
 	.probe		= mv643xx_eth_probe,
 	.remove		= mv643xx_eth_remove,
@@ -3022,6 +3100,7 @@ static struct platform_driver mv643xx_eth_driver = {
 	.driver = {
 		.name	= MV643XX_ETH_NAME,
 		.owner	= THIS_MODULE,
+		.of_match_table = of_match_ptr(mv_eth_dt_ids),
 	},
 };
 
-- 
1.8.1.1

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

* [RFC V2 PATCH 8/8] ARM: kirkwood: mv643xx_eth dt conversion
  2013-01-25  5:32 ` [RFC V2 PATCH 0/8] " Jason Cooper
                     ` (6 preceding siblings ...)
  2013-01-25  5:32   ` [RFC V2 PATCH 7/8] mv643xx.c: Add basic device tree support Jason Cooper
@ 2013-01-25  5:32   ` Jason Cooper
  2013-01-25 11:15   ` [RFC V2 PATCH 0/8] ARM: kirkwood: cleanup DT conversion Arnd Bergmann
  8 siblings, 0 replies; 102+ messages in thread
From: Jason Cooper @ 2013-01-25  5:32 UTC (permalink / raw)
  To: linux-arm-kernel

Tested on the dreamplug:

mv643xx_eth: MV-643xx 10/100/1000 ethernet driver version 1.4
libphy: mv643xx_eth smi: probed
libphy: mv643xx_eth smi: probed
mv643xx_eth_port f1072000.egiga0 eth0: port 0 with MAC address XX:XX:XX:XX:XX:XX
mv643xx_eth_port f1076000.egiga1 eth1: port 0 with MAC address XX:XX:XX:XX:XX:XX

Signed-off-by: Jason Cooper <jason@lakedaemon.net>
---
 arch/arm/boot/dts/kirkwood-dnskw.dtsi        |   9 +++
 arch/arm/boot/dts/kirkwood-dockstar.dts      |   8 +++
 arch/arm/boot/dts/kirkwood-dreamplug.dts     |  16 +++++
 arch/arm/boot/dts/kirkwood-goflexnet.dts     |   7 ++
 arch/arm/boot/dts/kirkwood-ib62x0.dts        |   9 +++
 arch/arm/boot/dts/kirkwood-iconnect.dts      |   9 +++
 arch/arm/boot/dts/kirkwood-lsxl.dtsi         |  18 +++++
 arch/arm/boot/dts/kirkwood-mplcec4.dts       |  18 +++++
 arch/arm/boot/dts/kirkwood-ns2-common.dtsi   |   9 +++
 arch/arm/boot/dts/kirkwood-ns2lite.dts       |   5 ++
 arch/arm/boot/dts/kirkwood-ns2mini.dts       |   5 ++
 arch/arm/boot/dts/kirkwood-openblocks_a6.dts |   8 +++
 arch/arm/boot/dts/kirkwood-topkick.dts       |   8 +++
 arch/arm/boot/dts/kirkwood.dtsi              |  38 ++++++++++
 arch/arm/mach-kirkwood/Kconfig               | 101 ---------------------------
 arch/arm/mach-kirkwood/Makefile              |  14 ----
 arch/arm/mach-kirkwood/board-dnskw.c         |   7 --
 arch/arm/mach-kirkwood/board-dockstar.c      |  32 ---------
 arch/arm/mach-kirkwood/board-dreamplug.c     |  35 ----------
 arch/arm/mach-kirkwood/board-dt.c            |  42 -----------
 arch/arm/mach-kirkwood/board-goflexnet.c     |  34 ---------
 arch/arm/mach-kirkwood/board-ib62x0.c        |  29 --------
 arch/arm/mach-kirkwood/board-iconnect.c      |  23 ------
 arch/arm/mach-kirkwood/board-lsxl.c          |  36 ----------
 arch/arm/mach-kirkwood/board-mplcec4.c       |  35 ----------
 arch/arm/mach-kirkwood/board-ns2.c           |  34 ---------
 arch/arm/mach-kirkwood/board-openblocks_a6.c |  26 -------
 arch/arm/mach-kirkwood/board-usi_topkick.c   |  29 --------
 arch/arm/mach-kirkwood/common.h              |  63 -----------------
 29 files changed, 167 insertions(+), 540 deletions(-)
 delete mode 100644 arch/arm/mach-kirkwood/board-dockstar.c
 delete mode 100644 arch/arm/mach-kirkwood/board-dreamplug.c
 delete mode 100644 arch/arm/mach-kirkwood/board-goflexnet.c
 delete mode 100644 arch/arm/mach-kirkwood/board-ib62x0.c
 delete mode 100644 arch/arm/mach-kirkwood/board-iconnect.c
 delete mode 100644 arch/arm/mach-kirkwood/board-lsxl.c
 delete mode 100644 arch/arm/mach-kirkwood/board-mplcec4.c
 delete mode 100644 arch/arm/mach-kirkwood/board-ns2.c
 delete mode 100644 arch/arm/mach-kirkwood/board-openblocks_a6.c
 delete mode 100644 arch/arm/mach-kirkwood/board-usi_topkick.c

diff --git a/arch/arm/boot/dts/kirkwood-dnskw.dtsi b/arch/arm/boot/dts/kirkwood-dnskw.dtsi
index 6875ac0..9e2132a 100644
--- a/arch/arm/boot/dts/kirkwood-dnskw.dtsi
+++ b/arch/arm/boot/dts/kirkwood-dnskw.dtsi
@@ -186,6 +186,15 @@
 				reg = <0x7b00000 0x500000>;
 			};
 		};
+
+		smi0: mdio at 72000 {
+			status = "ok";
+		};
+
+		egiga0 {
+			phy_addr = <0x88>;
+			status = "ok";
+		};
 	};
 
 	regulators {
diff --git a/arch/arm/boot/dts/kirkwood-dockstar.dts b/arch/arm/boot/dts/kirkwood-dockstar.dts
index 2e3dd34..ec09085 100644
--- a/arch/arm/boot/dts/kirkwood-dockstar.dts
+++ b/arch/arm/boot/dts/kirkwood-dockstar.dts
@@ -60,6 +60,14 @@
 				reg = <0x0500000 0xfb00000>;
 			};
 		};
+
+		smi0: mdio at 72000 {
+			status = "ok";
+		};
+
+		egiga0 {
+			status = "ok";
+		};
 	};
 	gpio-leds {
 		compatible = "gpio-leds";
diff --git a/arch/arm/boot/dts/kirkwood-dreamplug.dts b/arch/arm/boot/dts/kirkwood-dreamplug.dts
index ef2d8c7..ae130a5 100644
--- a/arch/arm/boot/dts/kirkwood-dreamplug.dts
+++ b/arch/arm/boot/dts/kirkwood-dreamplug.dts
@@ -81,6 +81,22 @@
 			status = "okay";
 			/* No CD or WP GPIOs */
 		};
+
+		smi0: mdio at 72000 {
+			status = "ok";
+		};
+
+		smi1: mdio at 76000 {
+			status = "ok";
+		};
+
+		egiga0 {
+			status = "ok";
+		};
+
+		egiga1 {
+			status = "ok";
+		};
 	};
 
 	gpio-leds {
diff --git a/arch/arm/boot/dts/kirkwood-goflexnet.dts b/arch/arm/boot/dts/kirkwood-goflexnet.dts
index 1b133e0..98513ee 100644
--- a/arch/arm/boot/dts/kirkwood-goflexnet.dts
+++ b/arch/arm/boot/dts/kirkwood-goflexnet.dts
@@ -106,6 +106,13 @@
 			nr-ports = <2>;
 		};
 
+		smi0: mdio at 72000 {
+			status = "ok";
+		};
+
+		egiga0 {
+			status = "ok";
+		};
 	};
 	gpio-leds {
 		compatible = "gpio-leds";
diff --git a/arch/arm/boot/dts/kirkwood-ib62x0.dts b/arch/arm/boot/dts/kirkwood-ib62x0.dts
index 71902da..e77b06d 100644
--- a/arch/arm/boot/dts/kirkwood-ib62x0.dts
+++ b/arch/arm/boot/dts/kirkwood-ib62x0.dts
@@ -79,6 +79,15 @@
 			};
 
 		};
+
+		smi0: mdio at 72000 {
+			status = "ok";
+		};
+
+		egiga0 {
+			phy_addr = <0x88>;
+			status = "ok";
+		};
 	};
 
 	gpio_keys {
diff --git a/arch/arm/boot/dts/kirkwood-iconnect.dts b/arch/arm/boot/dts/kirkwood-iconnect.dts
index 504f16b..5b89685 100644
--- a/arch/arm/boot/dts/kirkwood-iconnect.dts
+++ b/arch/arm/boot/dts/kirkwood-iconnect.dts
@@ -110,6 +110,15 @@
 				reg = <0x980000 0x1f400000>;
 			};
 		};
+
+		smi0: mdio at 72000 {
+			status = "ok";
+		};
+
+		egiga0 {
+			phy_addr = <0x91>;
+			status = "ok";
+		};
 	};
 
 	gpio-leds {
diff --git a/arch/arm/boot/dts/kirkwood-lsxl.dtsi b/arch/arm/boot/dts/kirkwood-lsxl.dtsi
index 996c7fe..16199bf 100644
--- a/arch/arm/boot/dts/kirkwood-lsxl.dtsi
+++ b/arch/arm/boot/dts/kirkwood-lsxl.dtsi
@@ -106,6 +106,24 @@
 				};
 			};
 		};
+
+		smi0: mdio at 72000 {
+			status = "ok";
+		};
+
+		smi1: mdio at 76000 {
+			status = "ok";
+		};
+
+		egiga0 {
+			phy_addr = <0x80>;
+			status = "ok";
+		};
+
+		egiga1 {
+			phy_addr = <0x88>;
+			status = "ok";
+		};
 	};
 
 	gpio_keys {
diff --git a/arch/arm/boot/dts/kirkwood-mplcec4.dts b/arch/arm/boot/dts/kirkwood-mplcec4.dts
index 662dfd8..33130d1 100644
--- a/arch/arm/boot/dts/kirkwood-mplcec4.dts
+++ b/arch/arm/boot/dts/kirkwood-mplcec4.dts
@@ -140,6 +140,24 @@
 			cd-gpios = <&gpio1 15 0>;
 			/* No WP GPIO */
 		};
+
+		smi0: mdio at 72000 {
+			status = "ok";
+		};
+
+		smi1: mdio at 76000 {
+			status = "ok";
+		};
+
+		egiga0 {
+			phy_addr = <0x81>;
+			status = "ok";
+		};
+
+		egiga1 {
+			phy_addr = <0x82>;
+			status = "ok";
+		};
 	};
 
 	gpio-leds {
diff --git a/arch/arm/boot/dts/kirkwood-ns2-common.dtsi b/arch/arm/boot/dts/kirkwood-ns2-common.dtsi
index e8e7ece..0c54321 100644
--- a/arch/arm/boot/dts/kirkwood-ns2-common.dtsi
+++ b/arch/arm/boot/dts/kirkwood-ns2-common.dtsi
@@ -54,6 +54,15 @@
 				reg = <0x50>;
 			};
 		};
+
+		smi0: mdio at 72000 {
+			status = "ok";
+		};
+
+		egiga0 {
+			phy_addr = <0x88>;
+			status = "ok";
+		};
 	};
 
 	gpio_keys {
diff --git a/arch/arm/boot/dts/kirkwood-ns2lite.dts b/arch/arm/boot/dts/kirkwood-ns2lite.dts
index b02eb4e..e7cd611 100644
--- a/arch/arm/boot/dts/kirkwood-ns2lite.dts
+++ b/arch/arm/boot/dts/kirkwood-ns2lite.dts
@@ -16,6 +16,11 @@
 			status = "okay";
 			nr-ports = <1>;
 		};
+
+		egiga0 {
+			phy_addr = <0x80>;
+			status = "ok";
+		};
 	};
 
 	gpio-leds {
diff --git a/arch/arm/boot/dts/kirkwood-ns2mini.dts b/arch/arm/boot/dts/kirkwood-ns2mini.dts
index b79f5eb..700d308 100644
--- a/arch/arm/boot/dts/kirkwood-ns2mini.dts
+++ b/arch/arm/boot/dts/kirkwood-ns2mini.dts
@@ -16,6 +16,11 @@
 			status = "okay";
 			nr-ports = <1>;
 		};
+
+		egiga0 {
+			phy_addr = <0x80>;
+			status = "ok";
+		};
 	};
 
 	gpio_fan {
diff --git a/arch/arm/boot/dts/kirkwood-openblocks_a6.dts b/arch/arm/boot/dts/kirkwood-openblocks_a6.dts
index ede7fe0d..b179d43 100644
--- a/arch/arm/boot/dts/kirkwood-openblocks_a6.dts
+++ b/arch/arm/boot/dts/kirkwood-openblocks_a6.dts
@@ -191,6 +191,14 @@
 				marvell,function = "gpio";
 			};
 		};
+
+		smi0: mdio at 72000 {
+			status = "ok";
+		};
+
+		egiga0 {
+			status = "ok";
+		};
 	};
 
 	gpio-leds {
diff --git a/arch/arm/boot/dts/kirkwood-topkick.dts b/arch/arm/boot/dts/kirkwood-topkick.dts
index d959873..edefbb5 100644
--- a/arch/arm/boot/dts/kirkwood-topkick.dts
+++ b/arch/arm/boot/dts/kirkwood-topkick.dts
@@ -149,6 +149,14 @@
 			status = "okay";
 			/* No CD or WP GPIOs */
 		};
+
+		smi0: mdio at 72000 {
+			status = "ok";
+		};
+
+		egiga0 {
+			status = "ok";
+		};
 	};
 
 	gpio-leds {
diff --git a/arch/arm/boot/dts/kirkwood.dtsi b/arch/arm/boot/dts/kirkwood.dtsi
index 2c738d9..b13a405 100644
--- a/arch/arm/boot/dts/kirkwood.dtsi
+++ b/arch/arm/boot/dts/kirkwood.dtsi
@@ -201,5 +201,43 @@
 			clocks = <&gate_clk 4>;
 			status = "disabled";
 		};
+
+		smi0: mdio at 72000 {
+			compatible = "marvell,mdio-mv643xx";
+			reg = <0x72000 0x4000>;
+			interrupts = <46>;
+			tx_csum_limit = <1600>;
+			status = "disabled";
+		};
+
+		smi1: mdio at 76000 {
+			compatible = "marvell,mdio-mv643xx";
+			reg = <0x76000 0x4000>;
+			interrupts = <47>;
+			tx_csum_limit = <1600>;
+			status = "disabled";
+		};
+
+		egiga0 {
+			compatible = "marvell,mv643xx-eth";
+			reg = <0x72000 0x4000>;
+			mdio = <&smi0>;
+			port_number = <0>;
+			phy_addr = <0x80>;
+			interrupts = <11>;
+			clocks = <&gate_clk 0>;
+			status = "disabled";
+		};
+
+		egiga1 {
+			compatible = "marvell,mv643xx-eth";
+			reg = <0x76000 0x4000>;
+			mdio = <&smi1>;
+			port_number = <0>;
+			phy_addr = <0x81>;
+			interrupts = <15>;
+			clocks = <&gate_clk 19>;
+			status = "disabled";
+		};
 	};
 };
diff --git a/arch/arm/mach-kirkwood/Kconfig b/arch/arm/mach-kirkwood/Kconfig
index 432bee0..188651b 100644
--- a/arch/arm/mach-kirkwood/Kconfig
+++ b/arch/arm/mach-kirkwood/Kconfig
@@ -58,19 +58,6 @@ config ARCH_KIRKWOOD_DT
 	  Say 'Y' here if you want your kernel to support the
 	  Marvell Kirkwood using flattened device tree.
 
-config MACH_DREAMPLUG_DT
-	bool "Marvell DreamPlug (Flattened Device Tree)"
-	select ARCH_KIRKWOOD_DT
-	help
-	  Say 'Y' here if you want your kernel to support the
-	  Marvell DreamPlug (Flattened Device Tree).
-
-config MACH_ICONNECT_DT
-	bool "Iomega Iconnect (Flattened Device Tree)"
-	select ARCH_KIRKWOOD_DT
-	help
-	  Say 'Y' here to enable Iomega Iconnect support.
-
 config MACH_DLINK_KIRKWOOD_DT
 	bool "D-Link Kirkwood-based NAS (Flattened Device Tree)"
 	select ARCH_KIRKWOOD_DT
@@ -79,14 +66,6 @@ config MACH_DLINK_KIRKWOOD_DT
 	  Kirkwood-based D-Link NASes such as DNS-320 & DNS-325,
 	  using Flattened Device Tree.
 
-config MACH_IB62X0_DT
-	bool "RaidSonic IB-NAS6210, IB-NAS6220 (Flattened Device Tree)"
-	select ARCH_KIRKWOOD_DT
-	help
-	  Say 'Y' here if you want your kernel to support the
-	  RaidSonic IB-NAS6210 & IB-NAS6220 devices, using
-	  Flattened Device Tree.
-
 config MACH_TS219_DT
 	bool "Device Tree for QNAP TS-11X, TS-21X NAS"
 	select ARCH_KIRKWOOD_DT
@@ -102,29 +81,6 @@ config MACH_TS219_DT
 	  or MV6282. If you have the wrong one, the buttons will not
 	  work.
 
-config MACH_DOCKSTAR_DT
-	bool "Seagate FreeAgent Dockstar (Flattened Device Tree)"
-	select ARCH_KIRKWOOD_DT
-	help
-	  Say 'Y' here if you want your kernel to support the
-	  Seagate FreeAgent Dockstar (Flattened Device Tree).
-
-config MACH_GOFLEXNET_DT
-	bool "Seagate GoFlex Net (Flattened Device Tree)"
-	select ARCH_KIRKWOOD_DT
-	help
-	  Say 'Y' here if you want your kernel to support the
-	  Seagate GoFlex Net (Flattened Device Tree).
-
-config MACH_LSXL_DT
-	bool "Buffalo Linkstation LS-XHL, LS-CHLv2 (Flattened Device Tree)"
-	select ARCH_KIRKWOOD_DT
-	select POWER_RESET_RESTART
-	help
-	  Say 'Y' here if you want your kernel to support the
-	  Buffalo Linkstation LS-XHL & LS-CHLv2 devices, using
-	  Flattened Device Tree.
-
 config MACH_IOMEGA_IX2_200_DT
 	bool "Iomega StorCenter ix2-200 (Flattened Device Tree)"
 	select ARCH_KIRKWOOD_DT
@@ -139,63 +95,6 @@ config MACH_KM_KIRKWOOD_DT
 	  Say 'Y' here if you want your kernel to support the
 	  Keymile Kirkwood Reference Desgin, using Flattened Device Tree.
 
-config MACH_INETSPACE_V2_DT
-	bool "LaCie Internet Space v2 NAS (Flattened Device Tree)"
-	select ARCH_KIRKWOOD_DT
-	help
-	  Say 'Y' here if you want your kernel to support the LaCie
-	  Internet Space v2 NAS, using Flattened Device Tree.
-
-config MACH_MPLCEC4_DT
-	bool "MPL CEC4 (Flattened Device Tree)"
-	select ARCH_KIRKWOOD_DT
-	help
-	  Say 'Y' here if you want your kernel to support the
-	  MPL CEC4 (Flattened Device Tree).
-
-config MACH_NETSPACE_V2_DT
-	bool "LaCie Network Space v2 NAS (Flattened Device Tree)"
-	select ARCH_KIRKWOOD_DT
-	help
-	  Say 'Y' here if you want your kernel to support the LaCie
-	  Network Space v2 NAS, using Flattened Device Tree.
-
-config MACH_NETSPACE_MAX_V2_DT
-	bool "LaCie Network Space Max v2 NAS (Flattened Device Tree)"
-	select ARCH_KIRKWOOD_DT
-	help
-	  Say 'Y' here if you want your kernel to support the LaCie
-	  Network Space Max v2 NAS, using Flattened Device Tree.
-
-config MACH_NETSPACE_LITE_V2_DT
-	bool "LaCie Network Space Lite v2 NAS (Flattened Device Tree)"
-	select ARCH_KIRKWOOD_DT
-	help
-	  Say 'Y' here if you want your kernel to support the LaCie
-	  Network Space Lite v2 NAS, using Flattened Device Tree.
-
-config MACH_NETSPACE_MINI_V2_DT
-	bool "LaCie Network Space Mini v2 NAS (Flattened Device Tree)"
-	select ARCH_KIRKWOOD_DT
-	help
-	  Say 'Y' here if you want your kernel to support the LaCie
-	  Network Space Mini v2 NAS (aka SafeBox), using Flattened
-	  Device Tree.
-
-config MACH_OPENBLOCKS_A6_DT
-	bool "Plat'Home OpenBlocks A6 (Flattened Device Tree)"
-	select ARCH_KIRKWOOD_DT
-	help
-	  Say 'Y' here if you want your kernel to support the
-	  Plat'Home OpenBlocks A6 (Flattened Device Tree).
-
-config MACH_TOPKICK_DT
-	bool "USI Topkick (Flattened Device Tree)"
-	select ARCH_KIRKWOOD_DT
-	help
-	  Say 'Y' here if you want your kernel to support the
-	  USI Topkick, using Flattened Device Tree
-
 config MACH_TS219
 	bool "QNAP TS-110, TS-119, TS-119P+, TS-210, TS-219, TS-219P and TS-219P+ Turbo NAS"
 	help
diff --git a/arch/arm/mach-kirkwood/Makefile b/arch/arm/mach-kirkwood/Makefile
index ee3aa77..ab739b0 100644
--- a/arch/arm/mach-kirkwood/Makefile
+++ b/arch/arm/mach-kirkwood/Makefile
@@ -20,21 +20,7 @@ obj-$(CONFIG_MACH_NET5BIG_V2)		+= netxbig_v2-setup.o lacie_v2-common.o
 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_ICONNECT_DT)		+= board-iconnect.o
 obj-$(CONFIG_MACH_DLINK_KIRKWOOD_DT)	+= board-dnskw.o
-obj-$(CONFIG_MACH_IB62X0_DT)		+= board-ib62x0.o
 obj-$(CONFIG_MACH_TS219_DT)		+= board-ts219.o tsx1x-common.o
-obj-$(CONFIG_MACH_DOCKSTAR_DT)		+= board-dockstar.o
-obj-$(CONFIG_MACH_GOFLEXNET_DT)		+= board-goflexnet.o
-obj-$(CONFIG_MACH_LSXL_DT)		+= board-lsxl.o
 obj-$(CONFIG_MACH_IOMEGA_IX2_200_DT)	+= board-iomega_ix2_200.o
 obj-$(CONFIG_MACH_KM_KIRKWOOD_DT)	+= board-km_kirkwood.o
-obj-$(CONFIG_MACH_INETSPACE_V2_DT)	+= board-ns2.o
-obj-$(CONFIG_MACH_MPLCEC4_DT)		+= board-mplcec4.o
-obj-$(CONFIG_MACH_NETSPACE_V2_DT)	+= board-ns2.o
-obj-$(CONFIG_MACH_NETSPACE_MAX_V2_DT)	+= board-ns2.o
-obj-$(CONFIG_MACH_NETSPACE_LITE_V2_DT)	+= board-ns2.o
-obj-$(CONFIG_MACH_NETSPACE_MINI_V2_DT)	+= board-ns2.o
-obj-$(CONFIG_MACH_OPENBLOCKS_A6_DT)	+= board-openblocks_a6.o
-obj-$(CONFIG_MACH_TOPKICK_DT)		+= board-usi_topkick.o
diff --git a/arch/arm/mach-kirkwood/board-dnskw.c b/arch/arm/mach-kirkwood/board-dnskw.c
index a1aa87f..2af7a95 100644
--- a/arch/arm/mach-kirkwood/board-dnskw.c
+++ b/arch/arm/mach-kirkwood/board-dnskw.c
@@ -14,14 +14,9 @@
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/platform_device.h>
-#include <linux/mv643xx_eth.h>
 #include <linux/gpio.h>
 #include "common.h"
 
-static struct mv643xx_eth_platform_data dnskw_ge00_data = {
-	.phy_addr	= MV643XX_ETH_PHY_ADDR(8),
-};
-
 /* Register any GPIO for output and set the value */
 static void __init dnskw_gpio_register(unsigned gpio, char *name, int def)
 {
@@ -36,8 +31,6 @@ static void __init dnskw_gpio_register(unsigned gpio, char *name, int def)
 
 void __init dnskw_init(void)
 {
-	kirkwood_ge00_init(&dnskw_ge00_data);
-
 	/* Set NAS to turn back on after a power failure */
 	dnskw_gpio_register(37, "dnskw:power:recover", 1);
 }
diff --git a/arch/arm/mach-kirkwood/board-dockstar.c b/arch/arm/mach-kirkwood/board-dockstar.c
deleted file mode 100644
index d7196db..0000000
--- a/arch/arm/mach-kirkwood/board-dockstar.c
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * arch/arm/mach-kirkwood/board-dockstar.c
- *
- * Seagate FreeAgent Dockstar 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.
- *
- * Copied and modified for Seagate GoFlex Net support by
- * Joshua Coombs <josh.coombs@gmail.com> based on ArchLinux ARM's
- * GoFlex kernel patches.
- *
- */
-
-#include <linux/kernel.h>
-#include <linux/init.h>
-#include <linux/mv643xx_eth.h>
-#include "common.h"
-
-static struct mv643xx_eth_platform_data dockstar_ge00_data = {
-	.phy_addr	= MV643XX_ETH_PHY_ADDR(0),
-};
-
-void __init dockstar_dt_init(void)
-{
-	/*
-	 * Basic setup. Needs to be called early.
-	 */
-	kirkwood_ge00_init(&dockstar_ge00_data);
-}
diff --git a/arch/arm/mach-kirkwood/board-dreamplug.c b/arch/arm/mach-kirkwood/board-dreamplug.c
deleted file mode 100644
index 0903242..0000000
--- a/arch/arm/mach-kirkwood/board-dreamplug.c
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright 2012 (C), Jason Cooper <jason@lakedaemon.net>
- *
- * arch/arm/mach-kirkwood/board-dreamplug.c
- *
- * Marvell DreamPlug 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 <linux/gpio.h>
-#include "common.h"
-
-static struct mv643xx_eth_platform_data dreamplug_ge00_data = {
-	.phy_addr	= MV643XX_ETH_PHY_ADDR(0),
-};
-
-static struct mv643xx_eth_platform_data dreamplug_ge01_data = {
-	.phy_addr	= MV643XX_ETH_PHY_ADDR(1),
-};
-
-void __init dreamplug_init(void)
-{
-	/*
-	 * Basic setup. Needs to be called early.
-	 */
-	kirkwood_ge00_init(&dreamplug_ge00_data);
-	kirkwood_ge01_init(&dreamplug_ge01_data);
-}
diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c
index 73b76e4..620c99f 100644
--- a/arch/arm/mach-kirkwood/board-dt.c
+++ b/arch/arm/mach-kirkwood/board-dt.c
@@ -47,10 +47,6 @@ static void __init kirkwood_legacy_clk_init(void)
 	clkspec.np = np;
 	clkspec.args_count = 1;
 
-	clkspec.args[0] = CGC_BIT_GE0;
-	orion_clkdev_add(NULL, "mv643xx_eth_port.0",
-			 of_clk_get_from_provider(&clkspec));
-
 	clkspec.args[0] = CGC_BIT_PEX0;
 	orion_clkdev_add("0", "pcie",
 			 of_clk_get_from_provider(&clkspec));
@@ -58,10 +54,6 @@ static void __init kirkwood_legacy_clk_init(void)
 	clkspec.args[0] = CGC_BIT_PEX1;
 	orion_clkdev_add("1", "pcie",
 			 of_clk_get_from_provider(&clkspec));
-
-	clkspec.args[0] = CGC_BIT_GE1;
-	orion_clkdev_add(NULL, "mv643xx_eth_port.1",
-			 of_clk_get_from_provider(&clkspec));
 }
 
 static void __init kirkwood_of_clk_init(void)
@@ -118,52 +110,18 @@ static void __init kirkwood_dt_init(void)
 	kexec_reinit = kirkwood_enable_pcie;
 #endif
 
-	if (of_machine_is_compatible("globalscale,dreamplug"))
-		dreamplug_init();
-
 	if (of_machine_is_compatible("dlink,dns-kirkwood"))
 		dnskw_init();
 
-	if (of_machine_is_compatible("iom,iconnect"))
-		iconnect_init();
-
-	if (of_machine_is_compatible("raidsonic,ib-nas62x0"))
-		ib62x0_init();
-
 	if (of_machine_is_compatible("qnap,ts219"))
 		qnap_dt_ts219_init();
 
-	if (of_machine_is_compatible("seagate,dockstar"))
-		dockstar_dt_init();
-
-	if (of_machine_is_compatible("seagate,goflexnet"))
-		goflexnet_init();
-
-	if (of_machine_is_compatible("buffalo,lsxl"))
-		lsxl_init();
-
 	if (of_machine_is_compatible("iom,ix2-200"))
 		iomega_ix2_200_init();
 
 	if (of_machine_is_compatible("keymile,km_kirkwood"))
 		km_kirkwood_init();
 
-	if (of_machine_is_compatible("lacie,inetspace_v2") ||
-	    of_machine_is_compatible("lacie,netspace_v2") ||
-	    of_machine_is_compatible("lacie,netspace_max_v2") ||
-	    of_machine_is_compatible("lacie,netspace_lite_v2") ||
-	    of_machine_is_compatible("lacie,netspace_mini_v2"))
-		ns2_init();
-
-	if (of_machine_is_compatible("mpl,cec4"))
-		mplcec4_init();
-
-	if (of_machine_is_compatible("plathome,openblocks-a6"))
-		openblocks_a6_init();
-
-	if (of_machine_is_compatible("usi,topkick"))
-		usi_topkick_init();
-
 	of_platform_populate(NULL, kirkwood_dt_match_table, NULL, NULL);
 }
 
diff --git a/arch/arm/mach-kirkwood/board-goflexnet.c b/arch/arm/mach-kirkwood/board-goflexnet.c
deleted file mode 100644
index 9db979a..0000000
--- a/arch/arm/mach-kirkwood/board-goflexnet.c
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright 2012 (C), Jason Cooper <jason@lakedaemon.net>
- *
- * arch/arm/mach-kirkwood/board-goflexnet.c
- *
- * Seagate GoFlext Net 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.
- *
- * Copied and modified for Seagate GoFlex Net support by
- * Joshua Coombs <josh.coombs@gmail.com> based on ArchLinux ARM's
- * GoFlex kernel patches.
- *
- */
-
-#include <linux/kernel.h>
-#include <linux/init.h>
-#include <linux/mv643xx_eth.h>
-#include "common.h"
-
-static struct mv643xx_eth_platform_data goflexnet_ge00_data = {
-	.phy_addr	= MV643XX_ETH_PHY_ADDR(0),
-};
-
-void __init goflexnet_init(void)
-{
-	/*
-	 * Basic setup. Needs to be called early.
-	 */
-	kirkwood_ge00_init(&goflexnet_ge00_data);
-}
diff --git a/arch/arm/mach-kirkwood/board-ib62x0.c b/arch/arm/mach-kirkwood/board-ib62x0.c
deleted file mode 100644
index 9a857ae..0000000
--- a/arch/arm/mach-kirkwood/board-ib62x0.c
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Copyright 2012 (C), Simon Baatz <gmbnomis@gmail.com>
- *
- * arch/arm/mach-kirkwood/board-ib62x0.c
- *
- * RaidSonic ICY BOX IB-NAS6210 & IB-NAS6220 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 ib62x0_ge00_data = {
-	.phy_addr	= MV643XX_ETH_PHY_ADDR(8),
-};
-
-void __init ib62x0_init(void)
-{
-	/*
-	 * Basic setup. Needs to be called early.
-	 */
-	kirkwood_ge00_init(&ib62x0_ge00_data);
-}
diff --git a/arch/arm/mach-kirkwood/board-iconnect.c b/arch/arm/mach-kirkwood/board-iconnect.c
deleted file mode 100644
index ff042dc..0000000
--- a/arch/arm/mach-kirkwood/board-iconnect.c
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * arch/arm/mach-kirkwood/board-iconnect.c
- *
- * Iomega i-connect Board Setup
- *
- * 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 iconnect_ge00_data = {
-	.phy_addr	= MV643XX_ETH_PHY_ADDR(11),
-};
-
-void __init iconnect_init(void)
-{
-	kirkwood_ge00_init(&iconnect_ge00_data);
-}
diff --git a/arch/arm/mach-kirkwood/board-lsxl.c b/arch/arm/mach-kirkwood/board-lsxl.c
deleted file mode 100644
index 3483952..0000000
--- a/arch/arm/mach-kirkwood/board-lsxl.c
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright 2012 (C), Michael Walle <michael@walle.cc>
- *
- * arch/arm/mach-kirkwood/board-lsxl.c
- *
- * Buffalo Linkstation LS-XHL and LS-CHLv2 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/platform_device.h>
-#include <linux/mv643xx_eth.h>
-#include "common.h"
-
-static struct mv643xx_eth_platform_data lsxl_ge00_data = {
-	.phy_addr	= MV643XX_ETH_PHY_ADDR(0),
-};
-
-static struct mv643xx_eth_platform_data lsxl_ge01_data = {
-	.phy_addr	= MV643XX_ETH_PHY_ADDR(8),
-};
-
-void __init lsxl_init(void)
-{
-	/*
-	 * Basic setup. Needs to be called early.
-	 */
-
-	kirkwood_ge00_init(&lsxl_ge00_data);
-	kirkwood_ge01_init(&lsxl_ge01_data);
-}
diff --git a/arch/arm/mach-kirkwood/board-mplcec4.c b/arch/arm/mach-kirkwood/board-mplcec4.c
deleted file mode 100644
index 938712e..0000000
--- a/arch/arm/mach-kirkwood/board-mplcec4.c
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright (C) 2012 MPL AG, Switzerland
- * Stefan Peter <s.peter@mpl.ch>
- *
- * arch/arm/mach-kirkwood/board-mplcec4.c
- *
- * 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 mplcec4_ge00_data = {
-	.phy_addr	= MV643XX_ETH_PHY_ADDR(1),
-};
-
-static struct mv643xx_eth_platform_data mplcec4_ge01_data = {
-	.phy_addr	= MV643XX_ETH_PHY_ADDR(2),
-};
-
-void __init mplcec4_init(void)
-{
-	/*
-	 * Basic setup. Needs to be called early.
-	 */
-	kirkwood_ge00_init(&mplcec4_ge00_data);
-	kirkwood_ge01_init(&mplcec4_ge01_data);
-}
-
-
-
diff --git a/arch/arm/mach-kirkwood/board-ns2.c b/arch/arm/mach-kirkwood/board-ns2.c
deleted file mode 100644
index f2ea3b7..0000000
--- a/arch/arm/mach-kirkwood/board-ns2.c
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright 2012 (C), Simon Guinot <simon.guinot@sequanux.org>
- *
- * arch/arm/mach-kirkwood/board-ns2.c
- *
- * LaCie Network Space v2 board (and parents) initialization 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/platform_device.h>
-#include <linux/mv643xx_eth.h>
-#include <linux/of.h>
-#include "common.h"
-
-static struct mv643xx_eth_platform_data ns2_ge00_data = {
-	.phy_addr	= MV643XX_ETH_PHY_ADDR(8),
-};
-
-void __init ns2_init(void)
-{
-	/*
-	 * Basic setup. Needs to be called early.
-	 */
-	if (of_machine_is_compatible("lacie,netspace_lite_v2") ||
-	    of_machine_is_compatible("lacie,netspace_mini_v2"))
-		ns2_ge00_data.phy_addr = MV643XX_ETH_PHY_ADDR(0);
-	kirkwood_ge00_init(&ns2_ge00_data);
-}
diff --git a/arch/arm/mach-kirkwood/board-openblocks_a6.c b/arch/arm/mach-kirkwood/board-openblocks_a6.c
deleted file mode 100644
index b11d8fd..0000000
--- a/arch/arm/mach-kirkwood/board-openblocks_a6.c
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Copyright 2012 Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
- *
- * arch/arm/mach-kirkwood/board-openblocks_a6.c
- *
- * 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 openblocks_ge00_data = {
-	.phy_addr	= MV643XX_ETH_PHY_ADDR(0),
-};
-
-void __init openblocks_a6_init(void)
-{
-	/*
-	 * Basic setup. Needs to be called early.
-	 */
-	kirkwood_ge00_init(&openblocks_ge00_data);
-}
diff --git a/arch/arm/mach-kirkwood/board-usi_topkick.c b/arch/arm/mach-kirkwood/board-usi_topkick.c
deleted file mode 100644
index 1cc04ec..0000000
--- a/arch/arm/mach-kirkwood/board-usi_topkick.c
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Copyright 2012 (C), Jason Cooper <jason@lakedaemon.net>
- *
- * arch/arm/mach-kirkwood/board-usi_topkick.c
- *
- * USI Topkick 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 <linux/gpio.h>
-#include "common.h"
-
-static struct mv643xx_eth_platform_data topkick_ge00_data = {
-	.phy_addr	= MV643XX_ETH_PHY_ADDR(0),
-};
-
-void __init usi_topkick_init(void)
-{
-	/*
-	 * Basic setup. Needs to be called early.
-	 */
-	kirkwood_ge00_init(&topkick_ge00_data);
-}
diff --git a/arch/arm/mach-kirkwood/common.h b/arch/arm/mach-kirkwood/common.h
index 1c42cb8..ba6eb9c 100644
--- a/arch/arm/mach-kirkwood/common.h
+++ b/arch/arm/mach-kirkwood/common.h
@@ -55,11 +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_DREAMPLUG_DT
-void dreamplug_init(void);
-#else
-static inline void dreamplug_init(void) {};
-#endif
 #ifdef CONFIG_MACH_TS219_DT
 void qnap_dt_ts219_init(void);
 #else
@@ -72,36 +67,6 @@ void dnskw_init(void);
 static inline void dnskw_init(void) {};
 #endif
 
-#ifdef CONFIG_MACH_ICONNECT_DT
-void iconnect_init(void);
-#else
-static inline void iconnect_init(void) {};
-#endif
-
-#ifdef CONFIG_MACH_IB62X0_DT
-void ib62x0_init(void);
-#else
-static inline void ib62x0_init(void) {};
-#endif
-
-#ifdef CONFIG_MACH_DOCKSTAR_DT
-void dockstar_dt_init(void);
-#else
-static inline void dockstar_dt_init(void) {};
-#endif
-
-#ifdef CONFIG_MACH_GOFLEXNET_DT
-void goflexnet_init(void);
-#else
-static inline void goflexnet_init(void) {};
-#endif
-
-#ifdef CONFIG_MACH_LSXL_DT
-void lsxl_init(void);
-#else
-static inline void lsxl_init(void) {};
-#endif
-
 #ifdef CONFIG_MACH_IOMEGA_IX2_200_DT
 void iomega_ix2_200_init(void);
 #else
@@ -114,34 +79,6 @@ void km_kirkwood_init(void);
 static inline void km_kirkwood_init(void) {};
 #endif
 
-#ifdef CONFIG_MACH_MPLCEC4_DT
-void mplcec4_init(void);
-#else
-static inline void mplcec4_init(void) {};
-#endif
-
-#if defined(CONFIG_MACH_INETSPACE_V2_DT) || \
-	defined(CONFIG_MACH_NETSPACE_V2_DT) || \
-	defined(CONFIG_MACH_NETSPACE_MAX_V2_DT) || \
-	defined(CONFIG_MACH_NETSPACE_LITE_V2_DT) || \
-	defined(CONFIG_MACH_NETSPACE_MINI_V2_DT)
-void ns2_init(void);
-#else
-static inline void ns2_init(void) {};
-#endif
-
-#ifdef CONFIG_MACH_OPENBLOCKS_A6_DT
-void openblocks_a6_init(void);
-#else
-static inline void openblocks_a6_init(void) {};
-#endif
-
-#ifdef CONFIG_MACH_TOPKICK_DT
-void usi_topkick_init(void);
-#else
-static inline void usi_topkick_init(void) {};
-#endif
-
 /* early init functions not converted to fdt yet */
 char *kirkwood_id(void);
 void kirkwood_l2_init(void);
-- 
1.8.1.1

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

* [RFC V2 PATCH 0/8] ARM: kirkwood: cleanup DT conversion
  2013-01-25  5:32 ` [RFC V2 PATCH 0/8] " Jason Cooper
                     ` (7 preceding siblings ...)
  2013-01-25  5:32   ` [RFC V2 PATCH 8/8] ARM: kirkwood: mv643xx_eth dt conversion Jason Cooper
@ 2013-01-25 11:15   ` Arnd Bergmann
  2013-01-25 12:52     ` Jason Cooper
  8 siblings, 1 reply; 102+ messages in thread
From: Arnd Bergmann @ 2013-01-25 11:15 UTC (permalink / raw)
  To: linux-arm-kernel

On Friday 25 January 2013, Jason Cooper wrote:
> This is a second cut at cleaning up mach-kirkwood/.  There are a few DT
> conversions (topkick -> mvsdio, pinctrl) which, once reviewed, I'll put in the
> normal pull request cycle.
> 
> The others which remove board-*.c files, I'll keep updating against
> mvebu/for-next, and then apply at the end of the merge window.
> 
> Please test as you are able.

Great work, it's really nice to see where things are going now!

In patch 7, the changeset text seems to be indented wrong, but the
patch is still good.

I wonder if it makes sense to collapse the few remaining DT based
board files now and move their entire contents back into board-dt.c.
Of course, if you think they will all be gone soon anyway, there
is no point.

	Arnd

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

* [RFC V2 PATCH 0/8] ARM: kirkwood: cleanup DT conversion
  2013-01-25 11:15   ` [RFC V2 PATCH 0/8] ARM: kirkwood: cleanup DT conversion Arnd Bergmann
@ 2013-01-25 12:52     ` Jason Cooper
  2013-01-25 15:03       ` Sebastian Hesselbarth
  0 siblings, 1 reply; 102+ messages in thread
From: Jason Cooper @ 2013-01-25 12:52 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Jan 25, 2013 at 11:15:47AM +0000, Arnd Bergmann wrote:
> On Friday 25 January 2013, Jason Cooper wrote:
> > This is a second cut at cleaning up mach-kirkwood/.  There are a few DT
> > conversions (topkick -> mvsdio, pinctrl) which, once reviewed, I'll put in the
> > normal pull request cycle.
> > 
> > The others which remove board-*.c files, I'll keep updating against
> > mvebu/for-next, and then apply at the end of the merge window.
> > 
> > Please test as you are able.
> 
> Great work, it's really nice to see where things are going now!
> 
> In patch 7, the changeset text seems to be indented wrong, but the
> patch is still good.
> 
> I wonder if it makes sense to collapse the few remaining DT based
> board files now and move their entire contents back into board-dt.c.
> Of course, if you think they will all be gone soon anyway, there
> is no point.

Once I have the mv643xx_eth binding working reliably, preferably with
mvmdio, I'll take a look at removing the last board-*.c files.  If the
stars align, we'll get it all done for v3.9.

The only big thing left will be pcie.

thx,

Jason.

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

* [RFC V2 PATCH 0/8] ARM: kirkwood: cleanup DT conversion
  2013-01-25 12:52     ` Jason Cooper
@ 2013-01-25 15:03       ` Sebastian Hesselbarth
  2013-01-25 18:34         ` Jason Gunthorpe
  0 siblings, 1 reply; 102+ messages in thread
From: Sebastian Hesselbarth @ 2013-01-25 15:03 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Jan 25, 2013 at 1:52 PM, Jason Cooper <jason@lakedaemon.net> wrote:
> Once I have the mv643xx_eth binding working reliably, preferably with
> mvmdio, I'll take a look at removing the last board-*.c files.  If the
> stars align, we'll get it all done for v3.9.
>
> The only big thing left will be pcie.

Jason,

there is also addr_map that we haven't thought about yet. Is it supposed
to be configurable through DT or do we leave it as "linux wants it that way"?

Sebastian

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

* [RFC V2 PATCH 0/8] ARM: kirkwood: cleanup DT conversion
  2013-01-25 15:03       ` Sebastian Hesselbarth
@ 2013-01-25 18:34         ` Jason Gunthorpe
  2013-01-25 20:03           ` Arnd Bergmann
  2013-01-28 10:40           ` Ezequiel Garcia
  0 siblings, 2 replies; 102+ messages in thread
From: Jason Gunthorpe @ 2013-01-25 18:34 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Jan 25, 2013 at 04:03:29PM +0100, Sebastian Hesselbarth wrote:
> On Fri, Jan 25, 2013 at 1:52 PM, Jason Cooper <jason@lakedaemon.net> wrote:
> > Once I have the mv643xx_eth binding working reliably, preferably with
> > mvmdio, I'll take a look at removing the last board-*.c files.  If the
> > stars align, we'll get it all done for v3.9.
> >
> > The only big thing left will be pcie.

> there is also addr_map that we haven't thought about yet. Is it supposed
> to be configurable through DT or do we leave it as "linux wants it that way"?

FWIW, this was a pain + surprise for us when we started out. The
address map Linux wants is not the same as the device power on
default, and the Linux mapping is hardwired into the kernel :(

I would be happy to see the address map setup be more flexible and
done via DT. It would be a bit of a pain to change, but via DT each
decoded window could be described as a bus with a ranges and an OF
address map driver could directly setup the windows to match those DT
nodes. Something like this, repeated for each window:

        // MBUS Decoder window for NAND
        nand at f4000000 {
                #address-cells = <1>;
                #size-cells = <1>;
                compatible = "simple-bus", "marvell,orion-mbus";
		mbus-target = 0xXXXXX;
                ranges = <0 0xf4000000 0x10000>;

                nand at 0 {
                        cle = <0>;
                        ale = <1>;
                        bank-width = <1>;
                        chip-delay = <50>;
                        compatible = "marvell,orion-nand";
                        reg = <0x0 0x400>;
                };
        };

	// MBUS decoder window for internal registers
        internal at f1000000 {
                #address-cells = <1>;
                #size-cells = <1>;
                compatible = "simple-bus", "marvell,orion-mbus";
		mbus-target = 0xXXXXX;
                ranges = <0 0xf1000000 0x100000>;

                intc: interrupt-controller at 20204 {
                        #interrupt-cells = <1>;
                        compatible = "marvell,orion-intc", "marvell,intc";
                        interrupt-controller;
                        reg = <0x20204 0x04>,
                              <0x20214 0x04>;
                };

 		[... etc ...]
        };

Regards,
Jason

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

* [RFC V2 PATCH 0/8] ARM: kirkwood: cleanup DT conversion
  2013-01-25 18:34         ` Jason Gunthorpe
@ 2013-01-25 20:03           ` Arnd Bergmann
  2013-01-28 10:40           ` Ezequiel Garcia
  1 sibling, 0 replies; 102+ messages in thread
From: Arnd Bergmann @ 2013-01-25 20:03 UTC (permalink / raw)
  To: linux-arm-kernel

On Friday 25 January 2013, Jason Gunthorpe wrote:
>         // MBUS Decoder window for NAND
>         nand at f4000000 {
>                 #address-cells = <1>;
>                 #size-cells = <1>;
>                 compatible = "simple-bus", "marvell,orion-mbus";
>                 mbus-target = 0xXXXXX;
>                 ranges = <0 0xf4000000 0x10000>;
> 
>                 nand at 0 {
>                         cle = <0>;
>                         ale = <1>;
>                         bank-width = <1>;
>                         chip-delay = <50>;
>                         compatible = "marvell,orion-nand";
>                         reg = <0x0 0x400>;
>                 };
>         };
> 

Yes, this looks quite reasonable. I would not claim compatibility with
"simple-bus" though because it clearly isn't simple.

If we need a driver to set up the mappings, that driver should
also instantiate its child devices.

	Arnd

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

* [PATCH V3 0/8] ARM: kirkwood: cleanup DT conversion
  2013-01-23 23:34 [RFC PATCH 0/6] ARM: kirkwood: cleanup DT conversion Jason Cooper
                   ` (7 preceding siblings ...)
  2013-01-25  5:32 ` [RFC V2 PATCH 0/8] " Jason Cooper
@ 2013-01-25 20:53 ` Jason Cooper
  2013-01-25 20:53   ` [PATCH V3 1/8] ARM: kirkwood: topkick: init mvsdio via DT Jason Cooper
                     ` (7 more replies)
  2013-01-26 20:50 ` [PATCH V4 0/8] ARM: kirkwood: cleanup DT conversion Jason Cooper
  9 siblings, 8 replies; 102+ messages in thread
From: Jason Cooper @ 2013-01-25 20:53 UTC (permalink / raw)
  To: linux-arm-kernel

All,

This is a third cut at cleaning up mach-kirkwood/.  There are a few DT
conversions (topkick -> mvsdio, pinctrl) which, once reviewed, I'll put in the
normal pull request cycle.

The others which remove board-*.c files, I'll keep updating against
mvebu/for-next, and then apply at the end of the merge window.

Please test as you are able.

Changes since V1:
 - Included Ian Molton's patch to add DT bindings to mv643xx_eth
 - little doc cleanup
 - tested on dreamplug
   - good: boots fine to bash prompt
   - bad: hangs within one minute of booting (even with init=/bin/sh)
     - no output, just frozen hard
     - will debug more tomorrow

Changes since V2:
 - discovered source of hang.  ge0/1 clocks getting gated
   - changed alias for clocks
   - able to pull ip address and ping though the interface

thx,

Jason.

Ian Molton (1):
  mv643xx.c: Add basic device tree support.

Jason Cooper (7):
  ARM: kirkwood: topkick: init mvsdio via DT
  ARM: kirkwood: topkick: convert to pinctrl
  ARM: kirkwood: nsa310: cleanup includes and unneeded code
  ARM: kirkwood: nsa310: convert to pinctrl
  ARM: kirkwood: consolidate DT init of pcie
  ARM: mvebu: correct gated clock documentation
  ARM: kirkwood: mv643xx_eth dt conversion

 .../bindings/clock/mvebu-gated-clock.txt           |   2 +-
 Documentation/devicetree/bindings/net/mv643xx.txt  |  75 +++++++++++++++
 arch/arm/boot/dts/kirkwood-dnskw.dtsi              |   9 ++
 arch/arm/boot/dts/kirkwood-dockstar.dts            |   8 ++
 arch/arm/boot/dts/kirkwood-dreamplug.dts           |  16 ++++
 arch/arm/boot/dts/kirkwood-goflexnet.dts           |   7 ++
 arch/arm/boot/dts/kirkwood-ib62x0.dts              |   9 ++
 arch/arm/boot/dts/kirkwood-iconnect.dts            |   9 ++
 arch/arm/boot/dts/kirkwood-lsxl.dtsi               |  18 ++++
 arch/arm/boot/dts/kirkwood-mplcec4.dts             |  18 ++++
 arch/arm/boot/dts/kirkwood-ns2-common.dtsi         |   9 ++
 arch/arm/boot/dts/kirkwood-ns2lite.dts             |   5 +
 arch/arm/boot/dts/kirkwood-ns2mini.dts             |   5 +
 arch/arm/boot/dts/kirkwood-nsa310.dts              |  99 ++++++++++++++++++++
 arch/arm/boot/dts/kirkwood-openblocks_a6.dts       |   8 ++
 arch/arm/boot/dts/kirkwood-topkick.dts             | 103 +++++++++++++++++++++
 arch/arm/boot/dts/kirkwood.dtsi                    |  38 ++++++++
 arch/arm/mach-kirkwood/Kconfig                     | 101 --------------------
 arch/arm/mach-kirkwood/Makefile                    |  15 ---
 arch/arm/mach-kirkwood/board-dnskw.c               |   7 --
 arch/arm/mach-kirkwood/board-dockstar.c            |  32 -------
 arch/arm/mach-kirkwood/board-dreamplug.c           |  35 -------
 arch/arm/mach-kirkwood/board-dt.c                  |  64 +++++--------
 arch/arm/mach-kirkwood/board-goflexnet.c           |  34 -------
 arch/arm/mach-kirkwood/board-ib62x0.c              |  29 ------
 arch/arm/mach-kirkwood/board-iconnect.c            |  32 -------
 arch/arm/mach-kirkwood/board-lsxl.c                |  36 -------
 arch/arm/mach-kirkwood/board-mplcec4.c             |  36 -------
 arch/arm/mach-kirkwood/board-ns2.c                 |  34 -------
 arch/arm/mach-kirkwood/board-nsa310.c              |  58 ------------
 arch/arm/mach-kirkwood/board-openblocks_a6.c       |  26 ------
 arch/arm/mach-kirkwood/board-ts219.c               |  13 ---
 arch/arm/mach-kirkwood/board-usi_topkick.c         |  77 ---------------
 arch/arm/mach-kirkwood/common.h                    |  69 --------------
 drivers/net/ethernet/marvell/mv643xx_eth.c         |  93 +++++++++++++++++--
 35 files changed, 548 insertions(+), 681 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/net/mv643xx.txt
 delete mode 100644 arch/arm/mach-kirkwood/board-dockstar.c
 delete mode 100644 arch/arm/mach-kirkwood/board-dreamplug.c
 delete mode 100644 arch/arm/mach-kirkwood/board-goflexnet.c
 delete mode 100644 arch/arm/mach-kirkwood/board-ib62x0.c
 delete mode 100644 arch/arm/mach-kirkwood/board-iconnect.c
 delete mode 100644 arch/arm/mach-kirkwood/board-lsxl.c
 delete mode 100644 arch/arm/mach-kirkwood/board-mplcec4.c
 delete mode 100644 arch/arm/mach-kirkwood/board-ns2.c
 delete mode 100644 arch/arm/mach-kirkwood/board-nsa310.c
 delete mode 100644 arch/arm/mach-kirkwood/board-openblocks_a6.c
 delete mode 100644 arch/arm/mach-kirkwood/board-usi_topkick.c

-- 
1.8.1.1

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

* [PATCH V3 1/8] ARM: kirkwood: topkick: init mvsdio via DT
  2013-01-25 20:53 ` [PATCH V3 " Jason Cooper
@ 2013-01-25 20:53   ` Jason Cooper
  2013-01-26 16:21     ` Andrew Lunn
  2013-01-25 20:53   ` [PATCH V3 2/8] ARM: kirkwood: topkick: convert to pinctrl Jason Cooper
                     ` (6 subsequent siblings)
  7 siblings, 1 reply; 102+ messages in thread
From: Jason Cooper @ 2013-01-25 20:53 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Jason Cooper <jason@lakedaemon.net>
---
 arch/arm/boot/dts/kirkwood-topkick.dts     | 7 +++++++
 arch/arm/mach-kirkwood/board-usi_topkick.c | 6 ------
 2 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/arch/arm/boot/dts/kirkwood-topkick.dts b/arch/arm/boot/dts/kirkwood-topkick.dts
index cd15452..23c2ddc 100644
--- a/arch/arm/boot/dts/kirkwood-topkick.dts
+++ b/arch/arm/boot/dts/kirkwood-topkick.dts
@@ -54,6 +54,13 @@
 			status = "okay";
 			nr-ports = <1>;
 		};
+
+		mvsdio at 90000 {
+			pinctrl-0 = <&pmx_sdio>;
+			pinctrl-names = "default";
+			status = "okay";
+			/* No CD or WP GPIOs */
+		};
 	};
 
 	gpio-leds {
diff --git a/arch/arm/mach-kirkwood/board-usi_topkick.c b/arch/arm/mach-kirkwood/board-usi_topkick.c
index 23d2dd1..95f0711 100644
--- a/arch/arm/mach-kirkwood/board-usi_topkick.c
+++ b/arch/arm/mach-kirkwood/board-usi_topkick.c
@@ -14,7 +14,6 @@
 #include <linux/init.h>
 #include <linux/mv643xx_eth.h>
 #include <linux/gpio.h>
-#include <linux/platform_data/mmc-mvsdio.h>
 #include "common.h"
 #include "mpp.h"
 
@@ -22,10 +21,6 @@ static struct mv643xx_eth_platform_data topkick_ge00_data = {
 	.phy_addr	= MV643XX_ETH_PHY_ADDR(0),
 };
 
-static struct mvsdio_platform_data topkick_mvsdio_data = {
-	/* unfortunately the CD signal has not been connected */
-};
-
 /*
  * GPIO LED layout
  *
@@ -73,5 +68,4 @@ void __init usi_topkick_init(void)
 
 
 	kirkwood_ge00_init(&topkick_ge00_data);
-	kirkwood_sdio_init(&topkick_mvsdio_data);
 }
-- 
1.8.1.1

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

* [PATCH V3 2/8] ARM: kirkwood: topkick: convert to pinctrl
  2013-01-25 20:53 ` [PATCH V3 " Jason Cooper
  2013-01-25 20:53   ` [PATCH V3 1/8] ARM: kirkwood: topkick: init mvsdio via DT Jason Cooper
@ 2013-01-25 20:53   ` Jason Cooper
  2013-01-26 16:55     ` [PATCH 1/2] ARM: Kirkwood: topkick: Fix SoC type and add missing pins Andrew Lunn
  2013-01-25 20:53   ` [PATCH V3 3/8] ARM: kirkwood: nsa310: cleanup includes and unneeded code Jason Cooper
                     ` (5 subsequent siblings)
  7 siblings, 1 reply; 102+ messages in thread
From: Jason Cooper @ 2013-01-25 20:53 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Jason Cooper <jason@lakedaemon.net>
---
 arch/arm/boot/dts/kirkwood-topkick.dts     | 88 ++++++++++++++++++++++++++++++
 arch/arm/mach-kirkwood/board-usi_topkick.c | 42 --------------
 2 files changed, 88 insertions(+), 42 deletions(-)

diff --git a/arch/arm/boot/dts/kirkwood-topkick.dts b/arch/arm/boot/dts/kirkwood-topkick.dts
index 23c2ddc..d959873 100644
--- a/arch/arm/boot/dts/kirkwood-topkick.dts
+++ b/arch/arm/boot/dts/kirkwood-topkick.dts
@@ -1,6 +1,7 @@
 /dts-v1/;
 
 /include/ "kirkwood.dtsi"
+/include/ "kirkwood-6281.dtsi"
 
 / {
 	model = "Univeral Scientific Industrial Co. Topkick-1281P2";
@@ -16,6 +17,93 @@
 	};
 
 	ocp at f1000000 {
+		pinctrl: pinctrl at 10000 {
+			/*
+			 * GPIO LED layout
+			 *
+			 *       /-SYS_LED(2)
+			 *       |
+			 *       |   /-DISK_LED
+			 *       |   |
+			 *       |   |   /-WLAN_LED(2)
+			 *       |   |   |
+			 * [SW] [*] [*] [*]
+			 */
+
+			/*
+			 * Switch positions
+			 *
+			 *     /-SW_LEFT(2)
+			 *     |
+			 *     |   /-SW_IDLE
+			 *     |   |
+			 *     |   |   /-SW_RIGHT
+			 *     |   |   |
+			 * PS [L] [I] [R] LEDS
+			 */
+			pinctrl-0 = < &pmx_led_disk_yellow
+				      &pmx_sata0_pwr_enable
+				      &pmx_led_sys_red
+				      &pmx_led_sys_blue
+				      &pmx_led_wifi_green
+				      &pmx_sw_left
+				      &pmx_sw_right
+				      &pmx_sw_idle
+				      &pmx_sw_left2
+				      &pmx_led_wifi_yellow >;
+			pinctrl-names = "default";
+
+			pmx_led_disk_yellow: pmx-led-disk-yellow {
+				marvell,pins = "mpp21";
+				marvell,function = "gpio";
+			};
+
+			pmx_sata0_pwr_enable: pmx-sata0-pwr-enable {
+				marvell,pins = "mpp36";
+				marvell,function = "gpio";
+			};
+
+			pmx_led_sys_red: pmx-led-sys-red {
+				marvell,pins = "mpp37";
+				marvell,function = "gpio";
+			};
+
+			pmx_led_sys_blue: pmx-led-sys-blue {
+				marvell,pins = "mpp38";
+				marvell,function = "gpio";
+			};
+
+			pmx_led_wifi_green: pmx-led-wifi-green {
+				marvell,pins = "mpp39";
+				marvell,function = "gpio";
+			};
+
+			pmx_sw_left: pmx-sw-left {
+				marvell,pins = "mpp43";
+				marvell,function = "gpio";
+			};
+
+			pmx_sw_right: pmx-sw-right {
+				marvell,pins = "mpp44";
+				marvell,function = "gpio";
+			};
+
+			pmx_sw_idle: pmx-sw-idle {
+				marvell,pins = "mpp45";
+				marvell,function = "gpio";
+			};
+
+			pmx_sw_left2: pmx-sw-left2 {
+				marvell,pins = "mpp46";
+				marvell,function = "gpio";
+			};
+
+			pmx_led_wifi_yellow: pmx-led-wifi-yellow {
+				marvell,pins = "mpp48";
+				marvell,function = "gpio";
+			};
+		};
+
 		serial at 12000 {
 			clock-frequency = <200000000>;
 			status = "ok";
diff --git a/arch/arm/mach-kirkwood/board-usi_topkick.c b/arch/arm/mach-kirkwood/board-usi_topkick.c
index 95f0711..1cc04ec 100644
--- a/arch/arm/mach-kirkwood/board-usi_topkick.c
+++ b/arch/arm/mach-kirkwood/board-usi_topkick.c
@@ -15,57 +15,15 @@
 #include <linux/mv643xx_eth.h>
 #include <linux/gpio.h>
 #include "common.h"
-#include "mpp.h"
 
 static struct mv643xx_eth_platform_data topkick_ge00_data = {
 	.phy_addr	= MV643XX_ETH_PHY_ADDR(0),
 };
 
-/*
- * GPIO LED layout
- *
- *       /-SYS_LED(2)
- *       |
- *       |   /-DISK_LED
- *       |   |
- *       |   |   /-WLAN_LED(2)
- *       |   |   |
- * [SW] [*] [*] [*]
- */
-
-/*
- * Switch positions
- *
- *     /-SW_LEFT
- *     |
- *     |   /-SW_IDLE
- *     |   |
- *     |   |   /-SW_RIGHT
- *     |   |   |
- * PS [L] [I] [R] LEDS
- */
-
-static unsigned int topkick_mpp_config[] __initdata = {
-	MPP21_GPIO,	/* DISK_LED           (low active) - yellow */
-	MPP36_GPIO,	/* SATA0 power enable (high active) */
-	MPP37_GPIO,	/* SYS_LED2           (low active) - red */
-	MPP38_GPIO,	/* SYS_LED            (low active) - blue */
-	MPP39_GPIO,	/* WLAN_LED           (low active) - green */
-	MPP43_GPIO,	/* SW_LEFT            (low active) */
-	MPP44_GPIO,     /* SW_RIGHT           (low active) */
-	MPP45_GPIO,	/* SW_IDLE            (low active) */
-	MPP46_GPIO,     /* SW_LEFT            (low active) */
-	MPP48_GPIO,	/* WLAN_LED2          (low active) - yellow */
-	0
-};
-
 void __init usi_topkick_init(void)
 {
 	/*
 	 * Basic setup. Needs to be called early.
 	 */
-	kirkwood_mpp_conf(topkick_mpp_config);
-
-
 	kirkwood_ge00_init(&topkick_ge00_data);
 }
-- 
1.8.1.1

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

* [PATCH V3 3/8] ARM: kirkwood: nsa310: cleanup includes and unneeded code
  2013-01-25 20:53 ` [PATCH V3 " Jason Cooper
  2013-01-25 20:53   ` [PATCH V3 1/8] ARM: kirkwood: topkick: init mvsdio via DT Jason Cooper
  2013-01-25 20:53   ` [PATCH V3 2/8] ARM: kirkwood: topkick: convert to pinctrl Jason Cooper
@ 2013-01-25 20:53   ` Jason Cooper
  2013-01-25 20:53   ` [PATCH V3 4/8] ARM: kirkwood: nsa310: convert to pinctrl Jason Cooper
                     ` (4 subsequent siblings)
  7 siblings, 0 replies; 102+ messages in thread
From: Jason Cooper @ 2013-01-25 20:53 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Jason Cooper <jason@lakedaemon.net>
---
 arch/arm/mach-kirkwood/board-nsa310.c | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/arch/arm/mach-kirkwood/board-nsa310.c b/arch/arm/mach-kirkwood/board-nsa310.c
index 1bd328d..0b99533 100644
--- a/arch/arm/mach-kirkwood/board-nsa310.c
+++ b/arch/arm/mach-kirkwood/board-nsa310.c
@@ -10,11 +10,8 @@
 
 #include <linux/kernel.h>
 #include <linux/init.h>
-#include <linux/i2c.h>
-
-#include <asm/mach-types.h>
-#include <asm/mach/arch.h>
 #include <mach/kirkwood.h>
+#include <linux/of.h>
 #include "common.h"
 #include "mpp.h"
 
@@ -40,11 +37,7 @@ static unsigned int nsa310_mpp_config[] __initdata = {
 
 void __init nsa310_init(void)
 {
-	u32 dev, rev;
-
 	kirkwood_mpp_conf(nsa310_mpp_config);
-
-	kirkwood_pcie_id(&dev, &rev);
 }
 
 static int __init nsa310_pci_init(void)
-- 
1.8.1.1

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

* [PATCH V3 4/8] ARM: kirkwood: nsa310: convert to pinctrl
  2013-01-25 20:53 ` [PATCH V3 " Jason Cooper
                     ` (2 preceding siblings ...)
  2013-01-25 20:53   ` [PATCH V3 3/8] ARM: kirkwood: nsa310: cleanup includes and unneeded code Jason Cooper
@ 2013-01-25 20:53   ` Jason Cooper
  2013-01-25 20:53   ` [PATCH V3 5/8] ARM: kirkwood: consolidate DT init of pcie Jason Cooper
                     ` (3 subsequent siblings)
  7 siblings, 0 replies; 102+ messages in thread
From: Jason Cooper @ 2013-01-25 20:53 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Jason Cooper <jason@lakedaemon.net>
---
 arch/arm/boot/dts/kirkwood-nsa310.dts | 99 +++++++++++++++++++++++++++++++++++
 arch/arm/mach-kirkwood/board-dt.c     |  3 --
 arch/arm/mach-kirkwood/board-nsa310.c | 26 ---------
 arch/arm/mach-kirkwood/common.h       |  6 ---
 4 files changed, 99 insertions(+), 35 deletions(-)

diff --git a/arch/arm/boot/dts/kirkwood-nsa310.dts b/arch/arm/boot/dts/kirkwood-nsa310.dts
index dbb3551..3a178cf 100644
--- a/arch/arm/boot/dts/kirkwood-nsa310.dts
+++ b/arch/arm/boot/dts/kirkwood-nsa310.dts
@@ -16,6 +16,105 @@
 	};
 
 	ocp at f1000000 {
+		pinctrl: pinctrl at 10000 {
+			pinctrl-0 = < &pmx_led_esata_green
+				      &pmx_led_esata_red
+				      &pmx_led_usb_green
+				      &pmx_led_usb_red
+				      &pmx_usb_power_off
+				      &pmx_led_sys_green
+				      &pmx_led_sys_red
+				      &pmx_btn_reset
+				      &pmx_btn_copy
+				      &pmx_led_copy_green
+				      &pmx_led_copy_red
+				      &pmx_led_hdd_green
+				      &pmx_led_hdd_red
+				      &pmx_unknown
+				      &pmx_btn_power
+				      &pmx_pwr_off >;
+			pinctrl-names = "default";
+
+			pmx_led_esata_green: pmx-led-esata-green {
+				marvell,pins = "mpp12";
+				marvell,function = "gpio";
+			};
+
+			pmx_led_esata_red: pmx-led-esata-red {
+				marvell,pins = "mpp13";
+				marvell,function = "gpio";
+			};
+
+			pmx_led_usb_green: pmx-led-usb-green {
+				marvell,pins = "mpp15";
+				marvell,function = "gpio";
+			};
+
+			pmx_led_usb_red: pmx-led-usb-red {
+				marvell,pins = "mpp16";
+				marvell,function = "gpio";
+			};
+
+			pmx_usb_power_off: pmx-usb-power-off {
+				marvell,pins = "mpp21";
+				marvell,function = "gpio";
+			};
+
+			pmx_led_sys_green: pmx-led-sys-green {
+				marvell,pins = "mpp28";
+				marvell,function = "gpio";
+			};
+
+			pmx_led_sys_red: pmx-led-sys-red {
+				marvell,pins = "mpp29";
+				marvell,function = "gpio";
+			};
+
+			pmx_btn_reset: pmx-btn-reset {
+				marvell,pins = "mpp36";
+				marvell,function = "gpio";
+			};
+
+			pmx_btn_copy: pmx-btn-copy {
+				marvell,pins = "mpp37";
+				marvell,function = "gpio";
+			};
+
+			pmx_led_copy_green: pmx-led-copy-green {
+				marvell,pins = "mpp39";
+				marvell,function = "gpio";
+			};
+
+			pmx_led_copy_red: pmx-led-copy-red {
+				marvell,pins = "mpp40";
+				marvell,function = "gpio";
+			};
+
+			pmx_led_hdd_green: pmx-led-hdd-green {
+				marvell,pins = "mpp41";
+				marvell,function = "gpio";
+			};
+
+			pmx_led_hdd_red: pmx-led-hdd-red {
+				marvell,pins = "mpp42";
+				marvell,function = "gpio";
+			};
+
+			pmx_unknown: pmx-unknown {
+				marvell,pins = "mpp44";
+				marvell,function = "gpio";
+			};
+
+			pmx_btn_power: pmx-btn-power {
+				marvell,pins = "mpp46";
+				marvell,function = "gpio";
+			};
+
+			pmx_pwr_off: pmx-pwr-off {
+				marvell,pins = "mpp48";
+				marvell,function = "gpio";
+			};
+		};
 
 		serial at 12000 {
 			clock-frequency = <200000000>;
diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c
index 8eac548..8b35157 100644
--- a/arch/arm/mach-kirkwood/board-dt.c
+++ b/arch/arm/mach-kirkwood/board-dt.c
@@ -141,9 +141,6 @@ static void __init kirkwood_dt_init(void)
 	if (of_machine_is_compatible("usi,topkick"))
 		usi_topkick_init();
 
-	if (of_machine_is_compatible("zyxel,nsa310"))
-		nsa310_init();
-
 	of_platform_populate(NULL, kirkwood_dt_match_table, NULL, NULL);
 }
 
diff --git a/arch/arm/mach-kirkwood/board-nsa310.c b/arch/arm/mach-kirkwood/board-nsa310.c
index 0b99533..55ade93 100644
--- a/arch/arm/mach-kirkwood/board-nsa310.c
+++ b/arch/arm/mach-kirkwood/board-nsa310.c
@@ -13,32 +13,6 @@
 #include <mach/kirkwood.h>
 #include <linux/of.h>
 #include "common.h"
-#include "mpp.h"
-
-static unsigned int nsa310_mpp_config[] __initdata = {
-	MPP12_GPIO, /* led esata green */
-	MPP13_GPIO, /* led esata red */
-	MPP15_GPIO, /* led usb green */
-	MPP16_GPIO, /* led usb red */
-	MPP21_GPIO, /* control usb power off */
-	MPP28_GPIO, /* led sys green */
-	MPP29_GPIO, /* led sys red */
-	MPP36_GPIO, /* key reset */
-	MPP37_GPIO, /* key copy */
-	MPP39_GPIO, /* led copy green */
-	MPP40_GPIO, /* led copy red */
-	MPP41_GPIO, /* led hdd green */
-	MPP42_GPIO, /* led hdd red */
-	MPP44_GPIO, /* ?? */
-	MPP46_GPIO, /* key power */
-	MPP48_GPIO, /* control power off */
-	0
-};
-
-void __init nsa310_init(void)
-{
-	kirkwood_mpp_conf(nsa310_mpp_config);
-}
 
 static int __init nsa310_pci_init(void)
 {
diff --git a/arch/arm/mach-kirkwood/common.h b/arch/arm/mach-kirkwood/common.h
index e956d02..1c42cb8 100644
--- a/arch/arm/mach-kirkwood/common.h
+++ b/arch/arm/mach-kirkwood/common.h
@@ -130,12 +130,6 @@ void ns2_init(void);
 static inline void ns2_init(void) {};
 #endif
 
-#ifdef CONFIG_MACH_NSA310_DT
-void nsa310_init(void);
-#else
-static inline void nsa310_init(void) {};
-#endif
-
 #ifdef CONFIG_MACH_OPENBLOCKS_A6_DT
 void openblocks_a6_init(void);
 #else
-- 
1.8.1.1

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

* [PATCH V3 5/8] ARM: kirkwood: consolidate DT init of pcie
  2013-01-25 20:53 ` [PATCH V3 " Jason Cooper
                     ` (3 preceding siblings ...)
  2013-01-25 20:53   ` [PATCH V3 4/8] ARM: kirkwood: nsa310: convert to pinctrl Jason Cooper
@ 2013-01-25 20:53   ` Jason Cooper
  2013-01-25 20:53   ` [PATCH V3 6/8] ARM: mvebu: correct gated clock documentation Jason Cooper
                     ` (2 subsequent siblings)
  7 siblings, 0 replies; 102+ messages in thread
From: Jason Cooper @ 2013-01-25 20:53 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Jason Cooper <jason@lakedaemon.net>
---
 arch/arm/mach-kirkwood/Makefile         |  1 -
 arch/arm/mach-kirkwood/board-dt.c       | 23 +++++++++++++++++++++++
 arch/arm/mach-kirkwood/board-iconnect.c |  9 ---------
 arch/arm/mach-kirkwood/board-mplcec4.c  |  1 -
 arch/arm/mach-kirkwood/board-nsa310.c   | 25 -------------------------
 arch/arm/mach-kirkwood/board-ts219.c    | 13 -------------
 6 files changed, 23 insertions(+), 49 deletions(-)
 delete mode 100644 arch/arm/mach-kirkwood/board-nsa310.c

diff --git a/arch/arm/mach-kirkwood/Makefile b/arch/arm/mach-kirkwood/Makefile
index d665309..ee3aa77 100644
--- a/arch/arm/mach-kirkwood/Makefile
+++ b/arch/arm/mach-kirkwood/Makefile
@@ -36,6 +36,5 @@ obj-$(CONFIG_MACH_NETSPACE_V2_DT)	+= board-ns2.o
 obj-$(CONFIG_MACH_NETSPACE_MAX_V2_DT)	+= board-ns2.o
 obj-$(CONFIG_MACH_NETSPACE_LITE_V2_DT)	+= board-ns2.o
 obj-$(CONFIG_MACH_NETSPACE_MINI_V2_DT)	+= board-ns2.o
-obj-$(CONFIG_MACH_NSA310_DT)		+= board-nsa310.o
 obj-$(CONFIG_MACH_OPENBLOCKS_A6_DT)	+= board-openblocks_a6.o
 obj-$(CONFIG_MACH_TOPKICK_DT)		+= board-usi_topkick.o
diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c
index 8b35157..73b76e4 100644
--- a/arch/arm/mach-kirkwood/board-dt.c
+++ b/arch/arm/mach-kirkwood/board-dt.c
@@ -70,6 +70,29 @@ static void __init kirkwood_of_clk_init(void)
 	kirkwood_legacy_clk_init();
 }
 
+static const char * const kirkwood_dt_pcie0_compat[] = {
+	"iom,iconnect",
+	"mpl,cec4",
+	"qnap,ts219",
+	"zyxel,nsa310",
+	NULL
+};
+
+static int __init kirkwood_pcie_dt_init(void)
+{
+	int i;
+
+	for (i = 0; kirkwood_dt_pcie0_compat[i] != NULL; i++) {
+		if (of_machine_is_compatible(kirkwood_dt_pcie0_compat[i])) {
+			kirkwood_pcie_init(KW_PCIE0);
+			break;
+		}
+	}
+
+	return 0;
+}
+subsys_initcall(kirkwood_pcie_dt_init);
+
 static void __init kirkwood_dt_init(void)
 {
 	pr_info("Kirkwood: %s, TCLK=%d.\n", kirkwood_id(), kirkwood_tclk);
diff --git a/arch/arm/mach-kirkwood/board-iconnect.c b/arch/arm/mach-kirkwood/board-iconnect.c
index c8ebde4..ff042dc 100644
--- a/arch/arm/mach-kirkwood/board-iconnect.c
+++ b/arch/arm/mach-kirkwood/board-iconnect.c
@@ -10,7 +10,6 @@
 
 #include <linux/kernel.h>
 #include <linux/init.h>
-#include <linux/of.h>
 #include <linux/mv643xx_eth.h>
 #include "common.h"
 
@@ -22,11 +21,3 @@ void __init iconnect_init(void)
 {
 	kirkwood_ge00_init(&iconnect_ge00_data);
 }
-
-static int __init iconnect_pci_init(void)
-{
-	if (of_machine_is_compatible("iom,iconnect"))
-		kirkwood_pcie_init(KW_PCIE0);
-	return 0;
-}
-subsys_initcall(iconnect_pci_init);
diff --git a/arch/arm/mach-kirkwood/board-mplcec4.c b/arch/arm/mach-kirkwood/board-mplcec4.c
index 7d6dc66..938712e 100644
--- a/arch/arm/mach-kirkwood/board-mplcec4.c
+++ b/arch/arm/mach-kirkwood/board-mplcec4.c
@@ -29,7 +29,6 @@ void __init mplcec4_init(void)
 	 */
 	kirkwood_ge00_init(&mplcec4_ge00_data);
 	kirkwood_ge01_init(&mplcec4_ge01_data);
-	kirkwood_pcie_init(KW_PCIE0);
 }
 
 
diff --git a/arch/arm/mach-kirkwood/board-nsa310.c b/arch/arm/mach-kirkwood/board-nsa310.c
deleted file mode 100644
index 55ade93..0000000
--- a/arch/arm/mach-kirkwood/board-nsa310.c
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * arch/arm/mach-kirkwood/nsa-310-setup.c
- *
- * ZyXEL NSA-310 Setup
- *
- * 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 <mach/kirkwood.h>
-#include <linux/of.h>
-#include "common.h"
-
-static int __init nsa310_pci_init(void)
-{
-	if (of_machine_is_compatible("zyxel,nsa310"))
-		kirkwood_pcie_init(KW_PCIE0);
-
-	return 0;
-}
-
-subsys_initcall(nsa310_pci_init);
diff --git a/arch/arm/mach-kirkwood/board-ts219.c b/arch/arm/mach-kirkwood/board-ts219.c
index 10fb397..f00c0a9 100644
--- a/arch/arm/mach-kirkwood/board-ts219.c
+++ b/arch/arm/mach-kirkwood/board-ts219.c
@@ -17,10 +17,7 @@
 
 #include <linux/kernel.h>
 #include <linux/init.h>
-#include <linux/platform_device.h>
 #include <linux/mv643xx_eth.h>
-#include <asm/mach-types.h>
-#include <asm/mach/arch.h>
 #include <mach/kirkwood.h>
 #include "common.h"
 
@@ -38,13 +35,3 @@ void __init qnap_dt_ts219_init(void)
 
 	kirkwood_ge00_init(&qnap_ts219_ge00_data);
 }
-
-/* FIXME: Will not work with DT. Maybe use MPP40_GPIO? */
-static int __init ts219_pci_init(void)
-{
-	if (machine_is_ts219())
-		kirkwood_pcie_init(KW_PCIE0);
-
-	return 0;
-}
-subsys_initcall(ts219_pci_init);
-- 
1.8.1.1

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

* [PATCH V3 6/8] ARM: mvebu: correct gated clock documentation
  2013-01-25 20:53 ` [PATCH V3 " Jason Cooper
                     ` (4 preceding siblings ...)
  2013-01-25 20:53   ` [PATCH V3 5/8] ARM: kirkwood: consolidate DT init of pcie Jason Cooper
@ 2013-01-25 20:53   ` Jason Cooper
  2013-01-25 20:53   ` [PATCH V3 7/8] mv643xx.c: Add basic device tree support Jason Cooper
  2013-01-25 20:54   ` [PATCH V3 8/8] ARM: kirkwood: mv643xx_eth dt conversion Jason Cooper
  7 siblings, 0 replies; 102+ messages in thread
From: Jason Cooper @ 2013-01-25 20:53 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Jason Cooper <jason@lakedaemon.net>
---
 Documentation/devicetree/bindings/clock/mvebu-gated-clock.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/clock/mvebu-gated-clock.txt b/Documentation/devicetree/bindings/clock/mvebu-gated-clock.txt
index 7337005..cffc93d 100644
--- a/Documentation/devicetree/bindings/clock/mvebu-gated-clock.txt
+++ b/Documentation/devicetree/bindings/clock/mvebu-gated-clock.txt
@@ -89,7 +89,7 @@ ID	Clock	Peripheral
 16	xor1	XOR DMA 1
 17	crypto	CESA engine
 18	pex1	PCIe Cntrl 1
-19	ge1	Gigabit Ethernet 0
+19	ge1	Gigabit Ethernet 1
 20	tdm	Time Division Mplx
 
 Required properties:
-- 
1.8.1.1

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

* [PATCH V3 7/8] mv643xx.c: Add basic device tree support.
  2013-01-25 20:53 ` [PATCH V3 " Jason Cooper
                     ` (5 preceding siblings ...)
  2013-01-25 20:53   ` [PATCH V3 6/8] ARM: mvebu: correct gated clock documentation Jason Cooper
@ 2013-01-25 20:53   ` Jason Cooper
  2013-01-28 10:12     ` Mark Rutland
  2013-01-25 20:54   ` [PATCH V3 8/8] ARM: kirkwood: mv643xx_eth dt conversion Jason Cooper
  7 siblings, 1 reply; 102+ messages in thread
From: Jason Cooper @ 2013-01-25 20:53 UTC (permalink / raw)
  To: linux-arm-kernel

From: Ian Molton <ian.molton@codethink.co.uk>

    This patch adds basic device tree support to the mv643xx ethernet driver.

    It should be enough for most current users of the device, and should allow
    a painless migration.

    Signed-off-by: Ian Molton <ian.molton@codethink.co.uk>

Signed-off-by: Jason Cooper <jason@lakedaemon.net>
---
 Documentation/devicetree/bindings/net/mv643xx.txt | 75 ++++++++++++++++++
 drivers/net/ethernet/marvell/mv643xx_eth.c        | 93 +++++++++++++++++++++--
 2 files changed, 161 insertions(+), 7 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/net/mv643xx.txt

diff --git a/Documentation/devicetree/bindings/net/mv643xx.txt b/Documentation/devicetree/bindings/net/mv643xx.txt
new file mode 100644
index 0000000..2727f798
--- /dev/null
+++ b/Documentation/devicetree/bindings/net/mv643xx.txt
@@ -0,0 +1,75 @@
+mv643xx related nodes.
+
+marvell,mdio-mv643xx:
+
+Required properties:
+
+ - interrupts : <a> where a is the SMI interrupt number.
+ - reg : the base address and size of the controllers register space.
+
+Optional properties:
+ - shared_smi : on some chips, the second PHY is "shared", meaning it is
+	really accessed via the first SMI controller. It is passed in this
+	way due to the present structure of the driver, which requires the
+	base address for the MAC to be passed in via the SMI controllers
+	platform data.
+ - tx_csum_limit : on some devices, this option is required for proper
+	operation wrt. jumbo frames.
+
+
+Example:
+
+smi0: mdio at 72000 {
+	compatible = "marvell,mdio-mv643xx";
+	reg = <0x72000 0x4000>;
+	interrupts = <46>;
+	tx_csum_limit = <1600>;
+	status = "disabled";
+};
+
+smi1: mdio at 76000 {
+	compatible = "marvell,mdio-mv643xx";
+	reg = <0x76000 0x4000>;
+	interrupts = <47>;
+	shared_smi = <&smi0>;
+	tx_csum_limit = <1600>;
+	status = "disabled";
+};
+
+
+
+marvell,mv643xx-eth:
+
+Required properties:
+ - interrupts : the port interrupt number.
+ - mdio : phandle of the smi device as drescribed above
+
+Optional properties:
+ - port_number : the port number on this bus.
+ - phy_addr : the PHY address.
+ - reg : should match the mdio reg this device is attached to.
+	this is a required hack for now due to the way the
+	driver is constructed. This allows the device clock to be
+	kept running so that the MAC is not lost after boot.
+
+
+Example:
+
+egiga0 {
+	compatible = "marvell,mv643xx-eth";
+	reg = <0x72000 0x4000>;
+	mdio = <&smi0>;
+	port_number = <0>;
+	phy_addr = <0x80>;
+	interrupts = <11>;
+};
+
+egiga1 {
+	compatible = "marvell,mv643xx-eth";
+	reg = <0x76000 0x4000>;
+	mdio = <&smi1>;
+	port_number = <0>;
+	phy_addr = <0x81>;
+	interrupts = <15>;
+};
+
diff --git a/drivers/net/ethernet/marvell/mv643xx_eth.c b/drivers/net/ethernet/marvell/mv643xx_eth.c
index 84c1326..7048d7c 100644
--- a/drivers/net/ethernet/marvell/mv643xx_eth.c
+++ b/drivers/net/ethernet/marvell/mv643xx_eth.c
@@ -48,6 +48,9 @@
 #include <linux/ethtool.h>
 #include <linux/platform_device.h>
 #include <linux/module.h>
+#include <linux/of.h>
+#include <linux/of_platform.h>
+#include <linux/of_irq.h>
 #include <linux/kernel.h>
 #include <linux/spinlock.h>
 #include <linux/workqueue.h>
@@ -2586,7 +2589,7 @@ static void infer_hw_params(struct mv643xx_eth_shared_private *msp)
 static int mv643xx_eth_shared_probe(struct platform_device *pdev)
 {
 	static int mv643xx_eth_version_printed;
-	struct mv643xx_eth_shared_platform_data *pd = pdev->dev.platform_data;
+	struct mv643xx_eth_shared_platform_data *pd;
 	struct mv643xx_eth_shared_private *msp;
 	const struct mbus_dram_target_info *dram;
 	struct resource *res;
@@ -2610,6 +2613,26 @@ static int mv643xx_eth_shared_probe(struct platform_device *pdev)
 	if (msp->base == NULL)
 		goto out_free;
 
+	if (pdev->dev.of_node) {
+		struct device_node *np = NULL;
+
+		/* when all users of this driver use FDT, we can remove this */
+		pd = kzalloc(sizeof(*pd), GFP_KERNEL);
+		if (!pd) {
+			dev_dbg(&pdev->dev, "Could not allocate platform data\n");
+			goto out_free;
+		}
+
+		of_property_read_u32(pdev->dev.of_node,
+			"tx_csum_limit", &pd->tx_csum_limit);
+
+		np = of_parse_phandle(pdev->dev.of_node, "shared_smi", 0);
+		if (np)
+			pd->shared_smi = of_find_device_by_node(np);
+
+	} else {
+		pd = pdev->dev.platform_data;
+	}
 	/*
 	 * Set up and register SMI bus.
 	 */
@@ -2642,7 +2665,6 @@ static int mv643xx_eth_shared_probe(struct platform_device *pdev)
 	res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
 	if (res != NULL) {
 		int err;
-
 		err = request_irq(res->start, mv643xx_eth_err_irq,
 				  IRQF_SHARED, "mv643xx_eth", msp);
 		if (!err) {
@@ -2660,6 +2682,10 @@ static int mv643xx_eth_shared_probe(struct platform_device *pdev)
 
 	msp->tx_csum_limit = (pd != NULL && pd->tx_csum_limit) ?
 					pd->tx_csum_limit : 9 * 1024;
+
+	if (pdev->dev.of_node)
+		kfree(pd);  /* If we created a fake pd, free it now */
+
 	infer_hw_params(msp);
 
 	platform_set_drvdata(pdev, msp);
@@ -2693,12 +2719,21 @@ static int mv643xx_eth_shared_remove(struct platform_device *pdev)
 	return 0;
 }
 
+#ifdef CONFIG_OF
+static struct of_device_id mv_mdio_dt_ids[] __devinitdata = {
+	{ .compatible = "marvell,mdio-mv643xx", },
+	{},
+};
+MODULE_DEVICE_TABLE(of, mv_mdio_dt_ids);
+#endif
+
 static struct platform_driver mv643xx_eth_shared_driver = {
 	.probe		= mv643xx_eth_shared_probe,
 	.remove		= mv643xx_eth_shared_remove,
 	.driver = {
 		.name	= MV643XX_ETH_SHARED_NAME,
 		.owner	= THIS_MODULE,
+		.of_match_table = of_match_ptr(mv_mdio_dt_ids),
 	},
 };
 
@@ -2858,7 +2893,36 @@ static int mv643xx_eth_probe(struct platform_device *pdev)
 	struct resource *res;
 	int err;
 
-	pd = pdev->dev.platform_data;
+	if (pdev->dev.of_node) {
+		struct device_node *np = NULL;
+
+		/* when all users of this driver use FDT, we can remove this */
+		pd = kzalloc(sizeof(*pd), GFP_KERNEL);
+		if (!pd) {
+			dev_dbg(&pdev->dev, "Could not allocate platform data\n");
+			return -ENOMEM;
+		}
+
+		of_property_read_u32(pdev->dev.of_node,
+			"port_number", &pd->port_number);
+
+		if (!of_property_read_u32(pdev->dev.of_node,
+				"phy_addr", &pd->phy_addr))
+			pd->phy_addr = MV643XX_ETH_PHY_ADDR(pd->phy_addr);
+		else
+			pd->phy_addr = MV643XX_ETH_PHY_ADDR_DEFAULT;
+
+		np = of_parse_phandle(pdev->dev.of_node, "mdio", 0);
+		if (np) {
+			pd->shared = of_find_device_by_node(np);
+		} else {
+			kfree(pd);
+			return -ENODEV;
+		}
+	} else {
+		pd = pdev->dev.platform_data;
+	}
+
 	if (pd == NULL) {
 		dev_err(&pdev->dev, "no mv643xx_eth_platform_data\n");
 		return -ENODEV;
@@ -2866,12 +2930,15 @@ static int mv643xx_eth_probe(struct platform_device *pdev)
 
 	if (pd->shared == NULL) {
 		dev_err(&pdev->dev, "no mv643xx_eth_platform_data->shared\n");
-		return -ENODEV;
+		err = -ENODEV;
+		goto out_free_pd;
 	}
 
 	dev = alloc_etherdev_mq(sizeof(struct mv643xx_eth_private), 8);
-	if (!dev)
-		return -ENOMEM;
+	if (!dev) {
+		err = -ENOMEM;
+		goto out_free_pd;
+	}
 
 	mp = netdev_priv(dev);
 	platform_set_drvdata(pdev, mp);
@@ -2908,6 +2975,8 @@ static int mv643xx_eth_probe(struct platform_device *pdev)
 
 	init_pscr(mp, pd->speed, pd->duplex);
 
+	if (pdev->dev.of_node)
+		kfree(pd); /* If we created a fake pd, free it now */
 
 	mib_counters_clear(mp);
 
@@ -2927,7 +2996,6 @@ static int mv643xx_eth_probe(struct platform_device *pdev)
 	mp->rx_oom.data = (unsigned long)mp;
 	mp->rx_oom.function = oom_timer_wrapper;
 
-
 	res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
 	BUG_ON(!res);
 	dev->irq = res->start;
@@ -2976,6 +3044,8 @@ out:
 	}
 #endif
 	free_netdev(dev);
+out_free_pd:
+	kfree(pd);
 
 	return err;
 }
@@ -3015,6 +3085,14 @@ static void mv643xx_eth_shutdown(struct platform_device *pdev)
 		port_reset(mp);
 }
 
+#ifdef CONFIG_OF
+static struct of_device_id mv_eth_dt_ids[] __devinitdata = {
+	{ .compatible = "marvell,mv643xx-eth", },
+	{},
+};
+MODULE_DEVICE_TABLE(of, mv_eth_dt_ids);
+#endif
+
 static struct platform_driver mv643xx_eth_driver = {
 	.probe		= mv643xx_eth_probe,
 	.remove		= mv643xx_eth_remove,
@@ -3022,6 +3100,7 @@ static struct platform_driver mv643xx_eth_driver = {
 	.driver = {
 		.name	= MV643XX_ETH_NAME,
 		.owner	= THIS_MODULE,
+		.of_match_table = of_match_ptr(mv_eth_dt_ids),
 	},
 };
 
-- 
1.8.1.1

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

* [PATCH V3 8/8] ARM: kirkwood: mv643xx_eth dt conversion
  2013-01-25 20:53 ` [PATCH V3 " Jason Cooper
                     ` (6 preceding siblings ...)
  2013-01-25 20:53   ` [PATCH V3 7/8] mv643xx.c: Add basic device tree support Jason Cooper
@ 2013-01-25 20:54   ` Jason Cooper
  2013-01-26 12:38     ` Andrew Lunn
  2013-01-26 15:33     ` Andrew Lunn
  7 siblings, 2 replies; 102+ messages in thread
From: Jason Cooper @ 2013-01-25 20:54 UTC (permalink / raw)
  To: linux-arm-kernel

Tested on the dreamplug:

mv643xx_eth: MV-643xx 10/100/1000 ethernet driver version 1.4
libphy: mv643xx_eth smi: probed
libphy: mv643xx_eth smi: probed
mv643xx_eth_port f1072000.egiga0 eth0: port 0 with MAC address XX:XX:XX...
mv643xx_eth_port f1076000.egiga1 eth1: port 0 with MAC address XX:XX:XX...

Successfully pulled an ip address and pinged through the interface

Signed-off-by: Jason Cooper <jason@lakedaemon.net>
---
 arch/arm/boot/dts/kirkwood-dnskw.dtsi        |   9 +++
 arch/arm/boot/dts/kirkwood-dockstar.dts      |   8 +++
 arch/arm/boot/dts/kirkwood-dreamplug.dts     |  16 +++++
 arch/arm/boot/dts/kirkwood-goflexnet.dts     |   7 ++
 arch/arm/boot/dts/kirkwood-ib62x0.dts        |   9 +++
 arch/arm/boot/dts/kirkwood-iconnect.dts      |   9 +++
 arch/arm/boot/dts/kirkwood-lsxl.dtsi         |  18 +++++
 arch/arm/boot/dts/kirkwood-mplcec4.dts       |  18 +++++
 arch/arm/boot/dts/kirkwood-ns2-common.dtsi   |   9 +++
 arch/arm/boot/dts/kirkwood-ns2lite.dts       |   5 ++
 arch/arm/boot/dts/kirkwood-ns2mini.dts       |   5 ++
 arch/arm/boot/dts/kirkwood-openblocks_a6.dts |   8 +++
 arch/arm/boot/dts/kirkwood-topkick.dts       |   8 +++
 arch/arm/boot/dts/kirkwood.dtsi              |  38 ++++++++++
 arch/arm/mach-kirkwood/Kconfig               | 101 ---------------------------
 arch/arm/mach-kirkwood/Makefile              |  14 ----
 arch/arm/mach-kirkwood/board-dnskw.c         |   7 --
 arch/arm/mach-kirkwood/board-dockstar.c      |  32 ---------
 arch/arm/mach-kirkwood/board-dreamplug.c     |  35 ----------
 arch/arm/mach-kirkwood/board-dt.c            |  38 +---------
 arch/arm/mach-kirkwood/board-goflexnet.c     |  34 ---------
 arch/arm/mach-kirkwood/board-ib62x0.c        |  29 --------
 arch/arm/mach-kirkwood/board-iconnect.c      |  23 ------
 arch/arm/mach-kirkwood/board-lsxl.c          |  36 ----------
 arch/arm/mach-kirkwood/board-mplcec4.c       |  35 ----------
 arch/arm/mach-kirkwood/board-ns2.c           |  34 ---------
 arch/arm/mach-kirkwood/board-openblocks_a6.c |  26 -------
 arch/arm/mach-kirkwood/board-usi_topkick.c   |  29 --------
 arch/arm/mach-kirkwood/common.h              |  63 -----------------
 29 files changed, 169 insertions(+), 534 deletions(-)
 delete mode 100644 arch/arm/mach-kirkwood/board-dockstar.c
 delete mode 100644 arch/arm/mach-kirkwood/board-dreamplug.c
 delete mode 100644 arch/arm/mach-kirkwood/board-goflexnet.c
 delete mode 100644 arch/arm/mach-kirkwood/board-ib62x0.c
 delete mode 100644 arch/arm/mach-kirkwood/board-iconnect.c
 delete mode 100644 arch/arm/mach-kirkwood/board-lsxl.c
 delete mode 100644 arch/arm/mach-kirkwood/board-mplcec4.c
 delete mode 100644 arch/arm/mach-kirkwood/board-ns2.c
 delete mode 100644 arch/arm/mach-kirkwood/board-openblocks_a6.c
 delete mode 100644 arch/arm/mach-kirkwood/board-usi_topkick.c

diff --git a/arch/arm/boot/dts/kirkwood-dnskw.dtsi b/arch/arm/boot/dts/kirkwood-dnskw.dtsi
index 6875ac0..9e2132a 100644
--- a/arch/arm/boot/dts/kirkwood-dnskw.dtsi
+++ b/arch/arm/boot/dts/kirkwood-dnskw.dtsi
@@ -186,6 +186,15 @@
 				reg = <0x7b00000 0x500000>;
 			};
 		};
+
+		smi0: mdio at 72000 {
+			status = "ok";
+		};
+
+		egiga0 {
+			phy_addr = <0x88>;
+			status = "ok";
+		};
 	};
 
 	regulators {
diff --git a/arch/arm/boot/dts/kirkwood-dockstar.dts b/arch/arm/boot/dts/kirkwood-dockstar.dts
index 2e3dd34..ec09085 100644
--- a/arch/arm/boot/dts/kirkwood-dockstar.dts
+++ b/arch/arm/boot/dts/kirkwood-dockstar.dts
@@ -60,6 +60,14 @@
 				reg = <0x0500000 0xfb00000>;
 			};
 		};
+
+		smi0: mdio at 72000 {
+			status = "ok";
+		};
+
+		egiga0 {
+			status = "ok";
+		};
 	};
 	gpio-leds {
 		compatible = "gpio-leds";
diff --git a/arch/arm/boot/dts/kirkwood-dreamplug.dts b/arch/arm/boot/dts/kirkwood-dreamplug.dts
index ef2d8c7..ae130a5 100644
--- a/arch/arm/boot/dts/kirkwood-dreamplug.dts
+++ b/arch/arm/boot/dts/kirkwood-dreamplug.dts
@@ -81,6 +81,22 @@
 			status = "okay";
 			/* No CD or WP GPIOs */
 		};
+
+		smi0: mdio at 72000 {
+			status = "ok";
+		};
+
+		smi1: mdio at 76000 {
+			status = "ok";
+		};
+
+		egiga0 {
+			status = "ok";
+		};
+
+		egiga1 {
+			status = "ok";
+		};
 	};
 
 	gpio-leds {
diff --git a/arch/arm/boot/dts/kirkwood-goflexnet.dts b/arch/arm/boot/dts/kirkwood-goflexnet.dts
index 1b133e0..98513ee 100644
--- a/arch/arm/boot/dts/kirkwood-goflexnet.dts
+++ b/arch/arm/boot/dts/kirkwood-goflexnet.dts
@@ -106,6 +106,13 @@
 			nr-ports = <2>;
 		};
 
+		smi0: mdio at 72000 {
+			status = "ok";
+		};
+
+		egiga0 {
+			status = "ok";
+		};
 	};
 	gpio-leds {
 		compatible = "gpio-leds";
diff --git a/arch/arm/boot/dts/kirkwood-ib62x0.dts b/arch/arm/boot/dts/kirkwood-ib62x0.dts
index 71902da..e77b06d 100644
--- a/arch/arm/boot/dts/kirkwood-ib62x0.dts
+++ b/arch/arm/boot/dts/kirkwood-ib62x0.dts
@@ -79,6 +79,15 @@
 			};
 
 		};
+
+		smi0: mdio at 72000 {
+			status = "ok";
+		};
+
+		egiga0 {
+			phy_addr = <0x88>;
+			status = "ok";
+		};
 	};
 
 	gpio_keys {
diff --git a/arch/arm/boot/dts/kirkwood-iconnect.dts b/arch/arm/boot/dts/kirkwood-iconnect.dts
index 504f16b..5b89685 100644
--- a/arch/arm/boot/dts/kirkwood-iconnect.dts
+++ b/arch/arm/boot/dts/kirkwood-iconnect.dts
@@ -110,6 +110,15 @@
 				reg = <0x980000 0x1f400000>;
 			};
 		};
+
+		smi0: mdio at 72000 {
+			status = "ok";
+		};
+
+		egiga0 {
+			phy_addr = <0x91>;
+			status = "ok";
+		};
 	};
 
 	gpio-leds {
diff --git a/arch/arm/boot/dts/kirkwood-lsxl.dtsi b/arch/arm/boot/dts/kirkwood-lsxl.dtsi
index 996c7fe..16199bf 100644
--- a/arch/arm/boot/dts/kirkwood-lsxl.dtsi
+++ b/arch/arm/boot/dts/kirkwood-lsxl.dtsi
@@ -106,6 +106,24 @@
 				};
 			};
 		};
+
+		smi0: mdio at 72000 {
+			status = "ok";
+		};
+
+		smi1: mdio at 76000 {
+			status = "ok";
+		};
+
+		egiga0 {
+			phy_addr = <0x80>;
+			status = "ok";
+		};
+
+		egiga1 {
+			phy_addr = <0x88>;
+			status = "ok";
+		};
 	};
 
 	gpio_keys {
diff --git a/arch/arm/boot/dts/kirkwood-mplcec4.dts b/arch/arm/boot/dts/kirkwood-mplcec4.dts
index 662dfd8..33130d1 100644
--- a/arch/arm/boot/dts/kirkwood-mplcec4.dts
+++ b/arch/arm/boot/dts/kirkwood-mplcec4.dts
@@ -140,6 +140,24 @@
 			cd-gpios = <&gpio1 15 0>;
 			/* No WP GPIO */
 		};
+
+		smi0: mdio at 72000 {
+			status = "ok";
+		};
+
+		smi1: mdio at 76000 {
+			status = "ok";
+		};
+
+		egiga0 {
+			phy_addr = <0x81>;
+			status = "ok";
+		};
+
+		egiga1 {
+			phy_addr = <0x82>;
+			status = "ok";
+		};
 	};
 
 	gpio-leds {
diff --git a/arch/arm/boot/dts/kirkwood-ns2-common.dtsi b/arch/arm/boot/dts/kirkwood-ns2-common.dtsi
index e8e7ece..0c54321 100644
--- a/arch/arm/boot/dts/kirkwood-ns2-common.dtsi
+++ b/arch/arm/boot/dts/kirkwood-ns2-common.dtsi
@@ -54,6 +54,15 @@
 				reg = <0x50>;
 			};
 		};
+
+		smi0: mdio at 72000 {
+			status = "ok";
+		};
+
+		egiga0 {
+			phy_addr = <0x88>;
+			status = "ok";
+		};
 	};
 
 	gpio_keys {
diff --git a/arch/arm/boot/dts/kirkwood-ns2lite.dts b/arch/arm/boot/dts/kirkwood-ns2lite.dts
index b02eb4e..e7cd611 100644
--- a/arch/arm/boot/dts/kirkwood-ns2lite.dts
+++ b/arch/arm/boot/dts/kirkwood-ns2lite.dts
@@ -16,6 +16,11 @@
 			status = "okay";
 			nr-ports = <1>;
 		};
+
+		egiga0 {
+			phy_addr = <0x80>;
+			status = "ok";
+		};
 	};
 
 	gpio-leds {
diff --git a/arch/arm/boot/dts/kirkwood-ns2mini.dts b/arch/arm/boot/dts/kirkwood-ns2mini.dts
index b79f5eb..700d308 100644
--- a/arch/arm/boot/dts/kirkwood-ns2mini.dts
+++ b/arch/arm/boot/dts/kirkwood-ns2mini.dts
@@ -16,6 +16,11 @@
 			status = "okay";
 			nr-ports = <1>;
 		};
+
+		egiga0 {
+			phy_addr = <0x80>;
+			status = "ok";
+		};
 	};
 
 	gpio_fan {
diff --git a/arch/arm/boot/dts/kirkwood-openblocks_a6.dts b/arch/arm/boot/dts/kirkwood-openblocks_a6.dts
index ede7fe0d..b179d43 100644
--- a/arch/arm/boot/dts/kirkwood-openblocks_a6.dts
+++ b/arch/arm/boot/dts/kirkwood-openblocks_a6.dts
@@ -191,6 +191,14 @@
 				marvell,function = "gpio";
 			};
 		};
+
+		smi0: mdio at 72000 {
+			status = "ok";
+		};
+
+		egiga0 {
+			status = "ok";
+		};
 	};
 
 	gpio-leds {
diff --git a/arch/arm/boot/dts/kirkwood-topkick.dts b/arch/arm/boot/dts/kirkwood-topkick.dts
index d959873..edefbb5 100644
--- a/arch/arm/boot/dts/kirkwood-topkick.dts
+++ b/arch/arm/boot/dts/kirkwood-topkick.dts
@@ -149,6 +149,14 @@
 			status = "okay";
 			/* No CD or WP GPIOs */
 		};
+
+		smi0: mdio at 72000 {
+			status = "ok";
+		};
+
+		egiga0 {
+			status = "ok";
+		};
 	};
 
 	gpio-leds {
diff --git a/arch/arm/boot/dts/kirkwood.dtsi b/arch/arm/boot/dts/kirkwood.dtsi
index 2c738d9..b13a405 100644
--- a/arch/arm/boot/dts/kirkwood.dtsi
+++ b/arch/arm/boot/dts/kirkwood.dtsi
@@ -201,5 +201,43 @@
 			clocks = <&gate_clk 4>;
 			status = "disabled";
 		};
+
+		smi0: mdio at 72000 {
+			compatible = "marvell,mdio-mv643xx";
+			reg = <0x72000 0x4000>;
+			interrupts = <46>;
+			tx_csum_limit = <1600>;
+			status = "disabled";
+		};
+
+		smi1: mdio at 76000 {
+			compatible = "marvell,mdio-mv643xx";
+			reg = <0x76000 0x4000>;
+			interrupts = <47>;
+			tx_csum_limit = <1600>;
+			status = "disabled";
+		};
+
+		egiga0 {
+			compatible = "marvell,mv643xx-eth";
+			reg = <0x72000 0x4000>;
+			mdio = <&smi0>;
+			port_number = <0>;
+			phy_addr = <0x80>;
+			interrupts = <11>;
+			clocks = <&gate_clk 0>;
+			status = "disabled";
+		};
+
+		egiga1 {
+			compatible = "marvell,mv643xx-eth";
+			reg = <0x76000 0x4000>;
+			mdio = <&smi1>;
+			port_number = <0>;
+			phy_addr = <0x81>;
+			interrupts = <15>;
+			clocks = <&gate_clk 19>;
+			status = "disabled";
+		};
 	};
 };
diff --git a/arch/arm/mach-kirkwood/Kconfig b/arch/arm/mach-kirkwood/Kconfig
index 432bee0..188651b 100644
--- a/arch/arm/mach-kirkwood/Kconfig
+++ b/arch/arm/mach-kirkwood/Kconfig
@@ -58,19 +58,6 @@ config ARCH_KIRKWOOD_DT
 	  Say 'Y' here if you want your kernel to support the
 	  Marvell Kirkwood using flattened device tree.
 
-config MACH_DREAMPLUG_DT
-	bool "Marvell DreamPlug (Flattened Device Tree)"
-	select ARCH_KIRKWOOD_DT
-	help
-	  Say 'Y' here if you want your kernel to support the
-	  Marvell DreamPlug (Flattened Device Tree).
-
-config MACH_ICONNECT_DT
-	bool "Iomega Iconnect (Flattened Device Tree)"
-	select ARCH_KIRKWOOD_DT
-	help
-	  Say 'Y' here to enable Iomega Iconnect support.
-
 config MACH_DLINK_KIRKWOOD_DT
 	bool "D-Link Kirkwood-based NAS (Flattened Device Tree)"
 	select ARCH_KIRKWOOD_DT
@@ -79,14 +66,6 @@ config MACH_DLINK_KIRKWOOD_DT
 	  Kirkwood-based D-Link NASes such as DNS-320 & DNS-325,
 	  using Flattened Device Tree.
 
-config MACH_IB62X0_DT
-	bool "RaidSonic IB-NAS6210, IB-NAS6220 (Flattened Device Tree)"
-	select ARCH_KIRKWOOD_DT
-	help
-	  Say 'Y' here if you want your kernel to support the
-	  RaidSonic IB-NAS6210 & IB-NAS6220 devices, using
-	  Flattened Device Tree.
-
 config MACH_TS219_DT
 	bool "Device Tree for QNAP TS-11X, TS-21X NAS"
 	select ARCH_KIRKWOOD_DT
@@ -102,29 +81,6 @@ config MACH_TS219_DT
 	  or MV6282. If you have the wrong one, the buttons will not
 	  work.
 
-config MACH_DOCKSTAR_DT
-	bool "Seagate FreeAgent Dockstar (Flattened Device Tree)"
-	select ARCH_KIRKWOOD_DT
-	help
-	  Say 'Y' here if you want your kernel to support the
-	  Seagate FreeAgent Dockstar (Flattened Device Tree).
-
-config MACH_GOFLEXNET_DT
-	bool "Seagate GoFlex Net (Flattened Device Tree)"
-	select ARCH_KIRKWOOD_DT
-	help
-	  Say 'Y' here if you want your kernel to support the
-	  Seagate GoFlex Net (Flattened Device Tree).
-
-config MACH_LSXL_DT
-	bool "Buffalo Linkstation LS-XHL, LS-CHLv2 (Flattened Device Tree)"
-	select ARCH_KIRKWOOD_DT
-	select POWER_RESET_RESTART
-	help
-	  Say 'Y' here if you want your kernel to support the
-	  Buffalo Linkstation LS-XHL & LS-CHLv2 devices, using
-	  Flattened Device Tree.
-
 config MACH_IOMEGA_IX2_200_DT
 	bool "Iomega StorCenter ix2-200 (Flattened Device Tree)"
 	select ARCH_KIRKWOOD_DT
@@ -139,63 +95,6 @@ config MACH_KM_KIRKWOOD_DT
 	  Say 'Y' here if you want your kernel to support the
 	  Keymile Kirkwood Reference Desgin, using Flattened Device Tree.
 
-config MACH_INETSPACE_V2_DT
-	bool "LaCie Internet Space v2 NAS (Flattened Device Tree)"
-	select ARCH_KIRKWOOD_DT
-	help
-	  Say 'Y' here if you want your kernel to support the LaCie
-	  Internet Space v2 NAS, using Flattened Device Tree.
-
-config MACH_MPLCEC4_DT
-	bool "MPL CEC4 (Flattened Device Tree)"
-	select ARCH_KIRKWOOD_DT
-	help
-	  Say 'Y' here if you want your kernel to support the
-	  MPL CEC4 (Flattened Device Tree).
-
-config MACH_NETSPACE_V2_DT
-	bool "LaCie Network Space v2 NAS (Flattened Device Tree)"
-	select ARCH_KIRKWOOD_DT
-	help
-	  Say 'Y' here if you want your kernel to support the LaCie
-	  Network Space v2 NAS, using Flattened Device Tree.
-
-config MACH_NETSPACE_MAX_V2_DT
-	bool "LaCie Network Space Max v2 NAS (Flattened Device Tree)"
-	select ARCH_KIRKWOOD_DT
-	help
-	  Say 'Y' here if you want your kernel to support the LaCie
-	  Network Space Max v2 NAS, using Flattened Device Tree.
-
-config MACH_NETSPACE_LITE_V2_DT
-	bool "LaCie Network Space Lite v2 NAS (Flattened Device Tree)"
-	select ARCH_KIRKWOOD_DT
-	help
-	  Say 'Y' here if you want your kernel to support the LaCie
-	  Network Space Lite v2 NAS, using Flattened Device Tree.
-
-config MACH_NETSPACE_MINI_V2_DT
-	bool "LaCie Network Space Mini v2 NAS (Flattened Device Tree)"
-	select ARCH_KIRKWOOD_DT
-	help
-	  Say 'Y' here if you want your kernel to support the LaCie
-	  Network Space Mini v2 NAS (aka SafeBox), using Flattened
-	  Device Tree.
-
-config MACH_OPENBLOCKS_A6_DT
-	bool "Plat'Home OpenBlocks A6 (Flattened Device Tree)"
-	select ARCH_KIRKWOOD_DT
-	help
-	  Say 'Y' here if you want your kernel to support the
-	  Plat'Home OpenBlocks A6 (Flattened Device Tree).
-
-config MACH_TOPKICK_DT
-	bool "USI Topkick (Flattened Device Tree)"
-	select ARCH_KIRKWOOD_DT
-	help
-	  Say 'Y' here if you want your kernel to support the
-	  USI Topkick, using Flattened Device Tree
-
 config MACH_TS219
 	bool "QNAP TS-110, TS-119, TS-119P+, TS-210, TS-219, TS-219P and TS-219P+ Turbo NAS"
 	help
diff --git a/arch/arm/mach-kirkwood/Makefile b/arch/arm/mach-kirkwood/Makefile
index ee3aa77..ab739b0 100644
--- a/arch/arm/mach-kirkwood/Makefile
+++ b/arch/arm/mach-kirkwood/Makefile
@@ -20,21 +20,7 @@ obj-$(CONFIG_MACH_NET5BIG_V2)		+= netxbig_v2-setup.o lacie_v2-common.o
 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_ICONNECT_DT)		+= board-iconnect.o
 obj-$(CONFIG_MACH_DLINK_KIRKWOOD_DT)	+= board-dnskw.o
-obj-$(CONFIG_MACH_IB62X0_DT)		+= board-ib62x0.o
 obj-$(CONFIG_MACH_TS219_DT)		+= board-ts219.o tsx1x-common.o
-obj-$(CONFIG_MACH_DOCKSTAR_DT)		+= board-dockstar.o
-obj-$(CONFIG_MACH_GOFLEXNET_DT)		+= board-goflexnet.o
-obj-$(CONFIG_MACH_LSXL_DT)		+= board-lsxl.o
 obj-$(CONFIG_MACH_IOMEGA_IX2_200_DT)	+= board-iomega_ix2_200.o
 obj-$(CONFIG_MACH_KM_KIRKWOOD_DT)	+= board-km_kirkwood.o
-obj-$(CONFIG_MACH_INETSPACE_V2_DT)	+= board-ns2.o
-obj-$(CONFIG_MACH_MPLCEC4_DT)		+= board-mplcec4.o
-obj-$(CONFIG_MACH_NETSPACE_V2_DT)	+= board-ns2.o
-obj-$(CONFIG_MACH_NETSPACE_MAX_V2_DT)	+= board-ns2.o
-obj-$(CONFIG_MACH_NETSPACE_LITE_V2_DT)	+= board-ns2.o
-obj-$(CONFIG_MACH_NETSPACE_MINI_V2_DT)	+= board-ns2.o
-obj-$(CONFIG_MACH_OPENBLOCKS_A6_DT)	+= board-openblocks_a6.o
-obj-$(CONFIG_MACH_TOPKICK_DT)		+= board-usi_topkick.o
diff --git a/arch/arm/mach-kirkwood/board-dnskw.c b/arch/arm/mach-kirkwood/board-dnskw.c
index a1aa87f..2af7a95 100644
--- a/arch/arm/mach-kirkwood/board-dnskw.c
+++ b/arch/arm/mach-kirkwood/board-dnskw.c
@@ -14,14 +14,9 @@
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/platform_device.h>
-#include <linux/mv643xx_eth.h>
 #include <linux/gpio.h>
 #include "common.h"
 
-static struct mv643xx_eth_platform_data dnskw_ge00_data = {
-	.phy_addr	= MV643XX_ETH_PHY_ADDR(8),
-};
-
 /* Register any GPIO for output and set the value */
 static void __init dnskw_gpio_register(unsigned gpio, char *name, int def)
 {
@@ -36,8 +31,6 @@ static void __init dnskw_gpio_register(unsigned gpio, char *name, int def)
 
 void __init dnskw_init(void)
 {
-	kirkwood_ge00_init(&dnskw_ge00_data);
-
 	/* Set NAS to turn back on after a power failure */
 	dnskw_gpio_register(37, "dnskw:power:recover", 1);
 }
diff --git a/arch/arm/mach-kirkwood/board-dockstar.c b/arch/arm/mach-kirkwood/board-dockstar.c
deleted file mode 100644
index d7196db..0000000
--- a/arch/arm/mach-kirkwood/board-dockstar.c
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * arch/arm/mach-kirkwood/board-dockstar.c
- *
- * Seagate FreeAgent Dockstar 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.
- *
- * Copied and modified for Seagate GoFlex Net support by
- * Joshua Coombs <josh.coombs@gmail.com> based on ArchLinux ARM's
- * GoFlex kernel patches.
- *
- */
-
-#include <linux/kernel.h>
-#include <linux/init.h>
-#include <linux/mv643xx_eth.h>
-#include "common.h"
-
-static struct mv643xx_eth_platform_data dockstar_ge00_data = {
-	.phy_addr	= MV643XX_ETH_PHY_ADDR(0),
-};
-
-void __init dockstar_dt_init(void)
-{
-	/*
-	 * Basic setup. Needs to be called early.
-	 */
-	kirkwood_ge00_init(&dockstar_ge00_data);
-}
diff --git a/arch/arm/mach-kirkwood/board-dreamplug.c b/arch/arm/mach-kirkwood/board-dreamplug.c
deleted file mode 100644
index 0903242..0000000
--- a/arch/arm/mach-kirkwood/board-dreamplug.c
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright 2012 (C), Jason Cooper <jason@lakedaemon.net>
- *
- * arch/arm/mach-kirkwood/board-dreamplug.c
- *
- * Marvell DreamPlug 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 <linux/gpio.h>
-#include "common.h"
-
-static struct mv643xx_eth_platform_data dreamplug_ge00_data = {
-	.phy_addr	= MV643XX_ETH_PHY_ADDR(0),
-};
-
-static struct mv643xx_eth_platform_data dreamplug_ge01_data = {
-	.phy_addr	= MV643XX_ETH_PHY_ADDR(1),
-};
-
-void __init dreamplug_init(void)
-{
-	/*
-	 * Basic setup. Needs to be called early.
-	 */
-	kirkwood_ge00_init(&dreamplug_ge00_data);
-	kirkwood_ge01_init(&dreamplug_ge01_data);
-}
diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c
index 73b76e4..7ab92e5 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, "mv643xx_eth_port.0",
+	orion_clkdev_add(NULL, "f1072000.egiga0",
 			 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, "mv643xx_eth_port.1",
+	orion_clkdev_add(NULL, "f1076000.egiga1",
 			 of_clk_get_from_provider(&clkspec));
 }
 
@@ -118,52 +118,18 @@ static void __init kirkwood_dt_init(void)
 	kexec_reinit = kirkwood_enable_pcie;
 #endif
 
-	if (of_machine_is_compatible("globalscale,dreamplug"))
-		dreamplug_init();
-
 	if (of_machine_is_compatible("dlink,dns-kirkwood"))
 		dnskw_init();
 
-	if (of_machine_is_compatible("iom,iconnect"))
-		iconnect_init();
-
-	if (of_machine_is_compatible("raidsonic,ib-nas62x0"))
-		ib62x0_init();
-
 	if (of_machine_is_compatible("qnap,ts219"))
 		qnap_dt_ts219_init();
 
-	if (of_machine_is_compatible("seagate,dockstar"))
-		dockstar_dt_init();
-
-	if (of_machine_is_compatible("seagate,goflexnet"))
-		goflexnet_init();
-
-	if (of_machine_is_compatible("buffalo,lsxl"))
-		lsxl_init();
-
 	if (of_machine_is_compatible("iom,ix2-200"))
 		iomega_ix2_200_init();
 
 	if (of_machine_is_compatible("keymile,km_kirkwood"))
 		km_kirkwood_init();
 
-	if (of_machine_is_compatible("lacie,inetspace_v2") ||
-	    of_machine_is_compatible("lacie,netspace_v2") ||
-	    of_machine_is_compatible("lacie,netspace_max_v2") ||
-	    of_machine_is_compatible("lacie,netspace_lite_v2") ||
-	    of_machine_is_compatible("lacie,netspace_mini_v2"))
-		ns2_init();
-
-	if (of_machine_is_compatible("mpl,cec4"))
-		mplcec4_init();
-
-	if (of_machine_is_compatible("plathome,openblocks-a6"))
-		openblocks_a6_init();
-
-	if (of_machine_is_compatible("usi,topkick"))
-		usi_topkick_init();
-
 	of_platform_populate(NULL, kirkwood_dt_match_table, NULL, NULL);
 }
 
diff --git a/arch/arm/mach-kirkwood/board-goflexnet.c b/arch/arm/mach-kirkwood/board-goflexnet.c
deleted file mode 100644
index 9db979a..0000000
--- a/arch/arm/mach-kirkwood/board-goflexnet.c
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright 2012 (C), Jason Cooper <jason@lakedaemon.net>
- *
- * arch/arm/mach-kirkwood/board-goflexnet.c
- *
- * Seagate GoFlext Net 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.
- *
- * Copied and modified for Seagate GoFlex Net support by
- * Joshua Coombs <josh.coombs@gmail.com> based on ArchLinux ARM's
- * GoFlex kernel patches.
- *
- */
-
-#include <linux/kernel.h>
-#include <linux/init.h>
-#include <linux/mv643xx_eth.h>
-#include "common.h"
-
-static struct mv643xx_eth_platform_data goflexnet_ge00_data = {
-	.phy_addr	= MV643XX_ETH_PHY_ADDR(0),
-};
-
-void __init goflexnet_init(void)
-{
-	/*
-	 * Basic setup. Needs to be called early.
-	 */
-	kirkwood_ge00_init(&goflexnet_ge00_data);
-}
diff --git a/arch/arm/mach-kirkwood/board-ib62x0.c b/arch/arm/mach-kirkwood/board-ib62x0.c
deleted file mode 100644
index 9a857ae..0000000
--- a/arch/arm/mach-kirkwood/board-ib62x0.c
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Copyright 2012 (C), Simon Baatz <gmbnomis@gmail.com>
- *
- * arch/arm/mach-kirkwood/board-ib62x0.c
- *
- * RaidSonic ICY BOX IB-NAS6210 & IB-NAS6220 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 ib62x0_ge00_data = {
-	.phy_addr	= MV643XX_ETH_PHY_ADDR(8),
-};
-
-void __init ib62x0_init(void)
-{
-	/*
-	 * Basic setup. Needs to be called early.
-	 */
-	kirkwood_ge00_init(&ib62x0_ge00_data);
-}
diff --git a/arch/arm/mach-kirkwood/board-iconnect.c b/arch/arm/mach-kirkwood/board-iconnect.c
deleted file mode 100644
index ff042dc..0000000
--- a/arch/arm/mach-kirkwood/board-iconnect.c
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * arch/arm/mach-kirkwood/board-iconnect.c
- *
- * Iomega i-connect Board Setup
- *
- * 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 iconnect_ge00_data = {
-	.phy_addr	= MV643XX_ETH_PHY_ADDR(11),
-};
-
-void __init iconnect_init(void)
-{
-	kirkwood_ge00_init(&iconnect_ge00_data);
-}
diff --git a/arch/arm/mach-kirkwood/board-lsxl.c b/arch/arm/mach-kirkwood/board-lsxl.c
deleted file mode 100644
index 3483952..0000000
--- a/arch/arm/mach-kirkwood/board-lsxl.c
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright 2012 (C), Michael Walle <michael@walle.cc>
- *
- * arch/arm/mach-kirkwood/board-lsxl.c
- *
- * Buffalo Linkstation LS-XHL and LS-CHLv2 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/platform_device.h>
-#include <linux/mv643xx_eth.h>
-#include "common.h"
-
-static struct mv643xx_eth_platform_data lsxl_ge00_data = {
-	.phy_addr	= MV643XX_ETH_PHY_ADDR(0),
-};
-
-static struct mv643xx_eth_platform_data lsxl_ge01_data = {
-	.phy_addr	= MV643XX_ETH_PHY_ADDR(8),
-};
-
-void __init lsxl_init(void)
-{
-	/*
-	 * Basic setup. Needs to be called early.
-	 */
-
-	kirkwood_ge00_init(&lsxl_ge00_data);
-	kirkwood_ge01_init(&lsxl_ge01_data);
-}
diff --git a/arch/arm/mach-kirkwood/board-mplcec4.c b/arch/arm/mach-kirkwood/board-mplcec4.c
deleted file mode 100644
index 938712e..0000000
--- a/arch/arm/mach-kirkwood/board-mplcec4.c
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright (C) 2012 MPL AG, Switzerland
- * Stefan Peter <s.peter@mpl.ch>
- *
- * arch/arm/mach-kirkwood/board-mplcec4.c
- *
- * 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 mplcec4_ge00_data = {
-	.phy_addr	= MV643XX_ETH_PHY_ADDR(1),
-};
-
-static struct mv643xx_eth_platform_data mplcec4_ge01_data = {
-	.phy_addr	= MV643XX_ETH_PHY_ADDR(2),
-};
-
-void __init mplcec4_init(void)
-{
-	/*
-	 * Basic setup. Needs to be called early.
-	 */
-	kirkwood_ge00_init(&mplcec4_ge00_data);
-	kirkwood_ge01_init(&mplcec4_ge01_data);
-}
-
-
-
diff --git a/arch/arm/mach-kirkwood/board-ns2.c b/arch/arm/mach-kirkwood/board-ns2.c
deleted file mode 100644
index f2ea3b7..0000000
--- a/arch/arm/mach-kirkwood/board-ns2.c
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright 2012 (C), Simon Guinot <simon.guinot@sequanux.org>
- *
- * arch/arm/mach-kirkwood/board-ns2.c
- *
- * LaCie Network Space v2 board (and parents) initialization 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/platform_device.h>
-#include <linux/mv643xx_eth.h>
-#include <linux/of.h>
-#include "common.h"
-
-static struct mv643xx_eth_platform_data ns2_ge00_data = {
-	.phy_addr	= MV643XX_ETH_PHY_ADDR(8),
-};
-
-void __init ns2_init(void)
-{
-	/*
-	 * Basic setup. Needs to be called early.
-	 */
-	if (of_machine_is_compatible("lacie,netspace_lite_v2") ||
-	    of_machine_is_compatible("lacie,netspace_mini_v2"))
-		ns2_ge00_data.phy_addr = MV643XX_ETH_PHY_ADDR(0);
-	kirkwood_ge00_init(&ns2_ge00_data);
-}
diff --git a/arch/arm/mach-kirkwood/board-openblocks_a6.c b/arch/arm/mach-kirkwood/board-openblocks_a6.c
deleted file mode 100644
index b11d8fd..0000000
--- a/arch/arm/mach-kirkwood/board-openblocks_a6.c
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Copyright 2012 Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
- *
- * arch/arm/mach-kirkwood/board-openblocks_a6.c
- *
- * 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 openblocks_ge00_data = {
-	.phy_addr	= MV643XX_ETH_PHY_ADDR(0),
-};
-
-void __init openblocks_a6_init(void)
-{
-	/*
-	 * Basic setup. Needs to be called early.
-	 */
-	kirkwood_ge00_init(&openblocks_ge00_data);
-}
diff --git a/arch/arm/mach-kirkwood/board-usi_topkick.c b/arch/arm/mach-kirkwood/board-usi_topkick.c
deleted file mode 100644
index 1cc04ec..0000000
--- a/arch/arm/mach-kirkwood/board-usi_topkick.c
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Copyright 2012 (C), Jason Cooper <jason@lakedaemon.net>
- *
- * arch/arm/mach-kirkwood/board-usi_topkick.c
- *
- * USI Topkick 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 <linux/gpio.h>
-#include "common.h"
-
-static struct mv643xx_eth_platform_data topkick_ge00_data = {
-	.phy_addr	= MV643XX_ETH_PHY_ADDR(0),
-};
-
-void __init usi_topkick_init(void)
-{
-	/*
-	 * Basic setup. Needs to be called early.
-	 */
-	kirkwood_ge00_init(&topkick_ge00_data);
-}
diff --git a/arch/arm/mach-kirkwood/common.h b/arch/arm/mach-kirkwood/common.h
index 1c42cb8..ba6eb9c 100644
--- a/arch/arm/mach-kirkwood/common.h
+++ b/arch/arm/mach-kirkwood/common.h
@@ -55,11 +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_DREAMPLUG_DT
-void dreamplug_init(void);
-#else
-static inline void dreamplug_init(void) {};
-#endif
 #ifdef CONFIG_MACH_TS219_DT
 void qnap_dt_ts219_init(void);
 #else
@@ -72,36 +67,6 @@ void dnskw_init(void);
 static inline void dnskw_init(void) {};
 #endif
 
-#ifdef CONFIG_MACH_ICONNECT_DT
-void iconnect_init(void);
-#else
-static inline void iconnect_init(void) {};
-#endif
-
-#ifdef CONFIG_MACH_IB62X0_DT
-void ib62x0_init(void);
-#else
-static inline void ib62x0_init(void) {};
-#endif
-
-#ifdef CONFIG_MACH_DOCKSTAR_DT
-void dockstar_dt_init(void);
-#else
-static inline void dockstar_dt_init(void) {};
-#endif
-
-#ifdef CONFIG_MACH_GOFLEXNET_DT
-void goflexnet_init(void);
-#else
-static inline void goflexnet_init(void) {};
-#endif
-
-#ifdef CONFIG_MACH_LSXL_DT
-void lsxl_init(void);
-#else
-static inline void lsxl_init(void) {};
-#endif
-
 #ifdef CONFIG_MACH_IOMEGA_IX2_200_DT
 void iomega_ix2_200_init(void);
 #else
@@ -114,34 +79,6 @@ void km_kirkwood_init(void);
 static inline void km_kirkwood_init(void) {};
 #endif
 
-#ifdef CONFIG_MACH_MPLCEC4_DT
-void mplcec4_init(void);
-#else
-static inline void mplcec4_init(void) {};
-#endif
-
-#if defined(CONFIG_MACH_INETSPACE_V2_DT) || \
-	defined(CONFIG_MACH_NETSPACE_V2_DT) || \
-	defined(CONFIG_MACH_NETSPACE_MAX_V2_DT) || \
-	defined(CONFIG_MACH_NETSPACE_LITE_V2_DT) || \
-	defined(CONFIG_MACH_NETSPACE_MINI_V2_DT)
-void ns2_init(void);
-#else
-static inline void ns2_init(void) {};
-#endif
-
-#ifdef CONFIG_MACH_OPENBLOCKS_A6_DT
-void openblocks_a6_init(void);
-#else
-static inline void openblocks_a6_init(void) {};
-#endif
-
-#ifdef CONFIG_MACH_TOPKICK_DT
-void usi_topkick_init(void);
-#else
-static inline void usi_topkick_init(void) {};
-#endif
-
 /* early init functions not converted to fdt yet */
 char *kirkwood_id(void);
 void kirkwood_l2_init(void);
-- 
1.8.1.1

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

* [PATCH V3 8/8] ARM: kirkwood: mv643xx_eth dt conversion
  2013-01-25 20:54   ` [PATCH V3 8/8] ARM: kirkwood: mv643xx_eth dt conversion Jason Cooper
@ 2013-01-26 12:38     ` Andrew Lunn
  2013-01-26 12:50       ` Sebastian Hesselbarth
  2013-01-26 15:06       ` Jason Cooper
  2013-01-26 15:33     ` Andrew Lunn
  1 sibling, 2 replies; 102+ messages in thread
From: Andrew Lunn @ 2013-01-26 12:38 UTC (permalink / raw)
  To: linux-arm-kernel

> diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c
> index 73b76e4..7ab92e5 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, "mv643xx_eth_port.0",
> +	orion_clkdev_add(NULL, "f1072000.egiga0",
>  			 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, "mv643xx_eth_port.1",
> +	orion_clkdev_add(NULL, "f1076000.egiga1",
>  			 of_clk_get_from_provider(&clkspec));
>  }
>  

Hi Jason

These changes break any platform not yet converted, eg my QNAP box now
locks up solid.

Something is not right here, or i'm not understanding something. DT
devices should not need code like this, only devices not yet using
DT....

	Andrew

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

* [PATCH V3 8/8] ARM: kirkwood: mv643xx_eth dt conversion
  2013-01-26 12:38     ` Andrew Lunn
@ 2013-01-26 12:50       ` Sebastian Hesselbarth
  2013-01-26 13:40         ` Andrew Lunn
  2013-01-26 15:06       ` Jason Cooper
  1 sibling, 1 reply; 102+ messages in thread
From: Sebastian Hesselbarth @ 2013-01-26 12:50 UTC (permalink / raw)
  To: linux-arm-kernel

On 01/26/2013 01:38 PM, Andrew Lunn wrote:
>> diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c
>> index 73b76e4..7ab92e5 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, "mv643xx_eth_port.0",
>> +	orion_clkdev_add(NULL, "f1072000.egiga0",
>>   			 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, "mv643xx_eth_port.1",
>> +	orion_clkdev_add(NULL, "f1076000.egiga1",
>>   			 of_clk_get_from_provider(&clkspec));
>>   }
>>
> These changes break any platform not yet converted, eg my QNAP box now
> locks up solid.
>
> Something is not right here, or i'm not understanding something. DT
> devices should not need code like this, only devices not yet using
> DT....

Jason, Andrew,

have a look at dove_legacy_clk_init() in arch/arm/mach-dove/common.c.
This is how I handled non-DT clock aliases from DT provided clocks.
Maybe you can also use it for kirkwood.

Sebastian

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

* [PATCH V3 8/8] ARM: kirkwood: mv643xx_eth dt conversion
  2013-01-26 12:50       ` Sebastian Hesselbarth
@ 2013-01-26 13:40         ` Andrew Lunn
  2013-01-26 13:46           ` Sebastian Hesselbarth
                             ` (2 more replies)
  0 siblings, 3 replies; 102+ messages in thread
From: Andrew Lunn @ 2013-01-26 13:40 UTC (permalink / raw)
  To: linux-arm-kernel

On Sat, Jan 26, 2013 at 01:50:11PM +0100, Sebastian Hesselbarth wrote:
> On 01/26/2013 01:38 PM, Andrew Lunn wrote:
> >>diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c
> >>index 73b76e4..7ab92e5 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, "mv643xx_eth_port.0",
> >>+	orion_clkdev_add(NULL, "f1072000.egiga0",
> >>  			 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, "mv643xx_eth_port.1",
> >>+	orion_clkdev_add(NULL, "f1076000.egiga1",
> >>  			 of_clk_get_from_provider(&clkspec));
> >>  }
> >>
> >These changes break any platform not yet converted, eg my QNAP box now
> >locks up solid.
> >
> >Something is not right here, or i'm not understanding something. DT
> >devices should not need code like this, only devices not yet using
> >DT....
> 
> Jason, Andrew,
> 
> have a look at dove_legacy_clk_init() in arch/arm/mach-dove/common.c.
> This is how I handled non-DT clock aliases from DT provided clocks.
> Maybe you can also use it for kirkwood.

Hi Sebastian

The code here is based on dove_legacy_clk_init(). However the change
made by Jason is in order to make a DT device work, not an non-DT
device.

The problem is the way the driver is getting the clock.

	mp->clk = clk_get(&pdev->dev, (pdev->id ? "1" : "0"));

clk_get() then calls

                clk = of_clk_get_by_name(dev->of_node, con_id);

 * of_clk_get_by_name() - Parse and lookup a clock referenced by a device node
 * @np: pointer to clock consumer node
 * @name: name of consumer's clock input, or NULL for the first clock reference

So it is looking for a clock called "0" or "1" in the node. This does
not exist, and so it falls. Jason's change then comes into affect and
it finds the clkdev entries added above.

I will change the driver to use of_clk_get() when passed an np.

  Andrew

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

* [PATCH V3 8/8] ARM: kirkwood: mv643xx_eth dt conversion
  2013-01-26 13:40         ` Andrew Lunn
@ 2013-01-26 13:46           ` Sebastian Hesselbarth
  2013-01-26 15:42           ` Jason Cooper
  2013-01-27 12:21           ` Russell King - ARM Linux
  2 siblings, 0 replies; 102+ messages in thread
From: Sebastian Hesselbarth @ 2013-01-26 13:46 UTC (permalink / raw)
  To: linux-arm-kernel

On 01/26/2013 02:40 PM, Andrew Lunn wrote:
> On Sat, Jan 26, 2013 at 01:50:11PM +0100, Sebastian Hesselbarth wrote:
>> have a look at dove_legacy_clk_init() in arch/arm/mach-dove/common.c.
>> This is how I handled non-DT clock aliases from DT provided clocks.
>> Maybe you can also use it for kirkwood.
>
> The code here is based on dove_legacy_clk_init(). However the change
> made by Jason is in order to make a DT device work, not an non-DT
> device.

Yeah, I know. The second after I sent that email, I knew it was just
totally wrong. Sorry for that.

> The problem is the way the driver is getting the clock.
>
> 	mp->clk = clk_get(&pdev->dev, (pdev->id ? "1" : "0"));
>
> clk_get() then calls
>
>                  clk = of_clk_get_by_name(dev->of_node, con_id);
>
>   * of_clk_get_by_name() - Parse and lookup a clock referenced by a device node
>   * @np: pointer to clock consumer node
>   * @name: name of consumer's clock input, or NULL for the first clock reference
>
> So it is looking for a clock called "0" or "1" in the node. This does
> not exist, and so it falls. Jason's change then comes into affect and
> it finds the clkdev entries added above.
>
> I will change the driver to use of_clk_get() when passed an np.

This is way better.

Sebastian

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

* [PATCH V3 8/8] ARM: kirkwood: mv643xx_eth dt conversion
  2013-01-26 12:38     ` Andrew Lunn
  2013-01-26 12:50       ` Sebastian Hesselbarth
@ 2013-01-26 15:06       ` Jason Cooper
  2013-01-26 15:12         ` Andrew Lunn
  1 sibling, 1 reply; 102+ messages in thread
From: Jason Cooper @ 2013-01-26 15:06 UTC (permalink / raw)
  To: linux-arm-kernel

On Sat, Jan 26, 2013 at 01:38:27PM +0100, Andrew Lunn wrote:
> > diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c
> > index 73b76e4..7ab92e5 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, "mv643xx_eth_port.0",
> > +	orion_clkdev_add(NULL, "f1072000.egiga0",
> >  			 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, "mv643xx_eth_port.1",
> > +	orion_clkdev_add(NULL, "f1076000.egiga1",
> >  			 of_clk_get_from_provider(&clkspec));
> >  }
> >  
> 
> Hi Jason
> 
> These changes break any platform not yet converted, eg my QNAP box now
> locks up solid.
> 
> Something is not right here, or i'm not understanding something. DT
> devices should not need code like this, only devices not yet using
> DT....

Yes, hence my frustration yesterday.  I posted this so everyone could
see exactly what I was working with, and perhaps spot something I had
missed.  Looks like you did in your followup to Sebastian.

thx,

Jason.

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

* [PATCH V3 8/8] ARM: kirkwood: mv643xx_eth dt conversion
  2013-01-26 15:06       ` Jason Cooper
@ 2013-01-26 15:12         ` Andrew Lunn
  0 siblings, 0 replies; 102+ messages in thread
From: Andrew Lunn @ 2013-01-26 15:12 UTC (permalink / raw)
  To: linux-arm-kernel

> > Something is not right here, or i'm not understanding something. DT
> > devices should not need code like this, only devices not yet using
> > DT....
> 
> Yes, hence my frustration yesterday.  I posted this so everyone could
> see exactly what I was working with, and perhaps spot something I had
> missed.  Looks like you did in your followup to Sebastian.

Hi Jason

I have it fixed now. I just sent some patches, which you can insert or
squash as appropriate.

       Andrew

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

* [PATCH V3 8/8] ARM: kirkwood: mv643xx_eth dt conversion
  2013-01-25 20:54   ` [PATCH V3 8/8] ARM: kirkwood: mv643xx_eth dt conversion Jason Cooper
  2013-01-26 12:38     ` Andrew Lunn
@ 2013-01-26 15:33     ` Andrew Lunn
  2013-01-26 15:44       ` Jason Cooper
  1 sibling, 1 reply; 102+ messages in thread
From: Andrew Lunn @ 2013-01-26 15:33 UTC (permalink / raw)
  To: linux-arm-kernel

> -config MACH_LSXL_DT
> -	bool "Buffalo Linkstation LS-XHL, LS-CHLv2 (Flattened Device Tree)"
> -	select ARCH_KIRKWOOD_DT
> -	select POWER_RESET_RESTART
> -	help
> -	  Say 'Y' here if you want your kernel to support the
> -	  Buffalo Linkstation LS-XHL & LS-CHLv2 devices, using
> -	  Flattened Device Tree.

Hi Jason

I don't think you add POWER_RESET_RESTART back anywhere. It should
probably be added to ARCH_KIRKWOOD_DT. Otherwise it will not be
possible to shutdown these boxes.

	 Thanks
		Andrew

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

* [PATCH V3 8/8] ARM: kirkwood: mv643xx_eth dt conversion
  2013-01-26 13:40         ` Andrew Lunn
  2013-01-26 13:46           ` Sebastian Hesselbarth
@ 2013-01-26 15:42           ` Jason Cooper
  2013-01-27 12:21           ` Russell King - ARM Linux
  2 siblings, 0 replies; 102+ messages in thread
From: Jason Cooper @ 2013-01-26 15:42 UTC (permalink / raw)
  To: linux-arm-kernel

On Sat, Jan 26, 2013 at 02:40:12PM +0100, Andrew Lunn wrote:
> On Sat, Jan 26, 2013 at 01:50:11PM +0100, Sebastian Hesselbarth wrote:
> > On 01/26/2013 01:38 PM, Andrew Lunn wrote:
> > >>diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c
> > >>index 73b76e4..7ab92e5 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, "mv643xx_eth_port.0",
> > >>+	orion_clkdev_add(NULL, "f1072000.egiga0",
> > >>  			 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, "mv643xx_eth_port.1",
> > >>+	orion_clkdev_add(NULL, "f1076000.egiga1",
> > >>  			 of_clk_get_from_provider(&clkspec));
> > >>  }
> > >>
> > >These changes break any platform not yet converted, eg my QNAP box now
> > >locks up solid.
> > >
> > >Something is not right here, or i'm not understanding something. DT
> > >devices should not need code like this, only devices not yet using
> > >DT....
> > 
> > Jason, Andrew,
> > 
> > have a look at dove_legacy_clk_init() in arch/arm/mach-dove/common.c.
> > This is how I handled non-DT clock aliases from DT provided clocks.
> > Maybe you can also use it for kirkwood.
> 
> Hi Sebastian
> 
> The code here is based on dove_legacy_clk_init(). However the change
> made by Jason is in order to make a DT device work, not an non-DT
> device.
> 
> The problem is the way the driver is getting the clock.
> 
> 	mp->clk = clk_get(&pdev->dev, (pdev->id ? "1" : "0"));
> 
> clk_get() then calls
> 
>                 clk = of_clk_get_by_name(dev->of_node, con_id);
> 
>  * of_clk_get_by_name() - Parse and lookup a clock referenced by a device node
>  * @np: pointer to clock consumer node
>  * @name: name of consumer's clock input, or NULL for the first clock reference
> 
> So it is looking for a clock called "0" or "1" in the node. This does
> not exist, and so it falls. Jason's change then comes into affect and
> it finds the clkdev entries added above.

Exactly.

> I will change the driver to use of_clk_get() when passed an np.

something like this? (on top of this series):

btw - I just booted this and it is working...

$ cat ge0/clk_prepare_count
1
$ cat ge1/clk_prepare_count
1
$ 

--8<-------
diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c
index 7ab92e5..620c99f 100644
--- a/arch/arm/mach-kirkwood/board-dt.c
+++ b/arch/arm/mach-kirkwood/board-dt.c
@@ -47,10 +47,6 @@ static void __init kirkwood_legacy_clk_init(void)
 	clkspec.np = np;
 	clkspec.args_count = 1;
 
-	clkspec.args[0] = CGC_BIT_GE0;
-	orion_clkdev_add(NULL, "f1072000.egiga0",
-			 of_clk_get_from_provider(&clkspec));
-
 	clkspec.args[0] = CGC_BIT_PEX0;
 	orion_clkdev_add("0", "pcie",
 			 of_clk_get_from_provider(&clkspec));
@@ -58,10 +54,6 @@ static void __init kirkwood_legacy_clk_init(void)
 	clkspec.args[0] = CGC_BIT_PEX1;
 	orion_clkdev_add("1", "pcie",
 			 of_clk_get_from_provider(&clkspec));
-
-	clkspec.args[0] = CGC_BIT_GE1;
-	orion_clkdev_add(NULL, "f1076000.egiga1",
-			 of_clk_get_from_provider(&clkspec));
 }
 
 static void __init kirkwood_of_clk_init(void)
diff --git a/drivers/net/ethernet/marvell/mv643xx_eth.c b/drivers/net/ethernet/marvell/mv643xx_eth.c
index 7048d7c..8fb92d4 100644
--- a/drivers/net/ethernet/marvell/mv643xx_eth.c
+++ b/drivers/net/ethernet/marvell/mv643xx_eth.c
@@ -2895,6 +2895,7 @@ static int mv643xx_eth_probe(struct platform_device *pdev)
 
 	if (pdev->dev.of_node) {
 		struct device_node *np = NULL;
+		struct clk *clk = NULL;
 
 		/* when all users of this driver use FDT, we can remove this */
 		pd = kzalloc(sizeof(*pd), GFP_KERNEL);
@@ -2912,6 +2913,12 @@ static int mv643xx_eth_probe(struct platform_device *pdev)
 		else
 			pd->phy_addr = MV643XX_ETH_PHY_ADDR_DEFAULT;
 
+		clk = of_clk_get(pdev->dev.of_node, 0);
+		if (!IS_ERR(clk)) {
+			clk_prepare_enable(clk);
+			clk_put(clk);
+		}
+
 		np = of_parse_phandle(pdev->dev.of_node, "mdio", 0);
 		if (np) {
 			pd->shared = of_find_device_by_node(np);

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

* [PATCH V3 8/8] ARM: kirkwood: mv643xx_eth dt conversion
  2013-01-26 15:33     ` Andrew Lunn
@ 2013-01-26 15:44       ` Jason Cooper
  0 siblings, 0 replies; 102+ messages in thread
From: Jason Cooper @ 2013-01-26 15:44 UTC (permalink / raw)
  To: linux-arm-kernel

On Sat, Jan 26, 2013 at 04:33:57PM +0100, Andrew Lunn wrote:
> > -config MACH_LSXL_DT
> > -	bool "Buffalo Linkstation LS-XHL, LS-CHLv2 (Flattened Device Tree)"
> > -	select ARCH_KIRKWOOD_DT
> > -	select POWER_RESET_RESTART
> > -	help
> > -	  Say 'Y' here if you want your kernel to support the
> > -	  Buffalo Linkstation LS-XHL & LS-CHLv2 devices, using
> > -	  Flattened Device Tree.
> 
> Hi Jason
> 
> I don't think you add POWER_RESET_RESTART back anywhere. It should
> probably be added to ARCH_KIRKWOOD_DT. Otherwise it will not be
> possible to shutdown these boxes.

Good catch, I'll add that in.

thx,

Jason.

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

* [PATCH V3 1/8] ARM: kirkwood: topkick: init mvsdio via DT
  2013-01-25 20:53   ` [PATCH V3 1/8] ARM: kirkwood: topkick: init mvsdio via DT Jason Cooper
@ 2013-01-26 16:21     ` Andrew Lunn
  0 siblings, 0 replies; 102+ messages in thread
From: Andrew Lunn @ 2013-01-26 16:21 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Jan 25, 2013 at 08:53:53PM +0000, Jason Cooper wrote:
> Signed-off-by: Jason Cooper <jason@lakedaemon.net>
> ---
>  arch/arm/boot/dts/kirkwood-topkick.dts     | 7 +++++++
>  arch/arm/mach-kirkwood/board-usi_topkick.c | 6 ------
>  2 files changed, 7 insertions(+), 6 deletions(-)
> 
> diff --git a/arch/arm/boot/dts/kirkwood-topkick.dts b/arch/arm/boot/dts/kirkwood-topkick.dts
> index cd15452..23c2ddc 100644
> --- a/arch/arm/boot/dts/kirkwood-topkick.dts
> +++ b/arch/arm/boot/dts/kirkwood-topkick.dts
> @@ -54,6 +54,13 @@
>  			status = "okay";
>  			nr-ports = <1>;
>  		};
> +
> +		mvsdio at 90000 {
> +			pinctrl-0 = <&pmx_sdio>;
> +			pinctrl-names = "default";
> +			status = "okay";
> +			/* No CD or WP GPIOs */
> +		};
>  	};
>  
>  	gpio-leds {
> diff --git a/arch/arm/mach-kirkwood/board-usi_topkick.c b/arch/arm/mach-kirkwood/board-usi_topkick.c
> index 23d2dd1..95f0711 100644
> --- a/arch/arm/mach-kirkwood/board-usi_topkick.c
> +++ b/arch/arm/mach-kirkwood/board-usi_topkick.c
> @@ -14,7 +14,6 @@
>  #include <linux/init.h>
>  #include <linux/mv643xx_eth.h>
>  #include <linux/gpio.h>
> -#include <linux/platform_data/mmc-mvsdio.h>
>  #include "common.h"
>  #include "mpp.h"
>  
> @@ -22,10 +21,6 @@ static struct mv643xx_eth_platform_data topkick_ge00_data = {
>  	.phy_addr	= MV643XX_ETH_PHY_ADDR(0),
>  };
>  
> -static struct mvsdio_platform_data topkick_mvsdio_data = {
> -	/* unfortunately the CD signal has not been connected */
> -};
> -
>  /*
>   * GPIO LED layout
>   *
> @@ -73,5 +68,4 @@ void __init usi_topkick_init(void)
>  
>  
>  	kirkwood_ge00_init(&topkick_ge00_data);
> -	kirkwood_sdio_init(&topkick_mvsdio_data);
>  }
> -- 
> 1.8.1.1
> 

Tested-by: Andrew Lunn <andrew@lunn.ch>

   Andrew

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

* [PATCH 1/2] ARM: Kirkwood: topkick: Fix SoC type and add missing pins
  2013-01-25 20:53   ` [PATCH V3 2/8] ARM: kirkwood: topkick: convert to pinctrl Jason Cooper
@ 2013-01-26 16:55     ` Andrew Lunn
  2013-01-26 16:55       ` [PATCH 2/2] ARM: Kirkwood: topkick: Enable i2c bus Andrew Lunn
  2013-01-26 20:39       ` [PATCH 1/2] ARM: Kirkwood: topkick: Fix SoC type and add missing pins Jason Cooper
  0 siblings, 2 replies; 102+ messages in thread
From: Andrew Lunn @ 2013-01-26 16:55 UTC (permalink / raw)
  To: linux-arm-kernel

Topkick contains a Marvell 6282, not an 6281 as included in the
kirkwood-topkick.dts file.

Also, add pinhogs for the serial port and nand devices.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
---
 arch/arm/boot/dts/kirkwood-topkick.dts |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/arch/arm/boot/dts/kirkwood-topkick.dts b/arch/arm/boot/dts/kirkwood-topkick.dts
index edefbb5..c8e8a64 100644
--- a/arch/arm/boot/dts/kirkwood-topkick.dts
+++ b/arch/arm/boot/dts/kirkwood-topkick.dts
@@ -1,7 +1,7 @@
 /dts-v1/;
 
 /include/ "kirkwood.dtsi"
-/include/ "kirkwood-6281.dtsi"
+/include/ "kirkwood-6282.dtsi"
 
 / {
 	model = "Univeral Scientific Industrial Co. Topkick-1281P2";
@@ -50,7 +50,9 @@
 				      &pmx_sw_right
 				      &pmx_sw_idle
 				      &pmx_sw_left2
-				      &pmx_led_wifi_yellow >;
+				      &pmx_led_wifi_yellow
+				      &pmx_uart0
+				      &pmx_nand >;
 			pinctrl-names = "default";
 
 			pmx_led_disk_yellow: pmx-led-disk-yellow {
-- 
1.7.10.4

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

* [PATCH 2/2] ARM: Kirkwood: topkick: Enable i2c bus.
  2013-01-26 16:55     ` [PATCH 1/2] ARM: Kirkwood: topkick: Fix SoC type and add missing pins Andrew Lunn
@ 2013-01-26 16:55       ` Andrew Lunn
  2013-01-26 17:38         ` Sebastian Hesselbarth
  2013-01-26 20:40         ` Jason Cooper
  2013-01-26 20:39       ` [PATCH 1/2] ARM: Kirkwood: topkick: Fix SoC type and add missing pins Jason Cooper
  1 sibling, 2 replies; 102+ messages in thread
From: Andrew Lunn @ 2013-01-26 16:55 UTC (permalink / raw)
  To: linux-arm-kernel

Add a DT node for I2C and pinctrl hog for the pins. There appears to
be an i2c bus on topkick with a device on it:

i2cdetect 0
WARNING! This program can confuse your I2C bus, cause data loss and worse!
I will probe file /dev/i2c-0.
I will probe address range 0x03-0x77.
Continue? [Y/n] y
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- 64 -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
---
 arch/arm/boot/dts/kirkwood-topkick.dts |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/kirkwood-topkick.dts b/arch/arm/boot/dts/kirkwood-topkick.dts
index c8e8a64..75fc1dd 100644
--- a/arch/arm/boot/dts/kirkwood-topkick.dts
+++ b/arch/arm/boot/dts/kirkwood-topkick.dts
@@ -52,7 +52,8 @@
 				      &pmx_sw_left2
 				      &pmx_led_wifi_yellow
 				      &pmx_uart0
-				      &pmx_nand >;
+				      &pmx_nand
+				      &pmx_twsi0 >;
 			pinctrl-names = "default";
 
 			pmx_led_disk_yellow: pmx-led-disk-yellow {
@@ -159,6 +160,9 @@
 		egiga0 {
 			status = "ok";
 		};
+		i2c at 11000 {
+			status = "ok";
+		};
 	};
 
 	gpio-leds {
-- 
1.7.10.4

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

* [PATCH 2/2] ARM: Kirkwood: topkick: Enable i2c bus.
  2013-01-26 16:55       ` [PATCH 2/2] ARM: Kirkwood: topkick: Enable i2c bus Andrew Lunn
@ 2013-01-26 17:38         ` Sebastian Hesselbarth
  2013-01-26 18:24           ` Andrew Lunn
  2013-01-26 20:40         ` Jason Cooper
  1 sibling, 1 reply; 102+ messages in thread
From: Sebastian Hesselbarth @ 2013-01-26 17:38 UTC (permalink / raw)
  To: linux-arm-kernel

On 01/26/2013 05:55 PM, Andrew Lunn wrote:
> Add a DT node for I2C and pinctrl hog for the pins. There appears to
> be an i2c bus on topkick with a device on it:
>
> 60: -- -- -- -- 64 -- -- -- -- -- -- -- -- -- -- --

Andrew,

this could be a Nuvoton NCT3012S ACPI PMIC. It is located right next to
Wifi/BT. There is i2c address should be 6c but officially it
only supports 100kHz bus frequency. Can you post i2cdetect and
i2cdump with 100kHz?

Sebastian

[1] http://www.catagle.com/29-11/NCT3012S.htm

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

* [PATCH 2/2] ARM: Kirkwood: topkick: Enable i2c bus.
  2013-01-26 17:38         ` Sebastian Hesselbarth
@ 2013-01-26 18:24           ` Andrew Lunn
  2013-01-26 18:51             ` Sebastian Hesselbarth
  0 siblings, 1 reply; 102+ messages in thread
From: Andrew Lunn @ 2013-01-26 18:24 UTC (permalink / raw)
  To: linux-arm-kernel

On Sat, Jan 26, 2013 at 06:38:59PM +0100, Sebastian Hesselbarth wrote:
> On 01/26/2013 05:55 PM, Andrew Lunn wrote:
> >Add a DT node for I2C and pinctrl hog for the pins. There appears to
> >be an i2c bus on topkick with a device on it:
> >
> >60: -- -- -- -- 64 -- -- -- -- -- -- -- -- -- -- --
> 
> Andrew,
> 
> this could be a Nuvoton NCT3012S ACPI PMIC. It is located right next to
> Wifi/BT. There is i2c address should be 6c but officially it
> only supports 100kHz bus frequency. Can you post i2cdetect and
> i2cdump with 100kHz?

Hi Sebastian

100KHz is the default in the kirkwood.dtsi file.

Just to be paranoid, i dropped it to 10KHz. No difference, still at
address 0x64.

Probing just 0x6c does not help:

# i2cdetect 0 0x6c 0x6c
WARNING! This program can confuse your I2C bus, cause data loss and worse!
I will probe file /dev/i2c-0.
I will probe address range 0x6c-0x6c.
Continue? [Y/n] y
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:                                                 
10:                                                 
20:                                                 
30:                                                 
40:                                                 
50:                                                 
60:                                     --          
70:                                             

However, there are some issues at other addresses, both at 100KHz and
10KHz:

# i2cdetect 0
WARNING! This program can confuse your I2C bus, cause data loss and worse!
I will probe file /dev/i2c-0.
I will probe address range 0x03-0x77.
Continue? [Y/n] y
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- --i2c i2c-0: mv64xxx_i2c_fsm: Ctlr Error -- state: 0x71
 -- -- -- -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- i2c i2c-0: mv64xxx_i2c_fsm: Ctlr Error -- state: 0x2, 1
-- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: -- -- -- -- 64 -- -- -- -- -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- --                         

Full message is:

[  215.514562] i2c i2c-0: mv64xxx_i2c_fsm: Ctlr Error -- state: 0x7, status: 0x38, addr: 0x36, flags: 0x1
[  215.545791] i2c i2c-0: mv64xxx_i2c_fsm: Ctlr Error -- state: 0x2, status: 0x0, addr: 0x37, flags: 0x1

So maybe there is something at 0x36 and 0x37 as well?

# i2cdump 0 0x36
No size specified (using byte-data access)
WARNING! This program can confuse your I2C bus, cause data loss and worse!
I will probe file /dev/i2c-0, address 0x36, mode byte
Continue? [Y/n] y
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f    0123456789abcdef
00: 3d 00 00 87 47 0c 00 08 00 13 00 00 10 00 00 00    =..?G?.?.?..?...
10: ff ff 00 6c 09 02 ff ff ff ff ff ff ff ff ff ff    ...l??..........
20: 88 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ?...............
30: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................
40: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................
50: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................
60: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................
70: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................
80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................
90: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................
a0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................
b0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................
c0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................
d0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................
e0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................
f0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................

# i2cdump 0 0x37
No size specified (using byte-data access)
WARNING! This program can confuse your I2C bus, cause data loss and worse!
I will probe file /dev/i2c-0, address 0x37, mode byte
Continue? [Y/n] y
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f    0123456789abcdef
00: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX    XXXXXXXXXXXXXXXX
10: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX    XXXXXXXXXXXXXXXX
20: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX    XXXXXXXXXXXXXXXX
30: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX    XXXXXXXXXXXXXXXX
40: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX    XXXXXXXXXXXXXXXX
50: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX    XXXXXXXXXXXXXXXX
60: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX    XXXXXXXXXXXXXXXX
70: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX    XXXXXXXXXXXXXXXX
80: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX    XXXXXXXXXXXXXXXX
90: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX    XXXXXXXXXXXXXXXX
a0: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX    XXXXXXXXXXXXXXXX
b0: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX    XXXXXXXXXXXXXXXX
c0: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX    XXXXXXXXXXXXXXXX
d0: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX    XXXXXXXXXXXXXXXX
e0: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX    XXXXXXXXXXXXXXXX
f0: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX    XXXXXXXXXXXXXXXX

Nothing interesting at 0x64:

# i2cdump 0 0x64
No size specified (using byte-data access)
WARNING! This program can confuse your I2C bus, cause data loss and worse!
I will probe file /dev/i2c-0, address 0x64, mode byte
Continue? [Y/n] y
     0  1  2  3 i2c i2c-0: mv64xxx_i2c_fsm: Ctlr Error -- state: 0x2, status: 0x0, addr: 0x64, flags: 0x0
 4  5  6  7  8  9  a  b  c  d  e  f    0123456789abcdef
00: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX    XXXXXXXXXXXXXXXX
10: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX    XXXXXXXXXXXXXXXX
20: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX    XXXXXXXXXXXXXXXX
30: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX    XXXXXXXXXXXXXXXX
40: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX    XXXXXXXXXXXXXXXX
50: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX    XXXXXXXXXXXXXXXX
60: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX    XXXXXXXXXXXXXXXX
70: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX    XXXXXXXXXXXXXXXX
80: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX    XXXXXXXXXXXXXXXX
90: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX    XXXXXXXXXXXXXXXX
a0: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX    XXXXXXXXXXXXXXXX
b0: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX    XXXXXXXXXXXXXXXX
c0: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX    XXXXXXXXXXXXXXXX
d0: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX    XXXXXXXXXXXXXXXX
e0: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX    XXXXXXXXXXXXXXXX
f0: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX    XXXXXXXXXXXXXXXX


Humm. A thought. 6282 has two i2c busses. I had noticed that uboot had
configured the pin multiplexer such that they could be used for
i2c. But maybe the NCT3012S is on the other i2c bus? Need to go look
and see, but that will probably happen tomorrow....

     Andrew

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

* [PATCH 2/2] ARM: Kirkwood: topkick: Enable i2c bus.
  2013-01-26 18:24           ` Andrew Lunn
@ 2013-01-26 18:51             ` Sebastian Hesselbarth
  0 siblings, 0 replies; 102+ messages in thread
From: Sebastian Hesselbarth @ 2013-01-26 18:51 UTC (permalink / raw)
  To: linux-arm-kernel

On 01/26/2013 07:24 PM, Andrew Lunn wrote:
> # i2cdump 0 0x36
> No size specified (using byte-data access)
> WARNING! This program can confuse your I2C bus, cause data loss and worse!
> I will probe file /dev/i2c-0, address 0x36, mode byte
> Continue? [Y/n] y
>       0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f    0123456789abcdef
> 00: 3d 00 00 87 47 0c 00 08 00 13 00 00 10 00 00 00    =..?G?.?.?..?...
> 10: ff ff 00 6c 09 02 ff ff ff ff ff ff ff ff ff ff    ...l??..........
> 20: 88 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ?...............
 >
 > ...
>
> Humm. A thought. 6282 has two i2c busses. I had noticed that uboot had
> configured the pin multiplexer such that they could be used for
> i2c. But maybe the NCT3012S is on the other i2c bus? Need to go look
> and see, but that will probably happen tomorrow....

0x36 (=0x6c >> 1) is the nuvoton pmic. Register values match what is
written in that very short datasheet.

Sebastian

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

* [RFC V2 PATCH 3/8] ARM: kirkwood: nsa310: cleanup includes and unneeded code
  2013-01-25  5:32   ` [RFC V2 PATCH 3/8] ARM: kirkwood: nsa310: cleanup includes and unneeded code Jason Cooper
@ 2013-01-26 20:08     ` Sergei Shtylyov
  2013-01-26 20:22       ` Jason Cooper
  0 siblings, 1 reply; 102+ messages in thread
From: Sergei Shtylyov @ 2013-01-26 20:08 UTC (permalink / raw)
  To: linux-arm-kernel

Hello.

On 25-01-2013 9:32, Jason Cooper wrote:

> Signed-off-by: Jason Cooper <jason@lakedaemon.net>
> ---
>   arch/arm/mach-kirkwood/board-nsa310.c | 9 +--------
>   1 file changed, 1 insertion(+), 8 deletions(-)

> diff --git a/arch/arm/mach-kirkwood/board-nsa310.c b/arch/arm/mach-kirkwood/board-nsa310.c
> index 1bd328d..0b99533 100644
> --- a/arch/arm/mach-kirkwood/board-nsa310.c
> +++ b/arch/arm/mach-kirkwood/board-nsa310.c
> @@ -10,11 +10,8 @@
>
>   #include <linux/kernel.h>
>   #include <linux/init.h>
> -#include <linux/i2c.h>
> -
> -#include <asm/mach-types.h>
> -#include <asm/mach/arch.h>
>   #include <mach/kirkwood.h>
> +#include <linux/of.h>

    You also add an #include and don't mention it anywhere. Or is that part of 
the cleanup?

WBR, Sergei

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

* [RFC V2 PATCH 3/8] ARM: kirkwood: nsa310: cleanup includes and unneeded code
  2013-01-26 20:08     ` Sergei Shtylyov
@ 2013-01-26 20:22       ` Jason Cooper
  2013-01-27 15:04         ` Sergei Shtylyov
  0 siblings, 1 reply; 102+ messages in thread
From: Jason Cooper @ 2013-01-26 20:22 UTC (permalink / raw)
  To: linux-arm-kernel

On Sun, Jan 27, 2013 at 12:08:44AM +0400, Sergei Shtylyov wrote:
> Hello.
> 
> On 25-01-2013 9:32, Jason Cooper wrote:
> 
> >Signed-off-by: Jason Cooper <jason@lakedaemon.net>
> >---
> >  arch/arm/mach-kirkwood/board-nsa310.c | 9 +--------
> >  1 file changed, 1 insertion(+), 8 deletions(-)
> 
> >diff --git a/arch/arm/mach-kirkwood/board-nsa310.c b/arch/arm/mach-kirkwood/board-nsa310.c
> >index 1bd328d..0b99533 100644
> >--- a/arch/arm/mach-kirkwood/board-nsa310.c
> >+++ b/arch/arm/mach-kirkwood/board-nsa310.c
> >@@ -10,11 +10,8 @@
> >
> >  #include <linux/kernel.h>
> >  #include <linux/init.h>
> >-#include <linux/i2c.h>
> >-
> >-#include <asm/mach-types.h>
> >-#include <asm/mach/arch.h>
> >  #include <mach/kirkwood.h>
> >+#include <linux/of.h>
> 
>    You also add an #include and don't mention it anywhere. Or is
> that part of the cleanup?

After removing the unneeded linux/i2c.h, linux/of.h was needed for
of_machine_is_compatible().  i2c.h had included of.h.

thanks for the review,

Jason.

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

* [PATCH 1/2] ARM: Kirkwood: topkick: Fix SoC type and add missing pins
  2013-01-26 16:55     ` [PATCH 1/2] ARM: Kirkwood: topkick: Fix SoC type and add missing pins Andrew Lunn
  2013-01-26 16:55       ` [PATCH 2/2] ARM: Kirkwood: topkick: Enable i2c bus Andrew Lunn
@ 2013-01-26 20:39       ` Jason Cooper
  1 sibling, 0 replies; 102+ messages in thread
From: Jason Cooper @ 2013-01-26 20:39 UTC (permalink / raw)
  To: linux-arm-kernel

On Sat, Jan 26, 2013 at 05:55:24PM +0100, Andrew Lunn wrote:
> Topkick contains a Marvell 6282, not an 6281 as included in the
> kirkwood-topkick.dts file.
> 
> Also, add pinhogs for the serial port and nand devices.
> 
> Signed-off-by: Andrew Lunn <andrew@lunn.ch>
> ---
>  arch/arm/boot/dts/kirkwood-topkick.dts |    6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)

Squashed into pinctrl conversion, thanks and good catch.

thx,

Jason.

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

* [PATCH 2/2] ARM: Kirkwood: topkick: Enable i2c bus.
  2013-01-26 16:55       ` [PATCH 2/2] ARM: Kirkwood: topkick: Enable i2c bus Andrew Lunn
  2013-01-26 17:38         ` Sebastian Hesselbarth
@ 2013-01-26 20:40         ` Jason Cooper
  1 sibling, 0 replies; 102+ messages in thread
From: Jason Cooper @ 2013-01-26 20:40 UTC (permalink / raw)
  To: linux-arm-kernel

On Sat, Jan 26, 2013 at 05:55:25PM +0100, Andrew Lunn wrote:
> Add a DT node for I2C and pinctrl hog for the pins. There appears to
> be an i2c bus on topkick with a device on it:
> 
> i2cdetect 0
> WARNING! This program can confuse your I2C bus, cause data loss and worse!
> I will probe file /dev/i2c-0.
> I will probe address range 0x03-0x77.
> Continue? [Y/n] y
>      0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
> 00:          -- -- -- -- -- -- -- -- -- -- -- -- --
> 10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
> 20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
> 30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
> 40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
> 50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
> 60: -- -- -- -- 64 -- -- -- -- -- -- -- -- -- -- --
> 70: -- -- -- -- -- -- -- --
> 
> Signed-off-by: Andrew Lunn <andrew@lunn.ch>
> ---
>  arch/arm/boot/dts/kirkwood-topkick.dts |    6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)

Pulled into series,

thanks,

Jason.

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

* [PATCH V4 0/8] ARM: kirkwood: cleanup DT conversion
  2013-01-23 23:34 [RFC PATCH 0/6] ARM: kirkwood: cleanup DT conversion Jason Cooper
                   ` (8 preceding siblings ...)
  2013-01-25 20:53 ` [PATCH V3 " Jason Cooper
@ 2013-01-26 20:50 ` Jason Cooper
  2013-01-26 20:50   ` [PATCH V4 01/11] ARM: kirkwood: topkick: init mvsdio via DT Jason Cooper
                     ` (10 more replies)
  9 siblings, 11 replies; 102+ messages in thread
From: Jason Cooper @ 2013-01-26 20:50 UTC (permalink / raw)
  To: linux-arm-kernel

All,

This is a fourth cut at cleaning up mach-kirkwood/.  There are a few DT
conversions (topkick -> mvsdio, pinctrl) which, once reviewed, I'll put in the
normal pull request cycle.

The others which remove board-*.c files, I'll keep updating against
mvebu/for-next, and then apply at the end of the merge window.

Please test as you are able.

Changes since V1:
 - Included Ian Molton's patch to add DT bindings to mv643xx_eth
 - little doc cleanup
 - tested on dreamplug
   - good: boots fine to bash prompt
   - bad: hangs within one minute of booting (even with init=/bin/sh)
     - no output, just frozen hard
     - will debug more tomorrow

Changes since V2:
 - discovered source of hang.  ge0/1 clocks getting gated
   - changed alias for clocks
   - able to pull ip address and ping though the interface

Changes since V3:
 - fixed clock gating in mv643xx_eth driver (thanks Andrew!)
 - corrected topkick pinctrl conversion (thanks Andrew!)
 - added a i2c bus to topkick (thanks Andrew! (notice a pattern?))
 - converted ts219 ethernet to DT (yep, same thanks)

thx,

Jason.

Andrew Lunn (3):
  ARM: Kirkwood: topkick: Enable i2c bus.
  NET: mv643xx: Get clk from device tree.
  ARM: Kirkwood: Convert QNAP TS219 Ethernet to DT.

Ian Molton (1):
  mv643xx.c: Add basic device tree support.

Jason Cooper (7):
  ARM: kirkwood: topkick: init mvsdio via DT
  ARM: kirkwood: topkick: convert to pinctrl
  ARM: kirkwood: nsa310: cleanup includes and unneeded code
  ARM: kirkwood: nsa310: convert to pinctrl
  ARM: kirkwood: consolidate DT init of pcie
  ARM: mvebu: correct gated clock documentation
  ARM: kirkwood: mv643xx_eth dt conversion

 .../bindings/clock/mvebu-gated-clock.txt           |   2 +-
 Documentation/devicetree/bindings/net/mv643xx.txt  |  75 +++++++++++++
 arch/arm/boot/dts/kirkwood-dnskw.dtsi              |   9 ++
 arch/arm/boot/dts/kirkwood-dockstar.dts            |   8 ++
 arch/arm/boot/dts/kirkwood-dreamplug.dts           |  16 +++
 arch/arm/boot/dts/kirkwood-goflexnet.dts           |   7 ++
 arch/arm/boot/dts/kirkwood-ib62x0.dts              |   9 ++
 arch/arm/boot/dts/kirkwood-iconnect.dts            |   9 ++
 arch/arm/boot/dts/kirkwood-km_kirkwood.dts         |   8 ++
 arch/arm/boot/dts/kirkwood-lsxl.dtsi               |  18 ++++
 arch/arm/boot/dts/kirkwood-mplcec4.dts             |  18 ++++
 arch/arm/boot/dts/kirkwood-ns2-common.dtsi         |   9 ++
 arch/arm/boot/dts/kirkwood-ns2lite.dts             |   5 +
 arch/arm/boot/dts/kirkwood-ns2mini.dts             |   5 +
 arch/arm/boot/dts/kirkwood-nsa310.dts              |  99 +++++++++++++++++
 arch/arm/boot/dts/kirkwood-openblocks_a6.dts       |   8 ++
 arch/arm/boot/dts/kirkwood-topkick.dts             | 110 +++++++++++++++++++
 arch/arm/boot/dts/kirkwood-ts219-6281.dts          |   9 ++
 arch/arm/boot/dts/kirkwood-ts219-6282.dts          |  10 ++
 arch/arm/boot/dts/kirkwood.dtsi                    |  38 +++++++
 arch/arm/mach-kirkwood/Kconfig                     | 119 +--------------------
 arch/arm/mach-kirkwood/Makefile                    |  16 ---
 arch/arm/mach-kirkwood/board-dnskw.c               |   7 --
 arch/arm/mach-kirkwood/board-dockstar.c            |  32 ------
 arch/arm/mach-kirkwood/board-dreamplug.c           |  35 ------
 arch/arm/mach-kirkwood/board-dt.c                  |  63 ++++-------
 arch/arm/mach-kirkwood/board-goflexnet.c           |  34 ------
 arch/arm/mach-kirkwood/board-ib62x0.c              |  29 -----
 arch/arm/mach-kirkwood/board-iconnect.c            |  32 ------
 arch/arm/mach-kirkwood/board-km_kirkwood.c         |   7 --
 arch/arm/mach-kirkwood/board-lsxl.c                |  36 -------
 arch/arm/mach-kirkwood/board-mplcec4.c             |  36 -------
 arch/arm/mach-kirkwood/board-ns2.c                 |  34 ------
 arch/arm/mach-kirkwood/board-nsa310.c              |  58 ----------
 arch/arm/mach-kirkwood/board-openblocks_a6.c       |  26 -----
 arch/arm/mach-kirkwood/board-ts219.c               |  50 ---------
 arch/arm/mach-kirkwood/board-usi_topkick.c         |  77 -------------
 arch/arm/mach-kirkwood/common.h                    |  75 -------------
 drivers/net/ethernet/marvell/mv643xx_eth.c         |  98 +++++++++++++++--
 39 files changed, 587 insertions(+), 749 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/net/mv643xx.txt
 delete mode 100644 arch/arm/mach-kirkwood/board-dockstar.c
 delete mode 100644 arch/arm/mach-kirkwood/board-dreamplug.c
 delete mode 100644 arch/arm/mach-kirkwood/board-goflexnet.c
 delete mode 100644 arch/arm/mach-kirkwood/board-ib62x0.c
 delete mode 100644 arch/arm/mach-kirkwood/board-iconnect.c
 delete mode 100644 arch/arm/mach-kirkwood/board-lsxl.c
 delete mode 100644 arch/arm/mach-kirkwood/board-mplcec4.c
 delete mode 100644 arch/arm/mach-kirkwood/board-ns2.c
 delete mode 100644 arch/arm/mach-kirkwood/board-nsa310.c
 delete mode 100644 arch/arm/mach-kirkwood/board-openblocks_a6.c
 delete mode 100644 arch/arm/mach-kirkwood/board-ts219.c
 delete mode 100644 arch/arm/mach-kirkwood/board-usi_topkick.c

-- 
1.8.1.1

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

* [PATCH V4 01/11] ARM: kirkwood: topkick: init mvsdio via DT
  2013-01-26 20:50 ` [PATCH V4 0/8] ARM: kirkwood: cleanup DT conversion Jason Cooper
@ 2013-01-26 20:50   ` Jason Cooper
  2013-02-16 16:25     ` Jason Cooper
  2013-01-26 20:50   ` [PATCH V4 02/11] ARM: kirkwood: topkick: convert to pinctrl Jason Cooper
                     ` (9 subsequent siblings)
  10 siblings, 1 reply; 102+ messages in thread
From: Jason Cooper @ 2013-01-26 20:50 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Jason Cooper <jason@lakedaemon.net>
Tested-by: Andrew Lunn <andrew@lunn.ch>
---
 arch/arm/boot/dts/kirkwood-topkick.dts     | 7 +++++++
 arch/arm/mach-kirkwood/board-usi_topkick.c | 6 ------
 2 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/arch/arm/boot/dts/kirkwood-topkick.dts b/arch/arm/boot/dts/kirkwood-topkick.dts
index cd15452..23c2ddc 100644
--- a/arch/arm/boot/dts/kirkwood-topkick.dts
+++ b/arch/arm/boot/dts/kirkwood-topkick.dts
@@ -54,6 +54,13 @@
 			status = "okay";
 			nr-ports = <1>;
 		};
+
+		mvsdio at 90000 {
+			pinctrl-0 = <&pmx_sdio>;
+			pinctrl-names = "default";
+			status = "okay";
+			/* No CD or WP GPIOs */
+		};
 	};
 
 	gpio-leds {
diff --git a/arch/arm/mach-kirkwood/board-usi_topkick.c b/arch/arm/mach-kirkwood/board-usi_topkick.c
index 23d2dd1..95f0711 100644
--- a/arch/arm/mach-kirkwood/board-usi_topkick.c
+++ b/arch/arm/mach-kirkwood/board-usi_topkick.c
@@ -14,7 +14,6 @@
 #include <linux/init.h>
 #include <linux/mv643xx_eth.h>
 #include <linux/gpio.h>
-#include <linux/platform_data/mmc-mvsdio.h>
 #include "common.h"
 #include "mpp.h"
 
@@ -22,10 +21,6 @@ static struct mv643xx_eth_platform_data topkick_ge00_data = {
 	.phy_addr	= MV643XX_ETH_PHY_ADDR(0),
 };
 
-static struct mvsdio_platform_data topkick_mvsdio_data = {
-	/* unfortunately the CD signal has not been connected */
-};
-
 /*
  * GPIO LED layout
  *
@@ -73,5 +68,4 @@ void __init usi_topkick_init(void)
 
 
 	kirkwood_ge00_init(&topkick_ge00_data);
-	kirkwood_sdio_init(&topkick_mvsdio_data);
 }
-- 
1.8.1.1

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

* [PATCH V4 02/11] ARM: kirkwood: topkick: convert to pinctrl
  2013-01-26 20:50 ` [PATCH V4 0/8] ARM: kirkwood: cleanup DT conversion Jason Cooper
  2013-01-26 20:50   ` [PATCH V4 01/11] ARM: kirkwood: topkick: init mvsdio via DT Jason Cooper
@ 2013-01-26 20:50   ` Jason Cooper
  2013-02-16 16:11     ` Jason Cooper
  2013-01-26 20:50   ` [PATCH V4 03/11] ARM: Kirkwood: topkick: Enable i2c bus Jason Cooper
                     ` (8 subsequent siblings)
  10 siblings, 1 reply; 102+ messages in thread
From: Jason Cooper @ 2013-01-26 20:50 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Jason Cooper <jason@lakedaemon.net>
---
 arch/arm/boot/dts/kirkwood-topkick.dts     | 90 ++++++++++++++++++++++++++++++
 arch/arm/mach-kirkwood/board-usi_topkick.c | 42 --------------
 2 files changed, 90 insertions(+), 42 deletions(-)

diff --git a/arch/arm/boot/dts/kirkwood-topkick.dts b/arch/arm/boot/dts/kirkwood-topkick.dts
index 23c2ddc..9ae2d2c 100644
--- a/arch/arm/boot/dts/kirkwood-topkick.dts
+++ b/arch/arm/boot/dts/kirkwood-topkick.dts
@@ -1,6 +1,7 @@
 /dts-v1/;
 
 /include/ "kirkwood.dtsi"
+/include/ "kirkwood-6282.dtsi"
 
 / {
 	model = "Univeral Scientific Industrial Co. Topkick-1281P2";
@@ -16,6 +17,95 @@
 	};
 
 	ocp at f1000000 {
+		pinctrl: pinctrl at 10000 {
+			/*
+			 * GPIO LED layout
+			 *
+			 *       /-SYS_LED(2)
+			 *       |
+			 *       |   /-DISK_LED
+			 *       |   |
+			 *       |   |   /-WLAN_LED(2)
+			 *       |   |   |
+			 * [SW] [*] [*] [*]
+			 */
+
+			/*
+			 * Switch positions
+			 *
+			 *     /-SW_LEFT(2)
+			 *     |
+			 *     |   /-SW_IDLE
+			 *     |   |
+			 *     |   |   /-SW_RIGHT
+			 *     |   |   |
+			 * PS [L] [I] [R] LEDS
+			 */
+			pinctrl-0 = < &pmx_led_disk_yellow
+				      &pmx_sata0_pwr_enable
+				      &pmx_led_sys_red
+				      &pmx_led_sys_blue
+				      &pmx_led_wifi_green
+				      &pmx_sw_left
+				      &pmx_sw_right
+				      &pmx_sw_idle
+				      &pmx_sw_left2
+				      &pmx_led_wifi_yellow
+				      &pmx_uart0
+				      &pmx_nand >;
+			pinctrl-names = "default";
+
+			pmx_led_disk_yellow: pmx-led-disk-yellow {
+				marvell,pins = "mpp21";
+				marvell,function = "gpio";
+			};
+
+			pmx_sata0_pwr_enable: pmx-sata0-pwr-enable {
+				marvell,pins = "mpp36";
+				marvell,function = "gpio";
+			};
+
+			pmx_led_sys_red: pmx-led-sys-red {
+				marvell,pins = "mpp37";
+				marvell,function = "gpio";
+			};
+
+			pmx_led_sys_blue: pmx-led-sys-blue {
+				marvell,pins = "mpp38";
+				marvell,function = "gpio";
+			};
+
+			pmx_led_wifi_green: pmx-led-wifi-green {
+				marvell,pins = "mpp39";
+				marvell,function = "gpio";
+			};
+
+			pmx_sw_left: pmx-sw-left {
+				marvell,pins = "mpp43";
+				marvell,function = "gpio";
+			};
+
+			pmx_sw_right: pmx-sw-right {
+				marvell,pins = "mpp44";
+				marvell,function = "gpio";
+			};
+
+			pmx_sw_idle: pmx-sw-idle {
+				marvell,pins = "mpp45";
+				marvell,function = "gpio";
+			};
+
+			pmx_sw_left2: pmx-sw-left2 {
+				marvell,pins = "mpp46";
+				marvell,function = "gpio";
+			};
+
+			pmx_led_wifi_yellow: pmx-led-wifi-yellow {
+				marvell,pins = "mpp48";
+				marvell,function = "gpio";
+			};
+		};
+
 		serial at 12000 {
 			clock-frequency = <200000000>;
 			status = "ok";
diff --git a/arch/arm/mach-kirkwood/board-usi_topkick.c b/arch/arm/mach-kirkwood/board-usi_topkick.c
index 95f0711..1cc04ec 100644
--- a/arch/arm/mach-kirkwood/board-usi_topkick.c
+++ b/arch/arm/mach-kirkwood/board-usi_topkick.c
@@ -15,57 +15,15 @@
 #include <linux/mv643xx_eth.h>
 #include <linux/gpio.h>
 #include "common.h"
-#include "mpp.h"
 
 static struct mv643xx_eth_platform_data topkick_ge00_data = {
 	.phy_addr	= MV643XX_ETH_PHY_ADDR(0),
 };
 
-/*
- * GPIO LED layout
- *
- *       /-SYS_LED(2)
- *       |
- *       |   /-DISK_LED
- *       |   |
- *       |   |   /-WLAN_LED(2)
- *       |   |   |
- * [SW] [*] [*] [*]
- */
-
-/*
- * Switch positions
- *
- *     /-SW_LEFT
- *     |
- *     |   /-SW_IDLE
- *     |   |
- *     |   |   /-SW_RIGHT
- *     |   |   |
- * PS [L] [I] [R] LEDS
- */
-
-static unsigned int topkick_mpp_config[] __initdata = {
-	MPP21_GPIO,	/* DISK_LED           (low active) - yellow */
-	MPP36_GPIO,	/* SATA0 power enable (high active) */
-	MPP37_GPIO,	/* SYS_LED2           (low active) - red */
-	MPP38_GPIO,	/* SYS_LED            (low active) - blue */
-	MPP39_GPIO,	/* WLAN_LED           (low active) - green */
-	MPP43_GPIO,	/* SW_LEFT            (low active) */
-	MPP44_GPIO,     /* SW_RIGHT           (low active) */
-	MPP45_GPIO,	/* SW_IDLE            (low active) */
-	MPP46_GPIO,     /* SW_LEFT            (low active) */
-	MPP48_GPIO,	/* WLAN_LED2          (low active) - yellow */
-	0
-};
-
 void __init usi_topkick_init(void)
 {
 	/*
 	 * Basic setup. Needs to be called early.
 	 */
-	kirkwood_mpp_conf(topkick_mpp_config);
-
-
 	kirkwood_ge00_init(&topkick_ge00_data);
 }
-- 
1.8.1.1

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

* [PATCH V4 03/11] ARM: Kirkwood: topkick: Enable i2c bus.
  2013-01-26 20:50 ` [PATCH V4 0/8] ARM: kirkwood: cleanup DT conversion Jason Cooper
  2013-01-26 20:50   ` [PATCH V4 01/11] ARM: kirkwood: topkick: init mvsdio via DT Jason Cooper
  2013-01-26 20:50   ` [PATCH V4 02/11] ARM: kirkwood: topkick: convert to pinctrl Jason Cooper
@ 2013-01-26 20:50   ` Jason Cooper
  2013-02-16 16:15     ` Jason Cooper
  2013-01-26 20:50   ` [PATCH V4 04/11] ARM: kirkwood: nsa310: cleanup includes and unneeded code Jason Cooper
                     ` (7 subsequent siblings)
  10 siblings, 1 reply; 102+ messages in thread
From: Jason Cooper @ 2013-01-26 20:50 UTC (permalink / raw)
  To: linux-arm-kernel

From: Andrew Lunn <andrew@lunn.ch>

Add a DT node for I2C and pinctrl hog for the pins. There appears to
be an i2c bus on topkick with a device on it:

i2cdetect 0
WARNING! This program can confuse your I2C bus, cause data loss and worse!
I will probe file /dev/i2c-0.
I will probe address range 0x03-0x77.
Continue? [Y/n] y
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- 64 -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
---
 arch/arm/boot/dts/kirkwood-topkick.dts | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/kirkwood-topkick.dts b/arch/arm/boot/dts/kirkwood-topkick.dts
index 9ae2d2c..131aae5 100644
--- a/arch/arm/boot/dts/kirkwood-topkick.dts
+++ b/arch/arm/boot/dts/kirkwood-topkick.dts
@@ -52,7 +52,8 @@
 				      &pmx_sw_left2
 				      &pmx_led_wifi_yellow
 				      &pmx_uart0
-				      &pmx_nand >;
+				      &pmx_nand
+				      &pmx_twsi0 >;
 			pinctrl-names = "default";
 
 			pmx_led_disk_yellow: pmx-led-disk-yellow {
@@ -151,6 +152,10 @@
 			status = "okay";
 			/* No CD or WP GPIOs */
 		};
+
+		i2c at 11000 {
+			status = "ok";
+		};
 	};
 
 	gpio-leds {
-- 
1.8.1.1

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

* [PATCH V4 04/11] ARM: kirkwood: nsa310: cleanup includes and unneeded code
  2013-01-26 20:50 ` [PATCH V4 0/8] ARM: kirkwood: cleanup DT conversion Jason Cooper
                     ` (2 preceding siblings ...)
  2013-01-26 20:50   ` [PATCH V4 03/11] ARM: Kirkwood: topkick: Enable i2c bus Jason Cooper
@ 2013-01-26 20:50   ` Jason Cooper
  2013-01-26 20:50   ` [PATCH V4 05/11] ARM: kirkwood: nsa310: convert to pinctrl Jason Cooper
                     ` (6 subsequent siblings)
  10 siblings, 0 replies; 102+ messages in thread
From: Jason Cooper @ 2013-01-26 20:50 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Jason Cooper <jason@lakedaemon.net>
---
 arch/arm/mach-kirkwood/board-nsa310.c | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/arch/arm/mach-kirkwood/board-nsa310.c b/arch/arm/mach-kirkwood/board-nsa310.c
index 1bd328d..0b99533 100644
--- a/arch/arm/mach-kirkwood/board-nsa310.c
+++ b/arch/arm/mach-kirkwood/board-nsa310.c
@@ -10,11 +10,8 @@
 
 #include <linux/kernel.h>
 #include <linux/init.h>
-#include <linux/i2c.h>
-
-#include <asm/mach-types.h>
-#include <asm/mach/arch.h>
 #include <mach/kirkwood.h>
+#include <linux/of.h>
 #include "common.h"
 #include "mpp.h"
 
@@ -40,11 +37,7 @@ static unsigned int nsa310_mpp_config[] __initdata = {
 
 void __init nsa310_init(void)
 {
-	u32 dev, rev;
-
 	kirkwood_mpp_conf(nsa310_mpp_config);
-
-	kirkwood_pcie_id(&dev, &rev);
 }
 
 static int __init nsa310_pci_init(void)
-- 
1.8.1.1

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

* [PATCH V4 05/11] ARM: kirkwood: nsa310: convert to pinctrl
  2013-01-26 20:50 ` [PATCH V4 0/8] ARM: kirkwood: cleanup DT conversion Jason Cooper
                     ` (3 preceding siblings ...)
  2013-01-26 20:50   ` [PATCH V4 04/11] ARM: kirkwood: nsa310: cleanup includes and unneeded code Jason Cooper
@ 2013-01-26 20:50   ` Jason Cooper
  2013-02-16 16:17     ` Jason Cooper
  2013-01-26 20:50   ` [PATCH V4 06/11] ARM: kirkwood: consolidate DT init of pcie Jason Cooper
                     ` (5 subsequent siblings)
  10 siblings, 1 reply; 102+ messages in thread
From: Jason Cooper @ 2013-01-26 20:50 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Jason Cooper <jason@lakedaemon.net>
---
 arch/arm/boot/dts/kirkwood-nsa310.dts | 99 +++++++++++++++++++++++++++++++++++
 arch/arm/mach-kirkwood/board-dt.c     |  3 --
 arch/arm/mach-kirkwood/board-nsa310.c | 26 ---------
 arch/arm/mach-kirkwood/common.h       |  6 ---
 4 files changed, 99 insertions(+), 35 deletions(-)

diff --git a/arch/arm/boot/dts/kirkwood-nsa310.dts b/arch/arm/boot/dts/kirkwood-nsa310.dts
index dbb3551..3a178cf 100644
--- a/arch/arm/boot/dts/kirkwood-nsa310.dts
+++ b/arch/arm/boot/dts/kirkwood-nsa310.dts
@@ -16,6 +16,105 @@
 	};
 
 	ocp at f1000000 {
+		pinctrl: pinctrl at 10000 {
+			pinctrl-0 = < &pmx_led_esata_green
+				      &pmx_led_esata_red
+				      &pmx_led_usb_green
+				      &pmx_led_usb_red
+				      &pmx_usb_power_off
+				      &pmx_led_sys_green
+				      &pmx_led_sys_red
+				      &pmx_btn_reset
+				      &pmx_btn_copy
+				      &pmx_led_copy_green
+				      &pmx_led_copy_red
+				      &pmx_led_hdd_green
+				      &pmx_led_hdd_red
+				      &pmx_unknown
+				      &pmx_btn_power
+				      &pmx_pwr_off >;
+			pinctrl-names = "default";
+
+			pmx_led_esata_green: pmx-led-esata-green {
+				marvell,pins = "mpp12";
+				marvell,function = "gpio";
+			};
+
+			pmx_led_esata_red: pmx-led-esata-red {
+				marvell,pins = "mpp13";
+				marvell,function = "gpio";
+			};
+
+			pmx_led_usb_green: pmx-led-usb-green {
+				marvell,pins = "mpp15";
+				marvell,function = "gpio";
+			};
+
+			pmx_led_usb_red: pmx-led-usb-red {
+				marvell,pins = "mpp16";
+				marvell,function = "gpio";
+			};
+
+			pmx_usb_power_off: pmx-usb-power-off {
+				marvell,pins = "mpp21";
+				marvell,function = "gpio";
+			};
+
+			pmx_led_sys_green: pmx-led-sys-green {
+				marvell,pins = "mpp28";
+				marvell,function = "gpio";
+			};
+
+			pmx_led_sys_red: pmx-led-sys-red {
+				marvell,pins = "mpp29";
+				marvell,function = "gpio";
+			};
+
+			pmx_btn_reset: pmx-btn-reset {
+				marvell,pins = "mpp36";
+				marvell,function = "gpio";
+			};
+
+			pmx_btn_copy: pmx-btn-copy {
+				marvell,pins = "mpp37";
+				marvell,function = "gpio";
+			};
+
+			pmx_led_copy_green: pmx-led-copy-green {
+				marvell,pins = "mpp39";
+				marvell,function = "gpio";
+			};
+
+			pmx_led_copy_red: pmx-led-copy-red {
+				marvell,pins = "mpp40";
+				marvell,function = "gpio";
+			};
+
+			pmx_led_hdd_green: pmx-led-hdd-green {
+				marvell,pins = "mpp41";
+				marvell,function = "gpio";
+			};
+
+			pmx_led_hdd_red: pmx-led-hdd-red {
+				marvell,pins = "mpp42";
+				marvell,function = "gpio";
+			};
+
+			pmx_unknown: pmx-unknown {
+				marvell,pins = "mpp44";
+				marvell,function = "gpio";
+			};
+
+			pmx_btn_power: pmx-btn-power {
+				marvell,pins = "mpp46";
+				marvell,function = "gpio";
+			};
+
+			pmx_pwr_off: pmx-pwr-off {
+				marvell,pins = "mpp48";
+				marvell,function = "gpio";
+			};
+		};
 
 		serial at 12000 {
 			clock-frequency = <200000000>;
diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c
index 8eac548..8b35157 100644
--- a/arch/arm/mach-kirkwood/board-dt.c
+++ b/arch/arm/mach-kirkwood/board-dt.c
@@ -141,9 +141,6 @@ static void __init kirkwood_dt_init(void)
 	if (of_machine_is_compatible("usi,topkick"))
 		usi_topkick_init();
 
-	if (of_machine_is_compatible("zyxel,nsa310"))
-		nsa310_init();
-
 	of_platform_populate(NULL, kirkwood_dt_match_table, NULL, NULL);
 }
 
diff --git a/arch/arm/mach-kirkwood/board-nsa310.c b/arch/arm/mach-kirkwood/board-nsa310.c
index 0b99533..55ade93 100644
--- a/arch/arm/mach-kirkwood/board-nsa310.c
+++ b/arch/arm/mach-kirkwood/board-nsa310.c
@@ -13,32 +13,6 @@
 #include <mach/kirkwood.h>
 #include <linux/of.h>
 #include "common.h"
-#include "mpp.h"
-
-static unsigned int nsa310_mpp_config[] __initdata = {
-	MPP12_GPIO, /* led esata green */
-	MPP13_GPIO, /* led esata red */
-	MPP15_GPIO, /* led usb green */
-	MPP16_GPIO, /* led usb red */
-	MPP21_GPIO, /* control usb power off */
-	MPP28_GPIO, /* led sys green */
-	MPP29_GPIO, /* led sys red */
-	MPP36_GPIO, /* key reset */
-	MPP37_GPIO, /* key copy */
-	MPP39_GPIO, /* led copy green */
-	MPP40_GPIO, /* led copy red */
-	MPP41_GPIO, /* led hdd green */
-	MPP42_GPIO, /* led hdd red */
-	MPP44_GPIO, /* ?? */
-	MPP46_GPIO, /* key power */
-	MPP48_GPIO, /* control power off */
-	0
-};
-
-void __init nsa310_init(void)
-{
-	kirkwood_mpp_conf(nsa310_mpp_config);
-}
 
 static int __init nsa310_pci_init(void)
 {
diff --git a/arch/arm/mach-kirkwood/common.h b/arch/arm/mach-kirkwood/common.h
index e956d02..1c42cb8 100644
--- a/arch/arm/mach-kirkwood/common.h
+++ b/arch/arm/mach-kirkwood/common.h
@@ -130,12 +130,6 @@ void ns2_init(void);
 static inline void ns2_init(void) {};
 #endif
 
-#ifdef CONFIG_MACH_NSA310_DT
-void nsa310_init(void);
-#else
-static inline void nsa310_init(void) {};
-#endif
-
 #ifdef CONFIG_MACH_OPENBLOCKS_A6_DT
 void openblocks_a6_init(void);
 #else
-- 
1.8.1.1

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

* [PATCH V4 06/11] ARM: kirkwood: consolidate DT init of pcie
  2013-01-26 20:50 ` [PATCH V4 0/8] ARM: kirkwood: cleanup DT conversion Jason Cooper
                     ` (4 preceding siblings ...)
  2013-01-26 20:50   ` [PATCH V4 05/11] ARM: kirkwood: nsa310: convert to pinctrl Jason Cooper
@ 2013-01-26 20:50   ` Jason Cooper
  2013-01-26 20:50   ` [PATCH V4 07/11] ARM: mvebu: correct gated clock documentation Jason Cooper
                     ` (4 subsequent siblings)
  10 siblings, 0 replies; 102+ messages in thread
From: Jason Cooper @ 2013-01-26 20:50 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Jason Cooper <jason@lakedaemon.net>
---
 arch/arm/mach-kirkwood/Makefile         |  1 -
 arch/arm/mach-kirkwood/board-dt.c       | 23 +++++++++++++++++++++++
 arch/arm/mach-kirkwood/board-iconnect.c |  9 ---------
 arch/arm/mach-kirkwood/board-mplcec4.c  |  1 -
 arch/arm/mach-kirkwood/board-nsa310.c   | 25 -------------------------
 arch/arm/mach-kirkwood/board-ts219.c    | 13 -------------
 6 files changed, 23 insertions(+), 49 deletions(-)
 delete mode 100644 arch/arm/mach-kirkwood/board-nsa310.c

diff --git a/arch/arm/mach-kirkwood/Makefile b/arch/arm/mach-kirkwood/Makefile
index d665309..ee3aa77 100644
--- a/arch/arm/mach-kirkwood/Makefile
+++ b/arch/arm/mach-kirkwood/Makefile
@@ -36,6 +36,5 @@ obj-$(CONFIG_MACH_NETSPACE_V2_DT)	+= board-ns2.o
 obj-$(CONFIG_MACH_NETSPACE_MAX_V2_DT)	+= board-ns2.o
 obj-$(CONFIG_MACH_NETSPACE_LITE_V2_DT)	+= board-ns2.o
 obj-$(CONFIG_MACH_NETSPACE_MINI_V2_DT)	+= board-ns2.o
-obj-$(CONFIG_MACH_NSA310_DT)		+= board-nsa310.o
 obj-$(CONFIG_MACH_OPENBLOCKS_A6_DT)	+= board-openblocks_a6.o
 obj-$(CONFIG_MACH_TOPKICK_DT)		+= board-usi_topkick.o
diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c
index 8b35157..73b76e4 100644
--- a/arch/arm/mach-kirkwood/board-dt.c
+++ b/arch/arm/mach-kirkwood/board-dt.c
@@ -70,6 +70,29 @@ static void __init kirkwood_of_clk_init(void)
 	kirkwood_legacy_clk_init();
 }
 
+static const char * const kirkwood_dt_pcie0_compat[] = {
+	"iom,iconnect",
+	"mpl,cec4",
+	"qnap,ts219",
+	"zyxel,nsa310",
+	NULL
+};
+
+static int __init kirkwood_pcie_dt_init(void)
+{
+	int i;
+
+	for (i = 0; kirkwood_dt_pcie0_compat[i] != NULL; i++) {
+		if (of_machine_is_compatible(kirkwood_dt_pcie0_compat[i])) {
+			kirkwood_pcie_init(KW_PCIE0);
+			break;
+		}
+	}
+
+	return 0;
+}
+subsys_initcall(kirkwood_pcie_dt_init);
+
 static void __init kirkwood_dt_init(void)
 {
 	pr_info("Kirkwood: %s, TCLK=%d.\n", kirkwood_id(), kirkwood_tclk);
diff --git a/arch/arm/mach-kirkwood/board-iconnect.c b/arch/arm/mach-kirkwood/board-iconnect.c
index c8ebde4..ff042dc 100644
--- a/arch/arm/mach-kirkwood/board-iconnect.c
+++ b/arch/arm/mach-kirkwood/board-iconnect.c
@@ -10,7 +10,6 @@
 
 #include <linux/kernel.h>
 #include <linux/init.h>
-#include <linux/of.h>
 #include <linux/mv643xx_eth.h>
 #include "common.h"
 
@@ -22,11 +21,3 @@ void __init iconnect_init(void)
 {
 	kirkwood_ge00_init(&iconnect_ge00_data);
 }
-
-static int __init iconnect_pci_init(void)
-{
-	if (of_machine_is_compatible("iom,iconnect"))
-		kirkwood_pcie_init(KW_PCIE0);
-	return 0;
-}
-subsys_initcall(iconnect_pci_init);
diff --git a/arch/arm/mach-kirkwood/board-mplcec4.c b/arch/arm/mach-kirkwood/board-mplcec4.c
index 7d6dc66..938712e 100644
--- a/arch/arm/mach-kirkwood/board-mplcec4.c
+++ b/arch/arm/mach-kirkwood/board-mplcec4.c
@@ -29,7 +29,6 @@ void __init mplcec4_init(void)
 	 */
 	kirkwood_ge00_init(&mplcec4_ge00_data);
 	kirkwood_ge01_init(&mplcec4_ge01_data);
-	kirkwood_pcie_init(KW_PCIE0);
 }
 
 
diff --git a/arch/arm/mach-kirkwood/board-nsa310.c b/arch/arm/mach-kirkwood/board-nsa310.c
deleted file mode 100644
index 55ade93..0000000
--- a/arch/arm/mach-kirkwood/board-nsa310.c
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * arch/arm/mach-kirkwood/nsa-310-setup.c
- *
- * ZyXEL NSA-310 Setup
- *
- * 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 <mach/kirkwood.h>
-#include <linux/of.h>
-#include "common.h"
-
-static int __init nsa310_pci_init(void)
-{
-	if (of_machine_is_compatible("zyxel,nsa310"))
-		kirkwood_pcie_init(KW_PCIE0);
-
-	return 0;
-}
-
-subsys_initcall(nsa310_pci_init);
diff --git a/arch/arm/mach-kirkwood/board-ts219.c b/arch/arm/mach-kirkwood/board-ts219.c
index 10fb397..f00c0a9 100644
--- a/arch/arm/mach-kirkwood/board-ts219.c
+++ b/arch/arm/mach-kirkwood/board-ts219.c
@@ -17,10 +17,7 @@
 
 #include <linux/kernel.h>
 #include <linux/init.h>
-#include <linux/platform_device.h>
 #include <linux/mv643xx_eth.h>
-#include <asm/mach-types.h>
-#include <asm/mach/arch.h>
 #include <mach/kirkwood.h>
 #include "common.h"
 
@@ -38,13 +35,3 @@ void __init qnap_dt_ts219_init(void)
 
 	kirkwood_ge00_init(&qnap_ts219_ge00_data);
 }
-
-/* FIXME: Will not work with DT. Maybe use MPP40_GPIO? */
-static int __init ts219_pci_init(void)
-{
-	if (machine_is_ts219())
-		kirkwood_pcie_init(KW_PCIE0);
-
-	return 0;
-}
-subsys_initcall(ts219_pci_init);
-- 
1.8.1.1

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

* [PATCH V4 07/11] ARM: mvebu: correct gated clock documentation
  2013-01-26 20:50 ` [PATCH V4 0/8] ARM: kirkwood: cleanup DT conversion Jason Cooper
                     ` (5 preceding siblings ...)
  2013-01-26 20:50   ` [PATCH V4 06/11] ARM: kirkwood: consolidate DT init of pcie Jason Cooper
@ 2013-01-26 20:50   ` Jason Cooper
  2013-02-15 20:37     ` Jason Cooper
  2013-01-26 20:50   ` [PATCH V4 08/11] mv643xx.c: Add basic device tree support Jason Cooper
                     ` (3 subsequent siblings)
  10 siblings, 1 reply; 102+ messages in thread
From: Jason Cooper @ 2013-01-26 20:50 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Jason Cooper <jason@lakedaemon.net>
---
 Documentation/devicetree/bindings/clock/mvebu-gated-clock.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/clock/mvebu-gated-clock.txt b/Documentation/devicetree/bindings/clock/mvebu-gated-clock.txt
index 7337005..cffc93d 100644
--- a/Documentation/devicetree/bindings/clock/mvebu-gated-clock.txt
+++ b/Documentation/devicetree/bindings/clock/mvebu-gated-clock.txt
@@ -89,7 +89,7 @@ ID	Clock	Peripheral
 16	xor1	XOR DMA 1
 17	crypto	CESA engine
 18	pex1	PCIe Cntrl 1
-19	ge1	Gigabit Ethernet 0
+19	ge1	Gigabit Ethernet 1
 20	tdm	Time Division Mplx
 
 Required properties:
-- 
1.8.1.1

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

* [PATCH V4 08/11] mv643xx.c: Add basic device tree support.
  2013-01-26 20:50 ` [PATCH V4 0/8] ARM: kirkwood: cleanup DT conversion Jason Cooper
                     ` (6 preceding siblings ...)
  2013-01-26 20:50   ` [PATCH V4 07/11] ARM: mvebu: correct gated clock documentation Jason Cooper
@ 2013-01-26 20:50   ` Jason Cooper
  2013-01-26 20:50   ` [PATCH V4 09/11] NET: mv643xx: Get clk from device tree Jason Cooper
                     ` (2 subsequent siblings)
  10 siblings, 0 replies; 102+ messages in thread
From: Jason Cooper @ 2013-01-26 20:50 UTC (permalink / raw)
  To: linux-arm-kernel

From: Ian Molton <ian.molton@codethink.co.uk>

    This patch adds basic device tree support to the mv643xx ethernet driver.

    It should be enough for most current users of the device, and should allow
    a painless migration.

    Signed-off-by: Ian Molton <ian.molton@codethink.co.uk>

Signed-off-by: Jason Cooper <jason@lakedaemon.net>
---
 Documentation/devicetree/bindings/net/mv643xx.txt | 75 ++++++++++++++++++
 drivers/net/ethernet/marvell/mv643xx_eth.c        | 93 +++++++++++++++++++++--
 2 files changed, 161 insertions(+), 7 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/net/mv643xx.txt

diff --git a/Documentation/devicetree/bindings/net/mv643xx.txt b/Documentation/devicetree/bindings/net/mv643xx.txt
new file mode 100644
index 0000000..2727f798
--- /dev/null
+++ b/Documentation/devicetree/bindings/net/mv643xx.txt
@@ -0,0 +1,75 @@
+mv643xx related nodes.
+
+marvell,mdio-mv643xx:
+
+Required properties:
+
+ - interrupts : <a> where a is the SMI interrupt number.
+ - reg : the base address and size of the controllers register space.
+
+Optional properties:
+ - shared_smi : on some chips, the second PHY is "shared", meaning it is
+	really accessed via the first SMI controller. It is passed in this
+	way due to the present structure of the driver, which requires the
+	base address for the MAC to be passed in via the SMI controllers
+	platform data.
+ - tx_csum_limit : on some devices, this option is required for proper
+	operation wrt. jumbo frames.
+
+
+Example:
+
+smi0: mdio at 72000 {
+	compatible = "marvell,mdio-mv643xx";
+	reg = <0x72000 0x4000>;
+	interrupts = <46>;
+	tx_csum_limit = <1600>;
+	status = "disabled";
+};
+
+smi1: mdio at 76000 {
+	compatible = "marvell,mdio-mv643xx";
+	reg = <0x76000 0x4000>;
+	interrupts = <47>;
+	shared_smi = <&smi0>;
+	tx_csum_limit = <1600>;
+	status = "disabled";
+};
+
+
+
+marvell,mv643xx-eth:
+
+Required properties:
+ - interrupts : the port interrupt number.
+ - mdio : phandle of the smi device as drescribed above
+
+Optional properties:
+ - port_number : the port number on this bus.
+ - phy_addr : the PHY address.
+ - reg : should match the mdio reg this device is attached to.
+	this is a required hack for now due to the way the
+	driver is constructed. This allows the device clock to be
+	kept running so that the MAC is not lost after boot.
+
+
+Example:
+
+egiga0 {
+	compatible = "marvell,mv643xx-eth";
+	reg = <0x72000 0x4000>;
+	mdio = <&smi0>;
+	port_number = <0>;
+	phy_addr = <0x80>;
+	interrupts = <11>;
+};
+
+egiga1 {
+	compatible = "marvell,mv643xx-eth";
+	reg = <0x76000 0x4000>;
+	mdio = <&smi1>;
+	port_number = <0>;
+	phy_addr = <0x81>;
+	interrupts = <15>;
+};
+
diff --git a/drivers/net/ethernet/marvell/mv643xx_eth.c b/drivers/net/ethernet/marvell/mv643xx_eth.c
index 84c1326..7048d7c 100644
--- a/drivers/net/ethernet/marvell/mv643xx_eth.c
+++ b/drivers/net/ethernet/marvell/mv643xx_eth.c
@@ -48,6 +48,9 @@
 #include <linux/ethtool.h>
 #include <linux/platform_device.h>
 #include <linux/module.h>
+#include <linux/of.h>
+#include <linux/of_platform.h>
+#include <linux/of_irq.h>
 #include <linux/kernel.h>
 #include <linux/spinlock.h>
 #include <linux/workqueue.h>
@@ -2586,7 +2589,7 @@ static void infer_hw_params(struct mv643xx_eth_shared_private *msp)
 static int mv643xx_eth_shared_probe(struct platform_device *pdev)
 {
 	static int mv643xx_eth_version_printed;
-	struct mv643xx_eth_shared_platform_data *pd = pdev->dev.platform_data;
+	struct mv643xx_eth_shared_platform_data *pd;
 	struct mv643xx_eth_shared_private *msp;
 	const struct mbus_dram_target_info *dram;
 	struct resource *res;
@@ -2610,6 +2613,26 @@ static int mv643xx_eth_shared_probe(struct platform_device *pdev)
 	if (msp->base == NULL)
 		goto out_free;
 
+	if (pdev->dev.of_node) {
+		struct device_node *np = NULL;
+
+		/* when all users of this driver use FDT, we can remove this */
+		pd = kzalloc(sizeof(*pd), GFP_KERNEL);
+		if (!pd) {
+			dev_dbg(&pdev->dev, "Could not allocate platform data\n");
+			goto out_free;
+		}
+
+		of_property_read_u32(pdev->dev.of_node,
+			"tx_csum_limit", &pd->tx_csum_limit);
+
+		np = of_parse_phandle(pdev->dev.of_node, "shared_smi", 0);
+		if (np)
+			pd->shared_smi = of_find_device_by_node(np);
+
+	} else {
+		pd = pdev->dev.platform_data;
+	}
 	/*
 	 * Set up and register SMI bus.
 	 */
@@ -2642,7 +2665,6 @@ static int mv643xx_eth_shared_probe(struct platform_device *pdev)
 	res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
 	if (res != NULL) {
 		int err;
-
 		err = request_irq(res->start, mv643xx_eth_err_irq,
 				  IRQF_SHARED, "mv643xx_eth", msp);
 		if (!err) {
@@ -2660,6 +2682,10 @@ static int mv643xx_eth_shared_probe(struct platform_device *pdev)
 
 	msp->tx_csum_limit = (pd != NULL && pd->tx_csum_limit) ?
 					pd->tx_csum_limit : 9 * 1024;
+
+	if (pdev->dev.of_node)
+		kfree(pd);  /* If we created a fake pd, free it now */
+
 	infer_hw_params(msp);
 
 	platform_set_drvdata(pdev, msp);
@@ -2693,12 +2719,21 @@ static int mv643xx_eth_shared_remove(struct platform_device *pdev)
 	return 0;
 }
 
+#ifdef CONFIG_OF
+static struct of_device_id mv_mdio_dt_ids[] __devinitdata = {
+	{ .compatible = "marvell,mdio-mv643xx", },
+	{},
+};
+MODULE_DEVICE_TABLE(of, mv_mdio_dt_ids);
+#endif
+
 static struct platform_driver mv643xx_eth_shared_driver = {
 	.probe		= mv643xx_eth_shared_probe,
 	.remove		= mv643xx_eth_shared_remove,
 	.driver = {
 		.name	= MV643XX_ETH_SHARED_NAME,
 		.owner	= THIS_MODULE,
+		.of_match_table = of_match_ptr(mv_mdio_dt_ids),
 	},
 };
 
@@ -2858,7 +2893,36 @@ static int mv643xx_eth_probe(struct platform_device *pdev)
 	struct resource *res;
 	int err;
 
-	pd = pdev->dev.platform_data;
+	if (pdev->dev.of_node) {
+		struct device_node *np = NULL;
+
+		/* when all users of this driver use FDT, we can remove this */
+		pd = kzalloc(sizeof(*pd), GFP_KERNEL);
+		if (!pd) {
+			dev_dbg(&pdev->dev, "Could not allocate platform data\n");
+			return -ENOMEM;
+		}
+
+		of_property_read_u32(pdev->dev.of_node,
+			"port_number", &pd->port_number);
+
+		if (!of_property_read_u32(pdev->dev.of_node,
+				"phy_addr", &pd->phy_addr))
+			pd->phy_addr = MV643XX_ETH_PHY_ADDR(pd->phy_addr);
+		else
+			pd->phy_addr = MV643XX_ETH_PHY_ADDR_DEFAULT;
+
+		np = of_parse_phandle(pdev->dev.of_node, "mdio", 0);
+		if (np) {
+			pd->shared = of_find_device_by_node(np);
+		} else {
+			kfree(pd);
+			return -ENODEV;
+		}
+	} else {
+		pd = pdev->dev.platform_data;
+	}
+
 	if (pd == NULL) {
 		dev_err(&pdev->dev, "no mv643xx_eth_platform_data\n");
 		return -ENODEV;
@@ -2866,12 +2930,15 @@ static int mv643xx_eth_probe(struct platform_device *pdev)
 
 	if (pd->shared == NULL) {
 		dev_err(&pdev->dev, "no mv643xx_eth_platform_data->shared\n");
-		return -ENODEV;
+		err = -ENODEV;
+		goto out_free_pd;
 	}
 
 	dev = alloc_etherdev_mq(sizeof(struct mv643xx_eth_private), 8);
-	if (!dev)
-		return -ENOMEM;
+	if (!dev) {
+		err = -ENOMEM;
+		goto out_free_pd;
+	}
 
 	mp = netdev_priv(dev);
 	platform_set_drvdata(pdev, mp);
@@ -2908,6 +2975,8 @@ static int mv643xx_eth_probe(struct platform_device *pdev)
 
 	init_pscr(mp, pd->speed, pd->duplex);
 
+	if (pdev->dev.of_node)
+		kfree(pd); /* If we created a fake pd, free it now */
 
 	mib_counters_clear(mp);
 
@@ -2927,7 +2996,6 @@ static int mv643xx_eth_probe(struct platform_device *pdev)
 	mp->rx_oom.data = (unsigned long)mp;
 	mp->rx_oom.function = oom_timer_wrapper;
 
-
 	res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
 	BUG_ON(!res);
 	dev->irq = res->start;
@@ -2976,6 +3044,8 @@ out:
 	}
 #endif
 	free_netdev(dev);
+out_free_pd:
+	kfree(pd);
 
 	return err;
 }
@@ -3015,6 +3085,14 @@ static void mv643xx_eth_shutdown(struct platform_device *pdev)
 		port_reset(mp);
 }
 
+#ifdef CONFIG_OF
+static struct of_device_id mv_eth_dt_ids[] __devinitdata = {
+	{ .compatible = "marvell,mv643xx-eth", },
+	{},
+};
+MODULE_DEVICE_TABLE(of, mv_eth_dt_ids);
+#endif
+
 static struct platform_driver mv643xx_eth_driver = {
 	.probe		= mv643xx_eth_probe,
 	.remove		= mv643xx_eth_remove,
@@ -3022,6 +3100,7 @@ static struct platform_driver mv643xx_eth_driver = {
 	.driver = {
 		.name	= MV643XX_ETH_NAME,
 		.owner	= THIS_MODULE,
+		.of_match_table = of_match_ptr(mv_eth_dt_ids),
 	},
 };
 
-- 
1.8.1.1

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

* [PATCH V4 09/11] NET: mv643xx: Get clk from device tree.
  2013-01-26 20:50 ` [PATCH V4 0/8] ARM: kirkwood: cleanup DT conversion Jason Cooper
                     ` (7 preceding siblings ...)
  2013-01-26 20:50   ` [PATCH V4 08/11] mv643xx.c: Add basic device tree support Jason Cooper
@ 2013-01-26 20:50   ` Jason Cooper
  2013-01-27 14:27     ` [PATCH] NET: mv643xx: get smi clock " Sebastian Hesselbarth
  2013-01-26 20:50   ` [PATCH V4 10/11] ARM: kirkwood: mv643xx_eth dt conversion Jason Cooper
  2013-01-26 20:50   ` [PATCH V4 11/11] ARM: Kirkwood: Convert QNAP TS219 Ethernet to DT Jason Cooper
  10 siblings, 1 reply; 102+ messages in thread
From: Jason Cooper @ 2013-01-26 20:50 UTC (permalink / raw)
  To: linux-arm-kernel

From: Andrew Lunn <andrew@lunn.ch>

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>
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
---
 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.8.1.1

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

* [PATCH V4 10/11] ARM: kirkwood: mv643xx_eth dt conversion
  2013-01-26 20:50 ` [PATCH V4 0/8] ARM: kirkwood: cleanup DT conversion Jason Cooper
                     ` (8 preceding siblings ...)
  2013-01-26 20:50   ` [PATCH V4 09/11] NET: mv643xx: Get clk from device tree Jason Cooper
@ 2013-01-26 20:50   ` Jason Cooper
  2013-01-27 13:41     ` Sebastian Hesselbarth
  2013-01-26 20:50   ` [PATCH V4 11/11] ARM: Kirkwood: Convert QNAP TS219 Ethernet to DT Jason Cooper
  10 siblings, 1 reply; 102+ messages in thread
From: Jason Cooper @ 2013-01-26 20:50 UTC (permalink / raw)
  To: linux-arm-kernel

Tested on the dreamplug:

mv643xx_eth: MV-643xx 10/100/1000 ethernet driver version 1.4
libphy: mv643xx_eth smi: probed
libphy: mv643xx_eth smi: probed
mv643xx_eth_port f1072000.egiga0 eth0: port 0 with MAC address XX:XX:XX...
mv643xx_eth_port f1076000.egiga1 eth1: port 0 with MAC address XX:XX:XX...

Successfully pulled an ip address and pinged through the interface

Signed-off-by: Jason Cooper <jason@lakedaemon.net>
---
 arch/arm/boot/dts/kirkwood-dnskw.dtsi        |   9 +++
 arch/arm/boot/dts/kirkwood-dockstar.dts      |   8 +++
 arch/arm/boot/dts/kirkwood-dreamplug.dts     |  16 +++++
 arch/arm/boot/dts/kirkwood-goflexnet.dts     |   7 ++
 arch/arm/boot/dts/kirkwood-ib62x0.dts        |   9 +++
 arch/arm/boot/dts/kirkwood-iconnect.dts      |   9 +++
 arch/arm/boot/dts/kirkwood-km_kirkwood.dts   |   8 +++
 arch/arm/boot/dts/kirkwood-lsxl.dtsi         |  18 +++++
 arch/arm/boot/dts/kirkwood-mplcec4.dts       |  18 +++++
 arch/arm/boot/dts/kirkwood-ns2-common.dtsi   |   9 +++
 arch/arm/boot/dts/kirkwood-ns2lite.dts       |   5 ++
 arch/arm/boot/dts/kirkwood-ns2mini.dts       |   5 ++
 arch/arm/boot/dts/kirkwood-openblocks_a6.dts |   8 +++
 arch/arm/boot/dts/kirkwood-topkick.dts       |   8 +++
 arch/arm/boot/dts/kirkwood.dtsi              |  38 ++++++++++
 arch/arm/mach-kirkwood/Kconfig               | 102 +--------------------------
 arch/arm/mach-kirkwood/Makefile              |  14 ----
 arch/arm/mach-kirkwood/board-dnskw.c         |   7 --
 arch/arm/mach-kirkwood/board-dockstar.c      |  32 ---------
 arch/arm/mach-kirkwood/board-dreamplug.c     |  35 ---------
 arch/arm/mach-kirkwood/board-dt.c            |  34 ---------
 arch/arm/mach-kirkwood/board-goflexnet.c     |  34 ---------
 arch/arm/mach-kirkwood/board-ib62x0.c        |  29 --------
 arch/arm/mach-kirkwood/board-iconnect.c      |  23 ------
 arch/arm/mach-kirkwood/board-km_kirkwood.c   |   7 --
 arch/arm/mach-kirkwood/board-lsxl.c          |  36 ----------
 arch/arm/mach-kirkwood/board-mplcec4.c       |  35 ---------
 arch/arm/mach-kirkwood/board-ns2.c           |  34 ---------
 arch/arm/mach-kirkwood/board-openblocks_a6.c |  26 -------
 arch/arm/mach-kirkwood/board-usi_topkick.c   |  29 --------
 arch/arm/mach-kirkwood/common.h              |  63 -----------------
 31 files changed, 176 insertions(+), 539 deletions(-)
 delete mode 100644 arch/arm/mach-kirkwood/board-dockstar.c
 delete mode 100644 arch/arm/mach-kirkwood/board-dreamplug.c
 delete mode 100644 arch/arm/mach-kirkwood/board-goflexnet.c
 delete mode 100644 arch/arm/mach-kirkwood/board-ib62x0.c
 delete mode 100644 arch/arm/mach-kirkwood/board-iconnect.c
 delete mode 100644 arch/arm/mach-kirkwood/board-lsxl.c
 delete mode 100644 arch/arm/mach-kirkwood/board-mplcec4.c
 delete mode 100644 arch/arm/mach-kirkwood/board-ns2.c
 delete mode 100644 arch/arm/mach-kirkwood/board-openblocks_a6.c
 delete mode 100644 arch/arm/mach-kirkwood/board-usi_topkick.c

diff --git a/arch/arm/boot/dts/kirkwood-dnskw.dtsi b/arch/arm/boot/dts/kirkwood-dnskw.dtsi
index 6875ac0..9e2132a 100644
--- a/arch/arm/boot/dts/kirkwood-dnskw.dtsi
+++ b/arch/arm/boot/dts/kirkwood-dnskw.dtsi
@@ -186,6 +186,15 @@
 				reg = <0x7b00000 0x500000>;
 			};
 		};
+
+		smi0: mdio at 72000 {
+			status = "ok";
+		};
+
+		egiga0 {
+			phy_addr = <0x88>;
+			status = "ok";
+		};
 	};
 
 	regulators {
diff --git a/arch/arm/boot/dts/kirkwood-dockstar.dts b/arch/arm/boot/dts/kirkwood-dockstar.dts
index 2e3dd34..ec09085 100644
--- a/arch/arm/boot/dts/kirkwood-dockstar.dts
+++ b/arch/arm/boot/dts/kirkwood-dockstar.dts
@@ -60,6 +60,14 @@
 				reg = <0x0500000 0xfb00000>;
 			};
 		};
+
+		smi0: mdio at 72000 {
+			status = "ok";
+		};
+
+		egiga0 {
+			status = "ok";
+		};
 	};
 	gpio-leds {
 		compatible = "gpio-leds";
diff --git a/arch/arm/boot/dts/kirkwood-dreamplug.dts b/arch/arm/boot/dts/kirkwood-dreamplug.dts
index ef2d8c7..ae130a5 100644
--- a/arch/arm/boot/dts/kirkwood-dreamplug.dts
+++ b/arch/arm/boot/dts/kirkwood-dreamplug.dts
@@ -81,6 +81,22 @@
 			status = "okay";
 			/* No CD or WP GPIOs */
 		};
+
+		smi0: mdio at 72000 {
+			status = "ok";
+		};
+
+		smi1: mdio at 76000 {
+			status = "ok";
+		};
+
+		egiga0 {
+			status = "ok";
+		};
+
+		egiga1 {
+			status = "ok";
+		};
 	};
 
 	gpio-leds {
diff --git a/arch/arm/boot/dts/kirkwood-goflexnet.dts b/arch/arm/boot/dts/kirkwood-goflexnet.dts
index 1b133e0..98513ee 100644
--- a/arch/arm/boot/dts/kirkwood-goflexnet.dts
+++ b/arch/arm/boot/dts/kirkwood-goflexnet.dts
@@ -106,6 +106,13 @@
 			nr-ports = <2>;
 		};
 
+		smi0: mdio at 72000 {
+			status = "ok";
+		};
+
+		egiga0 {
+			status = "ok";
+		};
 	};
 	gpio-leds {
 		compatible = "gpio-leds";
diff --git a/arch/arm/boot/dts/kirkwood-ib62x0.dts b/arch/arm/boot/dts/kirkwood-ib62x0.dts
index 71902da..e77b06d 100644
--- a/arch/arm/boot/dts/kirkwood-ib62x0.dts
+++ b/arch/arm/boot/dts/kirkwood-ib62x0.dts
@@ -79,6 +79,15 @@
 			};
 
 		};
+
+		smi0: mdio at 72000 {
+			status = "ok";
+		};
+
+		egiga0 {
+			phy_addr = <0x88>;
+			status = "ok";
+		};
 	};
 
 	gpio_keys {
diff --git a/arch/arm/boot/dts/kirkwood-iconnect.dts b/arch/arm/boot/dts/kirkwood-iconnect.dts
index 504f16b..5b89685 100644
--- a/arch/arm/boot/dts/kirkwood-iconnect.dts
+++ b/arch/arm/boot/dts/kirkwood-iconnect.dts
@@ -110,6 +110,15 @@
 				reg = <0x980000 0x1f400000>;
 			};
 		};
+
+		smi0: mdio at 72000 {
+			status = "ok";
+		};
+
+		egiga0 {
+			phy_addr = <0x91>;
+			status = "ok";
+		};
 	};
 
 	gpio-leds {
diff --git a/arch/arm/boot/dts/kirkwood-km_kirkwood.dts b/arch/arm/boot/dts/kirkwood-km_kirkwood.dts
index 8db3123..49a8049 100644
--- a/arch/arm/boot/dts/kirkwood-km_kirkwood.dts
+++ b/arch/arm/boot/dts/kirkwood-km_kirkwood.dts
@@ -42,5 +42,13 @@
 			status = "ok";
 			chip-delay = <25>;
 		};
+
+		smi0: mdio at 72000 {
+			status = "ok";
+		};
+
+		egiga0 {
+			status = "ok";
+		};
 	};
 };
diff --git a/arch/arm/boot/dts/kirkwood-lsxl.dtsi b/arch/arm/boot/dts/kirkwood-lsxl.dtsi
index 996c7fe..16199bf 100644
--- a/arch/arm/boot/dts/kirkwood-lsxl.dtsi
+++ b/arch/arm/boot/dts/kirkwood-lsxl.dtsi
@@ -106,6 +106,24 @@
 				};
 			};
 		};
+
+		smi0: mdio at 72000 {
+			status = "ok";
+		};
+
+		smi1: mdio at 76000 {
+			status = "ok";
+		};
+
+		egiga0 {
+			phy_addr = <0x80>;
+			status = "ok";
+		};
+
+		egiga1 {
+			phy_addr = <0x88>;
+			status = "ok";
+		};
 	};
 
 	gpio_keys {
diff --git a/arch/arm/boot/dts/kirkwood-mplcec4.dts b/arch/arm/boot/dts/kirkwood-mplcec4.dts
index 662dfd8..33130d1 100644
--- a/arch/arm/boot/dts/kirkwood-mplcec4.dts
+++ b/arch/arm/boot/dts/kirkwood-mplcec4.dts
@@ -140,6 +140,24 @@
 			cd-gpios = <&gpio1 15 0>;
 			/* No WP GPIO */
 		};
+
+		smi0: mdio at 72000 {
+			status = "ok";
+		};
+
+		smi1: mdio at 76000 {
+			status = "ok";
+		};
+
+		egiga0 {
+			phy_addr = <0x81>;
+			status = "ok";
+		};
+
+		egiga1 {
+			phy_addr = <0x82>;
+			status = "ok";
+		};
 	};
 
 	gpio-leds {
diff --git a/arch/arm/boot/dts/kirkwood-ns2-common.dtsi b/arch/arm/boot/dts/kirkwood-ns2-common.dtsi
index e8e7ece..0c54321 100644
--- a/arch/arm/boot/dts/kirkwood-ns2-common.dtsi
+++ b/arch/arm/boot/dts/kirkwood-ns2-common.dtsi
@@ -54,6 +54,15 @@
 				reg = <0x50>;
 			};
 		};
+
+		smi0: mdio at 72000 {
+			status = "ok";
+		};
+
+		egiga0 {
+			phy_addr = <0x88>;
+			status = "ok";
+		};
 	};
 
 	gpio_keys {
diff --git a/arch/arm/boot/dts/kirkwood-ns2lite.dts b/arch/arm/boot/dts/kirkwood-ns2lite.dts
index b02eb4e..e7cd611 100644
--- a/arch/arm/boot/dts/kirkwood-ns2lite.dts
+++ b/arch/arm/boot/dts/kirkwood-ns2lite.dts
@@ -16,6 +16,11 @@
 			status = "okay";
 			nr-ports = <1>;
 		};
+
+		egiga0 {
+			phy_addr = <0x80>;
+			status = "ok";
+		};
 	};
 
 	gpio-leds {
diff --git a/arch/arm/boot/dts/kirkwood-ns2mini.dts b/arch/arm/boot/dts/kirkwood-ns2mini.dts
index b79f5eb..700d308 100644
--- a/arch/arm/boot/dts/kirkwood-ns2mini.dts
+++ b/arch/arm/boot/dts/kirkwood-ns2mini.dts
@@ -16,6 +16,11 @@
 			status = "okay";
 			nr-ports = <1>;
 		};
+
+		egiga0 {
+			phy_addr = <0x80>;
+			status = "ok";
+		};
 	};
 
 	gpio_fan {
diff --git a/arch/arm/boot/dts/kirkwood-openblocks_a6.dts b/arch/arm/boot/dts/kirkwood-openblocks_a6.dts
index ede7fe0d..b179d43 100644
--- a/arch/arm/boot/dts/kirkwood-openblocks_a6.dts
+++ b/arch/arm/boot/dts/kirkwood-openblocks_a6.dts
@@ -191,6 +191,14 @@
 				marvell,function = "gpio";
 			};
 		};
+
+		smi0: mdio at 72000 {
+			status = "ok";
+		};
+
+		egiga0 {
+			status = "ok";
+		};
 	};
 
 	gpio-leds {
diff --git a/arch/arm/boot/dts/kirkwood-topkick.dts b/arch/arm/boot/dts/kirkwood-topkick.dts
index 131aae5..5c82f9d 100644
--- a/arch/arm/boot/dts/kirkwood-topkick.dts
+++ b/arch/arm/boot/dts/kirkwood-topkick.dts
@@ -156,6 +156,14 @@
 		i2c at 11000 {
 			status = "ok";
 		};
+
+		smi0: mdio at 72000 {
+			status = "ok";
+		};
+
+		egiga0 {
+			status = "ok";
+		};
 	};
 
 	gpio-leds {
diff --git a/arch/arm/boot/dts/kirkwood.dtsi b/arch/arm/boot/dts/kirkwood.dtsi
index 2c738d9..b13a405 100644
--- a/arch/arm/boot/dts/kirkwood.dtsi
+++ b/arch/arm/boot/dts/kirkwood.dtsi
@@ -201,5 +201,43 @@
 			clocks = <&gate_clk 4>;
 			status = "disabled";
 		};
+
+		smi0: mdio at 72000 {
+			compatible = "marvell,mdio-mv643xx";
+			reg = <0x72000 0x4000>;
+			interrupts = <46>;
+			tx_csum_limit = <1600>;
+			status = "disabled";
+		};
+
+		smi1: mdio at 76000 {
+			compatible = "marvell,mdio-mv643xx";
+			reg = <0x76000 0x4000>;
+			interrupts = <47>;
+			tx_csum_limit = <1600>;
+			status = "disabled";
+		};
+
+		egiga0 {
+			compatible = "marvell,mv643xx-eth";
+			reg = <0x72000 0x4000>;
+			mdio = <&smi0>;
+			port_number = <0>;
+			phy_addr = <0x80>;
+			interrupts = <11>;
+			clocks = <&gate_clk 0>;
+			status = "disabled";
+		};
+
+		egiga1 {
+			compatible = "marvell,mv643xx-eth";
+			reg = <0x76000 0x4000>;
+			mdio = <&smi1>;
+			port_number = <0>;
+			phy_addr = <0x81>;
+			interrupts = <15>;
+			clocks = <&gate_clk 19>;
+			status = "disabled";
+		};
 	};
 };
diff --git a/arch/arm/mach-kirkwood/Kconfig b/arch/arm/mach-kirkwood/Kconfig
index 432bee0..ac27a3d 100644
--- a/arch/arm/mach-kirkwood/Kconfig
+++ b/arch/arm/mach-kirkwood/Kconfig
@@ -48,6 +48,7 @@ config ARCH_KIRKWOOD_DT
 	bool "Marvell Kirkwood Flattened Device Tree"
 	select POWER_SUPPLY
 	select POWER_RESET
+	select POWER_RESET_RESTART
 	select POWER_RESET_GPIO
 	select REGULATOR
 	select REGULATOR_FIXED_VOLTAGE
@@ -58,19 +59,6 @@ config ARCH_KIRKWOOD_DT
 	  Say 'Y' here if you want your kernel to support the
 	  Marvell Kirkwood using flattened device tree.
 
-config MACH_DREAMPLUG_DT
-	bool "Marvell DreamPlug (Flattened Device Tree)"
-	select ARCH_KIRKWOOD_DT
-	help
-	  Say 'Y' here if you want your kernel to support the
-	  Marvell DreamPlug (Flattened Device Tree).
-
-config MACH_ICONNECT_DT
-	bool "Iomega Iconnect (Flattened Device Tree)"
-	select ARCH_KIRKWOOD_DT
-	help
-	  Say 'Y' here to enable Iomega Iconnect support.
-
 config MACH_DLINK_KIRKWOOD_DT
 	bool "D-Link Kirkwood-based NAS (Flattened Device Tree)"
 	select ARCH_KIRKWOOD_DT
@@ -79,14 +67,6 @@ config MACH_DLINK_KIRKWOOD_DT
 	  Kirkwood-based D-Link NASes such as DNS-320 & DNS-325,
 	  using Flattened Device Tree.
 
-config MACH_IB62X0_DT
-	bool "RaidSonic IB-NAS6210, IB-NAS6220 (Flattened Device Tree)"
-	select ARCH_KIRKWOOD_DT
-	help
-	  Say 'Y' here if you want your kernel to support the
-	  RaidSonic IB-NAS6210 & IB-NAS6220 devices, using
-	  Flattened Device Tree.
-
 config MACH_TS219_DT
 	bool "Device Tree for QNAP TS-11X, TS-21X NAS"
 	select ARCH_KIRKWOOD_DT
@@ -102,29 +82,6 @@ config MACH_TS219_DT
 	  or MV6282. If you have the wrong one, the buttons will not
 	  work.
 
-config MACH_DOCKSTAR_DT
-	bool "Seagate FreeAgent Dockstar (Flattened Device Tree)"
-	select ARCH_KIRKWOOD_DT
-	help
-	  Say 'Y' here if you want your kernel to support the
-	  Seagate FreeAgent Dockstar (Flattened Device Tree).
-
-config MACH_GOFLEXNET_DT
-	bool "Seagate GoFlex Net (Flattened Device Tree)"
-	select ARCH_KIRKWOOD_DT
-	help
-	  Say 'Y' here if you want your kernel to support the
-	  Seagate GoFlex Net (Flattened Device Tree).
-
-config MACH_LSXL_DT
-	bool "Buffalo Linkstation LS-XHL, LS-CHLv2 (Flattened Device Tree)"
-	select ARCH_KIRKWOOD_DT
-	select POWER_RESET_RESTART
-	help
-	  Say 'Y' here if you want your kernel to support the
-	  Buffalo Linkstation LS-XHL & LS-CHLv2 devices, using
-	  Flattened Device Tree.
-
 config MACH_IOMEGA_IX2_200_DT
 	bool "Iomega StorCenter ix2-200 (Flattened Device Tree)"
 	select ARCH_KIRKWOOD_DT
@@ -139,63 +96,6 @@ config MACH_KM_KIRKWOOD_DT
 	  Say 'Y' here if you want your kernel to support the
 	  Keymile Kirkwood Reference Desgin, using Flattened Device Tree.
 
-config MACH_INETSPACE_V2_DT
-	bool "LaCie Internet Space v2 NAS (Flattened Device Tree)"
-	select ARCH_KIRKWOOD_DT
-	help
-	  Say 'Y' here if you want your kernel to support the LaCie
-	  Internet Space v2 NAS, using Flattened Device Tree.
-
-config MACH_MPLCEC4_DT
-	bool "MPL CEC4 (Flattened Device Tree)"
-	select ARCH_KIRKWOOD_DT
-	help
-	  Say 'Y' here if you want your kernel to support the
-	  MPL CEC4 (Flattened Device Tree).
-
-config MACH_NETSPACE_V2_DT
-	bool "LaCie Network Space v2 NAS (Flattened Device Tree)"
-	select ARCH_KIRKWOOD_DT
-	help
-	  Say 'Y' here if you want your kernel to support the LaCie
-	  Network Space v2 NAS, using Flattened Device Tree.
-
-config MACH_NETSPACE_MAX_V2_DT
-	bool "LaCie Network Space Max v2 NAS (Flattened Device Tree)"
-	select ARCH_KIRKWOOD_DT
-	help
-	  Say 'Y' here if you want your kernel to support the LaCie
-	  Network Space Max v2 NAS, using Flattened Device Tree.
-
-config MACH_NETSPACE_LITE_V2_DT
-	bool "LaCie Network Space Lite v2 NAS (Flattened Device Tree)"
-	select ARCH_KIRKWOOD_DT
-	help
-	  Say 'Y' here if you want your kernel to support the LaCie
-	  Network Space Lite v2 NAS, using Flattened Device Tree.
-
-config MACH_NETSPACE_MINI_V2_DT
-	bool "LaCie Network Space Mini v2 NAS (Flattened Device Tree)"
-	select ARCH_KIRKWOOD_DT
-	help
-	  Say 'Y' here if you want your kernel to support the LaCie
-	  Network Space Mini v2 NAS (aka SafeBox), using Flattened
-	  Device Tree.
-
-config MACH_OPENBLOCKS_A6_DT
-	bool "Plat'Home OpenBlocks A6 (Flattened Device Tree)"
-	select ARCH_KIRKWOOD_DT
-	help
-	  Say 'Y' here if you want your kernel to support the
-	  Plat'Home OpenBlocks A6 (Flattened Device Tree).
-
-config MACH_TOPKICK_DT
-	bool "USI Topkick (Flattened Device Tree)"
-	select ARCH_KIRKWOOD_DT
-	help
-	  Say 'Y' here if you want your kernel to support the
-	  USI Topkick, using Flattened Device Tree
-
 config MACH_TS219
 	bool "QNAP TS-110, TS-119, TS-119P+, TS-210, TS-219, TS-219P and TS-219P+ Turbo NAS"
 	help
diff --git a/arch/arm/mach-kirkwood/Makefile b/arch/arm/mach-kirkwood/Makefile
index ee3aa77..ab739b0 100644
--- a/arch/arm/mach-kirkwood/Makefile
+++ b/arch/arm/mach-kirkwood/Makefile
@@ -20,21 +20,7 @@ obj-$(CONFIG_MACH_NET5BIG_V2)		+= netxbig_v2-setup.o lacie_v2-common.o
 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_ICONNECT_DT)		+= board-iconnect.o
 obj-$(CONFIG_MACH_DLINK_KIRKWOOD_DT)	+= board-dnskw.o
-obj-$(CONFIG_MACH_IB62X0_DT)		+= board-ib62x0.o
 obj-$(CONFIG_MACH_TS219_DT)		+= board-ts219.o tsx1x-common.o
-obj-$(CONFIG_MACH_DOCKSTAR_DT)		+= board-dockstar.o
-obj-$(CONFIG_MACH_GOFLEXNET_DT)		+= board-goflexnet.o
-obj-$(CONFIG_MACH_LSXL_DT)		+= board-lsxl.o
 obj-$(CONFIG_MACH_IOMEGA_IX2_200_DT)	+= board-iomega_ix2_200.o
 obj-$(CONFIG_MACH_KM_KIRKWOOD_DT)	+= board-km_kirkwood.o
-obj-$(CONFIG_MACH_INETSPACE_V2_DT)	+= board-ns2.o
-obj-$(CONFIG_MACH_MPLCEC4_DT)		+= board-mplcec4.o
-obj-$(CONFIG_MACH_NETSPACE_V2_DT)	+= board-ns2.o
-obj-$(CONFIG_MACH_NETSPACE_MAX_V2_DT)	+= board-ns2.o
-obj-$(CONFIG_MACH_NETSPACE_LITE_V2_DT)	+= board-ns2.o
-obj-$(CONFIG_MACH_NETSPACE_MINI_V2_DT)	+= board-ns2.o
-obj-$(CONFIG_MACH_OPENBLOCKS_A6_DT)	+= board-openblocks_a6.o
-obj-$(CONFIG_MACH_TOPKICK_DT)		+= board-usi_topkick.o
diff --git a/arch/arm/mach-kirkwood/board-dnskw.c b/arch/arm/mach-kirkwood/board-dnskw.c
index a1aa87f..2af7a95 100644
--- a/arch/arm/mach-kirkwood/board-dnskw.c
+++ b/arch/arm/mach-kirkwood/board-dnskw.c
@@ -14,14 +14,9 @@
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/platform_device.h>
-#include <linux/mv643xx_eth.h>
 #include <linux/gpio.h>
 #include "common.h"
 
-static struct mv643xx_eth_platform_data dnskw_ge00_data = {
-	.phy_addr	= MV643XX_ETH_PHY_ADDR(8),
-};
-
 /* Register any GPIO for output and set the value */
 static void __init dnskw_gpio_register(unsigned gpio, char *name, int def)
 {
@@ -36,8 +31,6 @@ static void __init dnskw_gpio_register(unsigned gpio, char *name, int def)
 
 void __init dnskw_init(void)
 {
-	kirkwood_ge00_init(&dnskw_ge00_data);
-
 	/* Set NAS to turn back on after a power failure */
 	dnskw_gpio_register(37, "dnskw:power:recover", 1);
 }
diff --git a/arch/arm/mach-kirkwood/board-dockstar.c b/arch/arm/mach-kirkwood/board-dockstar.c
deleted file mode 100644
index d7196db..0000000
--- a/arch/arm/mach-kirkwood/board-dockstar.c
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * arch/arm/mach-kirkwood/board-dockstar.c
- *
- * Seagate FreeAgent Dockstar 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.
- *
- * Copied and modified for Seagate GoFlex Net support by
- * Joshua Coombs <josh.coombs@gmail.com> based on ArchLinux ARM's
- * GoFlex kernel patches.
- *
- */
-
-#include <linux/kernel.h>
-#include <linux/init.h>
-#include <linux/mv643xx_eth.h>
-#include "common.h"
-
-static struct mv643xx_eth_platform_data dockstar_ge00_data = {
-	.phy_addr	= MV643XX_ETH_PHY_ADDR(0),
-};
-
-void __init dockstar_dt_init(void)
-{
-	/*
-	 * Basic setup. Needs to be called early.
-	 */
-	kirkwood_ge00_init(&dockstar_ge00_data);
-}
diff --git a/arch/arm/mach-kirkwood/board-dreamplug.c b/arch/arm/mach-kirkwood/board-dreamplug.c
deleted file mode 100644
index 0903242..0000000
--- a/arch/arm/mach-kirkwood/board-dreamplug.c
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright 2012 (C), Jason Cooper <jason@lakedaemon.net>
- *
- * arch/arm/mach-kirkwood/board-dreamplug.c
- *
- * Marvell DreamPlug 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 <linux/gpio.h>
-#include "common.h"
-
-static struct mv643xx_eth_platform_data dreamplug_ge00_data = {
-	.phy_addr	= MV643XX_ETH_PHY_ADDR(0),
-};
-
-static struct mv643xx_eth_platform_data dreamplug_ge01_data = {
-	.phy_addr	= MV643XX_ETH_PHY_ADDR(1),
-};
-
-void __init dreamplug_init(void)
-{
-	/*
-	 * Basic setup. Needs to be called early.
-	 */
-	kirkwood_ge00_init(&dreamplug_ge00_data);
-	kirkwood_ge01_init(&dreamplug_ge01_data);
-}
diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c
index 73b76e4..edb1215 100644
--- a/arch/arm/mach-kirkwood/board-dt.c
+++ b/arch/arm/mach-kirkwood/board-dt.c
@@ -118,52 +118,18 @@ static void __init kirkwood_dt_init(void)
 	kexec_reinit = kirkwood_enable_pcie;
 #endif
 
-	if (of_machine_is_compatible("globalscale,dreamplug"))
-		dreamplug_init();
-
 	if (of_machine_is_compatible("dlink,dns-kirkwood"))
 		dnskw_init();
 
-	if (of_machine_is_compatible("iom,iconnect"))
-		iconnect_init();
-
-	if (of_machine_is_compatible("raidsonic,ib-nas62x0"))
-		ib62x0_init();
-
 	if (of_machine_is_compatible("qnap,ts219"))
 		qnap_dt_ts219_init();
 
-	if (of_machine_is_compatible("seagate,dockstar"))
-		dockstar_dt_init();
-
-	if (of_machine_is_compatible("seagate,goflexnet"))
-		goflexnet_init();
-
-	if (of_machine_is_compatible("buffalo,lsxl"))
-		lsxl_init();
-
 	if (of_machine_is_compatible("iom,ix2-200"))
 		iomega_ix2_200_init();
 
 	if (of_machine_is_compatible("keymile,km_kirkwood"))
 		km_kirkwood_init();
 
-	if (of_machine_is_compatible("lacie,inetspace_v2") ||
-	    of_machine_is_compatible("lacie,netspace_v2") ||
-	    of_machine_is_compatible("lacie,netspace_max_v2") ||
-	    of_machine_is_compatible("lacie,netspace_lite_v2") ||
-	    of_machine_is_compatible("lacie,netspace_mini_v2"))
-		ns2_init();
-
-	if (of_machine_is_compatible("mpl,cec4"))
-		mplcec4_init();
-
-	if (of_machine_is_compatible("plathome,openblocks-a6"))
-		openblocks_a6_init();
-
-	if (of_machine_is_compatible("usi,topkick"))
-		usi_topkick_init();
-
 	of_platform_populate(NULL, kirkwood_dt_match_table, NULL, NULL);
 }
 
diff --git a/arch/arm/mach-kirkwood/board-goflexnet.c b/arch/arm/mach-kirkwood/board-goflexnet.c
deleted file mode 100644
index 9db979a..0000000
--- a/arch/arm/mach-kirkwood/board-goflexnet.c
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright 2012 (C), Jason Cooper <jason@lakedaemon.net>
- *
- * arch/arm/mach-kirkwood/board-goflexnet.c
- *
- * Seagate GoFlext Net 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.
- *
- * Copied and modified for Seagate GoFlex Net support by
- * Joshua Coombs <josh.coombs@gmail.com> based on ArchLinux ARM's
- * GoFlex kernel patches.
- *
- */
-
-#include <linux/kernel.h>
-#include <linux/init.h>
-#include <linux/mv643xx_eth.h>
-#include "common.h"
-
-static struct mv643xx_eth_platform_data goflexnet_ge00_data = {
-	.phy_addr	= MV643XX_ETH_PHY_ADDR(0),
-};
-
-void __init goflexnet_init(void)
-{
-	/*
-	 * Basic setup. Needs to be called early.
-	 */
-	kirkwood_ge00_init(&goflexnet_ge00_data);
-}
diff --git a/arch/arm/mach-kirkwood/board-ib62x0.c b/arch/arm/mach-kirkwood/board-ib62x0.c
deleted file mode 100644
index 9a857ae..0000000
--- a/arch/arm/mach-kirkwood/board-ib62x0.c
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Copyright 2012 (C), Simon Baatz <gmbnomis@gmail.com>
- *
- * arch/arm/mach-kirkwood/board-ib62x0.c
- *
- * RaidSonic ICY BOX IB-NAS6210 & IB-NAS6220 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 ib62x0_ge00_data = {
-	.phy_addr	= MV643XX_ETH_PHY_ADDR(8),
-};
-
-void __init ib62x0_init(void)
-{
-	/*
-	 * Basic setup. Needs to be called early.
-	 */
-	kirkwood_ge00_init(&ib62x0_ge00_data);
-}
diff --git a/arch/arm/mach-kirkwood/board-iconnect.c b/arch/arm/mach-kirkwood/board-iconnect.c
deleted file mode 100644
index ff042dc..0000000
--- a/arch/arm/mach-kirkwood/board-iconnect.c
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * arch/arm/mach-kirkwood/board-iconnect.c
- *
- * Iomega i-connect Board Setup
- *
- * 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 iconnect_ge00_data = {
-	.phy_addr	= MV643XX_ETH_PHY_ADDR(11),
-};
-
-void __init iconnect_init(void)
-{
-	kirkwood_ge00_init(&iconnect_ge00_data);
-}
diff --git a/arch/arm/mach-kirkwood/board-km_kirkwood.c b/arch/arm/mach-kirkwood/board-km_kirkwood.c
index 44e4605..6b8464b 100644
--- a/arch/arm/mach-kirkwood/board-km_kirkwood.c
+++ b/arch/arm/mach-kirkwood/board-km_kirkwood.c
@@ -14,15 +14,10 @@
 
 #include <linux/kernel.h>
 #include <linux/init.h>
-#include <linux/mv643xx_eth.h>
 #include <linux/clk.h>
 #include <linux/clk-private.h>
 #include "common.h"
 
-static struct mv643xx_eth_platform_data km_kirkwood_ge00_data = {
-	.phy_addr	= MV643XX_ETH_PHY_ADDR(0),
-};
-
 void __init km_kirkwood_init(void)
 {
 	struct clk *sata_clk;
@@ -39,6 +34,4 @@ void __init km_kirkwood_init(void)
 	sata_clk = clk_get_sys("sata_mv.0", "1");
 	if (!IS_ERR(sata_clk))
 		sata_clk->flags |= CLK_IGNORE_UNUSED;
-
-	kirkwood_ge00_init(&km_kirkwood_ge00_data);
 }
diff --git a/arch/arm/mach-kirkwood/board-lsxl.c b/arch/arm/mach-kirkwood/board-lsxl.c
deleted file mode 100644
index 3483952..0000000
--- a/arch/arm/mach-kirkwood/board-lsxl.c
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright 2012 (C), Michael Walle <michael@walle.cc>
- *
- * arch/arm/mach-kirkwood/board-lsxl.c
- *
- * Buffalo Linkstation LS-XHL and LS-CHLv2 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/platform_device.h>
-#include <linux/mv643xx_eth.h>
-#include "common.h"
-
-static struct mv643xx_eth_platform_data lsxl_ge00_data = {
-	.phy_addr	= MV643XX_ETH_PHY_ADDR(0),
-};
-
-static struct mv643xx_eth_platform_data lsxl_ge01_data = {
-	.phy_addr	= MV643XX_ETH_PHY_ADDR(8),
-};
-
-void __init lsxl_init(void)
-{
-	/*
-	 * Basic setup. Needs to be called early.
-	 */
-
-	kirkwood_ge00_init(&lsxl_ge00_data);
-	kirkwood_ge01_init(&lsxl_ge01_data);
-}
diff --git a/arch/arm/mach-kirkwood/board-mplcec4.c b/arch/arm/mach-kirkwood/board-mplcec4.c
deleted file mode 100644
index 938712e..0000000
--- a/arch/arm/mach-kirkwood/board-mplcec4.c
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright (C) 2012 MPL AG, Switzerland
- * Stefan Peter <s.peter@mpl.ch>
- *
- * arch/arm/mach-kirkwood/board-mplcec4.c
- *
- * 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 mplcec4_ge00_data = {
-	.phy_addr	= MV643XX_ETH_PHY_ADDR(1),
-};
-
-static struct mv643xx_eth_platform_data mplcec4_ge01_data = {
-	.phy_addr	= MV643XX_ETH_PHY_ADDR(2),
-};
-
-void __init mplcec4_init(void)
-{
-	/*
-	 * Basic setup. Needs to be called early.
-	 */
-	kirkwood_ge00_init(&mplcec4_ge00_data);
-	kirkwood_ge01_init(&mplcec4_ge01_data);
-}
-
-
-
diff --git a/arch/arm/mach-kirkwood/board-ns2.c b/arch/arm/mach-kirkwood/board-ns2.c
deleted file mode 100644
index f2ea3b7..0000000
--- a/arch/arm/mach-kirkwood/board-ns2.c
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright 2012 (C), Simon Guinot <simon.guinot@sequanux.org>
- *
- * arch/arm/mach-kirkwood/board-ns2.c
- *
- * LaCie Network Space v2 board (and parents) initialization 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/platform_device.h>
-#include <linux/mv643xx_eth.h>
-#include <linux/of.h>
-#include "common.h"
-
-static struct mv643xx_eth_platform_data ns2_ge00_data = {
-	.phy_addr	= MV643XX_ETH_PHY_ADDR(8),
-};
-
-void __init ns2_init(void)
-{
-	/*
-	 * Basic setup. Needs to be called early.
-	 */
-	if (of_machine_is_compatible("lacie,netspace_lite_v2") ||
-	    of_machine_is_compatible("lacie,netspace_mini_v2"))
-		ns2_ge00_data.phy_addr = MV643XX_ETH_PHY_ADDR(0);
-	kirkwood_ge00_init(&ns2_ge00_data);
-}
diff --git a/arch/arm/mach-kirkwood/board-openblocks_a6.c b/arch/arm/mach-kirkwood/board-openblocks_a6.c
deleted file mode 100644
index b11d8fd..0000000
--- a/arch/arm/mach-kirkwood/board-openblocks_a6.c
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Copyright 2012 Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
- *
- * arch/arm/mach-kirkwood/board-openblocks_a6.c
- *
- * 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 openblocks_ge00_data = {
-	.phy_addr	= MV643XX_ETH_PHY_ADDR(0),
-};
-
-void __init openblocks_a6_init(void)
-{
-	/*
-	 * Basic setup. Needs to be called early.
-	 */
-	kirkwood_ge00_init(&openblocks_ge00_data);
-}
diff --git a/arch/arm/mach-kirkwood/board-usi_topkick.c b/arch/arm/mach-kirkwood/board-usi_topkick.c
deleted file mode 100644
index 1cc04ec..0000000
--- a/arch/arm/mach-kirkwood/board-usi_topkick.c
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Copyright 2012 (C), Jason Cooper <jason@lakedaemon.net>
- *
- * arch/arm/mach-kirkwood/board-usi_topkick.c
- *
- * USI Topkick 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 <linux/gpio.h>
-#include "common.h"
-
-static struct mv643xx_eth_platform_data topkick_ge00_data = {
-	.phy_addr	= MV643XX_ETH_PHY_ADDR(0),
-};
-
-void __init usi_topkick_init(void)
-{
-	/*
-	 * Basic setup. Needs to be called early.
-	 */
-	kirkwood_ge00_init(&topkick_ge00_data);
-}
diff --git a/arch/arm/mach-kirkwood/common.h b/arch/arm/mach-kirkwood/common.h
index 1c42cb8..ba6eb9c 100644
--- a/arch/arm/mach-kirkwood/common.h
+++ b/arch/arm/mach-kirkwood/common.h
@@ -55,11 +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_DREAMPLUG_DT
-void dreamplug_init(void);
-#else
-static inline void dreamplug_init(void) {};
-#endif
 #ifdef CONFIG_MACH_TS219_DT
 void qnap_dt_ts219_init(void);
 #else
@@ -72,36 +67,6 @@ void dnskw_init(void);
 static inline void dnskw_init(void) {};
 #endif
 
-#ifdef CONFIG_MACH_ICONNECT_DT
-void iconnect_init(void);
-#else
-static inline void iconnect_init(void) {};
-#endif
-
-#ifdef CONFIG_MACH_IB62X0_DT
-void ib62x0_init(void);
-#else
-static inline void ib62x0_init(void) {};
-#endif
-
-#ifdef CONFIG_MACH_DOCKSTAR_DT
-void dockstar_dt_init(void);
-#else
-static inline void dockstar_dt_init(void) {};
-#endif
-
-#ifdef CONFIG_MACH_GOFLEXNET_DT
-void goflexnet_init(void);
-#else
-static inline void goflexnet_init(void) {};
-#endif
-
-#ifdef CONFIG_MACH_LSXL_DT
-void lsxl_init(void);
-#else
-static inline void lsxl_init(void) {};
-#endif
-
 #ifdef CONFIG_MACH_IOMEGA_IX2_200_DT
 void iomega_ix2_200_init(void);
 #else
@@ -114,34 +79,6 @@ void km_kirkwood_init(void);
 static inline void km_kirkwood_init(void) {};
 #endif
 
-#ifdef CONFIG_MACH_MPLCEC4_DT
-void mplcec4_init(void);
-#else
-static inline void mplcec4_init(void) {};
-#endif
-
-#if defined(CONFIG_MACH_INETSPACE_V2_DT) || \
-	defined(CONFIG_MACH_NETSPACE_V2_DT) || \
-	defined(CONFIG_MACH_NETSPACE_MAX_V2_DT) || \
-	defined(CONFIG_MACH_NETSPACE_LITE_V2_DT) || \
-	defined(CONFIG_MACH_NETSPACE_MINI_V2_DT)
-void ns2_init(void);
-#else
-static inline void ns2_init(void) {};
-#endif
-
-#ifdef CONFIG_MACH_OPENBLOCKS_A6_DT
-void openblocks_a6_init(void);
-#else
-static inline void openblocks_a6_init(void) {};
-#endif
-
-#ifdef CONFIG_MACH_TOPKICK_DT
-void usi_topkick_init(void);
-#else
-static inline void usi_topkick_init(void) {};
-#endif
-
 /* early init functions not converted to fdt yet */
 char *kirkwood_id(void);
 void kirkwood_l2_init(void);
-- 
1.8.1.1

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

* [PATCH V4 11/11] ARM: Kirkwood: Convert QNAP TS219 Ethernet to DT.
  2013-01-26 20:50 ` [PATCH V4 0/8] ARM: kirkwood: cleanup DT conversion Jason Cooper
                     ` (9 preceding siblings ...)
  2013-01-26 20:50   ` [PATCH V4 10/11] ARM: kirkwood: mv643xx_eth dt conversion Jason Cooper
@ 2013-01-26 20:50   ` Jason Cooper
  10 siblings, 0 replies; 102+ messages in thread
From: Jason Cooper @ 2013-01-26 20:50 UTC (permalink / raw)
  To: linux-arm-kernel

From: Andrew Lunn <andrew@lunn.ch>

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>
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
---
 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 ac27a3d..aa10096 100644
--- a/arch/arm/mach-kirkwood/Kconfig
+++ b/arch/arm/mach-kirkwood/Kconfig
@@ -46,10 +46,12 @@ 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_RESTART
 	select POWER_RESET_GPIO
+	select POWER_RESET_QNAP
 	select REGULATOR
 	select REGULATOR_FIXED_VOLTAGE
 	select MVEBU_CLK_CORE
@@ -67,21 +69,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.8.1.1

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

* [PATCH V3 8/8] ARM: kirkwood: mv643xx_eth dt conversion
  2013-01-26 13:40         ` Andrew Lunn
  2013-01-26 13:46           ` Sebastian Hesselbarth
  2013-01-26 15:42           ` Jason Cooper
@ 2013-01-27 12:21           ` Russell King - ARM Linux
  2013-01-27 13:10             ` Sebastian Hesselbarth
  2 siblings, 1 reply; 102+ messages in thread
From: Russell King - ARM Linux @ 2013-01-27 12:21 UTC (permalink / raw)
  To: linux-arm-kernel

On Sat, Jan 26, 2013 at 02:40:12PM +0100, Andrew Lunn wrote:
> On Sat, Jan 26, 2013 at 01:50:11PM +0100, Sebastian Hesselbarth wrote:
> The code here is based on dove_legacy_clk_init(). However the change
> made by Jason is in order to make a DT device work, not an non-DT
> device.
> 
> The problem is the way the driver is getting the clock.
> 
> 	mp->clk = clk_get(&pdev->dev, (pdev->id ? "1" : "0"));
> 
> clk_get() then calls
> 
>                 clk = of_clk_get_by_name(dev->of_node, con_id);
> 
>  * of_clk_get_by_name() - Parse and lookup a clock referenced by a device node
>  * @np: pointer to clock consumer node
>  * @name: name of consumer's clock input, or NULL for the first clock reference
> 
> So it is looking for a clock called "0" or "1" in the node. This does
> not exist, and so it falls. Jason's change then comes into affect and
> it finds the clkdev entries added above.

This is just bollocks.  Sorry, but it is.  Yet again, people misunderstand
the clk API...

Look, the clk API is very simple, as it also is when using clkdev or OF.
Stop naming your bloody clocks individually - whenever anyone does that
it all breaks.

The API is designed to work as follows:

FIRST argument to clk_get() is the struct device.  This _SHOULD_ be used
to determine the clock or set of clocks which the device is going to use.
In other words, it is the PRIMARY key in the lookup.

SECOND argument to clk_get() identifies the CONNECTION ON THE DEVICE
passed as the first argument.  To make this point, if the device only
ever has one clock connection, convention is to pass NULL to ensure that
people do _not_ think that they can use global clock names.

So, the whole:

	mp->clk = clk_get(&pdev->dev, (pdev->id ? "1" : "0"));

is absolutely ludicrous.  You already know which device it is by means of
the first argument.  You don't need to pass a "0" or a "1".  So that should
be NULL, so:

	mp->clk = clk_get(&pdev->dev, NULL);

That will get a clock from clkdev which is setup in the _matching_ tables
to correlate with the device (and a NULL connection ID _there_ too).  With
OF, I believe it will get the first clock.

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

* [PATCH V3 8/8] ARM: kirkwood: mv643xx_eth dt conversion
  2013-01-27 12:21           ` Russell King - ARM Linux
@ 2013-01-27 13:10             ` Sebastian Hesselbarth
  2013-01-27 18:38               ` Russell King - ARM Linux
  0 siblings, 1 reply; 102+ messages in thread
From: Sebastian Hesselbarth @ 2013-01-27 13:10 UTC (permalink / raw)
  To: linux-arm-kernel

On 01/27/2013 01:21 PM, Russell King - ARM Linux wrote:
> On Sat, Jan 26, 2013 at 02:40:12PM +0100, Andrew Lunn wrote:
>> On Sat, Jan 26, 2013 at 01:50:11PM +0100, Sebastian Hesselbarth wrote:
>> The code here is based on dove_legacy_clk_init(). However the change
>> made by Jason is in order to make a DT device work, not an non-DT
>> device.
>>
>> The problem is the way the driver is getting the clock.
>>
>> 	mp->clk = clk_get(&pdev->dev, (pdev->id ? "1" : "0"));
>>
 > ...
> So, the whole:
>
> 	mp->clk = clk_get(&pdev->dev, (pdev->id ? "1" : "0"));
>
> is absolutely ludicrous.  You already know which device it is by means of
> the first argument.  You don't need to pass a "0" or a "1".  So that should
> be NULL, so:
>
> 	mp->clk = clk_get(&pdev->dev, NULL);
>
> That will get a clock from clkdev which is setup in the _matching_ tables
> to correlate with the device (and a NULL connection ID _there_ too).  With
> OF, I believe it will get the first clock.

The conid was set for mv643xx but shouldn't be set anymore - check
mach-kirkwood/common.c. From what I can tell, powerpc isn't using
common clock at all and orion5x/mv78x00 don't have any clock gates.

I guess we can just remove the conid check and rely on DT passed
clock only.

Sebastian

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

* [PATCH V4 10/11] ARM: kirkwood: mv643xx_eth dt conversion
  2013-01-26 20:50   ` [PATCH V4 10/11] ARM: kirkwood: mv643xx_eth dt conversion Jason Cooper
@ 2013-01-27 13:41     ` Sebastian Hesselbarth
  2013-01-27 15:35       ` Jason Cooper
  0 siblings, 1 reply; 102+ messages in thread
From: Sebastian Hesselbarth @ 2013-01-27 13:41 UTC (permalink / raw)
  To: linux-arm-kernel

On 01/26/2013 09:50 PM, Jason Cooper wrote:
> Tested on the dreamplug:
>
> mv643xx_eth: MV-643xx 10/100/1000 ethernet driver version 1.4
> libphy: mv643xx_eth smi: probed
> libphy: mv643xx_eth smi: probed
> mv643xx_eth_port f1072000.egiga0 eth0: port 0 with MAC address XX:XX:XX...
> mv643xx_eth_port f1076000.egiga1 eth1: port 0 with MAC address XX:XX:XX...
>
> Successfully pulled an ip address and pinged through the interface
>
> ...
>
> diff --git a/arch/arm/boot/dts/kirkwood.dtsi b/arch/arm/boot/dts/kirkwood.dtsi
> index 2c738d9..b13a405 100644
> --- a/arch/arm/boot/dts/kirkwood.dtsi
> +++ b/arch/arm/boot/dts/kirkwood.dtsi
> @@ -201,5 +201,43 @@
>   			clocks =<&gate_clk 4>;
>   			status = "disabled";
>   		};
> +
> +		smi0: mdio at 72000 {
> +			compatible = "marvell,mdio-mv643xx";
> +			reg =<0x72000 0x4000>;
> +			interrupts =<46>;
> +			tx_csum_limit =<1600>;
> +			status = "disabled";
> +		};
> +
> +		smi1: mdio at 76000 {
> +			compatible = "marvell,mdio-mv643xx";
> +			reg =<0x76000 0x4000>;
> +			interrupts =<47>;
> +			tx_csum_limit =<1600>;
> +			status = "disabled";
> +		};
> +
> +		egiga0 {
> +			compatible = "marvell,mv643xx-eth";
> +			reg =<0x72000 0x4000>;
> +			mdio =<&smi0>;
> +			port_number =<0>;
> +			phy_addr =<0x80>;

Jason,

This will break phy_scan on all kirkwood boards as 0x80 is _not_ equal
MV643XX_ETH_PHY_ADDR_DEFAULT.

I suggest not to set phy_addr in kirkwood.dtsi at all and let the
board specific DT files set the phy addresses (or rely on phy_scan if not
set).

Also, you are ORing the address passed by phy_addr with 0x80 anyway. So
all phy addresses should be passed as <0> or <1> instead the ORed ones.

Sebastian

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

* [PATCH] NET: mv643xx: get smi clock from device tree
  2013-01-26 20:50   ` [PATCH V4 09/11] NET: mv643xx: Get clk from device tree Jason Cooper
@ 2013-01-27 14:27     ` Sebastian Hesselbarth
  0 siblings, 0 replies; 102+ messages in thread
From: Sebastian Hesselbarth @ 2013-01-27 14:27 UTC (permalink / raw)
  To: linux-arm-kernel

mv643xx_eth is split up into core (ethernet) and smi (mdio) driver
parts. If clock gates are introduced as for Kirkwood and Dove SoCs,
smi registers are accessed with clock gated and cause the SoC to
hang.

This patch also gets and enables a clock passed from DT for the
shared smi part of the driver. It has been tested on Dove and also
allows the driver compiled and used as a module.

DT conversion patches for mv643xx_eth on Dove will be sent on another
patch set.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
---
Cc: Jason Cooper <jason@lakedaemon.net>
Cc: Andrew Lunn <andrew@lunn.ch>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Olof Johansson <olof@lixom.net>
Cc: Simon Baatz <gmbnomis@gmail.com>
Cc: linux-arm-kernel at lists.infradead.org
---
 drivers/net/ethernet/marvell/mv643xx_eth.c |   21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/drivers/net/ethernet/marvell/mv643xx_eth.c b/drivers/net/ethernet/marvell/mv643xx_eth.c
index 67e5d86..c0f0671 100644
--- a/drivers/net/ethernet/marvell/mv643xx_eth.c
+++ b/drivers/net/ethernet/marvell/mv643xx_eth.c
@@ -296,6 +296,9 @@ struct mv643xx_eth_shared_private {
 	int extended_rx_coal_limit;
 	int tx_bw_control;
 	int tx_csum_limit;
+#if defined(CONFIG_HAVE_CLK)
+	struct clk *clk;
+#endif
 
 };
 
@@ -2626,6 +2629,12 @@ static int mv643xx_eth_shared_probe(struct platform_device *pdev)
 		of_property_read_u32(pdev->dev.of_node,
 			"tx_csum_limit", &pd->tx_csum_limit);
 
+#if defined(CONFIG_HAVE_CLK)
+		msp->clk = of_clk_get(pdev->dev.of_node, 0);
+		if (!IS_ERR(msp->clk))
+			clk_prepare_enable(msp->clk);
+#endif
+
 		np = of_parse_phandle(pdev->dev.of_node, "shared_smi", 0);
 		if (np)
 			pd->shared_smi = of_find_device_by_node(np);
@@ -2695,6 +2704,12 @@ static int mv643xx_eth_shared_probe(struct platform_device *pdev)
 out_free_mii_bus:
 	mdiobus_free(msp->smi_bus);
 out_unmap:
+#if defined(CONFIG_HAVE_CLK)
+	if (!IS_ERR(msp->clk)) {
+		clk_disable_unprepare(msp->clk);
+		clk_put(msp->clk);
+	}
+#endif
 	iounmap(msp->base);
 out_free:
 	kfree(msp);
@@ -2713,6 +2728,12 @@ static int mv643xx_eth_shared_remove(struct platform_device *pdev)
 	}
 	if (msp->err_interrupt != NO_IRQ)
 		free_irq(msp->err_interrupt, msp);
+#if defined(CONFIG_HAVE_CLK)
+	if (!IS_ERR(msp->clk)) {
+		clk_disable_unprepare(msp->clk);
+		clk_put(msp->clk);
+	}
+#endif
 	iounmap(msp->base);
 	kfree(msp);
 
-- 
1.7.10.4

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

* [RFC V2 PATCH 3/8] ARM: kirkwood: nsa310: cleanup includes and unneeded code
  2013-01-26 20:22       ` Jason Cooper
@ 2013-01-27 15:04         ` Sergei Shtylyov
  2013-01-27 15:26           ` Jason Cooper
  0 siblings, 1 reply; 102+ messages in thread
From: Sergei Shtylyov @ 2013-01-27 15:04 UTC (permalink / raw)
  To: linux-arm-kernel

Hello.

On 27-01-2013 0:22, Jason Cooper wrote:

>>> Signed-off-by: Jason Cooper <jason@lakedaemon.net>
>>> ---
>>>   arch/arm/mach-kirkwood/board-nsa310.c | 9 +--------
>>>   1 file changed, 1 insertion(+), 8 deletions(-)

>>> diff --git a/arch/arm/mach-kirkwood/board-nsa310.c b/arch/arm/mach-kirkwood/board-nsa310.c
>>> index 1bd328d..0b99533 100644
>>> --- a/arch/arm/mach-kirkwood/board-nsa310.c
>>> +++ b/arch/arm/mach-kirkwood/board-nsa310.c
>>> @@ -10,11 +10,8 @@
>>>
>>>   #include <linux/kernel.h>
>>>   #include <linux/init.h>
>>> -#include <linux/i2c.h>
>>> -
>>> -#include <asm/mach-types.h>
>>> -#include <asm/mach/arch.h>
>>>   #include <mach/kirkwood.h>
>>> +#include <linux/of.h>

>>     You also add an #include and don't mention it anywhere. Or is
>> that part of the cleanup?

> After removing the unneeded linux/i2c.h, linux/of.h was needed for
> of_machine_is_compatible().  i2c.h had included of.h.

    Would be worth mentioning it in the changelog.

> thanks for the review,

> Jason.

WBR, Sergei

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

* [RFC V2 PATCH 3/8] ARM: kirkwood: nsa310: cleanup includes and unneeded code
  2013-01-27 15:04         ` Sergei Shtylyov
@ 2013-01-27 15:26           ` Jason Cooper
  0 siblings, 0 replies; 102+ messages in thread
From: Jason Cooper @ 2013-01-27 15:26 UTC (permalink / raw)
  To: linux-arm-kernel

On Sun, Jan 27, 2013 at 07:04:57PM +0400, Sergei Shtylyov wrote:
> Hello.
> 
> On 27-01-2013 0:22, Jason Cooper wrote:
> 
> >>>Signed-off-by: Jason Cooper <jason@lakedaemon.net>
> >>>---
> >>>  arch/arm/mach-kirkwood/board-nsa310.c | 9 +--------
> >>>  1 file changed, 1 insertion(+), 8 deletions(-)
> 
> >>>diff --git a/arch/arm/mach-kirkwood/board-nsa310.c b/arch/arm/mach-kirkwood/board-nsa310.c
> >>>index 1bd328d..0b99533 100644
> >>>--- a/arch/arm/mach-kirkwood/board-nsa310.c
> >>>+++ b/arch/arm/mach-kirkwood/board-nsa310.c
> >>>@@ -10,11 +10,8 @@
> >>>
> >>>  #include <linux/kernel.h>
> >>>  #include <linux/init.h>
> >>>-#include <linux/i2c.h>
> >>>-
> >>>-#include <asm/mach-types.h>
> >>>-#include <asm/mach/arch.h>
> >>>  #include <mach/kirkwood.h>
> >>>+#include <linux/of.h>
> 
> >>    You also add an #include and don't mention it anywhere. Or is
> >>that part of the cleanup?
> 
> >After removing the unneeded linux/i2c.h, linux/of.h was needed for
> >of_machine_is_compatible().  i2c.h had included of.h.
> 
>    Would be worth mentioning it in the changelog.

Ok, I'll add it when I pull it in.

thx,

Jason.

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

* [PATCH V4 10/11] ARM: kirkwood: mv643xx_eth dt conversion
  2013-01-27 13:41     ` Sebastian Hesselbarth
@ 2013-01-27 15:35       ` Jason Cooper
  0 siblings, 0 replies; 102+ messages in thread
From: Jason Cooper @ 2013-01-27 15:35 UTC (permalink / raw)
  To: linux-arm-kernel

On Sun, Jan 27, 2013 at 02:41:00PM +0100, Sebastian Hesselbarth wrote:
> On 01/26/2013 09:50 PM, Jason Cooper wrote:
> >Tested on the dreamplug:
> >
> >mv643xx_eth: MV-643xx 10/100/1000 ethernet driver version 1.4
> >libphy: mv643xx_eth smi: probed
> >libphy: mv643xx_eth smi: probed
> >mv643xx_eth_port f1072000.egiga0 eth0: port 0 with MAC address XX:XX:XX...
> >mv643xx_eth_port f1076000.egiga1 eth1: port 0 with MAC address XX:XX:XX...
> >
> >Successfully pulled an ip address and pinged through the interface
> >
> >...
> >
> >diff --git a/arch/arm/boot/dts/kirkwood.dtsi b/arch/arm/boot/dts/kirkwood.dtsi
> >index 2c738d9..b13a405 100644
> >--- a/arch/arm/boot/dts/kirkwood.dtsi
> >+++ b/arch/arm/boot/dts/kirkwood.dtsi
> >@@ -201,5 +201,43 @@
> >  			clocks =<&gate_clk 4>;
> >  			status = "disabled";
> >  		};
> >+
> >+		smi0: mdio at 72000 {
> >+			compatible = "marvell,mdio-mv643xx";
> >+			reg =<0x72000 0x4000>;
> >+			interrupts =<46>;
> >+			tx_csum_limit =<1600>;
> >+			status = "disabled";
> >+		};
> >+
> >+		smi1: mdio at 76000 {
> >+			compatible = "marvell,mdio-mv643xx";
> >+			reg =<0x76000 0x4000>;
> >+			interrupts =<47>;
> >+			tx_csum_limit =<1600>;
> >+			status = "disabled";
> >+		};
> >+
> >+		egiga0 {
> >+			compatible = "marvell,mv643xx-eth";
> >+			reg =<0x72000 0x4000>;
> >+			mdio =<&smi0>;
> >+			port_number =<0>;
> >+			phy_addr =<0x80>;
> 
> Jason,
> 
> This will break phy_scan on all kirkwood boards as 0x80 is _not_ equal
> MV643XX_ETH_PHY_ADDR_DEFAULT.

Good point.

> I suggest not to set phy_addr in kirkwood.dtsi at all and let the
> board specific DT files set the phy addresses (or rely on phy_scan if not
> set).
> 
> Also, you are ORing the address passed by phy_addr with 0x80 anyway. So
> all phy addresses should be passed as <0> or <1> instead the ORed ones.

agreed.  I'll make the changes for V5.

thanks for the review.

Jason.

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

* [PATCH V3 8/8] ARM: kirkwood: mv643xx_eth dt conversion
  2013-01-27 13:10             ` Sebastian Hesselbarth
@ 2013-01-27 18:38               ` Russell King - ARM Linux
  0 siblings, 0 replies; 102+ messages in thread
From: Russell King - ARM Linux @ 2013-01-27 18:38 UTC (permalink / raw)
  To: linux-arm-kernel

On Sun, Jan 27, 2013 at 02:10:51PM +0100, Sebastian Hesselbarth wrote:
> On 01/27/2013 01:21 PM, Russell King - ARM Linux wrote:
>> On Sat, Jan 26, 2013 at 02:40:12PM +0100, Andrew Lunn wrote:
>>> On Sat, Jan 26, 2013 at 01:50:11PM +0100, Sebastian Hesselbarth wrote:
>>> The code here is based on dove_legacy_clk_init(). However the change
>>> made by Jason is in order to make a DT device work, not an non-DT
>>> device.
>>>
>>> The problem is the way the driver is getting the clock.
>>>
>>> 	mp->clk = clk_get(&pdev->dev, (pdev->id ? "1" : "0"));
>>>
> > ...
>> So, the whole:
>>
>> 	mp->clk = clk_get(&pdev->dev, (pdev->id ? "1" : "0"));
>>
>> is absolutely ludicrous.  You already know which device it is by means of
>> the first argument.  You don't need to pass a "0" or a "1".  So that should
>> be NULL, so:
>>
>> 	mp->clk = clk_get(&pdev->dev, NULL);
>>
>> That will get a clock from clkdev which is setup in the _matching_ tables
>> to correlate with the device (and a NULL connection ID _there_ too).  With
>> OF, I believe it will get the first clock.
>
> The conid was set for mv643xx but shouldn't be set anymore - check
> mach-kirkwood/common.c.

If you're referring to:

	mp->clk = clk_get(&pdev->dev, (pdev->id ? "1" : "0"));

That should _never_ have ever been allowed.  It's total bollocks as I've
pointed out above.

> I guess we can just remove the conid check and rely on DT passed
> clock only.

Yes, and it _will_ work fine for non-DT too, because you have a device
with a single clock connection.  If it doesn't, then you've revealed a
latent bug - probably down to a non-conforming clk API implementation
by someone else.

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

* [PATCH V3 7/8] mv643xx.c: Add basic device tree support.
  2013-01-25 20:53   ` [PATCH V3 7/8] mv643xx.c: Add basic device tree support Jason Cooper
@ 2013-01-28 10:12     ` Mark Rutland
  2013-01-28 19:38       ` Jason Cooper
  0 siblings, 1 reply; 102+ messages in thread
From: Mark Rutland @ 2013-01-28 10:12 UTC (permalink / raw)
  To: linux-arm-kernel

Hello,

I've taken a quick look at this, and I have a couple of comments on the binding
and the way it's parsed.

On Fri, Jan 25, 2013 at 08:53:59PM +0000, Jason Cooper wrote:
> From: Ian Molton <ian.molton@codethink.co.uk>
> 
>     This patch adds basic device tree support to the mv643xx ethernet driver.
> 
>     It should be enough for most current users of the device, and should allow
>     a painless migration.
> 
>     Signed-off-by: Ian Molton <ian.molton@codethink.co.uk>
> 
> Signed-off-by: Jason Cooper <jason@lakedaemon.net>
> ---
>  Documentation/devicetree/bindings/net/mv643xx.txt | 75 ++++++++++++++++++
>  drivers/net/ethernet/marvell/mv643xx_eth.c        | 93 +++++++++++++++++++++--
>  2 files changed, 161 insertions(+), 7 deletions(-)
>  create mode 100644 Documentation/devicetree/bindings/net/mv643xx.txt
> 
> diff --git a/Documentation/devicetree/bindings/net/mv643xx.txt b/Documentation/devicetree/bindings/net/mv643xx.txt
> new file mode 100644
> index 0000000..2727f798
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/net/mv643xx.txt
> @@ -0,0 +1,75 @@
> +mv643xx related nodes.
> +
> +marvell,mdio-mv643xx:
> +
> +Required properties:
> +
> + - interrupts : <a> where a is the SMI interrupt number.
> + - reg : the base address and size of the controllers register space.
> +
> +Optional properties:
> + - shared_smi : on some chips, the second PHY is "shared", meaning it is
> +	really accessed via the first SMI controller. It is passed in this
> +	way due to the present structure of the driver, which requires the
> +	base address for the MAC to be passed in via the SMI controllers
> +	platform data.

The phrase "the present structure of the driver" is not something that's
generally good to hear in a binding document. Is shared_smi always going to be
required for such configurations, or is there going to be any driver rework
that makes it irrelevant?

> + - tx_csum_limit : on some devices, this option is required for proper
> +	operation wrt. jumbo frames.

This doesn't explain what this property is. Also "limit" doesn't describe
what's limited (e.g. size, rate). How about something like
max-tx-checksum-size?

> +
> +
> +Example:
> +
> +smi0: mdio at 72000 {
> +	compatible = "marvell,mdio-mv643xx";
> +	reg = <0x72000 0x4000>;
> +	interrupts = <46>;
> +	tx_csum_limit = <1600>;
> +	status = "disabled";
> +};
> +
> +smi1: mdio at 76000 {
> +	compatible = "marvell,mdio-mv643xx";
> +	reg = <0x76000 0x4000>;
> +	interrupts = <47>;
> +	shared_smi = <&smi0>;
> +	tx_csum_limit = <1600>;
> +	status = "disabled";
> +};
> +
> +
> +
> +marvell,mv643xx-eth:
> +
> +Required properties:
> + - interrupts : the port interrupt number.
> + - mdio : phandle of the smi device as drescribed above
> +
> +Optional properties:
> + - port_number : the port number on this bus.
> + - phy_addr : the PHY address.
> + - reg : should match the mdio reg this device is attached to.
> +	this is a required hack for now due to the way the
> +	driver is constructed. This allows the device clock to be
> +	kept running so that the MAC is not lost after boot.

More s/_/-/ candidates.

Is there any reason to have "phy_addr" rather than "phy_address"? We already
have #address-cells, which would seem to have set a precedent for naming.

[...]

> @@ -2610,6 +2613,26 @@ static int mv643xx_eth_shared_probe(struct platform_device *pdev)
>  	if (msp->base == NULL)
>  		goto out_free;
>  
> +	if (pdev->dev.of_node) {
> +		struct device_node *np = NULL;
> +
> +		/* when all users of this driver use FDT, we can remove this */
> +		pd = kzalloc(sizeof(*pd), GFP_KERNEL);
> +		if (!pd) {
> +			dev_dbg(&pdev->dev, "Could not allocate platform data\n");
> +			goto out_free;
> +		}
> +
> +		of_property_read_u32(pdev->dev.of_node,
> +			"tx_csum_limit", &pd->tx_csum_limit);

Is there any upper limit on what this property could be? It would be nice to
have a sanity check.

Also, of_property_read_u32 reads a u32, but pd->tx_csum_limit is an int. It
would be good to use a u32 temporary.

[...]

> @@ -2858,7 +2893,36 @@ static int mv643xx_eth_probe(struct platform_device *pdev)
>  	struct resource *res;
>  	int err;
>  
> -	pd = pdev->dev.platform_data;
> +	if (pdev->dev.of_node) {
> +		struct device_node *np = NULL;
> +
> +		/* when all users of this driver use FDT, we can remove this */
> +		pd = kzalloc(sizeof(*pd), GFP_KERNEL);
> +		if (!pd) {
> +			dev_dbg(&pdev->dev, "Could not allocate platform data\n");
> +			return -ENOMEM;
> +		}
> +
> +		of_property_read_u32(pdev->dev.of_node,
> +			"port_number", &pd->port_number);
> +
> +		if (!of_property_read_u32(pdev->dev.of_node,
> +				"phy_addr", &pd->phy_addr))
> +			pd->phy_addr = MV643XX_ETH_PHY_ADDR(pd->phy_addr);

>From a cursory glance at mv643xx_eth.c, it looks like phy_addr needs to be in
the range 0 to 0x1f. It might be worth a sanity check here (even if it just
prints a warning).

> +		else
> +			pd->phy_addr = MV643XX_ETH_PHY_ADDR_DEFAULT;
> +
> +		np = of_parse_phandle(pdev->dev.of_node, "mdio", 0);
> +		if (np) {
> +			pd->shared = of_find_device_by_node(np);
> +		} else {
> +			kfree(pd);
> +			return -ENODEV;
> +		}
> +	} else {
> +		pd = pdev->dev.platform_data;
> +	}
> +
>  	if (pd == NULL) {
>  		dev_err(&pdev->dev, "no mv643xx_eth_platform_data\n");
>  		return -ENODEV;

[...]

Thanks,
Mark.

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

* [RFC V2 PATCH 0/8] ARM: kirkwood: cleanup DT conversion
  2013-01-25 18:34         ` Jason Gunthorpe
  2013-01-25 20:03           ` Arnd Bergmann
@ 2013-01-28 10:40           ` Ezequiel Garcia
  2013-01-28 18:07             ` Jason Gunthorpe
  1 sibling, 1 reply; 102+ messages in thread
From: Ezequiel Garcia @ 2013-01-28 10:40 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Jason,

On Fri, Jan 25, 2013 at 11:34:07AM -0700, Jason Gunthorpe wrote:
> On Fri, Jan 25, 2013 at 04:03:29PM +0100, Sebastian Hesselbarth wrote:
> > On Fri, Jan 25, 2013 at 1:52 PM, Jason Cooper <jason@lakedaemon.net> wrote:
> > > Once I have the mv643xx_eth binding working reliably, preferably with
> > > mvmdio, I'll take a look at removing the last board-*.c files.  If the
> > > stars align, we'll get it all done for v3.9.
> > >
> > > The only big thing left will be pcie.
> 
> > there is also addr_map that we haven't thought about yet. Is it supposed
> > to be configurable through DT or do we leave it as "linux wants it that way"?
> 
> FWIW, this was a pain + surprise for us when we started out. The
> address map Linux wants is not the same as the device power on
> default, and the Linux mapping is hardwired into the kernel :(
> 
> I would be happy to see the address map setup be more flexible and
> done via DT. It would be a bit of a pain to change, but via DT each
> decoded window could be described as a bus with a ranges and an OF
> address map driver could directly setup the windows to match those DT
> nodes. Something like this, repeated for each window:
> 
>         // MBUS Decoder window for NAND
>         nand at f4000000 {
>                 #address-cells = <1>;
>                 #size-cells = <1>;
>                 compatible = "simple-bus", "marvell,orion-mbus";
> 		mbus-target = 0xXXXXX;
>                 ranges = <0 0xf4000000 0x10000>;
> 
>                 nand at 0 {
>                         cle = <0>;
>                         ale = <1>;
>                         bank-width = <1>;
>                         chip-delay = <50>;
>                         compatible = "marvell,orion-nand";
>                         reg = <0x0 0x400>;
>                 };
>         };
> 

This is a nice idea.

I have a few questions, though.

1. Are you sure we should use "ranges" property?
In this case it's not an address translation but rather
and address window configuration.
If I got this right, in this case child device address
space is the same as its parent. So, it's not an actual translation.

I would think we could add a new "windows" property to reflect
address window configuration.

2. Also, If we use "ranges" property. How would that work?
By reading the property in the addr-map driver or
by somehow improving on of_bus to include this new kind of busses?

Thanks,

-- 
Ezequiel Garc?a, Free Electrons
Embedded Linux, Kernel and Android Engineering
http://free-electrons.com

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

* [RFC V2 PATCH 0/8] ARM: kirkwood: cleanup DT conversion
  2013-01-28 10:40           ` Ezequiel Garcia
@ 2013-01-28 18:07             ` Jason Gunthorpe
  2013-01-28 18:24               ` Thomas Petazzoni
  0 siblings, 1 reply; 102+ messages in thread
From: Jason Gunthorpe @ 2013-01-28 18:07 UTC (permalink / raw)
  To: linux-arm-kernel

> >         // MBUS Decoder window for NAND
> >         nand at f4000000 {
> >                 #address-cells = <1>;
> >                 #size-cells = <1>;
> >                 compatible = "simple-bus", "marvell,orion-mbus";
> > 		mbus-target = 0xXXXXX;
> >                 ranges = <0 0xf4000000 0x10000>;
> > 
> >                 nand at 0 {
> >                         cle = <0>;
> >                         ale = <1>;
> >                         bank-width = <1>;
> >                         chip-delay = <50>;
> >                         compatible = "marvell,orion-nand";
> >                         reg = <0x0 0x400>;
> >                 };
> >         };
> > 
> 
> This is a nice idea.
> 
> I have a few questions, though.
> 
> 1. Are you sure we should use "ranges" property?
> In this case it's not an address translation but rather
> and address window configuration.

Yes, you'd use ranges with an identity transation. The purpose is so
that child OF blocks are all relative to the start of the decode
region. This way changing the address of the HW block behind the mbus
window is simply done by changing the ranges property.

Note the reg on the nand is starting at offset 0, so ranges will
translate that to 0xf4000000. Similar for the internal regs.

> I would think we could add a new "windows" property to reflect
> address window configuration.

My arrangement above would have each "marvell,orion-mbus" specify the
mbus-target, which I imagined to be all the HW specific bits (target,
attributes, etc). The addr-map driver would select a window for this
bus and then assign those bits to it.

> 2. Also, If we use "ranges" property. How would that work?
> By reading the property in the addr-map driver or
> by somehow improving on of_bus to include this new kind of busses?

The addr-map driver would have to read it, I believe the rules of how
busses work make this fairly simple:

1) very early on the addr-map driver would have to scan the OF tree,
   find the address of the mbus mapping registers, and the internal
   register map.
2) Verify the mbus window for the internal registers matches the DT
   This is just a sanity check, if the correct value doesn't come back
   then the DT doesnt match what the bootloader setup, and some
   jtag accessible diagnostic can be printed...
3) Wipe all the mbus windows
4) Register a "marvell,orion-mbus" bus handler somehow
5) When OF processes the DT it would call the bus handler for each
   "marvell,orion-mbus" which should parse the ranges, allocate
   a free window, program that window then instantiate the child
   devices.

Jason

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

* [RFC V2 PATCH 0/8] ARM: kirkwood: cleanup DT conversion
  2013-01-28 18:07             ` Jason Gunthorpe
@ 2013-01-28 18:24               ` Thomas Petazzoni
  2013-01-28 18:41                 ` Ezequiel Garcia
  2013-01-28 18:43                 ` Jason Gunthorpe
  0 siblings, 2 replies; 102+ messages in thread
From: Thomas Petazzoni @ 2013-01-28 18:24 UTC (permalink / raw)
  To: linux-arm-kernel

Dear Jason Gunthorpe,

On Mon, 28 Jan 2013 11:07:16 -0700, Jason Gunthorpe wrote:

> > 2. Also, If we use "ranges" property. How would that work?
> > By reading the property in the addr-map driver or
> > by somehow improving on of_bus to include this new kind of busses?
> 
> The addr-map driver would have to read it, I believe the rules of how
> busses work make this fairly simple:
> 
> 1) very early on the addr-map driver would have to scan the OF tree,
>    find the address of the mbus mapping registers, and the internal
>    register map.
> 2) Verify the mbus window for the internal registers matches the DT
>    This is just a sanity check, if the correct value doesn't come back
>    then the DT doesnt match what the bootloader setup, and some
>    jtag accessible diagnostic can be printed...
> 3) Wipe all the mbus windows
> 4) Register a "marvell,orion-mbus" bus handler somehow
> 5) When OF processes the DT it would call the bus handler for each
>    "marvell,orion-mbus" which should parse the ranges, allocate
>    a free window, program that window then instantiate the child
>    devices.

I am not totally convinced that we want to describe the address
decoding windows in the DT, because it is too static. For example, the
number, size and location of address decoding windows for PCIe
interfaces vary depending on the PCIe devices connected in those PCIe
interfaces. So we clearly do not want to have address decoding windows
fixed in stone in the Device Tree, in my opinion.

Instead, I think the "address decoding window driver" in the kernel
should provide an API for device drivers to request an address decoding
window at a given address, with a given size and target/attribute. This
is already what the PCIe code is doing (I'm going to submit v2 of the
PCIe code soon), and I think we should to the same for other devices as
well.

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] 102+ messages in thread

* [RFC V2 PATCH 0/8] ARM: kirkwood: cleanup DT conversion
  2013-01-28 18:24               ` Thomas Petazzoni
@ 2013-01-28 18:41                 ` Ezequiel Garcia
  2013-01-28 19:03                   ` Thomas Petazzoni
  2013-01-28 18:43                 ` Jason Gunthorpe
  1 sibling, 1 reply; 102+ messages in thread
From: Ezequiel Garcia @ 2013-01-28 18:41 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Thomas,

On Mon, Jan 28, 2013 at 3:24 PM, Thomas Petazzoni
<thomas.petazzoni@free-electrons.com> wrote:
>
> Instead, I think the "address decoding window driver" in the kernel
> should provide an API for device drivers to request an address decoding
> window at a given address, with a given size and target/attribute. This
> is already what the PCIe code is doing (I'm going to submit v2 of the
> PCIe code soon), and I think we should to the same for other devices as
> well.
>

Note that in Jason's proposal, it's possible to instantiate a bus' child
device, configure its address window and then call the corresponding
driver using a regular of_node.

For instance,

// MBUS Decoder window for NAND
nand at f4000000 {
        #address-cells = <1>;
        #size-cells = <1>;
        compatible = "simple-bus", "marvell,orion-mbus";
        mbus-target = <0x01 0x2f>;
        ranges = <0 0xf4000000 0x10000>;

        nand at 0 {
                // ...
               compatible = "marvell,orion-nand";
               reg = <0x0 0x400>;
        };
};

In this example, we can configure the window using both mbus-target and ranges
properties and then use the child node to instantiate an "orion-nand" device.

I understand your point regarding PCIe flexibility needs.
So I wonder, in your proposed scheme,
who should call this "address decoding window" driver
in order to still be able to instantiate child devices easily?

Thanks,

-- 
    Ezequiel

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

* [RFC V2 PATCH 0/8] ARM: kirkwood: cleanup DT conversion
  2013-01-28 18:24               ` Thomas Petazzoni
  2013-01-28 18:41                 ` Ezequiel Garcia
@ 2013-01-28 18:43                 ` Jason Gunthorpe
  1 sibling, 0 replies; 102+ messages in thread
From: Jason Gunthorpe @ 2013-01-28 18:43 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Jan 28, 2013 at 07:24:45PM +0100, Thomas Petazzoni wrote:

> > 1) very early on the addr-map driver would have to scan the OF tree,
> >    find the address of the mbus mapping registers, and the internal
> >    register map.
> > 2) Verify the mbus window for the internal registers matches the DT
> >    This is just a sanity check, if the correct value doesn't come back
> >    then the DT doesnt match what the bootloader setup, and some
> >    jtag accessible diagnostic can be printed...
> > 3) Wipe all the mbus windows
> > 4) Register a "marvell,orion-mbus" bus handler somehow
> > 5) When OF processes the DT it would call the bus handler for each
> >    "marvell,orion-mbus" which should parse the ranges, allocate
> >    a free window, program that window then instantiate the child
> >    devices.

[..]
 
> Instead, I think the "address decoding window driver" in the kernel
> should provide an API for device drivers to request an address decoding
> window at a given address, with a given size and target/attribute. This
> is already what the PCIe code is doing (I'm going to submit v2 of the
> PCIe code soon), and I think we should to the same for other devices as
> well.

Sure, but that isn't exclusive with setting up the bulk of the windows
through DT - the tegra PCI-E driver can use a request API for its
dynamic windows, while everyone else can be setup by having the DT bus
declarations automatically request the proper windows.

All this would do is replace the tables of window configurations in
the board files with a DT representation of the same table.

Jason

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

* [RFC V2 PATCH 0/8] ARM: kirkwood: cleanup DT conversion
  2013-01-28 18:41                 ` Ezequiel Garcia
@ 2013-01-28 19:03                   ` Thomas Petazzoni
  2013-01-28 19:19                     ` Jason Gunthorpe
  2013-01-28 19:19                     ` Ezequiel Garcia
  0 siblings, 2 replies; 102+ messages in thread
From: Thomas Petazzoni @ 2013-01-28 19:03 UTC (permalink / raw)
  To: linux-arm-kernel

Dear Ezequiel Garcia,

On Mon, 28 Jan 2013 15:41:12 -0300, Ezequiel Garcia wrote:

> Note that in Jason's proposal, it's possible to instantiate a bus'
> child device, configure its address window and then call the
> corresponding driver using a regular of_node.
> 
> For instance,
> 
> // MBUS Decoder window for NAND
> nand at f4000000 {
>         #address-cells = <1>;
>         #size-cells = <1>;
>         compatible = "simple-bus", "marvell,orion-mbus";
>         mbus-target = <0x01 0x2f>;
>         ranges = <0 0xf4000000 0x10000>;
> 
>         nand at 0 {
>                 // ...
>                compatible = "marvell,orion-nand";
>                reg = <0x0 0x400>;
>         };
> };
> 
> In this example, we can configure the window using both mbus-target
> and ranges properties and then use the child node to instantiate an
> "orion-nand" device.
> 
> I understand your point regarding PCIe flexibility needs.
> So I wonder, in your proposed scheme,
> who should call this "address decoding window" driver
> in order to still be able to instantiate child devices easily?

I am not sure to exactly understand what you mean here. You would have
a DT node for the NAND, and another one for the NOR. Each of them use a
different compatible string (such as the "marvell,orion-nand" you've
mentioned). Those correspond to platform_drivers, like all other
devices described in the DT, nothing different. In their ->probe()
function, those driver call some mvebu_setup_addr_decoding_window()
function, which is part of an API provided by the address mapping
driver.

The address at which we configure the various address decoding windows
is an operating system specific decision, it is not a description of
the hardware. Therefore, it shouldn't be encoded in the DT, because the
DT describes the hardware, not the Linux-specific decisions on how the
hardware should be used.

Of course, for things like the internal registers decoding windows, we
can't really make the DT unaware of that, because it is so fundamental
to even having the platform booting. But for all other windows, it is
an operating system decision, and not a hardware description.

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] 102+ messages in thread

* [RFC V2 PATCH 0/8] ARM: kirkwood: cleanup DT conversion
  2013-01-28 19:03                   ` Thomas Petazzoni
@ 2013-01-28 19:19                     ` Jason Gunthorpe
  2013-01-28 19:19                     ` Ezequiel Garcia
  1 sibling, 0 replies; 102+ messages in thread
From: Jason Gunthorpe @ 2013-01-28 19:19 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Jan 28, 2013 at 08:03:32PM +0100, Thomas Petazzoni wrote:

> devices described in the DT, nothing different. In their ->probe()
> function, those driver call some mvebu_setup_addr_decoding_window()
> function, which is part of an API provided by the address mapping
> driver.

I think that would be a layering mess to update these possibly shared
drivers to conditionally call some mvebu specific function in some
case, with some SOC specific set of parameters.. The MBUS driver
should take care of that, just like the PCI framework takes care of
address allocation.
 
> The address at which we configure the various address decoding windows
> is an operating system specific decision, it is not a description of
> the hardware. Therefore, it shouldn't be encoded in the DT, because the
> DT describes the hardware, not the Linux-specific decisions on how the
> hardware should be used.

DT models PCI BARs/Bridge windows as well, which are functionally
identical to the MBUS decode windows. There *is* a piece of address
decoder hardware, and the DT binding for that kind of hardware is a
bus with ranges. So it is completely appropriate to model that in DT.

The OF convention for bridge buses is to put the boot loader assigned
address in the DT (under the assumption that the boot loader sets
things up properly) so it is reasonable to include those addresses in
DT as well..

If, someday, the MBUS driver wants to dynamically allocate every MBUS
region, then that is fine, it can ignore/override the addresses from
the DT, just like the PCI stuff does for BARs/etc, but for today
without dynamic assignment it makes alot of sense to just use the DT
values directly.

Jason

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

* [RFC V2 PATCH 0/8] ARM: kirkwood: cleanup DT conversion
  2013-01-28 19:03                   ` Thomas Petazzoni
  2013-01-28 19:19                     ` Jason Gunthorpe
@ 2013-01-28 19:19                     ` Ezequiel Garcia
  1 sibling, 0 replies; 102+ messages in thread
From: Ezequiel Garcia @ 2013-01-28 19:19 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Jan 28, 2013 at 4:03 PM, Thomas Petazzoni
<thomas.petazzoni@free-electrons.com> wrote:
> Dear Ezequiel Garcia,
>
> On Mon, 28 Jan 2013 15:41:12 -0300, Ezequiel Garcia wrote:
>
>> Note that in Jason's proposal, it's possible to instantiate a bus'
>> child device, configure its address window and then call the
>> corresponding driver using a regular of_node.
>>
>> For instance,
>>
>> // MBUS Decoder window for NAND
>> nand at f4000000 {
>>         #address-cells = <1>;
>>         #size-cells = <1>;
>>         compatible = "simple-bus", "marvell,orion-mbus";
>>         mbus-target = <0x01 0x2f>;
>>         ranges = <0 0xf4000000 0x10000>;
>>
>>         nand at 0 {
>>                 // ...
>>                compatible = "marvell,orion-nand";
>>                reg = <0x0 0x400>;
>>         };
>> };
>>
>> In this example, we can configure the window using both mbus-target
>> and ranges properties and then use the child node to instantiate an
>> "orion-nand" device.
>>
>> I understand your point regarding PCIe flexibility needs.
>> So I wonder, in your proposed scheme,
>> who should call this "address decoding window" driver
>> in order to still be able to instantiate child devices easily?
>
> I am not sure to exactly understand what you mean here. You would have
> a DT node for the NAND, and another one for the NOR. Each of them use a
> different compatible string (such as the "marvell,orion-nand" you've
> mentioned). Those correspond to platform_drivers, like all other
> devices described in the DT, nothing different. In their ->probe()
> function, those driver call some mvebu_setup_addr_decoding_window()
> function, which is part of an API provided by the address mapping
> driver.
>

Well, I guess we can call this mvebu_setup_addr_decoding_window()
from orion-nand driver, being orion specific.
I assume we will have to add something like the mbus-target property
to the orion-nand DT node, right?
(This describes the hardware, since it basically describes how the
flash is wired;
so I believe we must put that into the DT).

On the other side, I still don't understand how we will call something like this
for the NOR driver, which could probably be cfi-flash.

> The address at which we configure the various address decoding windows
> is an operating system specific decision, it is not a description of
> the hardware. Therefore, it shouldn't be encoded in the DT, because the
> DT describes the hardware, not the Linux-specific decisions on how the
> hardware should be used.
>

Good point. I haven't thought it that way.

-- 
    Ezequiel

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

* [PATCH V3 7/8] mv643xx.c: Add basic device tree support.
  2013-01-28 10:12     ` Mark Rutland
@ 2013-01-28 19:38       ` Jason Cooper
  2013-01-29 10:26         ` Ian Molton
  0 siblings, 1 reply; 102+ messages in thread
From: Jason Cooper @ 2013-01-28 19:38 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Jan 28, 2013 at 10:12:49AM +0000, Mark Rutland wrote:
> Hello,
> 
> I've taken a quick look at this, and I have a couple of comments on the binding
> and the way it's parsed.
> 
> On Fri, Jan 25, 2013 at 08:53:59PM +0000, Jason Cooper wrote:
> > From: Ian Molton <ian.molton@codethink.co.uk>
> > 
> >     This patch adds basic device tree support to the mv643xx ethernet driver.
> > 
> >     It should be enough for most current users of the device, and should allow
> >     a painless migration.
> > 
> >     Signed-off-by: Ian Molton <ian.molton@codethink.co.uk>
> > 
> > Signed-off-by: Jason Cooper <jason@lakedaemon.net>
> > ---
> >  Documentation/devicetree/bindings/net/mv643xx.txt | 75 ++++++++++++++++++
> >  drivers/net/ethernet/marvell/mv643xx_eth.c        | 93 +++++++++++++++++++++--
> >  2 files changed, 161 insertions(+), 7 deletions(-)
> >  create mode 100644 Documentation/devicetree/bindings/net/mv643xx.txt
> > 
> > diff --git a/Documentation/devicetree/bindings/net/mv643xx.txt b/Documentation/devicetree/bindings/net/mv643xx.txt
> > new file mode 100644
> > index 0000000..2727f798
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/net/mv643xx.txt
> > @@ -0,0 +1,75 @@
> > +mv643xx related nodes.
> > +
> > +marvell,mdio-mv643xx:
> > +
> > +Required properties:
> > +
> > + - interrupts : <a> where a is the SMI interrupt number.
> > + - reg : the base address and size of the controllers register space.
> > +
> > +Optional properties:
> > + - shared_smi : on some chips, the second PHY is "shared", meaning it is
> > +	really accessed via the first SMI controller. It is passed in this
> > +	way due to the present structure of the driver, which requires the
> > +	base address for the MAC to be passed in via the SMI controllers
> > +	platform data.
> 
> The phrase "the present structure of the driver" is not something that's
> generally good to hear in a binding document. Is shared_smi always going to be
> required for such configurations, or is there going to be any driver rework
> that makes it irrelevant?

Florian is working on bring mvmdio up to speed, I'll let him comment on
this.

> > + - tx_csum_limit : on some devices, this option is required for proper
> > +	operation wrt. jumbo frames.
> 
> This doesn't explain what this property is. Also "limit" doesn't describe
> what's limited (e.g. size, rate). How about something like
> max-tx-checksum-size?

sounds better, I'll update for the next version.

> 
> > +
> > +
> > +Example:
> > +
> > +smi0: mdio at 72000 {
> > +	compatible = "marvell,mdio-mv643xx";
> > +	reg = <0x72000 0x4000>;
> > +	interrupts = <46>;
> > +	tx_csum_limit = <1600>;
> > +	status = "disabled";
> > +};
> > +
> > +smi1: mdio at 76000 {
> > +	compatible = "marvell,mdio-mv643xx";
> > +	reg = <0x76000 0x4000>;
> > +	interrupts = <47>;
> > +	shared_smi = <&smi0>;
> > +	tx_csum_limit = <1600>;
> > +	status = "disabled";
> > +};
> > +
> > +
> > +
> > +marvell,mv643xx-eth:
> > +
> > +Required properties:
> > + - interrupts : the port interrupt number.
> > + - mdio : phandle of the smi device as drescribed above
> > +
> > +Optional properties:
> > + - port_number : the port number on this bus.
> > + - phy_addr : the PHY address.
> > + - reg : should match the mdio reg this device is attached to.
> > +	this is a required hack for now due to the way the
> > +	driver is constructed. This allows the device clock to be
> > +	kept running so that the MAC is not lost after boot.
> 
> More s/_/-/ candidates.

ok.

> Is there any reason to have "phy_addr" rather than "phy_address"? We already
> have #address-cells, which would seem to have set a precedent for naming.

Well, we also have "reg", which would seem to indicate the opposite.  And,
following your logic, we should really say "physical_address" :-P .  I
personally feel "phy_addr" is well understood, but I don't have a strong
opinion on it.

> 
> [...]
> 
> > @@ -2610,6 +2613,26 @@ static int mv643xx_eth_shared_probe(struct platform_device *pdev)
> >  	if (msp->base == NULL)
> >  		goto out_free;
> >  
> > +	if (pdev->dev.of_node) {
> > +		struct device_node *np = NULL;
> > +
> > +		/* when all users of this driver use FDT, we can remove this */
> > +		pd = kzalloc(sizeof(*pd), GFP_KERNEL);
> > +		if (!pd) {
> > +			dev_dbg(&pdev->dev, "Could not allocate platform data\n");
> > +			goto out_free;
> > +		}
> > +
> > +		of_property_read_u32(pdev->dev.of_node,
> > +			"tx_csum_limit", &pd->tx_csum_limit);
> 
> Is there any upper limit on what this property could be? It would be nice to
> have a sanity check.
> 
> Also, of_property_read_u32 reads a u32, but pd->tx_csum_limit is an int. It
> would be good to use a u32 temporary.

Good catch, I'll update for both.

> 
> [...]
> 
> > @@ -2858,7 +2893,36 @@ static int mv643xx_eth_probe(struct platform_device *pdev)
> >  	struct resource *res;
> >  	int err;
> >  
> > -	pd = pdev->dev.platform_data;
> > +	if (pdev->dev.of_node) {
> > +		struct device_node *np = NULL;
> > +
> > +		/* when all users of this driver use FDT, we can remove this */
> > +		pd = kzalloc(sizeof(*pd), GFP_KERNEL);
> > +		if (!pd) {
> > +			dev_dbg(&pdev->dev, "Could not allocate platform data\n");
> > +			return -ENOMEM;
> > +		}
> > +
> > +		of_property_read_u32(pdev->dev.of_node,
> > +			"port_number", &pd->port_number);
> > +
> > +		if (!of_property_read_u32(pdev->dev.of_node,
> > +				"phy_addr", &pd->phy_addr))
> > +			pd->phy_addr = MV643XX_ETH_PHY_ADDR(pd->phy_addr);
> 
> From a cursory glance at mv643xx_eth.c, it looks like phy_addr needs to be in
> the range 0 to 0x1f. It might be worth a sanity check here (even if it just
> prints a warning).

right, this had been commented elsewhere.  phy_addr is XORd with 0x80,
so I'll correct my subsequent patch adding the DT entries and add the
warning here.

Thanks for the review,

Jason.

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

* [PATCH V3 7/8] mv643xx.c: Add basic device tree support.
  2013-01-28 19:38       ` Jason Cooper
@ 2013-01-29 10:26         ` Ian Molton
  0 siblings, 0 replies; 102+ messages in thread
From: Ian Molton @ 2013-01-29 10:26 UTC (permalink / raw)
  To: linux-arm-kernel

On 28/01/13 19:38, Jason Cooper wrote:

Good to see this patch get some TLC guys - have at it :)

-Ian

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

* [PATCH V4 07/11] ARM: mvebu: correct gated clock documentation
  2013-01-26 20:50   ` [PATCH V4 07/11] ARM: mvebu: correct gated clock documentation Jason Cooper
@ 2013-02-15 20:37     ` Jason Cooper
  0 siblings, 0 replies; 102+ messages in thread
From: Jason Cooper @ 2013-02-15 20:37 UTC (permalink / raw)
  To: linux-arm-kernel

On Sat, Jan 26, 2013 at 08:50:16PM +0000, Jason Cooper wrote:
> Signed-off-by: Jason Cooper <jason@lakedaemon.net>
> ---
>  Documentation/devicetree/bindings/clock/mvebu-gated-clock.txt | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Applied to mvebu/cleanup.

thx,

Jason.

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

* [PATCH V4 02/11] ARM: kirkwood: topkick: convert to pinctrl
  2013-01-26 20:50   ` [PATCH V4 02/11] ARM: kirkwood: topkick: convert to pinctrl Jason Cooper
@ 2013-02-16 16:11     ` Jason Cooper
  0 siblings, 0 replies; 102+ messages in thread
From: Jason Cooper @ 2013-02-16 16:11 UTC (permalink / raw)
  To: linux-arm-kernel

On Sat, Jan 26, 2013 at 08:50:11PM +0000, Jason Cooper wrote:
> Signed-off-by: Jason Cooper <jason@lakedaemon.net>
> ---
>  arch/arm/boot/dts/kirkwood-topkick.dts     | 90 ++++++++++++++++++++++++++++++
>  arch/arm/mach-kirkwood/board-usi_topkick.c | 42 --------------
>  2 files changed, 90 insertions(+), 42 deletions(-)

Applied to mvebu/dt

thx,

Jason.

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

* [PATCH V4 03/11] ARM: Kirkwood: topkick: Enable i2c bus.
  2013-01-26 20:50   ` [PATCH V4 03/11] ARM: Kirkwood: topkick: Enable i2c bus Jason Cooper
@ 2013-02-16 16:15     ` Jason Cooper
  0 siblings, 0 replies; 102+ messages in thread
From: Jason Cooper @ 2013-02-16 16:15 UTC (permalink / raw)
  To: linux-arm-kernel

On Sat, Jan 26, 2013 at 08:50:12PM +0000, Jason Cooper wrote:
> From: Andrew Lunn <andrew@lunn.ch>
> 
> Add a DT node for I2C and pinctrl hog for the pins. There appears to
> be an i2c bus on topkick with a device on it:
> 
> i2cdetect 0
> WARNING! This program can confuse your I2C bus, cause data loss and worse!
> I will probe file /dev/i2c-0.
> I will probe address range 0x03-0x77.
> Continue? [Y/n] y
>      0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
> 00:          -- -- -- -- -- -- -- -- -- -- -- -- --
> 10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
> 20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
> 30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
> 40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
> 50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
> 60: -- -- -- -- 64 -- -- -- -- -- -- -- -- -- -- --
> 70: -- -- -- -- -- -- -- --
> 
> Signed-off-by: Andrew Lunn <andrew@lunn.ch>
> Signed-off-by: Jason Cooper <jason@lakedaemon.net>
> ---
>  arch/arm/boot/dts/kirkwood-topkick.dts | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)

Applied to mvebu/dt

thx,

Jason.

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

* [PATCH V4 05/11] ARM: kirkwood: nsa310: convert to pinctrl
  2013-01-26 20:50   ` [PATCH V4 05/11] ARM: kirkwood: nsa310: convert to pinctrl Jason Cooper
@ 2013-02-16 16:17     ` Jason Cooper
  0 siblings, 0 replies; 102+ messages in thread
From: Jason Cooper @ 2013-02-16 16:17 UTC (permalink / raw)
  To: linux-arm-kernel

On Sat, Jan 26, 2013 at 08:50:14PM +0000, Jason Cooper wrote:
> Signed-off-by: Jason Cooper <jason@lakedaemon.net>
> ---
>  arch/arm/boot/dts/kirkwood-nsa310.dts | 99 +++++++++++++++++++++++++++++++++++
>  arch/arm/mach-kirkwood/board-dt.c     |  3 --
>  arch/arm/mach-kirkwood/board-nsa310.c | 26 ---------
>  arch/arm/mach-kirkwood/common.h       |  6 ---
>  4 files changed, 99 insertions(+), 35 deletions(-)

Applied to mvebu/dt

thx,

Jason.

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

* [PATCH V4 01/11] ARM: kirkwood: topkick: init mvsdio via DT
  2013-01-26 20:50   ` [PATCH V4 01/11] ARM: kirkwood: topkick: init mvsdio via DT Jason Cooper
@ 2013-02-16 16:25     ` Jason Cooper
  0 siblings, 0 replies; 102+ messages in thread
From: Jason Cooper @ 2013-02-16 16:25 UTC (permalink / raw)
  To: linux-arm-kernel

On Sat, Jan 26, 2013 at 08:50:10PM +0000, Jason Cooper wrote:
> Signed-off-by: Jason Cooper <jason@lakedaemon.net>
> Tested-by: Andrew Lunn <andrew@lunn.ch>
> ---
>  arch/arm/boot/dts/kirkwood-topkick.dts     | 7 +++++++
>  arch/arm/mach-kirkwood/board-usi_topkick.c | 6 ------
>  2 files changed, 7 insertions(+), 6 deletions(-)

Applied to mvebu/dt

thx,

Jason.

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

end of thread, other threads:[~2013-02-16 16:25 UTC | newest]

Thread overview: 102+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-23 23:34 [RFC PATCH 0/6] ARM: kirkwood: cleanup DT conversion Jason Cooper
2013-01-23 23:34 ` [RFC PATCH 1/6] ARM: kirkwood: topkick: init mvsdio via DT Jason Cooper
2013-01-23 23:34 ` [RFC PATCH 2/6] ARM: kirkwood: topkick: convert to pinctrl Jason Cooper
2013-01-23 23:34 ` [RFC PATCH 3/6] ARM: kirkwood: nsa310: cleanup includes and unneeded code Jason Cooper
2013-01-24  5:50   ` Andrew Lunn
2013-01-24 13:43     ` Florian Fainelli
2013-01-24 14:39       ` Jason Cooper
2013-01-24 15:41     ` Jason Cooper
2013-01-23 23:34 ` [RFC PATCH 4/6] ARM: kirkwood: nsa310: convert to pinctrl Jason Cooper
2013-01-23 23:34 ` [RFC PATCH 5/6] ARM: kirkwood: consolidate DT init of pcie Jason Cooper
2013-01-23 23:34 ` [RFC PATCH 6/6] ARM: kirkwood: consolidate mv643xx_eth init for DT Jason Cooper
2013-01-24  1:39   ` Jason Cooper
2013-01-24  6:23     ` Andrew Lunn
2013-01-24 12:07       ` Jason Cooper
2013-01-24 13:37   ` Florian Fainelli
2013-01-24 14:37     ` Jason Cooper
2013-01-24 15:54       ` Arnd Bergmann
2013-01-24 16:13         ` Jason Cooper
2013-01-24 17:51           ` Florian Fainelli
2013-01-24 18:16             ` Jason Cooper
2013-01-24 20:27               ` Florian Fainelli
2013-01-24 20:38                 ` Jason Cooper
2013-01-24 20:52                   ` Florian Fainelli
2013-01-24  1:33 ` [RFC PATCH 0/6] ARM: kirkwood: cleanup DT conversion Jason Cooper
2013-01-25  5:32 ` [RFC V2 PATCH 0/8] " Jason Cooper
2013-01-25  5:32   ` [RFC V2 PATCH 1/8] ARM: kirkwood: topkick: init mvsdio via DT Jason Cooper
2013-01-25  5:32   ` [RFC V2 PATCH 2/8] ARM: kirkwood: topkick: convert to pinctrl Jason Cooper
2013-01-25  5:32   ` [RFC V2 PATCH 3/8] ARM: kirkwood: nsa310: cleanup includes and unneeded code Jason Cooper
2013-01-26 20:08     ` Sergei Shtylyov
2013-01-26 20:22       ` Jason Cooper
2013-01-27 15:04         ` Sergei Shtylyov
2013-01-27 15:26           ` Jason Cooper
2013-01-25  5:32   ` [RFC V2 PATCH 4/8] ARM: kirkwood: nsa310: convert to pinctrl Jason Cooper
2013-01-25  5:32   ` [RFC V2 PATCH 5/8] ARM: kirkwood: consolidate DT init of pcie Jason Cooper
2013-01-25  5:32   ` [RFC V2 PATCH 6/8] ARM: mvebu: correct gated clock documentation Jason Cooper
2013-01-25  5:32   ` [RFC V2 PATCH 7/8] mv643xx.c: Add basic device tree support Jason Cooper
2013-01-25  5:32   ` [RFC V2 PATCH 8/8] ARM: kirkwood: mv643xx_eth dt conversion Jason Cooper
2013-01-25 11:15   ` [RFC V2 PATCH 0/8] ARM: kirkwood: cleanup DT conversion Arnd Bergmann
2013-01-25 12:52     ` Jason Cooper
2013-01-25 15:03       ` Sebastian Hesselbarth
2013-01-25 18:34         ` Jason Gunthorpe
2013-01-25 20:03           ` Arnd Bergmann
2013-01-28 10:40           ` Ezequiel Garcia
2013-01-28 18:07             ` Jason Gunthorpe
2013-01-28 18:24               ` Thomas Petazzoni
2013-01-28 18:41                 ` Ezequiel Garcia
2013-01-28 19:03                   ` Thomas Petazzoni
2013-01-28 19:19                     ` Jason Gunthorpe
2013-01-28 19:19                     ` Ezequiel Garcia
2013-01-28 18:43                 ` Jason Gunthorpe
2013-01-25 20:53 ` [PATCH V3 " Jason Cooper
2013-01-25 20:53   ` [PATCH V3 1/8] ARM: kirkwood: topkick: init mvsdio via DT Jason Cooper
2013-01-26 16:21     ` Andrew Lunn
2013-01-25 20:53   ` [PATCH V3 2/8] ARM: kirkwood: topkick: convert to pinctrl Jason Cooper
2013-01-26 16:55     ` [PATCH 1/2] ARM: Kirkwood: topkick: Fix SoC type and add missing pins Andrew Lunn
2013-01-26 16:55       ` [PATCH 2/2] ARM: Kirkwood: topkick: Enable i2c bus Andrew Lunn
2013-01-26 17:38         ` Sebastian Hesselbarth
2013-01-26 18:24           ` Andrew Lunn
2013-01-26 18:51             ` Sebastian Hesselbarth
2013-01-26 20:40         ` Jason Cooper
2013-01-26 20:39       ` [PATCH 1/2] ARM: Kirkwood: topkick: Fix SoC type and add missing pins Jason Cooper
2013-01-25 20:53   ` [PATCH V3 3/8] ARM: kirkwood: nsa310: cleanup includes and unneeded code Jason Cooper
2013-01-25 20:53   ` [PATCH V3 4/8] ARM: kirkwood: nsa310: convert to pinctrl Jason Cooper
2013-01-25 20:53   ` [PATCH V3 5/8] ARM: kirkwood: consolidate DT init of pcie Jason Cooper
2013-01-25 20:53   ` [PATCH V3 6/8] ARM: mvebu: correct gated clock documentation Jason Cooper
2013-01-25 20:53   ` [PATCH V3 7/8] mv643xx.c: Add basic device tree support Jason Cooper
2013-01-28 10:12     ` Mark Rutland
2013-01-28 19:38       ` Jason Cooper
2013-01-29 10:26         ` Ian Molton
2013-01-25 20:54   ` [PATCH V3 8/8] ARM: kirkwood: mv643xx_eth dt conversion Jason Cooper
2013-01-26 12:38     ` Andrew Lunn
2013-01-26 12:50       ` Sebastian Hesselbarth
2013-01-26 13:40         ` Andrew Lunn
2013-01-26 13:46           ` Sebastian Hesselbarth
2013-01-26 15:42           ` Jason Cooper
2013-01-27 12:21           ` Russell King - ARM Linux
2013-01-27 13:10             ` Sebastian Hesselbarth
2013-01-27 18:38               ` Russell King - ARM Linux
2013-01-26 15:06       ` Jason Cooper
2013-01-26 15:12         ` Andrew Lunn
2013-01-26 15:33     ` Andrew Lunn
2013-01-26 15:44       ` Jason Cooper
2013-01-26 20:50 ` [PATCH V4 0/8] ARM: kirkwood: cleanup DT conversion Jason Cooper
2013-01-26 20:50   ` [PATCH V4 01/11] ARM: kirkwood: topkick: init mvsdio via DT Jason Cooper
2013-02-16 16:25     ` Jason Cooper
2013-01-26 20:50   ` [PATCH V4 02/11] ARM: kirkwood: topkick: convert to pinctrl Jason Cooper
2013-02-16 16:11     ` Jason Cooper
2013-01-26 20:50   ` [PATCH V4 03/11] ARM: Kirkwood: topkick: Enable i2c bus Jason Cooper
2013-02-16 16:15     ` Jason Cooper
2013-01-26 20:50   ` [PATCH V4 04/11] ARM: kirkwood: nsa310: cleanup includes and unneeded code Jason Cooper
2013-01-26 20:50   ` [PATCH V4 05/11] ARM: kirkwood: nsa310: convert to pinctrl Jason Cooper
2013-02-16 16:17     ` Jason Cooper
2013-01-26 20:50   ` [PATCH V4 06/11] ARM: kirkwood: consolidate DT init of pcie Jason Cooper
2013-01-26 20:50   ` [PATCH V4 07/11] ARM: mvebu: correct gated clock documentation Jason Cooper
2013-02-15 20:37     ` Jason Cooper
2013-01-26 20:50   ` [PATCH V4 08/11] mv643xx.c: Add basic device tree support Jason Cooper
2013-01-26 20:50   ` [PATCH V4 09/11] NET: mv643xx: Get clk from device tree Jason Cooper
2013-01-27 14:27     ` [PATCH] NET: mv643xx: get smi clock " Sebastian Hesselbarth
2013-01-26 20:50   ` [PATCH V4 10/11] ARM: kirkwood: mv643xx_eth dt conversion Jason Cooper
2013-01-27 13:41     ` Sebastian Hesselbarth
2013-01-27 15:35       ` Jason Cooper
2013-01-26 20:50   ` [PATCH V4 11/11] ARM: Kirkwood: Convert QNAP TS219 Ethernet to DT 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.