All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3 v2] RFC: marvell dreamplug dft support
@ 2011-08-09 16:47 Jason Cooper
  2011-08-09 16:47 ` [PATCH 1/3 v2] RFC: arm/kirkwood: TEMP hack till mach-types is updated Jason Cooper
                   ` (12 more replies)
  0 siblings, 13 replies; 76+ messages in thread
From: Jason Cooper @ 2011-08-09 16:47 UTC (permalink / raw)
  To: linux-arm-kernel

All,

First, a warning.  Do not apply the last patch in the series!  It has
no hope of compiling.  I'm trying to learn how to add board support to
the Linux kernel _and_ now trying to learn how to do it using devicetree.

In short, I'm lost.  ;-)  Any and all help appreciated.

In my sad attempt to add devicetree support, I used
arch/arm/mach-kirkwood/include/mach/kirkwood.h to stub out the addresses.
It's my understanding that most peripherals on this SoC are register-based.
So, I haven't added external-bus{...}; yet.

Based on kirkwood.h, there doesn't seem to be any obvious register size
definition, should I omit that all around in my devicetree?

I'm guessing at a lot of the compatible="" properties, I simply chose the
.name string I found in the respective code.  Is this correct?

I see nothing obvious to indicate an irq handler similar to that mentioned
in [1].  Any thoughts?  I found the irq table, just no way to use it.

Also, I'll rename dreamplug-setup.c -> dreamplug-dt.c once I have something
working.

[1] has been a great help, thanks Grant!

thx,

Jason.

[1] http://devicetree.org/Device_Tree_Usage

Jason Cooper (3):
  arm/kirkwood: TEMP hack till mach-types is updated.
  arm/kirkwood: add dreamplug support.
  arm: kirkwood: dreamplug fdt support

 arch/arm/boot/dts/kirkwood-dreamplug.dts |   64 +++++++++++++
 arch/arm/mach-kirkwood/Kconfig           |    8 ++
 arch/arm/mach-kirkwood/Makefile          |    1 +
 arch/arm/mach-kirkwood/Makefile.boot     |    2 +
 arch/arm/mach-kirkwood/dreamplug-setup.c |  151 ++++++++++++++++++++++++++++++
 arch/arm/tools/mach-types                |    1 +
 6 files changed, 227 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/boot/dts/kirkwood-dreamplug.dts
 create mode 100644 arch/arm/mach-kirkwood/dreamplug-setup.c

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

* [PATCH 1/3 v2] RFC: arm/kirkwood: TEMP hack till mach-types is updated.
  2011-08-09 16:47 [PATCH 0/3 v2] RFC: marvell dreamplug dft support Jason Cooper
@ 2011-08-09 16:47 ` Jason Cooper
  2012-02-23  1:46   ` Grant Likely
  2012-02-23  1:48   ` Grant Likely
  2011-08-09 16:47 ` [PATCH 2/3 v2] RFC: arm/kirkwood: add dreamplug support Jason Cooper
                   ` (11 subsequent siblings)
  12 siblings, 2 replies; 76+ messages in thread
From: Jason Cooper @ 2011-08-09 16:47 UTC (permalink / raw)
  To: linux-arm-kernel

	DO NOT SUBMIT!

Signed-off-by: Jason Cooper <jason@lakedaemon.net>
---
 arch/arm/tools/mach-types |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/arch/arm/tools/mach-types b/arch/arm/tools/mach-types
index 3b3776d..d5c5779 100644
--- a/arch/arm/tools/mach-types
+++ b/arch/arm/tools/mach-types
@@ -1113,3 +1113,4 @@ blissc			MACH_BLISSC		BLISSC			3491
 thales_adc		MACH_THALES_ADC		THALES_ADC		3492
 ubisys_p9d_evp		MACH_UBISYS_P9D_EVP	UBISYS_P9D_EVP		3493
 atdgp318		MACH_ATDGP318		ATDGP318		3494
+dreamplug		MACH_DREAMPLUG		DREAMPLUG		3550
-- 
1.7.0.4

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

* [PATCH 2/3 v2] RFC: arm/kirkwood: add dreamplug support.
  2011-08-09 16:47 [PATCH 0/3 v2] RFC: marvell dreamplug dft support Jason Cooper
  2011-08-09 16:47 ` [PATCH 1/3 v2] RFC: arm/kirkwood: TEMP hack till mach-types is updated Jason Cooper
@ 2011-08-09 16:47 ` Jason Cooper
  2011-08-09 17:25   ` Arnaud Patard (Rtp)
  2011-08-10 14:31   ` Arnd Bergmann
  2011-08-09 16:47 ` [PATCH 3/3 v2] RFC: arm: kirkwood: dreamplug fdt support Jason Cooper
                   ` (10 subsequent siblings)
  12 siblings, 2 replies; 76+ messages in thread
From: Jason Cooper @ 2011-08-09 16:47 UTC (permalink / raw)
  To: linux-arm-kernel

Copied guruplug-setup.c and did s/guruplug/dreamplug/g.  Then, switched
to SPI based NOR flash.  LED pins are correct.

Signed-off-by: Jason Cooper <jason@lakedaemon.net>
---
 arch/arm/mach-kirkwood/Kconfig           |    6 ++
 arch/arm/mach-kirkwood/Makefile          |    1 +
 arch/arm/mach-kirkwood/dreamplug-setup.c |  144 ++++++++++++++++++++++++++++++
 3 files changed, 151 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/mach-kirkwood/dreamplug-setup.c

diff --git a/arch/arm/mach-kirkwood/Kconfig b/arch/arm/mach-kirkwood/Kconfig
index 7fc603b..e93c610 100644
--- a/arch/arm/mach-kirkwood/Kconfig
+++ b/arch/arm/mach-kirkwood/Kconfig
@@ -44,6 +44,12 @@ config MACH_GURUPLUG
 	  Say 'Y' here if you want your kernel to support the
 	  Marvell GuruPlug Reference Board.
 
+config MACH_DREAMPLUG
+	bool "Marvell DreamPlug Reference Board"
+	help
+	  Say 'Y' here if you want your kernel to support the
+	  Marvell DreamPlug Reference Board.
+
 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 5dcaa81..c443a13 100644
--- a/arch/arm/mach-kirkwood/Makefile
+++ b/arch/arm/mach-kirkwood/Makefile
@@ -7,6 +7,7 @@ obj-$(CONFIG_MACH_MV88F6281GTW_GE)	+= mv88f6281gtw_ge-setup.o
 obj-$(CONFIG_MACH_SHEEVAPLUG)		+= sheevaplug-setup.o
 obj-$(CONFIG_MACH_ESATA_SHEEVAPLUG)	+= sheevaplug-setup.o
 obj-$(CONFIG_MACH_GURUPLUG)		+= guruplug-setup.o
+obj-$(CONFIG_MACH_DREAMPLUG)		+= dreamplug-setup.o
 obj-$(CONFIG_MACH_DOCKSTAR)		+= dockstar-setup.o
 obj-$(CONFIG_MACH_TS219)		+= ts219-setup.o tsx1x-common.o
 obj-$(CONFIG_MACH_TS41X)		+= ts41x-setup.o tsx1x-common.o
diff --git a/arch/arm/mach-kirkwood/dreamplug-setup.c b/arch/arm/mach-kirkwood/dreamplug-setup.c
new file mode 100644
index 0000000..981bc71
--- /dev/null
+++ b/arch/arm/mach-kirkwood/dreamplug-setup.c
@@ -0,0 +1,144 @@
+/*
+ * arch/arm/mach-kirkwood/dreamplug-setup.c
+ *
+ * Marvell DreamPlug Reference 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/platform_device.h>
+#include <linux/mtd/partitions.h>
+#include <linux/ata_platform.h>
+#include <linux/mv643xx_eth.h>
+#include <linux/gpio.h>
+#include <linux/leds.h>
+#include <linux/mtd/physmap.h>
+#include <linux/spi/flash.h>
+#include <linux/spi/spi.h>
+#include <linux/spi/orion_spi.h>
+#include <asm/mach-types.h>
+#include <asm/mach/arch.h>
+#include <mach/kirkwood.h>
+#include <plat/mvsdio.h>
+#include "common.h"
+#include "mpp.h"
+
+struct mtd_partition dreamplug_partitions[] = {
+	{
+		.name	= "u-boot",
+		.size	= SZ_512K,
+		.offset = 0,
+	},
+	{
+		.name	= "u-boot env",
+		.size	= SZ_64K,
+		.offset = SZ_512K + SZ_512K,
+	},
+};
+
+static const struct flash_platform_data dreamplug_spi_slave_data = {
+	.type		= "mx25l1606e",
+	.name		= "spi_flash",
+	.parts		= dreamplug_partitions,
+	.nr_parts	= ARRAY_SIZE(dreamplug_partitions),
+};
+
+static struct spi_board_info __initdata dreamplug_spi_slave_info[] = {
+	{
+		.modalias	= "m25p80",
+		.platform_data	= &dreamplug_spi_slave_data,
+		.irq		= -1,
+		.max_speed_hz	= 50000000,
+		.bus_num	= 0,
+		.chip_select	= 0,
+	},
+};
+
+static struct mv643xx_eth_platform_data dreamplug_ge00_data = {
+	.phy_addr	= MV643XX_ETH_PHY_ADDR(0),
+};
+
+static struct mv643xx_eth_platform_data dreamplug_ge01_data = {
+	.phy_addr	= MV643XX_ETH_PHY_ADDR(1),
+};
+
+static struct mv_sata_platform_data dreamplug_sata_data = {
+	.n_ports	= 1,
+};
+
+static struct mvsdio_platform_data dreamplug_mvsdio_data = {
+	/* unfortunately the CD signal has not been connected */
+};
+
+static struct gpio_led dreamplug_led_pins[] = {
+	{
+		.name			= "dreamplug:blue:ap",
+		.gpio			= 46,
+		.active_low		= 1,
+	},
+	{
+		.name			= "dreamplug:green:wifi",
+		.gpio			= 48,
+		.active_low		= 1,
+	},
+};
+
+static struct gpio_led_platform_data dreamplug_led_data = {
+	.leds		= dreamplug_led_pins,
+	.num_leds	= ARRAY_SIZE(dreamplug_led_pins),
+};
+
+static struct platform_device dreamplug_leds = {
+	.name	= "leds-gpio",
+	.id	= -1,
+	.dev	= {
+		.platform_data	= &dreamplug_led_data,
+	}
+};
+
+static unsigned int dreamplug_mpp_config[] __initdata = {
+	MPP0_SPI_SCn,
+	MPP1_SPI_MOSI,
+	MPP2_SPI_SCK,
+	MPP3_SPI_MISO,
+	MPP46_GPIO,	/* Wifi AP LED */
+	MPP48_GPIO,	/* Wifi LED */
+	0
+};
+
+static void __init dreamplug_init(void)
+{
+	/*
+	 * Basic setup. Needs to be called early.
+	 */
+	kirkwood_init();
+	kirkwood_mpp_conf(dreamplug_mpp_config);
+
+	kirkwood_uart0_init();
+
+	spi_register_board_info(dreamplug_spi_slave_info,
+				ARRAY_SIZE(dreamplug_spi_slave_info));
+	kirkwood_spi_init();
+
+	kirkwood_ehci_init();
+	kirkwood_ge00_init(&dreamplug_ge00_data);
+	kirkwood_ge01_init(&dreamplug_ge01_data);
+	kirkwood_sata_init(&dreamplug_sata_data);
+	kirkwood_sdio_init(&dreamplug_mvsdio_data);
+
+	platform_device_register(&dreamplug_leds);
+}
+
+MACHINE_START(DREAMPLUG, "Marvell DreamPlug Reference Board")
+	/* Maintainer: Siddarth Gore <gores@marvell.com> */
+	.boot_params	= 0x00000100,
+	.init_machine	= dreamplug_init,
+	.map_io		= kirkwood_map_io,
+	.init_early	= kirkwood_init_early,
+	.init_irq	= kirkwood_init_irq,
+	.timer		= &kirkwood_timer,
+MACHINE_END
-- 
1.7.0.4

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

* [PATCH 3/3 v2] RFC: arm: kirkwood: dreamplug fdt support
  2011-08-09 16:47 [PATCH 0/3 v2] RFC: marvell dreamplug dft support Jason Cooper
  2011-08-09 16:47 ` [PATCH 1/3 v2] RFC: arm/kirkwood: TEMP hack till mach-types is updated Jason Cooper
  2011-08-09 16:47 ` [PATCH 2/3 v2] RFC: arm/kirkwood: add dreamplug support Jason Cooper
@ 2011-08-09 16:47 ` Jason Cooper
  2011-12-07 19:40 ` [PATCH V3] arm: kirkwood: add dreamplug support Jason Cooper
                   ` (9 subsequent siblings)
  12 siblings, 0 replies; 76+ messages in thread
From: Jason Cooper @ 2011-08-09 16:47 UTC (permalink / raw)
  To: linux-arm-kernel

Do Not Apply!  Does not build!  This patch is just a conversation
starter to help me learn how to add devicetree support to arm
devices.

I chose the dreamplug because it isn't supported in mainline yet.

Signed-off-by: Jason Cooper <jason@lakedaemon.net>
---
 arch/arm/boot/dts/kirkwood-dreamplug.dts |   64 ++++++++++++++++++++++++++++++
 arch/arm/mach-kirkwood/Kconfig           |    6 ++-
 arch/arm/mach-kirkwood/Makefile.boot     |    2 +
 arch/arm/mach-kirkwood/dreamplug-setup.c |   15 +++++--
 4 files changed, 81 insertions(+), 6 deletions(-)
 create mode 100644 arch/arm/boot/dts/kirkwood-dreamplug.dts

diff --git a/arch/arm/boot/dts/kirkwood-dreamplug.dts b/arch/arm/boot/dts/kirkwood-dreamplug.dts
new file mode 100644
index 0000000..954d03f
--- /dev/null
+++ b/arch/arm/boot/dts/kirkwood-dreamplug.dts
@@ -0,0 +1,64 @@
+/ {
+	#address-cells = <1>;
+	#size-cells = <1>;
+	compatible = "marvell,kirkwood-dreamplug";
+
+	cpus {
+		#address-cells = <1>;
+		#size-cells = <0>;
+		cpu at 0 {
+			compatible = "arm,arm926ejs";
+			reg = <0>;
+		};
+	};
+
+	rtc at f1000300 {
+		compatible = "marvell,mvrtc";
+		reg = <0xf1000300 0xXXX>;
+	};
+
+	spi at f1000600 {
+		compatible = "marvell,orion_spi";
+		reg = <0xf1000600 0xXXX>;
+	};
+
+	i2c at f1001000 {
+		compatible = "marvell,XXX";
+		reg = <0xf1001000 0xXXX>;
+	};
+
+	serial at f1002000 {
+		compatible = "marvell,serial8250";
+		reg = <0xf1002000 0xXXXX>;
+	};
+
+	serial at f1002100 {
+		compatible = "marvell,serial8250";
+		reg = <0xf1002100 0xXXXX>;
+	};
+
+	usb at f1050000 {
+		compatible = "marvell,orion-ehci";
+		reg = <0xf1050000 0xXXX>;
+	};
+
+	ethernet at f1070000 {
+		compatible = "marvell,XXX";
+		reg = <0xf1070000 0xXXXX>;
+	};
+
+	ethernet at f1074000 {
+		compatible = "marvell,XXX";
+		reg = <0xf1074000 0xXXXX>;
+	};
+
+	sata at f1080000 {
+		compatible = "marvell,sata_mv";
+		reg = <0xf1080000 0xXXXX>;
+	};
+
+	sdio at f1090000 {
+		compatible = "marvell,XXX";
+		reg = <0xf1090000 0xXXX>;
+	};
+};
diff --git a/arch/arm/mach-kirkwood/Kconfig b/arch/arm/mach-kirkwood/Kconfig
index e93c610..ea87090 100644
--- a/arch/arm/mach-kirkwood/Kconfig
+++ b/arch/arm/mach-kirkwood/Kconfig
@@ -45,10 +45,12 @@ config MACH_GURUPLUG
 	  Marvell GuruPlug Reference Board.
 
 config MACH_DREAMPLUG
-	bool "Marvell DreamPlug Reference Board"
+	bool "Marvell DreamPlug Reference Board (FDT Support)"
+	select USE_OF
 	help
 	  Say 'Y' here if you want your kernel to support the
-	  Marvell DreamPlug Reference Board.
+	  Marvell DreamPlug Reference Board using the 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"
diff --git a/arch/arm/mach-kirkwood/Makefile.boot b/arch/arm/mach-kirkwood/Makefile.boot
index 67039c3..53dbe1f 100644
--- a/arch/arm/mach-kirkwood/Makefile.boot
+++ b/arch/arm/mach-kirkwood/Makefile.boot
@@ -1,3 +1,5 @@
    zreladdr-y	:= 0x00008000
 params_phys-y	:= 0x00000100
 initrd_phys-y	:= 0x00800000
+
+dtb-$(CONFIG_MACH_DREAMPLUG) += kirkwood-dreamplug.dtb
diff --git a/arch/arm/mach-kirkwood/dreamplug-setup.c b/arch/arm/mach-kirkwood/dreamplug-setup.c
index 981bc71..4128ab7 100644
--- a/arch/arm/mach-kirkwood/dreamplug-setup.c
+++ b/arch/arm/mach-kirkwood/dreamplug-setup.c
@@ -11,6 +11,8 @@
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/platform_device.h>
+#include <linux/of_platform.h>
+#include <linux/of_address.h>
 #include <linux/mtd/partitions.h>
 #include <linux/ata_platform.h>
 #include <linux/mv643xx_eth.h>
@@ -110,6 +112,10 @@ static unsigned int dreamplug_mpp_config[] __initdata = {
 	0
 };
 
+static struct of_device_id dreamplug_dt_match_table[] __initdata = {
+	{ .compatible = "marvell,kirkwood-dreamplug", },
+};
+
 static void __init dreamplug_init(void)
 {
 	/*
@@ -131,14 +137,15 @@ static void __init dreamplug_init(void)
 	kirkwood_sdio_init(&dreamplug_mvsdio_data);
 
 	platform_device_register(&dreamplug_leds);
+	of_platform_populate(NULL, dreamplug_dt_match_table, NULL, NULL);
 }
 
-MACHINE_START(DREAMPLUG, "Marvell DreamPlug Reference Board")
-	/* Maintainer: Siddarth Gore <gores@marvell.com> */
-	.boot_params	= 0x00000100,
-	.init_machine	= dreamplug_init,
+MACHINE_START(DREAMPLUG, "Marvell DreamPlug (Flattened Device Tree)")
 	.map_io		= kirkwood_map_io,
 	.init_early	= kirkwood_init_early,
 	.init_irq	= kirkwood_init_irq,
 	.timer		= &kirkwood_timer,
+	.init_machine	= dreamplug_init,
+	.dt_compat	= kirkwood_dt_board_compat,
+	.boot_params	= 0x00000100,
 MACHINE_END
-- 
1.7.0.4

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

* [PATCH 2/3 v2] RFC: arm/kirkwood: add dreamplug support.
  2011-08-09 16:47 ` [PATCH 2/3 v2] RFC: arm/kirkwood: add dreamplug support Jason Cooper
@ 2011-08-09 17:25   ` Arnaud Patard (Rtp)
  2011-08-09 18:10     ` Jason
  2011-08-10 14:31   ` Arnd Bergmann
  1 sibling, 1 reply; 76+ messages in thread
From: Arnaud Patard (Rtp) @ 2011-08-09 17:25 UTC (permalink / raw)
  To: linux-arm-kernel

Jason Cooper <jason@lakedaemon.net> writes:

Hi,

> Copied guruplug-setup.c and did s/guruplug/dreamplug/g.  Then, switched
> to SPI based NOR flash.  LED pins are correct.

Why don't use modify guruplug.c instead and use some if (machine_is_*)
tests to handle the differences like what was done for openrd ? I find
it quite wasteful to add a new machine file while (I guess) it should be
easier to modify existing code.

Regards,
Arnaud

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

* [PATCH 2/3 v2] RFC: arm/kirkwood: add dreamplug support.
  2011-08-09 17:25   ` Arnaud Patard (Rtp)
@ 2011-08-09 18:10     ` Jason
  0 siblings, 0 replies; 76+ messages in thread
From: Jason @ 2011-08-09 18:10 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Aug 09, 2011 at 07:25:14PM +0200, Arnaud Patard wrote:
> Jason Cooper <jason@lakedaemon.net> writes:
> > Copied guruplug-setup.c and did s/guruplug/dreamplug/g.  Then, switched
> > to SPI based NOR flash.  LED pins are correct.
> 
> Why don't use modify guruplug.c instead and use some if (machine_is_*)
> tests to handle the differences like what was done for openrd ? I find
> it quite wasteful to add a new machine file while (I guess) it should be
> easier to modify existing code.

Interesting, I hadn't looked carefully at openrd.  Thanks for the
pointer.  In my grand plan, there will be a boot/dts/kirkwood.dtsi, and
then a boot/dts/kirkwood-dreamplug.dts and, hopefully, a single
mach-kirkwood/board-dt.c ...  This patch [2/3] was left in because it
was the legacy way of doing things, at it works.  I wanted to show my
thought process (wrong and right) for migrating dreamplug to devicetree.
Dreamplug hasn't made it into mainline yet, because it isn't devicetree.

If I can get it right, migrating the other mach-kirkwood/*-setup.c
should be simply boot/dts/kirkwood-*.dts

thx,

Jason. 

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

* [PATCH 2/3 v2] RFC: arm/kirkwood: add dreamplug support.
  2011-08-09 16:47 ` [PATCH 2/3 v2] RFC: arm/kirkwood: add dreamplug support Jason Cooper
  2011-08-09 17:25   ` Arnaud Patard (Rtp)
@ 2011-08-10 14:31   ` Arnd Bergmann
  1 sibling, 0 replies; 76+ messages in thread
From: Arnd Bergmann @ 2011-08-10 14:31 UTC (permalink / raw)
  To: linux-arm-kernel

On Tuesday 09 August 2011, Jason Cooper wrote:
> Copied guruplug-setup.c and did s/guruplug/dreamplug/g.  Then, switched
> to SPI based NOR flash.  LED pins are correct.
> 
> Signed-off-by: Jason Cooper <jason@lakedaemon.net>
> ---
>  arch/arm/mach-kirkwood/Kconfig           |    6 ++
>  arch/arm/mach-kirkwood/Makefile          |    1 +
>  arch/arm/mach-kirkwood/dreamplug-setup.c |  144 ++++++++++++++++++++++++++++++
>  3 files changed, 151 insertions(+), 0 deletions(-)
>  create mode 100644 arch/arm/mach-kirkwood/dreamplug-setup.c

Hi Jason,

If the boards are reasonably similar, the way to go using the device tree
is to have separate dts files but share a single board file that uses the
device tree to figure out the differences.

For the on-chip components, you can even share most of the device tree
contents with an include directive.

In the actual board file, do not list any platform devices, but make
sure that the contents of the device tree file describe the devices
completely. Try to avoid any dependencies on the specific board name
(other than the initial match entry) but instead describe the
differences accurately.

	Arnd

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

* [PATCH V3] arm: kirkwood: add dreamplug support.
  2011-08-09 16:47 [PATCH 0/3 v2] RFC: marvell dreamplug dft support Jason Cooper
                   ` (2 preceding siblings ...)
  2011-08-09 16:47 ` [PATCH 3/3 v2] RFC: arm: kirkwood: dreamplug fdt support Jason Cooper
@ 2011-12-07 19:40 ` Jason Cooper
  2012-02-22 19:18   ` Jason Cooper
                   ` (8 subsequent siblings)
  12 siblings, 0 replies; 76+ messages in thread
From: Jason Cooper @ 2011-12-07 19:40 UTC (permalink / raw)
  To: linux-arm-kernel

Copied guruplug-setup.c and did s/guruplug/dreamplug/g.  Then, switched
to SPI based NOR flash.

Signed-off-by: Jason Cooper <linux_arm@lakedaemon.net>
---
Changes from v1

   - attempting dts, looking for pointers.

Changes from v2

   - resubmit as MACH_TYPE_DREAMPLUG (3550) is in arm/for-next, rebased
     against same.
   - removed lame fdt attempt, others are working on kirkwood fdt.  Will
     convert once kirkwood fdt is mainline.
   - s/boot_params/atag_offset/
   - added kirkwood_reset
   - 1 checkpatch.pl warning (help in Kconfig), looks the same as all
     other kirkwood boards...

 arch/arm/mach-kirkwood/Kconfig           |    6 +
 arch/arm/mach-kirkwood/Makefile          |    1 +
 arch/arm/mach-kirkwood/dreamplug-setup.c |  151 ++++++++++++++++++++++++++++++
 3 files changed, 158 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/mach-kirkwood/dreamplug-setup.c

diff --git a/arch/arm/mach-kirkwood/Kconfig b/arch/arm/mach-kirkwood/Kconfig
index 7fc603b..e93c610 100644
--- a/arch/arm/mach-kirkwood/Kconfig
+++ b/arch/arm/mach-kirkwood/Kconfig
@@ -44,6 +44,12 @@ config MACH_GURUPLUG
 	  Say 'Y' here if you want your kernel to support the
 	  Marvell GuruPlug Reference Board.
 
+config MACH_DREAMPLUG
+	bool "Marvell DreamPlug Reference Board"
+	help
+	  Say 'Y' here if you want your kernel to support the
+	  Marvell DreamPlug Reference Board.
+
 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 5dcaa81..c443a13 100644
--- a/arch/arm/mach-kirkwood/Makefile
+++ b/arch/arm/mach-kirkwood/Makefile
@@ -7,6 +7,7 @@ obj-$(CONFIG_MACH_MV88F6281GTW_GE)	+= mv88f6281gtw_ge-setup.o
 obj-$(CONFIG_MACH_SHEEVAPLUG)		+= sheevaplug-setup.o
 obj-$(CONFIG_MACH_ESATA_SHEEVAPLUG)	+= sheevaplug-setup.o
 obj-$(CONFIG_MACH_GURUPLUG)		+= guruplug-setup.o
+obj-$(CONFIG_MACH_DREAMPLUG)		+= dreamplug-setup.o
 obj-$(CONFIG_MACH_DOCKSTAR)		+= dockstar-setup.o
 obj-$(CONFIG_MACH_TS219)		+= ts219-setup.o tsx1x-common.o
 obj-$(CONFIG_MACH_TS41X)		+= ts41x-setup.o tsx1x-common.o
diff --git a/arch/arm/mach-kirkwood/dreamplug-setup.c b/arch/arm/mach-kirkwood/dreamplug-setup.c
new file mode 100644
index 0000000..09cdd95
--- /dev/null
+++ b/arch/arm/mach-kirkwood/dreamplug-setup.c
@@ -0,0 +1,151 @@
+/*
+ * arch/arm/mach-kirkwood/dreamplug-setup.c
+ *
+ * Marvell DreamPlug Reference 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/platform_device.h>
+#include <linux/mtd/partitions.h>
+#include <linux/ata_platform.h>
+#include <linux/mv643xx_eth.h>
+#include <linux/gpio.h>
+#include <linux/leds.h>
+#include <linux/mtd/physmap.h>
+#include <linux/spi/flash.h>
+#include <linux/spi/spi.h>
+#include <linux/spi/orion_spi.h>
+#include <asm/mach-types.h>
+#include <asm/mach/arch.h>
+#include <mach/kirkwood.h>
+#include <plat/mvsdio.h>
+#include "common.h"
+#include "mpp.h"
+
+struct mtd_partition dreamplug_partitions[] = {
+	{
+		.name	= "u-boot",
+		.size	= SZ_512K,
+		.offset = 0,
+	},
+	{
+		.name	= "u-boot env",
+		.size	= SZ_64K,
+		.offset = SZ_512K + SZ_512K,
+	},
+};
+
+static const struct flash_platform_data dreamplug_spi_slave_data = {
+	.type		= "mx25l1606e",
+	.name		= "spi_flash",
+	.parts		= dreamplug_partitions,
+	.nr_parts	= ARRAY_SIZE(dreamplug_partitions),
+};
+
+static struct spi_board_info __initdata dreamplug_spi_slave_info[] = {
+	{
+		.modalias	= "m25p80",
+		.platform_data	= &dreamplug_spi_slave_data,
+		.irq		= -1,
+		.max_speed_hz	= 50000000,
+		.bus_num	= 0,
+		.chip_select	= 0,
+	},
+};
+
+static struct mv643xx_eth_platform_data dreamplug_ge00_data = {
+	.phy_addr	= MV643XX_ETH_PHY_ADDR(0),
+};
+
+static struct mv643xx_eth_platform_data dreamplug_ge01_data = {
+	.phy_addr	= MV643XX_ETH_PHY_ADDR(1),
+};
+
+static struct mv_sata_platform_data dreamplug_sata_data = {
+	.n_ports	= 1,
+};
+
+static struct mvsdio_platform_data dreamplug_mvsdio_data = {
+	/* unfortunately the CD signal has not been connected */
+};
+
+static struct gpio_led dreamplug_led_pins[] = {
+	{
+		.name			= "dreamplug:blue:bluetooth",
+		.gpio			= 47,
+		.active_low		= 1,
+	},
+	{
+		.name			= "dreamplug:green:wifi",
+		.gpio			= 48,
+		.active_low		= 1,
+	},
+	{
+		.name			= "dreamplug:green:wifi_ap",
+		.gpio			= 49,
+		.active_low		= 1,
+	},
+};
+
+static struct gpio_led_platform_data dreamplug_led_data = {
+	.leds		= dreamplug_led_pins,
+	.num_leds	= ARRAY_SIZE(dreamplug_led_pins),
+};
+
+static struct platform_device dreamplug_leds = {
+	.name	= "leds-gpio",
+	.id	= -1,
+	.dev	= {
+		.platform_data	= &dreamplug_led_data,
+	}
+};
+
+static unsigned int dreamplug_mpp_config[] __initdata = {
+	MPP0_SPI_SCn,
+	MPP1_SPI_MOSI,
+	MPP2_SPI_SCK,
+	MPP3_SPI_MISO,
+	MPP47_GPIO,	/* Bluetooth LED */
+	MPP48_GPIO,	/* Wifi LED */
+	MPP49_GPIO,	/* Wifi AP LED */
+	0
+};
+
+static void __init dreamplug_init(void)
+{
+	/*
+	 * Basic setup. Needs to be called early.
+	 */
+	kirkwood_init();
+	kirkwood_mpp_conf(dreamplug_mpp_config);
+
+	kirkwood_uart0_init();
+
+	spi_register_board_info(dreamplug_spi_slave_info,
+				ARRAY_SIZE(dreamplug_spi_slave_info));
+	kirkwood_spi_init();
+
+	kirkwood_ehci_init();
+	kirkwood_ge00_init(&dreamplug_ge00_data);
+	kirkwood_ge01_init(&dreamplug_ge01_data);
+	kirkwood_sata_init(&dreamplug_sata_data);
+	kirkwood_sdio_init(&dreamplug_mvsdio_data);
+
+	platform_device_register(&dreamplug_leds);
+}
+
+MACHINE_START(DREAMPLUG, "Marvell DreamPlug Reference Board")
+	/* Maintainer: Siddarth Gore <gores@marvell.com> */
+	.atag_offset    = 0x100,
+	.init_machine	= dreamplug_init,
+	.map_io		= kirkwood_map_io,
+	.init_early	= kirkwood_init_early,
+	.init_irq	= kirkwood_init_irq,
+	.timer		= &kirkwood_timer,
+	.restart        = kirkwood_restart,
+MACHINE_END
-- 
1.7.0.4

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

* [PATCH 0/3 v4] arm: kirkwood: add dreamplug/devicetree support
  2011-08-09 16:47 [PATCH 0/3 v2] RFC: marvell dreamplug dft support Jason Cooper
@ 2012-02-22 19:18   ` Jason Cooper
  2011-08-09 16:47 ` [PATCH 2/3 v2] RFC: arm/kirkwood: add dreamplug support Jason Cooper
                     ` (11 subsequent siblings)
  12 siblings, 0 replies; 76+ messages in thread
From: Jason Cooper @ 2012-02-22 19:18 UTC (permalink / raw)
  To: arnd, grant.likely; +Cc: devicetree-discuss, Jason Cooper, linux-arm-kernel

This patch series provides initial support for devicetree on kirkwood for the
dreamplug platform.  After discussing the approach with Arnd Bergman last week
at ELC, we decided to take an incremental approach to the conversion.  First, I
would detect that we were on the dreamplug via the devicetree blob.  Then,
configure uart0 via devicetree.  We chose the uart since it is already well
supported under devicetree.

This patch series has been boot-tested on the dreamplug.

In a future patch series, I plan to migrate spi/flash/partitions over to
devicetree.

When the migration is complete, board-dt.c will not be specific to the
dreamplug, and dts files can be written for all of the other kirkwood boards.

Jason Cooper (3):
  arm: ignore devicetree blobs.
  arm: kirkwood: add dreamplug (fdt) support.
  arm: kirkwood: convert uart0 to devicetree.

 arch/arm/boot/.gitignore                 |    1 +
 arch/arm/boot/dts/kirkwood-dreamplug.dts |   19 +++
 arch/arm/boot/dts/kirkwood.dtsi          |   14 +++
 arch/arm/mach-kirkwood/Kconfig           |   14 +++
 arch/arm/mach-kirkwood/Makefile          |    1 +
 arch/arm/mach-kirkwood/Makefile.boot     |    2 +
 arch/arm/mach-kirkwood/board-dt.c        |  180 ++++++++++++++++++++++++++++++
 7 files changed, 231 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/boot/dts/kirkwood-dreamplug.dts
 create mode 100644 arch/arm/boot/dts/kirkwood.dtsi
 create mode 100644 arch/arm/mach-kirkwood/board-dt.c

-- 
1.7.3.4

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

* [PATCH 0/3 v4] arm: kirkwood: add dreamplug/devicetree support
@ 2012-02-22 19:18   ` Jason Cooper
  0 siblings, 0 replies; 76+ messages in thread
From: Jason Cooper @ 2012-02-22 19:18 UTC (permalink / raw)
  To: linux-arm-kernel

This patch series provides initial support for devicetree on kirkwood for the
dreamplug platform.  After discussing the approach with Arnd Bergman last week
at ELC, we decided to take an incremental approach to the conversion.  First, I
would detect that we were on the dreamplug via the devicetree blob.  Then,
configure uart0 via devicetree.  We chose the uart since it is already well
supported under devicetree.

This patch series has been boot-tested on the dreamplug.

In a future patch series, I plan to migrate spi/flash/partitions over to
devicetree.

When the migration is complete, board-dt.c will not be specific to the
dreamplug, and dts files can be written for all of the other kirkwood boards.

Jason Cooper (3):
  arm: ignore devicetree blobs.
  arm: kirkwood: add dreamplug (fdt) support.
  arm: kirkwood: convert uart0 to devicetree.

 arch/arm/boot/.gitignore                 |    1 +
 arch/arm/boot/dts/kirkwood-dreamplug.dts |   19 +++
 arch/arm/boot/dts/kirkwood.dtsi          |   14 +++
 arch/arm/mach-kirkwood/Kconfig           |   14 +++
 arch/arm/mach-kirkwood/Makefile          |    1 +
 arch/arm/mach-kirkwood/Makefile.boot     |    2 +
 arch/arm/mach-kirkwood/board-dt.c        |  180 ++++++++++++++++++++++++++++++
 7 files changed, 231 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/boot/dts/kirkwood-dreamplug.dts
 create mode 100644 arch/arm/boot/dts/kirkwood.dtsi
 create mode 100644 arch/arm/mach-kirkwood/board-dt.c

-- 
1.7.3.4

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

* [PATCH 1/3] arm: ignore devicetree blobs.
  2012-02-22 19:18   ` Jason Cooper
@ 2012-02-22 19:18   ` Jason Cooper
  -1 siblings, 0 replies; 76+ messages in thread
From: Jason Cooper @ 2012-02-22 19:18 UTC (permalink / raw)
  To: arnd, grant.likely; +Cc: devicetree-discuss, Jason Cooper, linux-arm-kernel


