All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH 0/5] ARM: mv78x00: First step to convert mv78x00 to Device Tree
@ 2013-05-19 21:39 Gregory CLEMENT
  2013-05-19 21:39 ` [RFC PATCH 1/5] ARM: mv78x00: Add generic support for the Device Tree boards Gregory CLEMENT
                   ` (5 more replies)
  0 siblings, 6 replies; 15+ messages in thread
From: Gregory CLEMENT @ 2013-05-19 21:39 UTC (permalink / raw)
  To: linux-arm-kernel

Hello,

This patch set is a first step in order to convert mach-mv78x00 to
device tree before it joins mach-mvebu.

I managed to test it on the RD-78X00-mASA board. All the peripherals I
have tested work as they work before the migration to the device tree:
- UART
- Ethernet
- USB
- SATA

My main concern is that the mv78x00 are MP but not SMP
capable. Currently the same kernel run on the 2 cores and it is in the
board file that the peripherals are assigned for each CPU. (Actually I
didn't test this behavior, but the code is written in this way.)

I don't know how to assign a peripheral to a given CPU with the device
tree. The only way I have in mind is to have a dts per CPU, but I am
not sure it is very convenient.

So for now the code assigns all the peripherals to the CPU.

I am also concerned by the 2 other boards: the Marvell DB-78x00-BP
Development Board and the Buffalo WLX (Terastation Duo) NAS. I don't
have them and so I can't test them if I want to convert them to device
tree too.

Comments and ideas are welcome

Thanks,

Gregory CLEMENT (5):
  ARM: mv78x00: Add generic support for the Device Tree boards
  ARM: mv78x00: Convert RD-78X00-mASA board to device tree
  ARM: mv78x00: Add infrastructure to support boards converted to DT
  ARM: mv78x00: Add the Device Tree support for MV78X00 family
  ARM: mv78x00: Add Device Tree support for the RD-78X00-mASA board

 arch/arm/boot/dts/Makefile                 |   1 +
 arch/arm/boot/dts/mv78x00-masa-db.dts      |  61 ++++++++++++++
 arch/arm/boot/dts/mv78x00.dtsi             | 126 +++++++++++++++++++++++++++++
 arch/arm/mach-mv78xx0/Kconfig              |   7 ++
 arch/arm/mach-mv78xx0/Makefile             |   1 +
 arch/arm/mach-mv78xx0/board-dt.c           |  49 +++++++++++
 arch/arm/mach-mv78xx0/common.h             |   7 ++
 arch/arm/mach-mv78xx0/rd78x00-masa-setup.c |  10 +++
 8 files changed, 262 insertions(+)
 create mode 100644 arch/arm/boot/dts/mv78x00-masa-db.dts
 create mode 100644 arch/arm/boot/dts/mv78x00.dtsi
 create mode 100644 arch/arm/mach-mv78xx0/board-dt.c

-- 
1.8.1.2

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

* [RFC PATCH 1/5] ARM: mv78x00: Add generic support for the Device Tree boards
  2013-05-19 21:39 [RFC PATCH 0/5] ARM: mv78x00: First step to convert mv78x00 to Device Tree Gregory CLEMENT
@ 2013-05-19 21:39 ` Gregory CLEMENT
  2013-05-19 21:39 ` [RFC PATCH 2/5] ARM: mv78x00: Convert RD-78X00-mASA board to device tree Gregory CLEMENT
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 15+ messages in thread
From: Gregory CLEMENT @ 2013-05-19 21:39 UTC (permalink / raw)
  To: linux-arm-kernel

This commit add the generic support for the MV78X00 based boards
converted to the device tree.

Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
---
 arch/arm/mach-mv78xx0/board-dt.c | 46 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 46 insertions(+)
 create mode 100644 arch/arm/mach-mv78xx0/board-dt.c

diff --git a/arch/arm/mach-mv78xx0/board-dt.c b/arch/arm/mach-mv78xx0/board-dt.c
new file mode 100644
index 0000000..4995fee
--- /dev/null
+++ b/arch/arm/mach-mv78xx0/board-dt.c
@@ -0,0 +1,46 @@
+/*
+ * arch/arm/mach-mv78xx0/board-dt.c
+ *
+ * Flattened Device Tree board initialization
+ *
+ * Copyright (C) 2013  Gregory CLEMENT <gregory.clement@free-electrons.com>
+ *
+ * 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/of.h>
+#include <linux/of_platform.h>
+#include <mach/mv78xx0.h>
+#include <plat/irq.h>
+#include <asm/mach/arch.h>
+#include "common.h"
+
+static void __init mv78x00_dt_init(void)
+{
+	/*
+	 * Basic MV78xx0 setup. Needs to be called early.
+	 */
+	mv78xx0_init();
+
+	of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
+}
+
+static const char *mv78x00_dt_compat[] = {
+	"marvell,mv78x00",
+	NULL,
+};
+
+DT_MACHINE_START(MV78X00_DT, "Marvell MV78x00 (Flattened Device Tree)")
+	/* Maintainer: Gregory CLEMENT <gregory.clement@free-electrons.com> */
+	.init_machine	= mv78x00_dt_init,
+	.map_io		= mv78xx0_map_io,
+	.init_early	= mv78xx0_init_early,
+	.init_irq	= orion_dt_init_irq,
+	.init_time	= mv78xx0_timer_init,
+	.restart	= mv78xx0_restart,
+	.dt_compat	= mv78x00_dt_compat,
+MACHINE_END
-- 
1.8.1.2

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

