Skip to contentSkip to conversation

Add DT support for Network Space v2 and parents

PATCH New Simon Guinot 5 participants 16 messages Oct 17, 2012 – Nov 27, 2012

Subsystems (6)
lore
Share & tools
lore
#0 lore raw

v2 cover Add DT support for Network Space v2 and parents

This patch series provides DT support for LaCie NAS Network Space v2 and parents. This includes the following machines:
- Internet Space v2
- Network Space v2
- Network Space Max v2
- Network Space Lite v2
- Network Space Mini v2

Note that the three first boards are already supported by the Linux kernel via an "old-fashion" board setup. The two lasts (Lite and Mini) are new boards.

Also note that the first patch of the series is related with the LED subsystem. It adds device tree binding to the driver leds-ns2.

Changes for v2:
- Fix version for patch (update to v3):
"ARM: kirkwood: DT board setup for Network Space v2 and parents"
- Fix compatibility string for driver leds-ns2. Use "lacie,ns2-leds".
- leds-ns2: Remove useless #else #endif statement.

Simon Guinot (4):
leds: leds-ns2: add device tree binding
ARM: kirkwood: DT board setup for Network Space v2 and parents
ARM: kirkwood: DT board setup for Network Space Lite v2
ARM: kirkwood: DT board setup for Network Space Mini v2

 .../devicetree/bindings/gpio/leds-ns2.txt          |   26 ++++++
 arch/arm/boot/dts/Makefile                         |    5 ++
 arch/arm/boot/dts/kirkwood-is2.dts                 |   30 +++++++
 arch/arm/boot/dts/kirkwood-ns2-common.dtsi         |   63 ++++++++++++++
 arch/arm/boot/dts/kirkwood-ns2.dts                 |   30 +++++++
 arch/arm/boot/dts/kirkwood-ns2lite.dts             |   30 +++++++
 arch/arm/boot/dts/kirkwood-ns2max.dts              |   49 +++++++++++
 arch/arm/boot/dts/kirkwood-ns2mini.dts             |   49 +++++++++++
 arch/arm/mach-kirkwood/Kconfig                     |   36 ++++++++
 arch/arm/mach-kirkwood/Makefile                    |    5 ++
 arch/arm/mach-kirkwood/board-dt.c                  |   12 +++
 arch/arm/mach-kirkwood/board-ns2.c                 |   87 ++++++++++++++++++++
 arch/arm/mach-kirkwood/common.h                    |   10 +++
 drivers/leds/Kconfig                               |    4 +-
 drivers/leds/leds-ns2.c                            |   78 +++++++++++++++++-
 15 files changed, 510 insertions(+), 4 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/gpio/leds-ns2.txt
 create mode 100644 arch/arm/boot/dts/kirkwood-is2.dts
 create mode 100644 arch/arm/boot/dts/kirkwood-ns2-common.dtsi
 create mode 100644 arch/arm/boot/dts/kirkwood-ns2.dts
 create mode 100644 arch/arm/boot/dts/kirkwood-ns2lite.dts
 create mode 100644 arch/arm/boot/dts/kirkwood-ns2max.dts
 create mode 100644 arch/arm/boot/dts/kirkwood-ns2mini.dts
 create mode 100644 arch/arm/mach-kirkwood/board-ns2.c
Signature · 1 line
1.7.10
#1 lore raw

PATCH v2 1/4 leds: leds-ns2: add device tree binding

---
Changes for v2:
- Fix compatibility string. Use "lacie,ns2-leds".
- Remove useless #else #endif statement.

 .../devicetree/bindings/gpio/leds-ns2.txt          |   26 +++++++
 drivers/leds/leds-ns2.c                            |   78 +++++++++++++++++++-
 2 files changed, 101 insertions(+), 3 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/gpio/leds-ns2.txt
Documentation/devicetree/bindings/gpio/leds-ns2.txt new file +26 -0
new file mode 100644
index 0000000..aef3aca
@@ -0,0 +1,26 @@
+Binding for dual-GPIO LED found on Network Space v2 (and parents).
+
+Required properties:
+- compatible: "lacie,ns2-leds".
+
+Each LED is represented as a sub-node of the ns2-leds device.
+
+Required sub-node properties:
+- cmd-gpio: Command LED GPIO. See OF device-tree GPIO specification.
+- slow-gpio: Slow LED GPIO. See OF device-tree GPIO specification.
+
+Optional sub-node properties:
+- label: Name for this LED. If omitted, the label is taken from the node name.
+- linux,default-trigger: Trigger assigned to the LED.
+
+Example:
+
+ns2-leds {
+	compatible = "lacie,ns2-leds";
+
+	blue-sata {
+		label = "ns2:blue:sata";
+		slow-gpio = <&gpio0 29 0>;
+		cmd-gpio = <&gpio0 30 0>;
+	};
+};
drivers/leds/leds-ns2.c +75 -3

106 lines not on this page · raw message

Signature · 1 line
1.7.10
#2 lore raw

PATCH v3 2/4 ARM: kirkwood: DT board setup for Network Space v2 and parents

In reply to Simon Guinot

This patch adds DT board setup for LaCie Network Space v2 and parents, based on the Marvell Kirkwood 6281 SoC. This includes Network Space v2 (Max) and Internet Space v2.

---
Changes for v2:
- Rebased against Linux 3.7-rc1.
- Add missing Kconfig options MACH_INETSPACE_V2_DT and MACH_NETSPACE_MAX_V2_DT.
- Use ns2-leds DT binding.
- Move gpio-leds definition out from kirkwood-ns2-common.dtsi. The ns2 lite board (patch 3/4) uses a different configuration for GPIO LEDs.

Changes for v3:
- Fix patch version (update to v3).
- Fix compatibility string for driver leds-ns2. Use "lacie,ns2-leds".

 arch/arm/boot/dts/Makefile                 |    3 +
 arch/arm/boot/dts/kirkwood-is2.dts         |   30 ++++++++++
 arch/arm/boot/dts/kirkwood-ns2-common.dtsi |   63 +++++++++++++++++++++
 arch/arm/boot/dts/kirkwood-ns2.dts         |   30 ++++++++++
 arch/arm/boot/dts/kirkwood-ns2max.dts      |   49 ++++++++++++++++
 arch/arm/mach-kirkwood/Kconfig             |   21 +++++++
 arch/arm/mach-kirkwood/Makefile            |    3 +
 arch/arm/mach-kirkwood/board-dt.c          |    8 +++
 arch/arm/mach-kirkwood/board-ns2.c         |   83 ++++++++++++++++++++++++++++
 arch/arm/mach-kirkwood/common.h            |    8 +++
 drivers/leds/Kconfig                       |    4 +-
 11 files changed, 301 insertions(+), 1 deletion(-)
 create mode 100644 arch/arm/boot/dts/kirkwood-is2.dts
 create mode 100644 arch/arm/boot/dts/kirkwood-ns2-common.dtsi
 create mode 100644 arch/arm/boot/dts/kirkwood-ns2.dts
 create mode 100644 arch/arm/boot/dts/kirkwood-ns2max.dts
 create mode 100644 arch/arm/mach-kirkwood/board-ns2.c
arch/arm/boot/dts/Makefile +3 -0
index c1ce813..e6201b6 100644
@@ -34,9 +34,12 @@ dtb-$(CONFIG_ARCH_KIRKWOOD) += kirkwood-dns320.dtb \
 	kirkwood-ib62x0.dtb \
 	kirkwood-iconnect.dtb \
 	kirkwood-iomega_ix2_200.dtb \
