linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] ARM: Dove: split legacy and DT setup
@ 2012-12-18  0:24 Sebastian Hesselbarth
  2012-12-18  0:24 ` [PATCH 2/3] ARM: Dove: cleanup includes Sebastian Hesselbarth
                   ` (4 more replies)
  0 siblings, 5 replies; 16+ messages in thread
From: Sebastian Hesselbarth @ 2012-12-18  0:24 UTC (permalink / raw)
  To: Sebastian Hesselbarth
  Cc: Russell King, Jason Cooper, Andrew Lunn, linux-arm-kernel, linux-kernel

In the beginning of DT for Dove it was reasonable to have it close to
non-DT code. With improved DT support, it became more and more difficult
to not break non-DT while changing DT code.

This patch splits up DT board setup and introduces a DOVE_LEGACY config
to allow to remove legacy code for DT-only kernels.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
---
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Jason Cooper <jason@lakedaemon.net>
Cc: Andrew Lunn <andrew@lunn.ch>
Cc: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-kernel@vger.kernel.org
---
 arch/arm/mach-dove/Kconfig    |    5 ++
 arch/arm/mach-dove/Makefile   |    4 +-
 arch/arm/mach-dove/board-dt.c |  102 +++++++++++++++++++++++++++++++++++++++++
 arch/arm/mach-dove/common.c   |   85 ----------------------------------
 4 files changed, 110 insertions(+), 86 deletions(-)
 create mode 100644 arch/arm/mach-dove/board-dt.c

diff --git a/arch/arm/mach-dove/Kconfig b/arch/arm/mach-dove/Kconfig
index 603c5fd..aedd0ba 100644
--- a/arch/arm/mach-dove/Kconfig
+++ b/arch/arm/mach-dove/Kconfig
@@ -2,8 +2,12 @@ if ARCH_DOVE
 
 menu "Marvell Dove Implementations"
 
+config DOVE_LEGACY
+	bool
+
 config MACH_DOVE_DB
 	bool "Marvell DB-MV88AP510 Development Board"
+	select DOVE_LEGACY
 	select I2C_BOARDINFO
 	help
 	  Say 'Y' here if you want your kernel to support the
@@ -11,6 +15,7 @@ config MACH_DOVE_DB
 
 config MACH_CM_A510
 	bool "CompuLab CM-A510 Board"
+	select DOVE_LEGACY
 	help
 	  Say 'Y' here if you want your kernel to support the
 	  CompuLab CM-A510 Board.
diff --git a/arch/arm/mach-dove/Makefile b/arch/arm/mach-dove/Makefile
index 5e683ba..3f0a858 100644
--- a/arch/arm/mach-dove/Makefile
+++ b/arch/arm/mach-dove/Makefile
@@ -1,4 +1,6 @@
-obj-y				+= common.o addr-map.o irq.o mpp.o
+obj-y				+= common.o addr-map.o irq.o
+obj-$(CONFIG_DOVE_LEGACY)	+= mpp.o
 obj-$(CONFIG_PCI)		+= pcie.o
 obj-$(CONFIG_MACH_DOVE_DB)	+= dove-db-setup.o
+obj-$(CONFIG_MACH_DOVE_DT)	+= board-dt.o
 obj-$(CONFIG_MACH_CM_A510)	+= cm-a510.o
diff --git a/arch/arm/mach-dove/board-dt.c b/arch/arm/mach-dove/board-dt.c
new file mode 100644
index 0000000..2310f55
--- /dev/null
+++ b/arch/arm/mach-dove/board-dt.c
@@ -0,0 +1,102 @@
+/*
+ * arch/arm/mach-dove/board-dt.c
+ *
+ * Marvell Dove 88AP510 System On Chip FDT Board
+ *
+ * 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/init.h>
+#include <linux/clk-provider.h>
+#include <linux/clk/mvebu.h>
+#include <linux/of.h>
+#include <linux/of_platform.h>
+#include <linux/platform_data/usb-ehci-orion.h>
+#include <asm/hardware/cache-tauros2.h>
+#include <asm/mach/arch.h>
+#include <mach/pm.h>
+#include <plat/common.h>
+#include <plat/irq.h>
+#include "common.h"
+
+/*
+ * There are still devices that doesn't even know about DT,
+ * get clock gates here and add a clock lookup.
+ */
+static void __init dove_legacy_clk_init(void)
+{
+	struct device_node *np = of_find_compatible_node(NULL, NULL,
+					 "marvell,dove-gating-clock");
+	struct of_phandle_args clkspec;
+
+	clkspec.np = np;
+	clkspec.args_count = 1;
+
+	clkspec.args[0] = CLOCK_GATING_BIT_USB0;
+	orion_clkdev_add(NULL, "orion-ehci.0",
+			 of_clk_get_from_provider(&clkspec));
+
+	clkspec.args[0] = CLOCK_GATING_BIT_USB1;
+	orion_clkdev_add(NULL, "orion-ehci.1",
+			 of_clk_get_from_provider(&clkspec));
+
+	clkspec.args[0] = CLOCK_GATING_BIT_GBE;
+	orion_clkdev_add(NULL, "mv643xx_eth_port.0",
+			 of_clk_get_from_provider(&clkspec));
+
+	clkspec.args[0] = CLOCK_GATING_BIT_PCIE0;
+	orion_clkdev_add("0", "pcie",
+			 of_clk_get_from_provider(&clkspec));
+
+	clkspec.args[0] = CLOCK_GATING_BIT_PCIE1;
+	orion_clkdev_add("1", "pcie",
+			 of_clk_get_from_provider(&clkspec));
+}
+
+static void __init dove_of_clk_init(void)
+{
+	mvebu_clocks_init();
+	dove_legacy_clk_init();
+}
+
+static struct mv643xx_eth_platform_data dove_dt_ge00_data = {
+	.phy_addr = MV643XX_ETH_PHY_ADDR_DEFAULT,
+};
+
+static void __init dove_dt_init(void)
+{
+	pr_info("Dove 88AP510 SoC\n");
+
+#ifdef CONFIG_CACHE_TAUROS2
+	tauros2_init(0);
+#endif
+	dove_setup_cpu_mbus();
+
+	/* Setup root of clk tree */
+	dove_of_clk_init();
+
+	/* Internal devices not ported to DT yet */
+	dove_ge00_init(&dove_dt_ge00_data);
+	dove_ehci0_init();
+	dove_ehci1_init();
+	dove_pcie_init(1, 1);
+
+	of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
+}
+
+static const char * const dove_dt_board_compat[] = {
+	"marvell,dove",
+	NULL
+};
+
+DT_MACHINE_START(DOVE_DT, "Marvell Dove (Flattened Device Tree)")
+	.map_io		= dove_map_io,
+	.init_early	= dove_init_early,
+	.init_irq	= orion_dt_init_irq,
+	.timer		= &dove_timer,
+	.init_machine	= dove_dt_init,
+	.restart	= dove_restart,
+	.dt_compat	= dove_dt_board_compat,
+MACHINE_END
diff --git a/arch/arm/mach-dove/common.c b/arch/arm/mach-dove/common.c
index 89f4f99..7dda832 100644
--- a/arch/arm/mach-dove/common.c
+++ b/arch/arm/mach-dove/common.c
@@ -375,88 +375,3 @@ void dove_restart(char mode, const char *cmd)
 	while (1)
 		;
 }
-
-#if defined(CONFIG_MACH_DOVE_DT)
-/*
- * There are still devices that doesn't even know about DT,
- * get clock gates here and add a clock lookup.
- */
-static void __init dove_legacy_clk_init(void)
-{
-	struct device_node *np = of_find_compatible_node(NULL, NULL,
-					 "marvell,dove-gating-clock");
-	struct of_phandle_args clkspec;
-
-	clkspec.np = np;
-	clkspec.args_count = 1;
-
-	clkspec.args[0] = CLOCK_GATING_BIT_USB0;
-	orion_clkdev_add(NULL, "orion-ehci.0",
-			 of_clk_get_from_provider(&clkspec));
-
-	clkspec.args[0] = CLOCK_GATING_BIT_USB1;
-	orion_clkdev_add(NULL, "orion-ehci.1",
-			 of_clk_get_from_provider(&clkspec));
-
-	clkspec.args[0] = CLOCK_GATING_BIT_GBE;
-	orion_clkdev_add(NULL, "mv643xx_eth_port.0",
-			 of_clk_get_from_provider(&clkspec));
-
-	clkspec.args[0] = CLOCK_GATING_BIT_PCIE0;
-	orion_clkdev_add("0", "pcie",
-			 of_clk_get_from_provider(&clkspec));
-
-	clkspec.args[0] = CLOCK_GATING_BIT_PCIE1;
-	orion_clkdev_add("1", "pcie",
-			 of_clk_get_from_provider(&clkspec));
-}
-
-static void __init dove_of_clk_init(void)
-{
-	mvebu_clocks_init();
-	dove_legacy_clk_init();
-}
-
-static struct mv643xx_eth_platform_data dove_dt_ge00_data = {
-	.phy_addr = MV643XX_ETH_PHY_ADDR_DEFAULT,
-};
-
-static void __init dove_dt_init(void)
-{
-	pr_info("Dove 88AP510 SoC, TCLK = %d MHz.\n",
-		(dove_tclk + 499999) / 1000000);
-
-#ifdef CONFIG_CACHE_TAUROS2
-	tauros2_init(0);
-#endif
-	dove_setup_cpu_mbus();
-
-	/* Setup root of clk tree */
-	dove_of_clk_init();
-
-	/* Internal devices not ported to DT yet */
-	dove_rtc_init();
-
-	dove_ge00_init(&dove_dt_ge00_data);
-	dove_ehci0_init();
-	dove_ehci1_init();
-	dove_pcie_init(1, 1);
-
-	of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
-}
-
-static const char * const dove_dt_board_compat[] = {
-	"marvell,dove",
-	NULL
-};
-
-DT_MACHINE_START(DOVE_DT, "Marvell Dove (Flattened Device Tree)")
-	.map_io		= dove_map_io,
-	.init_early	= dove_init_early,
-	.init_irq	= orion_dt_init_irq,
-	.timer		= &dove_timer,
-	.init_machine	= dove_dt_init,
-	.restart	= dove_restart,
-	.dt_compat	= dove_dt_board_compat,
-MACHINE_END
-#endif
-- 
1.7.10.4


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

