diff mbox

[RFC,6/6] ARM: kirkwood: consolidate mv643xx_eth init for DT

Message ID ecb64cdf824399badaf9d659177811d8cb091156.1358983578.git.jason@lakedaemon.net (mailing list archive)
State New, archived
Headers show

Commit Message

Jason Cooper Jan. 23, 2013, 11:34 p.m. UTC
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

Comments

Jason Cooper Jan. 24, 2013, 1:39 a.m. UTC | #1
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.
Andrew Lunn Jan. 24, 2013, 6:23 a.m. UTC | #2
> > +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
Jason Cooper Jan. 24, 2013, 12:07 p.m. UTC | #3
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.
Florian Fainelli Jan. 24, 2013, 1:37 p.m. UTC | #4
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
Jason Cooper Jan. 24, 2013, 2:37 p.m. UTC | #5
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/
Arnd Bergmann Jan. 24, 2013, 3:54 p.m. UTC | #6
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
Jason Cooper Jan. 24, 2013, 4:13 p.m. UTC | #7
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.
Florian Fainelli Jan. 24, 2013, 5:51 p.m. UTC | #8
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
Jason Cooper Jan. 24, 2013, 6:16 p.m. UTC | #9
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.
Florian Fainelli Jan. 24, 2013, 8:27 p.m. UTC | #10
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.
Jason Cooper Jan. 24, 2013, 8:38 p.m. UTC | #11
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@72000 {
+                       compatible = "marvell,mdio-mv643xx";
+                       reg = <0x72000 0x4000>;
+                       interrupts = <46>;
+                       status = "disabled";
+               };
+
+               smi1: mdio@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.
Florian Fainelli Jan. 24, 2013, 8:52 p.m. UTC | #12
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@72000 {
> +                       compatible = "marvell,mdio-mv643xx";
> +                       reg = <0x72000 0x4000>;
> +                       interrupts = <46>;
> +                       status = "disabled";
> +               };
> +
> +               smi1: mdio@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.
diff mbox

Patch

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);