* [RFC PATCH 2/5] ARM: mv78x00: Convert RD-78X00-mASA board to device tree
  2013-05-19 21:39 [RFC PATCH 0/5] ARM: mv78x00: First step to convert mv78x00 to Device Tree Gregory CLEMENT
  2013-05-19 21:39 ` [RFC PATCH 1/5] ARM: mv78x00: Add generic support for the Device Tree boards Gregory CLEMENT
@ 2013-05-19 21:39 ` Gregory CLEMENT
  2013-05-20  9:52   ` Andrew Lunn
  2013-05-19 21:39 ` [RFC PATCH 3/5] ARM: mv78x00: Add infrastructure to support boards converted to DT Gregory CLEMENT
                   ` (3 subsequent siblings)
  5 siblings, 1 reply; 15+ messages in thread
From: Gregory CLEMENT @ 2013-05-19 21:39 UTC (permalink / raw)
  To: linux-arm-kernel

This commit converts the 'RD-78X00-mASA' board to the Device
Tree. Most of the devices are converted to the Device Tree, the only
devices which have not their Device Tree bindings are the Gigabit
Ethernet ones and remain instantiated in the old way.

Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
---
 arch/arm/mach-mv78xx0/board-dt.c           |  3 +++
 arch/arm/mach-mv78xx0/common.h             |  7 +++++++
 arch/arm/mach-mv78xx0/rd78x00-masa-setup.c | 10 ++++++++++
 3 files changed, 20 insertions(+)

diff --git a/arch/arm/mach-mv78xx0/board-dt.c b/arch/arm/mach-mv78xx0/board-dt.c
index 4995fee..5111cbd 100644
--- a/arch/arm/mach-mv78xx0/board-dt.c
+++ b/arch/arm/mach-mv78xx0/board-dt.c
@@ -26,6 +26,9 @@ static void __init mv78x00_dt_init(void)
 	 */
 	mv78xx0_init();
 
+	if (of_machine_is_compatible("marvell,rd-78x00-masa"))
+		rd78x00_masa_init_dt();
+
 	of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
 }
 
diff --git a/arch/arm/mach-mv78xx0/common.h b/arch/arm/mach-mv78xx0/common.h
index 5e9485b..6e9140d 100644
--- a/arch/arm/mach-mv78xx0/common.h
+++ b/arch/arm/mach-mv78xx0/common.h
@@ -17,6 +17,13 @@ struct mv_sata_platform_data;
 /*
  * Basic MV78xx0 init functions used early by machine-setup.
  */
+#ifdef CONFIG_MACH_RD78X00_MASA
+void rd78x00_masa_init_dt(void);
+#else
+static inline void rd78x00_masa_init_dt(void) {};
+#endif
+
+
 int mv78xx0_core_index(void);
 void mv78xx0_map_io(void);
 void mv78xx0_init(void);
diff --git a/arch/arm/mach-mv78xx0/rd78x00-masa-setup.c b/arch/arm/mach-mv78xx0/rd78x00-masa-setup.c
index d2d06f3..8d88657 100644
--- a/arch/arm/mach-mv78xx0/rd78x00-masa-setup.c
+++ b/arch/arm/mach-mv78xx0/rd78x00-masa-setup.c
@@ -64,6 +64,16 @@ static void __init rd78x00_masa_init(void)
 	}
 }
 
+void __init rd78x00_masa_init_dt(void)
+{
+	/* Internal devices not ported to DT yet */
+	mv78xx0_ge00_init(&rd78x00_masa_ge00_data);
+	mv78xx0_ge10_init(&rd78x00_masa_ge10_data);
+		mv78xx0_ge01_init(&rd78x00_masa_ge01_data);
+		mv78xx0_ge11_init(&rd78x00_masa_ge11_data);
+
+}
+
 static int __init rd78x00_pci_init(void)
 {
 	/*
-- 
1.8.1.2

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

* [RFC PATCH 3/5] ARM: mv78x00: Add infrastructure to support boards converted to DT
  2013-05-19 21:39 [RFC PATCH 0/5] ARM: mv78x00: First step to convert mv78x00 to Device Tree Gregory CLEMENT
  2013-05-19 21:39 ` [RFC PATCH 1/5] ARM: mv78x00: Add generic support for the Device Tree boards Gregory CLEMENT
  2013-05-19 21:39 ` [RFC PATCH 2/5] ARM: mv78x00: Convert RD-78X00-mASA board to device tree Gregory CLEMENT
@ 2013-05-19 21:39 ` Gregory CLEMENT
  2013-05-19 21:39 ` [RFC PATCH 4/5] ARM: mv78x00: Add the Device Tree support for MV78X00 family Gregory CLEMENT
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 15+ messages in thread
From: Gregory CLEMENT @ 2013-05-19 21:39 UTC (permalink / raw)
  To: linux-arm-kernel

This commit updates the Kconfig and the Makefile to allow to build the
boards converted to the Device Tree.

Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
---
 arch/arm/mach-mv78xx0/Kconfig  | 7 +++++++
 arch/arm/mach-mv78xx0/Makefile | 1 +
 2 files changed, 8 insertions(+)

diff --git a/arch/arm/mach-mv78xx0/Kconfig b/arch/arm/mach-mv78xx0/Kconfig
index f2d309d..2390a6e 100644
--- a/arch/arm/mach-mv78xx0/Kconfig
+++ b/arch/arm/mach-mv78xx0/Kconfig
@@ -20,6 +20,13 @@ config MACH_TERASTATION_WXL
 	  Say 'Y' here if you want your kernel to support the
 	  Buffalo WXL Nas.
 
+config ARCH_MV78X00_DT
+	bool "Marvell MV78X00 Flattened Device Tree"
+	select USE_OF
+	help
+	  Say 'Y' here if you want your kernel to support the
+	  Marvell MV78X00 using flattened device tree.
+
 endmenu
 
 endif
diff --git a/arch/arm/mach-mv78xx0/Makefile b/arch/arm/mach-mv78xx0/Makefile
index 7cd0463..8935e48 100644
--- a/arch/arm/mach-mv78xx0/Makefile
+++ b/arch/arm/mach-mv78xx0/Makefile
@@ -2,3 +2,4 @@ obj-y				+= common.o mpp.o irq.o pcie.o
 obj-$(CONFIG_MACH_DB78X00_BP)	+= db78x00-bp-setup.o
 obj-$(CONFIG_MACH_RD78X00_MASA)	+= rd78x00-masa-setup.o
 obj-$(CONFIG_MACH_TERASTATION_WXL) += buffalo-wxl-setup.o
+obj-$(CONFIG_ARCH_MV78X00_DT)	+= board-dt.o
-- 
1.8.1.2

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

* [RFC PATCH 4/5] ARM: mv78x00: Add the Device Tree support for MV78X00 family
  2013-05-19 21:39 [RFC PATCH 0/5] ARM: mv78x00: First step to convert mv78x00 to Device Tree Gregory CLEMENT
                   ` (2 preceding siblings ...)
  2013-05-19 21:39 ` [RFC PATCH 3/5] ARM: mv78x00: Add infrastructure to support boards converted to DT Gregory CLEMENT
@ 2013-05-19 21:39 ` Gregory CLEMENT
  2013-05-20 17:21   ` Jason Cooper
  2013-05-19 21:39 ` [RFC PATCH 5/5] ARM: mv78x00: Add Device Tree support for the RD-78X00-mASA board Gregory CLEMENT
  2013-05-20  9:43 ` [RFC PATCH 0/5] ARM: mv78x00: First step to convert mv78x00 to Device Tree Andrew Lunn
  5 siblings, 1 reply; 15+ messages in thread
From: Gregory CLEMENT @ 2013-05-19 21:39 UTC (permalink / raw)
  To: linux-arm-kernel

This commit adds the Device Tree support for the mv78x00 SoC
family. It adds an mv78x00.dtsi description of the mv78x00 SoC

So far, the Device Tree contains the interrupt controller, the GPIO
bank, the UART controllers, the USB host controllers, the SATA
controllers and the I2C controllers.

Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
---
 arch/arm/boot/dts/mv78x00.dtsi | 126 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 126 insertions(+)
 create mode 100644 arch/arm/boot/dts/mv78x00.dtsi

diff --git a/arch/arm/boot/dts/mv78x00.dtsi b/arch/arm/boot/dts/mv78x00.dtsi
new file mode 100644
index 0000000..df496f5
--- /dev/null
+++ b/arch/arm/boot/dts/mv78x00.dtsi
@@ -0,0 +1,126 @@
+/*
+ * Copyright (C) 2013 Gregory CLEMENT <gregory.clement@free-electrons.com>
+ *
+ * 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/ "skeleton.dtsi"
+
+/ {
+	model = "Marvell MV78X00 SoC";
+	compatible = "marvell,mv78x00";
+	interrupt-parent = <&intc>;
+
+	intc: interrupt-controller {
+		compatible = "marvell,orion-intc", "marvell,intc";
+		interrupt-controller;
+		#interrupt-cells = <1>;
+		reg = <0xf1020210 0x04>,
+		      <0xf1020214 0x04>,
+		      <0xf102020c 0x04>;
+	};
+
+	ocp at f1000000 {
+		compatible = "simple-bus";
+		ranges = <0x00000000 0xf1000000 0x4000000>;
+		#address-cells = <1>;
+		#size-cells = <1>;
+
+		gpio0: gpio at 10100 {
+			compatible = "marvell,orion-gpio";
+			#gpio-cells = <2>;
+			gpio-controller;
+			reg = <0x10100 0x40>;
+			ngpios = <32>;
+			interrupts = <56>, <57>, <58>, <59>;
+		};
+
+		serial at 12000 {
+			compatible = "ns16550a";
+			reg = <0x12000 0x100>;
+			reg-shift = <2>;
+			interrupts = <12>;
+			/* set clock-frequency in board dts */
+			status = "disabled";
+		};
+
+		serial at 12100 {
+			compatible = "ns16550a";
+			reg = <0x12100 0x100>;
+			reg-shift = <2>;
+			interrupts = <13>;
+			/* set clock-frequency in board dts */
+			status = "disabled";
+		};
+
+		serial at 12200 {
+			compatible = "ns16550a";
+			reg = <0x12200 0x100>;
+			reg-shift = <2>;
+			interrupts = <14>;
+			/* set clock-frequency in board dts */
+			status = "disabled";
+		};
+
+		serial at 12300 {
+			compatible = "ns16550a";
+			reg = <0x12300 0x100>;
+			reg-shift = <2>;
+			interrupts = <15>;
+			/* set clock-frequency in board dts */
+			status = "disabled";
+		};
+
+
+		sata at a0000 {
+			compatible = "marvell,orion-sata";
+			reg = <0xa0000 0x5000>;
+			interrupts = <26>;
+			status = "disabled";
+		};
+
+		i2c at 10000 {
+			compatible = "marvell,mv64xxx-i2c";
+			reg = <0x10000 0x20>;
+			#address-cells = <1>;
+			#size-cells = <0>;
+			interrupts = <2>;
+			clock-frequency = <100000>;
+			status = "disabled";
+		};
+
+		i2c at 11000 {
+			compatible = "marvell,mv64xxx-i2c";
+			reg = <0x11000 0x20>;
+			#address-cells = <1>;
+			#size-cells = <0>;
+			interrupts = <3>;
+			clock-frequency = <100000>;
+			status = "disabled";
+		};
+
+		ehci at 50000 {
+			compatible = "marvell,orion-ehci";
+			reg = <0x50000 0x1000>;
+			interrupts = <16>;
+			status = "disabled";
+		};
+
+		ehci at 51000 {
+			compatible = "marvell,orion-ehci";
+			reg = <0x51000 0x1000>;
+			interrupts = <17>;
+			status = "disabled";
+		};
+
+		ehci at 52000 {
+			compatible = "marvell,orion-ehci";
+			reg = <0x52000 0x1000>;
+			interrupts = <18>;
+			status = "disabled";
+		};
+
+	};
+};
-- 
1.8.1.2

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

* [RFC PATCH 5/5] ARM: mv78x00: Add Device Tree support for the RD-78X00-mASA board
  2013-05-19 21:39 [RFC PATCH 0/5] ARM: mv78x00: First step to convert mv78x00 to Device Tree Gregory CLEMENT
                   ` (3 preceding siblings ...)
  2013-05-19 21:39 ` [RFC PATCH 4/5] ARM: mv78x00: Add the Device Tree support for MV78X00 family Gregory CLEMENT
@ 2013-05-19 21:39 ` Gregory CLEMENT
  2013-05-20  9:43 ` [RFC PATCH 0/5] ARM: mv78x00: First step to convert mv78x00 to Device Tree Andrew Lunn
  5 siblings, 0 replies; 15+ messages in thread
From: Gregory CLEMENT @ 2013-05-19 21:39 UTC (permalink / raw)
  To: linux-arm-kernel

This commit adds the device tree support for the RD-78X00-mASA board.
It mainly converts the platform resource from the former board file
to the dts. It also add this device tree to the list of the dtbs
make rule.

Currently support includes:
- UARTs
- USBs
- I2Cs
- RTC
- SATAs

The mains lacks are PCI and Ethernet which will be added when
converted to device tree.

Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
---
 arch/arm/boot/dts/Makefile            |  1 +
 arch/arm/boot/dts/mv78x00-masa-db.dts | 61 +++++++++++++++++++++++++++++++++++
 2 files changed, 62 insertions(+)
 create mode 100644 arch/arm/boot/dts/mv78x00-masa-db.dts

diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index b9f7121..f152b89 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -91,6 +91,7 @@ dtb-$(CONFIG_ARCH_KIRKWOOD) += kirkwood-cloudbox.dtb \
 dtb-$(CONFIG_ARCH_MARCO) += marco-evb.dtb
 dtb-$(CONFIG_ARCH_MSM) += msm8660-surf.dtb \
 	msm8960-cdp.dtb
+dtb-$(CONFIG_ARCH_MV78X00) += mv78x00-masa-db.dtb
 dtb-$(CONFIG_ARCH_MVEBU) += armada-370-db.dtb \
 	armada-370-mirabox.dtb \
 	armada-370-rd.dtb \
diff --git a/arch/arm/boot/dts/mv78x00-masa-db.dts b/arch/arm/boot/dts/mv78x00-masa-db.dts
new file mode 100644
index 0000000..f87f84d
--- /dev/null
+++ b/arch/arm/boot/dts/mv78x00-masa-db.dts
@@ -0,0 +1,61 @@
+/*
+ * Copyright (C) 2013  Gregory CLEMENT <gregory.clement@free-electrons.com>
+ *
+ * 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.
+ */
+
+/dts-v1/;
+/include/ "mv78x00.dtsi"
+
+/ {
+	model = "Marvell RD-78x00-MASA Development Board";
+	compatible = "marvell,rd-78x00-masa", "marvell,mv78x00";
+
+	memory {
+		reg = <0x00000000 0x20000000>; /* 512 MB */
+	};
+
+	chosen {
+		bootargs = "console=ttyS0,115200n8 earlyprintk";
+	};
+
+	ocp at f1000000 {
+
+		serial at 12000 {
+			clock-frequency = <200000000>;
+			status = "okay";
+		};
+
+		serial at 12200 {
+			clock-frequency = <200000000>;
+			status = "okay";
+		};
+
+		sata at a0000 {
+			nr-ports = <2>;
+			status = "okay";
+		};
+
+		i2c0: i2c at 10000 {
+			status = "okay";
+			rtc: rtc at 68 {
+				compatible = "dallas,ds1338";
+				reg = <0x68>;
+			};
+		};
+
+		ehci at 50000 {
+			status = "okay";
+		};
+
+		ehci at 51000 {
+			status = "okay";
+		};
+
+		ehci at 52000 {
+			status = "okay";
+		};
+	};
+};
-- 
1.8.1.2

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

* [RFC PATCH 0/5] ARM: mv78x00: First step to convert mv78x00 to Device Tree
  2013-05-19 21:39 [RFC PATCH 0/5] ARM: mv78x00: First step to convert mv78x00 to Device Tree Gregory CLEMENT
                   ` (4 preceding siblings ...)
  2013-05-19 21:39 ` [RFC PATCH 5/5] ARM: mv78x00: Add Device Tree support for the RD-78X00-mASA board Gregory CLEMENT
@ 2013-05-20  9:43 ` Andrew Lunn
  2013-05-20  9:59   ` Gregory CLEMENT
  5 siblings, 1 reply; 15+ messages in thread
From: Andrew Lunn @ 2013-05-20  9:43 UTC (permalink / raw)
  To: linux-arm-kernel

On Sun, May 19, 2013 at 11:39:33PM +0200, Gregory CLEMENT wrote:
> Hello,
> 
> This patch set is a first step in order to convert mach-mv78x00 to
> device tree before it joins mach-mvebu.
> 
> I managed to test it on the RD-78X00-mASA board. All the peripherals I
> have tested work as they work before the migration to the device tree:
> - UART
> - Ethernet
> - USB
> - SATA
> 
> My main concern is that the mv78x00 are MP but not SMP
> capable. Currently the same kernel run on the 2 cores and it is in the
> board file that the peripherals are assigned for each CPU. (Actually I
> didn't test this behavior, but the code is written in this way.)
> 
> I don't know how to assign a peripheral to a given CPU with the device
> tree. The only way I have in mind is to have a dts per CPU, but I am
> not sure it is very convenient.
> 
> So for now the code assigns all the peripherals to the CPU.

Hi Gregory

Could you explain what you have in a bit more detail. Are you just
bringing up one CPU and assigning all peripherals to that? Or do all
peripherals get assigned to the first CPU but both are running?

As you say, it looks like you need a DTS subtree per CPU for placing
peripherals. No idea if it will work, but i guess i would try:

       ocp at f1000000@cpu0 {
/include/ "mv78x00-peripherals.dtsi"
       }
       ocp at f1000000@cpu1 {
/include/ "mv78x00-peripherals.dtsi"
       }
 
so you get all the peripherals twice, disabled by default. In the
board-dt.c you can then do something like:


	if (mv78xx0_core_index() == 0) {
	   np = of_find_node_by_name(NULL, "ocp at f1000000@cpu0");
	else
	   np = of_find_node_by_name(NULL, "ocp at f1000000@cpu1");
	
        of_platform_populate(np, kirkwood_dt_match_table, NULL, NULL);

There are a few more details, like the GPIO controller has a different
mask register for CPU1, but that is not supported in the current mvebu
gpio code. However none of the current 3 boards make use of GPIO, let
alone GPIO interrupts.

> I am also concerned by the 2 other boards: the Marvell DB-78x00-BP
> Development Board and the Buffalo WLX (Terastation Duo) NAS. I don't
> have them and so I can't test them if I want to convert them to device
> tree too.

The Buffalo WLX is interesting. The wxl_init() does not differentiate
between CPU0 and CPU1, where as the Marvell reference boards do. So i
suspect only one CPU is running, or its broken.

It might be interesting to ask on the buffalo forums if anybody is
actually using mainline on TS-WLX.

      Andrew

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

* [RFC PATCH 2/5] ARM: mv78x00: Convert RD-78X00-mASA board to device tree
  2013-05-19 21:39 ` [RFC PATCH 2/5] ARM: mv78x00: Convert RD-78X00-mASA board to device tree Gregory CLEMENT