Signed-off-by: Jason Cooper <jason@lakedaemon.net>
---
NOTE: This is the first version of this patch, so no change history.

 arch/arm/boot/.gitignore |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/arch/arm/boot/.gitignore b/arch/arm/boot/.gitignore
index ce1c5ff..3c79f85 100644
--- a/arch/arm/boot/.gitignore
+++ b/arch/arm/boot/.gitignore
@@ -3,3 +3,4 @@ zImage
 xipImage
 bootpImage
 uImage
+*.dtb
-- 
1.7.3.4

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

* [PATCH 1/3] arm: ignore devicetree blobs.
@ 2012-02-22 19:18   ` Jason Cooper
  0 siblings, 0 replies; 76+ messages in thread
From: Jason Cooper @ 2012-02-22 19:18 UTC (permalink / raw)
  To: linux-arm-kernel


Signed-off-by: Jason Cooper <jason@lakedaemon.net>
---
NOTE: This is the first version of this patch, so no change history.

 arch/arm/boot/.gitignore |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/arch/arm/boot/.gitignore b/arch/arm/boot/.gitignore
index ce1c5ff..3c79f85 100644
--- a/arch/arm/boot/.gitignore
+++ b/arch/arm/boot/.gitignore
@@ -3,3 +3,4 @@ zImage
 xipImage
 bootpImage
 uImage
+*.dtb
-- 
1.7.3.4

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

* [PATCH 2/3 v4] arm: kirkwood: add dreamplug (fdt) support.
  2012-02-22 19:18   ` Jason Cooper
@ 2012-02-22 19:18   ` Jason Cooper
  -1 siblings, 0 replies; 76+ messages in thread
From: Jason Cooper @ 2012-02-22 19:18 UTC (permalink / raw)
  To: arnd, grant.likely; +Cc: devicetree-discuss, Jason Cooper, linux-arm-kernel

Initially, copied guruplug-setup.c and did s/guruplug/dreamplug/g.
Then, switched to SPI based NOR flash.

After talking to Arnd Bergman, chose an incremental approach to adding
devicetree support.  First, we use the dtb to tell us we are on the
dreamplug, then we gradually port over drivers.

Driver porting will start with the uart (see next patch), and progress
from there.  Possibly, spi/flash/partitions will be next.

When done, board-dt.c will no longer be dreamplug specific, and dt's can
be made for the other kirkwood boards.

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

   - attempting dts, looking for pointers.

Changes from v2

   - resubmit as MACH_TYPE_DREAMPLUG (3550) is in arm/for-next, rebased
     against same.
   - removed lame fdt attempt, others are working on kirkwood fdt.  Will
     convert once kirkwood fdt is mainline.
   - s/boot_params/atag_offset/
   - added kirkwood_reset
   - 1 checkpatch.pl warning (help in Kconfig), looks the same as all
     other kirkwood boards...

Changes from v3

   - rebased against v3.3-rc3 (recommended by Arnd)
   - use devicetree to determine which board we are on
   - added patch to configure uart0 from devicetree

 arch/arm/boot/dts/kirkwood-dreamplug.dts |   19 +++
 arch/arm/boot/dts/kirkwood.dtsi          |    6 +
 arch/arm/mach-kirkwood/Kconfig           |   14 +++
 arch/arm/mach-kirkwood/Makefile          |    1 +
 arch/arm/mach-kirkwood/Makefile.boot     |    2 +
 arch/arm/mach-kirkwood/board-dt.c        |  182 ++++++++++++++++++++++++++++++
 6 files changed, 224 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/boot/dts/kirkwood-dreamplug.dts
 create mode 100644 arch/arm/boot/dts/kirkwood.dtsi
 create mode 100644 arch/arm/mach-kirkwood/board-dt.c

diff --git a/arch/arm/boot/dts/kirkwood-dreamplug.dts b/arch/arm/boot/dts/kirkwood-dreamplug.dts
new file mode 100644
index 0000000..fbfaaf6
--- /dev/null
+++ b/arch/arm/boot/dts/kirkwood-dreamplug.dts
@@ -0,0 +1,19 @@
+/dts-v1/;
+
+/include/ "kirkwood.dtsi"
+
+/ {
+	model = "Marvell Dreamplug";
+	compatible = "marvell,dreamplug", "marvell,kirkwood";
+
+	memory {
+		device_type = "memory";
+		reg = <0x00000000 0x20000000>;
+	};
+
+	chosen {
+		bootargs = "console=ttyS0,115200n8 earlyprintk";
+	};
+
+
+};
diff --git a/arch/arm/boot/dts/kirkwood.dtsi b/arch/arm/boot/dts/kirkwood.dtsi
new file mode 100644
index 0000000..771c6bb
--- /dev/null
+++ b/arch/arm/boot/dts/kirkwood.dtsi
@@ -0,0 +1,6 @@
+/include/ "skeleton.dtsi"
+
+/ {
+	compatible = "marvell,kirkwood";
+};
+
diff --git a/arch/arm/mach-kirkwood/Kconfig b/arch/arm/mach-kirkwood/Kconfig
index 7fc603b..6095884 100644
--- a/arch/arm/mach-kirkwood/Kconfig
+++ b/arch/arm/mach-kirkwood/Kconfig
@@ -44,6 +44,20 @@ config MACH_GURUPLUG
 	  Say 'Y' here if you want your kernel to support the
 	  Marvell GuruPlug Reference Board.
 
+config ARCH_KIRKWOOD_DT
+	bool "Marvell Kirkwood Flattened Device Tree"
+	select USE_OF
+	help
+	  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)"
+	depends on ARCH_KIRKWOOD_DT
+	help
+	  Say 'Y' here if you want your kernel to support the
+	  Marvell DreamPlug (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 5dcaa81..acbc5e1 100644
--- a/arch/arm/mach-kirkwood/Makefile
+++ b/arch/arm/mach-kirkwood/Makefile
@@ -20,3 +20,4 @@ obj-$(CONFIG_MACH_NET5BIG_V2)		+= netxbig_v2-setup.o lacie_v2-common.o
 obj-$(CONFIG_MACH_T5325)		+= t5325-setup.o
 
 obj-$(CONFIG_CPU_IDLE)			+= cpuidle.o
+obj-$(CONFIG_ARCH_KIRKWOOD_DT)		+= board-dt.o
diff --git a/arch/arm/mach-kirkwood/Makefile.boot b/arch/arm/mach-kirkwood/Makefile.boot
index 760a0ef..16f9385 100644
--- a/arch/arm/mach-kirkwood/Makefile.boot
+++ b/arch/arm/mach-kirkwood/Makefile.boot
@@ -1,3 +1,5 @@
    zreladdr-y	+= 0x00008000
 params_phys-y	:= 0x00000100
 initrd_phys-y	:= 0x00800000
+
+dtb-$(CONFIG_MACH_DREAMPLUG_DT) += kirkwood-dreamplug.dtb
diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c
new file mode 100644
index 0000000..ab13eb9
--- /dev/null
+++ b/arch/arm/mach-kirkwood/board-dt.c
@@ -0,0 +1,182 @@
+/*
+ * Copyright 2012 (C), Jason Cooper <jason@lakedaemon.net>
+ *
+ * arch/arm/mach-kirkwood/board-dt.c
+ *
+ * Marvell DreamPlug Reference 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/platform_device.h>
+#include <linux/mtd/partitions.h>
+#include <linux/ata_platform.h>
+#include <linux/mv643xx_eth.h>
+#include <linux/of.h>
+#include <linux/of_address.h>
+#include <linux/of_fdt.h>
+#include <linux/of_irq.h>
+#include <linux/of_platform.h>
+#include <linux/gpio.h>
+#include <linux/leds.h>
+#include <linux/mtd/physmap.h>
+#include <linux/spi/flash.h>
+#include <linux/spi/spi.h>
+#include <linux/spi/orion_spi.h>
+#include <asm/mach-types.h>
+#include <asm/mach/arch.h>
+#include <mach/kirkwood.h>
+#include <plat/mvsdio.h>
+#include "common.h"
+#include "mpp.h"
+
+static struct of_device_id kirkwood_dt_match_table[] __initdata = {
+	{ .compatible = "simple-bus", },
+	{ }
+};
+
+struct mtd_partition dreamplug_partitions[] = {
+	{
+		.name	= "u-boot",
+		.size	= SZ_512K,
+		.offset = 0,
+	},
+	{
+		.name	= "u-boot env",
+		.size	= SZ_64K,
+		.offset = SZ_512K + SZ_512K,
+	},
+	{
+		.name	= "dtb",
+		.size	= SZ_64K,
+		.offset = SZ_512K + SZ_512K + SZ_512K,
+	},
+};
+
+static const struct flash_platform_data dreamplug_spi_slave_data = {
+	.type		= "mx25l1606e",
+	.name		= "spi_flash",
+	.parts		= dreamplug_partitions,
+	.nr_parts	= ARRAY_SIZE(dreamplug_partitions),
+};
+
+static struct spi_board_info __initdata dreamplug_spi_slave_info[] = {
+	{
+		.modalias	= "m25p80",
+		.platform_data	= &dreamplug_spi_slave_data,
+		.irq		= -1,
+		.max_speed_hz	= 50000000,
+		.bus_num	= 0,
+		.chip_select	= 0,
+	},
+};
+
+static struct mv643xx_eth_platform_data dreamplug_ge00_data = {
+	.phy_addr	= MV643XX_ETH_PHY_ADDR(0),
+};
+
+static struct mv643xx_eth_platform_data dreamplug_ge01_data = {
+	.phy_addr	= MV643XX_ETH_PHY_ADDR(1),
+};
+
+static struct mv_sata_platform_data dreamplug_sata_data = {
+	.n_ports	= 1,
+};
+
+static struct mvsdio_platform_data dreamplug_mvsdio_data = {
+	/* unfortunately the CD signal has not been connected */
+};
+
+static struct gpio_led dreamplug_led_pins[] = {
+	{
+		.name			= "dreamplug:blue:bluetooth",
+		.gpio			= 47,
+		.active_low		= 1,
+	},
+	{
+		.name			= "dreamplug:green:wifi",
+		.gpio			= 48,
+		.active_low		= 1,
+	},
+	{
+		.name			= "dreamplug:green:wifi_ap",
+		.gpio			= 49,
+		.active_low		= 1,
+	},
+};
+
+static struct gpio_led_platform_data dreamplug_led_data = {
+	.leds		= dreamplug_led_pins,
+	.num_leds	= ARRAY_SIZE(dreamplug_led_pins),
+};
+
+static struct platform_device dreamplug_leds = {
+	.name	= "leds-gpio",
+	.id	= -1,
+	.dev	= {
+		.platform_data	= &dreamplug_led_data,
+	}
+};
+
+static unsigned int dreamplug_mpp_config[] __initdata = {
+	MPP0_SPI_SCn,
+	MPP1_SPI_MOSI,
+	MPP2_SPI_SCK,
+	MPP3_SPI_MISO,
+	MPP47_GPIO,	/* Bluetooth LED */
+	MPP48_GPIO,	/* Wifi LED */
+	MPP49_GPIO,	/* Wifi AP LED */
+	0
+};
+
+static void __init dreamplug_init(void)
+{
+	/*
+	 * Basic setup. Needs to be called early.
+	 */
+	kirkwood_mpp_conf(dreamplug_mpp_config);
+
+	kirkwood_uart0_init();
+
+	spi_register_board_info(dreamplug_spi_slave_info,
+				ARRAY_SIZE(dreamplug_spi_slave_info));
+	kirkwood_spi_init();
+
+	kirkwood_ehci_init();
+	kirkwood_ge00_init(&dreamplug_ge00_data);
+	kirkwood_ge01_init(&dreamplug_ge01_data);
+	kirkwood_sata_init(&dreamplug_sata_data);
+	kirkwood_sdio_init(&dreamplug_mvsdio_data);
+
+	platform_device_register(&dreamplug_leds);
+}
+
+static void __init kirkwood_dt_init(void)
+{
+	kirkwood_init();
+
+	if (!of_machine_is_compatible("kirkwood,dreamplug"))
+		dreamplug_init();
+
+	of_platform_populate(NULL, kirkwood_dt_match_table, NULL, NULL);
+}
+
+static const char *kirkwood_dt_board_compat[] = {
+	"marvell,dreamplug",
+	NULL
+};
+
+DT_MACHINE_START(KIRKWOOD_DT, "Marvell Kirkwood (Flattened Device Tree)")
+	/* Maintainer: Jason Cooper <jason@lakedaemon.net> */
+	.map_io		= kirkwood_map_io,
+	.init_early	= kirkwood_init_early,
+	.init_irq	= kirkwood_init_irq,
+	.timer		= &kirkwood_timer,
+	.init_machine	= kirkwood_dt_init,
+	.restart	= kirkwood_restart,
+	.dt_compat	= kirkwood_dt_board_compat,
+MACHINE_END
-- 
1.7.3.4

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

* [PATCH 2/3 v4] arm: kirkwood: add dreamplug (fdt) support.
@ 2012-02-22 19:18   ` Jason Cooper
  0 siblings, 0 replies; 76+ messages in thread
From: Jason Cooper @ 2012-02-22 19:18 UTC (permalink / raw)
  To: linux-arm-kernel

Initially, copied guruplug-setup.c and did s/guruplug/dreamplug/g.
Then, switched to SPI based NOR flash.

After talking to Arnd Bergman, chose an incremental approach to adding
devicetree support.  First, we use the dtb to tell us we are on the
dreamplug, then we gradually port over drivers.

Driver porting will start with the uart (see next patch), and progress
from there.  Possibly, spi/flash/partitions will be next.

When done, board-dt.c will no longer be dreamplug specific, and dt's can
be made for the other kirkwood boards.

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

   - attempting dts, looking for pointers.

Changes from v2

   - resubmit as MACH_TYPE_DREAMPLUG (3550) is in arm/for-next, rebased
     against same.
   - removed lame fdt attempt, others are working on kirkwood fdt.  Will
     convert once kirkwood fdt is mainline.
   - s/boot_params/atag_offset/
   - added kirkwood_reset
   - 1 checkpatch.pl warning (help in Kconfig), looks the same as all
     other kirkwood boards...

Changes from v3

   - rebased against v3.3-rc3 (recommended by Arnd)
   - use devicetree to determine which board we are on
   - added patch to configure uart0 from devicetree

 arch/arm/boot/dts/kirkwood-dreamplug.dts |   19 +++
 arch/arm/boot/dts/kirkwood.dtsi          |    6 +
 arch/arm/mach-kirkwood/Kconfig           |   14 +++
 arch/arm/mach-kirkwood/Makefile          |    1 +
 arch/arm/mach-kirkwood/Makefile.boot     |    2 +
 arch/arm/mach-kirkwood/board-dt.c        |  182 ++++++++++++++++++++++++++++++
 6 files changed, 224 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/boot/dts/kirkwood-dreamplug.dts
 create mode 100644 arch/arm/boot/dts/kirkwood.dtsi
 create mode 100644 arch/arm/mach-kirkwood/board-dt.c

diff --git a/arch/arm/boot/dts/kirkwood-dreamplug.dts b/arch/arm/boot/dts/kirkwood-dreamplug.dts
new file mode 100644
index 0000000..fbfaaf6
--- /dev/null
+++ b/arch/arm/boot/dts/kirkwood-dreamplug.dts
@@ -0,0 +1,19 @@
+/dts-v1/;
+
+/include/ "kirkwood.dtsi"
+
+/ {
+	model = "Marvell Dreamplug";
+	compatible = "marvell,dreamplug", "marvell,kirkwood";
+
+	memory {
+		device_type = "memory";
+		reg = <0x00000000 0x20000000>;
+	};
+
+	chosen {
+		bootargs = "console=ttyS0,115200n8 earlyprintk";
+	};
+
+
+};
diff --git a/arch/arm/boot/dts/kirkwood.dtsi b/arch/arm/boot/dts/kirkwood.dtsi
new file mode 100644
index 0000000..771c6bb
--- /dev/null
+++ b/arch/arm/boot/dts/kirkwood.dtsi
@@ -0,0 +1,6 @@
+/include/ "skeleton.dtsi"
+
+/ {
+	compatible = "marvell,kirkwood";
+};
+
diff --git a/arch/arm/mach-kirkwood/Kconfig b/arch/arm/mach-kirkwood/Kconfig
index 7fc603b..6095884 100644
--- a/arch/arm/mach-kirkwood/Kconfig
+++ b/arch/arm/mach-kirkwood/Kconfig
@@ -44,6 +44,20 @@ config MACH_GURUPLUG
 	  Say 'Y' here if you want your kernel to support the
 	  Marvell GuruPlug Reference Board.
 
+config ARCH_KIRKWOOD_DT
+	bool "Marvell Kirkwood Flattened Device Tree"
+	select USE_OF
+	help
+	  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)"
+	depends on ARCH_KIRKWOOD_DT
+	help
+	  Say 'Y' here if you want your kernel to support the
+	  Marvell DreamPlug (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 5dcaa81..acbc5e1 100644
--- a/arch/arm/mach-kirkwood/Makefile
+++ b/arch/arm/mach-kirkwood/Makefile
@@ -20,3 +20,4 @@ obj-$(CONFIG_MACH_NET5BIG_V2)		+= netxbig_v2-setup.o lacie_v2-common.o
 obj-$(CONFIG_MACH_T5325)		+= t5325-setup.o
 
 obj-$(CONFIG_CPU_IDLE)			+= cpuidle.o
+obj-$(CONFIG_ARCH_KIRKWOOD_DT)		+= board-dt.o
diff --git a/arch/arm/mach-kirkwood/Makefile.boot b/arch/arm/mach-kirkwood/Makefile.boot
index 760a0ef..16f9385 100644
--- a/arch/arm/mach-kirkwood/Makefile.boot
+++ b/arch/arm/mach-kirkwood/Makefile.boot
@@ -1,3 +1,5 @@
    zreladdr-y	+= 0x00008000
 params_phys-y	:= 0x00000100
 initrd_phys-y	:= 0x00800000
+
+dtb-$(CONFIG_MACH_DREAMPLUG_DT) += kirkwood-dreamplug.dtb
diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c
new file mode 100644
index 0000000..ab13eb9
--- /dev/null
+++ b/arch/arm/mach-kirkwood/board-dt.c
@@ -0,0 +1,182 @@
+/*
+ * Copyright 2012 (C), Jason Cooper <jason@lakedaemon.net>
+ *
+ * arch/arm/mach-kirkwood/board-dt.c
+ *
+ * Marvell DreamPlug Reference 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/platform_device.h>
+#include <linux/mtd/partitions.h>
+#include <linux/ata_platform.h>
+#include <linux/mv643xx_eth.h>
+#include <linux/of.h>
+#include <linux/of_address.h>
+#include <linux/of_fdt.h>
+#include <linux/of_irq.h>
+#include <linux/of_platform.h>
+#include <linux/gpio.h>
+#include <linux/leds.h>
+#include <linux/mtd/physmap.h>
+#include <linux/spi/flash.h>
+#include <linux/spi/spi.h>
+#include <linux/spi/orion_spi.h>
+#include <asm/mach-types.h>
+#include <asm/mach/arch.h>
+#include <mach/kirkwood.h>
+#include <plat/mvsdio.h>
+#include "common.h"
+#include "mpp.h"
+
+static struct of_device_id kirkwood_dt_match_table[] __initdata = {
+	{ .compatible = "simple-bus", },
+	{ }
+};
+
+struct mtd_partition dreamplug_partitions[] = {
+	{
+		.name	= "u-boot",
+		.size	= SZ_512K,
+		.offset = 0,
+	},
+	{
+		.name	= "u-boot env",
+		.size	= SZ_64K,
+		.offset = SZ_512K + SZ_512K,
+	},
+	{
+		.name	= "dtb",
+		.size	= SZ_64K,
+		.offset = SZ_512K + SZ_512K + SZ_512K,
+	},
+};
+
+static const struct flash_platform_data dreamplug_spi_slave_data = {
+	.type		= "mx25l1606e",
+	.name		= "spi_flash",
+	.parts		= dreamplug_partitions,
+	.nr_parts	= ARRAY_SIZE(dreamplug_partitions),
+};
+
+static struct spi_board_info __initdata dreamplug_spi_slave_info[] = {
+	{
+		.modalias	= "m25p80",
+		.platform_data	= &dreamplug_spi_slave_data,
+		.irq		= -1,
+		.max_speed_hz	= 50000000,
+		.bus_num	= 0,
+		.chip_select	= 0,
+	},
+};
+
+static struct mv643xx_eth_platform_data dreamplug_ge00_data = {
+	.phy_addr	= MV643XX_ETH_PHY_ADDR(0),
+};
+
+static struct mv643xx_eth_platform_data dreamplug_ge01_data = {
+	.phy_addr	= MV643XX_ETH_PHY_ADDR(1),
+};
+
+static struct mv_sata_platform_data dreamplug_sata_data = {
+	.n_ports	= 1,
+};
+
+static struct mvsdio_platform_data dreamplug_mvsdio_data = {
+	/* unfortunately the CD signal has not been connected */
+};
+
+static struct gpio_led dreamplug_led_pins[] = {
+	{
+		.name			= "dreamplug:blue:bluetooth",
+		.gpio			= 47,
+		.active_low		= 1,
+	},
+	{
+		.name			= "dreamplug:green:wifi",
+		.gpio			= 48,
+		.active_low		= 1,
+	},
+	{
+		.name			= "dreamplug:green:wifi_ap",
+		.gpio			= 49,
+		.active_low		= 1,
+	},
+};
+
+static struct gpio_led_platform_data dreamplug_led_data = {
+	.leds		= dreamplug_led_pins,
+	.num_leds	= ARRAY_SIZE(dreamplug_led_pins),
+};
+
+static struct platform_device dreamplug_leds = {
+	.name	= "leds-gpio",
+	.id	= -1,
+	.dev	= {
+		.platform_data	= &dreamplug_led_data,
+	}
+};
+
+static unsigned int dreamplug_mpp_config[] __initdata = {
+	MPP0_SPI_SCn,
+	MPP1_SPI_MOSI,
+	MPP2_SPI_SCK,
+	MPP3_SPI_MISO,
+	MPP47_GPIO,	/* Bluetooth LED */
+	MPP48_GPIO,	/* Wifi LED */
+	MPP49_GPIO,	/* Wifi AP LED */
+	0
+};
+
+static void __init dreamplug_init(void)
+{
+	/*
+	 * Basic setup. Needs to be called early.
+	 */
+	kirkwood_mpp_conf(dreamplug_mpp_config);
+
+	kirkwood_uart0_init();
+
+	spi_register_board_info(dreamplug_spi_slave_info,
+				ARRAY_SIZE(dreamplug_spi_slave_info));
+	kirkwood_spi_init();
+
+	kirkwood_ehci_init();
+	kirkwood_ge00_init(&dreamplug_ge00_data);
+	kirkwood_ge01_init(&dreamplug_ge01_data);
+	kirkwood_sata_init(&dreamplug_sata_data);
+	kirkwood_sdio_init(&dreamplug_mvsdio_data);
+
+	platform_device_register(&dreamplug_leds);
+}
+
+static void __init kirkwood_dt_init(void)
+{
+	kirkwood_init();
+
+	if (!of_machine_is_compatible("kirkwood,dreamplug"))
+		dreamplug_init();
+
+	of_platform_populate(NULL, kirkwood_dt_match_table, NULL, NULL);
+}
+
+static const char *kirkwood_dt_board_compat[] = {
+	"marvell,dreamplug",
+	NULL
+};
+
+DT_MACHINE_START(KIRKWOOD_DT, "Marvell Kirkwood (Flattened Device Tree)")
+	/* Maintainer: Jason Cooper <jason@lakedaemon.net> */
+	.map_io		= kirkwood_map_io,
+	.init_early	= kirkwood_init_early,
+	.init_irq	= kirkwood_init_irq,
+	.timer		= &kirkwood_timer,
+	.init_machine	= kirkwood_dt_init,
+	.restart	= kirkwood_restart,
+	.dt_compat	= kirkwood_dt_board_compat,
+MACHINE_END
-- 
1.7.3.4

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

* [PATCH 3/3] arm: kirkwood: convert uart0 to devicetree.
  2012-02-22 19:18   ` Jason Cooper
@ 2012-02-22 19:18   ` Jason Cooper
  -1 siblings, 0 replies; 76+ messages in thread
From: Jason Cooper @ 2012-02-22 19:18 UTC (permalink / raw)
  To: arnd, grant.likely; +Cc: devicetree-discuss, Jason Cooper, linux-arm-kernel

This uart is common to all kirkwood SoC's, so I placed it in the
kirkwood.dtsi.

Signed-off-by: Jason Cooper <jason@lakedaemon.net>
---
NOTE: first version of this patch, no changelog.

 arch/arm/boot/dts/kirkwood.dtsi   |    8 ++++++++
 arch/arm/mach-kirkwood/board-dt.c |    2 --
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/arch/arm/boot/dts/kirkwood.dtsi b/arch/arm/boot/dts/kirkwood.dtsi
index 771c6bb..0531dbb 100644
--- a/arch/arm/boot/dts/kirkwood.dtsi
+++ b/arch/arm/boot/dts/kirkwood.dtsi
@@ -2,5 +2,13 @@
 
 / {
 	compatible = "marvell,kirkwood";
+
+	serial@f1012000 {
+		compatible = "ns16550a";
+		reg = <0xf1012000 0xff>;
+		reg-shift = <2>;
+		interrupts = <33>;
+		clock-frequency = <200000000>;
+	};
 };
 
diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c
index ab13eb9..e247ca7 100644
--- a/arch/arm/mach-kirkwood/board-dt.c
+++ b/arch/arm/mach-kirkwood/board-dt.c
@@ -140,8 +140,6 @@ static void __init dreamplug_init(void)
 	 */
 	kirkwood_mpp_conf(dreamplug_mpp_config);
 
-	kirkwood_uart0_init();
-
 	spi_register_board_info(dreamplug_spi_slave_info,
 				ARRAY_SIZE(dreamplug_spi_slave_info));
 	kirkwood_spi_init();
-- 
1.7.3.4

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

* [PATCH 3/3] arm: kirkwood: convert uart0 to devicetree.
@ 2012-02-22 19:18   ` Jason Cooper
  0 siblings, 0 replies; 76+ messages in thread
From: Jason Cooper @ 2012-02-22 19:18 UTC (permalink / raw)
  To: linux-arm-kernel

This uart is common to all kirkwood SoC's, so I placed it in the
kirkwood.dtsi.

Signed-off-by: Jason Cooper <jason@lakedaemon.net>
---
NOTE: first version of this patch, no changelog.

 arch/arm/boot/dts/kirkwood.dtsi   |    8 ++++++++
 arch/arm/mach-kirkwood/board-dt.c |    2 --
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/arch/arm/boot/dts/kirkwood.dtsi b/arch/arm/boot/dts/kirkwood.dtsi
index 771c6bb..0531dbb 100644
--- a/arch/arm/boot/dts/kirkwood.dtsi
+++ b/arch/arm/boot/dts/kirkwood.dtsi
@@ -2,5 +2,13 @@
 
 / {
 	compatible = "marvell,kirkwood";
+
+	serial at f1012000 {
+		compatible = "ns16550a";
+		reg = <0xf1012000 0xff>;
+		reg-shift = <2>;
+		interrupts = <33>;
+		clock-frequency = <200000000>;
+	};
 };
 
diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c
index ab13eb9..e247ca7 100644
--- a/arch/arm/mach-kirkwood/board-dt.c
+++ b/arch/arm/mach-kirkwood/board-dt.c
@@ -140,8 +140,6 @@ static void __init dreamplug_init(void)
 	 */
 	kirkwood_mpp_conf(dreamplug_mpp_config);
 
-	kirkwood_uart0_init();
-
 	spi_register_board_info(dreamplug_spi_slave_info,
 				ARRAY_SIZE(dreamplug_spi_slave_info));
 	kirkwood_spi_init();
-- 
1.7.3.4

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

* Re: [PATCH 1/3] arm: ignore devicetree blobs.
  2012-02-22 19:18   ` Jason Cooper
@ 2012-02-22 20:38       ` Arnd Bergmann
  -1 siblings, 0 replies; 76+ messages in thread
From: Arnd Bergmann @ 2012-02-22 20:38 UTC (permalink / raw)
  To: Jason Cooper
  Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On Wednesday 22 February 2012, Jason Cooper wrote:
> Signed-off-by: Jason Cooper <jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org>

Acked-by: Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org>

> diff --git a/arch/arm/boot/.gitignore b/arch/arm/boot/.gitignore
> index ce1c5ff..3c79f85 100644
> --- a/arch/arm/boot/.gitignore
> +++ b/arch/arm/boot/.gitignore
> @@ -3,3 +3,4 @@ zImage
>  xipImage
>  bootpImage
>  uImage
> +*.dtb

This patch should probably go through Russell's tree. It looks obviously
correct so unless someone complains in the next few days, just put it into
the patch tracker system.

	Arnd

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

* [PATCH 1/3] arm: ignore devicetree blobs.
@ 2012-02-22 20:38       ` Arnd Bergmann
  0 siblings, 0 replies; 76+ messages in thread
From: Arnd Bergmann @ 2012-02-22 20:38 UTC (permalink / raw)
  To: linux-arm-kernel

On Wednesday 22 February 2012, Jason Cooper wrote:
> Signed-off-by: Jason Cooper <jason@lakedaemon.net>

Acked-by: Arnd Bergmann <arnd@arndb.de>

> diff --git a/arch/arm/boot/.gitignore b/arch/arm/boot/.gitignore
> index ce1c5ff..3c79f85 100644
> --- a/arch/arm/boot/.gitignore
> +++ b/arch/arm/boot/.gitignore
> @@ -3,3 +3,4 @@ zImage
>  xipImage
>  bootpImage
>  uImage
> +*.dtb

This patch should probably go through Russell's tree. It looks obviously
correct so unless someone complains in the next few days, just put it into
the patch tracker system.

	Arnd

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

* Re: [PATCH 2/3 v4] arm: kirkwood: add dreamplug (fdt) support.
  2012-02-22 19:18   ` Jason Cooper
@ 2012-02-22 20:46       ` Arnd Bergmann
  -1 siblings, 0 replies; 76+ messages in thread
From: Arnd Bergmann @ 2012-02-22 20:46 UTC (permalink / raw)
  To: Jason Cooper
  Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ, Lennert Buytenhek,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On Wednesday 22 February 2012, Jason Cooper wrote:
> Initially, copied guruplug-setup.c and did s/guruplug/dreamplug/g.
> Then, switched to SPI based NOR flash.
> 
> After talking to Arnd Bergman, chose an incremental approach to adding
> devicetree support.  First, we use the dtb to tell us we are on the
> dreamplug, then we gradually port over drivers.
> 
> Driver porting will start with the uart (see next patch), and progress
> from there.  Possibly, spi/flash/partitions will be next.
> 
> When done, board-dt.c will no longer be dreamplug specific, and dt's can
> be made for the other kirkwood boards.
> 
> Signed-off-by: Jason Cooper <jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org>

Looks good to me. 

I'm adding Nicolas and Lennert to Cc to make sure they see the mail.

Acked-by: Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org>

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

* [PATCH 2/3 v4] arm: kirkwood: add dreamplug (fdt) support.
@ 2012-02-22 20:46       ` Arnd Bergmann
  0 siblings, 0 replies; 76+ messages in thread
From: Arnd Bergmann @ 2012-02-22 20:46 UTC (permalink / raw)
  To: linux-arm-kernel

On Wednesday 22 February 2012, Jason Cooper wrote:
> Initially, copied guruplug-setup.c and did s/guruplug/dreamplug/g.
> Then, switched to SPI based NOR flash.
> 
> After talking to Arnd Bergman, chose an incremental approach to adding
> devicetree support.  First, we use the dtb to tell us we are on the
> dreamplug, then we gradually port over drivers.
> 
> Driver porting will start with the uart (see next patch), and progress
> from there.  Possibly, spi/flash/partitions will be next.
> 
> When done, board-dt.c will no longer be dreamplug specific, and dt's can
> be made for the other kirkwood boards.
> 
> Signed-off-by: Jason Cooper <jason@lakedaemon.net>

Looks good to me. 

I'm adding Nicolas and Lennert to Cc to make sure they see the mail.

Acked-by: Arnd Bergmann <arnd@arndb.de>

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

* Re: [PATCH 3/3] arm: kirkwood: convert uart0 to devicetree.
  2012-02-22 19:18   ` Jason Cooper
@ 2012-02-22 20:55       ` Arnd Bergmann
  -1 siblings, 0 replies; 76+ messages in thread
From: Arnd Bergmann @ 2012-02-22 20:55 UTC (permalink / raw)
  To: Jason Cooper
  Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On Wednesday 22 February 2012, Jason Cooper wrote:
> This uart is common to all kirkwood SoC's, so I placed it in the
> kirkwood.dtsi.
> 
> Signed-off-by: Jason Cooper <jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org>

I'm not sure how we are handling this for other platforms, but
my feeling is that the serial port information should be in
the board specific dts file, because there are multiple serial
ports on the chips and individual boards may only provide one
of them.

Alternatively, you could list all serial ports in the dts file
and use the linux,stdout-path "chosen" property to tell the
kernel which one to use.

	Arnd

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

* [PATCH 3/3] arm: kirkwood: convert uart0 to devicetree.
@ 2012-02-22 20:55       ` Arnd Bergmann
  0 siblings, 0 replies; 76+ messages in thread
From: Arnd Bergmann @ 2012-02-22 20:55 UTC (permalink / raw)
  To: linux-arm-kernel

On Wednesday 22 February 2012, Jason Cooper wrote:
> This uart is common to all kirkwood SoC's, so I placed it in the
> kirkwood.dtsi.
> 
> Signed-off-by: Jason Cooper <jason@lakedaemon.net>

I'm not sure how we are handling this for other platforms, but
my feeling is that the serial port information should be in
the board specific dts file, because there are multiple serial
ports on the chips and individual boards may only provide one
of them.

Alternatively, you could list all serial ports in the dts file
and use the linux,stdout-path "chosen" property to tell the
kernel which one to use.

	Arnd

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

* Re: [PATCH 3/3] arm: kirkwood: convert uart0 to devicetree.
  2012-02-22 20:55       ` Arnd Bergmann
@ 2012-02-22 21:09         ` Jason
  -1 siblings, 0 replies; 76+ messages in thread
From: Jason @ 2012-02-22 21:09 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: grant.likely, devicetree-discuss, linux-arm-kernel

On Wed, Feb 22, 2012 at 08:55:27PM +0000, Arnd Bergmann wrote:
> On Wednesday 22 February 2012, Jason Cooper wrote:
> > This uart is common to all kirkwood SoC's, so I placed it in the
> > kirkwood.dtsi.
> > 
> > Signed-off-by: Jason Cooper <jason@lakedaemon.net>
> 
> I'm not sure how we are handling this for other platforms, but
> my feeling is that the serial port information should be in
> the board specific dts file, because there are multiple serial
> ports on the chips and individual boards may only provide one
> of them.

On closer inspection, it looks like the openrd board and the qnap boards
are including uart1, nothing else does.  I'll redo it and resubmit.

> Alternatively, you could list all serial ports in the dts file
> and use the linux,stdout-path "chosen" property to tell the
> kernel which one to use.

All of the boards use uart0 as the default tty, so I'm thinking uart0 is
declared in all boards (.dts), and the two that need it, declare uart1
in the same dts.

Does that sound right?

thx,

Jason.

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