+	kirkwood-is2.dtb \
 	kirkwood-km_kirkwood.dtb \
 	kirkwood-lschlv2.dtb \
 	kirkwood-lsxhl.dtb \
+	kirkwood-ns2.dtb \
+	kirkwood-ns2max.dtb \
 	kirkwood-ts219-6281.dtb \
 	kirkwood-ts219-6282.dtb
 dtb-$(CONFIG_ARCH_MSM) += msm8660-surf.dtb \
arch/arm/boot/dts/kirkwood-is2.dts new file +30 -0
new file mode 100644
index 0000000..0bdce0a
@@ -0,0 +1,30 @@
+/dts-v1/;
+
+/include/ "kirkwood-ns2-common.dtsi"
+
+/ {
+	model = "LaCie Internet Space v2";
+	compatible = "lacie,inetspace_v2", "marvell,kirkwood-88f6281", "marvell,kirkwood";
+
+	memory {
+		device_type = "memory";
+		reg = <0x00000000 0x8000000>;
+	};
+
+	ocp at f1000000 {
+		sata at 80000 {
+			status = "okay";
+			nr-ports = <1>;
+		};
+	};
+
+	ns2-leds {
+		compatible = "lacie,ns2-leds";
+
+		blue-sata {
+			label = "ns2:blue:sata";
+			slow-gpio = <&gpio0 29 0>;
+			cmd-gpio = <&gpio0 30 0>;
+		};
+	};
+};
arch/arm/boot/dts/kirkwood-ns2-common.dtsi new file +63 -0

63 lines not on this page · raw message

arch/arm/boot/dts/kirkwood-ns2.dts new file +30 -0
new file mode 100644
index 0000000..f2d36ecf
@@ -0,0 +1,30 @@
+/dts-v1/;
+
+/include/ "kirkwood-ns2-common.dtsi"
+
+/ {
+	model = "LaCie Network Space v2";
+	compatible = "lacie,netspace_v2", "marvell,kirkwood-88f6281", "marvell,kirkwood";
+
+	memory {
+		device_type = "memory";
+		reg = <0x00000000 0x10000000>;
+	};
+
+	ocp at f1000000 {
+		sata at 80000 {
+			status = "okay";
+			nr-ports = <1>;
+		};
+	};
+
+	ns2-leds {
+		compatible = "lacie,ns2-leds";
+
+		blue-sata {
+			label = "ns2:blue:sata";
+			slow-gpio = <&gpio0 29 0>;
+			cmd-gpio = <&gpio0 30 0>;
+		};
+	};
+};
arch/arm/boot/dts/kirkwood-ns2max.dts new file +49 -0

49 lines not on this page · raw message

arch/arm/mach-kirkwood/Kconfig +21 -0
index 50bca50..847e0c2 100644
@@ -130,6 +130,27 @@ config MACH_KM_KIRKWOOD_DT
 	  Say 'Y' here if you want your kernel to support the
 	  Keymile Kirkwood Reference Desgin, using Flattened Device Tree.
 
+config MACH_INETSPACE_V2_DT
+	bool "LaCie Internet Space v2 NAS (Flattened Device Tree)"
+	select ARCH_KIRKWOOD_DT
+	help
+	  Say 'Y' here if you want your kernel to support the LaCie
+	  Internet Space v2 NAS, using Flattened Device Tree.
+
+config MACH_NETSPACE_V2_DT
+	bool "LaCie Network Space v2 NAS (Flattened Device Tree)"
+	select ARCH_KIRKWOOD_DT
+	help
+	  Say 'Y' here if you want your kernel to support the LaCie
+	  Network Space v2 NAS, using Flattened Device Tree.
+
+config MACH_NETSPACE_MAX_V2_DT
+	bool "LaCie Network Space Max v2 NAS (Flattened Device Tree)"
+	select ARCH_KIRKWOOD_DT
+	help
+	  Say 'Y' here if you want your kernel to support the LaCie
+	  Network Space Max v2 NAS, using Flattened Device Tree.
+
 config MACH_TS219
 	bool "QNAP TS-110, TS-119, TS-119P+, TS-210, TS-219, TS-219P and TS-219P+ Turbo NAS"
 	help
arch/arm/mach-kirkwood/Makefile +3 -0
index 294779f..1f63d80 100644
@@ -31,3 +31,6 @@ obj-$(CONFIG_MACH_GOFLEXNET_DT)		+= board-goflexnet.o
 obj-$(CONFIG_MACH_LSXL_DT)		+= board-lsxl.o
 obj-$(CONFIG_MACH_IOMEGA_IX2_200_DT)	+= board-iomega_ix2_200.o
 obj-$(CONFIG_MACH_KM_KIRKWOOD_DT)	+= board-km_kirkwood.o
+obj-$(CONFIG_MACH_INETSPACE_V2_DT)	+= board-ns2.o
+obj-$(CONFIG_MACH_NETSPACE_V2_DT)	+= board-ns2.o
+obj-$(CONFIG_MACH_NETSPACE_MAX_V2_DT)	+= board-ns2.o
arch/arm/mach-kirkwood/board-dt.c +8 -0
index 70c5a28..b3e0519 100644
@@ -96,6 +96,11 @@ static void __init kirkwood_dt_init(void)
 	if (of_machine_is_compatible("keymile,km_kirkwood"))
 		km_kirkwood_init();
 
+	if (of_machine_is_compatible("lacie,inetspace_v2") ||
+	    of_machine_is_compatible("lacie,netspace_v2") ||
+	    of_machine_is_compatible("lacie,netspace_max_v2"))
+		ns2_init();
+
 	of_platform_populate(NULL, kirkwood_dt_match_table,
 			     kirkwood_auxdata_lookup, NULL);
 }
@@ -112,6 +117,9 @@ static const char *kirkwood_dt_board_compat[] = {
 	"buffalo,lsxl",
 	"iom,ix2-200",
 	"keymile,km_kirkwood",
+	"lacie,inetspace_v2",
+	"lacie,netspace_max_v2",
+	"lacie,netspace_v2",
 	NULL
 };
 
arch/arm/mach-kirkwood/board-ns2.c new file +83 -0

83 lines not on this page · raw message

arch/arm/mach-kirkwood/common.h +8 -0
index bcffd7c..2f75f3f 100644
@@ -112,6 +112,14 @@ void km_kirkwood_init(void);
 static inline void km_kirkwood_init(void) {};
 #endif
 
+#if defined(CONFIG_MACH_INETSPACE_V2_DT) || \
+	defined(CONFIG_MACH_NETSPACE_V2_DT) || \
+	defined(CONFIG_MACH_NETSPACE_MAX_V2_DT)
+void ns2_init(void);
+#else
+static inline void ns2_init(void) {};
+#endif
+
 /* early init functions not converted to fdt yet */
 char *kirkwood_id(void);
 void kirkwood_l2_init(void);
drivers/leds/Kconfig +3 -1
index f508def..e455c08 100644
@@ -379,7 +379,9 @@ config LEDS_NS2
 	tristate "LED support for Network Space v2 GPIO LEDs"
 	depends on LEDS_CLASS
 	depends on MACH_NETSPACE_V2 || MACH_INETSPACE_V2 || \