@ 2013-05-20  9:52   ` Andrew Lunn
  2013-05-20 10:00     ` Gregory CLEMENT
  0 siblings, 1 reply; 15+ messages in thread
From: Andrew Lunn @ 2013-05-20  9:52 UTC (permalink / raw)
  To: linux-arm-kernel

On Sun, May 19, 2013 at 11:39:35PM +0200, Gregory CLEMENT wrote:
> This commit converts the 'RD-78X00-mASA' board to the Device
> Tree. Most of the devices are converted to the Device Tree, the only
> devices which have not their Device Tree bindings are the Gigabit
> Ethernet ones and remain instantiated in the old way.
> 
> Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
> ---
>  arch/arm/mach-mv78xx0/board-dt.c           |  3 +++
>  arch/arm/mach-mv78xx0/common.h             |  7 +++++++
>  arch/arm/mach-mv78xx0/rd78x00-masa-setup.c | 10 ++++++++++
>  3 files changed, 20 insertions(+)
> 
> diff --git a/arch/arm/mach-mv78xx0/board-dt.c b/arch/arm/mach-mv78xx0/board-dt.c
> index 4995fee..5111cbd 100644
> --- a/arch/arm/mach-mv78xx0/board-dt.c
> +++ b/arch/arm/mach-mv78xx0/board-dt.c
> @@ -26,6 +26,9 @@ static void __init mv78x00_dt_init(void)
>  	 */
>  	mv78xx0_init();
>  
> +	if (of_machine_is_compatible("marvell,rd-78x00-masa"))
> +		rd78x00_masa_init_dt();
> +
>  	of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
>  }
>  
> diff --git a/arch/arm/mach-mv78xx0/common.h b/arch/arm/mach-mv78xx0/common.h
> index 5e9485b..6e9140d 100644
> --- a/arch/arm/mach-mv78xx0/common.h
> +++ b/arch/arm/mach-mv78xx0/common.h
> @@ -17,6 +17,13 @@ struct mv_sata_platform_data;
>  /*
>   * Basic MV78xx0 init functions used early by machine-setup.
>   */
> +#ifdef CONFIG_MACH_RD78X00_MASA
> +void rd78x00_masa_init_dt(void);
> +#else
> +static inline void rd78x00_masa_init_dt(void) {};
> +#endif
> +
> +
>  int mv78xx0_core_index(void);
>  void mv78xx0_map_io(void);
>  void mv78xx0_init(void);
> diff --git a/arch/arm/mach-mv78xx0/rd78x00-masa-setup.c b/arch/arm/mach-mv78xx0/rd78x00-masa-setup.c
> index d2d06f3..8d88657 100644
> --- a/arch/arm/mach-mv78xx0/rd78x00-masa-setup.c
> +++ b/arch/arm/mach-mv78xx0/rd78x00-masa-setup.c
> @@ -64,6 +64,16 @@ static void __init rd78x00_masa_init(void)
>  	}
>  }
>  
> +void __init rd78x00_masa_init_dt(void)
> +{
> +	/* Internal devices not ported to DT yet */
> +	mv78xx0_ge00_init(&rd78x00_masa_ge00_data);
> +	mv78xx0_ge10_init(&rd78x00_masa_ge10_data);
> +		mv78xx0_ge01_init(&rd78x00_masa_ge01_data);
> +		mv78xx0_ge11_init(&rd78x00_masa_ge11_data);
> +
> +}