* [PATCH 3/3] arm: kirkwood: convert uart0 to devicetree.
@ 2012-02-22 21:09         ` Jason
  0 siblings, 0 replies; 76+ messages in thread
From: Jason @ 2012-02-22 21:09 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Feb 22, 2012 at 08:55:27PM +0000, Arnd Bergmann wrote:
> On Wednesday 22 February 2012, Jason Cooper wrote:
> > This uart is common to all kirkwood SoC's, so I placed it in the
> > kirkwood.dtsi.
> > 
> > Signed-off-by: Jason Cooper <jason@lakedaemon.net>
> 
> I'm not sure how we are handling this for other platforms, but
> my feeling is that the serial port information should be in
> the board specific dts file, because there are multiple serial
> ports on the chips and individual boards may only provide one
> of them.

On closer inspection, it looks like the openrd board and the qnap boards
are including uart1, nothing else does.  I'll redo it and resubmit.

> Alternatively, you could list all serial ports in the dts file
> and use the linux,stdout-path "chosen" property to tell the
> kernel which one to use.

All of the boards use uart0 as the default tty, so I'm thinking uart0 is
declared in all boards (.dts), and the two that need it, declare uart1
in the same dts.

Does that sound right?

thx,

Jason.

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

* Re: [PATCH 2/3 v4] arm: kirkwood: add dreamplug (fdt) support.
  2012-02-22 20:46       ` Arnd Bergmann
@ 2012-02-22 21:17           ` Nicolas Pitre
  -1 siblings, 0 replies; 76+ messages in thread
From: Nicolas Pitre @ 2012-02-22 21:17 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ, Jason Cooper,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	Lennert Buytenhek

On Wed, 22 Feb 2012, Arnd Bergmann wrote:

> On Wednesday 22 February 2012, Jason Cooper wrote:
> > Initially, copied guruplug-setup.c and did s/guruplug/dreamplug/g.
> > Then, switched to SPI based NOR flash.
> > 
> > After talking to Arnd Bergman, chose an incremental approach to adding
> > devicetree support.  First, we use the dtb to tell us we are on the
> > dreamplug, then we gradually port over drivers.
> > 
> > Driver porting will start with the uart (see next patch), and progress
> > from there.  Possibly, spi/flash/partitions will be next.
> > 
> > When done, board-dt.c will no longer be dreamplug specific, and dt's can
> > be made for the other kirkwood boards.
> > 
> > Signed-off-by: Jason Cooper <jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org>
> 
> Looks good to me. 
> 
> I'm adding Nicolas and Lennert to Cc to make sure they see the mail.
> 
> Acked-by: Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org>

I'm fine with the approach.

Acked-by: Nicolas Pitre <nico-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>

Arnd, Jason: please feel free to work something out between yourselves 
to move those patches into the arm-soc tree.


Nicolas

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

* [PATCH 2/3 v4] arm: kirkwood: add dreamplug (fdt) support.
@ 2012-02-22 21:17           ` Nicolas Pitre
  0 siblings, 0 replies; 76+ messages in thread
From: Nicolas Pitre @ 2012-02-22 21:17 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, 22 Feb 2012, Arnd Bergmann wrote:

> On Wednesday 22 February 2012, Jason Cooper wrote:
> > Initially, copied guruplug-setup.c and did s/guruplug/dreamplug/g.
> > Then, switched to SPI based NOR flash.
> > 
> > After talking to Arnd Bergman, chose an incremental approach to adding
> > devicetree support.  First, we use the dtb to tell us we are on the
> > dreamplug, then we gradually port over drivers.
> > 
> > Driver porting will start with the uart (see next patch), and progress
> > from there.  Possibly, spi/flash/partitions will be next.
> > 
> > When done, board-dt.c will no longer be dreamplug specific, and dt's can
> > be made for the other kirkwood boards.
> > 
> > Signed-off-by: Jason Cooper <jason@lakedaemon.net>
> 
> Looks good to me. 
> 
> I'm adding Nicolas and Lennert to Cc to make sure they see the mail.
> 
> Acked-by: Arnd Bergmann <arnd@arndb.de>

I'm fine with the approach.

Acked-by: Nicolas Pitre <nico@linaro.org>

Arnd, Jason: please feel free to work something out between yourselves 
to move those patches into the arm-soc tree.


Nicolas

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

* Re: [PATCH 1/3] arm: ignore devicetree blobs.
  2012-02-22 19:18   ` Jason Cooper
@ 2012-02-22 22:26       ` Uwe Kleine-König
  -1 siblings, 0 replies; 76+ messages in thread
From: Uwe Kleine-König @ 2012-02-22 22:26 UTC (permalink / raw)
  To: Jason Cooper
  Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On Wed, Feb 22, 2012 at 07:18:44PM +0000, Jason Cooper wrote:
> 
> Signed-off-by: Jason Cooper <jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org>
/me claims prior art:

	http://mid.gmane.org/1323808612-14976-1-git-send-email-u.kleine-koenig@pengutronix.de

Best regards
Uwe
	
> ---
> NOTE: This is the first version of this patch, so no change history.
> 
>  arch/arm/boot/.gitignore |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/arm/boot/.gitignore b/arch/arm/boot/.gitignore
> index ce1c5ff..3c79f85 100644
> --- a/arch/arm/boot/.gitignore
> +++ b/arch/arm/boot/.gitignore
> @@ -3,3 +3,4 @@ zImage
>  xipImage
>  bootpImage
>  uImage
> +*.dtb
> -- 
> 1.7.3.4
> 
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
> 

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

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

* [PATCH 1/3] arm: ignore devicetree blobs.
@ 2012-02-22 22:26       ` Uwe Kleine-König
  0 siblings, 0 replies; 76+ messages in thread
From: Uwe Kleine-König @ 2012-02-22 22:26 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Feb 22, 2012 at 07:18:44PM +0000, Jason Cooper wrote:
> 
> Signed-off-by: Jason Cooper <jason@lakedaemon.net>
/me claims prior art:

	http://mid.gmane.org/1323808612-14976-1-git-send-email-u.kleine-koenig at pengutronix.de

Best regards
Uwe
	
> ---
> NOTE: This is the first version of this patch, so no change history.
> 
>  arch/arm/boot/.gitignore |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/arm/boot/.gitignore b/arch/arm/boot/.gitignore
> index ce1c5ff..3c79f85 100644
> --- a/arch/arm/boot/.gitignore
> +++ b/arch/arm/boot/.gitignore
> @@ -3,3 +3,4 @@ zImage
>  xipImage
>  bootpImage
>  uImage
> +*.dtb
> -- 
> 1.7.3.4
> 
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
> 

-- 
Pengutronix e.K.                           | Uwe Kleine-K?nig            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

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

* [PATCH 1/3 v2] RFC: arm/kirkwood: TEMP hack till mach-types is updated.
  2011-08-09 16:47 ` [PATCH 1/3 v2] RFC: arm/kirkwood: TEMP hack till mach-types is updated Jason Cooper
@ 2012-02-23  1:46   ` Grant Likely
  2012-02-23  1:48   ` Grant Likely
  1 sibling, 0 replies; 76+ messages in thread
From: Grant Likely @ 2012-02-23  1:46 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Aug 09, 2011 at 04:47:31PM +0000, Jason Cooper wrote:
> 	DO NOT SUBMIT!
> 
> Signed-off-by: Jason Cooper <jason@lakedaemon.net>
> ---
>  arch/arm/tools/mach-types |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/arm/tools/mach-types b/arch/arm/tools/mach-types
> index 3b3776d..d5c5779 100644
> --- a/arch/arm/tools/mach-types
> +++ b/arch/arm/tools/mach-types
> @@ -1113,3 +1113,4 @@ blissc			MACH_BLISSC		BLISSC			3491
>  thales_adc		MACH_THALES_ADC		THALES_ADC		3492
>  ubisys_p9d_evp		MACH_UBISYS_P9D_EVP	UBISYS_P9D_EVP		3493
>  atdgp318		MACH_ATDGP318		ATDGP318		3494
> +dreamplug		MACH_DREAMPLUG		DREAMPLUG		3550

Also completely unneeded when adding DT-only board support.

g.

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

* [PATCH 1/3 v2] RFC: arm/kirkwood: TEMP hack till mach-types is updated.
  2011-08-09 16:47 ` [PATCH 1/3 v2] RFC: arm/kirkwood: TEMP hack till mach-types is updated Jason Cooper
  2012-02-23  1:46   ` Grant Likely
@ 2012-02-23  1:48   ` Grant Likely
  1 sibling, 0 replies; 76+ messages in thread
From: Grant Likely @ 2012-02-23  1:48 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Aug 09, 2011 at 04:47:31PM +0000, Jason Cooper wrote:
> 	DO NOT SUBMIT!
> 
> Signed-off-by: Jason Cooper <jason@lakedaemon.net>
> ---
>  arch/arm/tools/mach-types |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/arm/tools/mach-types b/arch/arm/tools/mach-types
> index 3b3776d..d5c5779 100644
> --- a/arch/arm/tools/mach-types
> +++ b/arch/arm/tools/mach-types
> @@ -1113,3 +1113,4 @@ blissc			MACH_BLISSC		BLISSC			3491
>  thales_adc		MACH_THALES_ADC		THALES_ADC		3492
>  ubisys_p9d_evp		MACH_UBISYS_P9D_EVP	UBISYS_P9D_EVP		3493
>  atdgp318		MACH_ATDGP318		ATDGP318		3494
> +dreamplug		MACH_DREAMPLUG		DREAMPLUG		3550

Oops, I replied to a really old email.  Ignore my comments.

g.

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

* Re: [PATCH 2/3 v4] arm: kirkwood: add dreamplug (fdt) support.
  2012-02-22 19:18   ` Jason Cooper
@ 2012-02-23  3:19       ` Rob Herring
  -1 siblings, 0 replies; 76+ messages in thread
From: Rob Herring @ 2012-02-23  3:19 UTC (permalink / raw)
  To: Jason Cooper
  Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On 02/22/2012 01:18 PM, Jason Cooper wrote:
> Initially, copied guruplug-setup.c and did s/guruplug/dreamplug/g.
> Then, switched to SPI based NOR flash.
> 
> After talking to Arnd Bergman, chose an incremental approach to adding
> devicetree support.  First, we use the dtb to tell us we are on the
> dreamplug, then we gradually port over drivers.
> 
> Driver porting will start with the uart (see next patch), and progress
> from there.  Possibly, spi/flash/partitions will be next.
> 
> When done, board-dt.c will no longer be dreamplug specific, and dt's can
> be made for the other kirkwood boards.
> 
> Signed-off-by: Jason Cooper <jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org>
> ---
> Changes from v1
> 
>    - attempting dts, looking for pointers.
> 
> Changes from v2
> 
>    - resubmit as MACH_TYPE_DREAMPLUG (3550) is in arm/for-next, rebased
>      against same.
>    - removed lame fdt attempt, others are working on kirkwood fdt.  Will
>      convert once kirkwood fdt is mainline.
>    - s/boot_params/atag_offset/
>    - added kirkwood_reset
>    - 1 checkpatch.pl warning (help in Kconfig), looks the same as all
>      other kirkwood boards...
> 
> Changes from v3
> 
>    - rebased against v3.3-rc3 (recommended by Arnd)
>    - use devicetree to determine which board we are on
>    - added patch to configure uart0 from devicetree
> 
>  arch/arm/boot/dts/kirkwood-dreamplug.dts |   19 +++
>  arch/arm/boot/dts/kirkwood.dtsi          |    6 +
>  arch/arm/mach-kirkwood/Kconfig           |   14 +++
>  arch/arm/mach-kirkwood/Makefile          |    1 +
>  arch/arm/mach-kirkwood/Makefile.boot     |    2 +
>  arch/arm/mach-kirkwood/board-dt.c        |  182 ++++++++++++++++++++++++++++++
>  6 files changed, 224 insertions(+), 0 deletions(-)
>  create mode 100644 arch/arm/boot/dts/kirkwood-dreamplug.dts
>  create mode 100644 arch/arm/boot/dts/kirkwood.dtsi
>  create mode 100644 arch/arm/mach-kirkwood/board-dt.c
> 
> diff --git a/arch/arm/boot/dts/kirkwood-dreamplug.dts b/arch/arm/boot/dts/kirkwood-dreamplug.dts
> new file mode 100644
> index 0000000..fbfaaf6
> --- /dev/null
> +++ b/arch/arm/boot/dts/kirkwood-dreamplug.dts
> @@ -0,0 +1,19 @@
> +/dts-v1/;
> +
> +/include/ "kirkwood.dtsi"
> +
> +/ {
> +	model = "Marvell Dreamplug";
> +	compatible = "marvell,dreamplug", "marvell,kirkwood";
> +
> +	memory {
> +		device_type = "memory";
> +		reg = <0x00000000 0x20000000>;
> +	};
> +
> +	chosen {
> +		bootargs = "console=ttyS0,115200n8 earlyprintk";
> +	};
> +
> +
> +};
> diff --git a/arch/arm/boot/dts/kirkwood.dtsi b/arch/arm/boot/dts/kirkwood.dtsi
> new file mode 100644
> index 0000000..771c6bb
> --- /dev/null
> +++ b/arch/arm/boot/dts/kirkwood.dtsi
> @@ -0,0 +1,6 @@
> +/include/ "skeleton.dtsi"
> +
> +/ {
> +	compatible = "marvell,kirkwood";
> +};
> +
> diff --git a/arch/arm/mach-kirkwood/Kconfig b/arch/arm/mach-kirkwood/Kconfig
> index 7fc603b..6095884 100644
> --- a/arch/arm/mach-kirkwood/Kconfig
> +++ b/arch/arm/mach-kirkwood/Kconfig
> @@ -44,6 +44,20 @@ config MACH_GURUPLUG
>  	  Say 'Y' here if you want your kernel to support the
>  	  Marvell GuruPlug Reference Board.
>  
> +config ARCH_KIRKWOOD_DT
> +	bool "Marvell Kirkwood Flattened Device Tree"
> +	select USE_OF
> +	help
> +	  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)"
> +	depends on ARCH_KIRKWOOD_DT
> +	help
> +	  Say 'Y' here if you want your kernel to support the
> +	  Marvell DreamPlug (Flattened Device Tree).

Why do you need 2 entries?


> +
>  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 5dcaa81..acbc5e1 100644
> --- a/arch/arm/mach-kirkwood/Makefile
> +++ b/arch/arm/mach-kirkwood/Makefile
> @@ -20,3 +20,4 @@ obj-$(CONFIG_MACH_NET5BIG_V2)		+= netxbig_v2-setup.o lacie_v2-common.o
>  obj-$(CONFIG_MACH_T5325)		+= t5325-setup.o
>  
>  obj-$(CONFIG_CPU_IDLE)			+= cpuidle.o
> +obj-$(CONFIG_ARCH_KIRKWOOD_DT)		+= board-dt.o
> diff --git a/arch/arm/mach-kirkwood/Makefile.boot b/arch/arm/mach-kirkwood/Makefile.boot
> index 760a0ef..16f9385 100644
> --- a/arch/arm/mach-kirkwood/Makefile.boot
> +++ b/arch/arm/mach-kirkwood/Makefile.boot
> @@ -1,3 +1,5 @@
>     zreladdr-y	+= 0x00008000
>  params_phys-y	:= 0x00000100
>  initrd_phys-y	:= 0x00800000
> +
> +dtb-$(CONFIG_MACH_DREAMPLUG_DT) += kirkwood-dreamplug.dtb
> diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c
> new file mode 100644
> index 0000000..ab13eb9
> --- /dev/null
> +++ b/arch/arm/mach-kirkwood/board-dt.c
> @@ -0,0 +1,182 @@
> +/*
> + * Copyright 2012 (C), Jason Cooper <jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org>
> + *
> + * arch/arm/mach-kirkwood/board-dt.c
> + *
> + * Marvell DreamPlug Reference 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/platform_device.h>
> +#include <linux/mtd/partitions.h>
> +#include <linux/ata_platform.h>
> +#include <linux/mv643xx_eth.h>
> +#include <linux/of.h>
> +#include <linux/of_address.h>
> +#include <linux/of_fdt.h>
> +#include <linux/of_irq.h>
> +#include <linux/of_platform.h>
> +#include <linux/gpio.h>
> +#include <linux/leds.h>
> +#include <linux/mtd/physmap.h>
> +#include <linux/spi/flash.h>
> +#include <linux/spi/spi.h>
> +#include <linux/spi/orion_spi.h>
> +#include <asm/mach-types.h>
> +#include <asm/mach/arch.h>
> +#include <mach/kirkwood.h>
> +#include <plat/mvsdio.h>
> +#include "common.h"
> +#include "mpp.h"
> +
> +static struct of_device_id kirkwood_dt_match_table[] __initdata = {
> +	{ .compatible = "simple-bus", },
> +	{ }
> +};
> +
> +struct mtd_partition dreamplug_partitions[] = {
> +	{
> +		.name	= "u-boot",
> +		.size	= SZ_512K,
> +		.offset = 0,
> +	},
> +	{
> +		.name	= "u-boot env",
> +		.size	= SZ_64K,
> +		.offset = SZ_512K + SZ_512K,
> +	},
> +	{
> +		.name	= "dtb",
> +		.size	= SZ_64K,
> +		.offset = SZ_512K + SZ_512K + SZ_512K,
> +	},
> +};
> +
> +static const struct flash_platform_data dreamplug_spi_slave_data = {
> +	.type		= "mx25l1606e",
> +	.name		= "spi_flash",
> +	.parts		= dreamplug_partitions,
> +	.nr_parts	= ARRAY_SIZE(dreamplug_partitions),
> +};
> +
> +static struct spi_board_info __initdata dreamplug_spi_slave_info[] = {
> +	{
> +		.modalias	= "m25p80",
> +		.platform_data	= &dreamplug_spi_slave_data,
> +		.irq		= -1,
> +		.max_speed_hz	= 50000000,
> +		.bus_num	= 0,
> +		.chip_select	= 0,
> +	},
> +};
> +
> +static struct mv643xx_eth_platform_data dreamplug_ge00_data = {
> +	.phy_addr	= MV643XX_ETH_PHY_ADDR(0),
> +};
> +
> +static struct mv643xx_eth_platform_data dreamplug_ge01_data = {
> +	.phy_addr	= MV643XX_ETH_PHY_ADDR(1),
> +};
> +
> +static struct mv_sata_platform_data dreamplug_sata_data = {
> +	.n_ports	= 1,
> +};
> +
> +static struct mvsdio_platform_data dreamplug_mvsdio_data = {
> +	/* unfortunately the CD signal has not been connected */
> +};
> +
> +static struct gpio_led dreamplug_led_pins[] = {
> +	{
> +		.name			= "dreamplug:blue:bluetooth",
> +		.gpio			= 47,
> +		.active_low		= 1,
> +	},
> +	{
> +		.name			= "dreamplug:green:wifi",
> +		.gpio			= 48,
> +		.active_low		= 1,
> +	},
> +	{
> +		.name			= "dreamplug:green:wifi_ap",
> +		.gpio			= 49,
> +		.active_low		= 1,
> +	},
> +};
> +
> +static struct gpio_led_platform_data dreamplug_led_data = {
> +	.leds		= dreamplug_led_pins,
> +	.num_leds	= ARRAY_SIZE(dreamplug_led_pins),
> +};
> +
> +static struct platform_device dreamplug_leds = {
> +	.name	= "leds-gpio",
> +	.id	= -1,
> +	.dev	= {
> +		.platform_data	= &dreamplug_led_data,
> +	}
> +};
> +
> +static unsigned int dreamplug_mpp_config[] __initdata = {
> +	MPP0_SPI_SCn,
> +	MPP1_SPI_MOSI,
> +	MPP2_SPI_SCK,
> +	MPP3_SPI_MISO,
> +	MPP47_GPIO,	/* Bluetooth LED */
> +	MPP48_GPIO,	/* Wifi LED */
> +	MPP49_GPIO,	/* Wifi AP LED */
> +	0
> +};

Do you need this to boot? All this data should come from the dtb.


> +
> +static void __init dreamplug_init(void)
> +{
> +	/*
> +	 * Basic setup. Needs to be called early.
> +	 */
> +	kirkwood_mpp_conf(dreamplug_mpp_config);
> +
> +	kirkwood_uart0_init();
> +
> +	spi_register_board_info(dreamplug_spi_slave_info,
> +				ARRAY_SIZE(dreamplug_spi_slave_info));
> +	kirkwood_spi_init();
> +
> +	kirkwood_ehci_init();
> +	kirkwood_ge00_init(&dreamplug_ge00_data);
> +	kirkwood_ge01_init(&dreamplug_ge01_data);
> +	kirkwood_sata_init(&dreamplug_sata_data);
> +	kirkwood_sdio_init(&dreamplug_mvsdio_data);
> +
> +	platform_device_register(&dreamplug_leds);
> +}
> +
> +static void __init kirkwood_dt_init(void)
> +{
> +	kirkwood_init();
> +
> +	if (!of_machine_is_compatible("kirkwood,dreamplug"))

Huh? Your string doesn't match your dts file.

You've already matched against "marvell,dreamplug", so is this check
necessary?

Rob

> +		dreamplug_init();
> +
> +	of_platform_populate(NULL, kirkwood_dt_match_table, NULL, NULL);
> +}
> +
> +static const char *kirkwood_dt_board_compat[] = {
> +	"marvell,dreamplug",
> +	NULL
> +};
> +
> +DT_MACHINE_START(KIRKWOOD_DT, "Marvell Kirkwood (Flattened Device Tree)")
> +	/* Maintainer: Jason Cooper <jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org> */
> +	.map_io		= kirkwood_map_io,
> +	.init_early	= kirkwood_init_early,
> +	.init_irq	= kirkwood_init_irq,
> +	.timer		= &kirkwood_timer,
> +	.init_machine	= kirkwood_dt_init,
> +	.restart	= kirkwood_restart,
> +	.dt_compat	= kirkwood_dt_board_compat,
> +MACHINE_END

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

* [PATCH 2/3 v4] arm: kirkwood: add dreamplug (fdt) support.
@ 2012-02-23  3:19       ` Rob Herring
  0 siblings, 0 replies; 76+ messages in thread
From: Rob Herring @ 2012-02-23  3:19 UTC (permalink / raw)
  To: linux-arm-kernel

On 02/22/2012 01:18 PM, Jason Cooper wrote:
> Initially, copied guruplug-setup.c and did s/guruplug/dreamplug/g.
> Then, switched to SPI based NOR flash.
> 
> After talking to Arnd Bergman, chose an incremental approach to adding
> devicetree support.  First, we use the dtb to tell us we are on the
> dreamplug, then we gradually port over drivers.
> 
> Driver porting will start with the uart (see next patch), and progress
> from there.  Possibly, spi/flash/partitions will be next.
> 
> When done, board-dt.c will no longer be dreamplug specific, and dt's can
> be made for the other kirkwood boards.
> 
> Signed-off-by: Jason Cooper <jason@lakedaemon.net>
> ---
> Changes from v1
> 
>    - attempting dts, looking for pointers.
> 
> Changes from v2
> 
>    - resubmit as MACH_TYPE_DREAMPLUG (3550) is in arm/for-next, rebased
>      against same.
>    - removed lame fdt attempt, others are working on kirkwood fdt.  Will
>      convert once kirkwood fdt is mainline.
>    - s/boot_params/atag_offset/
>    - added kirkwood_reset
>    - 1 checkpatch.pl warning (help in Kconfig), looks the same as all
>      other kirkwood boards...
> 
> Changes from v3
> 
>    - rebased against v3.3-rc3 (recommended by Arnd)
>    - use devicetree to determine which board we are on
>    - added patch to configure uart0 from devicetree
> 
>  arch/arm/boot/dts/kirkwood-dreamplug.dts |   19 +++
>  arch/arm/boot/dts/kirkwood.dtsi          |    6 +
>  arch/arm/mach-kirkwood/Kconfig           |   14 +++
>  arch/arm/mach-kirkwood/Makefile          |    1 +
>  arch/arm/mach-kirkwood/Makefile.boot     |    2 +
>  arch/arm/mach-kirkwood/board-dt.c        |  182 ++++++++++++++++++++++++++++++
>  6 files changed, 224 insertions(+), 0 deletions(-)
>  create mode 100644 arch/arm/boot/dts/kirkwood-dreamplug.dts
>  create mode 100644 arch/arm/boot/dts/kirkwood.dtsi
>  create mode 100644 arch/arm/mach-kirkwood/board-dt.c
> 
> diff --git a/arch/arm/boot/dts/kirkwood-dreamplug.dts b/arch/arm/boot/dts/kirkwood-dreamplug.dts
> new file mode 100644
> index 0000000..fbfaaf6
> --- /dev/null
> +++ b/arch/arm/boot/dts/kirkwood-dreamplug.dts
> @@ -0,0 +1,19 @@
> +/dts-v1/;
> +
> +/include/ "kirkwood.dtsi"
> +
> +/ {
> +	model = "Marvell Dreamplug";
> +	compatible = "marvell,dreamplug", "marvell,kirkwood";
> +
> +	memory {
> +		device_type = "memory";
> +		reg = <0x00000000 0x20000000>;
> +	};
> +
> +	chosen {
> +		bootargs = "console=ttyS0,115200n8 earlyprintk";
> +	};
> +
> +
> +};
> diff --git a/arch/arm/boot/dts/kirkwood.dtsi b/arch/arm/boot/dts/kirkwood.dtsi
> new file mode 100644
> index 0000000..771c6bb
> --- /dev/null
> +++ b/arch/arm/boot/dts/kirkwood.dtsi
> @@ -0,0 +1,6 @@
> +/include/ "skeleton.dtsi"
> +
> +/ {
> +	compatible = "marvell,kirkwood";
> +};
> +
> diff --git a/arch/arm/mach-kirkwood/Kconfig b/arch/arm/mach-kirkwood/Kconfig
> index 7fc603b..6095884 100644
> --- a/arch/arm/mach-kirkwood/Kconfig
> +++ b/arch/arm/mach-kirkwood/Kconfig
> @@ -44,6 +44,20 @@ config MACH_GURUPLUG
>  	  Say 'Y' here if you want your kernel to support the
>  	  Marvell GuruPlug Reference Board.
>  
> +config ARCH_KIRKWOOD_DT
> +	bool "Marvell Kirkwood Flattened Device Tree"
> +	select USE_OF
> +	help
> +	  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)"
> +	depends on ARCH_KIRKWOOD_DT
> +	help
> +	  Say 'Y' here if you want your kernel to support the
> +	  Marvell DreamPlug (Flattened Device Tree).

Why do you need 2 entries?


> +
>  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 5dcaa81..acbc5e1 100644
> --- a/arch/arm/mach-kirkwood/Makefile
> +++ b/arch/arm/mach-kirkwood/Makefile
> @@ -20,3 +20,4 @@ obj-$(CONFIG_MACH_NET5BIG_V2)		+= netxbig_v2-setup.o lacie_v2-common.o
>  obj-$(CONFIG_MACH_T5325)		+= t5325-setup.o
>  
>  obj-$(CONFIG_CPU_IDLE)			+= cpuidle.o
> +obj-$(CONFIG_ARCH_KIRKWOOD_DT)		+= board-dt.o
> diff --git a/arch/arm/mach-kirkwood/Makefile.boot b/arch/arm/mach-kirkwood/Makefile.boot
> index 760a0ef..16f9385 100644
> --- a/arch/arm/mach-kirkwood/Makefile.boot
> +++ b/arch/arm/mach-kirkwood/Makefile.boot
> @@ -1,3 +1,5 @@
>     zreladdr-y	+= 0x00008000
>  params_phys-y	:= 0x00000100
>  initrd_phys-y	:= 0x00800000
> +
> +dtb-$(CONFIG_MACH_DREAMPLUG_DT) += kirkwood-dreamplug.dtb
> diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c
> new file mode 100644
> index 0000000..ab13eb9
> --- /dev/null
> +++ b/arch/arm/mach-kirkwood/board-dt.c
> @@ -0,0 +1,182 @@
> +/*
> + * Copyright 2012 (C), Jason Cooper <jason@lakedaemon.net>
> + *
> + * arch/arm/mach-kirkwood/board-dt.c
> + *
> + * Marvell DreamPlug Reference 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/platform_device.h>
> +#include <linux/mtd/partitions.h>
> +#include <linux/ata_platform.h>
> +#include <linux/mv643xx_eth.h>
> +#include <linux/of.h>
> +#include <linux/of_address.h>
> +#include <linux/of_fdt.h>
> +#include <linux/of_irq.h>
> +#include <linux/of_platform.h>
> +#include <linux/gpio.h>
> +#include <linux/leds.h>
> +#include <linux/mtd/physmap.h>
> +#include <linux/spi/flash.h>
> +#include <linux/spi/spi.h>
> +#include <linux/spi/orion_spi.h>
> +#include <asm/mach-types.h>
> +#include <asm/mach/arch.h>
> +#include <mach/kirkwood.h>
> +#include <plat/mvsdio.h>
> +#include "common.h"
> +#include "mpp.h"
> +
> +static struct of_device_id kirkwood_dt_match_table[] __initdata = {
> +	{ .compatible = "simple-bus", },
> +	{ }
> +};
> +
> +struct mtd_partition dreamplug_partitions[] = {
> +	{
> +		.name	= "u-boot",
> +		.size	= SZ_512K,
> +		.offset = 0,
> +	},
> +	{
> +		.name	= "u-boot env",
> +		.size	= SZ_64K,
> +		.offset = SZ_512K + SZ_512K,
> +	},
> +	{
> +		.name	= "dtb",
> +		.size	= SZ_64K,
> +		.offset = SZ_512K + SZ_512K + SZ_512K,
> +	},
> +};
> +
> +static const struct flash_platform_data dreamplug_spi_slave_data = {
> +	.type		= "mx25l1606e",
> +	.name		= "spi_flash",
> +	.parts		= dreamplug_partitions,
> +	.nr_parts	= ARRAY_SIZE(dreamplug_partitions),
> +};
> +
> +static struct spi_board_info __initdata dreamplug_spi_slave_info[] = {
> +	{
> +		.modalias	= "m25p80",
> +		.platform_data	= &dreamplug_spi_slave_data,
> +		.irq		= -1,
> +		.max_speed_hz	= 50000000,
> +		.bus_num	= 0,
> +		.chip_select	= 0,
> +	},
> +};
> +
> +static struct mv643xx_eth_platform_data dreamplug_ge00_data = {
> +	.phy_addr	= MV643XX_ETH_PHY_ADDR(0),
> +};
> +
> +static struct mv643xx_eth_platform_data dreamplug_ge01_data = {
> +	.phy_addr	= MV643XX_ETH_PHY_ADDR(1),
> +};
> +
> +static struct mv_sata_platform_data dreamplug_sata_data = {
> +	.n_ports	= 1,
> +};
> +
> +static struct mvsdio_platform_data dreamplug_mvsdio_data = {
> +	/* unfortunately the CD signal has not been connected */
> +};
> +
> +static struct gpio_led dreamplug_led_pins[] = {
> +	{
> +		.name			= "dreamplug:blue:bluetooth",
> +		.gpio			= 47,
> +		.active_low		= 1,
> +	},
> +	{
> +		.name			= "dreamplug:green:wifi",
> +		.gpio			= 48,
> +		.active_low		= 1,
> +	},
> +	{
> +		.name			= "dreamplug:green:wifi_ap",
> +		.gpio			= 49,
> +		.active_low		= 1,
> +	},
> +};
> +
> +static struct gpio_led_platform_data dreamplug_led_data = {
> +	.leds		= dreamplug_led_pins,
> +	.num_leds	= ARRAY_SIZE(dreamplug_led_pins),
> +};
> +
> +static struct platform_device dreamplug_leds = {
> +	.name	= "leds-gpio",
> +	.id	= -1,
> +	.dev	= {
> +		.platform_data	= &dreamplug_led_data,
> +	}
> +};
> +
> +static unsigned int dreamplug_mpp_config[] __initdata = {
> +	MPP0_SPI_SCn,
> +	MPP1_SPI_MOSI,
> +	MPP2_SPI_SCK,
> +	MPP3_SPI_MISO,
> +	MPP47_GPIO,	/* Bluetooth LED */
> +	MPP48_GPIO,	/* Wifi LED */
> +	MPP49_GPIO,	/* Wifi AP LED */
> +	0
> +};

Do you need this to boot? All this data should come from the dtb.


> +
> +static void __init dreamplug_init(void)
> +{
> +	/*
> +	 * Basic setup. Needs to be called early.
> +	 */
> +	kirkwood_mpp_conf(dreamplug_mpp_config);
> +
> +	kirkwood_uart0_init();
> +
> +	spi_register_board_info(dreamplug_spi_slave_info,
> +				ARRAY_SIZE(dreamplug_spi_slave_info));
> +	kirkwood_spi_init();
> +
> +	kirkwood_ehci_init();
> +	kirkwood_ge00_init(&dreamplug_ge00_data);
> +	kirkwood_ge01_init(&dreamplug_ge01_data);
> +	kirkwood_sata_init(&dreamplug_sata_data);
> +	kirkwood_sdio_init(&dreamplug_mvsdio_data);
> +
> +	platform_device_register(&dreamplug_leds);
> +}
> +
> +static void __init kirkwood_dt_init(void)
> +{
> +	kirkwood_init();
> +
> +	if (!of_machine_is_compatible("kirkwood,dreamplug"))

Huh? Your string doesn't match your dts file.

You've already matched against "marvell,dreamplug", so is this check
necessary?

Rob

> +		dreamplug_init();
> +
> +	of_platform_populate(NULL, kirkwood_dt_match_table, NULL, NULL);
> +}
> +
> +static const char *kirkwood_dt_board_compat[] = {
> +	"marvell,dreamplug",
> +	NULL
> +};
> +
> +DT_MACHINE_START(KIRKWOOD_DT, "Marvell Kirkwood (Flattened Device Tree)")
> +	/* Maintainer: Jason Cooper <jason@lakedaemon.net> */
> +	.map_io		= kirkwood_map_io,
> +	.init_early	= kirkwood_init_early,
> +	.init_irq	= kirkwood_init_irq,
> +	.timer		= &kirkwood_timer,
> +	.init_machine	= kirkwood_dt_init,
> +	.restart	= kirkwood_restart,
> +	.dt_compat	= kirkwood_dt_board_compat,
> +MACHINE_END

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

* Re: [PATCH 2/3 v4] arm: kirkwood: add dreamplug (fdt) support.
  2012-02-23  3:19       ` Rob Herring
@ 2012-02-23  7:34           ` Arnd Bergmann
  -1 siblings, 0 replies; 76+ messages in thread
From: Arnd Bergmann @ 2012-02-23  7:34 UTC (permalink / raw)
  To: Rob Herring
  Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ, Jason Cooper,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On Thursday 23 February 2012, Rob Herring wrote:
> On 02/22/2012 01:18 PM, Jason Cooper wrote:

> > diff --git a/arch/arm/mach-kirkwood/Kconfig b/arch/arm/mach-kirkwood/Kconfig
> > index 7fc603b..6095884 100644
> > --- a/arch/arm/mach-kirkwood/Kconfig
> > +++ b/arch/arm/mach-kirkwood/Kconfig
> > @@ -44,6 +44,20 @@ config MACH_GURUPLUG
> >  	  Say 'Y' here if you want your kernel to support the
> >  	  Marvell GuruPlug Reference Board.
> >  
> > +config ARCH_KIRKWOOD_DT
> > +	bool "Marvell Kirkwood Flattened Device Tree"
> > +	select USE_OF
> > +	help
> > +	  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)"
> > +	depends on ARCH_KIRKWOOD_DT
> > +	help
> > +	  Say 'Y' here if you want your kernel to support the
> > +	  Marvell DreamPlug (Flattened Device Tree).
> 
> Why do you need 2 entries?

The first one is used to build the board file for all DT based machines,
the second one is used to select the dts file. I would be enough to have just
the first one, but that makes it harder to find for people looking for
dreamplug.

Maybe change the text to "Generic Marvell Kirkwood DT based (e.g. DreamPlug)"?

> > +
> > +static unsigned int dreamplug_mpp_config[] __initdata = {
> > +	MPP0_SPI_SCn,
> > +	MPP1_SPI_MOSI,
> > +	MPP2_SPI_SCK,
> > +	MPP3_SPI_MISO,
> > +	MPP47_GPIO,	/* Bluetooth LED */
> > +	MPP48_GPIO,	/* Wifi LED */
> > +	MPP49_GPIO,	/* Wifi AP LED */
> > +	0
> > +};
> 
> Do you need this to boot? All this data should come from the dtb.

Putting this into the dtb would require converting kirkwood to use the
pinctrl subsystem first, if we want to have proper bindings. When I
did the hands-on review of the code with Jason during ELC, we decided
to leave this being done the legacy way for now, which also matches
how Tegra does it until we have the pinctrl bindings.