-		   MACH_NETSPACE_MAX_V2 || MACH_D2NET_V2
+		   MACH_NETSPACE_MAX_V2 || MACH_D2NET_V2 || \
+		   MACH_NETSPACE_V2_DT || MACH_INETSPACE_V2_DT || \
+		   MACH_NETSPACE_MAX_V2_DT
 	default y
 	help
 	  This option enable support for the dual-GPIO LED found on the
Signature · 1 line
1.7.10
#3 lore raw

PATCH v3 2/4 ARM: kirkwood: DT board setup for Network Space v2 and parents

Hi,

This is more directed at Jason and the other maintainers than you, Simon -- it's something I noticed when looking at his pull request.

Quoted 18 lines · Simon Guinot
arch/arm/mach-kirkwood/Kconfig +10 -0
index 50bca50..847e0c2 100644
@@ -130,6 +130,27 @@ config MACH_KM_KIRKWOOD_DT
 	  Say 'Y' here if you want your kernel to support the
 	  Keymile Kirkwood Reference Desgin, using Flattened Device Tree.
 
+config MACH_INETSPACE_V2_DT
+	bool "LaCie Internet Space v2 NAS (Flattened Device Tree)"
+	select ARCH_KIRKWOOD_DT
+	help
+	  Say 'Y' here if you want your kernel to support the LaCie
+	  Internet Space v2 NAS, using Flattened Device Tree.
+
+config MACH_NETSPACE_V2_DT
+	bool "LaCie Network Space v2 NAS (Flattened Device Tree)"
+	select ARCH_KIRKWOOD_DT

arch/arm/mach-kirkwood/Kconfig config MACH_KM_KIRKWOOD_DT · line 152

Quoted 10 lines
arch/arm/mach-kirkwood/Kconfig +10 -0
+	help
+	  Say 'Y' here if you want your kernel to support the LaCie
+	  Network Space v2 NAS, using Flattened Device Tree.
+
+config MACH_NETSPACE_MAX_V2_DT
+	bool "LaCie Network Space Max v2 NAS (Flattened Device Tree)"
+	select ARCH_KIRKWOOD_DT
+	help
+	  Say 'Y' here if you want your kernel to support the LaCie
+	  Network Space Max v2 NAS, using Flattened Device Tree.

It would be nice to get away from these config options. The whole point with device tree is to no longer have to do code changes for new similar boards.

And even then, since they share the same init function, there's no need for three options, just one.

arch/arm/mach-kirkwood/Makefile obj-$(CONFIG_MACH_GOFLEXNET_DT) += board-goflexnet.o · line 36

Quoted 11 lines
arch/arm/mach-kirkwood/Makefile +3 -0
index 294779f..1f63d80 100644
@@ -31,3 +31,6 @@ obj-$(CONFIG_MACH_GOFLEXNET_DT)		+= board-goflexnet.o
 obj-$(CONFIG_MACH_LSXL_DT)		+= board-lsxl.o
 obj-$(CONFIG_MACH_IOMEGA_IX2_200_DT)	+= board-iomega_ix2_200.o
 obj-$(CONFIG_MACH_KM_KIRKWOOD_DT)	+= board-km_kirkwood.o
+obj-$(CONFIG_MACH_INETSPACE_V2_DT)	+= board-ns2.o
+obj-$(CONFIG_MACH_NETSPACE_V2_DT)	+= board-ns2.o
+obj-$(CONFIG_MACH_NETSPACE_MAX_V2_DT)	+= board-ns2.o

Same here.

arch/arm/mach-kirkwood/board-dt.c static void __init kirkwood_dt_init(void) · line 103

Quoted 13 lines
arch/arm/mach-kirkwood/board-dt.c +5 -0
index 70c5a28..b3e0519 100644
@@ -96,6 +96,11 @@ static void __init kirkwood_dt_init(void)
 	if (of_machine_is_compatible("keymile,km_kirkwood"))
 		km_kirkwood_init();
 
+	if (of_machine_is_compatible("lacie,inetspace_v2") ||
+	    of_machine_is_compatible("lacie,netspace_v2") ||
+	    of_machine_is_compatible("lacie,netspace_max_v2"))
+		ns2_init();
+

This function is now a long sequence of if statments like the ones above. It would be great if they could be removed by moving most of the functionality implemented in the board file to the device tree. Looks like it's not a whole lot left, so that's promising. I'm guessing there's already efforts underway to take care of the last pieces.

But, until then, I think it'd be nice to make this a table driven lookup instead of a sequence of open-coded if statements. Tegra had this early on before the board files were removed too. I.e. just a table of

static struct match_table {
	char *compat;
	void (*fn)(void);
} match_table = {
	{ "lacie,inetspace_v2", ns2_init },
	{ "lacie,netspace_v2", ns2_init },
	....
}

and then an interator over that table.