Hi Gregory

First off, the indentation looks wrong. Might be a space/tab issue.

I would also be tempted to place this code into board-dt.c and not
touch or even compile rd78x00-masa-setup.c when using DT. If i
remember correctly, Jason had a patch for Kirkwood which centralized
all the ethernet setup code. You can maybe copy/paste that.

> +
>  static int __init rd78x00_pci_init(void)
>  {
>  	/*
> -- 
> 1.8.1.2
> 

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

* [RFC PATCH 0/5] ARM: mv78x00: First step to convert mv78x00 to Device Tree
  2013-05-20  9:43 ` [RFC PATCH 0/5] ARM: mv78x00: First step to convert mv78x00 to Device Tree Andrew Lunn
@ 2013-05-20  9:59   ` Gregory CLEMENT
  2013-05-20 10:07     ` Andrew Lunn
  0 siblings, 1 reply; 15+ messages in thread
From: Gregory CLEMENT @ 2013-05-20  9:59 UTC (permalink / raw)
  To: linux-arm-kernel

On 05/20/2013 11:43 AM, Andrew Lunn wrote:
> On Sun, May 19, 2013 at 11:39:33PM +0200, Gregory CLEMENT wrote:
>> Hello,
>>
>> This patch set is a first step in order to convert mach-mv78x00 to
>> device tree before it joins mach-mvebu.
>>
>> I managed to test it on the RD-78X00-mASA board. All the peripherals I
>> have tested work as they work before the migration to the device tree:
>> - UART
>> - Ethernet
>> - USB
>> - SATA
>>
>> My main concern is that the mv78x00 are MP but not SMP
>> capable. Currently the same kernel run on the 2 cores and it is in the
>> board file that the peripherals are assigned for each CPU. (Actually I
>> didn't test this behavior, but the code is written in this way.)
>>
>> I don't know how to assign a peripheral to a given CPU with the device
>> tree. The only way I have in mind is to have a dts per CPU, but I am
>> not sure it is very convenient.
>>
>> So for now the code assigns all the peripherals to the CPU.
> 
> Hi Gregory

Hi Andrew,

> 
> Could you explain what you have in a bit more detail. Are you just
> bringing up one CPU and assigning all peripherals to that? Or do all
> peripherals get assigned to the first CPU but both are running?

Currently I didn't find (but I didn't looked for so much) how to
boot the kernel on both CPU even with the legacy code. So I am just
bringing up one CPU and assigning all peripherals to that.

> 
> As you say, it looks like you need a DTS subtree per CPU for placing
> peripherals. No idea if it will work, but i guess i would try:
> 
>        ocp at f1000000@cpu0 {
> /include/ "mv78x00-peripherals.dtsi"
>        }
>        ocp at f1000000@cpu1 {
> /include/ "mv78x00-peripherals.dtsi"
>        }
>  
> so you get all the peripherals twice, disabled by default. In the
> board-dt.c you can then do something like:
> 
> 
> 	if (mv78xx0_core_index() == 0) {
> 	   np = of_find_node_by_name(NULL, "ocp at f1000000@cpu0");
> 	else
> 	   np = of_find_node_by_name(NULL, "ocp at f1000000@cpu1");
> 	
>         of_platform_populate(np, kirkwood_dt_match_table, NULL, NULL);
> 

very interesting idea, I will try it to see how it goes!

> There are a few more details, like the GPIO controller has a different
> mask register for CPU1, but that is not supported in the current mvebu
> gpio code. However none of the current 3 boards make use of GPIO, let
> alone GPIO interrupts.
> 
>> I am also concerned by the 2 other boards: the Marvell DB-78x00-BP
>> Development Board and the Buffalo WLX (Terastation Duo) NAS. I don't
>> have them and so I can't test them if I want to convert them to device
>> tree too.
> 
> The Buffalo WLX is interesting. The wxl_init() does not differentiate
> between CPU0 and CPU1, where as the Marvell reference boards do. So i
> suspect only one CPU is running, or its broken.

It looked like a copy and paste of the rd78x00_masa_init function: it kept
the comment about the 2 CPUs "Partition on-chip peripherals between the
two CPU cores."

> 
> It might be interesting to ask on the buffalo forums if anybody is
> actually using mainline on TS-WLX.

Do you know where is this forum?

Thanks for your review and your ideas!

-- 
Gregory Clement, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

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

* [RFC PATCH 2/5] ARM: mv78x00: Convert RD-78X00-mASA board to device tree
  2013-05-20  9:52   ` Andrew Lunn
@ 2013-05-20 10:00     ` Gregory CLEMENT
  2013-05-20 19:18       ` Gregory CLEMENT
  0 siblings, 1 reply; 15+ messages in thread
From: Gregory CLEMENT @ 2013-05-20 10:00 UTC (permalink / raw)
  To: linux-arm-kernel

On 05/20/2013 11:52 AM, Andrew Lunn wrote:
> On Sun, May 19, 2013 at 11:39:35PM +0200, Gregory CLEMENT wrote:
>> This commit converts the 'RD-78X00-mASA' board to the Device
>> Tree. Most of the devices are converted to the Device Tree, the only
>> devices which have not their Device Tree bindings are the Gigabit
>> Ethernet ones and remain instantiated in the old way.
>>
>> Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
>> ---
>>  arch/arm/mach-mv78xx0/board-dt.c           |  3 +++
>>  arch/arm/mach-mv78xx0/common.h             |  7 +++++++
>>  arch/arm/mach-mv78xx0/rd78x00-masa-setup.c | 10 ++++++++++
>>  3 files changed, 20 insertions(+)
>>
>> diff --git a/arch/arm/mach-mv78xx0/board-dt.c b/arch/arm/mach-mv78xx0/board-dt.c
>> index 4995fee..5111cbd 100644
>> --- a/arch/arm/mach-mv78xx0/board-dt.c
>> +++ b/arch/arm/mach-mv78xx0/board-dt.c
>> @@ -26,6 +26,9 @@ static void __init mv78x00_dt_init(void)
>>  	 */
>>  	mv78xx0_init();
>>  
>> +	if (of_machine_is_compatible("marvell,rd-78x00-masa"))
>> +		rd78x00_masa_init_dt();
>> +
>>  	of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
>>  }
>>  
>> diff --git a/arch/arm/mach-mv78xx0/common.h b/arch/arm/mach-mv78xx0/common.h
>> index 5e9485b..6e9140d 100644
>> --- a/arch/arm/mach-mv78xx0/common.h
>> +++ b/arch/arm/mach-mv78xx0/common.h
>> @@ -17,6 +17,13 @@ struct mv_sata_platform_data;
>>  /*
>>   * Basic MV78xx0 init functions used early by machine-setup.
>>   */
>> +#ifdef CONFIG_MACH_RD78X00_MASA
>> +void rd78x00_masa_init_dt(void);
>> +#else
>> +static inline void rd78x00_masa_init_dt(void) {};
>> +#endif
>> +
>> +
>>  int mv78xx0_core_index(void);
>>  void mv78xx0_map_io(void);
>>  void mv78xx0_init(void);
>> diff --git a/arch/arm/mach-mv78xx0/rd78x00-masa-setup.c b/arch/arm/mach-mv78xx0/rd78x00-masa-setup.c
>> index d2d06f3..8d88657 100644
>> --- a/arch/arm/mach-mv78xx0/rd78x00-masa-setup.c
>> +++ b/arch/arm/mach-mv78xx0/rd78x00-masa-setup.c
>> @@ -64,6 +64,16 @@ static void __init rd78x00_masa_init(void)
>>  	}
>>  }
>>  
>> +void __init rd78x00_masa_init_dt(void)
>> +{
>> +	/* Internal devices not ported to DT yet */
>> +	mv78xx0_ge00_init(&rd78x00_masa_ge00_data);
>> +	mv78xx0_ge10_init(&rd78x00_masa_ge10_data);
>> +		mv78xx0_ge01_init(&rd78x00_masa_ge01_data);
>> +		mv78xx0_ge11_init(&rd78x00_masa_ge11_data);
>> +
>> +}
> 
> Hi Gregory
> 
> First off, the indentation looks wrong. Might be a space/tab issue.