Also note how the patch description says "Driver porting will start
with the uart (see next patch), and progress from there.  Possibly,
spi/flash/partitions will be next." I think this is the best approach
indeed and I'd probably leave the pinctrl stuff until the end.

> > +
> > +static void __init kirkwood_dt_init(void)
> > +{
> > +	kirkwood_init();
> > +
> > +	if (!of_machine_is_compatible("kirkwood,dreamplug"))
> 
> Huh? Your string doesn't match your dts file.
> 
> You've already matched against "marvell,dreamplug", so is this check
> necessary?

It's wrong, and the condition is negated. It should be

	if (of_machine_is_compatible("marvell,dreamplug"))
		dreamplug_init();

The idea is that there is one init function for all dt based
kirkwood machines, which contains special setup functions for
those boards that don't (yet) describe all the hardware in the
dt.

> > +
> > +static const char *kirkwood_dt_board_compat[] = {
> > +	"marvell,dreamplug",
> > +	NULL
> > +};

Since you mention the name, it should probably be "globalscale,dreamplug"
because the device is made by GlobalScale instead of Marvell.

	Arnd

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

* [PATCH 2/3 v4] arm: kirkwood: add dreamplug (fdt) support.
@ 2012-02-23  7:34           ` Arnd Bergmann
  0 siblings, 0 replies; 76+ messages in thread
From: Arnd Bergmann @ 2012-02-23  7:34 UTC (permalink / raw)
  To: linux-arm-kernel

On Thursday 23 February 2012, Rob Herring wrote:
> On 02/22/2012 01:18 PM, Jason Cooper wrote:

> > diff --git a/arch/arm/mach-kirkwood/Kconfig b/arch/arm/mach-kirkwood/Kconfig
> > index 7fc603b..6095884 100644
> > --- a/arch/arm/mach-kirkwood/Kconfig
> > +++ b/arch/arm/mach-kirkwood/Kconfig
> > @@ -44,6 +44,20 @@ config MACH_GURUPLUG
> >  	  Say 'Y' here if you want your kernel to support the
> >  	  Marvell GuruPlug Reference Board.
> >  
> > +config ARCH_KIRKWOOD_DT
> > +	bool "Marvell Kirkwood Flattened Device Tree"
> > +	select USE_OF
> > +	help
> > +	  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)"
> > +	depends on ARCH_KIRKWOOD_DT
> > +	help
> > +	  Say 'Y' here if you want your kernel to support the
> > +	  Marvell DreamPlug (Flattened Device Tree).
> 
> Why do you need 2 entries?

The first one is used to build the board file for all DT based machines,
the second one is used to select the dts file. I would be enough to have just
the first one, but that makes it harder to find for people looking for
dreamplug.

Maybe change the text to "Generic Marvell Kirkwood DT based (e.g. DreamPlug)"?

> > +
> > +static unsigned int dreamplug_mpp_config[] __initdata = {
> > +	MPP0_SPI_SCn,
> > +	MPP1_SPI_MOSI,
> > +	MPP2_SPI_SCK,
> > +	MPP3_SPI_MISO,
> > +	MPP47_GPIO,	/* Bluetooth LED */
> > +	MPP48_GPIO,	/* Wifi LED */
> > +	MPP49_GPIO,	/* Wifi AP LED */
> > +	0
> > +};
> 
> Do you need this to boot? All this data should come from the dtb.

Putting this into the dtb would require converting kirkwood to use the
pinctrl subsystem first, if we want to have proper bindings. When I
did the hands-on review of the code with Jason during ELC, we decided
to leave this being done the legacy way for now, which also matches
how Tegra does it until we have the pinctrl bindings.

Also note how the patch description says "Driver porting will start
with the uart (see next patch), and progress from there.  Possibly,
spi/flash/partitions will be next." I think this is the best approach
indeed and I'd probably leave the pinctrl stuff until the end.

> > +
> > +static void __init kirkwood_dt_init(void)
> > +{
> > +	kirkwood_init();
> > +
> > +	if (!of_machine_is_compatible("kirkwood,dreamplug"))
> 
> Huh? Your string doesn't match your dts file.
> 
> You've already matched against "marvell,dreamplug", so is this check
> necessary?

It's wrong, and the condition is negated. It should be

	if (of_machine_is_compatible("marvell,dreamplug"))
		dreamplug_init();

The idea is that there is one init function for all dt based
kirkwood machines, which contains special setup functions for
those boards that don't (yet) describe all the hardware in the
dt.

> > +
> > +static const char *kirkwood_dt_board_compat[] = {
> > +	"marvell,dreamplug",
> > +	NULL
> > +};

Since you mention the name, it should probably be "globalscale,dreamplug"
because the device is made by GlobalScale instead of Marvell.

	Arnd

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

* Re: [PATCH 1/3] arm: ignore devicetree blobs.
  2012-02-22 22:26       ` Uwe Kleine-König
@ 2012-02-23  9:16           ` Dave Martin
  -1 siblings, 0 replies; 76+ messages in thread
From: Dave Martin @ 2012-02-23  9:16 UTC (permalink / raw)
  To: Uwe Kleine-K?nig
  Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ, Jason Cooper,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On Wed, Feb 22, 2012 at 11:26:19PM +0100, Uwe Kleine-K?nig wrote:
> On Wed, Feb 22, 2012 at 07:18:44PM +0000, Jason Cooper wrote:
> > 
> > Signed-off-by: Jason Cooper <jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org>
> /me claims prior art:
> 
> 	http://mid.gmane.org/1323808612-14976-1-git-send-email-u.kleine-koenig-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org

Multiple people proposed this...

Grant accepted my patch, and it is already in -next:

See next-20110222

810ae3d26507e61d1f7a69e9716443df1ce41449
ARM: devicetree: Add .dtb files to arch/arm/boot/.gitignore

Cheers
---Dave

> 
> Best regards
> Uwe
> 	
> > ---
> > NOTE: This is the first version of this patch, so no change history.
> > 
> >  arch/arm/boot/.gitignore |    1 +
> >  1 files changed, 1 insertions(+), 0 deletions(-)
> > 
> > diff --git a/arch/arm/boot/.gitignore b/arch/arm/boot/.gitignore
> > index ce1c5ff..3c79f85 100644
> > --- a/arch/arm/boot/.gitignore
> > +++ b/arch/arm/boot/.gitignore
> > @@ -3,3 +3,4 @@ zImage
> >  xipImage
> >  bootpImage
> >  uImage
> > +*.dtb
> > -- 
> > 1.7.3.4
> > 
> > 
> > _______________________________________________
> > linux-arm-kernel mailing list
> > linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
> > http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
> > 
> 
> -- 
> Pengutronix e.K.                           | Uwe Kleine-K?nig            |
> Industrial Linux Solutions                 | http://www.pengutronix.de/  |
> _______________________________________________
> devicetree-discuss mailing list
> devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org
> https://lists.ozlabs.org/listinfo/devicetree-discuss

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

* [PATCH 1/3] arm: ignore devicetree blobs.
@ 2012-02-23  9:16           ` Dave Martin
  0 siblings, 0 replies; 76+ messages in thread
From: Dave Martin @ 2012-02-23  9:16 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Feb 22, 2012 at 11:26:19PM +0100, Uwe Kleine-K?nig wrote:
> On Wed, Feb 22, 2012 at 07:18:44PM +0000, Jason Cooper wrote:
> > 
> > Signed-off-by: Jason Cooper <jason@lakedaemon.net>
> /me claims prior art:
> 
> 	http://mid.gmane.org/1323808612-14976-1-git-send-email-u.kleine-koenig at pengutronix.de

Multiple people proposed this...

Grant accepted my patch, and it is already in -next:

See next-20110222

810ae3d26507e61d1f7a69e9716443df1ce41449
ARM: devicetree: Add .dtb files to arch/arm/boot/.gitignore

Cheers
---Dave

> 
> Best regards
> Uwe
> 	
> > ---
> > NOTE: This is the first version of this patch, so no change history.
> > 
> >  arch/arm/boot/.gitignore |    1 +
> >  1 files changed, 1 insertions(+), 0 deletions(-)
> > 
> > diff --git a/arch/arm/boot/.gitignore b/arch/arm/boot/.gitignore
> > index ce1c5ff..3c79f85 100644
> > --- a/arch/arm/boot/.gitignore
> > +++ b/arch/arm/boot/.gitignore
> > @@ -3,3 +3,4 @@ zImage
> >  xipImage
> >  bootpImage
> >  uImage
> > +*.dtb
> > -- 
> > 1.7.3.4
> > 
> > 
> > _______________________________________________
> > linux-arm-kernel mailing list
> > linux-arm-kernel at lists.infradead.org
> > http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
> > 
> 
> -- 
> Pengutronix e.K.                           | Uwe Kleine-K?nig            |
> Industrial Linux Solutions                 | http://www.pengutronix.de/  |
> _______________________________________________
> devicetree-discuss mailing list
> devicetree-discuss at lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/devicetree-discuss

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

* Re: [PATCH 1/3] arm: ignore devicetree blobs.
  2012-02-23  9:16           ` Dave Martin
@ 2012-02-23 15:56             ` Jason
  -1 siblings, 0 replies; 76+ messages in thread
From: Jason @ 2012-02-23 15:56 UTC (permalink / raw)
  To: Dave Martin; +Cc: devicetree-discuss, linux-arm-kernel, Uwe Kleine-K?nig

Dave,

On Thu, Feb 23, 2012 at 09:16:30AM +0000, Dave Martin wrote:
> On Wed, Feb 22, 2012 at 11:26:19PM +0100, Uwe Kleine-K?nig wrote:
> > On Wed, Feb 22, 2012 at 07:18:44PM +0000, Jason Cooper wrote:
> > > 
> > > Signed-off-by: Jason Cooper <jason@lakedaemon.net>
> > /me claims prior art:
> > 
> > 	http://mid.gmane.org/1323808612-14976-1-git-send-email-u.kleine-koenig@pengutronix.de
> 
> Multiple people proposed this...
> 
> Grant accepted my patch, and it is already in -next:
> 
> See next-20110222
> 
> 810ae3d26507e61d1f7a69e9716443df1ce41449
> ARM: devicetree: Add .dtb files to arch/arm/boot/.gitignore

awesome, I'll drop this from the next version of the series, then.

thx,

Jason.

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

* [PATCH 1/3] arm: ignore devicetree blobs.
@ 2012-02-23 15:56             ` Jason
  0 siblings, 0 replies; 76+ messages in thread
From: Jason @ 2012-02-23 15:56 UTC (permalink / raw)
  To: linux-arm-kernel

Dave,

On Thu, Feb 23, 2012 at 09:16:30AM +0000, Dave Martin wrote:
> On Wed, Feb 22, 2012 at 11:26:19PM +0100, Uwe Kleine-K?nig wrote:
> > On Wed, Feb 22, 2012 at 07:18:44PM +0000, Jason Cooper wrote:
> > > 
> > > Signed-off-by: Jason Cooper <jason@lakedaemon.net>
> > /me claims prior art:
> > 
> > 	http://mid.gmane.org/1323808612-14976-1-git-send-email-u.kleine-koenig at pengutronix.de
> 
> Multiple people proposed this...
> 
> Grant accepted my patch, and it is already in -next:
> 
> See next-20110222
> 
> 810ae3d26507e61d1f7a69e9716443df1ce41449
> ARM: devicetree: Add .dtb files to arch/arm/boot/.gitignore

awesome, I'll drop this from the next version of the series, then.

thx,

Jason.

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

* Re: [PATCH 2/3 v4] arm: kirkwood: add dreamplug (fdt) support.
  2012-02-23  7:34           ` Arnd Bergmann
@ 2012-02-23 16:12             ` Jason
  -1 siblings, 0 replies; 76+ messages in thread
From: Jason @ 2012-02-23 16:12 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: grant.likely, devicetree-discuss, linux-arm-kernel

On Thu, Feb 23, 2012 at 07:34:33AM +0000, Arnd Bergmann wrote:
> On Thursday 23 February 2012, Rob Herring wrote:
> > On 02/22/2012 01:18 PM, Jason Cooper wrote:
> 
> > > diff --git a/arch/arm/mach-kirkwood/Kconfig b/arch/arm/mach-kirkwood/Kconfig
> > > index 7fc603b..6095884 100644
> > > --- a/arch/arm/mach-kirkwood/Kconfig
> > > +++ b/arch/arm/mach-kirkwood/Kconfig
> > > @@ -44,6 +44,20 @@ config MACH_GURUPLUG
> > >  	  Say 'Y' here if you want your kernel to support the
> > >  	  Marvell GuruPlug Reference Board.
> > >  
> > > +config ARCH_KIRKWOOD_DT
> > > +	bool "Marvell Kirkwood Flattened Device Tree"
> > > +	select USE_OF
> > > +	help
> > > +	  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)"
> > > +	depends on ARCH_KIRKWOOD_DT
> > > +	help
> > > +	  Say 'Y' here if you want your kernel to support the
> > > +	  Marvell DreamPlug (Flattened Device Tree).
> > 
> > Why do you need 2 entries?
> 
> The first one is used to build the board file for all DT based machines,
> the second one is used to select the dts file. I would be enough to have just
> the first one, but that makes it harder to find for people looking for
> dreamplug.
> 
> Maybe change the text to "Generic Marvell Kirkwood DT based (e.g. DreamPlug)"?

I was thinking about this more, and had, I hope, a better idea:  change
the 'depends on ARCH_KIRKWOOD_DT' to 'selects ARCH_KIRKWOOD_DT' and
remove the first entry.  This way, the logic remains the same and the
word 'Dreamplug' is always visible.  Any objections?

> > > +
> > > +static unsigned int dreamplug_mpp_config[] __initdata = {
> > > +	MPP0_SPI_SCn,
> > > +	MPP1_SPI_MOSI,
> > > +	MPP2_SPI_SCK,
> > > +	MPP3_SPI_MISO,
> > > +	MPP47_GPIO,	/* Bluetooth LED */
> > > +	MPP48_GPIO,	/* Wifi LED */
> > > +	MPP49_GPIO,	/* Wifi AP LED */
> > > +	0
> > > +};
> > 
> > Do you need this to boot? All this data should come from the dtb.
> 
> Putting this into the dtb would require converting kirkwood to use the
> pinctrl subsystem first, if we want to have proper bindings. When I
> did the hands-on review of the code with Jason during ELC, we decided
> to leave this being done the legacy way for now, which also matches
> how Tegra does it until we have the pinctrl bindings.
> 
> Also note how the patch description says "Driver porting will start
> with the uart (see next patch), and progress from there.  Possibly,
> spi/flash/partitions will be next." I think this is the best approach
> indeed and I'd probably leave the pinctrl stuff until the end.

Agreed.

> > > +
> > > +static void __init kirkwood_dt_init(void)
> > > +{
> > > +	kirkwood_init();
> > > +
> > > +	if (!of_machine_is_compatible("kirkwood,dreamplug"))
> > 
> > Huh? Your string doesn't match your dts file.
> > 
> > You've already matched against "marvell,dreamplug", so is this check
> > necessary?
> 
> It's wrong, and the condition is negated. It should be
> 
> 	if (of_machine_is_compatible("marvell,dreamplug"))
> 		dreamplug_init();
> 
> The idea is that there is one init function for all dt based
> kirkwood machines, which contains special setup functions for
> those boards that don't (yet) describe all the hardware in the
> dt.

Good catch, will fix in v5.

> > > +
> > > +static const char *kirkwood_dt_board_compat[] = {
> > > +	"marvell,dreamplug",
> > > +	NULL
> > > +};
> 
> Since you mention the name, it should probably be "globalscale,dreamplug"
> because the device is made by GlobalScale instead of Marvell.

hmm, Globalscale Tech is, as I understand it, a turn-key manufacturer.
They are simply building Marvell's development platforms for them,
handling sales, etc.  My impression was that Marvell designed the board
and contracted Globalscale to build and distribute it.

I don't care which we use, but is the convention to use the SoC designer
(marvell,dreamplug), the SoC (kirkwood,dreamplug), or the brand
(globalscale,dreamplug)?

If there is no set standard, I think the SoC is most accurate, as
nothing prevents a manufacturer from swapping out ICs/SoCs between
manufacturing runs of the same make/model.  Look at certain wifi USB
devices for examples.

thx,

Jason.

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

* [PATCH 2/3 v4] arm: kirkwood: add dreamplug (fdt) support.
@ 2012-02-23 16:12             ` Jason
  0 siblings, 0 replies; 76+ messages in thread
From: Jason @ 2012-02-23 16:12 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Feb 23, 2012 at 07:34:33AM +0000, Arnd Bergmann wrote:
> On Thursday 23 February 2012, Rob Herring wrote:
> > On 02/22/2012 01:18 PM, Jason Cooper wrote:
> 
> > > diff --git a/arch/arm/mach-kirkwood/Kconfig b/arch/arm/mach-kirkwood/Kconfig
> > > index 7fc603b..6095884 100644
> > > --- a/arch/arm/mach-kirkwood/Kconfig
> > > +++ b/arch/arm/mach-kirkwood/Kconfig
> > > @@ -44,6 +44,20 @@ config MACH_GURUPLUG
> > >  	  Say 'Y' here if you want your kernel to support the
> > >  	  Marvell GuruPlug Reference Board.
> > >  
> > > +config ARCH_KIRKWOOD_DT
> > > +	bool "Marvell Kirkwood Flattened Device Tree"
> > > +	select USE_OF
> > > +	help
> > > +	  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)"
> > > +	depends on ARCH_KIRKWOOD_DT
> > > +	help
> > > +	  Say 'Y' here if you want your kernel to support the
> > > +	  Marvell DreamPlug (Flattened Device Tree).
> > 
> > Why do you need 2 entries?
> 
> The first one is used to build the board file for all DT based machines,
> the second one is used to select the dts file. I would be enough to have just
> the first one, but that makes it harder to find for people looking for
> dreamplug.
> 
> Maybe change the text to "Generic Marvell Kirkwood DT based (e.g. DreamPlug)"?

I was thinking about this more, and had, I hope, a better idea:  change
the 'depends on ARCH_KIRKWOOD_DT' to 'selects ARCH_KIRKWOOD_DT' and
remove the first entry.  This way, the logic remains the same and the
word 'Dreamplug' is always visible.  Any objections?

> > > +
> > > +static unsigned int dreamplug_mpp_config[] __initdata = {
> > > +	MPP0_SPI_SCn,
> > > +	MPP1_SPI_MOSI,
> > > +	MPP2_SPI_SCK,
> > > +	MPP3_SPI_MISO,
> > > +	MPP47_GPIO,	/* Bluetooth LED */
> > > +	MPP48_GPIO,	/* Wifi LED */
> > > +	MPP49_GPIO,	/* Wifi AP LED */
> > > +	0
> > > +};
> > 
> > Do you need this to boot? All this data should come from the dtb.
> 
> Putting this into the dtb would require converting kirkwood to use the
> pinctrl subsystem first, if we want to have proper bindings. When I
> did the hands-on review of the code with Jason during ELC, we decided
> to leave this being done the legacy way for now, which also matches
> how Tegra does it until we have the pinctrl bindings.
> 
> Also note how the patch description says "Driver porting will start
> with the uart (see next patch), and progress from there.  Possibly,
> spi/flash/partitions will be next." I think this is the best approach
> indeed and I'd probably leave the pinctrl stuff until the end.

Agreed.

> > > +
> > > +static void __init kirkwood_dt_init(void)
> > > +{
> > > +	kirkwood_init();
> > > +
> > > +	if (!of_machine_is_compatible("kirkwood,dreamplug"))
> > 
> > Huh? Your string doesn't match your dts file.
> > 
> > You've already matched against "marvell,dreamplug", so is this check
> > necessary?
> 
> It's wrong, and the condition is negated. It should be
> 
> 	if (of_machine_is_compatible("marvell,dreamplug"))
> 		dreamplug_init();
> 
> The idea is that there is one init function for all dt based
> kirkwood machines, which contains special setup functions for
> those boards that don't (yet) describe all the hardware in the
> dt.

Good catch, will fix in v5.

> > > +
> > > +static const char *kirkwood_dt_board_compat[] = {
> > > +	"marvell,dreamplug",
> > > +	NULL
> > > +};
> 
> Since you mention the name, it should probably be "globalscale,dreamplug"
> because the device is made by GlobalScale instead of Marvell.

hmm, Globalscale Tech is, as I understand it, a turn-key manufacturer.
They are simply building Marvell's development platforms for them,
handling sales, etc.  My impression was that Marvell designed the board
and contracted Globalscale to build and distribute it.

I don't care which we use, but is the convention to use the SoC designer
(marvell,dreamplug), the SoC (kirkwood,dreamplug), or the brand
(globalscale,dreamplug)?

If there is no set standard, I think the SoC is most accurate, as
nothing prevents a manufacturer from swapping out ICs/SoCs between
manufacturing runs of the same make/model.  Look at certain wifi USB
devices for examples.

thx,

Jason.

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

* Re: [PATCH 2/3 v4] arm: kirkwood: add dreamplug (fdt) support.
  2012-02-23 16:12             ` Jason
@ 2012-02-23 18:56                 ` Grant Likely
  -1 siblings, 0 replies; 76+ messages in thread
From: Grant Likely @ 2012-02-23 18:56 UTC (permalink / raw)
  To: Jason
  Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On Thu, Feb 23, 2012 at 9:12 AM, Jason <jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org> wrote:
> On Thu, Feb 23, 2012 at 07:34:33AM +0000, Arnd Bergmann wrote:
>> On Thursday 23 February 2012, Rob Herring wrote:
>> > On 02/22/2012 01:18 PM, Jason Cooper wrote:
>>
>> > > diff --git a/arch/arm/mach-kirkwood/Kconfig b/arch/arm/mach-kirkwood/Kconfig
>> > > index 7fc603b..6095884 100644
>> > > --- a/arch/arm/mach-kirkwood/Kconfig
>> > > +++ b/arch/arm/mach-kirkwood/Kconfig
>> > > @@ -44,6 +44,20 @@ config MACH_GURUPLUG
>> > >     Say 'Y' here if you want your kernel to support the
>> > >     Marvell GuruPlug Reference Board.
>> > >
>> > > +config ARCH_KIRKWOOD_DT
>> > > + bool "Marvell Kirkwood Flattened Device Tree"
>> > > + select USE_OF
>> > > + help
>> > > +   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)"
>> > > + depends on ARCH_KIRKWOOD_DT
>> > > + help
>> > > +   Say 'Y' here if you want your kernel to support the
>> > > +   Marvell DreamPlug (Flattened Device Tree).
>> >
>> > Why do you need 2 entries?
>>
>> The first one is used to build the board file for all DT based machines,
>> the second one is used to select the dts file. I would be enough to have just
>> the first one, but that makes it harder to find for people looking for
>> dreamplug.
>>
>> Maybe change the text to "Generic Marvell Kirkwood DT based (e.g. DreamPlug)"?
>
> I was thinking about this more, and had, I hope, a better idea:  change
> the 'depends on ARCH_KIRKWOOD_DT' to 'selects ARCH_KIRKWOOD_DT' and
> remove the first entry.  This way, the logic remains the same and the
> word 'Dreamplug' is always visible.  Any objections?
>
>> > > +
>> > > +static unsigned int dreamplug_mpp_config[] __initdata = {
>> > > + MPP0_SPI_SCn,
>> > > + MPP1_SPI_MOSI,
>> > > + MPP2_SPI_SCK,
>> > > + MPP3_SPI_MISO,
>> > > + MPP47_GPIO,     /* Bluetooth LED */
>> > > + MPP48_GPIO,     /* Wifi LED */
>> > > + MPP49_GPIO,     /* Wifi AP LED */
>> > > + 0
>> > > +};
>> >
>> > Do you need this to boot? All this data should come from the dtb.
>>
>> Putting this into the dtb would require converting kirkwood to use the
>> pinctrl subsystem first, if we want to have proper bindings. When I
>> did the hands-on review of the code with Jason during ELC, we decided
>> to leave this being done the legacy way for now, which also matches
>> how Tegra does it until we have the pinctrl bindings.
>>
>> Also note how the patch description says "Driver porting will start
>> with the uart (see next patch), and progress from there.  Possibly,
>> spi/flash/partitions will be next." I think this is the best approach
>> indeed and I'd probably leave the pinctrl stuff until the end.
>
> Agreed.
>
>> > > +
>> > > +static void __init kirkwood_dt_init(void)
>> > > +{
>> > > + kirkwood_init();
>> > > +
>> > > + if (!of_machine_is_compatible("kirkwood,dreamplug"))
>> >
>> > Huh? Your string doesn't match your dts file.
>> >
>> > You've already matched against "marvell,dreamplug", so is this check
>> > necessary?
>>
>> It's wrong, and the condition is negated. It should be
>>
>>       if (of_machine_is_compatible("marvell,dreamplug"))
>>               dreamplug_init();
>>
>> The idea is that there is one init function for all dt based
>> kirkwood machines, which contains special setup functions for
>> those boards that don't (yet) describe all the hardware in the
>> dt.
>
> Good catch, will fix in v5.
>
>> > > +
>> > > +static const char *kirkwood_dt_board_compat[] = {
>> > > + "marvell,dreamplug",
>> > > + NULL
>> > > +};
>>
>> Since you mention the name, it should probably be "globalscale,dreamplug"
>> because the device is made by GlobalScale instead of Marvell.
>
> hmm, Globalscale Tech is, as I understand it, a turn-key manufacturer.
> They are simply building Marvell's development platforms for them,
> handling sales, etc.  My impression was that Marvell designed the board
> and contracted Globalscale to build and distribute it.
>
> I don't care which we use, but is the convention to use the SoC designer
> (marvell,dreamplug), the SoC (kirkwood,dreamplug), or the brand
> (globalscale,dreamplug)?
>
> If there is no set standard, I think the SoC is most accurate, as
> nothing prevents a manufacturer from swapping out ICs/SoCs between
> manufacturing runs of the same make/model.  Look at certain wifi USB
> devices for examples.

convention is to use the vendor of the device.  If it is marketed as a
Marvell product, then use "marvell,...".  If it is Globalscale, then
"globalscale,...".  The actual SoC on the device is irrelevant for the
top level compatible property name.

g.

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

* [PATCH 2/3 v4] arm: kirkwood: add dreamplug (fdt) support.
@ 2012-02-23 18:56                 ` Grant Likely
  0 siblings, 0 replies; 76+ messages in thread
From: Grant Likely @ 2012-02-23 18:56 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Feb 23, 2012 at 9:12 AM, Jason <jason@lakedaemon.net> wrote:
> On Thu, Feb 23, 2012 at 07:34:33AM +0000, Arnd Bergmann wrote:
>> On Thursday 23 February 2012, Rob Herring wrote:
>> > On 02/22/2012 01:18 PM, Jason Cooper wrote:
>>
>> > > diff --git a/arch/arm/mach-kirkwood/Kconfig b/arch/arm/mach-kirkwood/Kconfig
>> > > index 7fc603b..6095884 100644
>> > > --- a/arch/arm/mach-kirkwood/Kconfig
>> > > +++ b/arch/arm/mach-kirkwood/Kconfig
>> > > @@ -44,6 +44,20 @@ config MACH_GURUPLUG
>> > > ? ? Say 'Y' here if you want your kernel to support the
>> > > ? ? Marvell GuruPlug Reference Board.
>> > >
>> > > +config ARCH_KIRKWOOD_DT
>> > > + bool "Marvell Kirkwood Flattened Device Tree"
>> > > + select USE_OF
>> > > + help
>> > > + ? 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)"
>> > > + depends on ARCH_KIRKWOOD_DT
>> > > + help
>> > > + ? Say 'Y' here if you want your kernel to support the
>> > > + ? Marvell DreamPlug (Flattened Device Tree).
>> >
>> > Why do you need 2 entries?
>>
>> The first one is used to build the board file for all DT based machines,
>> the second one is used to select the dts file. I would be enough to have just
>> the first one, but that makes it harder to find for people looking for
>> dreamplug.
>>
>> Maybe change the text to "Generic Marvell Kirkwood DT based (e.g. DreamPlug)"?
>
> I was thinking about this more, and had, I hope, a better idea: ?change
> the 'depends on ARCH_KIRKWOOD_DT' to 'selects ARCH_KIRKWOOD_DT' and
> remove the first entry. ?This way, the logic remains the same and the
> word 'Dreamplug' is always visible. ?Any objections?
>
>> > > +
>> > > +static unsigned int dreamplug_mpp_config[] __initdata = {
>> > > + MPP0_SPI_SCn,
>> > > + MPP1_SPI_MOSI,
>> > > + MPP2_SPI_SCK,
>> > > + MPP3_SPI_MISO,
>> > > + MPP47_GPIO, ? ? /* Bluetooth LED */
>> > > + MPP48_GPIO, ? ? /* Wifi LED */
>> > > + MPP49_GPIO, ? ? /* Wifi AP LED */
>> > > + 0
>> > > +};
>> >
>> > Do you need this to boot? All this data should come from the dtb.
>>
>> Putting this into the dtb would require converting kirkwood to use the
>> pinctrl subsystem first, if we want to have proper bindings. When I
>> did the hands-on review of the code with Jason during ELC, we decided
>> to leave this being done the legacy way for now, which also matches
>> how Tegra does it until we have the pinctrl bindings.
>>
>> Also note how the patch description says "Driver porting will start
>> with the uart (see next patch), and progress from there. ?Possibly,
>> spi/flash/partitions will be next." I think this is the best approach
>> indeed and I'd probably leave the pinctrl stuff until the end.
>
> Agreed.
>
>> > > +
>> > > +static void __init kirkwood_dt_init(void)
>> > > +{
>> > > + kirkwood_init();
>> > > +
>> > > + if (!of_machine_is_compatible("kirkwood,dreamplug"))
>> >
>> > Huh? Your string doesn't match your dts file.
>> >
>> > You've already matched against "marvell,dreamplug", so is this check
>> > necessary?
>>
>> It's wrong, and the condition is negated. It should be
>>
>> ? ? ? if (of_machine_is_compatible("marvell,dreamplug"))
>> ? ? ? ? ? ? ? dreamplug_init();
>>
>> The idea is that there is one init function for all dt based
>> kirkwood machines, which contains special setup functions for
>> those boards that don't (yet) describe all the hardware in the
>> dt.
>
> Good catch, will fix in v5.
>
>> > > +
>> > > +static const char *kirkwood_dt_board_compat[] = {
>> > > + "marvell,dreamplug",
>> > > + NULL
>> > > +};
>>
>> Since you mention the name, it should probably be "globalscale,dreamplug"
>> because the device is made by GlobalScale instead of Marvell.
>
> hmm, Globalscale Tech is, as I understand it, a turn-key manufacturer.
> They are simply building Marvell's development platforms for them,
> handling sales, etc. ?My impression was that Marvell designed the board
> and contracted Globalscale to build and distribute it.
>
> I don't care which we use, but is the convention to use the SoC designer
> (marvell,dreamplug), the SoC (kirkwood,dreamplug), or the brand
> (globalscale,dreamplug)?
>
> If there is no set standard, I think the SoC is most accurate, as
> nothing prevents a manufacturer from swapping out ICs/SoCs between
> manufacturing runs of the same make/model. ?Look at certain wifi USB
> devices for examples.

convention is to use the vendor of the device.  If it is marketed as a
Marvell product, then use "marvell,...".  If it is Globalscale, then
"globalscale,...".  The actual SoC on the device is irrelevant for the
top level compatible property name.

g.

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

* Re: [PATCH 2/3 v4] arm: kirkwood: add dreamplug (fdt) support.
  2012-02-23 18:56                 ` Grant Likely
@ 2012-02-23 19:00                   ` Jason
  -1 siblings, 0 replies; 76+ messages in thread
From: Jason @ 2012-02-23 19:00 UTC (permalink / raw)
  To: Grant Likely; +Cc: devicetree-discuss, linux-arm-kernel, Arnd Bergmann

On Thu, Feb 23, 2012 at 11:56:46AM -0700, Grant Likely wrote:
> On Thu, Feb 23, 2012 at 9:12 AM, Jason <jason@lakedaemon.net> wrote:
> > On Thu, Feb 23, 2012 at 07:34:33AM +0000, Arnd Bergmann wrote:
> >> On Thursday 23 February 2012, Rob Herring wrote:
> >> > On 02/22/2012 01:18 PM, Jason Cooper wrote:
...
> >> > > +
> >> > > +static const char *kirkwood_dt_board_compat[] = {
> >> > > + "marvell,dreamplug",
> >> > > + NULL
> >> > > +};
> >>
> >> Since you mention the name, it should probably be "globalscale,dreamplug"
> >> because the device is made by GlobalScale instead of Marvell.
> >
> > hmm, Globalscale Tech is, as I understand it, a turn-key manufacturer.
> > They are simply building Marvell's development platforms for them,
> > handling sales, etc.  My impression was that Marvell designed the board
> > and contracted Globalscale to build and distribute it.
> >
> > I don't care which we use, but is the convention to use the SoC designer
> > (marvell,dreamplug), the SoC (kirkwood,dreamplug), or the brand
> > (globalscale,dreamplug)?
> >
> > If there is no set standard, I think the SoC is most accurate, as
> > nothing prevents a manufacturer from swapping out ICs/SoCs between
> > manufacturing runs of the same make/model.  Look at certain wifi USB
> > devices for examples.
> 
> convention is to use the vendor of the device.  If it is marketed as a
> Marvell product, then use "marvell,...".  If it is Globalscale, then
> "globalscale,...".  The actual SoC on the device is irrelevant for the
> top level compatible property name.

globalscale it is, then.  Thanks for the clarification.

thx,

Jason.

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

* [PATCH 2/3 v4] arm: kirkwood: add dreamplug (fdt) support.
@ 2012-02-23 19:00                   ` Jason
  0 siblings, 0 replies; 76+ messages in thread
From: Jason @ 2012-02-23 19:00 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Feb 23, 2012 at 11:56:46AM -0700, Grant Likely wrote:
> On Thu, Feb 23, 2012 at 9:12 AM, Jason <jason@lakedaemon.net> wrote:
> > On Thu, Feb 23, 2012 at 07:34:33AM +0000, Arnd Bergmann wrote:
> >> On Thursday 23 February 2012, Rob Herring wrote:
> >> > On 02/22/2012 01:18 PM, Jason Cooper wrote:
...
> >> > > +
> >> > > +static const char *kirkwood_dt_board_compat[] = {
> >> > > + "marvell,dreamplug",
> >> > > + NULL
> >> > > +};
> >>
> >> Since you mention the name, it should probably be "globalscale,dreamplug"
> >> because the device is made by GlobalScale instead of Marvell.
> >
> > hmm, Globalscale Tech is, as I understand it, a turn-key manufacturer.
> > They are simply building Marvell's development platforms for them,
> > handling sales, etc. ?My impression was that Marvell designed the board
> > and contracted Globalscale to build and distribute it.
> >
> > I don't care which we use, but is the convention to use the SoC designer
> > (marvell,dreamplug), the SoC (kirkwood,dreamplug), or the brand
> > (globalscale,dreamplug)?
> >
> > If there is no set standard, I think the SoC is most accurate, as
> > nothing prevents a manufacturer from swapping out ICs/SoCs between
> > manufacturing runs of the same make/model. ?Look at certain wifi USB
> > devices for examples.
> 
> convention is to use the vendor of the device.  If it is marketed as a
> Marvell product, then use "marvell,...".  If it is Globalscale, then
> "globalscale,...".  The actual SoC on the device is irrelevant for the
> top level compatible property name.

globalscale it is, then.  Thanks for the clarification.

thx,

Jason.

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

* [PATCH 0/2 v5] arm: kirkwood: add dreamplug/devicetree support
  2011-08-09 16:47 [PATCH 0/3 v2] RFC: marvell dreamplug dft support Jason Cooper
@ 2012-02-23 19:52   ` Jason Cooper
  2011-08-09 16:47 ` [PATCH 2/3 v2] RFC: arm/kirkwood: add dreamplug support Jason Cooper
                     ` (11 subsequent siblings)
  12 siblings, 0 replies; 76+ messages in thread
From: Jason Cooper @ 2012-02-23 19:52 UTC (permalink / raw)
  To: arnd, grant.likely; +Cc: devicetree-discuss, Jason Cooper, linux-arm-kernel

This patch series provides initial support for devicetree on kirkwood for the
dreamplug platform.  After discussing the approach with Arnd Bergman last week
at ELC, we decided to take an incremental approach to the conversion.  First, I
would detect that we were on the dreamplug via the devicetree blob.  Then,
configure uart0 via devicetree.  We chose the uart since it is already well
supported under devicetree.

This patch series has been boot-tested on the dreamplug.

In a future patch series, I plan to migrate spi/flash/partitions over to
devicetree.

When the migration is complete, board-dt.c will not be specific to the
dreamplug, and dts files can be written for all of the other kirkwood boards.

Jason Cooper (2):
  arm: kirkwood: add dreamplug (fdt) support.
  arm: kirkwood: convert uart0 to devicetree.

 arch/arm/boot/dts/kirkwood-dreamplug.dts |   25 ++++
 arch/arm/boot/dts/kirkwood.dtsi          |    6 +
 arch/arm/mach-kirkwood/Kconfig           |   14 +++
 arch/arm/mach-kirkwood/Makefile          |    1 +
 arch/arm/mach-kirkwood/Makefile.boot     |    2 +
 arch/arm/mach-kirkwood/board-dt.c        |  180 ++++++++++++++++++++++++++++++
 6 files changed, 228 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/boot/dts/kirkwood-dreamplug.dts
 create mode 100644 arch/arm/boot/dts/kirkwood.dtsi
 create mode 100644 arch/arm/mach-kirkwood/board-dt.c

-- 
1.7.3.4

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

* [PATCH 0/2 v5] arm: kirkwood: add dreamplug/devicetree support
@ 2012-02-23 19:52   ` Jason Cooper
  0 siblings, 0 replies; 76+ messages in thread
From: Jason Cooper @ 2012-02-23 19:52 UTC (permalink / raw)
  To: linux-arm-kernel

This patch series provides initial support for devicetree on kirkwood for the
dreamplug platform.  After discussing the approach with Arnd Bergman last week
at ELC, we decided to take an incremental approach to the conversion.  First, I
would detect that we were on the dreamplug via the devicetree blob.  Then,
configure uart0 via devicetree.  We chose the uart since it is already well
supported under devicetree.

This patch series has been boot-tested on the dreamplug.

In a future patch series, I plan to migrate spi/flash/partitions over to
devicetree.

When the migration is complete, board-dt.c will not be specific to the
dreamplug, and dts files can be written for all of the other kirkwood boards.

Jason Cooper (2):
  arm: kirkwood: add dreamplug (fdt) support.
  arm: kirkwood: convert uart0 to devicetree.

 arch/arm/boot/dts/kirkwood-dreamplug.dts |   25 ++++
 arch/arm/boot/dts/kirkwood.dtsi          |    6 +
 arch/arm/mach-kirkwood/Kconfig           |   14 +++
 arch/arm/mach-kirkwood/Makefile          |    1 +
 arch/arm/mach-kirkwood/Makefile.boot     |    2 +
 arch/arm/mach-kirkwood/board-dt.c        |  180 ++++++++++++++++++++++++++++++
 6 files changed, 228 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/boot/dts/kirkwood-dreamplug.dts
 create mode 100644 arch/arm/boot/dts/kirkwood.dtsi
 create mode 100644 arch/arm/mach-kirkwood/board-dt.c

-- 
1.7.3.4

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

* [PATCH 1/2 v5] arm: kirkwood: add dreamplug (fdt) support.
  2012-02-23 19:52   ` Jason Cooper
@ 2012-02-23 19:52   ` Jason Cooper
  -1 siblings, 0 replies; 76+ messages in thread
From: Jason Cooper @ 2012-02-23 19:52 UTC (permalink / raw)
  To: arnd, grant.likely; +Cc: devicetree-discuss, Jason Cooper, linux-arm-kernel

Initially, copied guruplug-setup.c and did s/guruplug/dreamplug/g.
Then, switched to SPI based NOR flash.

After talking to Arnd Bergman, chose an incremental approach to adding
devicetree support.  First, we use the dtb to tell us we are on the
dreamplug, then we gradually port over drivers.

Driver porting will start with the uart (see next patch), and progress
from there.  Possibly, spi/flash/partitions will be next.

When done, board-dt.c will no longer be dreamplug specific, and dt's can
be made for the other kirkwood boards.

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

   - attempting dts, looking for pointers.

Changes from v2

   - resubmit as MACH_TYPE_DREAMPLUG (3550) is in arm/for-next, rebased
     against same.
   - removed lame fdt attempt, others are working on kirkwood fdt.  Will
     convert once kirkwood fdt is mainline.
   - s/boot_params/atag_offset/
   - added kirkwood_reset
   - 1 checkpatch.pl warning (help in Kconfig), looks the same as all
     other kirkwood boards...

Changes from v3

   - rebased against v3.3-rc3 (recommended by Arnd)
   - use devicetree to determine which board we are on
   - added patch to configure uart0 from devicetree

Changes from v4

   - fixed Kconfig logic so user can always see 'Dreamplug' in menuconfig.
   - changed 'marvell,dreamplug' to 'globalscale,dreamplug' as suggested by
     Grant Likely.
   - fixed of_machine_is_compatible() logic for calling dreamplug specific
     init functions.

 arch/arm/boot/dts/kirkwood-dreamplug.dts |   18 +++
 arch/arm/boot/dts/kirkwood.dtsi          |    6 +
 arch/arm/mach-kirkwood/Kconfig           |   14 +++
 arch/arm/mach-kirkwood/Makefile          |    1 +
 arch/arm/mach-kirkwood/Makefile.boot     |    2 +
 arch/arm/mach-kirkwood/board-dt.c        |  182 ++++++++++++++++++++++++++++++
 6 files changed, 223 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/boot/dts/kirkwood-dreamplug.dts
 create mode 100644 arch/arm/boot/dts/kirkwood.dtsi
 create mode 100644 arch/arm/mach-kirkwood/board-dt.c

diff --git a/arch/arm/boot/dts/kirkwood-dreamplug.dts b/arch/arm/boot/dts/kirkwood-dreamplug.dts
new file mode 100644
index 0000000..765813f
--- /dev/null
+++ b/arch/arm/boot/dts/kirkwood-dreamplug.dts
@@ -0,0 +1,18 @@
+/dts-v1/;
+
+/include/ "kirkwood.dtsi"
+
+/ {
+	model = "Globalscale Technologies Dreamplug";
+	compatible = "globalscale,dreamplug", "globalscale,kirkwood";
+
+	memory {
+		device_type = "memory";
+		reg = <0x00000000 0x20000000>;
+	};
+
+	chosen {
+		bootargs = "console=ttyS0,115200n8 earlyprintk";
+	};
+
+};
diff --git a/arch/arm/boot/dts/kirkwood.dtsi b/arch/arm/boot/dts/kirkwood.dtsi
new file mode 100644
index 0000000..18fd47e
--- /dev/null
+++ b/arch/arm/boot/dts/kirkwood.dtsi
@@ -0,0 +1,6 @@
+/include/ "skeleton.dtsi"
+
+/ {
+	compatible = "globalscale,kirkwood";
+};
+
diff --git a/arch/arm/mach-kirkwood/Kconfig b/arch/arm/mach-kirkwood/Kconfig
index 7fc603b..90ceab7 100644
--- a/arch/arm/mach-kirkwood/Kconfig
+++ b/arch/arm/mach-kirkwood/Kconfig
@@ -44,6 +44,20 @@ config MACH_GURUPLUG
 	  Say 'Y' here if you want your kernel to support the
 	  Marvell GuruPlug Reference Board.
 
+config ARCH_KIRKWOOD_DT
+	bool "Marvell Kirkwood Flattened Device Tree"
+	select USE_OF
+	help
+	  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_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 5dcaa81..acbc5e1 100644
--- a/arch/arm/mach-kirkwood/Makefile
+++ b/arch/arm/mach-kirkwood/Makefile
@@ -20,3 +20,4 @@ obj-$(CONFIG_MACH_NET5BIG_V2)		+= netxbig_v2-setup.o lacie_v2-common.o
 obj-$(CONFIG_MACH_T5325)		+= t5325-setup.o
 
 obj-$(CONFIG_CPU_IDLE)			+= cpuidle.o
+obj-$(CONFIG_ARCH_KIRKWOOD_DT)		+= board-dt.o
diff --git a/arch/arm/mach-kirkwood/Makefile.boot b/arch/arm/mach-kirkwood/Makefile.boot
index 760a0ef..16f9385 100644
--- a/arch/arm/mach-kirkwood/Makefile.boot
+++ b/arch/arm/mach-kirkwood/Makefile.boot
@@ -1,3 +1,5 @@
    zreladdr-y	+= 0x00008000
 params_phys-y	:= 0x00000100
 initrd_phys-y	:= 0x00800000
+
+dtb-$(CONFIG_MACH_DREAMPLUG_DT) += kirkwood-dreamplug.dtb
diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c
new file mode 100644
index 0000000..76392af
--- /dev/null
+++ b/arch/arm/mach-kirkwood/board-dt.c
@@ -0,0 +1,182 @@
+/*
+ * Copyright 2012 (C), Jason Cooper <jason@lakedaemon.net>
+ *
+ * arch/arm/mach-kirkwood/board-dt.c
+ *
+ * Marvell DreamPlug Reference 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/platform_device.h>
+#include <linux/mtd/partitions.h>
+#include <linux/ata_platform.h>
+#include <linux/mv643xx_eth.h>
+#include <linux/of.h>
+#include <linux/of_address.h>
+#include <linux/of_fdt.h>
+#include <linux/of_irq.h>
+#include <linux/of_platform.h>
+#include <linux/gpio.h>
+#include <linux/leds.h>
+#include <linux/mtd/physmap.h>
+#include <linux/spi/flash.h>
+#include <linux/spi/spi.h>
+#include <linux/spi/orion_spi.h>
+#include <asm/mach-types.h>
+#include <asm/mach/arch.h>
+#include <mach/kirkwood.h>
+#include <plat/mvsdio.h>
+#include "common.h"
+#include "mpp.h"
+
+static struct of_device_id kirkwood_dt_match_table[] __initdata = {
+	{ .compatible = "simple-bus", },
+	{ }
+};
+
+struct mtd_partition dreamplug_partitions[] = {
+	{
+		.name	= "u-boot",
+		.size	= SZ_512K,
+		.offset = 0,
+	},
+	{
+		.name	= "u-boot env",
+		.size	= SZ_64K,
+		.offset = SZ_512K + SZ_512K,
+	},
+	{
+		.name	= "dtb",
+		.size	= SZ_64K,
+		.offset = SZ_512K + SZ_512K + SZ_512K,
+	},
+};
+
+static const struct flash_platform_data dreamplug_spi_slave_data = {
+	.type		= "mx25l1606e",
+	.name		= "spi_flash",
+	.parts		= dreamplug_partitions,
+	.nr_parts	= ARRAY_SIZE(dreamplug_partitions),
+};
+
+static struct spi_board_info __initdata dreamplug_spi_slave_info[] = {
+	{
+		.modalias	= "m25p80",
+		.platform_data	= &dreamplug_spi_slave_data,
+		.irq		= -1,
+		.max_speed_hz	= 50000000,
+		.bus_num	= 0,
+		.chip_select	= 0,
+	},
+};
+
+static struct mv643xx_eth_platform_data dreamplug_ge00_data = {
+	.phy_addr	= MV643XX_ETH_PHY_ADDR(0),
+};
+
+static struct mv643xx_eth_platform_data dreamplug_ge01_data = {
+	.phy_addr	= MV643XX_ETH_PHY_ADDR(1),
+};
+
+static struct mv_sata_platform_data dreamplug_sata_data = {
+	.n_ports	= 1,
+};
+
+static struct mvsdio_platform_data dreamplug_mvsdio_data = {
+	/* unfortunately the CD signal has not been connected */
+};
+
+static struct gpio_led dreamplug_led_pins[] = {
+	{
+		.name			= "dreamplug:blue:bluetooth",
+		.gpio			= 47,
+		.active_low		= 1,
+	},
+	{
+		.name			= "dreamplug:green:wifi",
+		.gpio			= 48,
+		.active_low		= 1,
+	},
+	{
+		.name			= "dreamplug:green:wifi_ap",
+		.gpio			= 49,
+		.active_low		= 1,
+	},
+};
+
+static struct gpio_led_platform_data dreamplug_led_data = {
+	.leds		= dreamplug_led_pins,
+	.num_leds	= ARRAY_SIZE(dreamplug_led_pins),
+};
+
+static struct platform_device dreamplug_leds = {
+	.name	= "leds-gpio",
+	.id	= -1,
+	.dev	= {
+		.platform_data	= &dreamplug_led_data,
+	}
+};
+
+static unsigned int dreamplug_mpp_config[] __initdata = {
+	MPP0_SPI_SCn,
+	MPP1_SPI_MOSI,
+	MPP2_SPI_SCK,
+	MPP3_SPI_MISO,
+	MPP47_GPIO,	/* Bluetooth LED */
+	MPP48_GPIO,	/* Wifi LED */
+	MPP49_GPIO,	/* Wifi AP LED */
+	0
+};
+
+static void __init dreamplug_init(void)
+{
+	/*
+	 * Basic setup. Needs to be called early.
+	 */
+	kirkwood_mpp_conf(dreamplug_mpp_config);
+
+	kirkwood_uart0_init();
+
+	spi_register_board_info(dreamplug_spi_slave_info,
+				ARRAY_SIZE(dreamplug_spi_slave_info));
+	kirkwood_spi_init();
+
+	kirkwood_ehci_init();
+	kirkwood_ge00_init(&dreamplug_ge00_data);
+	kirkwood_ge01_init(&dreamplug_ge01_data);
+	kirkwood_sata_init(&dreamplug_sata_data);
+	kirkwood_sdio_init(&dreamplug_mvsdio_data);
+
+	platform_device_register(&dreamplug_leds);
+}
+
+static void __init kirkwood_dt_init(void)
+{
+	kirkwood_init();
+
+	if (of_machine_is_compatible("globalscale,dreamplug"))
+		dreamplug_init();
+
+	of_platform_populate(NULL, kirkwood_dt_match_table, NULL, NULL);
+}
+
+static const char *kirkwood_dt_board_compat[] = {
+	"globalscale,dreamplug",
+	NULL
+};
+
+DT_MACHINE_START(KIRKWOOD_DT, "Marvell Kirkwood (Flattened Device Tree)")
+	/* Maintainer: Jason Cooper <jason@lakedaemon.net> */
+	.map_io		= kirkwood_map_io,
+	.init_early	= kirkwood_init_early,
+	.init_irq	= kirkwood_init_irq,
+	.timer		= &kirkwood_timer,
+	.init_machine	= kirkwood_dt_init,
+	.restart	= kirkwood_restart,
+	.dt_compat	= kirkwood_dt_board_compat,
+MACHINE_END
-- 
1.7.3.4

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