* [PATCH 2/3] ARM: Dove: cleanup includes
  2012-12-18  0:24 [PATCH 1/3] ARM: Dove: split legacy and DT setup Sebastian Hesselbarth
@ 2012-12-18  0:24 ` Sebastian Hesselbarth
  2013-01-28  2:20   ` Jason Cooper
  2012-12-18  0:24 ` [PATCH 3/3] ARM: Dove: add Cubox sdhci card detect gpio Sebastian Hesselbarth
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 16+ messages in thread
From: Sebastian Hesselbarth @ 2012-12-18  0:24 UTC (permalink / raw)
  To: Sebastian Hesselbarth
  Cc: Russell King, Jason Cooper, Andrew Lunn, linux-arm-kernel, linux-kernel

With DT board setup removed from common code, it is a good time
to cleanup unneccessary includes from common dove code.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
---
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Jason Cooper <jason@lakedaemon.net>
Cc: Andrew Lunn <andrew@lunn.ch>
Cc: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-kernel@vger.kernel.org
---
 arch/arm/mach-dove/common.c |   30 +++++++++---------------------
 1 file changed, 9 insertions(+), 21 deletions(-)

diff --git a/arch/arm/mach-dove/common.c b/arch/arm/mach-dove/common.c
index 7dda832..0e61cc4 100644
--- a/arch/arm/mach-dove/common.c
+++ b/arch/arm/mach-dove/common.c
@@ -8,35 +8,23 @@
  * warranty of any kind, whether express or implied.
  */
 
-#include <linux/kernel.h>
-#include <linux/delay.h>
 #include <linux/init.h>
-#include <linux/platform_device.h>
-#include <linux/pci.h>
 #include <linux/clk-provider.h>
-#include <linux/clk/mvebu.h>
-#include <linux/ata_platform.h>
-#include <linux/gpio.h>
-#include <linux/of.h>
-#include <linux/of_platform.h>
-#include <asm/page.h>
-#include <asm/setup.h>
-#include <asm/timex.h>
+#include <linux/kernel.h>
+#include <linux/pci.h>
+#include <linux/platform_data/usb-ehci-orion.h>
+#include <linux/platform_data/dma-mv_xor.h>
+#include <linux/platform_device.h>
 #include <asm/hardware/cache-tauros2.h>
 #include <asm/mach/map.h>
 #include <asm/mach/time.h>
-#include <asm/mach/pci.h>
+#include <mach/bridge-regs.h>
 #include <mach/dove.h>
 #include <mach/pm.h>
-#include <mach/bridge-regs.h>
-#include <asm/mach/arch.h>
-#include <linux/irq.h>
-#include <plat/time.h>
-#include <linux/platform_data/usb-ehci-orion.h>
-#include <linux/platform_data/dma-mv_xor.h>
-#include <plat/irq.h>
-#include <plat/common.h>
 #include <plat/addr-map.h>
+#include <plat/common.h>
+#include <plat/irq.h>
+#include <plat/time.h>
 #include "common.h"
 
 /*****************************************************************************
-- 
1.7.10.4


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

* [PATCH 3/3] ARM: Dove: add Cubox sdhci card detect gpio
  2012-12-18  0:24 [PATCH 1/3] ARM: Dove: split legacy and DT setup Sebastian Hesselbarth
  2012-12-18  0:24 ` [PATCH 2/3] ARM: Dove: cleanup includes Sebastian Hesselbarth
@ 2012-12-18  0:24 ` Sebastian Hesselbarth
  2012-12-18  0:38   ` Jason Cooper
  2013-01-10  2:17   ` Jason Cooper
  2012-12-18  0:35 ` [PATCH 1/3] ARM: Dove: split legacy and DT setup Jason Cooper
                   ` (2 subsequent siblings)
  4 siblings, 2 replies; 16+ messages in thread
From: Sebastian Hesselbarth @ 2012-12-18  0:24 UTC (permalink / raw)
  To: Sebastian Hesselbarth
  Cc: Russell King, Jason Cooper, Andrew Lunn, linux-arm-kernel, linux-kernel

Card detect for sdhci on Cubox is connected to the wrong pin
(sdio1_cd instead of sdio0_cd). With support for cd-gpios and
pinctrl add the corresponding properties to DT for Cubox.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
---
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Jason Cooper <jason@lakedaemon.net>
Cc: Andrew Lunn <andrew@lunn.ch>
Cc: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-kernel@vger.kernel.org
---
 arch/arm/boot/dts/dove-cubox.dts |   14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/arch/arm/boot/dts/dove-cubox.dts b/arch/arm/boot/dts/dove-cubox.dts
index fed7d3f..cdee96f 100644
--- a/arch/arm/boot/dts/dove-cubox.dts
+++ b/arch/arm/boot/dts/dove-cubox.dts
@@ -26,10 +26,15 @@
 };
 
 &uart0 { status = "okay"; };
-&sdio0 { status = "okay"; };
 &sata0 { status = "okay"; };
 &i2c0 { status = "okay"; };
 
+&sdio0 {
+	status = "okay";
+	/* sdio0 card detect is connected to wrong pin on CuBox */
+	cd-gpios = <&gpio0 12 1>;
+};
+
 &spi0 {
 	status = "okay";
 
@@ -42,9 +47,14 @@
 };
 
 &pinctrl {
-	pinctrl-0 = <&pmx_gpio_18>;
+	pinctrl-0 = <&pmx_gpio_12 &pmx_gpio_18>;
 	pinctrl-names = "default";
 
+	pmx_gpio_12: pmx-gpio-12 {
+		marvell,pins = "mpp12";
+		marvell,function = "gpio";
+	};
+
 	pmx_gpio_18: pmx-gpio-18 {
 		marvell,pins = "mpp18";
 		marvell,function = "gpio";
-- 
1.7.10.4


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

* Re: [PATCH 1/3] ARM: Dove: split legacy and DT setup
  2012-12-18  0:24 [PATCH 1/3] ARM: Dove: split legacy and DT setup Sebastian Hesselbarth
  2012-12-18  0:24 ` [PATCH 2/3] ARM: Dove: cleanup includes Sebastian Hesselbarth
  2012-12-18  0:24 ` [PATCH 3/3] ARM: Dove: add Cubox sdhci card detect gpio Sebastian Hesselbarth
@ 2012-12-18  0:35 ` Jason Cooper
  2013-01-28  2:19 ` Jason Cooper
  2013-01-29 21:23 ` [PATCH v2 1/2] ARM: dove: cleanup includes Sebastian Hesselbarth
  4 siblings, 0 replies; 16+ messages in thread
From: Jason Cooper @ 2012-12-18  0:35 UTC (permalink / raw)
  To: Sebastian Hesselbarth
  Cc: Russell King, Andrew Lunn, linux-arm-kernel, linux-kernel

Sebastian,

On Tue, Dec 18, 2012 at 01:24:27AM +0100, Sebastian Hesselbarth wrote:
> In the beginning of DT for Dove it was reasonable to have it close to
> non-DT code. With improved DT support, it became more and more difficult
> to not break non-DT while changing DT code.
> 
> This patch splits up DT board setup and introduces a DOVE_LEGACY config
> to allow to remove legacy code for DT-only kernels.
> 
> Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
> ---
> Cc: Russell King <linux@arm.linux.org.uk>
> Cc: Jason Cooper <jason@lakedaemon.net>
> Cc: Andrew Lunn <andrew@lunn.ch>
> Cc: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
> Cc: linux-arm-kernel@lists.infradead.org
> Cc: linux-kernel@vger.kernel.org
> ---
>  arch/arm/mach-dove/Kconfig    |    5 ++
>  arch/arm/mach-dove/Makefile   |    4 +-
>  arch/arm/mach-dove/board-dt.c |  102 +++++++++++++++++++++++++++++++++++++++++
>  arch/arm/mach-dove/common.c   |   85 ----------------------------------