Thanks I will fix it

> 
> I would also be tempted to place this code into board-dt.c and not
> touch or even compile rd78x00-masa-setup.c when using DT. If i
> remember correctly, Jason had a patch for Kirkwood which centralized
> all the ethernet setup code. You can maybe copy/paste that.

OK I will have a look on it.
> 
>> +
>>  static int __init rd78x00_pci_init(void)
>>  {
>>  	/*
>> -- 
>> 1.8.1.2
>>


-- 
Gregory Clement, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

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

* [RFC PATCH 0/5] ARM: mv78x00: First step to convert mv78x00 to Device Tree
  2013-05-20  9:59   ` Gregory CLEMENT
@ 2013-05-20 10:07     ` Andrew Lunn
  0 siblings, 0 replies; 15+ messages in thread
From: Andrew Lunn @ 2013-05-20 10:07 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, May 20, 2013 at 11:59:04AM +0200, Gregory CLEMENT wrote:
> On 05/20/2013 11:43 AM, Andrew Lunn wrote:
> > On Sun, May 19, 2013 at 11:39:33PM +0200, Gregory CLEMENT wrote:
> >> Hello,
> >>
> >> This patch set is a first step in order to convert mach-mv78x00 to
> >> device tree before it joins mach-mvebu.
> >>
> >> I managed to test it on the RD-78X00-mASA board. All the peripherals I
> >> have tested work as they work before the migration to the device tree:
> >> - UART
> >> - Ethernet
> >> - USB
> >> - SATA
> >>
> >> My main concern is that the mv78x00 are MP but not SMP
> >> capable. Currently the same kernel run on the 2 cores and it is in the
> >> board file that the peripherals are assigned for each CPU. (Actually I
> >> didn't test this behavior, but the code is written in this way.)
> >>
> >> I don't know how to assign a peripheral to a given CPU with the device
> >> tree. The only way I have in mind is to have a dts per CPU, but I am
> >> not sure it is very convenient.
> >>
> >> So for now the code assigns all the peripherals to the CPU.
> > 
> > Hi Gregory
> 
> Hi Andrew,
> 
> > 
> > Could you explain what you have in a bit more detail. Are you just
> > bringing up one CPU and assigning all peripherals to that? Or do all
> > peripherals get assigned to the first CPU but both are running?
> 
> Currently I didn't find (but I didn't looked for so much) how to
> boot the kernel on both CPU even with the legacy code. So I am just
> bringing up one CPU and assigning all peripherals to that.

Hi Gregory

Did you try looking at UART 1. It could be there is a second uboot
instance running on it which is for CPU1.

> > It might be interesting to ask on the buffalo forums if anybody is
> > actually using mainline on TS-WLX.
> 
> Do you know where is this forum?

http://forum.buffalo.nas-central.org

	Andrew

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

* [RFC PATCH 4/5] ARM: mv78x00: Add the Device Tree support for MV78X00 family
  2013-05-19 21:39 ` [RFC PATCH 4/5] ARM: mv78x00: Add the Device Tree support for MV78X00 family Gregory CLEMENT
@ 2013-05-20 17:21   ` Jason Cooper
  2013-05-20 17:23     ` Sebastian Hesselbarth
  0 siblings, 1 reply; 15+ messages in thread
From: Jason Cooper @ 2013-05-20 17:21 UTC (permalink / raw)
  To: linux-arm-kernel

On Sun, May 19, 2013 at 11:39:37PM +0200, Gregory CLEMENT wrote:
> This commit adds the Device Tree support for the mv78x00 SoC
> family. It adds an mv78x00.dtsi description of the mv78x00 SoC
> 
> So far, the Device Tree contains the interrupt controller, the GPIO
> bank, the UART controllers, the USB host controllers, the SATA
> controllers and the I2C controllers.
> 
> Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
> ---
>  arch/arm/boot/dts/mv78x00.dtsi | 126 +++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 126 insertions(+)
>  create mode 100644 arch/arm/boot/dts/mv78x00.dtsi
> 
> diff --git a/arch/arm/boot/dts/mv78x00.dtsi b/arch/arm/boot/dts/mv78x00.dtsi
> new file mode 100644
> index 0000000..df496f5
> --- /dev/null
> +++ b/arch/arm/boot/dts/mv78x00.dtsi
> @@ -0,0 +1,126 @@
> +/*
> + * Copyright (C) 2013 Gregory CLEMENT <gregory.clement@free-electrons.com>
> + *
> + * 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/ "skeleton.dtsi"
> +
> +/ {
> +	model = "Marvell MV78X00 SoC";
> +	compatible = "marvell,mv78x00";
> +	interrupt-parent = <&intc>;
> +
> +	intc: interrupt-controller {
> +		compatible = "marvell,orion-intc", "marvell,intc";
> +		interrupt-controller;
> +		#interrupt-cells = <1>;
> +		reg = <0xf1020210 0x04>,
> +		      <0xf1020214 0x04>,
> +		      <0xf102020c 0x04>;
> +	};
> +
> +	ocp at f1000000 {
> +		compatible = "simple-bus";
> +		ranges = <0x00000000 0xf1000000 0x4000000>;
> +		#address-cells = <1>;
> +		#size-cells = <1>;
> +
> +		gpio0: gpio at 10100 {
> +			compatible = "marvell,orion-gpio";
> +			#gpio-cells = <2>;
> +			gpio-controller;
> +			reg = <0x10100 0x40>;
> +			ngpios = <32>;
> +			interrupts = <56>, <57>, <58>, <59>;
> +		};
> +
> +		serial at 12000 {
> +			compatible = "ns16550a";
> +			reg = <0x12000 0x100>;
> +			reg-shift = <2>;
> +			interrupts = <12>;
> +			/* set clock-frequency in board dts */
> +			status = "disabled";
> +		};
> +
> +		serial at 12100 {
> +			compatible = "ns16550a";
> +			reg = <0x12100 0x100>;
> +			reg-shift = <2>;
> +			interrupts = <13>;
> +			/* set clock-frequency in board dts */
> +			status = "disabled";
> +		};
> +
> +		serial at 12200 {
> +			compatible = "ns16550a";
> +			reg = <0x12200 0x100>;
> +			reg-shift = <2>;
> +			interrupts = <14>;
> +			/* set clock-frequency in board dts */
> +			status = "disabled";
> +		};
> +
> +		serial at 12300 {
> +			compatible = "ns16550a";
> +			reg = <0x12300 0x100>;
> +			reg-shift = <2>;
> +			interrupts = <15>;
> +			/* set clock-frequency in board dts */

We should probably add a note to these comments that this is only until
mv78x00 is converted to the clock infrastructure.

thx,

Jason.

> +			status = "disabled";
> +		};
> +
> +
> +		sata at a0000 {
> +			compatible = "marvell,orion-sata";
> +			reg = <0xa0000 0x5000>;
> +			interrupts = <26>;
> +			status = "disabled";
> +		};
> +
> +		i2c at 10000 {
> +			compatible = "marvell,mv64xxx-i2c";
> +			reg = <0x10000 0x20>;
> +			#address-cells = <1>;
> +			#size-cells = <0>;
> +			interrupts = <2>;
> +			clock-frequency = <100000>;
> +			status = "disabled";
> +		};
> +
> +		i2c at 11000 {
> +			compatible = "marvell,mv64xxx-i2c";
> +			reg = <0x11000 0x20>;
> +			#address-cells = <1>;
> +			#size-cells = <0>;
> +			interrupts = <3>;
> +			clock-frequency = <100000>;
> +			status = "disabled";
> +		};
> +
> +		ehci at 50000 {
> +			compatible = "marvell,orion-ehci";
> +			reg = <0x50000 0x1000>;
> +			interrupts = <16>;
> +			status = "disabled";
> +		};
> +
> +		ehci at 51000 {
> +			compatible = "marvell,orion-ehci";
> +			reg = <0x51000 0x1000>;
> +			interrupts = <17>;
> +			status = "disabled";
> +		};
> +
> +		ehci at 52000 {
> +			compatible = "marvell,orion-ehci";
> +			reg = <0x52000 0x1000>;
> +			interrupts = <18>;
> +			status = "disabled";
> +		};
> +
> +	};
> +};
> -- 
> 1.8.1.2
> 

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