* [PATCH 1/2 v5] arm: kirkwood: add dreamplug (fdt) support.
@ 2012-02-23 19:52   ` Jason Cooper
  0 siblings, 0 replies; 76+ messages in thread
From: Jason Cooper @ 2012-02-23 19:52 UTC (permalink / raw)
  To: linux-arm-kernel

Initially, copied guruplug-setup.c and did s/guruplug/dreamplug/g.
Then, switched to SPI based NOR flash.

After talking to Arnd Bergman, chose an incremental approach to adding
devicetree support.  First, we use the dtb to tell us we are on the
dreamplug, then we gradually port over drivers.

Driver porting will start with the uart (see next patch), and progress
from there.  Possibly, spi/flash/partitions will be next.

When done, board-dt.c will no longer be dreamplug specific, and dt's can
be made for the other kirkwood boards.

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

   - attempting dts, looking for pointers.

Changes from v2

   - resubmit as MACH_TYPE_DREAMPLUG (3550) is in arm/for-next, rebased
     against same.
   - removed lame fdt attempt, others are working on kirkwood fdt.  Will
     convert once kirkwood fdt is mainline.
   - s/boot_params/atag_offset/
   - added kirkwood_reset
   - 1 checkpatch.pl warning (help in Kconfig), looks the same as all
     other kirkwood boards...

Changes from v3

   - rebased against v3.3-rc3 (recommended by Arnd)
   - use devicetree to determine which board we are on
   - added patch to configure uart0 from devicetree

Changes from v4

   - fixed Kconfig logic so user can always see 'Dreamplug' in menuconfig.
   - changed 'marvell,dreamplug' to 'globalscale,dreamplug' as suggested by
     Grant Likely.
   - fixed of_machine_is_compatible() logic for calling dreamplug specific
     init functions.

 arch/arm/boot/dts/kirkwood-dreamplug.dts |   18 +++
 arch/arm/boot/dts/kirkwood.dtsi          |    6 +
 arch/arm/mach-kirkwood/Kconfig           |   14 +++
 arch/arm/mach-kirkwood/Makefile          |    1 +
 arch/arm/mach-kirkwood/Makefile.boot     |    2 +
 arch/arm/mach-kirkwood/board-dt.c        |  182 ++++++++++++++++++++++++++++++
 6 files changed, 223 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/boot/dts/kirkwood-dreamplug.dts
 create mode 100644 arch/arm/boot/dts/kirkwood.dtsi
 create mode 100644 arch/arm/mach-kirkwood/board-dt.c

diff --git a/arch/arm/boot/dts/kirkwood-dreamplug.dts b/arch/arm/boot/dts/kirkwood-dreamplug.dts
new file mode 100644
index 0000000..765813f
--- /dev/null
+++ b/arch/arm/boot/dts/kirkwood-dreamplug.dts
@@ -0,0 +1,18 @@
+/dts-v1/;
+
+/include/ "kirkwood.dtsi"
+
+/ {
+	model = "Globalscale Technologies Dreamplug";
+	compatible = "globalscale,dreamplug", "globalscale,kirkwood";
+
+	memory {
+		device_type = "memory";
+		reg = <0x00000000 0x20000000>;
+	};
+
+	chosen {
+		bootargs = "console=ttyS0,115200n8 earlyprintk";
+	};
+
+};
diff --git a/arch/arm/boot/dts/kirkwood.dtsi b/arch/arm/boot/dts/kirkwood.dtsi
new file mode 100644
index 0000000..18fd47e
--- /dev/null
+++ b/arch/arm/boot/dts/kirkwood.dtsi
@@ -0,0 +1,6 @@
+/include/ "skeleton.dtsi"
+
+/ {
+	compatible = "globalscale,kirkwood";
+};
+
diff --git a/arch/arm/mach-kirkwood/Kconfig b/arch/arm/mach-kirkwood/Kconfig
index 7fc603b..90ceab7 100644
--- a/arch/arm/mach-kirkwood/Kconfig
+++ b/arch/arm/mach-kirkwood/Kconfig
@@ -44,6 +44,20 @@ config MACH_GURUPLUG
 	  Say 'Y' here if you want your kernel to support the
 	  Marvell GuruPlug Reference Board.
 
+config ARCH_KIRKWOOD_DT
+	bool "Marvell Kirkwood Flattened Device Tree"
+	select USE_OF
+	help
+	  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_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 5dcaa81..acbc5e1 100644
--- a/arch/arm/mach-kirkwood/Makefile
+++ b/arch/arm/mach-kirkwood/Makefile
@@ -20,3 +20,4 @@ obj-$(CONFIG_MACH_NET5BIG_V2)		+= netxbig_v2-setup.o lacie_v2-common.o
 obj-$(CONFIG_MACH_T5325)		+= t5325-setup.o
 
 obj-$(CONFIG_CPU_IDLE)			+= cpuidle.o
+obj-$(CONFIG_ARCH_KIRKWOOD_DT)		+= board-dt.o
diff --git a/arch/arm/mach-kirkwood/Makefile.boot b/arch/arm/mach-kirkwood/Makefile.boot
index 760a0ef..16f9385 100644
--- a/arch/arm/mach-kirkwood/Makefile.boot
+++ b/arch/arm/mach-kirkwood/Makefile.boot
@@ -1,3 +1,5 @@
    zreladdr-y	+= 0x00008000
 params_phys-y	:= 0x00000100
 initrd_phys-y	:= 0x00800000
+
+dtb-$(CONFIG_MACH_DREAMPLUG_DT) += kirkwood-dreamplug.dtb
diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c
new file mode 100644
index 0000000..76392af
--- /dev/null
+++ b/arch/arm/mach-kirkwood/board-dt.c
@@ -0,0 +1,182 @@
+/*
+ * Copyright 2012 (C), Jason Cooper <jason@lakedaemon.net>
+ *
+ * arch/arm/mach-kirkwood/board-dt.c
+ *
+ * Marvell DreamPlug Reference 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/platform_device.h>
+#include <linux/mtd/partitions.h>
+#include <linux/ata_platform.h>
+#include <linux/mv643xx_eth.h>
+#include <linux/of.h>
+#include <linux/of_address.h>
+#include <linux/of_fdt.h>
+#include <linux/of_irq.h>
+#include <linux/of_platform.h>
+#include <linux/gpio.h>
+#include <linux/leds.h>
+#include <linux/mtd/physmap.h>
+#include <linux/spi/flash.h>
+#include <linux/spi/spi.h>
+#include <linux/spi/orion_spi.h>
+#include <asm/mach-types.h>
+#include <asm/mach/arch.h>
+#include <mach/kirkwood.h>
+#include <plat/mvsdio.h>
+#include "common.h"
+#include "mpp.h"
+
+static struct of_device_id kirkwood_dt_match_table[] __initdata = {
+	{ .compatible = "simple-bus", },
+	{ }
+};
+
+struct mtd_partition dreamplug_partitions[] = {
+	{
+		.name	= "u-boot",
+		.size	= SZ_512K,
+		.offset = 0,
+	},
+	{
+		.name	= "u-boot env",
+		.size	= SZ_64K,
+		.offset = SZ_512K + SZ_512K,
+	},
+	{
+		.name	= "dtb",
+		.size	= SZ_64K,
+		.offset = SZ_512K + SZ_512K + SZ_512K,
+	},
+};
+
+static const struct flash_platform_data dreamplug_spi_slave_data = {
+	.type		= "mx25l1606e",
+	.name		= "spi_flash",
+	.parts		= dreamplug_partitions,
+	.nr_parts	= ARRAY_SIZE(dreamplug_partitions),
+};
+
+static struct spi_board_info __initdata dreamplug_spi_slave_info[] = {
+	{
+		.modalias	= "m25p80",
+		.platform_data	= &dreamplug_spi_slave_data,
+		.irq		= -1,
+		.max_speed_hz	= 50000000,
+		.bus_num	= 0,
+		.chip_select	= 0,
+	},
+};
+
+static struct mv643xx_eth_platform_data dreamplug_ge00_data = {
+	.phy_addr	= MV643XX_ETH_PHY_ADDR(0),
+};
+
+static struct mv643xx_eth_platform_data dreamplug_ge01_data = {
+	.phy_addr	= MV643XX_ETH_PHY_ADDR(1),
+};
+
+static struct mv_sata_platform_data dreamplug_sata_data = {
+	.n_ports	= 1,
+};
+
+static struct mvsdio_platform_data dreamplug_mvsdio_data = {
+	/* unfortunately the CD signal has not been connected */
+};
+
+static struct gpio_led dreamplug_led_pins[] = {
+	{
+		.name			= "dreamplug:blue:bluetooth",
+		.gpio			= 47,
+		.active_low		= 1,
+	},
+	{
+		.name			= "dreamplug:green:wifi",
+		.gpio			= 48,
+		.active_low		= 1,
+	},
+	{
+		.name			= "dreamplug:green:wifi_ap",
+		.gpio			= 49,
+		.active_low		= 1,
+	},
+};
+
+static struct gpio_led_platform_data dreamplug_led_data = {
+	.leds		= dreamplug_led_pins,
+	.num_leds	= ARRAY_SIZE(dreamplug_led_pins),
+};
+
+static struct platform_device dreamplug_leds = {
+	.name	= "leds-gpio",
+	.id	= -1,
+	.dev	= {
+		.platform_data	= &dreamplug_led_data,
+	}
+};
+
+static unsigned int dreamplug_mpp_config[] __initdata = {
+	MPP0_SPI_SCn,
+	MPP1_SPI_MOSI,
+	MPP2_SPI_SCK,
+	MPP3_SPI_MISO,
+	MPP47_GPIO,	/* Bluetooth LED */
+	MPP48_GPIO,	/* Wifi LED */
+	MPP49_GPIO,	/* Wifi AP LED */
+	0
+};
+
+static void __init dreamplug_init(void)
+{
+	/*
+	 * Basic setup. Needs to be called early.
+	 */
+	kirkwood_mpp_conf(dreamplug_mpp_config);
+
+	kirkwood_uart0_init();
+
+	spi_register_board_info(dreamplug_spi_slave_info,
+				ARRAY_SIZE(dreamplug_spi_slave_info));
+	kirkwood_spi_init();
+
+	kirkwood_ehci_init();
+	kirkwood_ge00_init(&dreamplug_ge00_data);
+	kirkwood_ge01_init(&dreamplug_ge01_data);
+	kirkwood_sata_init(&dreamplug_sata_data);
+	kirkwood_sdio_init(&dreamplug_mvsdio_data);
+
+	platform_device_register(&dreamplug_leds);
+}
+
+static void __init kirkwood_dt_init(void)
+{
+	kirkwood_init();
+
+	if (of_machine_is_compatible("globalscale,dreamplug"))
+		dreamplug_init();
+
+	of_platform_populate(NULL, kirkwood_dt_match_table, NULL, NULL);
+}
+
+static const char *kirkwood_dt_board_compat[] = {
+	"globalscale,dreamplug",
+	NULL
+};
+
+DT_MACHINE_START(KIRKWOOD_DT, "Marvell Kirkwood (Flattened Device Tree)")
+	/* Maintainer: Jason Cooper <jason@lakedaemon.net> */
+	.map_io		= kirkwood_map_io,
+	.init_early	= kirkwood_init_early,
+	.init_irq	= kirkwood_init_irq,
+	.timer		= &kirkwood_timer,
+	.init_machine	= kirkwood_dt_init,
+	.restart	= kirkwood_restart,
+	.dt_compat	= kirkwood_dt_board_compat,
+MACHINE_END
-- 
1.7.3.4

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

* [PATCH 2/2 v2] arm: kirkwood: convert uart0 to devicetree.
  2012-02-23 19:52   ` Jason Cooper
@ 2012-02-23 19:52   ` Jason Cooper
  -1 siblings, 0 replies; 76+ messages in thread
From: Jason Cooper @ 2012-02-23 19:52 UTC (permalink / raw)
  To: arnd, grant.likely; +Cc: devicetree-discuss, Jason Cooper, linux-arm-kernel

This uart is the primary console for the dreamplug.  Removed
kirkwood_uart0_init() call from board-dt.c.

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

    - moved serial config from kirkwood.dtsi to kirkwood-dreamplug.dts as
      suggested by Arnd Bergman.

 arch/arm/boot/dts/kirkwood-dreamplug.dts |    7 +++++++
 arch/arm/mach-kirkwood/board-dt.c        |    2 --
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/arch/arm/boot/dts/kirkwood-dreamplug.dts b/arch/arm/boot/dts/kirkwood-dreamplug.dts
index 765813f..9cdda80 100644
--- a/arch/arm/boot/dts/kirkwood-dreamplug.dts
+++ b/arch/arm/boot/dts/kirkwood-dreamplug.dts
@@ -15,4 +15,11 @@
 		bootargs = "console=ttyS0,115200n8 earlyprintk";
 	};
 
+	serial@f1012000 {
+		compatible = "ns16550a";
+		reg = <0xf1012000 0xff>;
+		reg-shift = <2>;
+		interrupts = <33>;
+		clock-frequency = <200000000>;
+	};
 };
diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c
index 76392af..fbe6405 100644
--- a/arch/arm/mach-kirkwood/board-dt.c
+++ b/arch/arm/mach-kirkwood/board-dt.c
@@ -140,8 +140,6 @@ static void __init dreamplug_init(void)
 	 */
 	kirkwood_mpp_conf(dreamplug_mpp_config);
 
-	kirkwood_uart0_init();
-
 	spi_register_board_info(dreamplug_spi_slave_info,
 				ARRAY_SIZE(dreamplug_spi_slave_info));
 	kirkwood_spi_init();
-- 
1.7.3.4

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

* [PATCH 2/2 v2] arm: kirkwood: convert uart0 to devicetree.
@ 2012-02-23 19:52   ` Jason Cooper
  0 siblings, 0 replies; 76+ messages in thread
From: Jason Cooper @ 2012-02-23 19:52 UTC (permalink / raw)
  To: linux-arm-kernel

This uart is the primary console for the dreamplug.  Removed
kirkwood_uart0_init() call from board-dt.c.

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

    - moved serial config from kirkwood.dtsi to kirkwood-dreamplug.dts as
      suggested by Arnd Bergman.

 arch/arm/boot/dts/kirkwood-dreamplug.dts |    7 +++++++
 arch/arm/mach-kirkwood/board-dt.c        |    2 --
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/arch/arm/boot/dts/kirkwood-dreamplug.dts b/arch/arm/boot/dts/kirkwood-dreamplug.dts
index 765813f..9cdda80 100644
--- a/arch/arm/boot/dts/kirkwood-dreamplug.dts
+++ b/arch/arm/boot/dts/kirkwood-dreamplug.dts
@@ -15,4 +15,11 @@
 		bootargs = "console=ttyS0,115200n8 earlyprintk";
 	};
 
+	serial at f1012000 {
+		compatible = "ns16550a";
+		reg = <0xf1012000 0xff>;
+		reg-shift = <2>;
+		interrupts = <33>;
+		clock-frequency = <200000000>;
+	};
 };
diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c
index 76392af..fbe6405 100644
--- a/arch/arm/mach-kirkwood/board-dt.c
+++ b/arch/arm/mach-kirkwood/board-dt.c
@@ -140,8 +140,6 @@ static void __init dreamplug_init(void)
 	 */
 	kirkwood_mpp_conf(dreamplug_mpp_config);
 
-	kirkwood_uart0_init();
-
 	spi_register_board_info(dreamplug_spi_slave_info,
 				ARRAY_SIZE(dreamplug_spi_slave_info));
 	kirkwood_spi_init();
-- 
1.7.3.4

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

* Re: [PATCH 1/2 v5] arm: kirkwood: add dreamplug (fdt) support.
  2012-02-23 19:52   ` Jason Cooper
@ 2012-02-23 20:18     ` Grant Likely
  -1 siblings, 0 replies; 76+ messages in thread
From: Grant Likely @ 2012-02-23 20:18 UTC (permalink / raw)
  To: Jason Cooper; +Cc: devicetree-discuss, linux-arm-kernel, arnd