arch/arm/mach-kirkwood/board-dt.c static const char *kirkwood_dt_board_compat[] = { · line 124

Quoted 9 lines
arch/arm/mach-kirkwood/board-dt.c +3 -0
@@ -112,6 +117,9 @@ static const char *kirkwood_dt_board_compat[] = {
 	"buffalo,lsxl",
 	"iom,ix2-200",
 	"keymile,km_kirkwood",
+	"lacie,inetspace_v2",
+	"lacie,netspace_max_v2",
+	"lacie,netspace_v2",
 	NULL
 };

Same here. I actually think this is a table that is no longer needed -- the board compat can/should be done on the generic compatible string instead of for each most-specific board string.

arch/arm/mach-kirkwood/board-dt.c static const char *kirkwood_dt_board_compat[] = {

Quoted 4 lines
arch/arm/mach-kirkwood/board-dt.c +4 -0
+static void ns2_power_off(void)
+{
+	gpio_set_value(NS2_GPIO_POWER_OFF, 1);
+}

This kind of thing should be possible to generalize through a generic binding.

-Olof

#4 lore raw

PATCH v3 2/4 ARM: kirkwood: DT board setup for Network Space v2 and parents

Hi Olof

We are getting near to having boards fully described in DT. The last major piece we are missing is a DT binding for the Ethernet driver. Once that is in we can remove many of these per-board files and C code in board-dt.c. However, this is not going to happen before this merge window :-(

Quoted 10 lines

Same here. I actually think this is a table that is no longer needed -- the board compat can/should be done on the generic compatible string instead of for each most-specific board string.

arch/arm/mach-kirkwood/board-ns2.c line 66

Quoted 4 lines
arch/arm/mach-kirkwood/board-ns2.c new file +4 -0
+static void ns2_power_off(void)
+{
+	gpio_set_value(NS2_GPIO_POWER_OFF, 1);
+}

This kind of thing should be possible to generalize through a generic binding.

Such a generic binding is part of the pull requests. We converted two existing boards to this new binding. However, the new boards don't make use of a lot of new features we added this cycle, including this generic binding and pinctrl. We might have time to convert them before the merge window, otherwise it will be one of the first things we do for the next cycle.

Andrew

#5 lore raw

PATCH v3 2/4 ARM: kirkwood: DT board setup for Network Space v2 and parents

Quoted 7 lines · Andrew Lunn

Hi Olof

We are getting near to having boards fully described in DT. The last major piece we are missing is a DT binding for the Ethernet driver. Once that is in we can remove many of these per-board files and C code in board-dt.c. However, this is not going to happen before this merge window :-(

Yeah, no worries about timing for 3.8 -- it'll be a nice cleanup for 3.9 or so.

Quoted 11 lines
Quoted 10 lines

Same here. I actually think this is a table that is no longer needed -- the board compat can/should be done on the generic compatible string instead of for each most-specific board string.

arch/arm/mach-kirkwood/board-ns2.c line 66

Quoted 4 lines
arch/arm/mach-kirkwood/board-ns2.c new file +4 -0
+static void ns2_power_off(void)
+{
+   gpio_set_value(NS2_GPIO_POWER_OFF, 1);
+}

This kind of thing should be possible to generalize through a generic binding.

Quoted 6 lines

Such a generic binding is part of the pull requests. We converted two existing boards to this new binding. However, the new boards don't make use of a lot of new features we added this cycle, including this generic binding and pinctrl. We might have time to convert them before the merge window, otherwise it will be one of the first things we do for the next cycle.

Yeah, I sent this based on the first branch (boards), and noticed that some things had already been taken care of in the second one (dt), and noticed that when I looked at contents when I pulled that in. Talk about quick turnaround :)

There's no time left to convert for this merge window, so please just target 3.9 instead by now -- it'll be a nice cleanup for that release.

-Olof

#6 lore raw

PATCH v3 2/4 ARM: kirkwood: DT board setup for Network Space v2 and parents

In reply to Olof Johansson
Quoted 42 lines · Olof Johansson

Hi,

This is more directed at Jason and the other maintainers than you, Simon -- it's something I noticed when looking at his pull request.

Quoted 18 lines · Simon Guinot
arch/arm/mach-kirkwood/Kconfig +10 -0
index 50bca50..847e0c2 100644
@@ -130,6 +130,27 @@ config MACH_KM_KIRKWOOD_DT
 	  Say 'Y' here if you want your kernel to support the
 	  Keymile Kirkwood Reference Desgin, using Flattened Device Tree.
 
+config MACH_INETSPACE_V2_DT
+	bool "LaCie Internet Space v2 NAS (Flattened Device Tree)"
+	select ARCH_KIRKWOOD_DT
+	help
+	  Say 'Y' here if you want your kernel to support the LaCie
+	  Internet Space v2 NAS, using Flattened Device Tree.
+
+config MACH_NETSPACE_V2_DT
+	bool "LaCie Network Space v2 NAS (Flattened Device Tree)"
+	select ARCH_KIRKWOOD_DT

arch/arm/mach-kirkwood/Kconfig config MACH_KM_KIRKWOOD_DT · line 152

Quoted 10 lines
arch/arm/mach-kirkwood/Kconfig +10 -0
+	help
+	  Say 'Y' here if you want your kernel to support the LaCie
+	  Network Space v2 NAS, using Flattened Device Tree.
+
+config MACH_NETSPACE_MAX_V2_DT
+	bool "LaCie Network Space Max v2 NAS (Flattened Device Tree)"
+	select ARCH_KIRKWOOD_DT
+	help
+	  Say 'Y' here if you want your kernel to support the LaCie
+	  Network Space Max v2 NAS, using Flattened Device Tree.

It would be nice to get away from these config options. The whole point with device tree is to no longer have to do code changes for new similar boards.

And even then, since they share the same init function, there's no need for three options, just one.

Quoted 13 lines

arch/arm/mach-kirkwood/Makefile obj-$(CONFIG_MACH_GOFLEXNET_DT) += board-goflexnet.o · line 36

Quoted 11 lines
arch/arm/mach-kirkwood/Makefile +3 -0
index 294779f..1f63d80 100644
@@ -31,3 +31,6 @@ obj-$(CONFIG_MACH_GOFLEXNET_DT)		+= board-goflexnet.o
 obj-$(CONFIG_MACH_LSXL_DT)		+= board-lsxl.o
 obj-$(CONFIG_MACH_IOMEGA_IX2_200_DT)	+= board-iomega_ix2_200.o
 obj-$(CONFIG_MACH_KM_KIRKWOOD_DT)	+= board-km_kirkwood.o
+obj-$(CONFIG_MACH_INETSPACE_V2_DT)	+= board-ns2.o
+obj-$(CONFIG_MACH_NETSPACE_V2_DT)	+= board-ns2.o
+obj-$(CONFIG_MACH_NETSPACE_MAX_V2_DT)	+= board-ns2.o

Same here.

Hi,

All this configuration options (plus those for ns2 lite and mini) are indeed useless as we are using a single init function. Moreover there is no code relying on this options in the file board-ns2.c. All the checks are made at run-time.

I will send a patch to remove this options.

Simon

Quoted 58 lines
Quoted 6 lines
arch/arm/mach-kirkwood/board-dt.c +0 -0
index 70c5a28..b3e0519 100644

arch/arm/mach-kirkwood/board-dt.c static void __init kirkwood_dt_init(void) · line 103

Quoted 8 lines
arch/arm/mach-kirkwood/board-dt.c +5 -0
@@ -96,6 +96,11 @@ static void __init kirkwood_dt_init(void)
 	if (of_machine_is_compatible("keymile,km_kirkwood"))
 		km_kirkwood_init();
 
+	if (of_machine_is_compatible("lacie,inetspace_v2") ||
+	    of_machine_is_compatible("lacie,netspace_v2") ||
+	    of_machine_is_compatible("lacie,netspace_max_v2"))
+		ns2_init();
+

This function is now a long sequence of if statments like the ones above. It would be great if they could be removed by moving most of the functionality implemented in the board file to the device tree. Looks like it's not a whole lot left, so that's promising. I'm guessing there's already efforts underway to take care of the last pieces.

But, until then, I think it'd be nice to make this a table driven lookup instead of a sequence of open-coded if statements. Tegra had this early on before the board files were removed too. I.e. just a table of

static struct match_table {
	char *compat;
	void (*fn)(void);
} match_table = {
	{ "lacie,inetspace_v2", ns2_init },
	{ "lacie,netspace_v2", ns2_init },
	....
}

and then an interator over that table.

arch/arm/mach-kirkwood/board-dt.c static const char *kirkwood_dt_board_compat[] = { · line 124

Quoted 9 lines
arch/arm/mach-kirkwood/board-dt.c +3 -0
@@ -112,6 +117,9 @@ static const char *kirkwood_dt_board_compat[] = {
 	"buffalo,lsxl",
 	"iom,ix2-200",
 	"keymile,km_kirkwood",
+	"lacie,inetspace_v2",
+	"lacie,netspace_max_v2",
+	"lacie,netspace_v2",
 	NULL
 };

Same here. I actually think this is a table that is no longer needed -- the board compat can/should be done on the generic compatible string instead of for each most-specific board string.

arch/arm/mach-kirkwood/board-dt.c static const char *kirkwood_dt_board_compat[] = {

Quoted 4 lines
arch/arm/mach-kirkwood/board-dt.c +4 -0
+static void ns2_power_off(void)
+{
+	gpio_set_value(NS2_GPIO_POWER_OFF, 1);
+}

This kind of thing should be possible to generalize through a generic binding.

Quoted 6 lines

-Olof

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20121126/60830598/attachment-0001.sig>

#7 lore raw

PATCH v3 2/4 ARM: kirkwood: DT board setup for Network Space v2 and parents

Quoted 57 lines · Simon Guinot
Quoted 42 lines · Olof Johansson

Hi,

This is more directed at Jason and the other maintainers than you, Simon -- it's something I noticed when looking at his pull request.

Quoted 18 lines · Simon Guinot
arch/arm/mach-kirkwood/Kconfig +10 -0
index 50bca50..847e0c2 100644
@@ -130,6 +130,27 @@ config MACH_KM_KIRKWOOD_DT
 	  Say 'Y' here if you want your kernel to support the
 	  Keymile Kirkwood Reference Desgin, using Flattened Device Tree.
 
+config MACH_INETSPACE_V2_DT
+	bool "LaCie Internet Space v2 NAS (Flattened Device Tree)"
+	select ARCH_KIRKWOOD_DT
+	help
+	  Say 'Y' here if you want your kernel to support the LaCie
+	  Internet Space v2 NAS, using Flattened Device Tree.
+
+config MACH_NETSPACE_V2_DT
+	bool "LaCie Network Space v2 NAS (Flattened Device Tree)"
+	select ARCH_KIRKWOOD_DT

arch/arm/mach-kirkwood/Kconfig config MACH_KM_KIRKWOOD_DT · line 152

Quoted 10 lines
arch/arm/mach-kirkwood/Kconfig +10 -0
+	help
+	  Say 'Y' here if you want your kernel to support the LaCie
+	  Network Space v2 NAS, using Flattened Device Tree.
+
+config MACH_NETSPACE_MAX_V2_DT
+	bool "LaCie Network Space Max v2 NAS (Flattened Device Tree)"
+	select ARCH_KIRKWOOD_DT
+	help
+	  Say 'Y' here if you want your kernel to support the LaCie
+	  Network Space Max v2 NAS, using Flattened Device Tree.

It would be nice to get away from these config options. The whole point with device tree is to no longer have to do code changes for new similar boards.

And even then, since they share the same init function, there's no need for three options, just one.

Quoted 13 lines

arch/arm/mach-kirkwood/Makefile obj-$(CONFIG_MACH_GOFLEXNET_DT) += board-goflexnet.o · line 36

Quoted 11 lines
arch/arm/mach-kirkwood/Makefile +3 -0
index 294779f..1f63d80 100644
@@ -31,3 +31,6 @@ obj-$(CONFIG_MACH_GOFLEXNET_DT)		+= board-goflexnet.o
 obj-$(CONFIG_MACH_LSXL_DT)		+= board-lsxl.o
 obj-$(CONFIG_MACH_IOMEGA_IX2_200_DT)	+= board-iomega_ix2_200.o
 obj-$(CONFIG_MACH_KM_KIRKWOOD_DT)	+= board-km_kirkwood.o
+obj-$(CONFIG_MACH_INETSPACE_V2_DT)	+= board-ns2.o
+obj-$(CONFIG_MACH_NETSPACE_V2_DT)	+= board-ns2.o
+obj-$(CONFIG_MACH_NETSPACE_MAX_V2_DT)	+= board-ns2.o

Same here.

Quoted 8 lines

Hi,

All this configuration options (plus those for ns2 lite and mini) are indeed useless as we are using a single init function. Moreover there is no code relying on this options in the file board-ns2.c. All the checks are made at run-time.

I will send a patch to remove this options.

No need to jump on it just yet. Nothing more is going into 3.8. We plan on cleaning up a lot of this as the first part of stuff for 3.9. It'll be easier to have one series knocking it all out as opposed to several board-specific patches from individuals.

Unless, of course, you're volunteering to do the whole cleanup. Then by all means, don't let me stand in your way. :-)

Otherwise, I'll put this series together near v3.8-rc1.

thx,

Jason.

#8 lore raw

PATCH v3 2/4 ARM: kirkwood: DT board setup for Network Space v2 and parents

Quoted 65 lines · Jason Cooper
Quoted 64 lines · Simon Guinot
Quoted 42 lines · Olof Johansson

Hi,

This is more directed at Jason and the other maintainers than you, Simon -- it's something I noticed when looking at his pull request.

Quoted 18 lines · Simon Guinot
arch/arm/mach-kirkwood/Kconfig +10 -0
index 50bca50..847e0c2 100644
@@ -130,6 +130,27 @@ config MACH_KM_KIRKWOOD_DT
 	  Say 'Y' here if you want your kernel to support the
 	  Keymile Kirkwood Reference Desgin, using Flattened Device Tree.
 
+config MACH_INETSPACE_V2_DT
+	bool "LaCie Internet Space v2 NAS (Flattened Device Tree)"
+	select ARCH_KIRKWOOD_DT
+	help
+	  Say 'Y' here if you want your kernel to support the LaCie
+	  Internet Space v2 NAS, using Flattened Device Tree.
+
+config MACH_NETSPACE_V2_DT
+	bool "LaCie Network Space v2 NAS (Flattened Device Tree)"
+	select ARCH_KIRKWOOD_DT

arch/arm/mach-kirkwood/Kconfig config MACH_KM_KIRKWOOD_DT · line 152

Quoted 10 lines
arch/arm/mach-kirkwood/Kconfig +10 -0
+	help
+	  Say 'Y' here if you want your kernel to support the LaCie
+	  Network Space v2 NAS, using Flattened Device Tree.
+
+config MACH_NETSPACE_MAX_V2_DT
+	bool "LaCie Network Space Max v2 NAS (Flattened Device Tree)"
+	select ARCH_KIRKWOOD_DT
+	help
+	  Say 'Y' here if you want your kernel to support the LaCie
+	  Network Space Max v2 NAS, using Flattened Device Tree.

It would be nice to get away from these config options. The whole point with device tree is to no longer have to do code changes for new similar boards.

And even then, since they share the same init function, there's no need for three options, just one.

Quoted 13 lines

arch/arm/mach-kirkwood/Makefile obj-$(CONFIG_MACH_GOFLEXNET_DT) += board-goflexnet.o · line 36

Quoted 11 lines
arch/arm/mach-kirkwood/Makefile +3 -0
index 294779f..1f63d80 100644
@@ -31,3 +31,6 @@ obj-$(CONFIG_MACH_GOFLEXNET_DT)		+= board-goflexnet.o
 obj-$(CONFIG_MACH_LSXL_DT)		+= board-lsxl.o
 obj-$(CONFIG_MACH_IOMEGA_IX2_200_DT)	+= board-iomega_ix2_200.o
 obj-$(CONFIG_MACH_KM_KIRKWOOD_DT)	+= board-km_kirkwood.o
+obj-$(CONFIG_MACH_INETSPACE_V2_DT)	+= board-ns2.o
+obj-$(CONFIG_MACH_NETSPACE_V2_DT)	+= board-ns2.o
+obj-$(CONFIG_MACH_NETSPACE_MAX_V2_DT)	+= board-ns2.o

Same here.

Hi,

All this configuration options (plus those for ns2 lite and mini) are indeed useless as we are using a single init function. Moreover there is no code relying on this options in the file board-ns2.c. All the checks are made at run-time.

Quoted 6 lines
Quoted 1 line

I will send a patch to remove this options.

No need to jump on it just yet. Nothing more is going into 3.8. We plan on cleaning up a lot of this as the first part of stuff for 3.9. It'll be easier to have one series knocking it all out as opposed to several board-specific patches from individuals.

About the config duplicate options, I think that the ns2 is the only problem. But if you plan to remove the board-*.c files for 3.9, maybe there is no need at all to fix the issue ?

Quoted 3 lines

Unless, of course, you're volunteering to do the whole cleanup. Then by all means, don't let me stand in your way. :-)

The whole cleanup, I don't know :) But for sure, I can help. For example, I could do the gpio-poweroff migration.

Simon

Quoted 11 lines

Otherwise, I'll put this series together near v3.8-rc1.

thx,

Jason.

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20121127/e8d0a61b/attachment.sig>

#9 lore raw

PATCH v3 2/4 ARM: kirkwood: DT board setup for Network Space v2 and parents

Quoted 68 lines · Simon Guinot
Quoted 67 lines · Jason Cooper
Quoted 65 lines · Simon Guinot
Quoted 42 lines · Olof Johansson

Hi,

This is more directed at Jason and the other maintainers than you, Simon -- it's something I noticed when looking at his pull request.

Quoted 18 lines · Simon Guinot
arch/arm/mach-kirkwood/Kconfig +10 -0
index 50bca50..847e0c2 100644
@@ -130,6 +130,27 @@ config MACH_KM_KIRKWOOD_DT
 	  Say 'Y' here if you want your kernel to support the
 	  Keymile Kirkwood Reference Desgin, using Flattened Device Tree.
 
+config MACH_INETSPACE_V2_DT
+	bool "LaCie Internet Space v2 NAS (Flattened Device Tree)"
+	select ARCH_KIRKWOOD_DT
+	help
+	  Say 'Y' here if you want your kernel to support the LaCie
+	  Internet Space v2 NAS, using Flattened Device Tree.
+
+config MACH_NETSPACE_V2_DT
+	bool "LaCie Network Space v2 NAS (Flattened Device Tree)"
+	select ARCH_KIRKWOOD_DT

arch/arm/mach-kirkwood/Kconfig config MACH_KM_KIRKWOOD_DT · line 152

Quoted 10 lines
arch/arm/mach-kirkwood/Kconfig +10 -0
+	help
+	  Say 'Y' here if you want your kernel to support the LaCie
+	  Network Space v2 NAS, using Flattened Device Tree.
+
+config MACH_NETSPACE_MAX_V2_DT
+	bool "LaCie Network Space Max v2 NAS (Flattened Device Tree)"
+	select ARCH_KIRKWOOD_DT
+	help
+	  Say 'Y' here if you want your kernel to support the LaCie
+	  Network Space Max v2 NAS, using Flattened Device Tree.

It would be nice to get away from these config options. The whole point with device tree is to no longer have to do code changes for new similar boards.

And even then, since they share the same init function, there's no need for three options, just one.

Quoted 13 lines

arch/arm/mach-kirkwood/Makefile obj-$(CONFIG_MACH_GOFLEXNET_DT) += board-goflexnet.o · line 36

Quoted 11 lines
arch/arm/mach-kirkwood/Makefile +3 -0
index 294779f..1f63d80 100644
@@ -31,3 +31,6 @@ obj-$(CONFIG_MACH_GOFLEXNET_DT)		+= board-goflexnet.o
 obj-$(CONFIG_MACH_LSXL_DT)		+= board-lsxl.o
 obj-$(CONFIG_MACH_IOMEGA_IX2_200_DT)	+= board-iomega_ix2_200.o
 obj-$(CONFIG_MACH_KM_KIRKWOOD_DT)	+= board-km_kirkwood.o
+obj-$(CONFIG_MACH_INETSPACE_V2_DT)	+= board-ns2.o
+obj-$(CONFIG_MACH_NETSPACE_V2_DT)	+= board-ns2.o
+obj-$(CONFIG_MACH_NETSPACE_MAX_V2_DT)	+= board-ns2.o

Same here.

Hi,

All this configuration options (plus those for ns2 lite and mini) are indeed useless as we are using a single init function. Moreover there is no code relying on this options in the file board-ns2.c. All the checks are made at run-time.

I will send a patch to remove this options.

Quoted 8 lines
Quoted 4 lines

No need to jump on it just yet. Nothing more is going into 3.8. We plan on cleaning up a lot of this as the first part of stuff for 3.9. It'll be easier to have one series knocking it all out as opposed to several board-specific patches from individuals.

About the config duplicate options, I think that the ns2 is the only problem. But if you plan to remove the board-*.c files for 3.9, maybe there is no need at all to fix the issue ?

Correct. I think we might have one or two outliers when we're done, but board-dt.c should just compat with marvell,kirkwood.

Quoted 5 lines
Quoted 2 lines

Unless, of course, you're volunteering to do the whole cleanup. Then by all means, don't let me stand in your way. :-)

The whole cleanup, I don't know :) But for sure, I can help. For example, I could do the gpio-poweroff migration.

That would be much appreciated. Thanks!

Jason.

#10 lore raw

PATCH v3 2/4 ARM: kirkwood: DT board setup for Network Space v2 and parents

In reply to Simon Guinot
Quoted 21 lines · Simon Guinot
Quoted 19 lines · Jason Cooper
Quoted 18 lines · Simon Guinot
Quoted 10 lines · Olof Johansson

arch/arm/mach-kirkwood/Kconfig config MACH_KM_KIRKWOOD_DT · line 152

Quoted 6 lines
arch/arm/mach-kirkwood/Kconfig +6 -0
+config MACH_NETSPACE_MAX_V2_DT
+	bool "LaCie Network Space Max v2 NAS (Flattened Device Tree)"
+	select ARCH_KIRKWOOD_DT
+	help
+	  Say 'Y' here if you want your kernel to support the LaCie
+	  Network Space Max v2 NAS, using Flattened Device Tree.

It would be nice to get away from these config options. The whole point with device tree is to no longer have to do code changes for new similar boards.

Quoted 3 lines

And even then, since they share the same init function, there's no need for three options, just one.

I will send a patch to remove this options.

Quoted 9 lines
Quoted 4 lines

No need to jump on it just yet. Nothing more is going into 3.8. We plan on cleaning up a lot of this as the first part of stuff for 3.9. It'll be easier to have one series knocking it all out as opposed to several board-specific patches from individuals.

About the config duplicate options, I think that the ns2 is the only problem. But if you plan to remove the board-*.c files for 3.9, maybe there is no need at all to fix the issue ?

Are there any plans to convert the existing non-DT kirkwood boards in 3.9, too?

Regards

Stefan Peter

Signature · 2 lines
MPL AG, Switzerland                     http://www.mpl.ch
Tel. +41 (0)56 483 34 34          Fax: +41(0)56 493 30 20
#11 lore raw

PATCH v3 2/4 ARM: kirkwood: DT board setup for Network Space v2 and parents

Quoted 2 lines · Stefan Peter

Are there any plans to convert the existing non-DT kirkwood boards in 3.9, too?

Yes, that's on the list. We were waiting for most of the drivers to be converted to DT first. Like the Dockstar, we'll leave the legacy setup file around for a few releases, then probably deprecate them.

thx,

Jason.

#12 lore raw

PATCH v2 3/4 ARM: kirkwood: DT board setup for Network Space Lite v2

In reply to Simon Guinot

This patch adds DT board setup for the LaCie NAS Network Space Lite v2. This board is derived from the Network Space v2 and a lot of hardware characteristics are shared.

- CPU: Marvell 88F6192 800Mhz
- SDRAM memory: 128MB DDR2 200Mhz
- 1 SATA port: internal
- Gigabit ethernet: PHY Marvell 88E1318
- Flash memory: SPI NOR 512KB (Macronix MX25L4005A)
- i2c EEPROM: 512 bytes (24C04 type)
- 2 USB2 ports: host and host/device
- 1 push button
- 1 SATA LED (bi-color, blue and red)

Note that the SATA LED is not compatible with the driver leds-ns2. The LED behaviour ("on", "off" or "SATA activity blink") is controlled via a single MPP (21).

---
No changes for v2.

 arch/arm/boot/dts/Makefile             |    1 +
 arch/arm/boot/dts/kirkwood-ns2lite.dts |   30 ++++++++++++++++++++++++++++++
 arch/arm/mach-kirkwood/Kconfig         |    7 +++++++
 arch/arm/mach-kirkwood/Makefile        |    1 +
 arch/arm/mach-kirkwood/board-dt.c      |    4 +++-
 arch/arm/mach-kirkwood/board-ns2.c     |    3 +++
 arch/arm/mach-kirkwood/common.h        |    3 ++-
 7 files changed, 47 insertions(+), 2 deletions(-)
 create mode 100644 arch/arm/boot/dts/kirkwood-ns2lite.dts
arch/arm/boot/dts/Makefile +1 -0
index e6201b6..42b3e90 100644
@@ -39,6 +39,7 @@ dtb-$(CONFIG_ARCH_KIRKWOOD) += kirkwood-dns320.dtb \
 	kirkwood-lschlv2.dtb \
 	kirkwood-lsxhl.dtb \
 	kirkwood-ns2.dtb \
+	kirkwood-ns2lite.dtb \
 	kirkwood-ns2max.dtb \
 	kirkwood-ts219-6281.dtb \
 	kirkwood-ts219-6282.dtb
arch/arm/boot/dts/kirkwood-ns2lite.dts new file +30 -0
new file mode 100644
index 0000000..b02eb4e
@@ -0,0 +1,30 @@
+/dts-v1/;
+
+/include/ "kirkwood-ns2-common.dtsi"
+
+/ {
+	model = "LaCie Network Space Lite v2";
+	compatible = "lacie,netspace_lite_v2", "marvell,kirkwood-88f6192", "marvell,kirkwood";
+
+	memory {
+		device_type = "memory";
+		reg = <0x00000000 0x8000000>;
+	};
+
+	ocp at f1000000 {
+		sata at 80000 {
+			status = "okay";
+			nr-ports = <1>;
+		};
+	};
+
+	gpio-leds {
+		compatible = "gpio-leds";
+
+		blue-sata {
+			label = "ns2:blue:sata";
+			gpios = <&gpio0 30 1>;
+			linux,default-trigger = "default-on";
+		};
+	};
+};
arch/arm/mach-kirkwood/Kconfig +7 -0
index 847e0c2..83df331 100644
@@ -151,6 +151,13 @@ config MACH_NETSPACE_MAX_V2_DT
 	  Say 'Y' here if you want your kernel to support the LaCie
 	  Network Space Max v2 NAS, using Flattened Device Tree.
 
+config MACH_NETSPACE_LITE_V2_DT
+	bool "LaCie Network Space Lite v2 NAS (Flattened Device Tree)"
+	select ARCH_KIRKWOOD_DT
+	help
+	  Say 'Y' here if you want your kernel to support the LaCie
+	  Network Space Lite v2 NAS, using Flattened Device Tree.
+
 config MACH_TS219
 	bool "QNAP TS-110, TS-119, TS-119P+, TS-210, TS-219, TS-219P and TS-219P+ Turbo NAS"
 	help
arch/arm/mach-kirkwood/Makefile +1 -0
index 1f63d80..4d4b7d4 100644
@@ -34,3 +34,4 @@ obj-$(CONFIG_MACH_KM_KIRKWOOD_DT)	+= board-km_kirkwood.o
 obj-$(CONFIG_MACH_INETSPACE_V2_DT)	+= board-ns2.o
 obj-$(CONFIG_MACH_NETSPACE_V2_DT)	+= board-ns2.o
 obj-$(CONFIG_MACH_NETSPACE_MAX_V2_DT)	+= board-ns2.o
+obj-$(CONFIG_MACH_NETSPACE_LITE_V2_DT)	+= board-ns2.o
arch/arm/mach-kirkwood/board-dt.c +3 -1
index b3e0519..ab7595e 100644
@@ -98,7 +98,8 @@ static void __init kirkwood_dt_init(void)
 
 	if (of_machine_is_compatible("lacie,inetspace_v2") ||
 	    of_machine_is_compatible("lacie,netspace_v2") ||
-	    of_machine_is_compatible("lacie,netspace_max_v2"))
+	    of_machine_is_compatible("lacie,netspace_max_v2") ||
+	    of_machine_is_compatible("lacie,netspace_lite_v2"))
 		ns2_init();
 
 	of_platform_populate(NULL, kirkwood_dt_match_table,
@@ -120,6 +121,7 @@ static const char *kirkwood_dt_board_compat[] = {
 	"lacie,inetspace_v2",
 	"lacie,netspace_max_v2",
 	"lacie,netspace_v2",
+	"lacie,netspace_lite_v2",
 	NULL
 };
 
arch/arm/mach-kirkwood/board-ns2.c +3 -0
index b36c55c..da8c4c5 100644
@@ -16,6 +16,7 @@
 #include <linux/platform_device.h>
 #include <linux/mv643xx_eth.h>
 #include <linux/gpio.h>
+#include <linux/of.h>
 #include "common.h"
 #include "mpp.h"
 
@@ -73,6 +74,8 @@ void __init ns2_init(void)
 	kirkwood_mpp_conf(ns2_mpp_config);
 
 	kirkwood_ehci_init();
+	if (of_machine_is_compatible("lacie,netspace_lite_v2"))
+		ns2_ge00_data.phy_addr = MV643XX_ETH_PHY_ADDR(0);
 	kirkwood_ge00_init(&ns2_ge00_data);
 
 	if (gpio_request(NS2_GPIO_POWER_OFF, "power-off") == 0 &&
arch/arm/mach-kirkwood/common.h +2 -1
index 2f75f3f..6949d81 100644
@@ -114,7 +114,8 @@ static inline void km_kirkwood_init(void) {};
 
 #if defined(CONFIG_MACH_INETSPACE_V2_DT) || \
 	defined(CONFIG_MACH_NETSPACE_V2_DT) || \
-	defined(CONFIG_MACH_NETSPACE_MAX_V2_DT)
+	defined(CONFIG_MACH_NETSPACE_MAX_V2_DT) || \
+	defined(CONFIG_MACH_NETSPACE_LITE_V2_DT)
 void ns2_init(void);
 #else
 static inline void ns2_init(void) {};
Signature · 1 line
1.7.10
#13 lore raw

PATCH v2 4/4 ARM: kirkwood: DT board setup for Network Space Mini v2

In reply to Simon Guinot

This patch adds DT board setup for the LaCie NAS Network Space Mini v2 (aka SafeBox). The hardware characteristics are very close to those of the Network Space Lite v2. The main difference are:
- A GPIO fan which is only available on the NS2 Mini.
- A single USB host port is wired on the NS2 Mini. The NS2 Lite provides an additional dual-mode USB port (host/device).

---
Changes for v2:
- Fix compatibility string for driver leds-ns2. Use "lacie,ns2-leds".

 arch/arm/boot/dts/Makefile             |    1 +
 arch/arm/boot/dts/kirkwood-ns2mini.dts |   49 ++++++++++++++++++++++++++++++++
 arch/arm/mach-kirkwood/Kconfig         |    8 ++++++
 arch/arm/mach-kirkwood/Makefile        |    1 +
 arch/arm/mach-kirkwood/board-dt.c      |    4 ++-
 arch/arm/mach-kirkwood/board-ns2.c     |    3 +-
 arch/arm/mach-kirkwood/common.h        |    3 +-
 drivers/leds/Kconfig                   |    2 +-
 8 files changed, 67 insertions(+), 4 deletions(-)
 create mode 100644 arch/arm/boot/dts/kirkwood-ns2mini.dts
arch/arm/boot/dts/Makefile +1 -0
index 42b3e90..f2af858 100644
@@ -41,6 +41,7 @@ dtb-$(CONFIG_ARCH_KIRKWOOD) += kirkwood-dns320.dtb \
 	kirkwood-ns2.dtb \
 	kirkwood-ns2lite.dtb \
 	kirkwood-ns2max.dtb \
+	kirkwood-ns2mini.dtb \
 	kirkwood-ts219-6281.dtb \
 	kirkwood-ts219-6282.dtb
 dtb-$(CONFIG_ARCH_MSM) += msm8660-surf.dtb \
arch/arm/boot/dts/kirkwood-ns2mini.dts new file +49 -0

49 lines not on this page · raw message

arch/arm/mach-kirkwood/Kconfig +8 -0
index 83df331..757bdb3 100644
@@ -158,6 +158,14 @@ config MACH_NETSPACE_LITE_V2_DT
 	  Say 'Y' here if you want your kernel to support the LaCie
 	  Network Space Lite v2 NAS, using Flattened Device Tree.
 
+config MACH_NETSPACE_MINI_V2_DT
+	bool "LaCie Network Space Mini v2 NAS (Flattened Device Tree)"
+	select ARCH_KIRKWOOD_DT
+	help
+	  Say 'Y' here if you want your kernel to support the LaCie
+	  Network Space Mini v2 NAS (aka SafeBox), using Flattened
+	  Device Tree.
+
 config MACH_TS219
 	bool "QNAP TS-110, TS-119, TS-119P+, TS-210, TS-219, TS-219P and TS-219P+ Turbo NAS"
 	help
arch/arm/mach-kirkwood/Makefile +1 -0
index 4d4b7d4..3ff4aa1 100644
@@ -35,3 +35,4 @@ obj-$(CONFIG_MACH_INETSPACE_V2_DT)	+= board-ns2.o
 obj-$(CONFIG_MACH_NETSPACE_V2_DT)	+= board-ns2.o
 obj-$(CONFIG_MACH_NETSPACE_MAX_V2_DT)	+= board-ns2.o
 obj-$(CONFIG_MACH_NETSPACE_LITE_V2_DT)	+= board-ns2.o
+obj-$(CONFIG_MACH_NETSPACE_MINI_V2_DT)	+= board-ns2.o
arch/arm/mach-kirkwood/board-dt.c +3 -1
index ab7595e..c3dd5d2 100644
@@ -99,7 +99,8 @@ static void __init kirkwood_dt_init(void)
 	if (of_machine_is_compatible("lacie,inetspace_v2") ||
 	    of_machine_is_compatible("lacie,netspace_v2") ||
 	    of_machine_is_compatible("lacie,netspace_max_v2") ||
-	    of_machine_is_compatible("lacie,netspace_lite_v2"))
+	    of_machine_is_compatible("lacie,netspace_lite_v2") ||
+	    of_machine_is_compatible("lacie,netspace_mini_v2"))
 		ns2_init();
 
 	of_platform_populate(NULL, kirkwood_dt_match_table,
@@ -122,6 +123,7 @@ static const char *kirkwood_dt_board_compat[] = {
 	"lacie,netspace_max_v2",
 	"lacie,netspace_v2",
 	"lacie,netspace_lite_v2",
+	"lacie,netspace_mini_v2",
 	NULL
 };
 
arch/arm/mach-kirkwood/board-ns2.c +2 -1
index da8c4c5..78596c4 100644
@@ -74,7 +74,8 @@ void __init ns2_init(void)
 	kirkwood_mpp_conf(ns2_mpp_config);
 
 	kirkwood_ehci_init();
-	if (of_machine_is_compatible("lacie,netspace_lite_v2"))
+	if (of_machine_is_compatible("lacie,netspace_lite_v2") ||
+	    of_machine_is_compatible("lacie,netspace_mini_v2"))
 		ns2_ge00_data.phy_addr = MV643XX_ETH_PHY_ADDR(0);
 	kirkwood_ge00_init(&ns2_ge00_data);
 
arch/arm/mach-kirkwood/common.h +2 -1
index 6949d81..95eb69b 100644
@@ -115,7 +115,8 @@ static inline void km_kirkwood_init(void) {};
 #if defined(CONFIG_MACH_INETSPACE_V2_DT) || \
 	defined(CONFIG_MACH_NETSPACE_V2_DT) || \
 	defined(CONFIG_MACH_NETSPACE_MAX_V2_DT) || \
-	defined(CONFIG_MACH_NETSPACE_LITE_V2_DT)
+	defined(CONFIG_MACH_NETSPACE_LITE_V2_DT) || \
+	defined(CONFIG_MACH_NETSPACE_MINI_V2_DT)
 void ns2_init(void);
 #else
 static inline void ns2_init(void) {};
drivers/leds/Kconfig +1 -1
index e455c08..b58bc8a 100644
@@ -381,7 +381,7 @@ config LEDS_NS2
 	depends on MACH_NETSPACE_V2 || MACH_INETSPACE_V2 || \
 		   MACH_NETSPACE_MAX_V2 || MACH_D2NET_V2 || \
 		   MACH_NETSPACE_V2_DT || MACH_INETSPACE_V2_DT || \
-		   MACH_NETSPACE_MAX_V2_DT
+		   MACH_NETSPACE_MAX_V2_DT || MACH_NETSPACE_MINI_V2_DT
 	default y
 	help
 	  This option enable support for the dual-GPIO LED found on the
Signature · 1 line
1.7.10
#14 lore raw

v2 cover Add DT support for Network Space v2 and parents

In reply to Simon Guinot
Quoted 7 lines · Simon Guinot

This patch series provides DT support for LaCie NAS Network Space v2 and parents. This includes the following machines:
- Internet Space v2
- Network Space v2
- Network Space Max v2
- Network Space Lite v2
- Network Space Mini v2

Looks good. Thanks for rebasing to 3.7-rc1.

Andrew

#15 lore raw

v2 cover Add DT support for Network Space v2 and parents

In reply to Simon Guinot
Quoted 8 lines · Simon Guinot

This patch series provides DT support for LaCie NAS Network Space v2 and parents. This includes the following machines:
- Internet Space v2
- Network Space v2
- Network Space Max v2
- Network Space Lite v2
- Network Space Mini v2

Quoted 6 lines

Note that the three first boards are already supported by the Linux kernel via an "old-fashion" board setup. The two lasts (Lite and Mini) are new boards.

Also note that the first patch of the series is related with the LED subsystem. It adds device tree binding to the driver leds-ns2.

Series applied to:

git://git.infradead.org/users/jcooper/linux.git kirkwood/boards

thx,

Jason.