* [RFC PATCH 4/5] ARM: mv78x00: Add the Device Tree support for MV78X00 family
  2013-05-20 17:21   ` Jason Cooper
@ 2013-05-20 17:23     ` Sebastian Hesselbarth
  2013-05-20 17:28       ` Jason Cooper
  0 siblings, 1 reply; 15+ messages in thread
From: Sebastian Hesselbarth @ 2013-05-20 17:23 UTC (permalink / raw)
  To: linux-arm-kernel

On 05/20/2013 07:21 PM, Jason Cooper wrote:
> On Sun, May 19, 2013 at 11:39:37PM +0200, Gregory CLEMENT wrote:
>> This commit adds the Device Tree support for the mv78x00 SoC
>> family. It adds an mv78x00.dtsi description of the mv78x00 SoC
>>
>> So far, the Device Tree contains the interrupt controller, the GPIO
>> bank, the UART controllers, the USB host controllers, the SATA
>> controllers and the I2C controllers.
>>
>> Signed-off-by: Gregory CLEMENT<gregory.clement@free-electrons.com>
>> ---
...
>> +		serial at 12300 {
>> +			compatible = "ns16550a";
>> +			reg =<0x12300 0x100>;
>> +			reg-shift =<2>;
>> +			interrupts =<15>;
>> +			/* set clock-frequency in board dts */
>
> We should probably add a note to these comments that this is only until
> mv78x00 is converted to the clock infrastructure.

Or use a fixed-rate clock node, reference here, and set that in board
dts?

Sebastian

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

* [RFC PATCH 4/5] ARM: mv78x00: Add the Device Tree support for MV78X00 family
  2013-05-20 17:23     ` Sebastian Hesselbarth