On Thu, Feb 23, 2012 at 12:52 PM, Jason Cooper <jason@lakedaemon.net> wrote:
> Initially, copied guruplug-setup.c and did s/guruplug/dreamplug/g.
> Then, switched to SPI based NOR flash.
>
> After talking to Arnd Bergman, chose an incremental approach to adding
> devicetree support.  First, we use the dtb to tell us we are on the
> dreamplug, then we gradually port over drivers.
>
> Driver porting will start with the uart (see next patch), and progress
> from there.  Possibly, spi/flash/partitions will be next.
>
> When done, board-dt.c will no longer be dreamplug specific, and dt's can
> be made for the other kirkwood boards.
>
> Signed-off-by: Jason Cooper <jason@lakedaemon.net>
> ---
> Changes from v1
>
>   - attempting dts, looking for pointers.
>
> Changes from v2
>
>   - resubmit as MACH_TYPE_DREAMPLUG (3550) is in arm/for-next, rebased
>     against same.
>   - removed lame fdt attempt, others are working on kirkwood fdt.  Will
>     convert once kirkwood fdt is mainline.
>   - s/boot_params/atag_offset/
>   - added kirkwood_reset
>   - 1 checkpatch.pl warning (help in Kconfig), looks the same as all
>     other kirkwood boards...
>
> Changes from v3
>
>   - rebased against v3.3-rc3 (recommended by Arnd)
>   - use devicetree to determine which board we are on
>   - added patch to configure uart0 from devicetree
>
> Changes from v4
>
>   - fixed Kconfig logic so user can always see 'Dreamplug' in menuconfig.
>   - changed 'marvell,dreamplug' to 'globalscale,dreamplug' as suggested by
>     Grant Likely.
>   - fixed of_machine_is_compatible() logic for calling dreamplug specific
>     init functions.
>
>  arch/arm/boot/dts/kirkwood-dreamplug.dts |   18 +++
>  arch/arm/boot/dts/kirkwood.dtsi          |    6 +
>  arch/arm/mach-kirkwood/Kconfig           |   14 +++
>  arch/arm/mach-kirkwood/Makefile          |    1 +
>  arch/arm/mach-kirkwood/Makefile.boot     |    2 +
>  arch/arm/mach-kirkwood/board-dt.c        |  182 ++++++++++++++++++++++++++++++
>  6 files changed, 223 insertions(+), 0 deletions(-)
>  create mode 100644 arch/arm/boot/dts/kirkwood-dreamplug.dts
>  create mode 100644 arch/arm/boot/dts/kirkwood.dtsi
>  create mode 100644 arch/arm/mach-kirkwood/board-dt.c
>
> diff --git a/arch/arm/boot/dts/kirkwood-dreamplug.dts b/arch/arm/boot/dts/kirkwood-dreamplug.dts
> new file mode 100644
> index 0000000..765813f
> --- /dev/null
> +++ b/arch/arm/boot/dts/kirkwood-dreamplug.dts
> @@ -0,0 +1,18 @@
> +/dts-v1/;
> +
> +/include/ "kirkwood.dtsi"
> +
> +/ {
> +       model = "Globalscale Technologies Dreamplug";
> +       compatible = "globalscale,dreamplug", "globalscale,kirkwood";

Hahaha... okay, more clarification is needed here.

The compatible property is a list, and the first entry must always be
the exact device model.  That is why the vendor of the hardware is in
the prefix.  However, the following entries are a list of devices that
it is 'compatible' with.  In the case of the top-level compatible
property, we've been using the convention of including a string for
the SoC, and in that case the manufacturer is indeed Marvell.

Also, *be specific*.  Kirkwood is a family of processors, not a single
SoC.  The compatible string should reflect that.  So, in your case,
compatible should look something like:

compatible = "globalscale,dreamplug", "marvell,kirkwood-88f6281";

g.

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

* [PATCH 1/2 v5] arm: kirkwood: add dreamplug (fdt) support.
@ 2012-02-23 20:18     ` Grant Likely
  0 siblings, 0 replies; 76+ messages in thread
From: Grant Likely @ 2012-02-23 20:18 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Feb 23, 2012 at 12:52 PM, Jason Cooper <jason@lakedaemon.net> wrote:
> Initially, copied guruplug-setup.c and did s/guruplug/dreamplug/g.
> Then, switched to SPI based NOR flash.
>
> After talking to Arnd Bergman, chose an incremental approach to adding
> devicetree support. ?First, we use the dtb to tell us we are on the
> dreamplug, then we gradually port over drivers.
>
> Driver porting will start with the uart (see next patch), and progress
> from there. ?Possibly, spi/flash/partitions will be next.
>
> When done, board-dt.c will no longer be dreamplug specific, and dt's can
> be made for the other kirkwood boards.
>
> Signed-off-by: Jason Cooper <jason@lakedaemon.net>
> ---
> Changes from v1
>
> ? - attempting dts, looking for pointers.
>
> Changes from v2
>
> ? - resubmit as MACH_TYPE_DREAMPLUG (3550) is in arm/for-next, rebased
> ? ? against same.
> ? - removed lame fdt attempt, others are working on kirkwood fdt. ?Will
> ? ? convert once kirkwood fdt is mainline.
> ? - s/boot_params/atag_offset/
> ? - added kirkwood_reset
> ? - 1 checkpatch.pl warning (help in Kconfig), looks the same as all
> ? ? other kirkwood boards...
>
> Changes from v3
>
> ? - rebased against v3.3-rc3 (recommended by Arnd)
> ? - use devicetree to determine which board we are on
> ? - added patch to configure uart0 from devicetree
>
> Changes from v4
>
> ? - fixed Kconfig logic so user can always see 'Dreamplug' in menuconfig.
> ? - changed 'marvell,dreamplug' to 'globalscale,dreamplug' as suggested by
> ? ? Grant Likely.
> ? - fixed of_machine_is_compatible() logic for calling dreamplug specific
> ? ? init functions.
>
> ?arch/arm/boot/dts/kirkwood-dreamplug.dts | ? 18 +++
> ?arch/arm/boot/dts/kirkwood.dtsi ? ? ? ? ?| ? ?6 +
> ?arch/arm/mach-kirkwood/Kconfig ? ? ? ? ? | ? 14 +++
> ?arch/arm/mach-kirkwood/Makefile ? ? ? ? ?| ? ?1 +
> ?arch/arm/mach-kirkwood/Makefile.boot ? ? | ? ?2 +
> ?arch/arm/mach-kirkwood/board-dt.c ? ? ? ?| ?182 ++++++++++++++++++++++++++++++
> ?6 files changed, 223 insertions(+), 0 deletions(-)
> ?create mode 100644 arch/arm/boot/dts/kirkwood-dreamplug.dts
> ?create mode 100644 arch/arm/boot/dts/kirkwood.dtsi
> ?create mode 100644 arch/arm/mach-kirkwood/board-dt.c
>
> diff --git a/arch/arm/boot/dts/kirkwood-dreamplug.dts b/arch/arm/boot/dts/kirkwood-dreamplug.dts
> new file mode 100644
> index 0000000..765813f
> --- /dev/null
> +++ b/arch/arm/boot/dts/kirkwood-dreamplug.dts
> @@ -0,0 +1,18 @@
> +/dts-v1/;
> +
> +/include/ "kirkwood.dtsi"
> +
> +/ {
> + ? ? ? model = "Globalscale Technologies Dreamplug";
> + ? ? ? compatible = "globalscale,dreamplug", "globalscale,kirkwood";

Hahaha... okay, more clarification is needed here.

The compatible property is a list, and the first entry must always be
the exact device model.  That is why the vendor of the hardware is in
the prefix.  However, the following entries are a list of devices that
it is 'compatible' with.  In the case of the top-level compatible
property, we've been using the convention of including a string for
the SoC, and in that case the manufacturer is indeed Marvell.

Also, *be specific*.  Kirkwood is a family of processors, not a single
SoC.  The compatible string should reflect that.  So, in your case,
compatible should look something like:

compatible = "globalscale,dreamplug", "marvell,kirkwood-88f6281";

g.

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

* Re: [PATCH 1/2 v5] arm: kirkwood: add dreamplug (fdt) support.
  2012-02-23 20:18     ` Grant Likely
@ 2012-02-23 21:11         ` Jason
  -1 siblings, 0 replies; 76+ messages in thread
From: Jason @ 2012-02-23 21:11 UTC (permalink / raw)
  To: Grant Likely
  Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On Thu, Feb 23, 2012 at 01:18:55PM -0700, Grant Likely wrote:
> On Thu, Feb 23, 2012 at 12:52 PM, Jason Cooper <jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org> wrote:
> > Initially, copied guruplug-setup.c and did s/guruplug/dreamplug/g.
> > Then, switched to SPI based NOR flash.
> >
> > After talking to Arnd Bergman, chose an incremental approach to adding
> > devicetree support.  First, we use the dtb to tell us we are on the
> > dreamplug, then we gradually port over drivers.
> >
> > Driver porting will start with the uart (see next patch), and progress
> > from there.  Possibly, spi/flash/partitions will be next.
> >
> > When done, board-dt.c will no longer be dreamplug specific, and dt's can
> > be made for the other kirkwood boards.
> >
> > Signed-off-by: Jason Cooper <jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org>
> > ---
> > Changes from v1
> >
> >   - attempting dts, looking for pointers.
> >
> > Changes from v2
> >
> >   - resubmit as MACH_TYPE_DREAMPLUG (3550) is in arm/for-next, rebased
> >     against same.
> >   - removed lame fdt attempt, others are working on kirkwood fdt.  Will
> >     convert once kirkwood fdt is mainline.
> >   - s/boot_params/atag_offset/
> >   - added kirkwood_reset
> >   - 1 checkpatch.pl warning (help in Kconfig), looks the same as all
> >     other kirkwood boards...
> >
> > Changes from v3
> >
> >   - rebased against v3.3-rc3 (recommended by Arnd)
> >   - use devicetree to determine which board we are on
> >   - added patch to configure uart0 from devicetree
> >
> > Changes from v4
> >
> >   - fixed Kconfig logic so user can always see 'Dreamplug' in menuconfig.
> >   - changed 'marvell,dreamplug' to 'globalscale,dreamplug' as suggested by
> >     Grant Likely.
> >   - fixed of_machine_is_compatible() logic for calling dreamplug specific
> >     init functions.
> >
> >  arch/arm/boot/dts/kirkwood-dreamplug.dts |   18 +++
> >  arch/arm/boot/dts/kirkwood.dtsi          |    6 +
> >  arch/arm/mach-kirkwood/Kconfig           |   14 +++
> >  arch/arm/mach-kirkwood/Makefile          |    1 +
> >  arch/arm/mach-kirkwood/Makefile.boot     |    2 +
> >  arch/arm/mach-kirkwood/board-dt.c        |  182 ++++++++++++++++++++++++++++++
> >  6 files changed, 223 insertions(+), 0 deletions(-)
> >  create mode 100644 arch/arm/boot/dts/kirkwood-dreamplug.dts
> >  create mode 100644 arch/arm/boot/dts/kirkwood.dtsi
> >  create mode 100644 arch/arm/mach-kirkwood/board-dt.c
> >
> > diff --git a/arch/arm/boot/dts/kirkwood-dreamplug.dts b/arch/arm/boot/dts/kirkwood-dreamplug.dts
> > new file mode 100644
> > index 0000000..765813f
> > --- /dev/null
> > +++ b/arch/arm/boot/dts/kirkwood-dreamplug.dts
> > @@ -0,0 +1,18 @@
> > +/dts-v1/;
> > +
> > +/include/ "kirkwood.dtsi"
> > +
> > +/ {
> > +       model = "Globalscale Technologies Dreamplug";
> > +       compatible = "globalscale,dreamplug", "globalscale,kirkwood";
> 
> Hahaha... okay, more clarification is needed here.
> 
> The compatible property is a list, and the first entry must always be
> the exact device model.  That is why the vendor of the hardware is in
> the prefix.  However, the following entries are a list of devices that
> it is 'compatible' with.  In the case of the top-level compatible
> property, we've been using the convention of including a string for
> the SoC, and in that case the manufacturer is indeed Marvell.
> 
> Also, *be specific*.  Kirkwood is a family of processors, not a single
> SoC.  The compatible string should reflect that.  So, in your case,
> compatible should look something like:
> 
> compatible = "globalscale,dreamplug", "marvell,kirkwood-88f6281";

ahhh... ok.  So, my board-dt.c should have:

static const char *kirkwood_dt_board_compat[] = {
        "marvell,kirkwood",
        NULL
};

And then the test to run the dreamplug specific init should be:

        if (of_machine_is_compatible("globalscale,dreamplug"))
                dreamplug_init();

And then, kirkwood.dtsi:

compatible = "marvell,kirkwood";

and kirkwood-dreamplug.dts:

compatible = "globalscale,dreamplug", "marvell,kirkwood-88f6281-a1";


My only question is, should the kirkwood.dtsi have just
"marvell,kirkwood", or "marvell,kirkwood","marvell,kirkwood-88f6281-a1"?

I'm guessing kirkwood.dtsi is a generic devicetree, and should just be
"marvell,kirkwood".  If that's true, then *kirkwood_dt_board_compat
should just be "marvell,kirkwood" since board-dt.c should be able to
handle any kirkwood SoC.

Sorry for being so dense.

thx,

Jason.

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

* [PATCH 1/2 v5] arm: kirkwood: add dreamplug (fdt) support.
@ 2012-02-23 21:11         ` Jason
  0 siblings, 0 replies; 76+ messages in thread
From: Jason @ 2012-02-23 21:11 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Feb 23, 2012 at 01:18:55PM -0700, Grant Likely wrote:
> On Thu, Feb 23, 2012 at 12:52 PM, Jason Cooper <jason@lakedaemon.net> wrote:
> > Initially, copied guruplug-setup.c and did s/guruplug/dreamplug/g.
> > Then, switched to SPI based NOR flash.
> >
> > After talking to Arnd Bergman, chose an incremental approach to adding
> > devicetree support. ?First, we use the dtb to tell us we are on the
> > dreamplug, then we gradually port over drivers.
> >
> > Driver porting will start with the uart (see next patch), and progress
> > from there. ?Possibly, spi/flash/partitions will be next.
> >
> > When done, board-dt.c will no longer be dreamplug specific, and dt's can
> > be made for the other kirkwood boards.
> >
> > Signed-off-by: Jason Cooper <jason@lakedaemon.net>
> > ---
> > Changes from v1
> >
> > ? - attempting dts, looking for pointers.
> >
> > Changes from v2
> >
> > ? - resubmit as MACH_TYPE_DREAMPLUG (3550) is in arm/for-next, rebased
> > ? ? against same.
> > ? - removed lame fdt attempt, others are working on kirkwood fdt. ?Will
> > ? ? convert once kirkwood fdt is mainline.
> > ? - s/boot_params/atag_offset/
> > ? - added kirkwood_reset
> > ? - 1 checkpatch.pl warning (help in Kconfig), looks the same as all
> > ? ? other kirkwood boards...
> >
> > Changes from v3
> >
> > ? - rebased against v3.3-rc3 (recommended by Arnd)
> > ? - use devicetree to determine which board we are on
> > ? - added patch to configure uart0 from devicetree
> >
> > Changes from v4
> >
> > ? - fixed Kconfig logic so user can always see 'Dreamplug' in menuconfig.
> > ? - changed 'marvell,dreamplug' to 'globalscale,dreamplug' as suggested by
> > ? ? Grant Likely.
> > ? - fixed of_machine_is_compatible() logic for calling dreamplug specific
> > ? ? init functions.
> >
> > ?arch/arm/boot/dts/kirkwood-dreamplug.dts | ? 18 +++
> > ?arch/arm/boot/dts/kirkwood.dtsi ? ? ? ? ?| ? ?6 +
> > ?arch/arm/mach-kirkwood/Kconfig ? ? ? ? ? | ? 14 +++
> > ?arch/arm/mach-kirkwood/Makefile ? ? ? ? ?| ? ?1 +
> > ?arch/arm/mach-kirkwood/Makefile.boot ? ? | ? ?2 +
> > ?arch/arm/mach-kirkwood/board-dt.c ? ? ? ?| ?182 ++++++++++++++++++++++++++++++
> > ?6 files changed, 223 insertions(+), 0 deletions(-)
> > ?create mode 100644 arch/arm/boot/dts/kirkwood-dreamplug.dts
> > ?create mode 100644 arch/arm/boot/dts/kirkwood.dtsi
> > ?create mode 100644 arch/arm/mach-kirkwood/board-dt.c
> >
> > diff --git a/arch/arm/boot/dts/kirkwood-dreamplug.dts b/arch/arm/boot/dts/kirkwood-dreamplug.dts
> > new file mode 100644
> > index 0000000..765813f
> > --- /dev/null
> > +++ b/arch/arm/boot/dts/kirkwood-dreamplug.dts
> > @@ -0,0 +1,18 @@
> > +/dts-v1/;
> > +
> > +/include/ "kirkwood.dtsi"
> > +
> > +/ {
> > + ? ? ? model = "Globalscale Technologies Dreamplug";
> > + ? ? ? compatible = "globalscale,dreamplug", "globalscale,kirkwood";
> 
> Hahaha... okay, more clarification is needed here.
> 
> The compatible property is a list, and the first entry must always be
> the exact device model.  That is why the vendor of the hardware is in
> the prefix.  However, the following entries are a list of devices that
> it is 'compatible' with.  In the case of the top-level compatible
> property, we've been using the convention of including a string for
> the SoC, and in that case the manufacturer is indeed Marvell.
> 
> Also, *be specific*.  Kirkwood is a family of processors, not a single
> SoC.  The compatible string should reflect that.  So, in your case,
> compatible should look something like:
> 
> compatible = "globalscale,dreamplug", "marvell,kirkwood-88f6281";

ahhh... ok.  So, my board-dt.c should have:

static const char *kirkwood_dt_board_compat[] = {
        "marvell,kirkwood",
        NULL
};

And then the test to run the dreamplug specific init should be:

        if (of_machine_is_compatible("globalscale,dreamplug"))
                dreamplug_init();

And then, kirkwood.dtsi:

compatible = "marvell,kirkwood";

and kirkwood-dreamplug.dts:

compatible = "globalscale,dreamplug", "marvell,kirkwood-88f6281-a1";


My only question is, should the kirkwood.dtsi have just
"marvell,kirkwood", or "marvell,kirkwood","marvell,kirkwood-88f6281-a1"?

I'm guessing kirkwood.dtsi is a generic devicetree, and should just be
"marvell,kirkwood".  If that's true, then *kirkwood_dt_board_compat
should just be "marvell,kirkwood" since board-dt.c should be able to
handle any kirkwood SoC.

Sorry for being so dense.

thx,

Jason.

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

* Re: [PATCH 1/2 v5] arm: kirkwood: add dreamplug (fdt) support.
  2012-02-23 21:11         ` Jason
@ 2012-02-23 21:21             ` Grant Likely
  -1 siblings, 0 replies; 76+ messages in thread
From: Grant Likely @ 2012-02-23 21:21 UTC (permalink / raw)
  To: Jason
  Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On Thu, Feb 23, 2012 at 2:11 PM, Jason <jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org> wrote:
> On Thu, Feb 23, 2012 at 01:18:55PM -0700, Grant Likely wrote:
>> On Thu, Feb 23, 2012 at 12:52 PM, Jason Cooper <jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org> wrote:
>> > Initially, copied guruplug-setup.c and did s/guruplug/dreamplug/g.
>> > Then, switched to SPI based NOR flash.
>> >
>> > After talking to Arnd Bergman, chose an incremental approach to adding
>> > devicetree support.  First, we use the dtb to tell us we are on the
>> > dreamplug, then we gradually port over drivers.
>> >
>> > Driver porting will start with the uart (see next patch), and progress
>> > from there.  Possibly, spi/flash/partitions will be next.
>> >
>> > When done, board-dt.c will no longer be dreamplug specific, and dt's can
>> > be made for the other kirkwood boards.
>> >
>> > Signed-off-by: Jason Cooper <jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org>
>> > ---
>> > Changes from v1
>> >
>> >   - attempting dts, looking for pointers.
>> >
>> > Changes from v2
>> >
>> >   - resubmit as MACH_TYPE_DREAMPLUG (3550) is in arm/for-next, rebased
>> >     against same.
>> >   - removed lame fdt attempt, others are working on kirkwood fdt.  Will
>> >     convert once kirkwood fdt is mainline.
>> >   - s/boot_params/atag_offset/
>> >   - added kirkwood_reset
>> >   - 1 checkpatch.pl warning (help in Kconfig), looks the same as all
>> >     other kirkwood boards...
>> >
>> > Changes from v3
>> >
>> >   - rebased against v3.3-rc3 (recommended by Arnd)
>> >   - use devicetree to determine which board we are on
>> >   - added patch to configure uart0 from devicetree
>> >
>> > Changes from v4
>> >
>> >   - fixed Kconfig logic so user can always see 'Dreamplug' in menuconfig.
>> >   - changed 'marvell,dreamplug' to 'globalscale,dreamplug' as suggested by
>> >     Grant Likely.
>> >   - fixed of_machine_is_compatible() logic for calling dreamplug specific
>> >     init functions.
>> >
>> >  arch/arm/boot/dts/kirkwood-dreamplug.dts |   18 +++
>> >  arch/arm/boot/dts/kirkwood.dtsi          |    6 +
>> >  arch/arm/mach-kirkwood/Kconfig           |   14 +++
>> >  arch/arm/mach-kirkwood/Makefile          |    1 +
>> >  arch/arm/mach-kirkwood/Makefile.boot     |    2 +
>> >  arch/arm/mach-kirkwood/board-dt.c        |  182 ++++++++++++++++++++++++++++++
>> >  6 files changed, 223 insertions(+), 0 deletions(-)
>> >  create mode 100644 arch/arm/boot/dts/kirkwood-dreamplug.dts
>> >  create mode 100644 arch/arm/boot/dts/kirkwood.dtsi
>> >  create mode 100644 arch/arm/mach-kirkwood/board-dt.c
>> >
>> > diff --git a/arch/arm/boot/dts/kirkwood-dreamplug.dts b/arch/arm/boot/dts/kirkwood-dreamplug.dts
>> > new file mode 100644
>> > index 0000000..765813f
>> > --- /dev/null
>> > +++ b/arch/arm/boot/dts/kirkwood-dreamplug.dts
>> > @@ -0,0 +1,18 @@
>> > +/dts-v1/;
>> > +
>> > +/include/ "kirkwood.dtsi"
>> > +
>> > +/ {
>> > +       model = "Globalscale Technologies Dreamplug";
>> > +       compatible = "globalscale,dreamplug", "globalscale,kirkwood";
>>
>> Hahaha... okay, more clarification is needed here.
>>
>> The compatible property is a list, and the first entry must always be
>> the exact device model.  That is why the vendor of the hardware is in
>> the prefix.  However, the following entries are a list of devices that
>> it is 'compatible' with.  In the case of the top-level compatible
>> property, we've been using the convention of including a string for
>> the SoC, and in that case the manufacturer is indeed Marvell.
>>
>> Also, *be specific*.  Kirkwood is a family of processors, not a single
>> SoC.  The compatible string should reflect that.  So, in your case,
>> compatible should look something like:
>>
>> compatible = "globalscale,dreamplug", "marvell,kirkwood-88f6281";
>
> ahhh... ok.  So, my board-dt.c should have:
>
> static const char *kirkwood_dt_board_compat[] = {
>        "marvell,kirkwood",
>        NULL
> };
>
> And then the test to run the dreamplug specific init should be:
>
>        if (of_machine_is_compatible("globalscale,dreamplug"))
>                dreamplug_init();
>
> And then, kirkwood.dtsi:
>
> compatible = "marvell,kirkwood";
>
> and kirkwood-dreamplug.dts:
>
> compatible = "globalscale,dreamplug", "marvell,kirkwood-88f6281-a1";
>
>
> My only question is, should the kirkwood.dtsi have just
> "marvell,kirkwood", or "marvell,kirkwood","marvell,kirkwood-88f6281-a1"?

Fix the order.  The list is ordered from most specific to least.
Also, if the silicon revision can be read out of the SoC at runtime,
then including the -a1 revision is probably overkill.

So, something like the following is fine:

compatible = "globalscale,dreamplug", "marvell,kirkwood-88f6281",
"marvell,kirkwood";

BTW, does the dreamplug have a part number?

>
> I'm guessing kirkwood.dtsi is a generic devicetree, and should just be
> "marvell,kirkwood".  If that's true, then *kirkwood_dt_board_compat
> should just be "marvell,kirkwood" since board-dt.c should be able to
> handle any kirkwood SoC.
>
> Sorry for being so dense.
>
> thx,
>
> Jason.



-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.

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

* [PATCH 1/2 v5] arm: kirkwood: add dreamplug (fdt) support.
@ 2012-02-23 21:21             ` Grant Likely
  0 siblings, 0 replies; 76+ messages in thread
From: Grant Likely @ 2012-02-23 21:21 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Feb 23, 2012 at 2:11 PM, Jason <jason@lakedaemon.net> wrote:
> On Thu, Feb 23, 2012 at 01:18:55PM -0700, Grant Likely wrote:
>> On Thu, Feb 23, 2012 at 12:52 PM, Jason Cooper <jason@lakedaemon.net> wrote:
>> > Initially, copied guruplug-setup.c and did s/guruplug/dreamplug/g.
>> > Then, switched to SPI based NOR flash.
>> >
>> > After talking to Arnd Bergman, chose an incremental approach to adding
>> > devicetree support. ?First, we use the dtb to tell us we are on the
>> > dreamplug, then we gradually port over drivers.
>> >
>> > Driver porting will start with the uart (see next patch), and progress
>> > from there. ?Possibly, spi/flash/partitions will be next.
>> >
>> > When done, board-dt.c will no longer be dreamplug specific, and dt's can
>> > be made for the other kirkwood boards.
>> >
>> > Signed-off-by: Jason Cooper <jason@lakedaemon.net>
>> > ---
>> > Changes from v1
>> >
>> > ? - attempting dts, looking for pointers.
>> >
>> > Changes from v2
>> >
>> > ? - resubmit as MACH_TYPE_DREAMPLUG (3550) is in arm/for-next, rebased
>> > ? ? against same.
>> > ? - removed lame fdt attempt, others are working on kirkwood fdt. ?Will
>> > ? ? convert once kirkwood fdt is mainline.
>> > ? - s/boot_params/atag_offset/
>> > ? - added kirkwood_reset
>> > ? - 1 checkpatch.pl warning (help in Kconfig), looks the same as all
>> > ? ? other kirkwood boards...
>> >
>> > Changes from v3
>> >
>> > ? - rebased against v3.3-rc3 (recommended by Arnd)
>> > ? - use devicetree to determine which board we are on
>> > ? - added patch to configure uart0 from devicetree
>> >
>> > Changes from v4
>> >
>> > ? - fixed Kconfig logic so user can always see 'Dreamplug' in menuconfig.
>> > ? - changed 'marvell,dreamplug' to 'globalscale,dreamplug' as suggested by
>> > ? ? Grant Likely.
>> > ? - fixed of_machine_is_compatible() logic for calling dreamplug specific
>> > ? ? init functions.
>> >
>> > ?arch/arm/boot/dts/kirkwood-dreamplug.dts | ? 18 +++
>> > ?arch/arm/boot/dts/kirkwood.dtsi ? ? ? ? ?| ? ?6 +
>> > ?arch/arm/mach-kirkwood/Kconfig ? ? ? ? ? | ? 14 +++
>> > ?arch/arm/mach-kirkwood/Makefile ? ? ? ? ?| ? ?1 +
>> > ?arch/arm/mach-kirkwood/Makefile.boot ? ? | ? ?2 +
>> > ?arch/arm/mach-kirkwood/board-dt.c ? ? ? ?| ?182 ++++++++++++++++++++++++++++++
>> > ?6 files changed, 223 insertions(+), 0 deletions(-)
>> > ?create mode 100644 arch/arm/boot/dts/kirkwood-dreamplug.dts
>> > ?create mode 100644 arch/arm/boot/dts/kirkwood.dtsi
>> > ?create mode 100644 arch/arm/mach-kirkwood/board-dt.c
>> >
>> > diff --git a/arch/arm/boot/dts/kirkwood-dreamplug.dts b/arch/arm/boot/dts/kirkwood-dreamplug.dts
>> > new file mode 100644
>> > index 0000000..765813f
>> > --- /dev/null
>> > +++ b/arch/arm/boot/dts/kirkwood-dreamplug.dts
>> > @@ -0,0 +1,18 @@
>> > +/dts-v1/;
>> > +
>> > +/include/ "kirkwood.dtsi"
>> > +
>> > +/ {
>> > + ? ? ? model = "Globalscale Technologies Dreamplug";
>> > + ? ? ? compatible = "globalscale,dreamplug", "globalscale,kirkwood";
>>
>> Hahaha... okay, more clarification is needed here.
>>
>> The compatible property is a list, and the first entry must always be
>> the exact device model. ?That is why the vendor of the hardware is in
>> the prefix. ?However, the following entries are a list of devices that
>> it is 'compatible' with. ?In the case of the top-level compatible
>> property, we've been using the convention of including a string for
>> the SoC, and in that case the manufacturer is indeed Marvell.
>>
>> Also, *be specific*. ?Kirkwood is a family of processors, not a single
>> SoC. ?The compatible string should reflect that. ?So, in your case,
>> compatible should look something like:
>>
>> compatible = "globalscale,dreamplug", "marvell,kirkwood-88f6281";
>
> ahhh... ok. ?So, my board-dt.c should have:
>
> static const char *kirkwood_dt_board_compat[] = {
> ? ? ? ?"marvell,kirkwood",
> ? ? ? ?NULL
> };
>
> And then the test to run the dreamplug specific init should be:
>
> ? ? ? ?if (of_machine_is_compatible("globalscale,dreamplug"))
> ? ? ? ? ? ? ? ?dreamplug_init();
>
> And then, kirkwood.dtsi:
>
> compatible = "marvell,kirkwood";
>
> and kirkwood-dreamplug.dts:
>
> compatible = "globalscale,dreamplug", "marvell,kirkwood-88f6281-a1";
>
>
> My only question is, should the kirkwood.dtsi have just
> "marvell,kirkwood", or "marvell,kirkwood","marvell,kirkwood-88f6281-a1"?

Fix the order.  The list is ordered from most specific to least.
Also, if the silicon revision can be read out of the SoC at runtime,
then including the -a1 revision is probably overkill.

So, something like the following is fine:

compatible = "globalscale,dreamplug", "marvell,kirkwood-88f6281",
"marvell,kirkwood";

BTW, does the dreamplug have a part number?

>
> I'm guessing kirkwood.dtsi is a generic devicetree, and should just be
> "marvell,kirkwood". ?If that's true, then *kirkwood_dt_board_compat
> should just be "marvell,kirkwood" since board-dt.c should be able to
> handle any kirkwood SoC.
>
> Sorry for being so dense.
>
> thx,
>
> Jason.



-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.

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

* Re: [PATCH 1/2 v5] arm: kirkwood: add dreamplug (fdt) support.
  2012-02-23 21:21             ` Grant Likely
@ 2012-02-24 14:35               ` Jason
  -1 siblings, 0 replies; 76+ messages in thread
From: Jason @ 2012-02-24 14:35 UTC (permalink / raw)
  To: Grant Likely; +Cc: devicetree-discuss, arnd, linux-arm-kernel

On Thu, Feb 23, 2012 at 02:21:15PM -0700, Grant Likely wrote:
> On Thu, Feb 23, 2012 at 2:11 PM, Jason <jason@lakedaemon.net> wrote:
> > On Thu, Feb 23, 2012 at 01:18:55PM -0700, Grant Likely wrote:
> >> On Thu, Feb 23, 2012 at 12:52 PM, Jason Cooper <jason@lakedaemon.net> wrote:
> >> > Initially, copied guruplug-setup.c and did s/guruplug/dreamplug/g.
> >> > Then, switched to SPI based NOR flash.
> >> >
> >> > After talking to Arnd Bergman, chose an incremental approach to adding
> >> > devicetree support.  First, we use the dtb to tell us we are on the
> >> > dreamplug, then we gradually port over drivers.
> >> >
> >> > Driver porting will start with the uart (see next patch), and progress
> >> > from there.  Possibly, spi/flash/partitions will be next.
> >> >
> >> > When done, board-dt.c will no longer be dreamplug specific, and dt's can
> >> > be made for the other kirkwood boards.
> >> >
> >> > Signed-off-by: Jason Cooper <jason@lakedaemon.net>
> >> > ---
> >> > Changes from v1
> >> >
> >> >   - attempting dts, looking for pointers.
> >> >
> >> > Changes from v2
> >> >
> >> >   - resubmit as MACH_TYPE_DREAMPLUG (3550) is in arm/for-next, rebased
> >> >     against same.
> >> >   - removed lame fdt attempt, others are working on kirkwood fdt.  Will
> >> >     convert once kirkwood fdt is mainline.
> >> >   - s/boot_params/atag_offset/
> >> >   - added kirkwood_reset
> >> >   - 1 checkpatch.pl warning (help in Kconfig), looks the same as all
> >> >     other kirkwood boards...
> >> >
> >> > Changes from v3
> >> >
> >> >   - rebased against v3.3-rc3 (recommended by Arnd)
> >> >   - use devicetree to determine which board we are on
> >> >   - added patch to configure uart0 from devicetree
> >> >
> >> > Changes from v4
> >> >
> >> >   - fixed Kconfig logic so user can always see 'Dreamplug' in menuconfig.
> >> >   - changed 'marvell,dreamplug' to 'globalscale,dreamplug' as suggested by
> >> >     Grant Likely.
> >> >   - fixed of_machine_is_compatible() logic for calling dreamplug specific
> >> >     init functions.
> >> >
> >> >  arch/arm/boot/dts/kirkwood-dreamplug.dts |   18 +++
> >> >  arch/arm/boot/dts/kirkwood.dtsi          |    6 +
> >> >  arch/arm/mach-kirkwood/Kconfig           |   14 +++
> >> >  arch/arm/mach-kirkwood/Makefile          |    1 +
> >> >  arch/arm/mach-kirkwood/Makefile.boot     |    2 +
> >> >  arch/arm/mach-kirkwood/board-dt.c        |  182 ++++++++++++++++++++++++++++++
> >> >  6 files changed, 223 insertions(+), 0 deletions(-)
> >> >  create mode 100644 arch/arm/boot/dts/kirkwood-dreamplug.dts
> >> >  create mode 100644 arch/arm/boot/dts/kirkwood.dtsi
> >> >  create mode 100644 arch/arm/mach-kirkwood/board-dt.c
> >> >
> >> > diff --git a/arch/arm/boot/dts/kirkwood-dreamplug.dts b/arch/arm/boot/dts/kirkwood-dreamplug.dts
> >> > new file mode 100644
> >> > index 0000000..765813f
> >> > --- /dev/null
> >> > +++ b/arch/arm/boot/dts/kirkwood-dreamplug.dts
> >> > @@ -0,0 +1,18 @@
> >> > +/dts-v1/;
> >> > +
> >> > +/include/ "kirkwood.dtsi"
> >> > +
> >> > +/ {
> >> > +       model = "Globalscale Technologies Dreamplug";
> >> > +       compatible = "globalscale,dreamplug", "globalscale,kirkwood";
> >>
> >> Hahaha... okay, more clarification is needed here.
> >>
> >> The compatible property is a list, and the first entry must always be
> >> the exact device model.  That is why the vendor of the hardware is in
> >> the prefix.  However, the following entries are a list of devices that
> >> it is 'compatible' with.  In the case of the top-level compatible
> >> property, we've been using the convention of including a string for
> >> the SoC, and in that case the manufacturer is indeed Marvell.
> >>
> >> Also, *be specific*.  Kirkwood is a family of processors, not a single
> >> SoC.  The compatible string should reflect that.  So, in your case,
> >> compatible should look something like:
> >>
> >> compatible = "globalscale,dreamplug", "marvell,kirkwood-88f6281";
> >
> > ahhh... ok.  So, my board-dt.c should have:
> >
> > static const char *kirkwood_dt_board_compat[] = {
> >        "marvell,kirkwood",
> >        NULL
> > };
> >
> > And then the test to run the dreamplug specific init should be:
> >
> >        if (of_machine_is_compatible("globalscale,dreamplug"))
> >                dreamplug_init();
> >
> > And then, kirkwood.dtsi:
> >
> > compatible = "marvell,kirkwood";
> >
> > and kirkwood-dreamplug.dts:
> >
> > compatible = "globalscale,dreamplug", "marvell,kirkwood-88f6281-a1";
> >
> >
> > My only question is, should the kirkwood.dtsi have just
> > "marvell,kirkwood", or "marvell,kirkwood","marvell,kirkwood-88f6281-a1"?
> 
> Fix the order.  The list is ordered from most specific to least.
> Also, if the silicon revision can be read out of the SoC at runtime,
> then including the -a1 revision is probably overkill.

With kirkwood, it's able to determine the whole SoC part number (see
arch/arm/mach-kirkwood/common.c:394 kirkwood_id()).  So, the kernel
doesn't need to rely on the devicetree to determine which kirkwood it is
at runtime.

I'll include it as you've recommended.  I'd rather stick with convention
until we can prove we need to do otherwise.

> So, something like the following is fine:
> 
> compatible = "globalscale,dreamplug", "marvell,kirkwood-88f6281",
> "marvell,kirkwood";
> 
> BTW, does the dreamplug have a part number?

Yes, so I'll do in kirkwood-dreamplug.dts:

compatible = "globalscale,dreamplug-003-ds2001",
"globalscale,dreamplug", "marvell,kirkwood-88f6281", "marvell,kirkwood"

Thanks for the help

Jason.

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

* [PATCH 1/2 v5] arm: kirkwood: add dreamplug (fdt) support.
@ 2012-02-24 14:35               ` Jason
  0 siblings, 0 replies; 76+ messages in thread
From: Jason @ 2012-02-24 14:35 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Feb 23, 2012 at 02:21:15PM -0700, Grant Likely wrote:
> On Thu, Feb 23, 2012 at 2:11 PM, Jason <jason@lakedaemon.net> wrote:
> > On Thu, Feb 23, 2012 at 01:18:55PM -0700, Grant Likely wrote:
> >> On Thu, Feb 23, 2012 at 12:52 PM, Jason Cooper <jason@lakedaemon.net> wrote:
> >> > Initially, copied guruplug-setup.c and did s/guruplug/dreamplug/g.
> >> > Then, switched to SPI based NOR flash.
> >> >
> >> > After talking to Arnd Bergman, chose an incremental approach to adding
> >> > devicetree support. ?First, we use the dtb to tell us we are on the
> >> > dreamplug, then we gradually port over drivers.
> >> >
> >> > Driver porting will start with the uart (see next patch), and progress
> >> > from there. ?Possibly, spi/flash/partitions will be next.
> >> >
> >> > When done, board-dt.c will no longer be dreamplug specific, and dt's can
> >> > be made for the other kirkwood boards.
> >> >
> >> > Signed-off-by: Jason Cooper <jason@lakedaemon.net>
> >> > ---
> >> > Changes from v1
> >> >
> >> > ? - attempting dts, looking for pointers.
> >> >
> >> > Changes from v2
> >> >
> >> > ? - resubmit as MACH_TYPE_DREAMPLUG (3550) is in arm/for-next, rebased
> >> > ? ? against same.
> >> > ? - removed lame fdt attempt, others are working on kirkwood fdt. ?Will
> >> > ? ? convert once kirkwood fdt is mainline.
> >> > ? - s/boot_params/atag_offset/
> >> > ? - added kirkwood_reset
> >> > ? - 1 checkpatch.pl warning (help in Kconfig), looks the same as all
> >> > ? ? other kirkwood boards...
> >> >
> >> > Changes from v3
> >> >
> >> > ? - rebased against v3.3-rc3 (recommended by Arnd)
> >> > ? - use devicetree to determine which board we are on
> >> > ? - added patch to configure uart0 from devicetree
> >> >
> >> > Changes from v4
> >> >
> >> > ? - fixed Kconfig logic so user can always see 'Dreamplug' in menuconfig.
> >> > ? - changed 'marvell,dreamplug' to 'globalscale,dreamplug' as suggested by
> >> > ? ? Grant Likely.
> >> > ? - fixed of_machine_is_compatible() logic for calling dreamplug specific
> >> > ? ? init functions.
> >> >
> >> > ?arch/arm/boot/dts/kirkwood-dreamplug.dts | ? 18 +++
> >> > ?arch/arm/boot/dts/kirkwood.dtsi ? ? ? ? ?| ? ?6 +
> >> > ?arch/arm/mach-kirkwood/Kconfig ? ? ? ? ? | ? 14 +++
> >> > ?arch/arm/mach-kirkwood/Makefile ? ? ? ? ?| ? ?1 +
> >> > ?arch/arm/mach-kirkwood/Makefile.boot ? ? | ? ?2 +
> >> > ?arch/arm/mach-kirkwood/board-dt.c ? ? ? ?| ?182 ++++++++++++++++++++++++++++++
> >> > ?6 files changed, 223 insertions(+), 0 deletions(-)
> >> > ?create mode 100644 arch/arm/boot/dts/kirkwood-dreamplug.dts
> >> > ?create mode 100644 arch/arm/boot/dts/kirkwood.dtsi
> >> > ?create mode 100644 arch/arm/mach-kirkwood/board-dt.c
> >> >
> >> > diff --git a/arch/arm/boot/dts/kirkwood-dreamplug.dts b/arch/arm/boot/dts/kirkwood-dreamplug.dts
> >> > new file mode 100644
> >> > index 0000000..765813f
> >> > --- /dev/null
> >> > +++ b/arch/arm/boot/dts/kirkwood-dreamplug.dts
> >> > @@ -0,0 +1,18 @@
> >> > +/dts-v1/;
> >> > +
> >> > +/include/ "kirkwood.dtsi"
> >> > +
> >> > +/ {
> >> > + ? ? ? model = "Globalscale Technologies Dreamplug";
> >> > + ? ? ? compatible = "globalscale,dreamplug", "globalscale,kirkwood";
> >>
> >> Hahaha... okay, more clarification is needed here.
> >>
> >> The compatible property is a list, and the first entry must always be
> >> the exact device model. ?That is why the vendor of the hardware is in
> >> the prefix. ?However, the following entries are a list of devices that
> >> it is 'compatible' with. ?In the case of the top-level compatible
> >> property, we've been using the convention of including a string for
> >> the SoC, and in that case the manufacturer is indeed Marvell.
> >>
> >> Also, *be specific*. ?Kirkwood is a family of processors, not a single
> >> SoC. ?The compatible string should reflect that. ?So, in your case,
> >> compatible should look something like:
> >>
> >> compatible = "globalscale,dreamplug", "marvell,kirkwood-88f6281";
> >
> > ahhh... ok. ?So, my board-dt.c should have:
> >
> > static const char *kirkwood_dt_board_compat[] = {
> > ? ? ? ?"marvell,kirkwood",
> > ? ? ? ?NULL
> > };
> >
> > And then the test to run the dreamplug specific init should be:
> >
> > ? ? ? ?if (of_machine_is_compatible("globalscale,dreamplug"))
> > ? ? ? ? ? ? ? ?dreamplug_init();
> >
> > And then, kirkwood.dtsi:
> >
> > compatible = "marvell,kirkwood";
> >
> > and kirkwood-dreamplug.dts:
> >
> > compatible = "globalscale,dreamplug", "marvell,kirkwood-88f6281-a1";
> >
> >
> > My only question is, should the kirkwood.dtsi have just
> > "marvell,kirkwood", or "marvell,kirkwood","marvell,kirkwood-88f6281-a1"?
> 
> Fix the order.  The list is ordered from most specific to least.
> Also, if the silicon revision can be read out of the SoC at runtime,
> then including the -a1 revision is probably overkill.

With kirkwood, it's able to determine the whole SoC part number (see
arch/arm/mach-kirkwood/common.c:394 kirkwood_id()).  So, the kernel
doesn't need to rely on the devicetree to determine which kirkwood it is
at runtime.

I'll include it as you've recommended.  I'd rather stick with convention
until we can prove we need to do otherwise.

> So, something like the following is fine:
> 
> compatible = "globalscale,dreamplug", "marvell,kirkwood-88f6281",
> "marvell,kirkwood";
> 
> BTW, does the dreamplug have a part number?

Yes, so I'll do in kirkwood-dreamplug.dts:

compatible = "globalscale,dreamplug-003-ds2001",
"globalscale,dreamplug", "marvell,kirkwood-88f6281", "marvell,kirkwood"

Thanks for the help

Jason.

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

* Re: [PATCH 1/2 v5] arm: kirkwood: add dreamplug (fdt) support.
  2012-02-23 21:21             ` Grant Likely
@ 2012-02-24 19:36                 ` Jason
  -1 siblings, 0 replies; 76+ messages in thread
From: Jason @ 2012-02-24 19:36 UTC (permalink / raw)
  To: Grant Likely
  Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On Thu, Feb 23, 2012 at 02:21:15PM -0700, Grant Likely wrote:
> On Thu, Feb 23, 2012 at 2:11 PM, Jason <jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org> wrote:
> > On Thu, Feb 23, 2012 at 01:18:55PM -0700, Grant Likely wrote:
> >> On Thu, Feb 23, 2012 at 12:52 PM, Jason Cooper <jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org> wrote:
> >> > Initially, copied guruplug-setup.c and did s/guruplug/dreamplug/g.
> >> > Then, switched to SPI based NOR flash.
> >> >
> >> > After talking to Arnd Bergman, chose an incremental approach to adding
> >> > devicetree support.  First, we use the dtb to tell us we are on the
> >> > dreamplug, then we gradually port over drivers.
> >> >
> >> > Driver porting will start with the uart (see next patch), and progress
> >> > from there.  Possibly, spi/flash/partitions will be next.
> >> >
> >> > When done, board-dt.c will no longer be dreamplug specific, and dt's can
> >> > be made for the other kirkwood boards.
> >> >
> >> > Signed-off-by: Jason Cooper <jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org>
> >> > ---
> >> > Changes from v1
> >> >
> >> >   - attempting dts, looking for pointers.
> >> >
> >> > Changes from v2
> >> >
> >> >   - resubmit as MACH_TYPE_DREAMPLUG (3550) is in arm/for-next, rebased
> >> >     against same.
> >> >   - removed lame fdt attempt, others are working on kirkwood fdt.  Will
> >> >     convert once kirkwood fdt is mainline.
> >> >   - s/boot_params/atag_offset/
> >> >   - added kirkwood_reset
> >> >   - 1 checkpatch.pl warning (help in Kconfig), looks the same as all
> >> >     other kirkwood boards...
> >> >
> >> > Changes from v3
> >> >
> >> >   - rebased against v3.3-rc3 (recommended by Arnd)
> >> >   - use devicetree to determine which board we are on
> >> >   - added patch to configure uart0 from devicetree
> >> >
> >> > Changes from v4
> >> >
> >> >   - fixed Kconfig logic so user can always see 'Dreamplug' in menuconfig.
> >> >   - changed 'marvell,dreamplug' to 'globalscale,dreamplug' as suggested by
> >> >     Grant Likely.
> >> >   - fixed of_machine_is_compatible() logic for calling dreamplug specific
> >> >     init functions.
> >> >
> >> >  arch/arm/boot/dts/kirkwood-dreamplug.dts |   18 +++
> >> >  arch/arm/boot/dts/kirkwood.dtsi          |    6 +
> >> >  arch/arm/mach-kirkwood/Kconfig           |   14 +++
> >> >  arch/arm/mach-kirkwood/Makefile          |    1 +
> >> >  arch/arm/mach-kirkwood/Makefile.boot     |    2 +
> >> >  arch/arm/mach-kirkwood/board-dt.c        |  182 ++++++++++++++++++++++++++++++
> >> >  6 files changed, 223 insertions(+), 0 deletions(-)
> >> >  create mode 100644 arch/arm/boot/dts/kirkwood-dreamplug.dts
> >> >  create mode 100644 arch/arm/boot/dts/kirkwood.dtsi
> >> >  create mode 100644 arch/arm/mach-kirkwood/board-dt.c
> >> >
> >> > diff --git a/arch/arm/boot/dts/kirkwood-dreamplug.dts b/arch/arm/boot/dts/kirkwood-dreamplug.dts
> >> > new file mode 100644
> >> > index 0000000..765813f
> >> > --- /dev/null
> >> > +++ b/arch/arm/boot/dts/kirkwood-dreamplug.dts
> >> > @@ -0,0 +1,18 @@
> >> > +/dts-v1/;
> >> > +
> >> > +/include/ "kirkwood.dtsi"
> >> > +
> >> > +/ {
> >> > +       model = "Globalscale Technologies Dreamplug";
> >> > +       compatible = "globalscale,dreamplug", "globalscale,kirkwood";
> >>
> >> Hahaha... okay, more clarification is needed here.
> >>
> >> The compatible property is a list, and the first entry must always be
> >> the exact device model.  That is why the vendor of the hardware is in
> >> the prefix.  However, the following entries are a list of devices that
> >> it is 'compatible' with.  In the case of the top-level compatible
> >> property, we've been using the convention of including a string for
> >> the SoC, and in that case the manufacturer is indeed Marvell.
> >>
> >> Also, *be specific*.  Kirkwood is a family of processors, not a single
> >> SoC.  The compatible string should reflect that.  So, in your case,
> >> compatible should look something like:
> >>
> >> compatible = "globalscale,dreamplug", "marvell,kirkwood-88f6281";
> >
> > ahhh... ok.  So, my board-dt.c should have:
> >
> > static const char *kirkwood_dt_board_compat[] = {
> >        "marvell,kirkwood",
> >        NULL
> > };
> >
> > And then the test to run the dreamplug specific init should be:
> >
> >        if (of_machine_is_compatible("globalscale,dreamplug"))
> >                dreamplug_init();
> >
> > And then, kirkwood.dtsi:
> >
> > compatible = "marvell,kirkwood";
> >
> > and kirkwood-dreamplug.dts:
> >
> > compatible = "globalscale,dreamplug", "marvell,kirkwood-88f6281-a1";
> >
> >
> > My only question is, should the kirkwood.dtsi have just
> > "marvell,kirkwood", or "marvell,kirkwood","marvell,kirkwood-88f6281-a1"?
> 
> Fix the order.  The list is ordered from most specific to least.
> Also, if the silicon revision can be read out of the SoC at runtime,
> then including the -a1 revision is probably overkill.

With kirkwood, it's able to determine the whole SoC part number (see
arch/arm/mach-kirkwood/common.c:394 kirkwood_id()).  So, the kernel
doesn't need to rely on the devicetree to determine which kirkwood it is
at runtime.

I'll include it as you've recommended.  I'd rather stick with convention
until we can prove we need to do otherwise.

> So, something like the following is fine:
> 
> compatible = "globalscale,dreamplug", "marvell,kirkwood-88f6281",
> "marvell,kirkwood";
> 
> BTW, does the dreamplug have a part number?

Yes, so I'll do in kirkwood-dreamplug.dts:

compatible = "globalscale,dreamplug-003-ds2001",
"globalscale,dreamplug", "marvell,kirkwood-88f6281", "marvell,kirkwood"

Thanks for the help

Jason.

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

* [PATCH 1/2 v5] arm: kirkwood: add dreamplug (fdt) support.
@ 2012-02-24 19:36                 ` Jason
  0 siblings, 0 replies; 76+ messages in thread
From: Jason @ 2012-02-24 19:36 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Feb 23, 2012 at 02:21:15PM -0700, Grant Likely wrote:
> On Thu, Feb 23, 2012 at 2:11 PM, Jason <jason@lakedaemon.net> wrote:
> > On Thu, Feb 23, 2012 at 01:18:55PM -0700, Grant Likely wrote:
> >> On Thu, Feb 23, 2012 at 12:52 PM, Jason Cooper <jason@lakedaemon.net> wrote:
> >> > Initially, copied guruplug-setup.c and did s/guruplug/dreamplug/g.
> >> > Then, switched to SPI based NOR flash.
> >> >
> >> > After talking to Arnd Bergman, chose an incremental approach to adding
> >> > devicetree support. ?First, we use the dtb to tell us we are on the
> >> > dreamplug, then we gradually port over drivers.
> >> >
> >> > Driver porting will start with the uart (see next patch), and progress
> >> > from there. ?Possibly, spi/flash/partitions will be next.
> >> >
> >> > When done, board-dt.c will no longer be dreamplug specific, and dt's can
> >> > be made for the other kirkwood boards.
> >> >
> >> > Signed-off-by: Jason Cooper <jason@lakedaemon.net>
> >> > ---
> >> > Changes from v1
> >> >
> >> > ? - attempting dts, looking for pointers.
> >> >
> >> > Changes from v2
> >> >
> >> > ? - resubmit as MACH_TYPE_DREAMPLUG (3550) is in arm/for-next, rebased
> >> > ? ? against same.
> >> > ? - removed lame fdt attempt, others are working on kirkwood fdt. ?Will
> >> > ? ? convert once kirkwood fdt is mainline.
> >> > ? - s/boot_params/atag_offset/
> >> > ? - added kirkwood_reset
> >> > ? - 1 checkpatch.pl warning (help in Kconfig), looks the same as all
> >> > ? ? other kirkwood boards...
> >> >
> >> > Changes from v3
> >> >
> >> > ? - rebased against v3.3-rc3 (recommended by Arnd)
> >> > ? - use devicetree to determine which board we are on
> >> > ? - added patch to configure uart0 from devicetree
> >> >
> >> > Changes from v4
> >> >
> >> > ? - fixed Kconfig logic so user can always see 'Dreamplug' in menuconfig.
> >> > ? - changed 'marvell,dreamplug' to 'globalscale,dreamplug' as suggested by
> >> > ? ? Grant Likely.
> >> > ? - fixed of_machine_is_compatible() logic for calling dreamplug specific
> >> > ? ? init functions.
> >> >
> >> > ?arch/arm/boot/dts/kirkwood-dreamplug.dts | ? 18 +++
> >> > ?arch/arm/boot/dts/kirkwood.dtsi ? ? ? ? ?| ? ?6 +
> >> > ?arch/arm/mach-kirkwood/Kconfig ? ? ? ? ? | ? 14 +++
> >> > ?arch/arm/mach-kirkwood/Makefile ? ? ? ? ?| ? ?1 +
> >> > ?arch/arm/mach-kirkwood/Makefile.boot ? ? | ? ?2 +
> >> > ?arch/arm/mach-kirkwood/board-dt.c ? ? ? ?| ?182 ++++++++++++++++++++++++++++++
> >> > ?6 files changed, 223 insertions(+), 0 deletions(-)
> >> > ?create mode 100644 arch/arm/boot/dts/kirkwood-dreamplug.dts
> >> > ?create mode 100644 arch/arm/boot/dts/kirkwood.dtsi
> >> > ?create mode 100644 arch/arm/mach-kirkwood/board-dt.c
> >> >
> >> > diff --git a/arch/arm/boot/dts/kirkwood-dreamplug.dts b/arch/arm/boot/dts/kirkwood-dreamplug.dts
> >> > new file mode 100644
> >> > index 0000000..765813f
> >> > --- /dev/null
> >> > +++ b/arch/arm/boot/dts/kirkwood-dreamplug.dts
> >> > @@ -0,0 +1,18 @@
> >> > +/dts-v1/;
> >> > +
> >> > +/include/ "kirkwood.dtsi"
> >> > +
> >> > +/ {
> >> > + ? ? ? model = "Globalscale Technologies Dreamplug";
> >> > + ? ? ? compatible = "globalscale,dreamplug", "globalscale,kirkwood";
> >>
> >> Hahaha... okay, more clarification is needed here.
> >>
> >> The compatible property is a list, and the first entry must always be
> >> the exact device model. ?That is why the vendor of the hardware is in
> >> the prefix. ?However, the following entries are a list of devices that
> >> it is 'compatible' with. ?In the case of the top-level compatible
> >> property, we've been using the convention of including a string for
> >> the SoC, and in that case the manufacturer is indeed Marvell.
> >>
> >> Also, *be specific*. ?Kirkwood is a family of processors, not a single
> >> SoC. ?The compatible string should reflect that. ?So, in your case,
> >> compatible should look something like:
> >>
> >> compatible = "globalscale,dreamplug", "marvell,kirkwood-88f6281";
> >
> > ahhh... ok. ?So, my board-dt.c should have:
> >
> > static const char *kirkwood_dt_board_compat[] = {
> > ? ? ? ?"marvell,kirkwood",
> > ? ? ? ?NULL
> > };
> >
> > And then the test to run the dreamplug specific init should be:
> >
> > ? ? ? ?if (of_machine_is_compatible("globalscale,dreamplug"))
> > ? ? ? ? ? ? ? ?dreamplug_init();
> >
> > And then, kirkwood.dtsi:
> >
> > compatible = "marvell,kirkwood";
> >
> > and kirkwood-dreamplug.dts:
> >
> > compatible = "globalscale,dreamplug", "marvell,kirkwood-88f6281-a1";
> >
> >
> > My only question is, should the kirkwood.dtsi have just
> > "marvell,kirkwood", or "marvell,kirkwood","marvell,kirkwood-88f6281-a1"?
> 
> Fix the order.  The list is ordered from most specific to least.
> Also, if the silicon revision can be read out of the SoC at runtime,
> then including the -a1 revision is probably overkill.

With kirkwood, it's able to determine the whole SoC part number (see
arch/arm/mach-kirkwood/common.c:394 kirkwood_id()).  So, the kernel
doesn't need to rely on the devicetree to determine which kirkwood it is
at runtime.

I'll include it as you've recommended.  I'd rather stick with convention
until we can prove we need to do otherwise.

> So, something like the following is fine:
> 
> compatible = "globalscale,dreamplug", "marvell,kirkwood-88f6281",
> "marvell,kirkwood";
> 
> BTW, does the dreamplug have a part number?

Yes, so I'll do in kirkwood-dreamplug.dts:

compatible = "globalscale,dreamplug-003-ds2001",
"globalscale,dreamplug", "marvell,kirkwood-88f6281", "marvell,kirkwood"

Thanks for the help

Jason.

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

* Re: [PATCH 0/2 v5] arm: kirkwood: add dreamplug/devicetree support
  2012-02-23 19:52   ` Jason Cooper
@ 2012-02-26 11:00     ` Ian Campbell
  -1 siblings, 0 replies; 76+ messages in thread
From: Ian Campbell @ 2012-02-26 11:00 UTC (permalink / raw)
  To: Jason Cooper; +Cc: grant.likely, devicetree-discuss, linux-arm-kernel, arnd

On Thu, 2012-02-23 at 19:52 +0000, Jason Cooper wrote:
> This patch series provides initial support for devicetree on kirkwood for the
> dreamplug platform.  After discussing the approach with Arnd Bergman last week
> at ELC, we decided to take an incremental approach to the conversion.  First, I
> would detect that we were on the dreamplug via the devicetree blob.  Then,
> configure uart0 via devicetree.  We chose the uart since it is already well
> supported under devicetree.
> 
> This patch series has been boot-tested on the dreamplug.

Tested-by: Ian Campbell <ijc@hellion.org.uk>

I needed the following (obvious) patch against u-boot:

diff --git a/include/configs/dreamplug.h b/include/configs/dreamplug.h
index 0f2f9a2..76f9eea 100644
--- a/include/configs/dreamplug.h
+++ b/include/configs/dreamplug.h
@@ -148,4 +148,6 @@
  */
 #define CONFIG_DISPLAY_CPUINFO
 
+#define CONFIG_OF_LIBFDT
+
 #endif /* _CONFIG_DREAMPLUG_H */


Ian.

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

* [PATCH 0/2 v5] arm: kirkwood: add dreamplug/devicetree support
@ 2012-02-26 11:00     ` Ian Campbell
  0 siblings, 0 replies; 76+ messages in thread
From: Ian Campbell @ 2012-02-26 11:00 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, 2012-02-23 at 19:52 +0000, Jason Cooper wrote:
> This patch series provides initial support for devicetree on kirkwood for the
> dreamplug platform.  After discussing the approach with Arnd Bergman last week
> at ELC, we decided to take an incremental approach to the conversion.  First, I
> would detect that we were on the dreamplug via the devicetree blob.  Then,
> configure uart0 via devicetree.  We chose the uart since it is already well
> supported under devicetree.
> 
> This patch series has been boot-tested on the dreamplug.

Tested-by: Ian Campbell <ijc@hellion.org.uk>

I needed the following (obvious) patch against u-boot:

diff --git a/include/configs/dreamplug.h b/include/configs/dreamplug.h
index 0f2f9a2..76f9eea 100644
--- a/include/configs/dreamplug.h
+++ b/include/configs/dreamplug.h
@@ -148,4 +148,6 @@
  */
 #define CONFIG_DISPLAY_CPUINFO
 
+#define CONFIG_OF_LIBFDT
+
 #endif /* _CONFIG_DREAMPLUG_H */


Ian.

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

* Re: [PATCH 0/2 v5] arm: kirkwood: add dreamplug/devicetree support
  2012-02-26 11:00     ` Ian Campbell
@ 2012-02-27 14:57         ` Jason
  -1 siblings, 0 replies; 76+ messages in thread
From: Jason @ 2012-02-27 14:57 UTC (permalink / raw)
  To: Ian Campbell
  Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On Sun, Feb 26, 2012 at 11:00:38AM +0000, Ian Campbell wrote:
> On Thu, 2012-02-23 at 19:52 +0000, Jason Cooper wrote:
> > This patch series provides initial support for devicetree on kirkwood for the
> > dreamplug platform.  After discussing the approach with Arnd Bergman last week
> > at ELC, we decided to take an incremental approach to the conversion.  First, I
> > would detect that we were on the dreamplug via the devicetree blob.  Then,
> > configure uart0 via devicetree.  We chose the uart since it is already well
> > supported under devicetree.
> > 
> > This patch series has been boot-tested on the dreamplug.
> 
> Tested-by: Ian Campbell <ijc-KcIKpvwj1kUDXYZnReoRVg@public.gmane.org>

thanks!

> I needed the following (obvious) patch against u-boot:

yes, I forgot to mention that.  By any chance, have you tested booting
non-fdt kernels from u-boot with this option enabled?  I'm fairly sure
it will work, but I haven't tested it myself.

If you can boot both fdt and non-fdt kernels with this enabled, submit
it to u-boot, CC: Prafulla, and I'll ack it.

thx,

Jason.

> diff --git a/include/configs/dreamplug.h b/include/configs/dreamplug.h
> index 0f2f9a2..76f9eea 100644
> --- a/include/configs/dreamplug.h
> +++ b/include/configs/dreamplug.h
> @@ -148,4 +148,6 @@
>   */
>  #define CONFIG_DISPLAY_CPUINFO
>  
> +#define CONFIG_OF_LIBFDT
> +
>  #endif /* _CONFIG_DREAMPLUG_H */
> 
> 
> Ian.
> 
> 

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

* [PATCH 0/2 v5] arm: kirkwood: add dreamplug/devicetree support
@ 2012-02-27 14:57         ` Jason
  0 siblings, 0 replies; 76+ messages in thread
From: Jason @ 2012-02-27 14:57 UTC (permalink / raw)
  To: linux-arm-kernel

On Sun, Feb 26, 2012 at 11:00:38AM +0000, Ian Campbell wrote:
> On Thu, 2012-02-23 at 19:52 +0000, Jason Cooper wrote:
> > This patch series provides initial support for devicetree on kirkwood for the
> > dreamplug platform.  After discussing the approach with Arnd Bergman last week
> > at ELC, we decided to take an incremental approach to the conversion.  First, I
> > would detect that we were on the dreamplug via the devicetree blob.  Then,
> > configure uart0 via devicetree.  We chose the uart since it is already well
> > supported under devicetree.
> > 
> > This patch series has been boot-tested on the dreamplug.
> 
> Tested-by: Ian Campbell <ijc@hellion.org.uk>

thanks!

> I needed the following (obvious) patch against u-boot:

yes, I forgot to mention that.  By any chance, have you tested booting
non-fdt kernels from u-boot with this option enabled?  I'm fairly sure
it will work, but I haven't tested it myself.

If you can boot both fdt and non-fdt kernels with this enabled, submit
it to u-boot, CC: Prafulla, and I'll ack it.

thx,

Jason.

> diff --git a/include/configs/dreamplug.h b/include/configs/dreamplug.h
> index 0f2f9a2..76f9eea 100644
> --- a/include/configs/dreamplug.h
> +++ b/include/configs/dreamplug.h
> @@ -148,4 +148,6 @@
>   */
>  #define CONFIG_DISPLAY_CPUINFO
>  
> +#define CONFIG_OF_LIBFDT
> +
>  #endif /* _CONFIG_DREAMPLUG_H */
> 
> 
> Ian.
> 
> 

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

* [PATCH 0/2 v6] arm: kirkwood: add dreamplug/devicetree support
  2011-08-09 16:47 [PATCH 0/3 v2] RFC: marvell dreamplug dft support Jason Cooper
@ 2012-02-27 16:07     ` Jason Cooper
  2011-08-09 16:47 ` [PATCH 2/3 v2] RFC: arm/kirkwood: add dreamplug support Jason Cooper
                       ` (11 subsequent siblings)
  12 siblings, 0 replies; 76+ messages in thread
From: Jason Cooper @ 2012-02-27 16:07 UTC (permalink / raw)
  To: arnd-r2nGTMty4D4, grant.likely-s3s/WqlpOiPyB63q8FvJNQ
  Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ, Jason Cooper,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

This patch series provides initial support for devicetree on kirkwood for the
dreamplug platform.  After discussing the approach with Arnd Bergman last week
at ELC, we decided to take an incremental approach to the conversion.  First, I
would detect that we were on the dreamplug via the devicetree blob.  Then,
configure uart0 via devicetree.  We chose the uart since it is already well
supported under devicetree.

This patch series has been boot-tested on the dreamplug.

In a future patch series, I plan to migrate spi/flash/partitions over to
devicetree.

When the migration is complete, board-dt.c will not be specific to the
dreamplug, and dts files can be written for all of the other kirkwood boards.

Jason Cooper (2):
  arm: kirkwood: add dreamplug (fdt) support.
  arm: kirkwood: convert uart0 to devicetree.

 arch/arm/boot/dts/kirkwood-dreamplug.dts |   25 ++++
 arch/arm/boot/dts/kirkwood.dtsi          |    6 +
 arch/arm/mach-kirkwood/Kconfig           |   14 +++
 arch/arm/mach-kirkwood/Makefile          |    1 +
 arch/arm/mach-kirkwood/Makefile.boot     |    2 +
 arch/arm/mach-kirkwood/board-dt.c        |  180 ++++++++++++++++++++++++++++++
 6 files changed, 228 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/boot/dts/kirkwood-dreamplug.dts
 create mode 100644 arch/arm/boot/dts/kirkwood.dtsi
 create mode 100644 arch/arm/mach-kirkwood/board-dt.c

-- 
1.7.3.4

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

* [PATCH 0/2 v6] arm: kirkwood: add dreamplug/devicetree support
@ 2012-02-27 16:07     ` Jason Cooper
  0 siblings, 0 replies; 76+ messages in thread
From: Jason Cooper @ 2012-02-27 16:07 UTC (permalink / raw)
  To: linux-arm-kernel

This patch series provides initial support for devicetree on kirkwood for the
dreamplug platform.  After discussing the approach with Arnd Bergman last week
at ELC, we decided to take an incremental approach to the conversion.  First, I
would detect that we were on the dreamplug via the devicetree blob.  Then,
configure uart0 via devicetree.  We chose the uart since it is already well
supported under devicetree.

This patch series has been boot-tested on the dreamplug.

In a future patch series, I plan to migrate spi/flash/partitions over to
devicetree.

When the migration is complete, board-dt.c will not be specific to the
dreamplug, and dts files can be written for all of the other kirkwood boards.

Jason Cooper (2):
  arm: kirkwood: add dreamplug (fdt) support.
  arm: kirkwood: convert uart0 to devicetree.

 arch/arm/boot/dts/kirkwood-dreamplug.dts |   25 ++++
 arch/arm/boot/dts/kirkwood.dtsi          |    6 +
 arch/arm/mach-kirkwood/Kconfig           |   14 +++
 arch/arm/mach-kirkwood/Makefile          |    1 +
 arch/arm/mach-kirkwood/Makefile.boot     |    2 +
 arch/arm/mach-kirkwood/board-dt.c        |  180 ++++++++++++++++++++++++++++++
 6 files changed, 228 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/boot/dts/kirkwood-dreamplug.dts
 create mode 100644 arch/arm/boot/dts/kirkwood.dtsi
 create mode 100644 arch/arm/mach-kirkwood/board-dt.c

-- 
1.7.3.4

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

* [PATCH 1/2 v6] arm: kirkwood: add dreamplug (fdt) support.
  2012-02-27 16:07     ` Jason Cooper
@ 2012-02-27 16:07   ` Jason Cooper
  -1 siblings, 0 replies; 76+ messages in thread
From: Jason Cooper @ 2012-02-27 16:07 UTC (permalink / raw)
  To: arnd, grant.likely; +Cc: devicetree-discuss, Jason Cooper, linux-arm-kernel

Initially, copied guruplug-setup.c and did s/guruplug/dreamplug/g.
Then, switched to SPI based NOR flash.

After talking to Arnd Bergman, chose an incremental approach to adding
devicetree support.  First, we use the dtb to tell us we are on the
dreamplug, then we gradually port over drivers.

Driver porting will start with the uart (see next patch), and progress
from there.  Possibly, spi/flash/partitions will be next.

When done, board-dt.c will no longer be dreamplug specific, and dt's can
be made for the other kirkwood boards.

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

   - attempting dts, looking for pointers.

Changes from v2

   - resubmit as MACH_TYPE_DREAMPLUG (3550) is in arm/for-next, rebased
     against same.
   - removed lame fdt attempt, others are working on kirkwood fdt.  Will
     convert once kirkwood fdt is mainline.
   - s/boot_params/atag_offset/
   - added kirkwood_reset
   - 1 checkpatch.pl warning (help in Kconfig), looks the same as all
     other kirkwood boards...

Changes from v3

   - rebased against v3.3-rc3 (recommended by Arnd)
   - use devicetree to determine which board we are on
   - added patch to configure uart0 from devicetree

Changes from v4

   - fixed Kconfig logic so user can always see 'Dreamplug' in menuconfig.
   - changed 'marvell,dreamplug' to 'globalscale,dreamplug' as suggested by
     Grant Likely.
   - fixed of_machine_is_compatible() logic for calling dreamplug specific
     init functions.

Changes from v5

   - fixed compatible property in fdt as clarified by Grant Likely.

 arch/arm/boot/dts/kirkwood-dreamplug.dts |   18 +++
 arch/arm/boot/dts/kirkwood.dtsi          |    6 +
 arch/arm/mach-kirkwood/Kconfig           |   14 +++
 arch/arm/mach-kirkwood/Makefile          |    1 +
 arch/arm/mach-kirkwood/Makefile.boot     |    2 +
 arch/arm/mach-kirkwood/board-dt.c        |  182 ++++++++++++++++++++++++++++++
 6 files changed, 223 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/boot/dts/kirkwood-dreamplug.dts
 create mode 100644 arch/arm/boot/dts/kirkwood.dtsi
 create mode 100644 arch/arm/mach-kirkwood/board-dt.c

diff --git a/arch/arm/boot/dts/kirkwood-dreamplug.dts b/arch/arm/boot/dts/kirkwood-dreamplug.dts
new file mode 100644
index 0000000..0424d99
--- /dev/null
+++ b/arch/arm/boot/dts/kirkwood-dreamplug.dts
@@ -0,0 +1,18 @@
+/dts-v1/;
+
+/include/ "kirkwood.dtsi"
+
+/ {
+	model = "Globalscale Technologies Dreamplug";
+	compatible = "globalscale,dreamplug-003-ds2001", "globalscale,dreamplug", "marvell,kirkwood-88f6281", "marvell,kirkwood";
+
+	memory {
+		device_type = "memory";
+		reg = <0x00000000 0x20000000>;
+	};
+
+	chosen {
+		bootargs = "console=ttyS0,115200n8 earlyprintk";
+	};
+
+};
diff --git a/arch/arm/boot/dts/kirkwood.dtsi b/arch/arm/boot/dts/kirkwood.dtsi
new file mode 100644
index 0000000..771c6bb
--- /dev/null
+++ b/arch/arm/boot/dts/kirkwood.dtsi
@@ -0,0 +1,6 @@
+/include/ "skeleton.dtsi"
+
+/ {
+	compatible = "marvell,kirkwood";
+};
+
diff --git a/arch/arm/mach-kirkwood/Kconfig b/arch/arm/mach-kirkwood/Kconfig
index 7fc603b..90ceab7 100644
--- a/arch/arm/mach-kirkwood/Kconfig
+++ b/arch/arm/mach-kirkwood/Kconfig
@@ -44,6 +44,20 @@ config MACH_GURUPLUG
 	  Say 'Y' here if you want your kernel to support the
 	  Marvell GuruPlug Reference Board.
 
+config ARCH_KIRKWOOD_DT
+	bool "Marvell Kirkwood Flattened Device Tree"
+	select USE_OF
+	help
+	  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_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 5dcaa81..acbc5e1 100644
--- a/arch/arm/mach-kirkwood/Makefile
+++ b/arch/arm/mach-kirkwood/Makefile
@@ -20,3 +20,4 @@ obj-$(CONFIG_MACH_NET5BIG_V2)		+= netxbig_v2-setup.o lacie_v2-common.o
 obj-$(CONFIG_MACH_T5325)		+= t5325-setup.o
 
 obj-$(CONFIG_CPU_IDLE)			+= cpuidle.o
+obj-$(CONFIG_ARCH_KIRKWOOD_DT)		+= board-dt.o
diff --git a/arch/arm/mach-kirkwood/Makefile.boot b/arch/arm/mach-kirkwood/Makefile.boot
index 760a0ef..16f9385 100644
--- a/arch/arm/mach-kirkwood/Makefile.boot
+++ b/arch/arm/mach-kirkwood/Makefile.boot
@@ -1,3 +1,5 @@
    zreladdr-y	+= 0x00008000
 params_phys-y	:= 0x00000100
 initrd_phys-y	:= 0x00800000
+
+dtb-$(CONFIG_MACH_DREAMPLUG_DT) += kirkwood-dreamplug.dtb
diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c
new file mode 100644
index 0000000..76392af
--- /dev/null
+++ b/arch/arm/mach-kirkwood/board-dt.c
@@ -0,0 +1,182 @@
+/*
+ * Copyright 2012 (C), Jason Cooper <jason@lakedaemon.net>
+ *
+ * arch/arm/mach-kirkwood/board-dt.c
+ *
+ * Marvell DreamPlug Reference 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/platform_device.h>
+#include <linux/mtd/partitions.h>
+#include <linux/ata_platform.h>
+#include <linux/mv643xx_eth.h>
+#include <linux/of.h>
+#include <linux/of_address.h>
+#include <linux/of_fdt.h>
+#include <linux/of_irq.h>
+#include <linux/of_platform.h>
+#include <linux/gpio.h>
+#include <linux/leds.h>
+#include <linux/mtd/physmap.h>
+#include <linux/spi/flash.h>
+#include <linux/spi/spi.h>
+#include <linux/spi/orion_spi.h>
+#include <asm/mach-types.h>
+#include <asm/mach/arch.h>
+#include <mach/kirkwood.h>
+#include <plat/mvsdio.h>
+#include "common.h"
+#include "mpp.h"
+
+static struct of_device_id kirkwood_dt_match_table[] __initdata = {
+	{ .compatible = "simple-bus", },
+	{ }
+};
+
+struct mtd_partition dreamplug_partitions[] = {
+	{
+		.name	= "u-boot",
+		.size	= SZ_512K,
+		.offset = 0,
+	},
+	{
+		.name	= "u-boot env",
+		.size	= SZ_64K,
+		.offset = SZ_512K + SZ_512K,
+	},
+	{
+		.name	= "dtb",
+		.size	= SZ_64K,
+		.offset = SZ_512K + SZ_512K + SZ_512K,
+	},
+};
+
+static const struct flash_platform_data dreamplug_spi_slave_data = {
+	.type		= "mx25l1606e",
+	.name		= "spi_flash",
+	.parts		= dreamplug_partitions,
+	.nr_parts	= ARRAY_SIZE(dreamplug_partitions),
+};
+
+static struct spi_board_info __initdata dreamplug_spi_slave_info[] = {
+	{
+		.modalias	= "m25p80",
+		.platform_data	= &dreamplug_spi_slave_data,
+		.irq		= -1,
+		.max_speed_hz	= 50000000,
+		.bus_num	= 0,
+		.chip_select	= 0,
+	},
+};
+
+static struct mv643xx_eth_platform_data dreamplug_ge00_data = {
+	.phy_addr	= MV643XX_ETH_PHY_ADDR(0),
+};
+
+static struct mv643xx_eth_platform_data dreamplug_ge01_data = {
+	.phy_addr	= MV643XX_ETH_PHY_ADDR(1),
+};
+
+static struct mv_sata_platform_data dreamplug_sata_data = {
+	.n_ports	= 1,
+};
+
+static struct mvsdio_platform_data dreamplug_mvsdio_data = {
+	/* unfortunately the CD signal has not been connected */
+};
+
+static struct gpio_led dreamplug_led_pins[] = {
+	{
+		.name			= "dreamplug:blue:bluetooth",
+		.gpio			= 47,
+		.active_low		= 1,
+	},
+	{
+		.name			= "dreamplug:green:wifi",
+		.gpio			= 48,
+		.active_low		= 1,
+	},
+	{
+		.name			= "dreamplug:green:wifi_ap",
+		.gpio			= 49,
+		.active_low		= 1,
+	},
+};
+
+static struct gpio_led_platform_data dreamplug_led_data = {
+	.leds		= dreamplug_led_pins,
+	.num_leds	= ARRAY_SIZE(dreamplug_led_pins),
+};
+
+static struct platform_device dreamplug_leds = {
+	.name	= "leds-gpio",
+	.id	= -1,
+	.dev	= {
+		.platform_data	= &dreamplug_led_data,
+	}
+};
+
+static unsigned int dreamplug_mpp_config[] __initdata = {
+	MPP0_SPI_SCn,
+	MPP1_SPI_MOSI,
+	MPP2_SPI_SCK,
+	MPP3_SPI_MISO,
+	MPP47_GPIO,	/* Bluetooth LED */
+	MPP48_GPIO,	/* Wifi LED */
+	MPP49_GPIO,	/* Wifi AP LED */
+	0
+};
+
+static void __init dreamplug_init(void)
+{
+	/*
+	 * Basic setup. Needs to be called early.
+	 */
+	kirkwood_mpp_conf(dreamplug_mpp_config);
+
+	kirkwood_uart0_init();
+
+	spi_register_board_info(dreamplug_spi_slave_info,
+				ARRAY_SIZE(dreamplug_spi_slave_info));
+	kirkwood_spi_init();
+
+	kirkwood_ehci_init();
+	kirkwood_ge00_init(&dreamplug_ge00_data);
+	kirkwood_ge01_init(&dreamplug_ge01_data);
+	kirkwood_sata_init(&dreamplug_sata_data);
+	kirkwood_sdio_init(&dreamplug_mvsdio_data);
+
+	platform_device_register(&dreamplug_leds);
+}
+
+static void __init kirkwood_dt_init(void)
+{
+	kirkwood_init();
+
+	if (of_machine_is_compatible("globalscale,dreamplug"))
+		dreamplug_init();
+
+	of_platform_populate(NULL, kirkwood_dt_match_table, NULL, NULL);
+}
+
+static const char *kirkwood_dt_board_compat[] = {
+	"globalscale,dreamplug",
+	NULL
+};
+
+DT_MACHINE_START(KIRKWOOD_DT, "Marvell Kirkwood (Flattened Device Tree)")
+	/* Maintainer: Jason Cooper <jason@lakedaemon.net> */
+	.map_io		= kirkwood_map_io,
+	.init_early	= kirkwood_init_early,
+	.init_irq	= kirkwood_init_irq,
+	.timer		= &kirkwood_timer,
+	.init_machine	= kirkwood_dt_init,
+	.restart	= kirkwood_restart,
+	.dt_compat	= kirkwood_dt_board_compat,
+MACHINE_END
-- 
1.7.3.4

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

* [PATCH 1/2 v6] arm: kirkwood: add dreamplug (fdt) support.
@ 2012-02-27 16:07   ` Jason Cooper
  0 siblings, 0 replies; 76+ messages in thread
From: Jason Cooper @ 2012-02-27 16:07 UTC (permalink / raw)
  To: linux-arm-kernel

Initially, copied guruplug-setup.c and did s/guruplug/dreamplug/g.
Then, switched to SPI based NOR flash.

After talking to Arnd Bergman, chose an incremental approach to adding
devicetree support.  First, we use the dtb to tell us we are on the
dreamplug, then we gradually port over drivers.

Driver porting will start with the uart (see next patch), and progress
from there.  Possibly, spi/flash/partitions will be next.

When done, board-dt.c will no longer be dreamplug specific, and dt's can
be made for the other kirkwood boards.

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

   - attempting dts, looking for pointers.

Changes from v2

   - resubmit as MACH_TYPE_DREAMPLUG (3550) is in arm/for-next, rebased
     against same.
   - removed lame fdt attempt, others are working on kirkwood fdt.  Will
     convert once kirkwood fdt is mainline.
   - s/boot_params/atag_offset/
   - added kirkwood_reset
   - 1 checkpatch.pl warning (help in Kconfig), looks the same as all
     other kirkwood boards...

Changes from v3

   - rebased against v3.3-rc3 (recommended by Arnd)
   - use devicetree to determine which board we are on
   - added patch to configure uart0 from devicetree

Changes from v4

   - fixed Kconfig logic so user can always see 'Dreamplug' in menuconfig.
   - changed 'marvell,dreamplug' to 'globalscale,dreamplug' as suggested by
     Grant Likely.
   - fixed of_machine_is_compatible() logic for calling dreamplug specific
     init functions.

Changes from v5

   - fixed compatible property in fdt as clarified by Grant Likely.

 arch/arm/boot/dts/kirkwood-dreamplug.dts |   18 +++
 arch/arm/boot/dts/kirkwood.dtsi          |    6 +
 arch/arm/mach-kirkwood/Kconfig           |   14 +++
 arch/arm/mach-kirkwood/Makefile          |    1 +
 arch/arm/mach-kirkwood/Makefile.boot     |    2 +
 arch/arm/mach-kirkwood/board-dt.c        |  182 ++++++++++++++++++++++++++++++
 6 files changed, 223 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/boot/dts/kirkwood-dreamplug.dts
 create mode 100644 arch/arm/boot/dts/kirkwood.dtsi
 create mode 100644 arch/arm/mach-kirkwood/board-dt.c

diff --git a/arch/arm/boot/dts/kirkwood-dreamplug.dts b/arch/arm/boot/dts/kirkwood-dreamplug.dts
new file mode 100644
index 0000000..0424d99
--- /dev/null
+++ b/arch/arm/boot/dts/kirkwood-dreamplug.dts
@@ -0,0 +1,18 @@
+/dts-v1/;
+
+/include/ "kirkwood.dtsi"
+
+/ {
+	model = "Globalscale Technologies Dreamplug";
+	compatible = "globalscale,dreamplug-003-ds2001", "globalscale,dreamplug", "marvell,kirkwood-88f6281", "marvell,kirkwood";
+
+	memory {
+		device_type = "memory";
+		reg = <0x00000000 0x20000000>;
+	};
+
+	chosen {
+		bootargs = "console=ttyS0,115200n8 earlyprintk";
+	};
+
+};
diff --git a/arch/arm/boot/dts/kirkwood.dtsi b/arch/arm/boot/dts/kirkwood.dtsi
new file mode 100644
index 0000000..771c6bb
--- /dev/null
+++ b/arch/arm/boot/dts/kirkwood.dtsi
@@ -0,0 +1,6 @@
+/include/ "skeleton.dtsi"
+
+/ {
+	compatible = "marvell,kirkwood";
+};
+
diff --git a/arch/arm/mach-kirkwood/Kconfig b/arch/arm/mach-kirkwood/Kconfig
index 7fc603b..90ceab7 100644
--- a/arch/arm/mach-kirkwood/Kconfig
+++ b/arch/arm/mach-kirkwood/Kconfig
@@ -44,6 +44,20 @@ config MACH_GURUPLUG
 	  Say 'Y' here if you want your kernel to support the
 	  Marvell GuruPlug Reference Board.
 
+config ARCH_KIRKWOOD_DT
+	bool "Marvell Kirkwood Flattened Device Tree"
+	select USE_OF
+	help
+	  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_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 5dcaa81..acbc5e1 100644
--- a/arch/arm/mach-kirkwood/Makefile
+++ b/arch/arm/mach-kirkwood/Makefile
@@ -20,3 +20,4 @@ obj-$(CONFIG_MACH_NET5BIG_V2)		+= netxbig_v2-setup.o lacie_v2-common.o
 obj-$(CONFIG_MACH_T5325)		+= t5325-setup.o
 
 obj-$(CONFIG_CPU_IDLE)			+= cpuidle.o
+obj-$(CONFIG_ARCH_KIRKWOOD_DT)		+= board-dt.o
diff --git a/arch/arm/mach-kirkwood/Makefile.boot b/arch/arm/mach-kirkwood/Makefile.boot
index 760a0ef..16f9385 100644
--- a/arch/arm/mach-kirkwood/Makefile.boot
+++ b/arch/arm/mach-kirkwood/Makefile.boot
@@ -1,3 +1,5 @@
    zreladdr-y	+= 0x00008000
 params_phys-y	:= 0x00000100
 initrd_phys-y	:= 0x00800000
+
+dtb-$(CONFIG_MACH_DREAMPLUG_DT) += kirkwood-dreamplug.dtb
diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c
new file mode 100644
index 0000000..76392af
--- /dev/null
+++ b/arch/arm/mach-kirkwood/board-dt.c
@@ -0,0 +1,182 @@
+/*
+ * Copyright 2012 (C), Jason Cooper <jason@lakedaemon.net>
+ *
+ * arch/arm/mach-kirkwood/board-dt.c
+ *
+ * Marvell DreamPlug Reference 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/platform_device.h>
+#include <linux/mtd/partitions.h>
+#include <linux/ata_platform.h>
+#include <linux/mv643xx_eth.h>
+#include <linux/of.h>
+#include <linux/of_address.h>
+#include <linux/of_fdt.h>
+#include <linux/of_irq.h>
+#include <linux/of_platform.h>
+#include <linux/gpio.h>
+#include <linux/leds.h>
+#include <linux/mtd/physmap.h>
+#include <linux/spi/flash.h>
+#include <linux/spi/spi.h>
+#include <linux/spi/orion_spi.h>
+#include <asm/mach-types.h>
+#include <asm/mach/arch.h>
+#include <mach/kirkwood.h>
+#include <plat/mvsdio.h>
+#include "common.h"
+#include "mpp.h"
+
+static struct of_device_id kirkwood_dt_match_table[] __initdata = {
+	{ .compatible = "simple-bus", },
+	{ }
+};
+
+struct mtd_partition dreamplug_partitions[] = {
+	{
+		.name	= "u-boot",
+		.size	= SZ_512K,
+		.offset = 0,
+	},
+	{
+		.name	= "u-boot env",
+		.size	= SZ_64K,
+		.offset = SZ_512K + SZ_512K,
+	},
+	{
+		.name	= "dtb",
+		.size	= SZ_64K,
+		.offset = SZ_512K + SZ_512K + SZ_512K,
+	},
+};
+
+static const struct flash_platform_data dreamplug_spi_slave_data = {
+	.type		= "mx25l1606e",
+	.name		= "spi_flash",
+	.parts		= dreamplug_partitions,
+	.nr_parts	= ARRAY_SIZE(dreamplug_partitions),
+};
+
+static struct spi_board_info __initdata dreamplug_spi_slave_info[] = {
+	{
+		.modalias	= "m25p80",
+		.platform_data	= &dreamplug_spi_slave_data,
+		.irq		= -1,
+		.max_speed_hz	= 50000000,
+		.bus_num	= 0,
+		.chip_select	= 0,
+	},
+};
+
+static struct mv643xx_eth_platform_data dreamplug_ge00_data = {
+	.phy_addr	= MV643XX_ETH_PHY_ADDR(0),
+};
+
+static struct mv643xx_eth_platform_data dreamplug_ge01_data = {
+	.phy_addr	= MV643XX_ETH_PHY_ADDR(1),
+};
+
+static struct mv_sata_platform_data dreamplug_sata_data = {
+	.n_ports	= 1,
+};
+
+static struct mvsdio_platform_data dreamplug_mvsdio_data = {
+	/* unfortunately the CD signal has not been connected */
+};
+
+static struct gpio_led dreamplug_led_pins[] = {
+	{
+		.name			= "dreamplug:blue:bluetooth",
+		.gpio			= 47,
+		.active_low		= 1,
+	},
+	{
+		.name			= "dreamplug:green:wifi",
+		.gpio			= 48,
+		.active_low		= 1,
+	},
+	{
+		.name			= "dreamplug:green:wifi_ap",
+		.gpio			= 49,
+		.active_low		= 1,
+	},
+};
+
+static struct gpio_led_platform_data dreamplug_led_data = {
+	.leds		= dreamplug_led_pins,
+	.num_leds	= ARRAY_SIZE(dreamplug_led_pins),
+};
+
+static struct platform_device dreamplug_leds = {
+	.name	= "leds-gpio",
+	.id	= -1,
+	.dev	= {
+		.platform_data	= &dreamplug_led_data,
+	}
+};
+
+static unsigned int dreamplug_mpp_config[] __initdata = {
+	MPP0_SPI_SCn,
+	MPP1_SPI_MOSI,
+	MPP2_SPI_SCK,
+	MPP3_SPI_MISO,
+	MPP47_GPIO,	/* Bluetooth LED */
+	MPP48_GPIO,	/* Wifi LED */
+	MPP49_GPIO,	/* Wifi AP LED */
+	0
+};
+
+static void __init dreamplug_init(void)
+{
+	/*
+	 * Basic setup. Needs to be called early.
+	 */
+	kirkwood_mpp_conf(dreamplug_mpp_config);
+
+	kirkwood_uart0_init();
+
+	spi_register_board_info(dreamplug_spi_slave_info,
+				ARRAY_SIZE(dreamplug_spi_slave_info));
+	kirkwood_spi_init();
+
+	kirkwood_ehci_init();
+	kirkwood_ge00_init(&dreamplug_ge00_data);
+	kirkwood_ge01_init(&dreamplug_ge01_data);
+	kirkwood_sata_init(&dreamplug_sata_data);
+	kirkwood_sdio_init(&dreamplug_mvsdio_data);
+
+	platform_device_register(&dreamplug_leds);
+}
+
+static void __init kirkwood_dt_init(void)
+{
+	kirkwood_init();
+
+	if (of_machine_is_compatible("globalscale,dreamplug"))
+		dreamplug_init();
+
+	of_platform_populate(NULL, kirkwood_dt_match_table, NULL, NULL);
+}
+
+static const char *kirkwood_dt_board_compat[] = {
+	"globalscale,dreamplug",
+	NULL
+};
+
+DT_MACHINE_START(KIRKWOOD_DT, "Marvell Kirkwood (Flattened Device Tree)")
+	/* Maintainer: Jason Cooper <jason@lakedaemon.net> */
+	.map_io		= kirkwood_map_io,
+	.init_early	= kirkwood_init_early,
+	.init_irq	= kirkwood_init_irq,
+	.timer		= &kirkwood_timer,
+	.init_machine	= kirkwood_dt_init,
+	.restart	= kirkwood_restart,
+	.dt_compat	= kirkwood_dt_board_compat,
+MACHINE_END
-- 
1.7.3.4

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

* [PATCH 2/2 v2] arm: kirkwood: convert uart0 to devicetree.
  2012-02-27 16:07     ` Jason Cooper
@ 2012-02-27 16:07       ` Jason Cooper
  -1 siblings, 0 replies; 76+ messages in thread
From: Jason Cooper @ 2012-02-27 16:07 UTC (permalink / raw)
  To: arnd-r2nGTMty4D4, grant.likely-s3s/WqlpOiPyB63q8FvJNQ
  Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ, Jason Cooper,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

This uart is the primary console for the dreamplug.  Removed
kirkwood_uart0_init() call from board-dt.c.

Signed-off-by: Jason Cooper <jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org>
---
Changes from v1

    - moved serial config from kirkwood.dtsi to kirkwood-dreamplug.dts as
      suggested by Arnd Bergman.

 arch/arm/boot/dts/kirkwood-dreamplug.dts |    7 +++++++
 arch/arm/mach-kirkwood/board-dt.c        |    2 --
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/arch/arm/boot/dts/kirkwood-dreamplug.dts b/arch/arm/boot/dts/kirkwood-dreamplug.dts
index 0424d99..8a5dff8 100644
--- a/arch/arm/boot/dts/kirkwood-dreamplug.dts
+++ b/arch/arm/boot/dts/kirkwood-dreamplug.dts
@@ -15,4 +15,11 @@
 		bootargs = "console=ttyS0,115200n8 earlyprintk";
 	};
 
+	serial@f1012000 {
+		compatible = "ns16550a";
+		reg = <0xf1012000 0xff>;
+		reg-shift = <2>;
+		interrupts = <33>;
+		clock-frequency = <200000000>;
+	};
 };
diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c
index 76392af..fbe6405 100644
--- a/arch/arm/mach-kirkwood/board-dt.c
+++ b/arch/arm/mach-kirkwood/board-dt.c
@@ -140,8 +140,6 @@ static void __init dreamplug_init(void)
 	 */
 	kirkwood_mpp_conf(dreamplug_mpp_config);
 
-	kirkwood_uart0_init();
-
 	spi_register_board_info(dreamplug_spi_slave_info,
 				ARRAY_SIZE(dreamplug_spi_slave_info));
 	kirkwood_spi_init();
-- 
1.7.3.4

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

* [PATCH 2/2 v2] arm: kirkwood: convert uart0 to devicetree.
@ 2012-02-27 16:07       ` Jason Cooper
  0 siblings, 0 replies; 76+ messages in thread
From: Jason Cooper @ 2012-02-27 16:07 UTC (permalink / raw)
  To: linux-arm-kernel

This uart is the primary console for the dreamplug.  Removed
kirkwood_uart0_init() call from board-dt.c.

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

    - moved serial config from kirkwood.dtsi to kirkwood-dreamplug.dts as
      suggested by Arnd Bergman.

 arch/arm/boot/dts/kirkwood-dreamplug.dts |    7 +++++++
 arch/arm/mach-kirkwood/board-dt.c        |    2 --
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/arch/arm/boot/dts/kirkwood-dreamplug.dts b/arch/arm/boot/dts/kirkwood-dreamplug.dts
index 0424d99..8a5dff8 100644
--- a/arch/arm/boot/dts/kirkwood-dreamplug.dts
+++ b/arch/arm/boot/dts/kirkwood-dreamplug.dts
@@ -15,4 +15,11 @@
 		bootargs = "console=ttyS0,115200n8 earlyprintk";
 	};
 
+	serial at f1012000 {
+		compatible = "ns16550a";
+		reg = <0xf1012000 0xff>;
+		reg-shift = <2>;
+		interrupts = <33>;
+		clock-frequency = <200000000>;
+	};
 };
diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c
index 76392af..fbe6405 100644
--- a/arch/arm/mach-kirkwood/board-dt.c
+++ b/arch/arm/mach-kirkwood/board-dt.c
@@ -140,8 +140,6 @@ static void __init dreamplug_init(void)
 	 */
 	kirkwood_mpp_conf(dreamplug_mpp_config);
 
-	kirkwood_uart0_init();
-
 	spi_register_board_info(dreamplug_spi_slave_info,
 				ARRAY_SIZE(dreamplug_spi_slave_info));
 	kirkwood_spi_init();
-- 
1.7.3.4

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

* Re: [PATCH 0/2 v6] arm: kirkwood: add dreamplug/devicetree support
  2012-02-27 16:07     ` Jason Cooper