Could you please make this patch second in the series?  It'll prevent
dependency problems later if cleanup (patch #2) comes before board work.

thx,

Jason.

>  4 files changed, 110 insertions(+), 86 deletions(-)
>  create mode 100644 arch/arm/mach-dove/board-dt.c
> 
> diff --git a/arch/arm/mach-dove/Kconfig b/arch/arm/mach-dove/Kconfig
> index 603c5fd..aedd0ba 100644
> --- a/arch/arm/mach-dove/Kconfig
> +++ b/arch/arm/mach-dove/Kconfig
> @@ -2,8 +2,12 @@ if ARCH_DOVE
>  
>  menu "Marvell Dove Implementations"
>  
> +config DOVE_LEGACY
> +	bool
> +
>  config MACH_DOVE_DB
>  	bool "Marvell DB-MV88AP510 Development Board"
> +	select DOVE_LEGACY
>  	select I2C_BOARDINFO
>  	help
>  	  Say 'Y' here if you want your kernel to support the
> @@ -11,6 +15,7 @@ config MACH_DOVE_DB
>  
>  config MACH_CM_A510
>  	bool "CompuLab CM-A510 Board"
> +	select DOVE_LEGACY
>  	help
>  	  Say 'Y' here if you want your kernel to support the
>  	  CompuLab CM-A510 Board.
> diff --git a/arch/arm/mach-dove/Makefile b/arch/arm/mach-dove/Makefile
> index 5e683ba..3f0a858 100644
> --- a/arch/arm/mach-dove/Makefile
> +++ b/arch/arm/mach-dove/Makefile
> @@ -1,4 +1,6 @@
> -obj-y				+= common.o addr-map.o irq.o mpp.o
> +obj-y				+= common.o addr-map.o irq.o
> +obj-$(CONFIG_DOVE_LEGACY)	+= mpp.o
>  obj-$(CONFIG_PCI)		+= pcie.o
>  obj-$(CONFIG_MACH_DOVE_DB)	+= dove-db-setup.o
> +obj-$(CONFIG_MACH_DOVE_DT)	+= board-dt.o
>  obj-$(CONFIG_MACH_CM_A510)	+= cm-a510.o
> diff --git a/arch/arm/mach-dove/board-dt.c b/arch/arm/mach-dove/board-dt.c
> new file mode 100644
> index 0000000..2310f55
> --- /dev/null
> +++ b/arch/arm/mach-dove/board-dt.c
> @@ -0,0 +1,102 @@
> +/*
> + * arch/arm/mach-dove/board-dt.c
> + *
> + * Marvell Dove 88AP510 System On Chip FDT Board
> + *
> + * 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/init.h>
> +#include <linux/clk-provider.h>
> +#include <linux/clk/mvebu.h>
> +#include <linux/of.h>
> +#include <linux/of_platform.h>
> +#include <linux/platform_data/usb-ehci-orion.h>
> +#include <asm/hardware/cache-tauros2.h>
> +#include <asm/mach/arch.h>
> +#include <mach/pm.h>
> +#include <plat/common.h>
> +#include <plat/irq.h>
> +#include "common.h"
> +
> +/*
> + * There are still devices that doesn't even know about DT,
> + * get clock gates here and add a clock lookup.
> + */
> +static void __init dove_legacy_clk_init(void)
> +{
> +	struct device_node *np = of_find_compatible_node(NULL, NULL,
> +					 "marvell,dove-gating-clock");
> +	struct of_phandle_args clkspec;
> +
> +	clkspec.np = np;
> +	clkspec.args_count = 1;
> +
> +	clkspec.args[0] = CLOCK_GATING_BIT_USB0;
> +	orion_clkdev_add(NULL, "orion-ehci.0",
> +			 of_clk_get_from_provider(&clkspec));
> +
> +	clkspec.args[0] = CLOCK_GATING_BIT_USB1;
> +	orion_clkdev_add(NULL, "orion-ehci.1",
> +			 of_clk_get_from_provider(&clkspec));
> +
> +	clkspec.args[0] = CLOCK_GATING_BIT_GBE;
> +	orion_clkdev_add(NULL, "mv643xx_eth_port.0",
> +			 of_clk_get_from_provider(&clkspec));
> +
> +	clkspec.args[0] = CLOCK_GATING_BIT_PCIE0;
> +	orion_clkdev_add("0", "pcie",
> +			 of_clk_get_from_provider(&clkspec));
> +
> +	clkspec.args[0] = CLOCK_GATING_BIT_PCIE1;
> +	orion_clkdev_add("1", "pcie",
> +			 of_clk_get_from_provider(&clkspec));
> +}
> +
> +static void __init dove_of_clk_init(void)
> +{
> +	mvebu_clocks_init();
> +	dove_legacy_clk_init();
> +}
> +
> +static struct mv643xx_eth_platform_data dove_dt_ge00_data = {
> +	.phy_addr = MV643XX_ETH_PHY_ADDR_DEFAULT,
> +};
> +
> +static void __init dove_dt_init(void)
> +{
> +	pr_info("Dove 88AP510 SoC\n");
> +
> +#ifdef CONFIG_CACHE_TAUROS2
> +	tauros2_init(0);
> +#endif
> +	dove_setup_cpu_mbus();
> +
> +	/* Setup root of clk tree */
> +	dove_of_clk_init();
> +
> +	/* Internal devices not ported to DT yet */
> +	dove_ge00_init(&dove_dt_ge00_data);
> +	dove_ehci0_init();
> +	dove_ehci1_init();
> +	dove_pcie_init(1, 1);
> +
> +	of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
> +}
> +
> +static const char * const dove_dt_board_compat[] = {
> +	"marvell,dove",
> +	NULL
> +};
> +
> +DT_MACHINE_START(DOVE_DT, "Marvell Dove (Flattened Device Tree)")
> +	.map_io		= dove_map_io,
> +	.init_early	= dove_init_early,
> +	.init_irq	= orion_dt_init_irq,
> +	.timer		= &dove_timer,
> +	.init_machine	= dove_dt_init,
> +	.restart	= dove_restart,
> +	.dt_compat	= dove_dt_board_compat,
> +MACHINE_END
> diff --git a/arch/arm/mach-dove/common.c b/arch/arm/mach-dove/common.c
> index 89f4f99..7dda832 100644
> --- a/arch/arm/mach-dove/common.c
> +++ b/arch/arm/mach-dove/common.c
> @@ -375,88 +375,3 @@ void dove_restart(char mode, const char *cmd)
>  	while (1)
>  		;
>  }
> -
> -#if defined(CONFIG_MACH_DOVE_DT)
> -/*
> - * There are still devices that doesn't even know about DT,
> - * get clock gates here and add a clock lookup.
> - */
> -static void __init dove_legacy_clk_init(void)
> -{
> -	struct device_node *np = of_find_compatible_node(NULL, NULL,
> -					 "marvell,dove-gating-clock");
> -	struct of_phandle_args clkspec;
> -
> -	clkspec.np = np;
> -	clkspec.args_count = 1;
> -
> -	clkspec.args[0] = CLOCK_GATING_BIT_USB0;
> -	orion_clkdev_add(NULL, "orion-ehci.0",
> -			 of_clk_get_from_provider(&clkspec));
> -
> -	clkspec.args[0] = CLOCK_GATING_BIT_USB1;
> -	orion_clkdev_add(NULL, "orion-ehci.1",
> -			 of_clk_get_from_provider(&clkspec));
> -
> -	clkspec.args[0] = CLOCK_GATING_BIT_GBE;
> -	orion_clkdev_add(NULL, "mv643xx_eth_port.0",
> -			 of_clk_get_from_provider(&clkspec));
> -
> -	clkspec.args[0] = CLOCK_GATING_BIT_PCIE0;
> -	orion_clkdev_add("0", "pcie",
> -			 of_clk_get_from_provider(&clkspec));
> -
> -	clkspec.args[0] = CLOCK_GATING_BIT_PCIE1;
> -	orion_clkdev_add("1", "pcie",
> -			 of_clk_get_from_provider(&clkspec));
> -}
> -
> -static void __init dove_of_clk_init(void)
> -{
> -	mvebu_clocks_init();
> -	dove_legacy_clk_init();
> -}
> -
> -static struct mv643xx_eth_platform_data dove_dt_ge00_data = {
> -	.phy_addr = MV643XX_ETH_PHY_ADDR_DEFAULT,
> -};
> -
> -static void __init dove_dt_init(void)
> -{
> -	pr_info("Dove 88AP510 SoC, TCLK = %d MHz.\n",
> -		(dove_tclk + 499999) / 1000000);
> -
> -#ifdef CONFIG_CACHE_TAUROS2
> -	tauros2_init(0);
> -#endif
> -	dove_setup_cpu_mbus();
> -
> -	/* Setup root of clk tree */
> -	dove_of_clk_init();
> -
> -	/* Internal devices not ported to DT yet */
> -	dove_rtc_init();
> -
> -	dove_ge00_init(&dove_dt_ge00_data);
> -	dove_ehci0_init();
> -	dove_ehci1_init();
> -	dove_pcie_init(1, 1);
> -
> -	of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
> -}
> -
> -static const char * const dove_dt_board_compat[] = {
> -	"marvell,dove",
> -	NULL
> -};
> -
> -DT_MACHINE_START(DOVE_DT, "Marvell Dove (Flattened Device Tree)")
> -	.map_io		= dove_map_io,
> -	.init_early	= dove_init_early,
> -	.init_irq	= orion_dt_init_irq,
> -	.timer		= &dove_timer,
> -	.init_machine	= dove_dt_init,
> -	.restart	= dove_restart,
> -	.dt_compat	= dove_dt_board_compat,
> -MACHINE_END
> -#endif
> -- 
> 1.7.10.4
> 

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

* Re: [PATCH 3/3] ARM: Dove: add Cubox sdhci card detect gpio
  2012-12-18  0:24 ` [PATCH 3/3] ARM: Dove: add Cubox sdhci card detect gpio Sebastian Hesselbarth
@ 2012-12-18  0:38   ` Jason Cooper
  2012-12-18  0:50     ` Sebastian Hesselbarth
  2013-01-10  2:17   ` Jason Cooper
  1 sibling, 1 reply; 16+ messages in thread
From: Jason Cooper @ 2012-12-18  0:38 UTC (permalink / raw)
  To: Sebastian Hesselbarth
  Cc: Russell King, Andrew Lunn, linux-arm-kernel, linux-kernel

Sebastian,