@ 2013-05-20 17:28       ` Jason Cooper
  0 siblings, 0 replies; 15+ messages in thread
From: Jason Cooper @ 2013-05-20 17:28 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, May 20, 2013 at 07:23:41PM +0200, Sebastian Hesselbarth wrote:
> On 05/20/2013 07:21 PM, Jason Cooper wrote:
> >On Sun, May 19, 2013 at 11:39:37PM +0200, Gregory CLEMENT wrote:
> >>This commit adds the Device Tree support for the mv78x00 SoC
> >>family. It adds an mv78x00.dtsi description of the mv78x00 SoC
> >>
> >>So far, the Device Tree contains the interrupt controller, the GPIO
> >>bank, the UART controllers, the USB host controllers, the SATA
> >>controllers and the I2C controllers.
> >>
> >>Signed-off-by: Gregory CLEMENT<gregory.clement@free-electrons.com>
> >>---
> ...
> >>+		serial at 12300 {
> >>+			compatible = "ns16550a";
> >>+			reg =<0x12300 0x100>;
> >>+			reg-shift =<2>;
> >>+			interrupts =<15>;
> >>+			/* set clock-frequency in board dts */
> >
> >We should probably add a note to these comments that this is only until
> >mv78x00 is converted to the clock infrastructure.
> 
> Or use a fixed-rate clock node, reference here, and set that in board
> dts?

Yes, I realized (of course _after_ hitting send), that the whole issue I
was recalling was wrt gated clocks.  iirc now, mv78xx0 doesn't have
gated clocks.

thx,

Jason.

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

* [RFC PATCH 2/5] ARM: mv78x00: Convert RD-78X00-mASA board to device tree
  2013-05-20 10:00     ` Gregory CLEMENT