@ 2012-02-27 16:29       ` Arnd Bergmann
  -1 siblings, 0 replies; 76+ messages in thread
From: Arnd Bergmann @ 2012-02-27 16:29 UTC (permalink / raw)
  To: Jason Cooper
  Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	arm-DgEjT+Ai2ygdnm+yROfE0A,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On Monday 27 February 2012, Jason Cooper wrote:
> This patch series provides initial support for devicetree on kirkwood for the
> dreamplug platform.  After discussing the approach with Arnd Bergman last week
> at ELC, we decided to take an incremental approach to the conversion.  First, I
> would detect that we were on the dreamplug via the devicetree blob.  Then,
> configure uart0 via devicetree.  We chose the uart since it is already well
> supported under devicetree.
> 
> This patch series has been boot-tested on the dreamplug.
> 
> In a future patch series, I plan to migrate spi/flash/partitions over to
> devicetree.
> 
> When the migration is complete, board-dt.c will not be specific to the
> dreamplug, and dts files can be written for all of the other kirkwood boards.
> 
> Jason Cooper (2):
>   arm: kirkwood: add dreamplug (fdt) support.
>   arm: kirkwood: convert uart0 to devicetree.

Applied to the kirkwood/board branch and pulled into next/boards.

Great work!

I've made two trivial manual changes, please do these yourself next time:

1. Subject should start with "ARM: kirkwood:", not "arm: kirkwood:" by
   convention.

2. Nico and I had both replied with "Acked-by:". When you get one of
   these replies, add that line under your "Signed-off-by:" line.

If you have more changes for dreamplug, please submit those on top of
these patches now.

	Arnd

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

* [PATCH 0/2 v6] arm: kirkwood: add dreamplug/devicetree support
@ 2012-02-27 16:29       ` Arnd Bergmann
  0 siblings, 0 replies; 76+ messages in thread
From: Arnd Bergmann @ 2012-02-27 16:29 UTC (permalink / raw)
  To: linux-arm-kernel

On Monday 27 February 2012, Jason Cooper wrote:
> This patch series provides initial support for devicetree on kirkwood for the
> dreamplug platform.  After discussing the approach with Arnd Bergman last week
> at ELC, we decided to take an incremental approach to the conversion.  First, I
> would detect that we were on the dreamplug via the devicetree blob.  Then,
> configure uart0 via devicetree.  We chose the uart since it is already well
> supported under devicetree.
> 
> This patch series has been boot-tested on the dreamplug.
> 
> In a future patch series, I plan to migrate spi/flash/partitions over to
> devicetree.
> 
> When the migration is complete, board-dt.c will not be specific to the
> dreamplug, and dts files can be written for all of the other kirkwood boards.
> 
> Jason Cooper (2):
>   arm: kirkwood: add dreamplug (fdt) support.
>   arm: kirkwood: convert uart0 to devicetree.

Applied to the kirkwood/board branch and pulled into next/boards.

Great work!

I've made two trivial manual changes, please do these yourself next time:

1. Subject should start with "ARM: kirkwood:", not "arm: kirkwood:" by
   convention.

2. Nico and I had both replied with "Acked-by:". When you get one of
   these replies, add that line under your "Signed-off-by:" line.

If you have more changes for dreamplug, please submit those on top of
these patches now.

	Arnd

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

* Re: [PATCH 0/2 v6] arm: kirkwood: add dreamplug/devicetree support
  2012-02-27 16:29       ` Arnd Bergmann
@ 2012-02-27 17:31         ` Jason
  -1 siblings, 0 replies; 76+ messages in thread
From: Jason @ 2012-02-27 17:31 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: grant.likely, devicetree-discuss, arm, linux-arm-kernel

On Mon, Feb 27, 2012 at 04:29:37PM +0000, Arnd Bergmann wrote:
> On Monday 27 February 2012, Jason Cooper wrote:
> > This patch series provides initial support for devicetree on kirkwood for the
> > dreamplug platform.  After discussing the approach with Arnd Bergman last week
> > at ELC, we decided to take an incremental approach to the conversion.  First, I
> > would detect that we were on the dreamplug via the devicetree blob.  Then,
> > configure uart0 via devicetree.  We chose the uart since it is already well
> > supported under devicetree.
> > 
> > This patch series has been boot-tested on the dreamplug.
> > 
> > In a future patch series, I plan to migrate spi/flash/partitions over to
> > devicetree.
> > 
> > When the migration is complete, board-dt.c will not be specific to the
> > dreamplug, and dts files can be written for all of the other kirkwood boards.
> > 
> > Jason Cooper (2):
> >   arm: kirkwood: add dreamplug (fdt) support.
> >   arm: kirkwood: convert uart0 to devicetree.
> 
> Applied to the kirkwood/board branch and pulled into next/boards.
> 
> Great work!

Well, that was easier than I thought.  Thanks.

> I've made two trivial manual changes, please do these yourself next time:
> 
> 1. Subject should start with "ARM: kirkwood:", not "arm: kirkwood:" by
>    convention.

Sorry, will do.

> 2. Nico and I had both replied with "Acked-by:". When you get one of
>    these replies, add that line under your "Signed-off-by:" line.

Ahh, I always wondered how those made the transition.  Will add that to
my process.

> If you have more changes for dreamplug, please submit those on top of
> these patches now.

Okay, SPI coming up next.

thx,

Jason.

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

* [PATCH 0/2 v6] arm: kirkwood: add dreamplug/devicetree support
@ 2012-02-27 17:31         ` Jason
  0 siblings, 0 replies; 76+ messages in thread
From: Jason @ 2012-02-27 17:31 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Feb 27, 2012 at 04:29:37PM +0000, Arnd Bergmann wrote:
> On Monday 27 February 2012, Jason Cooper wrote:
> > This patch series provides initial support for devicetree on kirkwood for the
> > dreamplug platform.  After discussing the approach with Arnd Bergman last week
> > at ELC, we decided to take an incremental approach to the conversion.  First, I
> > would detect that we were on the dreamplug via the devicetree blob.  Then,
> > configure uart0 via devicetree.  We chose the uart since it is already well
> > supported under devicetree.
> > 
> > This patch series has been boot-tested on the dreamplug.
> > 
> > In a future patch series, I plan to migrate spi/flash/partitions over to
> > devicetree.
> > 
> > When the migration is complete, board-dt.c will not be specific to the
> > dreamplug, and dts files can be written for all of the other kirkwood boards.
> > 
> > Jason Cooper (2):
> >   arm: kirkwood: add dreamplug (fdt) support.
> >   arm: kirkwood: convert uart0 to devicetree.
> 
> Applied to the kirkwood/board branch and pulled into next/boards.
> 
> Great work!

Well, that was easier than I thought.  Thanks.

> I've made two trivial manual changes, please do these yourself next time:
> 
> 1. Subject should start with "ARM: kirkwood:", not "arm: kirkwood:" by
>    convention.

Sorry, will do.

> 2. Nico and I had both replied with "Acked-by:". When you get one of
>    these replies, add that line under your "Signed-off-by:" line.

Ahh, I always wondered how those made the transition.  Will add that to
my process.

> If you have more changes for dreamplug, please submit those on top of
> these patches now.

Okay, SPI coming up next.

thx,

Jason.

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

* Re: [PATCH 0/2 v5] arm: kirkwood: add dreamplug/devicetree support
  2012-02-27 14:57         ` Jason
@ 2012-02-28  7:20           ` Ian Campbell
  -1 siblings, 0 replies; 76+ messages in thread
From: Ian Campbell @ 2012-02-28  7:20 UTC (permalink / raw)
  To: Jason; +Cc: grant.likely, devicetree-discuss, linux-arm-kernel, arnd

On Mon, 2012-02-27 at 09:57 -0500, Jason wrote:
> On Sun, Feb 26, 2012 at 11:00:38AM +0000, Ian Campbell wrote:
> > On Thu, 2012-02-23 at 19:52 +0000, Jason Cooper wrote:
> > > This patch series provides initial support for devicetree on kirkwood for the
> > > dreamplug platform.  After discussing the approach with Arnd Bergman last week
> > > at ELC, we decided to take an incremental approach to the conversion.  First, I
> > > would detect that we were on the dreamplug via the devicetree blob.  Then,
> > > configure uart0 via devicetree.  We chose the uart since it is already well
> > > supported under devicetree.
> > > 
> > > This patch series has been boot-tested on the dreamplug.
> > 
> > Tested-by: Ian Campbell <ijc@hellion.org.uk>
> 
> thanks!
> 
> > I needed the following (obvious) patch against u-boot:
> 
> yes, I forgot to mention that.  By any chance, have you tested booting
> non-fdt kernels from u-boot with this option enabled?  I'm fairly sure
> it will work, but I haven't tested it myself.

I hadn't but I have now, it worked fine booting my existing kernel
(which uses v3 of your previous non-FDT dreamplug patches) with the
updated u-boot.

> If you can boot both fdt and non-fdt kernels with this enabled, submit
> it to u-boot, CC: Prafulla, and I'll ack it.

Done.

Thanks,
Ian.

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

* [PATCH 0/2 v5] arm: kirkwood: add dreamplug/devicetree support
@ 2012-02-28  7:20           ` Ian Campbell
  0 siblings, 0 replies; 76+ messages in thread
From: Ian Campbell @ 2012-02-28  7:20 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, 2012-02-27 at 09:57 -0500, Jason wrote:
> On Sun, Feb 26, 2012 at 11:00:38AM +0000, Ian Campbell wrote:
> > On Thu, 2012-02-23 at 19:52 +0000, Jason Cooper wrote:
> > > This patch series provides initial support for devicetree on kirkwood for the
> > > dreamplug platform.  After discussing the approach with Arnd Bergman last week
> > > at ELC, we decided to take an incremental approach to the conversion.  First, I
> > > would detect that we were on the dreamplug via the devicetree blob.  Then,
> > > configure uart0 via devicetree.  We chose the uart since it is already well
> > > supported under devicetree.
> > > 
> > > This patch series has been boot-tested on the dreamplug.
> > 
> > Tested-by: Ian Campbell <ijc@hellion.org.uk>
> 
> thanks!
> 
> > I needed the following (obvious) patch against u-boot:
> 
> yes, I forgot to mention that.  By any chance, have you tested booting
> non-fdt kernels from u-boot with this option enabled?  I'm fairly sure
> it will work, but I haven't tested it myself.

I hadn't but I have now, it worked fine booting my existing kernel
(which uses v3 of your previous non-FDT dreamplug patches) with the
updated u-boot.

> If you can boot both fdt and non-fdt kernels with this enabled, submit
> it to u-boot, CC: Prafulla, and I'll ack it.

Done.

Thanks,
Ian.

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

end of thread, other threads:[~2012-02-28  7:20 UTC | newest]

Thread overview: 76+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-09 16:47 [PATCH 0/3 v2] RFC: marvell dreamplug dft support Jason Cooper
2011-08-09 16:47 ` [PATCH 1/3 v2] RFC: arm/kirkwood: TEMP hack till mach-types is updated Jason Cooper
2012-02-23  1:46   ` Grant Likely
2012-02-23  1:48   ` Grant Likely
2011-08-09 16:47 ` [PATCH 2/3 v2] RFC: arm/kirkwood: add dreamplug support Jason Cooper
2011-08-09 17:25   ` Arnaud Patard (Rtp)
2011-08-09 18:10     ` Jason
2011-08-10 14:31   ` Arnd Bergmann
2011-08-09 16:47 ` [PATCH 3/3 v2] RFC: arm: kirkwood: dreamplug fdt support Jason Cooper
2011-12-07 19:40 ` [PATCH V3] arm: kirkwood: add dreamplug support Jason Cooper
2012-02-22 19:18 ` [PATCH 0/3 v4] arm: kirkwood: add dreamplug/devicetree support Jason Cooper
2012-02-22 19:18   ` Jason Cooper
2012-02-22 19:18 ` [PATCH 1/3] arm: ignore devicetree blobs Jason Cooper
2012-02-22 19:18   ` Jason Cooper
     [not found]   ` <3629df9b5b96d3a3a63a34ebf6ddfca2fd72ccfc.1329936660.git.jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org>
2012-02-22 20:38     ` Arnd Bergmann
2012-02-22 20:38       ` Arnd Bergmann
2012-02-22 22:26     ` Uwe Kleine-König
2012-02-22 22:26       ` Uwe Kleine-König
     [not found]       ` <20120222222619.GY14173-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2012-02-23  9:16         ` Dave Martin
2012-02-23  9:16           ` Dave Martin
2012-02-23 15:56           ` Jason
2012-02-23 15:56             ` Jason
2012-02-22 19:18 ` [PATCH 2/3 v4] arm: kirkwood: add dreamplug (fdt) support Jason Cooper
2012-02-22 19:18   ` Jason Cooper
     [not found]   ` <8532afcdc4adbb3771e6f742bcc33ef9c0347858.1329936660.git.jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org>
2012-02-22 20:46     ` Arnd Bergmann
2012-02-22 20:46       ` Arnd Bergmann
     [not found]       ` <201202222046.28707.arnd-r2nGTMty4D4@public.gmane.org>
2012-02-22 21:17         ` Nicolas Pitre
2012-02-22 21:17           ` Nicolas Pitre
2012-02-23  3:19     ` Rob Herring
2012-02-23  3:19       ` Rob Herring
     [not found]       ` <4F45B043.1080302-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2012-02-23  7:34         ` Arnd Bergmann
2012-02-23  7:34           ` Arnd Bergmann
2012-02-23 16:12           ` Jason
2012-02-23 16:12             ` Jason
     [not found]             ` <20120223161210.GN23524-u4khhh1J0LxI1Ri9qeTfzeTW4wlIGRCZ@public.gmane.org>
2012-02-23 18:56               ` Grant Likely
2012-02-23 18:56                 ` Grant Likely
2012-02-23 19:00                 ` Jason
2012-02-23 19:00                   ` Jason
2012-02-22 19:18 ` [PATCH 3/3] arm: kirkwood: convert uart0 to devicetree Jason Cooper
2012-02-22 19:18   ` Jason Cooper
     [not found]   ` <0ad28cac6d608253b01e1d57bb479a29754ae823.1329936660.git.jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org>
2012-02-22 20:55     ` Arnd Bergmann
2012-02-22 20:55       ` Arnd Bergmann
2012-02-22 21:09       ` Jason
2012-02-22 21:09         ` Jason
2012-02-23 19:52 ` [PATCH 0/2 v5] arm: kirkwood: add dreamplug/devicetree support Jason Cooper
2012-02-23 19:52   ` Jason Cooper
2012-02-26 11:00   ` Ian Campbell
2012-02-26 11:00     ` Ian Campbell
     [not found]     ` <1330254038.10008.24.camel-ztPmHsLffjjnO4AKDKe2m+kiAK3p4hvP@public.gmane.org>
2012-02-27 14:57       ` Jason
2012-02-27 14:57         ` Jason
2012-02-28  7:20         ` Ian Campbell
2012-02-28  7:20           ` Ian Campbell
2012-02-23 19:52 ` [PATCH 1/2 v5] arm: kirkwood: add dreamplug (fdt) support Jason Cooper
2012-02-23 19:52   ` Jason Cooper
2012-02-23 20:18   ` Grant Likely
2012-02-23 20:18     ` Grant Likely
     [not found]     ` <CACxGe6vjzXUwvGu73p+5L2-cW5EOJtFcR8JW8-gOUrRt-choJg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-02-23 21:11       ` Jason
2012-02-23 21:11         ` Jason
     [not found]         ` <20120223211138.GP23524-u4khhh1J0LxI1Ri9qeTfzeTW4wlIGRCZ@public.gmane.org>
2012-02-23 21:21           ` Grant Likely
2012-02-23 21:21             ` Grant Likely
2012-02-24 14:35             ` Jason
2012-02-24 14:35               ` Jason
     [not found]             ` <CACxGe6uMcOWC6ukTGF1soyfeTkT2fkmewhKUKA-AiK8hQDzCGQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-02-24 19:36               ` Jason
2012-02-24 19:36                 ` Jason
2012-02-23 19:52 ` [PATCH 2/2 v2] arm: kirkwood: convert uart0 to devicetree Jason Cooper
2012-02-23 19:52   ` Jason Cooper
     [not found] ` <cover.1312906908.git.jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org>
2012-02-27 16:07   ` [PATCH 0/2 v6] arm: kirkwood: add dreamplug/devicetree support Jason Cooper
2012-02-27 16:07     ` Jason Cooper
     [not found]   ` <cover.1330358323.git.jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org>
2012-02-27 16:07     ` [PATCH 2/2 v2] arm: kirkwood: convert uart0 to devicetree Jason Cooper
2012-02-27 16:07       ` Jason Cooper
2012-02-27 16:29     ` [PATCH 0/2 v6] arm: kirkwood: add dreamplug/devicetree support Arnd Bergmann
2012-02-27 16:29       ` Arnd Bergmann
2012-02-27 17:31       ` Jason
2012-02-27 17:31         ` Jason
2012-02-27 16:07 ` [PATCH 1/2 v6] arm: kirkwood: add dreamplug (fdt) support Jason Cooper
2012-02-27 16:07   ` Jason Cooper

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.