On Tue, Dec 18, 2012 at 01:24:29AM +0100, Sebastian Hesselbarth wrote:
> Card detect for sdhci on Cubox is connected to the wrong pin
> (sdio1_cd instead of sdio0_cd). With support for cd-gpios and
> pinctrl add the corresponding properties to DT for Cubox.
> 
> Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
> ---
> Cc: Russell King <linux@arm.linux.org.uk>
> Cc: Jason Cooper <jason@lakedaemon.net>
> Cc: Andrew Lunn <andrew@lunn.ch>
> Cc: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
> Cc: linux-arm-kernel@lists.infradead.org
> Cc: linux-kernel@vger.kernel.org
> ---
>  arch/arm/boot/dts/dove-cubox.dts |   14 ++++++++++++--
>  1 file changed, 12 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/arm/boot/dts/dove-cubox.dts b/arch/arm/boot/dts/dove-cubox.dts
> index fed7d3f..cdee96f 100644
> --- a/arch/arm/boot/dts/dove-cubox.dts
> +++ b/arch/arm/boot/dts/dove-cubox.dts
> @@ -26,10 +26,15 @@
>  };
>  
>  &uart0 { status = "okay"; };
> -&sdio0 { status = "okay"; };
>  &sata0 { status = "okay"; };
>  &i2c0 { status = "okay"; };
>  
> +&sdio0 {
> +	status = "okay";
> +	/* sdio0 card detect is connected to wrong pin on CuBox */
> +	cd-gpios = <&gpio0 12 1>;

this looks like a fix that should be merged into v3.8, I'll cue it up
for v3.8-rc2.

thx,

Jason.

> +};
> +
>  &spi0 {
>  	status = "okay";
>  
> @@ -42,9 +47,14 @@
>  };
>  
>  &pinctrl {
> -	pinctrl-0 = <&pmx_gpio_18>;
> +	pinctrl-0 = <&pmx_gpio_12 &pmx_gpio_18>;
>  	pinctrl-names = "default";
>  
> +	pmx_gpio_12: pmx-gpio-12 {
> +		marvell,pins = "mpp12";
> +		marvell,function = "gpio";
> +	};
> +
>  	pmx_gpio_18: pmx-gpio-18 {
>  		marvell,pins = "mpp18";
>  		marvell,function = "gpio";
> -- 
> 1.7.10.4
> 

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

* Re: [PATCH 3/3] ARM: Dove: add Cubox sdhci card detect gpio
  2012-12-18  0:38   ` Jason Cooper
@ 2012-12-18  0:50     ` Sebastian Hesselbarth
  2012-12-18  1:37       ` Jason Cooper
  0 siblings, 1 reply; 16+ messages in thread
From: Sebastian Hesselbarth @ 2012-12-18  0:50 UTC (permalink / raw)
  To: Jason Cooper; +Cc: Russell King, Andrew Lunn, linux-arm-kernel, linux-kernel

On 12/18/2012 01:38 AM, Jason Cooper wrote:
 > On Tue, Dec 18, 2012 at 01:24:29AM +0100, Sebastian Hesselbarth wrote:
 >> Card detect for sdhci on Cubox is connected to the wrong pin
 >> (sdio1_cd instead of sdio0_cd). With support for cd-gpios and
 >> pinctrl add the corresponding properties to DT for Cubox.
 >>
 >> Signed-off-by: Sebastian Hesselbarth<sebastian.hesselbarth@gmail.com>
 >> ...
 >> +&sdio0 {
 >> +	status = "okay";
 >> +	/* sdio0 card detect is connected to wrong pin on CuBox */
 >> +	cd-gpios =<&gpio0 12 1>;
 >
 > this looks like a fix that should be merged into v3.8, I'll cue it up
 > for v3.8-rc2.

Jason,

it is more a feature than a fix, as gpio-cd support for sdhci-dove
moved in lately. You want me to split this patch from the other two
(that I'll reorder as requested)?

Sebastian

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

* Re: [PATCH 3/3] ARM: Dove: add Cubox sdhci card detect gpio
  2012-12-18  0:50     ` Sebastian Hesselbarth
@ 2012-12-18  1:37       ` Jason Cooper
  0 siblings, 0 replies; 16+ messages in thread
From: Jason Cooper @ 2012-12-18  1:37 UTC (permalink / raw)
  To: Sebastian Hesselbarth
  Cc: Russell King, Andrew Lunn, linux-arm-kernel, linux-kernel

On Tue, Dec 18, 2012 at 01:50:12AM +0100, Sebastian Hesselbarth wrote:
> On 12/18/2012 01:38 AM, Jason Cooper wrote:
> > On Tue, Dec 18, 2012 at 01:24:29AM +0100, Sebastian Hesselbarth wrote:
> >> Card detect for sdhci on Cubox is connected to the wrong pin
> >> (sdio1_cd instead of sdio0_cd). With support for cd-gpios and
> >> pinctrl add the corresponding properties to DT for Cubox.
> >>
> >> Signed-off-by: Sebastian Hesselbarth<sebastian.hesselbarth@gmail.com>
> >> ...
> >> +&sdio0 {
> >> +	status = "okay";
> >> +	/* sdio0 card detect is connected to wrong pin on CuBox */
> >> +	cd-gpios =<&gpio0 12 1>;
> >
> > this looks like a fix that should be merged into v3.8, I'll cue it up
> > for v3.8-rc2.
> 
> Jason,
> 
> it is more a feature than a fix, as gpio-cd support for sdhci-dove
> moved in lately. You want me to split this patch from the other two
> (that I'll reorder as requested)?

I was referring to the code more than the physical feature itself.  You
appear to remove the default &sdio0, and replace it with a working
version.  Looked like a fix to me ;-)

No need to send it separate, I'll apply it as is once v3.8-rc1 drops.

thx,

Jason.

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

* Re: [PATCH 3/3] ARM: Dove: add Cubox sdhci card detect gpio
  2012-12-18  0:24 ` [PATCH 3/3] ARM: Dove: add Cubox sdhci card detect gpio Sebastian Hesselbarth
  2012-12-18  0:38   ` Jason Cooper
@ 2013-01-10  2:17   ` Jason Cooper
  1 sibling, 0 replies; 16+ messages in thread
From: Jason Cooper @ 2013-01-10  2:17 UTC (permalink / raw)
  To: Sebastian Hesselbarth
  Cc: Andrew Lunn, Russell King, linux-arm-kernel, linux-kernel

On Tue, Dec 18, 2012 at 01:24:29AM +0100, Sebastian Hesselbarth wrote:
> Card detect for sdhci on Cubox is connected to the wrong pin
> (sdio1_cd instead of sdio0_cd). With support for cd-gpios and
> pinctrl add the corresponding properties to DT for Cubox.
> 
> Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
> ---
> Cc: Russell King <linux@arm.linux.org.uk>
> Cc: Jason Cooper <jason@lakedaemon.net>
> Cc: Andrew Lunn <andrew@lunn.ch>
> Cc: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
> Cc: linux-arm-kernel@lists.infradead.org
> Cc: linux-kernel@vger.kernel.org
> ---
>  arch/arm/boot/dts/dove-cubox.dts |   14 ++++++++++++--
>  1 file changed, 12 insertions(+), 2 deletions(-)

Applied to mvebu/fixes

thx,

Jason.

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

* Re: [PATCH 1/3] ARM: Dove: split legacy and DT setup
  2012-12-18  0:24 [PATCH 1/3] ARM: Dove: split legacy and DT setup Sebastian Hesselbarth
                   ` (2 preceding siblings ...)
  2012-12-18  0:35 ` [PATCH 1/3] ARM: Dove: split legacy and DT setup Jason Cooper
@ 2013-01-28  2:19 ` Jason Cooper
  2013-01-29 21:23 ` [PATCH v2 1/2] ARM: dove: cleanup includes Sebastian Hesselbarth
  4 siblings, 0 replies; 16+ messages in thread
From: Jason Cooper @ 2013-01-28  2:19 UTC (permalink / raw)
  To: Sebastian Hesselbarth
  Cc: Andrew Lunn, Russell King, linux-arm-kernel, linux-kernel

On Tue, Dec 18, 2012 at 01:24:27AM +0100, Sebastian Hesselbarth wrote:
> In the beginning of DT for Dove it was reasonable to have it close to
> non-DT code. With improved DT support, it became more and more difficult
> to not break non-DT while changing DT code.
> 
> This patch splits up DT board setup and introduces a DOVE_LEGACY config
> to allow to remove legacy code for DT-only kernels.
> 
> Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
> ---
> Cc: Russell King <linux@arm.linux.org.uk>
> Cc: Jason Cooper <jason@lakedaemon.net>
> Cc: Andrew Lunn <andrew@lunn.ch>
> Cc: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
> Cc: linux-arm-kernel@lists.infradead.org
> Cc: linux-kernel@vger.kernel.org
> ---
>  arch/arm/mach-dove/Kconfig    |    5 ++
>  arch/arm/mach-dove/Makefile   |    4 +-
>  arch/arm/mach-dove/board-dt.c |  102 +++++++++++++++++++++++++++++++++++++++++
>  arch/arm/mach-dove/common.c   |   85 ----------------------------------
>  4 files changed, 110 insertions(+), 86 deletions(-)
>  create mode 100644 arch/arm/mach-dove/board-dt.c

Applied to mvebu/boards

thx,

Jason.

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

* Re: [PATCH 2/3] ARM: Dove: cleanup includes
  2012-12-18  0:24 ` [PATCH 2/3] ARM: Dove: cleanup includes Sebastian Hesselbarth
@ 2013-01-28  2:20   ` Jason Cooper
  0 siblings, 0 replies; 16+ messages in thread
From: Jason Cooper @ 2013-01-28  2:20 UTC (permalink / raw)
  To: Sebastian Hesselbarth
  Cc: Andrew Lunn, Russell King, linux-arm-kernel, linux-kernel

On Tue, Dec 18, 2012 at 01:24:28AM +0100, Sebastian Hesselbarth wrote:
> With DT board setup removed from common code, it is a good time
> to cleanup unneccessary includes from common dove code.
> 
> Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
> ---
> Cc: Russell King <linux@arm.linux.org.uk>
> Cc: Jason Cooper <jason@lakedaemon.net>
> Cc: Andrew Lunn <andrew@lunn.ch>
> Cc: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
> Cc: linux-arm-kernel@lists.infradead.org
> Cc: linux-kernel@vger.kernel.org
> ---
>  arch/arm/mach-dove/common.c |   30 +++++++++---------------------
>  1 file changed, 9 insertions(+), 21 deletions(-)

Applied to mvebu/cleanup

thx,

Jason.

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

* [PATCH v2 1/2] ARM: dove: cleanup includes
  2012-12-18  0:24 [PATCH 1/3] ARM: Dove: split legacy and DT setup Sebastian Hesselbarth
                   ` (3 preceding siblings ...)
  2013-01-28  2:19 ` Jason Cooper
@ 2013-01-29 21:23 ` Sebastian Hesselbarth
  2013-01-29 21:23   ` [PATCH v2 2/2] ARM: dove: split legacy and DT setup Sebastian Hesselbarth
  2013-01-29 21:36   ` [PATCH v2 1/2] ARM: dove: cleanup includes Jason Cooper
  4 siblings, 2 replies; 16+ messages in thread
From: Sebastian Hesselbarth @ 2013-01-29 21:23 UTC (permalink / raw)
  To: Sebastian Hesselbarth
  Cc: Russell King, Jason Cooper, Andrew Lunn, linux-arm-kernel, linux-kernel

This patch cleans unneccessary includes and reorders the remaining
includes in common dove code.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
---
Changelog:
[v2]
- restructure patches to first cleanup common.c includes [1/2]
  and then split legacy and DT specific code [2/2]
- removed v1 patch "[PATCH 3/3] ARM: Dove: add Cubox sdhci card
  detect gpio" that was taken independently

Cc: Russell King <linux@arm.linux.org.uk>
Cc: Jason Cooper <jason@lakedaemon.net>
Cc: Andrew Lunn <andrew@lunn.ch>
Cc: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-kernel@vger.kernel.org
---
 arch/arm/mach-dove/common.c |   29 +++++++++--------------------
 1 file changed, 9 insertions(+), 20 deletions(-)

diff --git a/arch/arm/mach-dove/common.c b/arch/arm/mach-dove/common.c
index 89f4f99..be887feea 100644
--- a/arch/arm/mach-dove/common.c
+++ b/arch/arm/mach-dove/common.c
@@ -8,35 +8,24 @@
  * warranty of any kind, whether express or implied.
  */
 
-#include <linux/kernel.h>
-#include <linux/delay.h>
-#include <linux/init.h>
-#include <linux/platform_device.h>
-#include <linux/pci.h>
 #include <linux/clk-provider.h>
 #include <linux/clk/mvebu.h>
-#include <linux/ata_platform.h>
-#include <linux/gpio.h>
+#include <linux/dma-mapping.h>
+#include <linux/init.h>
 #include <linux/of.h>
 #include <linux/of_platform.h>
-#include <asm/page.h>
-#include <asm/setup.h>
-#include <asm/timex.h>
+#include <linux/platform_data/dma-mv_xor.h>
+#include <linux/platform_data/usb-ehci-orion.h>
+#include <linux/platform_device.h>
 #include <asm/hardware/cache-tauros2.h>
+#include <asm/mach/arch.h>
 #include <asm/mach/map.h>
 #include <asm/mach/time.h>
-#include <asm/mach/pci.h>
-#include <mach/dove.h>
-#include <mach/pm.h>
 #include <mach/bridge-regs.h>
-#include <asm/mach/arch.h>
-#include <linux/irq.h>
-#include <plat/time.h>
-#include <linux/platform_data/usb-ehci-orion.h>
-#include <linux/platform_data/dma-mv_xor.h>
-#include <plat/irq.h>
+#include <mach/pm.h>
 #include <plat/common.h>
-#include <plat/addr-map.h>
+#include <plat/irq.h>
+#include <plat/time.h>
 #include "common.h"
 
 /*****************************************************************************
-- 
1.7.10.4


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

* [PATCH v2 2/2] ARM: dove: split legacy and DT setup
  2013-01-29 21:23 ` [PATCH v2 1/2] ARM: dove: cleanup includes Sebastian Hesselbarth
@ 2013-01-29 21:23   ` Sebastian Hesselbarth
  2013-01-29 21:26     ` Jason Cooper
  2013-01-29 21:36   ` [PATCH v2 1/2] ARM: dove: cleanup includes Jason Cooper
  1 sibling, 1 reply; 16+ messages in thread
From: Sebastian Hesselbarth @ 2013-01-29 21:23 UTC (permalink / raw)
  To: Sebastian Hesselbarth
  Cc: Russell King, Jason Cooper, Andrew Lunn, linux-arm-kernel, linux-kernel

In the beginning of DT for Dove it was reasonable to have it close to
non-DT code. With improved DT support, it became more and more difficult
to not break non-DT while changing DT code.

This patch splits up DT board setup and introduces a DOVE_LEGACY config
to allow to remove legacy code for DT-only kernels.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
---
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Jason Cooper <jason@lakedaemon.net>
Cc: Andrew Lunn <andrew@lunn.ch>
Cc: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-kernel@vger.kernel.org
---
 arch/arm/mach-dove/Kconfig  |    5 +++
 arch/arm/mach-dove/Makefile |    4 +-
 arch/arm/mach-dove/common.c |   90 -------------------------------------------
 arch/arm/mach-dove/common.h |    1 +
 4 files changed, 9 insertions(+), 91 deletions(-)

diff --git a/arch/arm/mach-dove/Kconfig b/arch/arm/mach-dove/Kconfig
index 603c5fd..aedd0ba 100644
--- a/arch/arm/mach-dove/Kconfig
+++ b/arch/arm/mach-dove/Kconfig
@@ -2,8 +2,12 @@ if ARCH_DOVE
 
 menu "Marvell Dove Implementations"
 
+config DOVE_LEGACY
+	bool
+
 config MACH_DOVE_DB
 	bool "Marvell DB-MV88AP510 Development Board"
+	select DOVE_LEGACY
 	select I2C_BOARDINFO
 	help
 	  Say 'Y' here if you want your kernel to support the
@@ -11,6 +15,7 @@ config MACH_DOVE_DB
 
 config MACH_CM_A510
 	bool "CompuLab CM-A510 Board"
+	select DOVE_LEGACY
 	help
 	  Say 'Y' here if you want your kernel to support the
 	  CompuLab CM-A510 Board.
diff --git a/arch/arm/mach-dove/Makefile b/arch/arm/mach-dove/Makefile
index 5e683ba..3f0a858 100644
--- a/arch/arm/mach-dove/Makefile
+++ b/arch/arm/mach-dove/Makefile
@@ -1,4 +1,6 @@
-obj-y				+= common.o addr-map.o irq.o mpp.o
+obj-y				+= common.o addr-map.o irq.o
+obj-$(CONFIG_DOVE_LEGACY)	+= mpp.o
 obj-$(CONFIG_PCI)		+= pcie.o
 obj-$(CONFIG_MACH_DOVE_DB)	+= dove-db-setup.o
+obj-$(CONFIG_MACH_DOVE_DT)	+= board-dt.o
 obj-$(CONFIG_MACH_CM_A510)	+= cm-a510.o
diff --git a/arch/arm/mach-dove/common.c b/arch/arm/mach-dove/common.c
index be887feea..aea14b4 100644
--- a/arch/arm/mach-dove/common.c
+++ b/arch/arm/mach-dove/common.c
@@ -9,22 +9,17 @@
  */
 
 #include <linux/clk-provider.h>
-#include <linux/clk/mvebu.h>
 #include <linux/dma-mapping.h>
 #include <linux/init.h>
-#include <linux/of.h>
-#include <linux/of_platform.h>
 #include <linux/platform_data/dma-mv_xor.h>
 #include <linux/platform_data/usb-ehci-orion.h>
 #include <linux/platform_device.h>
 #include <asm/hardware/cache-tauros2.h>
-#include <asm/mach/arch.h>
 #include <asm/mach/map.h>
 #include <asm/mach/time.h>
 #include <mach/bridge-regs.h>
 #include <mach/pm.h>
 #include <plat/common.h>
-#include <plat/irq.h>
 #include <plat/time.h>
 #include "common.h"
 
@@ -364,88 +359,3 @@ void dove_restart(char mode, const char *cmd)
 	while (1)
 		;
 }
-
-#if defined(CONFIG_MACH_DOVE_DT)
-/*
- * There are still devices that doesn't even know about DT,
- * get clock gates here and add a clock lookup.
- */
-static void __init dove_legacy_clk_init(void)
-{
-	struct device_node *np = of_find_compatible_node(NULL, NULL,
-					 "marvell,dove-gating-clock");
-	struct of_phandle_args clkspec;
-
-	clkspec.np = np;
-	clkspec.args_count = 1;
-
-	clkspec.args[0] = CLOCK_GATING_BIT_USB0;
-	orion_clkdev_add(NULL, "orion-ehci.0",
-			 of_clk_get_from_provider(&clkspec));
-
-	clkspec.args[0] = CLOCK_GATING_BIT_USB1;
-	orion_clkdev_add(NULL, "orion-ehci.1",
-			 of_clk_get_from_provider(&clkspec));
-
-	clkspec.args[0] = CLOCK_GATING_BIT_GBE;
-	orion_clkdev_add(NULL, "mv643xx_eth_port.0",
-			 of_clk_get_from_provider(&clkspec));
-
-	clkspec.args[0] = CLOCK_GATING_BIT_PCIE0;
-	orion_clkdev_add("0", "pcie",
-			 of_clk_get_from_provider(&clkspec));
-
-	clkspec.args[0] = CLOCK_GATING_BIT_PCIE1;
-	orion_clkdev_add("1", "pcie",
-			 of_clk_get_from_provider(&clkspec));
-}
-
-static void __init dove_of_clk_init(void)
-{
-	mvebu_clocks_init();
-	dove_legacy_clk_init();
-}
-
-static struct mv643xx_eth_platform_data dove_dt_ge00_data = {
-	.phy_addr = MV643XX_ETH_PHY_ADDR_DEFAULT,
-};
-
-static void __init dove_dt_init(void)
-{
-	pr_info("Dove 88AP510 SoC, TCLK = %d MHz.\n",
-		(dove_tclk + 499999) / 1000000);
-
-#ifdef CONFIG_CACHE_TAUROS2
-	tauros2_init(0);
-#endif
-	dove_setup_cpu_mbus();
-
-	/* Setup root of clk tree */
-	dove_of_clk_init();
-
-	/* Internal devices not ported to DT yet */
-	dove_rtc_init();
-
-	dove_ge00_init(&dove_dt_ge00_data);
-	dove_ehci0_init();
-	dove_ehci1_init();
-	dove_pcie_init(1, 1);
-
-	of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
-}
-
-static const char * const dove_dt_board_compat[] = {
-	"marvell,dove",
-	NULL
-};
-
-DT_MACHINE_START(DOVE_DT, "Marvell Dove (Flattened Device Tree)")
-	.map_io		= dove_map_io,
-	.init_early	= dove_init_early,
-	.init_irq	= orion_dt_init_irq,
-	.timer		= &dove_timer,
-	.init_machine	= dove_dt_init,
-	.restart	= dove_restart,
-	.dt_compat	= dove_dt_board_compat,
-MACHINE_END
-#endif
diff --git a/arch/arm/mach-dove/common.h b/arch/arm/mach-dove/common.h
index 1a23340..d17f760 100644
--- a/arch/arm/mach-dove/common.h
+++ b/arch/arm/mach-dove/common.h
@@ -25,6 +25,7 @@ void dove_init_early(void);
 void dove_init_irq(void);
 void dove_setup_cpu_mbus(void);
 void dove_ge00_init(struct mv643xx_eth_platform_data *eth_data);
+void dove_rtc_init(void);
 void dove_sata_init(struct mv_sata_platform_data *sata_data);
 #ifdef CONFIG_PCI
 void dove_pcie_init(int init_port0, int init_port1);
-- 
1.7.10.4


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

* Re: [PATCH v2 2/2] ARM: dove: split legacy and DT setup
  2013-01-29 21:23   ` [PATCH v2 2/2] ARM: dove: split legacy and DT setup Sebastian Hesselbarth
@ 2013-01-29 21:26     ` Jason Cooper
  2013-01-29 21:41       ` [PATCH v3 " Sebastian Hesselbarth
  0 siblings, 1 reply; 16+ messages in thread
From: Jason Cooper @ 2013-01-29 21:26 UTC (permalink / raw)
  To: Sebastian Hesselbarth
  Cc: Russell King, Andrew Lunn, linux-arm-kernel, linux-kernel

On Tue, Jan 29, 2013 at 10:23:10PM +0100, Sebastian Hesselbarth wrote:
> In the beginning of DT for Dove it was reasonable to have it close to
> non-DT code. With improved DT support, it became more and more difficult
> to not break non-DT while changing DT code.
> 
> This patch splits up DT board setup and introduces a DOVE_LEGACY config
> to allow to remove legacy code for DT-only kernels.
> 
> Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
> ---
> Cc: Russell King <linux@arm.linux.org.uk>
> Cc: Jason Cooper <jason@lakedaemon.net>
> Cc: Andrew Lunn <andrew@lunn.ch>
> Cc: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
> Cc: linux-arm-kernel@lists.infradead.org
> Cc: linux-kernel@vger.kernel.org
> ---
>  arch/arm/mach-dove/Kconfig  |    5 +++
>  arch/arm/mach-dove/Makefile |    4 +-
>  arch/arm/mach-dove/common.c |   90 -------------------------------------------

Shouldn't the above be added somewhere?

thx,

Jason.

>  arch/arm/mach-dove/common.h |    1 +
>  4 files changed, 9 insertions(+), 91 deletions(-)
> 
> diff --git a/arch/arm/mach-dove/Kconfig b/arch/arm/mach-dove/Kconfig
> index 603c5fd..aedd0ba 100644
> --- a/arch/arm/mach-dove/Kconfig
> +++ b/arch/arm/mach-dove/Kconfig
> @@ -2,8 +2,12 @@ if ARCH_DOVE
>  
>  menu "Marvell Dove Implementations"
>  
> +config DOVE_LEGACY
> +	bool
> +
>  config MACH_DOVE_DB
>  	bool "Marvell DB-MV88AP510 Development Board"
> +	select DOVE_LEGACY
>  	select I2C_BOARDINFO
>  	help
>  	  Say 'Y' here if you want your kernel to support the
> @@ -11,6 +15,7 @@ config MACH_DOVE_DB
>  
>  config MACH_CM_A510
>  	bool "CompuLab CM-A510 Board"
> +	select DOVE_LEGACY
>  	help
>  	  Say 'Y' here if you want your kernel to support the
>  	  CompuLab CM-A510 Board.
> diff --git a/arch/arm/mach-dove/Makefile b/arch/arm/mach-dove/Makefile
> index 5e683ba..3f0a858 100644
> --- a/arch/arm/mach-dove/Makefile
> +++ b/arch/arm/mach-dove/Makefile
> @@ -1,4 +1,6 @@
> -obj-y				+= common.o addr-map.o irq.o mpp.o
> +obj-y				+= common.o addr-map.o irq.o
> +obj-$(CONFIG_DOVE_LEGACY)	+= mpp.o
>  obj-$(CONFIG_PCI)		+= pcie.o
>  obj-$(CONFIG_MACH_DOVE_DB)	+= dove-db-setup.o
> +obj-$(CONFIG_MACH_DOVE_DT)	+= board-dt.o
>  obj-$(CONFIG_MACH_CM_A510)	+= cm-a510.o
> diff --git a/arch/arm/mach-dove/common.c b/arch/arm/mach-dove/common.c
> index be887feea..aea14b4 100644
> --- a/arch/arm/mach-dove/common.c
> +++ b/arch/arm/mach-dove/common.c
> @@ -9,22 +9,17 @@
>   */
>  
>  #include <linux/clk-provider.h>
> -#include <linux/clk/mvebu.h>
>  #include <linux/dma-mapping.h>
>  #include <linux/init.h>
> -#include <linux/of.h>
> -#include <linux/of_platform.h>
>  #include <linux/platform_data/dma-mv_xor.h>
>  #include <linux/platform_data/usb-ehci-orion.h>
>  #include <linux/platform_device.h>
>  #include <asm/hardware/cache-tauros2.h>
> -#include <asm/mach/arch.h>
>  #include <asm/mach/map.h>
>  #include <asm/mach/time.h>
>  #include <mach/bridge-regs.h>
>  #include <mach/pm.h>
>  #include <plat/common.h>
> -#include <plat/irq.h>
>  #include <plat/time.h>
>  #include "common.h"
>  
> @@ -364,88 +359,3 @@ void dove_restart(char mode, const char *cmd)
>  	while (1)
>  		;
>  }
> -
> -#if defined(CONFIG_MACH_DOVE_DT)
> -/*
> - * There are still devices that doesn't even know about DT,
> - * get clock gates here and add a clock lookup.
> - */
> -static void __init dove_legacy_clk_init(void)
> -{
> -	struct device_node *np = of_find_compatible_node(NULL, NULL,
> -					 "marvell,dove-gating-clock");
> -	struct of_phandle_args clkspec;
> -
> -	clkspec.np = np;
> -	clkspec.args_count = 1;
> -
> -	clkspec.args[0] = CLOCK_GATING_BIT_USB0;
> -	orion_clkdev_add(NULL, "orion-ehci.0",
> -			 of_clk_get_from_provider(&clkspec));
> -
> -	clkspec.args[0] = CLOCK_GATING_BIT_USB1;
> -	orion_clkdev_add(NULL, "orion-ehci.1",
> -			 of_clk_get_from_provider(&clkspec));
> -
> -	clkspec.args[0] = CLOCK_GATING_BIT_GBE;
> -	orion_clkdev_add(NULL, "mv643xx_eth_port.0",
> -			 of_clk_get_from_provider(&clkspec));
> -
> -	clkspec.args[0] = CLOCK_GATING_BIT_PCIE0;
> -	orion_clkdev_add("0", "pcie",
> -			 of_clk_get_from_provider(&clkspec));
> -
> -	clkspec.args[0] = CLOCK_GATING_BIT_PCIE1;
> -	orion_clkdev_add("1", "pcie",
> -			 of_clk_get_from_provider(&clkspec));
> -}
> -
> -static void __init dove_of_clk_init(void)
> -{
> -	mvebu_clocks_init();
> -	dove_legacy_clk_init();
> -}
> -
> -static struct mv643xx_eth_platform_data dove_dt_ge00_data = {
> -	.phy_addr = MV643XX_ETH_PHY_ADDR_DEFAULT,
> -};
> -
> -static void __init dove_dt_init(void)
> -{
> -	pr_info("Dove 88AP510 SoC, TCLK = %d MHz.\n",
> -		(dove_tclk + 499999) / 1000000);
> -
> -#ifdef CONFIG_CACHE_TAUROS2
> -	tauros2_init(0);
> -#endif
> -	dove_setup_cpu_mbus();
> -
> -	/* Setup root of clk tree */
> -	dove_of_clk_init();
> -
> -	/* Internal devices not ported to DT yet */
> -	dove_rtc_init();
> -
> -	dove_ge00_init(&dove_dt_ge00_data);
> -	dove_ehci0_init();
> -	dove_ehci1_init();
> -	dove_pcie_init(1, 1);
> -
> -	of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
> -}
> -
> -static const char * const dove_dt_board_compat[] = {
> -	"marvell,dove",
> -	NULL
> -};
> -
> -DT_MACHINE_START(DOVE_DT, "Marvell Dove (Flattened Device Tree)")
> -	.map_io		= dove_map_io,
> -	.init_early	= dove_init_early,
> -	.init_irq	= orion_dt_init_irq,
> -	.timer		= &dove_timer,
> -	.init_machine	= dove_dt_init,
> -	.restart	= dove_restart,
> -	.dt_compat	= dove_dt_board_compat,
> -MACHINE_END
> -#endif
> diff --git a/arch/arm/mach-dove/common.h b/arch/arm/mach-dove/common.h
> index 1a23340..d17f760 100644
> --- a/arch/arm/mach-dove/common.h
> +++ b/arch/arm/mach-dove/common.h
> @@ -25,6 +25,7 @@ void dove_init_early(void);
>  void dove_init_irq(void);
>  void dove_setup_cpu_mbus(void);
>  void dove_ge00_init(struct mv643xx_eth_platform_data *eth_data);
> +void dove_rtc_init(void);
>  void dove_sata_init(struct mv_sata_platform_data *sata_data);
>  #ifdef CONFIG_PCI
>  void dove_pcie_init(int init_port0, int init_port1);
> -- 
> 1.7.10.4
> 

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

* Re: [PATCH v2 1/2] ARM: dove: cleanup includes
  2013-01-29 21:23 ` [PATCH v2 1/2] ARM: dove: cleanup includes Sebastian Hesselbarth
  2013-01-29 21:23   ` [PATCH v2 2/2] ARM: dove: split legacy and DT setup Sebastian Hesselbarth
@ 2013-01-29 21:36   ` Jason Cooper
  1 sibling, 0 replies; 16+ messages in thread
From: Jason Cooper @ 2013-01-29 21:36 UTC (permalink / raw)
  To: Sebastian Hesselbarth
  Cc: Andrew Lunn, Russell King, linux-arm-kernel, linux-kernel

On Tue, Jan 29, 2013 at 10:23:09PM +0100, Sebastian Hesselbarth wrote:
> This patch cleans unneccessary includes and reorders the remaining
> includes in common dove code.
> 
> Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
> ---
> Changelog:
> [v2]
> - restructure patches to first cleanup common.c includes [1/2]
>   and then split legacy and DT specific code [2/2]
> - removed v1 patch "[PATCH 3/3] ARM: Dove: add Cubox sdhci card
>   detect gpio" that was taken independently
> 
> Cc: Russell King <linux@arm.linux.org.uk>
> Cc: Jason Cooper <jason@lakedaemon.net>
> Cc: Andrew Lunn <andrew@lunn.ch>
> Cc: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
> Cc: linux-arm-kernel@lists.infradead.org
> Cc: linux-kernel@vger.kernel.org
> ---
>  arch/arm/mach-dove/common.c |   29 +++++++++--------------------
>  1 file changed, 9 insertions(+), 20 deletions(-)

Applied to mvebu/cleanup, thanks for turning this around so quickly.

thx,

Jason.

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

* [PATCH v3 2/2] ARM: dove: split legacy and DT setup
  2013-01-29 21:26     ` Jason Cooper
@ 2013-01-29 21:41       ` Sebastian Hesselbarth
  2013-01-31  0:52         ` Jason Cooper
  0 siblings, 1 reply; 16+ messages in thread
From: Sebastian Hesselbarth @ 2013-01-29 21:41 UTC (permalink / raw)
  To: Sebastian Hesselbarth
  Cc: Russell King, Jason Cooper, Andrew Lunn, linux-arm-kernel, linux-kernel

In the beginning of DT for Dove it was reasonable to have it close to
non-DT code. With improved DT support, it became more and more difficult
to not break non-DT while changing DT code.

This patch splits up DT board setup and introduces a DOVE_LEGACY config
to allow to remove legacy code for DT-only kernels.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
---
Changelog:
[v3]
- also include new board-dt.c file that was missing in v2 of patch [2/2]
  (patch [1/2] has not changed and is not resent)

Cc: Russell King <linux@arm.linux.org.uk>
Cc: Jason Cooper <jason@lakedaemon.net>
Cc: Andrew Lunn <andrew@lunn.ch>
Cc: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-kernel@vger.kernel.org
---
 arch/arm/mach-dove/Kconfig    |    5 ++
 arch/arm/mach-dove/Makefile   |    4 +-
 arch/arm/mach-dove/board-dt.c |  103 +++++++++++++++++++++++++++++++++++++++++
 arch/arm/mach-dove/common.c   |   90 -----------------------------------
 arch/arm/mach-dove/common.h   |    1 +
 5 files changed, 112 insertions(+), 91 deletions(-)
 create mode 100644 arch/arm/mach-dove/board-dt.c

diff --git a/arch/arm/mach-dove/Kconfig b/arch/arm/mach-dove/Kconfig
index 603c5fd..aedd0ba 100644
--- a/arch/arm/mach-dove/Kconfig
+++ b/arch/arm/mach-dove/Kconfig
@@ -2,8 +2,12 @@ if ARCH_DOVE
 
 menu "Marvell Dove Implementations"
 
+config DOVE_LEGACY
+	bool
+
 config MACH_DOVE_DB
 	bool "Marvell DB-MV88AP510 Development Board"
+	select DOVE_LEGACY
 	select I2C_BOARDINFO
 	help
 	  Say 'Y' here if you want your kernel to support the
@@ -11,6 +15,7 @@ config MACH_DOVE_DB
 
 config MACH_CM_A510
 	bool "CompuLab CM-A510 Board"
+	select DOVE_LEGACY
 	help
 	  Say 'Y' here if you want your kernel to support the
 	  CompuLab CM-A510 Board.
diff --git a/arch/arm/mach-dove/Makefile b/arch/arm/mach-dove/Makefile
index 5e683ba..3f0a858 100644
--- a/arch/arm/mach-dove/Makefile
+++ b/arch/arm/mach-dove/Makefile
@@ -1,4 +1,6 @@
-obj-y				+= common.o addr-map.o irq.o mpp.o
+obj-y				+= common.o addr-map.o irq.o
+obj-$(CONFIG_DOVE_LEGACY)	+= mpp.o
 obj-$(CONFIG_PCI)		+= pcie.o
 obj-$(CONFIG_MACH_DOVE_DB)	+= dove-db-setup.o
+obj-$(CONFIG_MACH_DOVE_DT)	+= board-dt.o
 obj-$(CONFIG_MACH_CM_A510)	+= cm-a510.o
diff --git a/arch/arm/mach-dove/board-dt.c b/arch/arm/mach-dove/board-dt.c
new file mode 100644
index 0000000..c9c274a
--- /dev/null
+++ b/arch/arm/mach-dove/board-dt.c
@@ -0,0 +1,103 @@
+/*
+ * arch/arm/mach-dove/board-dt.c
+ *
+ * Marvell Dove 88AP510 System On Chip FDT Board
+ *
+ * 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/init.h>
+#include <linux/clk-provider.h>
+#include <linux/clk/mvebu.h>
+#include <linux/of.h>
+#include <linux/of_platform.h>
+#include <linux/platform_data/usb-ehci-orion.h>
+#include <asm/hardware/cache-tauros2.h>
+#include <asm/mach/arch.h>
+#include <mach/pm.h>
+#include <plat/common.h>
+#include <plat/irq.h>
+#include "common.h"
+
+/*
+ * There are still devices that doesn't even know about DT,
+ * get clock gates here and add a clock lookup.
+ */
+static void __init dove_legacy_clk_init(void)
+{
+	struct device_node *np = of_find_compatible_node(NULL, NULL,
+					 "marvell,dove-gating-clock");
+	struct of_phandle_args clkspec;
+
+	clkspec.np = np;
+	clkspec.args_count = 1;
+
+	clkspec.args[0] = CLOCK_GATING_BIT_USB0;
+	orion_clkdev_add(NULL, "orion-ehci.0",
+			 of_clk_get_from_provider(&clkspec));
+
+	clkspec.args[0] = CLOCK_GATING_BIT_USB1;
+	orion_clkdev_add(NULL, "orion-ehci.1",
+			 of_clk_get_from_provider(&clkspec));
+
+	clkspec.args[0] = CLOCK_GATING_BIT_GBE;
+	orion_clkdev_add(NULL, "mv643xx_eth_port.0",
+			 of_clk_get_from_provider(&clkspec));
+
+	clkspec.args[0] = CLOCK_GATING_BIT_PCIE0;
+	orion_clkdev_add("0", "pcie",
+			 of_clk_get_from_provider(&clkspec));
+
+	clkspec.args[0] = CLOCK_GATING_BIT_PCIE1;
+	orion_clkdev_add("1", "pcie",
+			 of_clk_get_from_provider(&clkspec));
+}
+
+static void __init dove_of_clk_init(void)
+{
+	mvebu_clocks_init();
+	dove_legacy_clk_init();
+}
+
+static struct mv643xx_eth_platform_data dove_dt_ge00_data = {
+	.phy_addr = MV643XX_ETH_PHY_ADDR_DEFAULT,
+};
+
+static void __init dove_dt_init(void)
+{
+	pr_info("Dove 88AP510 SoC\n");
+
+#ifdef CONFIG_CACHE_TAUROS2
+	tauros2_init(0);
+#endif
+	dove_setup_cpu_mbus();
+
+	/* Setup root of clk tree */
+	dove_of_clk_init();
+
+	/* Internal devices not ported to DT yet */
+	dove_rtc_init();
+	dove_ge00_init(&dove_dt_ge00_data);
+	dove_ehci0_init();
+	dove_ehci1_init();
+	dove_pcie_init(1, 1);
+
+	of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
+}
+
+static const char * const dove_dt_board_compat[] = {
+	"marvell,dove",
+	NULL
+};
+
+DT_MACHINE_START(DOVE_DT, "Marvell Dove (Flattened Device Tree)")
+	.map_io		= dove_map_io,
+	.init_early	= dove_init_early,
+	.init_irq	= orion_dt_init_irq,
+	.timer		= &dove_timer,
+	.init_machine	= dove_dt_init,
+	.restart	= dove_restart,
+	.dt_compat	= dove_dt_board_compat,
+MACHINE_END
diff --git a/arch/arm/mach-dove/common.c b/arch/arm/mach-dove/common.c
index be887feea..aea14b4 100644
--- a/arch/arm/mach-dove/common.c
+++ b/arch/arm/mach-dove/common.c
@@ -9,22 +9,17 @@
  */
 
 #include <linux/clk-provider.h>
-#include <linux/clk/mvebu.h>
 #include <linux/dma-mapping.h>
 #include <linux/init.h>
-#include <linux/of.h>
-#include <linux/of_platform.h>
 #include <linux/platform_data/dma-mv_xor.h>
 #include <linux/platform_data/usb-ehci-orion.h>
 #include <linux/platform_device.h>
 #include <asm/hardware/cache-tauros2.h>
-#include <asm/mach/arch.h>
 #include <asm/mach/map.h>
 #include <asm/mach/time.h>
 #include <mach/bridge-regs.h>
 #include <mach/pm.h>
 #include <plat/common.h>
-#include <plat/irq.h>
 #include <plat/time.h>
 #include "common.h"
 
@@ -364,88 +359,3 @@ void dove_restart(char mode, const char *cmd)
 	while (1)
 		;
 }
-
-#if defined(CONFIG_MACH_DOVE_DT)
-/*
- * There are still devices that doesn't even know about DT,
- * get clock gates here and add a clock lookup.
- */
-static void __init dove_legacy_clk_init(void)
-{
-	struct device_node *np = of_find_compatible_node(NULL, NULL,
-					 "marvell,dove-gating-clock");
-	struct of_phandle_args clkspec;
-
-	clkspec.np = np;
-	clkspec.args_count = 1;
-
-	clkspec.args[0] = CLOCK_GATING_BIT_USB0;
-	orion_clkdev_add(NULL, "orion-ehci.0",
-			 of_clk_get_from_provider(&clkspec));
-
-	clkspec.args[0] = CLOCK_GATING_BIT_USB1;
-	orion_clkdev_add(NULL, "orion-ehci.1",
-			 of_clk_get_from_provider(&clkspec));
-
-	clkspec.args[0] = CLOCK_GATING_BIT_GBE;
-	orion_clkdev_add(NULL, "mv643xx_eth_port.0",
-			 of_clk_get_from_provider(&clkspec));
-
-	clkspec.args[0] = CLOCK_GATING_BIT_PCIE0;
-	orion_clkdev_add("0", "pcie",
-			 of_clk_get_from_provider(&clkspec));
-
-	clkspec.args[0] = CLOCK_GATING_BIT_PCIE1;
-	orion_clkdev_add("1", "pcie",
-			 of_clk_get_from_provider(&clkspec));
-}
-
-static void __init dove_of_clk_init(void)
-{
-	mvebu_clocks_init();
-	dove_legacy_clk_init();
-}
-
-static struct mv643xx_eth_platform_data dove_dt_ge00_data = {
-	.phy_addr = MV643XX_ETH_PHY_ADDR_DEFAULT,
-};
-
-static void __init dove_dt_init(void)
-{
-	pr_info("Dove 88AP510 SoC, TCLK = %d MHz.\n",
-		(dove_tclk + 499999) / 1000000);
-
-#ifdef CONFIG_CACHE_TAUROS2
-	tauros2_init(0);
-#endif
-	dove_setup_cpu_mbus();
-
-	/* Setup root of clk tree */
-	dove_of_clk_init();
-
-	/* Internal devices not ported to DT yet */
-	dove_rtc_init();
-
-	dove_ge00_init(&dove_dt_ge00_data);
-	dove_ehci0_init();
-	dove_ehci1_init();
-	dove_pcie_init(1, 1);
-
-	of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
-}
-
-static const char * const dove_dt_board_compat[] = {
-	"marvell,dove",
-	NULL
-};
-
-DT_MACHINE_START(DOVE_DT, "Marvell Dove (Flattened Device Tree)")
-	.map_io		= dove_map_io,
-	.init_early	= dove_init_early,
-	.init_irq	= orion_dt_init_irq,
-	.timer		= &dove_timer,
-	.init_machine	= dove_dt_init,
-	.restart	= dove_restart,
-	.dt_compat	= dove_dt_board_compat,
-MACHINE_END
-#endif
diff --git a/arch/arm/mach-dove/common.h b/arch/arm/mach-dove/common.h
index 1a23340..d17f760 100644
--- a/arch/arm/mach-dove/common.h
+++ b/arch/arm/mach-dove/common.h
@@ -25,6 +25,7 @@ void dove_init_early(void);
 void dove_init_irq(void);
 void dove_setup_cpu_mbus(void);
 void dove_ge00_init(struct mv643xx_eth_platform_data *eth_data);
+void dove_rtc_init(void);
 void dove_sata_init(struct mv_sata_platform_data *sata_data);
 #ifdef CONFIG_PCI
 void dove_pcie_init(int init_port0, int init_port1);
-- 
1.7.10.4


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

* Re: [PATCH v3 2/2] ARM: dove: split legacy and DT setup
  2013-01-29 21:41       ` [PATCH v3 " Sebastian Hesselbarth
@ 2013-01-31  0:52         ` Jason Cooper
  0 siblings, 0 replies; 16+ messages in thread
From: Jason Cooper @ 2013-01-31  0:52 UTC (permalink / raw)
  To: Sebastian Hesselbarth
  Cc: Andrew Lunn, Russell King, linux-arm-kernel, linux-kernel

On Tue, Jan 29, 2013 at 10:41:35PM +0100, Sebastian Hesselbarth wrote:
> In the beginning of DT for Dove it was reasonable to have it close to
> non-DT code. With improved DT support, it became more and more difficult
> to not break non-DT while changing DT code.
> 
> This patch splits up DT board setup and introduces a DOVE_LEGACY config
> to allow to remove legacy code for DT-only kernels.
> 
> Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
> ---
> Changelog:
> [v3]
> - also include new board-dt.c file that was missing in v2 of patch [2/2]
>   (patch [1/2] has not changed and is not resent)
> 
> Cc: Russell King <linux@arm.linux.org.uk>
> Cc: Jason Cooper <jason@lakedaemon.net>
> Cc: Andrew Lunn <andrew@lunn.ch>
> Cc: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
> Cc: linux-arm-kernel@lists.infradead.org
> Cc: linux-kernel@vger.kernel.org
> ---
>  arch/arm/mach-dove/Kconfig    |    5 ++
>  arch/arm/mach-dove/Makefile   |    4 +-
>  arch/arm/mach-dove/board-dt.c |  103 +++++++++++++++++++++++++++++++++++++++++
>  arch/arm/mach-dove/common.c   |   90 -----------------------------------
>  arch/arm/mach-dove/common.h   |    1 +
>  5 files changed, 112 insertions(+), 91 deletions(-)
>  create mode 100644 arch/arm/mach-dove/board-dt.c

Applied to mvebu/boards

thx,

Jason.

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

end of thread, other threads:[~2013-01-31  0:52 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-12-18  0:24 [PATCH 1/3] ARM: Dove: split legacy and DT setup Sebastian Hesselbarth
2012-12-18  0:24 ` [PATCH 2/3] ARM: Dove: cleanup includes Sebastian Hesselbarth
2013-01-28  2:20   ` Jason Cooper
2012-12-18  0:24 ` [PATCH 3/3] ARM: Dove: add Cubox sdhci card detect gpio Sebastian Hesselbarth
2012-12-18  0:38   ` Jason Cooper
2012-12-18  0:50     ` Sebastian Hesselbarth
2012-12-18  1:37       ` Jason Cooper
2013-01-10  2:17   ` Jason Cooper
2012-12-18  0:35 ` [PATCH 1/3] ARM: Dove: split legacy and DT setup Jason Cooper
2013-01-28  2:19 ` Jason Cooper
2013-01-29 21:23 ` [PATCH v2 1/2] ARM: dove: cleanup includes Sebastian Hesselbarth
2013-01-29 21:23   ` [PATCH v2 2/2] ARM: dove: split legacy and DT setup Sebastian Hesselbarth
2013-01-29 21:26     ` Jason Cooper
2013-01-29 21:41       ` [PATCH v3 " Sebastian Hesselbarth
2013-01-31  0:52         ` Jason Cooper
2013-01-29 21:36   ` [PATCH v2 1/2] ARM: dove: cleanup includes Jason Cooper

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