@ 2013-05-20 19:18       ` Gregory CLEMENT
  0 siblings, 0 replies; 15+ messages in thread
From: Gregory CLEMENT @ 2013-05-20 19:18 UTC (permalink / raw)
  To: linux-arm-kernel

On 05/20/2013 12:00 PM, Gregory CLEMENT wrote:
> On 05/20/2013 11:52 AM, Andrew Lunn wrote:
>> On Sun, May 19, 2013 at 11:39:35PM +0200, Gregory CLEMENT wrote:
>>> This commit converts the 'RD-78X00-mASA' board to the Device
>>> Tree. Most of the devices are converted to the Device Tree, the only
>>> devices which have not their Device Tree bindings are the Gigabit
>>> Ethernet ones and remain instantiated in the old way.
>>>
>>> Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
>>> ---
>>>  arch/arm/mach-mv78xx0/board-dt.c           |  3 +++
>>>  arch/arm/mach-mv78xx0/common.h             |  7 +++++++
>>>  arch/arm/mach-mv78xx0/rd78x00-masa-setup.c | 10 ++++++++++
>>>  3 files changed, 20 insertions(+)
>>>
>>> diff --git a/arch/arm/mach-mv78xx0/board-dt.c b/arch/arm/mach-mv78xx0/board-dt.c
>>> index 4995fee..5111cbd 100644
>>> --- a/arch/arm/mach-mv78xx0/board-dt.c
>>> +++ b/arch/arm/mach-mv78xx0/board-dt.c
>>> @@ -26,6 +26,9 @@ static void __init mv78x00_dt_init(void)
>>>  	 */
>>>  	mv78xx0_init();
>>>  
>>> +	if (of_machine_is_compatible("marvell,rd-78x00-masa"))
>>> +		rd78x00_masa_init_dt();
>>> +
>>>  	of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
>>>  }
>>>  
>>> diff --git a/arch/arm/mach-mv78xx0/common.h b/arch/arm/mach-mv78xx0/common.h
>>> index 5e9485b..6e9140d 100644
>>> --- a/arch/arm/mach-mv78xx0/common.h
>>> +++ b/arch/arm/mach-mv78xx0/common.h
>>> @@ -17,6 +17,13 @@ struct mv_sata_platform_data;
>>>  /*
>>>   * Basic MV78xx0 init functions used early by machine-setup.
>>>   */
>>> +#ifdef CONFIG_MACH_RD78X00_MASA
>>> +void rd78x00_masa_init_dt(void);
>>> +#else
>>> +static inline void rd78x00_masa_init_dt(void) {};
>>> +#endif
>>> +
>>> +
>>>  int mv78xx0_core_index(void);
>>>  void mv78xx0_map_io(void);
>>>  void mv78xx0_init(void);
>>> diff --git a/arch/arm/mach-mv78xx0/rd78x00-masa-setup.c b/arch/arm/mach-mv78xx0/rd78x00-masa-setup.c
>>> index d2d06f3..8d88657 100644
>>> --- a/arch/arm/mach-mv78xx0/rd78x00-masa-setup.c
>>> +++ b/arch/arm/mach-mv78xx0/rd78x00-masa-setup.c
>>> @@ -64,6 +64,16 @@ static void __init rd78x00_masa_init(void)
>>>  	}
>>>  }
>>>  
>>> +void __init rd78x00_masa_init_dt(void)
>>> +{
>>> +	/* Internal devices not ported to DT yet */
>>> +	mv78xx0_ge00_init(&rd78x00_masa_ge00_data);
>>> +	mv78xx0_ge10_init(&rd78x00_masa_ge10_data);
>>> +		mv78xx0_ge01_init(&rd78x00_masa_ge01_data);
>>> +		mv78xx0_ge11_init(&rd78x00_masa_ge11_data);
>>> +
>>> +}
>>
>> Hi Gregory
>>
>> First off, the indentation looks wrong. Might be a space/tab issue.
> 
> Thanks I will fix it
> 
>>
>> I would also be tempted to place this code into board-dt.c and not
>> touch or even compile rd78x00-masa-setup.c when using DT. If i
>> remember correctly, Jason had a patch for Kirkwood which centralized
>> all the ethernet setup code. You can maybe copy/paste that.
> 
> OK I will have a look on it.

Initially I wanted to avoid duplicating the platform data, which are
the PHY address for the ethernet. But for coherency I will do the same
that it have been done in mach-kirkwood.

>>
>>> +
>>>  static int __init rd78x00_pci_init(void)
>>>  {
>>>  	/*
>>> -- 
>>> 1.8.1.2
>>>
> 
> 


-- 
Gregory Clement, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

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

end of thread, other threads:[~2013-05-20 19:18 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-19 21:39 [RFC PATCH 0/5] ARM: mv78x00: First step to convert mv78x00 to Device Tree Gregory CLEMENT
2013-05-19 21:39 ` [RFC PATCH 1/5] ARM: mv78x00: Add generic support for the Device Tree boards Gregory CLEMENT
2013-05-19 21:39 ` [RFC PATCH 2/5] ARM: mv78x00: Convert RD-78X00-mASA board to device tree Gregory CLEMENT
2013-05-20  9:52   ` Andrew Lunn
2013-05-20 10:00     ` Gregory CLEMENT
2013-05-20 19:18       ` Gregory CLEMENT
2013-05-19 21:39 ` [RFC PATCH 3/5] ARM: mv78x00: Add infrastructure to support boards converted to DT Gregory CLEMENT
2013-05-19 21:39 ` [RFC PATCH 4/5] ARM: mv78x00: Add the Device Tree support for MV78X00 family Gregory CLEMENT
2013-05-20 17:21   ` Jason Cooper
2013-05-20 17:23     ` Sebastian Hesselbarth
2013-05-20 17:28       ` Jason Cooper
2013-05-19 21:39 ` [RFC PATCH 5/5] ARM: mv78x00: Add Device Tree support for the RD-78X00-mASA board Gregory CLEMENT
2013-05-20  9:43 ` [RFC PATCH 0/5] ARM: mv78x00: First step to convert mv78x00 to Device Tree Andrew Lunn
2013-05-20  9:59   ` Gregory CLEMENT
2013-05-20 10:07     ` Andrew Lunn

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.