Skip to contentSkip to conversation

ARM: kirkwood: convert a few more boards to DT

PATCH New Thomas Petazzoni 6 participants 30 messages Aug 1, 2013 – Oct 14, 2013

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

v2 cover ARM: kirkwood: convert a few more boards to DT

Hello,

Here is a set of patches that converts a few additional Kirkwood boards to use the Device Tree. I intend to continue this effort with the remaining Kirkwood boards. It is based on the mvebu/boards branch of linux-mvebu.git, which allows to use the Ethernet DT bindings.

Note that I don't have access to any of the platforms that are being converted in this patch series, so this means that:

- A careful review would be useful

- Testing from owners of the boards would be appreciated. The DT conversion of Kirkwood boards is a process that has now been started a while ago, and we would like to finalize it. If board owners don't react by testing the proposed patches, then the support for those boards might be broken.

To ease testing, the branch containing those changes has been pushed to:

https://github.com/MISL-EBU-System-SW/mainline-public/tree/kirkwood-dt-conversion-step1-v2

and kernel images for the affected boards have been uploaded to the following locations. They contain the correct appended DTB, and a small initramfs to ease testing:

http://free-electrons.com/~thomas/pub/kirkwood/uImage.kirkwood-d2net-v2
http://free-electrons.com/~thomas/pub/kirkwood/uImage.kirkwood-mv88f6281gtw-ge
http://free-electrons.com/~thomas/pub/kirkwood/uImage.kirkwood-net2big-v2
http://free-electrons.com/~thomas/pub/kirkwood/uImage.kirkwood-net5big-v2

In detail:

* Patch 1 converts the d2net_v2 board completely to DT.

* Patches 2, 3, 4 and 5 remove support for boards that have already been converted to the Deice Tree, but for which the legacy board file was not removed.

* Patch 6 converts the mv88f6281gtw_ge board to DT.

The remaining devices probed in a legacy way are the mv643xx_eth driver, and the DSA switch (note that I have an Armada 370 platform with a DSA switch, so I'll have to look at how to make this appear in the DT). I've left the Ethernet device not converted to DT because the interaction with the DSA switch is a bit special.

* Patch 7 converts the LaCie Net{2,5}Big v2 platforms to DT

The remaining device probed is the one managed by the leds-netxbig driver. For Ethernet, see above. For leds-netxbig, Simon Guinot is currently working on this (see the LAKML thread "Location for a kind of GPIO bus driver").

* Patch 8 removes some common code for LaCie boards that has become useless after the DT conversions.

* Patch 9 adjusts kirkwood_defconfig after the DT conversions.

Changes since v1:

* Rebased on top of linux-mvebu.git/mvebu/boards
* Use the Ethernet DT binding where possible and do the corresponding simplication.
* Use the lacie,ns2-leds driver DT binding where possible, as suggested by Simon Guinot
* Fix the LaCie Net{2,5}Big conversion, where the function doing the legacy registration of devices was not being called for board-dt.c.
* Ensure DTB files are produced for all boards.
* Fixed various mistakes in the .dts files.

Thomas

Thomas Petazzoni (9):
ARM: kirkwood: convert d2net_v2 to DT
ARM: kirkwood: remove support for legacy booting of Dockstar
ARM: kirkwood: remove support for legacy booting of Guruplug
ARM: kirkwood: remove support for legacy booting of Sheevaplug
ARM: kirkwood: remove LaCie boards that are supported through DT
ARM: kirkwood: convert the mv88f6281gtw_ge board to DT
ARM: kirkwood: convert LaCie Net{2,5}Big v2 platforms to DT
ARM: kirkwood: remove unused common code for LaCie platforms
ARM: kirkwood: update defconfig after DT conversions

 arch/arm/boot/dts/Makefile                     |   4 +
 arch/arm/boot/dts/kirkwood-d2net-v2.dts        | 231 ++++++++++++++
 arch/arm/boot/dts/kirkwood-mv88f6281gtw-ge.dts | 125 ++++++++
 arch/arm/boot/dts/kirkwood-net2big-v2.dts      | 219 +++++++++++++
 arch/arm/boot/dts/kirkwood-net5big-v2.dts      | 265 ++++++++++++++++
 arch/arm/configs/kirkwood_defconfig            |  15 +-
 arch/arm/mach-kirkwood/Kconfig                 |  96 ++----
 arch/arm/mach-kirkwood/Makefile                |  15 +-
 arch/arm/mach-kirkwood/board-dt.c              |   7 +
 arch/arm/mach-kirkwood/board-mv88f6281gtw_ge.c |  50 +++
 arch/arm/mach-kirkwood/board-netxbig_v2.c      | 199 ++++++++++++
 arch/arm/mach-kirkwood/common.h                |  12 +
 arch/arm/mach-kirkwood/d2net_v2-setup.c        | 231 --------------
 arch/arm/mach-kirkwood/dockstar-setup.c        | 111 -------
 arch/arm/mach-kirkwood/guruplug-setup.c        | 133 --------
 arch/arm/mach-kirkwood/lacie_v2-common.c       | 114 -------
 arch/arm/mach-kirkwood/lacie_v2-common.h       |  16 -
 arch/arm/mach-kirkwood/mv88f6281gtw_ge-setup.c | 172 ----------
 arch/arm/mach-kirkwood/netspace_v2-setup.c     | 293 -----------------
 arch/arm/mach-kirkwood/netxbig_v2-setup.c      | 422 -------------------------
 arch/arm/mach-kirkwood/sheevaplug-setup.c      | 161 ----------
 21 files changed, 1139 insertions(+), 1752 deletions(-)
 create mode 100644 arch/arm/boot/dts/kirkwood-d2net-v2.dts
 create mode 100644 arch/arm/boot/dts/kirkwood-mv88f6281gtw-ge.dts
 create mode 100644 arch/arm/boot/dts/kirkwood-net2big-v2.dts
 create mode 100644 arch/arm/boot/dts/kirkwood-net5big-v2.dts
 create mode 100644 arch/arm/mach-kirkwood/board-mv88f6281gtw_ge.c
 create mode 100644 arch/arm/mach-kirkwood/board-netxbig_v2.c
 delete mode 100644 arch/arm/mach-kirkwood/d2net_v2-setup.c
 delete mode 100644 arch/arm/mach-kirkwood/dockstar-setup.c
 delete mode 100644 arch/arm/mach-kirkwood/guruplug-setup.c
 delete mode 100644 arch/arm/mach-kirkwood/lacie_v2-common.c
 delete mode 100644 arch/arm/mach-kirkwood/lacie_v2-common.h
 delete mode 100644 arch/arm/mach-kirkwood/mv88f6281gtw_ge-setup.c
 delete mode 100644 arch/arm/mach-kirkwood/netspace_v2-setup.c
 delete mode 100644 arch/arm/mach-kirkwood/netxbig_v2-setup.c
 delete mode 100644 arch/arm/mach-kirkwood/sheevaplug-setup.c
Signature · 1 line
1.8.1.2
#1 lore raw

PATCH v2 1/9 ARM: kirkwood: convert d2net_v2 to DT

This commit completely converts the d2net_v2 Kirkwood board to use a Device Tree representation.

---
 arch/arm/boot/dts/Makefile              |   1 +
 arch/arm/boot/dts/kirkwood-d2net-v2.dts | 231 ++++++++++++++++++++++++++++++++
 arch/arm/mach-kirkwood/Kconfig          |   7 -
 arch/arm/mach-kirkwood/Makefile         |   2 +-
 arch/arm/mach-kirkwood/d2net_v2-setup.c | 231 --------------------------------
 5 files changed, 233 insertions(+), 239 deletions(-)
 create mode 100644 arch/arm/boot/dts/kirkwood-d2net-v2.dts
 delete mode 100644 arch/arm/mach-kirkwood/d2net_v2-setup.c
arch/arm/boot/dts/Makefile +1 -0
index 641b3c9..277685f 100644
@@ -67,6 +67,7 @@ dtb-$(CONFIG_ARCH_INTEGRATOR) += integratorap.dtb \
 	integratorcp.dtb
 dtb-$(CONFIG_ARCH_LPC32XX) += ea3250.dtb phy3250.dtb
 dtb-$(CONFIG_ARCH_KIRKWOOD) += kirkwood-cloudbox.dtb \
+	kirkwood-d2net-v2.dtb \
 	kirkwood-db-88f6281.dtb \
 	kirkwood-db-88f6282.dtb \
 	kirkwood-dns320.dtb \
arch/arm/boot/dts/kirkwood-d2net-v2.dts new file +231 -0

231 lines not on this page · raw message

arch/arm/mach-kirkwood/Kconfig +0 -7
index 60d0896..8bcd659 100644
@@ -5,13 +5,6 @@ menu "Marvell Kirkwood Implementations"
 config KIRKWOOD_LEGACY
 	bool
 
-config MACH_D2NET_V2
-	bool "LaCie d2 Network v2 NAS Board"
-	select KIRKWOOD_LEGACY
-	help
-	  Say 'Y' here if you want your kernel to support the
-	  LaCie d2 Network v2 NAS.
-
 config MACH_DOCKSTAR
 	bool "Seagate FreeAgent DockStar"
 	select KIRKWOOD_LEGACY
arch/arm/mach-kirkwood/Makefile +1 -1
index 88e2dd3..805028a 100644
@@ -1,6 +1,6 @@
 obj-y				+= common.o pcie.o
 obj-$(CONFIG_KIRKWOOD_LEGACY)	+= irq.o mpp.o
-obj-$(CONFIG_MACH_D2NET_V2)		+= d2net_v2-setup.o lacie_v2-common.o
+
 obj-$(CONFIG_MACH_DOCKSTAR)		+= dockstar-setup.o
 obj-$(CONFIG_MACH_ESATA_SHEEVAPLUG)	+= sheevaplug-setup.o
 obj-$(CONFIG_MACH_GURUPLUG)		+= guruplug-setup.o
arch/arm/mach-kirkwood/d2net_v2-setup.c deleted +0 -231

231 lines not on this page · raw message

Signature · 1 line
1.8.1.2
#2 lore raw

PATCH v2 1/9 ARM: kirkwood: convert d2net_v2 to DT

Quoted 4 lines · Thomas Petazzoni

This commit completely converts the d2net_v2 Kirkwood board to use a Device Tree representation.

Quoted 9 lines
---
 arch/arm/boot/dts/Makefile              |   1 +
 arch/arm/boot/dts/kirkwood-d2net-v2.dts | 231 ++++++++++++++++++++++++++++++++
 arch/arm/mach-kirkwood/Kconfig          |   7 -
 arch/arm/mach-kirkwood/Makefile         |   2 +-
 arch/arm/mach-kirkwood/d2net_v2-setup.c | 231 --------------------------------
 5 files changed, 233 insertions(+), 239 deletions(-)
 create mode 100644 arch/arm/boot/dts/kirkwood-d2net-v2.dts
 delete mode 100644 arch/arm/mach-kirkwood/d2net_v2-setup.c

Hi Thomas,

Thanks for this patch. I have tested on by d2net_v2 board and it is almost good. Please, see below for my comments.

Quoted 22 lines
arch/arm/boot/dts/Makefile +1 -0
index 641b3c9..277685f 100644
@@ -67,6 +67,7 @@ dtb-$(CONFIG_ARCH_INTEGRATOR) += integratorap.dtb \
 	integratorcp.dtb
 dtb-$(CONFIG_ARCH_LPC32XX) += ea3250.dtb phy3250.dtb
 dtb-$(CONFIG_ARCH_KIRKWOOD) += kirkwood-cloudbox.dtb \
+	kirkwood-d2net-v2.dtb \
 	kirkwood-db-88f6281.dtb \
 	kirkwood-db-88f6282.dtb \
 	kirkwood-dns320.dtb \
arch/arm/boot/dts/kirkwood-d2net-v2.dts new file +3 -0
new file mode 100644
index 0000000..3b2d75b
@@ -0,0 +1,231 @@
+/dts-v1/;
+
+/include/ "kirkwood.dtsi"

arch/arm/boot/dts/kirkwood-d2net-v2.dts line 13

Quoted 10 lines
arch/arm/boot/dts/kirkwood-d2net-v2.dts new file +10 -0
+/include/ "kirkwood-6281.dtsi"
+
+/ {
+	model = "LaCie d2 Network v2";
+	compatible = "lacie,d2net_v2", "marvell,kirkwood-88f6281", "marvell,kirkwood";
+
+	memory {
+		device_type = "memory";
+		/* TODO: verify memory installed on board */
+		reg = <0x00000000 0x20000000>;

The board only provides 256MB of memory (0x100000000).

Quoted 19 lines
arch/arm/boot/dts/kirkwood-d2net-v2.dts new file +19 -0
+	};
+
+	chosen {
+		bootargs = "console=ttyS0,115200n8 earlyprintk";
+	};
+
+	ocp at f1000000 {
+		pinctrl: pinctrl at 10000 {
+			pinctrl-0 = <&pmx_inhibit_poweroff
+				     &pmx_sysrst>;
+
+			pmx_spi: pmx-spi {
+				marvell,pins = "mpp0", "mpp1", "mpp2", "mpp3";
+				marvell,function = "spi";
+			};
+
+			pmx_i2c: pmx-i2c {
+				marvell,pins = "mpp8", "mpp9";
+				marvell,function = "twsi0";

arch/arm/boot/dts/kirkwood-d2net-v2.dts line 42

Quoted 10 lines
arch/arm/boot/dts/kirkwood-d2net-v2.dts new file +10 -0
+			};
+
+			pmx_uart: pmx-uart {
+				marvell,pins = "mpp10", "mpp11";
+				marvell,function = "uart0";
+			};
+
+			pmx_leds: pmx-leds {
+				marvell,pins = "mpp12";
+				marvell,function = "gpo";

"gpo" is not valid for the 6281 SoC. You could use "gpio" instead.

Quoted 121 lines
arch/arm/boot/dts/kirkwood-d2net-v2.dts new file +121 -0
+			};
+
+			pmx_keys: pmx-keys {
+				marvell,pins = "mpp13", "mpp15", "mpp34";
+				marvell,function = "gpio";
+			};
+
+			pmx_poweroff: pmx-poweroff {
+				marvell,pins = "mpp7";
+				marvell,function = "gpo";
+			};
+
+			pmx_sata_power: pmx-sata-power {
+				marvell,pins = "mpp16";
+				marvell,function = "gpio";
+			};
+
+			pmx_sata: pmx-sata {
+				marvell,pins = "mpp21";
+				marvell,function = "sata0";
+			};
+
+			pmx_usb: pmx-usb {
+				marvell,pins = "mpp14", "mpp24", "mpp26", "mpp28";
+				marvell,function = "gpio";
+			};
+
+			pmx_sysrst: pmx-sysrst {
+				marvell,pins = "mpp6";
+				marvell,function = "sysrst";
+			};
+
+			pmx_inhibit_poweroff: pmx-inhibit-poweroff {
+				marvell,pins = "mpp35";
+				marvell,function = "gpio";
+			};
+
+			pmx_cpld_leds: pmx-cpld-leds {
+				marvell,pins = "mpp29", "mpp30";
+				marvell,function = "gpio";
+			};
+		};
+
+		spi at 10600 {
+			status = "okay";
+			pinctrl-0 = <&pmx_spi>;
+			pinctrl-names = "default";
+
+			flash at 0 {
+				#address-cells = <1>;
+				#size-cells = <1>;
+				compatible = "mx25l4005a";
+				reg = <0>;
+				spi-max-frequency = <20000000>;
+				mode = <0>;
+
+				partition at 0 {
+					reg = <0x0 0x80000>;
+					label = "u-boot";
+				};
+			};
+		};
+
+		i2c at 11000 {
+			status = "okay";
+			pinctrl-0 = <&pmx_i2c>;
+			pinctrl-names = "default";
+
+			eeprom at 50 {
+				compatible = "at,24c04";
+				pagesize = <16>;
+				reg = <0x50>;
+			};
+		};
+
+		serial at 12000 {
+			status = "ok";
+			pinctrl-0 = <&pmx_uart>;
+			pinctrl-names = "default";
+		};
+
+		sata at 80000 {
+			nr-ports = <2>;
+			status = "okay";
+			pinctrl-0 = <&pmx_sata>;
+			pinctrl-names = "default";
+		};
+
+		ehci at 50000 {
+			pinctrl-0 = <&pmx_usb>;
+			pinctrl-names = "default";
+		};
+	};
+
+	gpio_keys {
+		compatible = "gpio-keys";
+		#address-cells = <1>;
+		#size-cells = <0>;
+		pinctrl-0 = <&pmx_keys>;
+		pinctrl-names = "default";
+
+		button at 1 {
+			label = "Back power switch (on|auto)";
+			linux,code = <1>;
+			linux,input-type = <5>; /* EV_SW */
+			gpios = <&gpio0 13 0>;
+		};
+
+		button at 2 {
+			label = "Back power switch (auto|off)";
+			linux,code = <2>;
+			linux,input-type = <5>; /* EV_SW */
+			gpios = <&gpio0 15 0>;
+		};
+
+		button at 3 {
+			label = "Front Push Button";
+			linux,code = <116>; /* KEY_POWER */
+			gpios = <&gpio1 2 1>;
+		};
+	};

arch/arm/boot/dts/kirkwood-d2net-v2.dts line 173

Quoted 10 lines
arch/arm/boot/dts/kirkwood-d2net-v2.dts new file +10 -0
+
+	gpio-leds {
+		compatible = "gpio-leds";
+		pinctrl-0 = <&pmx_leds>;
+		pinctrl-names = "default";
+
+		fail {
+			label = "d2net_v2:red:fail";
+			gpios = <&gpio0 12 0>;
+			default-state = "on";

"keep" is a better default-state. Else, blue and red are melted for the front LED.

Quoted 29 lines
arch/arm/boot/dts/kirkwood-d2net-v2.dts new file +29 -0
+		};
+	};
+
+	gpio_poweroff {
+		compatible = "gpio-poweroff";
+		pinctrl-0 = <&pmx_poweroff>;
+		pinctrl-names = "default";
+		gpios = <&gpio0 7 0>;
+	};
+
+	ns2-leds {
+		compatible = "lacie,ns2-leds";
+		pinctrl-0 = <&pmx_cpld_leds>;
+		pinctrl-names = "default";
+
+		blue-sata {
+			label = "d2net_v2:blue:sata";
+			slow-gpio = <&gpio0 29 0>;
+			cmd-gpio = <&gpio0 30 0>;
+		};
+	};
+
+	regulators {
+		compatible = "simple-bus";
+		pinctrl-0 = <&pmx_sata_power>;
+		pinctrl-names = "default";
+		#address-cells = <1>;
+		#size-cells = <0>;
+

arch/arm/boot/dts/kirkwood-d2net-v2.dts line 212

Quoted 10 lines
arch/arm/boot/dts/kirkwood-d2net-v2.dts new file +10 -0
+		sata0_power: regulator at 1 {
+			compatible = "regulator-fixed";
+			reg = <1>;
+			regulator-name = "SATA0 Power";
+			regulator-min-microvolt = <5000000>;
+			regulator-max-microvolt = <5000000>;
+			enable-active-high;
+			regulator-always-on;
+			regulator-boot-on;
+			gpio = <&gpio0 16 0>;

I don't know the regulator API at all. But is that possible to allow a user to enable/disable the SATA0 power ? If yes, then it should be great to have the appropriate setting.

Quoted 24 lines
arch/arm/boot/dts/kirkwood-d2net-v2.dts new file +19 -0
+		};
+	};
+};
+
+&mdio {
+	status = "okay";
+
+	ethphy0: ethernet-phy at 0 {
+		device_type = "ethernet-phy";
+		reg = <8>;
+	};
+};
+
+&eth0 {
+	status = "okay";
+	ethernet0-port at 0 {
+		phy-handle = <&ethphy0>;
+	};
+};
arch/arm/mach-kirkwood/Kconfig +0 -0
index 60d0896..8bcd659 100644

arch/arm/mach-kirkwood/Kconfig menu "Marvell Kirkwood Implementations" · line 13

Quoted 9 lines
arch/arm/mach-kirkwood/Kconfig +0 -6
@@ -5,13 +5,6 @@ menu "Marvell Kirkwood Implementations"
 config KIRKWOOD_LEGACY
 	bool
 
-config MACH_D2NET_V2
-	bool "LaCie d2 Network v2 NAS Board"
-	select KIRKWOOD_LEGACY
-	help
-	  Say 'Y' here if you want your kernel to support the
-	  LaCie d2 Network v2 NAS.

Before removing this option, we need to fix the Kconfig dependencies for the LED driver leds-ns2. I will send a patch to do that.

Thanks,

Simon
-------------- 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/20130802/38085ee6/attachment.sig>

#3 lore raw

PATCH v2 1/9 ARM: kirkwood: convert d2net_v2 to DT

Dear Simon Guinot,

I'm resuming work on this platform on other Kirkwood boards, so it's time to finally answer this e-mail.

Quoted 2 lines · Simon Guinot

Thanks for this patch. I have tested on by d2net_v2 board and it is almost good. Please, see below for my comments.

Thanks for testing!

Quoted 6 lines

arch/arm/boot/dts/kirkwood-d2net-v2.dts line 13

Quoted 4 lines
arch/arm/boot/dts/kirkwood-d2net-v2.dts new file +4 -0
+	memory {
+		device_type = "memory";
+		/* TODO: verify memory installed on board */
+		reg = <0x00000000 0x20000000>;

The board only provides 256MB of memory (0x100000000).

Will fix.

Quoted 5 lines

arch/arm/boot/dts/kirkwood-d2net-v2.dts line 42

Quoted 3 lines
arch/arm/boot/dts/kirkwood-d2net-v2.dts new file +3 -0
+			pmx_leds: pmx-leds {
+				marvell,pins = "mpp12";
+				marvell,function = "gpo";

"gpo" is not valid for the 6281 SoC. You could use "gpio" instead.

Will fix.

Quoted 7 lines

arch/arm/boot/dts/kirkwood-d2net-v2.dts line 173

Quoted 4 lines
arch/arm/boot/dts/kirkwood-d2net-v2.dts new file +4 -0
+		fail {
+			label = "d2net_v2:red:fail";
+			gpios = <&gpio0 12 0>;
+			default-state = "on";

"keep" is a better default-state. Else, blue and red are melted for the front LED.

Ok, will change.

Quoted 6 lines
Quoted 6 lines
arch/arm/boot/dts/kirkwood-d2net-v2.dts new file +6 -0
+		sata0_power: regulator at 1 {
+			compatible = "regulator-fixed";
+			reg = <1>;
+			regulator-name = "SATA0 Power";
+			regulator-min-microvolt = <5000000>;
+			regulator-max-microvolt = <5000000>;
Quoted 8 lines

arch/arm/boot/dts/kirkwood-d2net-v2.dts line 212

Quoted 4 lines
arch/arm/boot/dts/kirkwood-d2net-v2.dts new file +4 -0
+			enable-active-high;
+			regulator-always-on;
+			regulator-boot-on;
+			gpio = <&gpio0 16 0>;

I don't know the regulator API at all. But is that possible to allow a user to enable/disable the SATA0 power ? If yes, then it should be great to have the appropriate setting.

The regulator subsystem has a userspace interface in sysfs. See Documentation/ABI/testing/sysfs-class-regulator. I don't think there's anything special needed in the DT to get the regulator exposed in sysfs.

Quoted 9 lines

arch/arm/mach-kirkwood/Kconfig menu "Marvell Kirkwood Implementations" · line 13

Quoted 6 lines
arch/arm/mach-kirkwood/Kconfig +0 -6
-config MACH_D2NET_V2
-	bool "LaCie d2 Network v2 NAS Board"
-	select KIRKWOOD_LEGACY
-	help
-	  Say 'Y' here if you want your kernel to support the
-	  LaCie d2 Network v2 NAS.

Before removing this option, we need to fix the Kconfig dependencies for the LED driver leds-ns2. I will send a patch to do that.

Your patch has been taken and is part of 3.12-rc, so this part is fixed.

I'll resend soon an updated version with the changes.

Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#4 lore raw

PATCH 1/1 leds: leds-ns2: depends on ARCH_KIRKWOOD

In reply to Thomas Petazzoni

With the DT conversion, the board Kconfig symbols MACH_ are going to be removed. In order to prepare this removal, this patch replaces alls the machines dependencies for leds-ns2 by ARCH_KIRKWOOD.

---
Thomas,

Please, insert this patch in your series before the patch named:
[PATCHv2 1/9] ARM: kirkwood: convert d2net_v2 to DT

Simon

 drivers/leds/Kconfig |    5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/leds/Kconfig +1 -4
index e43402d..0e41460 100644
@@ -398,10 +398,7 @@ config LEDS_MC13783
 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_V2_DT || MACH_INETSPACE_V2_DT || \
-		   MACH_NETSPACE_MAX_V2_DT || MACH_NETSPACE_MINI_V2_DT
+	depends on ARCH_KIRKWOOD
 	default y
 	help
 	  This option enable support for the dual-GPIO LED found on the
Signature · 1 line
1.7.10.4
#5 lore raw

PATCH 1/1 leds: leds-ns2: depends on ARCH_KIRKWOOD

Quoted 8 lines · Simon Guinot

With the DT conversion, the board Kconfig symbols MACH_ are going to be removed. In order to prepare this removal, this patch replaces alls the machines dependencies for leds-ns2 by ARCH_KIRKWOOD.

---
Thomas,

Quoted 7 lines

Please, insert this patch in your series before the patch named:
[PATCHv2 1/9] ARM: kirkwood: convert d2net_v2 to DT

Simon

 drivers/leds/Kconfig |    5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

Almost missed this one. This should also go through -leds.

thx,

Jason.

#6 lore raw

PATCH 1/1 leds: leds-ns2: depends on ARCH_KIRKWOOD

Quoted 12 lines · Jason Cooper
Quoted 11 lines · Simon Guinot

With the DT conversion, the board Kconfig symbols MACH_ are going to be removed. In order to prepare this removal, this patch replaces alls the machines dependencies for leds-ns2 by ARCH_KIRKWOOD.

---
Thomas,

Please, insert this patch in your series before the patch named:
[PATCHv2 1/9] ARM: kirkwood: convert d2net_v2 to DT

Quoted 9 lines
Quoted 4 lines

Simon

 drivers/leds/Kconfig |    5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

Almost missed this one. This should also go through -leds.

Sure, looks good to me and merged into my tree with Jason's Acked-by.

Thanks,
-Bryan

#7 lore raw

PATCH v2 1/9 ARM: kirkwood: convert d2net_v2 to DT

In reply to Thomas Petazzoni

Hi,

Quoted 14 lines · Thomas Petazzoni

This commit completely converts the d2net_v2 Kirkwood board to use a Device Tree representation.

---
 arch/arm/boot/dts/Makefile              |   1 +
 arch/arm/boot/dts/kirkwood-d2net-v2.dts | 231 ++++++++++++++++++++++++++++++++
 arch/arm/mach-kirkwood/Kconfig          |   7 -
 arch/arm/mach-kirkwood/Makefile         |   2 +-
 arch/arm/mach-kirkwood/d2net_v2-setup.c | 231 --------------------------------
 5 files changed, 233 insertions(+), 239 deletions(-)
 create mode 100644 arch/arm/boot/dts/kirkwood-d2net-v2.dts
 delete mode 100644 arch/arm/mach-kirkwood/d2net_v2-setup.c

[...]

arch/arm/boot/dts/kirkwood-d2net-v2.dts line 201

Quoted 6 lines
arch/arm/boot/dts/kirkwood-d2net-v2.dts new file +6 -0
+       regulators {
+               compatible = "simple-bus";
+               pinctrl-0 = <&pmx_sata_power>;
+               pinctrl-names = "default";
+               #address-cells = <1>;
+               #size-cells = <0>;

That's not really a simple-bus if there's no mapping to the parent's address space (and it represents a completely different concept of address).

Could you explain what the pinctrl's doing here? I couldn't see what code would be handling that given the node will get probed as a simple-bus and the regulator-fixed binding doesn't mention anything about the parent node.

arch/arm/boot/dts/kirkwood-d2net-v2.dts line 205

Quoted 4 lines
arch/arm/boot/dts/kirkwood-d2net-v2.dts new file +4 -0
+
+               sata0_power: regulator at 1 {
+                       compatible = "regulator-fixed";
+                       reg = <1>;

Do we even need the unit-address?

arch/arm/boot/dts/kirkwood-d2net-v2.dts line 215

Quoted 10 lines
arch/arm/boot/dts/kirkwood-d2net-v2.dts new file +10 -0
+                       regulator-name = "SATA0 Power";
+                       regulator-min-microvolt = <5000000>;
+                       regulator-max-microvolt = <5000000>;
+                       enable-active-high;
+                       regulator-always-on;
+                       regulator-boot-on;
+                       gpio = <&gpio0 16 0>;
+               };
+       };
+};

Thanks,
Mark.

#8 lore raw

PATCH v2 1/9 ARM: kirkwood: convert d2net_v2 to DT

Dear Mark Rutland,

Quoted 10 lines · Mark Rutland

arch/arm/boot/dts/kirkwood-d2net-v2.dts line 201

Quoted 6 lines
arch/arm/boot/dts/kirkwood-d2net-v2.dts new file +6 -0
+       regulators {
+               compatible = "simple-bus";
+               pinctrl-0 = <&pmx_sata_power>;
+               pinctrl-names = "default";
+               #address-cells = <1>;
+               #size-cells = <0>;

That's not really a simple-bus if there's no mapping to the parent's address space (and it represents a completely different concept of address).

Right, but I guess it is needed for the child nodes to be considered as platform devices. There are already gazillions of .dts doing this in arch/arm/boot/dts, not only Kirkwood platforms, but also Tegra platforms, i.MX platforms and a bunch of others. While I admit it doesn't look the most appropriate representation, I believe that considering the number of existing users, solving this problem is a separate matter to the conversion of the d2net_v2 to the Device Tree.

Quoted 4 lines

Could you explain what the pinctrl's doing here? I couldn't see what code would be handling that given the node will get probed as a simple-bus and the regulator-fixed binding doesn't mention anything about the parent node.

Right, the pinctrl should be one-level down, in the DT sub-node that describes the regulator, so that it get automatically configured because the regulator driver is a platform_driver.

I'll fix this.

Quoted 6 lines

arch/arm/boot/dts/kirkwood-d2net-v2.dts line 205

Quoted 4 lines
arch/arm/boot/dts/kirkwood-d2net-v2.dts new file +4 -0
+
+               sata0_power: regulator at 1 {
+                       compatible = "regulator-fixed";
+                       reg = <1>;

Do we even need the unit-address?

No, I'll fix this one as well.

Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#9 lore raw

PATCH v2 1/9 ARM: kirkwood: convert d2net_v2 to DT

Quoted 2 lines · Thomas Petazzoni

Dear Mark Rutland,

Hi Thomas,

Quoted 13 lines · Mark Rutland
Quoted 11 lines

arch/arm/boot/dts/kirkwood-d2net-v2.dts line 201

Quoted 7 lines
arch/arm/boot/dts/kirkwood-d2net-v2.dts new file +6 -0
+       regulators {
+               compatible = "simple-bus";
+               pinctrl-0 = <&pmx_sata_power>;
+               pinctrl-names = "default";
+               #address-cells = <1>;
+               #size-cells = <0>;

That's not really a simple-bus if there's no mapping to the parent's address space (and it represents a completely different concept of address).

Quoted 7 lines

Right, but I guess it is needed for the child nodes to be considered as platform devices. There are already gazillions of .dts doing this in arch/arm/boot/dts, not only Kirkwood platforms, but also Tegra platforms, i.MX platforms and a bunch of others. While I admit it doesn't look the most appropriate representation, I believe that considering the number of existing users, solving this problem is a separate matter to the conversion of the d2net_v2 to the Device Tree.

With regards to the general abuse of simple-bus, I think that's something we need to fix up. I don't think the fact that something is generally abused is a good reason for continuing to abuse it. We already have enough maintenance nightmares and there's no reason to add to that.

Quoted 11 lines
Quoted 5 lines

Could you explain what the pinctrl's doing here? I couldn't see what code would be handling that given the node will get probed as a simple-bus and the regulator-fixed binding doesn't mention anything about the parent node.

Right, the pinctrl should be one-level down, in the DT sub-node that describes the regulator, so that it get automatically configured because the regulator driver is a platform_driver.

I'll fix this.

Ok.

Quoted 9 lines
Quoted 7 lines

arch/arm/boot/dts/kirkwood-d2net-v2.dts line 205

Quoted 5 lines
arch/arm/boot/dts/kirkwood-d2net-v2.dts new file +4 -0
+
+               sata0_power: regulator at 1 {
+                       compatible = "regulator-fixed";
+                       reg = <1>;

Do we even need the unit-address?

No, I'll fix this one as well.

As the regulator is now not in any address space as such, I'm happier having it in a simple-bus (as we won't even need to hack in a kludge to prevent addresses being translated when the driver doesn't expect it). However, if we have a simple bus we should define the mapping to the parent address space using ranges (for one thing ePAPR lists ranges as required for simple-bus).

That said, is there any reason to place the regulators under a simple-bus at all? They could just live under the root of the tree.

Cheers,
Mark.

#10 lore raw

PATCH v2 2/9 ARM: kirkwood: remove support for legacy booting of Dockstar

In reply to Thomas Petazzoni

The Kirkwood Dockstar platform has already been converted to the Device Tree, so we can remove the legacy booting option for this platform.

---
 arch/arm/mach-kirkwood/Kconfig          |   7 --
 arch/arm/mach-kirkwood/Makefile         |   1 -
 arch/arm/mach-kirkwood/dockstar-setup.c | 111 --------------------------------
 3 files changed, 119 deletions(-)
 delete mode 100644 arch/arm/mach-kirkwood/dockstar-setup.c
arch/arm/mach-kirkwood/Kconfig +0 -7
index 8bcd659..cf6c938 100644
@@ -5,13 +5,6 @@ menu "Marvell Kirkwood Implementations"
 config KIRKWOOD_LEGACY
 	bool
 
-config MACH_DOCKSTAR
-	bool "Seagate FreeAgent DockStar"
-	select KIRKWOOD_LEGACY
-	help
-	  Say 'Y' here if you want your kernel to support the
-	  Seagate FreeAgent DockStar.
-
 config MACH_ESATA_SHEEVAPLUG
 	bool "Marvell eSATA SheevaPlug Reference Board"
 	select KIRKWOOD_LEGACY
arch/arm/mach-kirkwood/Makefile +0 -1
index 805028a..5edba89 100644
@@ -1,7 +1,6 @@
 obj-y				+= common.o pcie.o
 obj-$(CONFIG_KIRKWOOD_LEGACY)	+= irq.o mpp.o
 
-obj-$(CONFIG_MACH_DOCKSTAR)		+= dockstar-setup.o
 obj-$(CONFIG_MACH_ESATA_SHEEVAPLUG)	+= sheevaplug-setup.o
 obj-$(CONFIG_MACH_GURUPLUG)		+= guruplug-setup.o
 obj-$(CONFIG_MACH_INETSPACE_V2)		+= netspace_v2-setup.o lacie_v2-common.o
arch/arm/mach-kirkwood/dockstar-setup.c deleted +0 -111

111 lines not on this page · raw message

Signature · 1 line
1.8.1.2
Applied
#11 lore raw

PATCH v2 2/9 ARM: kirkwood: remove support for legacy booting of Dockstar

Quoted 11 lines · Thomas Petazzoni

The Kirkwood Dockstar platform has already been converted to the Device Tree, so we can remove the legacy booting option for this platform.

---
 arch/arm/mach-kirkwood/Kconfig          |   7 --
 arch/arm/mach-kirkwood/Makefile         |   1 -
 arch/arm/mach-kirkwood/dockstar-setup.c | 111 --------------------------------
 3 files changed, 119 deletions(-)
 delete mode 100644 arch/arm/mach-kirkwood/dockstar-setup.c

Applied to mvebu/boards

thx,

Jason.

#12 lore raw

PATCH v2 3/9 ARM: kirkwood: remove support for legacy booting of Guruplug

In reply to Thomas Petazzoni

The Kirkwood Guruplug platform has already been converted to the Device Tree, so we can remove the legacy booting option for this platform.

---
 arch/arm/mach-kirkwood/Kconfig          |   7 --
 arch/arm/mach-kirkwood/Makefile         |   1 -
 arch/arm/mach-kirkwood/guruplug-setup.c | 133 --------------------------------
 3 files changed, 141 deletions(-)
 delete mode 100644 arch/arm/mach-kirkwood/guruplug-setup.c
arch/arm/mach-kirkwood/Kconfig +0 -7
index cf6c938..1d100f6 100644
@@ -12,13 +12,6 @@ config MACH_ESATA_SHEEVAPLUG
 	  Say 'Y' here if you want your kernel to support the
 	  Marvell eSATA SheevaPlug Reference Board.
 
-config MACH_GURUPLUG
-	bool "Marvell GuruPlug Reference Board"
-	select KIRKWOOD_LEGACY
-	help
-	  Say 'Y' here if you want your kernel to support the
-	  Marvell GuruPlug Reference Board.
-
 config MACH_INETSPACE_V2
 	bool "LaCie Internet Space v2 NAS Board"
 	select KIRKWOOD_LEGACY
arch/arm/mach-kirkwood/Makefile +0 -1
index 5edba89..157be02 100644
@@ -2,7 +2,6 @@ obj-y				+= common.o pcie.o
 obj-$(CONFIG_KIRKWOOD_LEGACY)	+= irq.o mpp.o
 
 obj-$(CONFIG_MACH_ESATA_SHEEVAPLUG)	+= sheevaplug-setup.o
-obj-$(CONFIG_MACH_GURUPLUG)		+= guruplug-setup.o
 obj-$(CONFIG_MACH_INETSPACE_V2)		+= netspace_v2-setup.o lacie_v2-common.o
 obj-$(CONFIG_MACH_MV88F6281GTW_GE)	+= mv88f6281gtw_ge-setup.o
 obj-$(CONFIG_MACH_NET2BIG_V2)		+= netxbig_v2-setup.o lacie_v2-common.o
arch/arm/mach-kirkwood/guruplug-setup.c deleted +0 -133

133 lines not on this page · raw message

Signature · 1 line
1.8.1.2
#13 lore raw

PATCH v2 3/9 ARM: kirkwood: remove support for legacy booting of Guruplug

Quoted 12 lines · Thomas Petazzoni

The Kirkwood Guruplug platform has already been converted to the Device Tree, so we can remove the legacy booting option for this platform.

---
 arch/arm/mach-kirkwood/Kconfig          |   7 --
 arch/arm/mach-kirkwood/Makefile         |   1 -
 arch/arm/mach-kirkwood/guruplug-setup.c | 133 --------------------------------
 3 files changed, 141 deletions(-)
 delete mode 100644 arch/arm/mach-kirkwood/guruplug-setup.c

...

Quoted 1 line
arch/arm/mach-kirkwood/guruplug-setup.c +0 -0

...

arch/arm/mach-kirkwood/guruplug-setup.c line 52

Quoted 3 lines
arch/arm/mach-kirkwood/guruplug-setup.c +0 -3
-static struct mv_sata_platform_data guruplug_sata_data = {
-	.n_ports	= 1,
-};

This just caught my eye. iirc, there were two flavors of the Guruplug, the Guruplug, and the Guruplug Server Plus (had eSATA plus something else).

Nothing needs to be done with this patch, just making a note that we should look into doing an extra dts file for the Guruplug.

thx,

Jason.

#14 lore raw

PATCH v2 3/9 ARM: kirkwood: remove support for legacy booting of Guruplug

Quoted 16 lines · Jason Cooper
Quoted 12 lines · Thomas Petazzoni

The Kirkwood Guruplug platform has already been converted to the Device Tree, so we can remove the legacy booting option for this platform.

---
 arch/arm/mach-kirkwood/Kconfig          |   7 --
 arch/arm/mach-kirkwood/Makefile         |   1 -
 arch/arm/mach-kirkwood/guruplug-setup.c | 133 --------------------------------
 3 files changed, 141 deletions(-)
 delete mode 100644 arch/arm/mach-kirkwood/guruplug-setup.c

...

Quoted 1 line
arch/arm/mach-kirkwood/guruplug-setup.c +0 -0

...

Quoted 7 lines

arch/arm/mach-kirkwood/guruplug-setup.c line 52

Quoted 3 lines
arch/arm/mach-kirkwood/guruplug-setup.c +0 -3
-static struct mv_sata_platform_data guruplug_sata_data = {
-	.n_ports	= 1,
-};

This just caught my eye. iirc, there were two flavors of the Guruplug, the Guruplug, and the Guruplug Server Plus (had eSATA plus something else).

the difference between the guruplug server and the server plus is that there's one extra ethernet port and a eSATA port on server plus (iirc, there's also the guruplug display but it's a very different beast)

Arnaud

#15 lore raw

PATCH v2 4/9 ARM: kirkwood: remove support for legacy booting of Sheevaplug

In reply to Thomas Petazzoni

The Kirkwood Sheevaplug platform has already been converted to the Device Tree, so we can remove the legacy booting option for this platform.

---
 arch/arm/mach-kirkwood/Kconfig            |  14 ---
 arch/arm/mach-kirkwood/Makefile           |   2 -
 arch/arm/mach-kirkwood/sheevaplug-setup.c | 161 ------------------------------
 3 files changed, 177 deletions(-)
 delete mode 100644 arch/arm/mach-kirkwood/sheevaplug-setup.c
arch/arm/mach-kirkwood/Kconfig +0 -14
index 1d100f6..cb4688e 100644
@@ -5,13 +5,6 @@ menu "Marvell Kirkwood Implementations"
 config KIRKWOOD_LEGACY
 	bool
 
-config MACH_ESATA_SHEEVAPLUG
-	bool "Marvell eSATA SheevaPlug Reference Board"
-	select KIRKWOOD_LEGACY
-	help
-	  Say 'Y' here if you want your kernel to support the
-	  Marvell eSATA SheevaPlug Reference Board.
-
 config MACH_INETSPACE_V2
 	bool "LaCie Internet Space v2 NAS Board"
 	select KIRKWOOD_LEGACY
@@ -93,13 +86,6 @@ config MACH_RD88F6281
 	  Say 'Y' here if you want your kernel to support the
 	  Marvell RD-88F6281 Reference Board.
 
-config MACH_SHEEVAPLUG
-	bool "Marvell SheevaPlug Reference Board"
-	select KIRKWOOD_LEGACY
-	help
-	  Say 'Y' here if you want your kernel to support the
-	  Marvell SheevaPlug Reference Board.
-
 config MACH_T5325
 	bool "HP t5325 Thin Client"
 	select KIRKWOOD_LEGACY
arch/arm/mach-kirkwood/Makefile +0 -2
index 157be02..2d1eb52 100644
@@ -1,7 +1,6 @@
 obj-y				+= common.o pcie.o
 obj-$(CONFIG_KIRKWOOD_LEGACY)	+= irq.o mpp.o
 
-obj-$(CONFIG_MACH_ESATA_SHEEVAPLUG)	+= sheevaplug-setup.o
 obj-$(CONFIG_MACH_INETSPACE_V2)		+= netspace_v2-setup.o lacie_v2-common.o
 obj-$(CONFIG_MACH_MV88F6281GTW_GE)	+= mv88f6281gtw_ge-setup.o
 obj-$(CONFIG_MACH_NET2BIG_V2)		+= netxbig_v2-setup.o lacie_v2-common.o
@@ -11,7 +10,6 @@ obj-$(CONFIG_MACH_NETSPACE_V2)		+= netspace_v2-setup.o lacie_v2-common.o
 obj-$(CONFIG_MACH_OPENRD)		+= openrd-setup.o
 obj-$(CONFIG_MACH_RD88F6192_NAS)	+= rd88f6192-nas-setup.o
 obj-$(CONFIG_MACH_RD88F6281)		+= rd88f6281-setup.o
-obj-$(CONFIG_MACH_SHEEVAPLUG)		+= sheevaplug-setup.o
 obj-$(CONFIG_MACH_T5325)		+= t5325-setup.o
 obj-$(CONFIG_MACH_TS219)		+= ts219-setup.o tsx1x-common.o
 obj-$(CONFIG_MACH_TS41X)		+= ts41x-setup.o tsx1x-common.o
arch/arm/mach-kirkwood/sheevaplug-setup.c deleted +0 -161

161 lines not on this page · raw message

Signature · 1 line
1.8.1.2
#16 lore raw

PATCH v2 5/9 ARM: kirkwood: remove LaCie boards that are supported through DT

In reply to Thomas Petazzoni

The "LaCie Internet Space v2 NAS Board", "LaCie Network Space Max v2 NAS Board" and "LaCie Network Space v2 NAS Board" boards are all supported through the Device Tree.

---
 arch/arm/mach-kirkwood/Kconfig             |  21 ---
 arch/arm/mach-kirkwood/Makefile            |   3 -
 arch/arm/mach-kirkwood/netspace_v2-setup.c | 293 -----------------------------
 3 files changed, 317 deletions(-)
 delete mode 100644 arch/arm/mach-kirkwood/netspace_v2-setup.c
arch/arm/mach-kirkwood/Kconfig +0 -21
index cb4688e..48c61ad 100644
@@ -5,13 +5,6 @@ menu "Marvell Kirkwood Implementations"
 config KIRKWOOD_LEGACY
 	bool
 
-config MACH_INETSPACE_V2
-	bool "LaCie Internet Space v2 NAS Board"
-	select KIRKWOOD_LEGACY
-	help
-	  Say 'Y' here if you want your kernel to support the
-	  LaCie Internet Space v2 NAS.
-
 config MACH_MV88F6281GTW_GE
 	bool "Marvell 88F6281 GTW GE Board"
 	select KIRKWOOD_LEGACY
@@ -33,20 +26,6 @@ config MACH_NET5BIG_V2
 	  Say 'Y' here if you want your kernel to support the
 	  LaCie 5Big Network v2 NAS.
 
-config MACH_NETSPACE_MAX_V2
-	bool "LaCie Network Space Max v2 NAS Board"
-	select KIRKWOOD_LEGACY
-	help
-	  Say 'Y' here if you want your kernel to support the
-	  LaCie Network Space Max v2 NAS.
-
-config MACH_NETSPACE_V2
-	bool "LaCie Network Space v2 NAS Board"
-	select KIRKWOOD_LEGACY
-	help
-	  Say 'Y' here if you want your kernel to support the
-	  LaCie Network Space v2 NAS.
-
 config MACH_OPENRD
 	select KIRKWOOD_LEGACY
         bool
arch/arm/mach-kirkwood/Makefile +0 -3
index 2d1eb52..c58723d 100644
@@ -1,12 +1,9 @@
 obj-y				+= common.o pcie.o
 obj-$(CONFIG_KIRKWOOD_LEGACY)	+= irq.o mpp.o
 
-obj-$(CONFIG_MACH_INETSPACE_V2)		+= netspace_v2-setup.o lacie_v2-common.o
 obj-$(CONFIG_MACH_MV88F6281GTW_GE)	+= mv88f6281gtw_ge-setup.o
 obj-$(CONFIG_MACH_NET2BIG_V2)		+= netxbig_v2-setup.o lacie_v2-common.o
 obj-$(CONFIG_MACH_NET5BIG_V2)		+= netxbig_v2-setup.o lacie_v2-common.o
-obj-$(CONFIG_MACH_NETSPACE_MAX_V2)	+= netspace_v2-setup.o lacie_v2-common.o
-obj-$(CONFIG_MACH_NETSPACE_V2)		+= netspace_v2-setup.o lacie_v2-common.o
 obj-$(CONFIG_MACH_OPENRD)		+= openrd-setup.o
 obj-$(CONFIG_MACH_RD88F6192_NAS)	+= rd88f6192-nas-setup.o
 obj-$(CONFIG_MACH_RD88F6281)		+= rd88f6281-setup.o
arch/arm/mach-kirkwood/netspace_v2-setup.c deleted +0 -293

293 lines not on this page · raw message

Signature · 1 line
1.8.1.2
#17 lore raw

PATCH v2 6/9 ARM: kirkwood: convert the mv88f6281gtw_ge board to DT

In reply to Thomas Petazzoni

This commit converts the mv88f6281gtw_ge Kirkwood board to use a Device Tree representation, except for the Ethernet devices and the DSA switch. Even though the mv643xx_eth driver has a DT binding, converting this board to use it is for now left on the side because it doesn't use a simple PHY, but a DSA switch instead.

---
 arch/arm/boot/dts/Makefile                     |   1 +
 arch/arm/boot/dts/kirkwood-mv88f6281gtw-ge.dts | 125 ++++++++++++++++++
 arch/arm/mach-kirkwood/Kconfig                 |  14 +-
 arch/arm/mach-kirkwood/Makefile                |   2 +-
 arch/arm/mach-kirkwood/board-dt.c              |   3 +
 arch/arm/mach-kirkwood/board-mv88f6281gtw_ge.c |  50 +++++++
 arch/arm/mach-kirkwood/common.h                |   6 +
 arch/arm/mach-kirkwood/mv88f6281gtw_ge-setup.c | 172 -------------------------
 8 files changed, 193 insertions(+), 180 deletions(-)
 create mode 100644 arch/arm/boot/dts/kirkwood-mv88f6281gtw-ge.dts
 create mode 100644 arch/arm/mach-kirkwood/board-mv88f6281gtw_ge.c
 delete mode 100644 arch/arm/mach-kirkwood/mv88f6281gtw_ge-setup.c
arch/arm/boot/dts/Makefile +1 -0
index 277685f..d168bed 100644
@@ -84,6 +84,7 @@ dtb-$(CONFIG_ARCH_KIRKWOOD) += kirkwood-cloudbox.dtb \
 	kirkwood-lschlv2.dtb \
 	kirkwood-lsxhl.dtb \
 	kirkwood-mplcec4.dtb \
+	kirkwood-mv88f6281gtw-ge.dtb \
 	kirkwood-netgear_readynas_duo_v2.dtb \
 	kirkwood-ns2.dtb \
 	kirkwood-ns2lite.dtb \
arch/arm/boot/dts/kirkwood-mv88f6281gtw-ge.dts new file +125 -0

125 lines not on this page · raw message

arch/arm/mach-kirkwood/Kconfig +7 -7
index 48c61ad..f624162 100644
@@ -5,13 +5,6 @@ menu "Marvell Kirkwood Implementations"
 config KIRKWOOD_LEGACY
 	bool
 
-config MACH_MV88F6281GTW_GE
-	bool "Marvell 88F6281 GTW GE Board"
-	select KIRKWOOD_LEGACY
-	help
-	  Say 'Y' here if you want your kernel to support the
-	  Marvell 88F6281 GTW GE Board.
-
 config MACH_NET2BIG_V2
 	bool "LaCie 2Big Network v2 NAS Board"
 	select KIRKWOOD_LEGACY
@@ -113,6 +106,13 @@ config MACH_DLINK_KIRKWOOD_DT
 	  Kirkwood-based D-Link NASes such as DNS-320 & DNS-325,
 	  using Flattened Device Tree.
 
+config MACH_MV88F6281GTW_GE_DT
+	bool "Marvell 88F6281 GTW GE Board (Flattened Device Tree)"
+	select ARCH_KIRKWOOD_DT
+	help
+	  Say 'Y' here if you want your kernel to support the
+	  Marvell 88F6281 GTW GE Board (Flattened Device Tree).
+
 endmenu
 
 endif
arch/arm/mach-kirkwood/Makefile +1 -1
index c58723d..0dcc5d4 100644
@@ -1,7 +1,6 @@
 obj-y				+= common.o pcie.o
 obj-$(CONFIG_KIRKWOOD_LEGACY)	+= irq.o mpp.o
 
-obj-$(CONFIG_MACH_MV88F6281GTW_GE)	+= mv88f6281gtw_ge-setup.o
 obj-$(CONFIG_MACH_NET2BIG_V2)		+= netxbig_v2-setup.o lacie_v2-common.o
 obj-$(CONFIG_MACH_NET5BIG_V2)		+= netxbig_v2-setup.o lacie_v2-common.o
 obj-$(CONFIG_MACH_OPENRD)		+= openrd-setup.o
@@ -13,3 +12,4 @@ obj-$(CONFIG_MACH_TS41X)		+= ts41x-setup.o tsx1x-common.o
 
 obj-$(CONFIG_ARCH_KIRKWOOD_DT)		+= board-dt.o
 obj-$(CONFIG_MACH_DLINK_KIRKWOOD_DT)	+= board-dnskw.o
+obj-$(CONFIG_MACH_MV88F6281GTW_GE_DT)	+= board-mv88f6281gtw_ge.o
arch/arm/mach-kirkwood/board-dt.c +3 -0
index fac0f8e..b129c65 100644
@@ -109,6 +109,9 @@ static void __init kirkwood_dt_init(void)
 	if (of_machine_is_compatible("dlink,dns-kirkwood"))
 		dnskw_init();
 
+	if (of_machine_is_compatible("marvell,mv88f6281gtw-ge"))
+		mv88f6281gtw_ge_init();
+
 	of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
 }
 
arch/arm/mach-kirkwood/board-mv88f6281gtw_ge.c new file +50 -0

50 lines not on this page · raw message

arch/arm/mach-kirkwood/common.h +6 -0
index 9d8caae..cc639bb 100644
@@ -65,6 +65,12 @@ void dnskw_init(void);
 static inline void dnskw_init(void) {};
 #endif
 
+#ifdef CONFIG_MACH_MV88F6281GTW_GE_DT
+void mv88f6281gtw_ge_init(void);
+#else
+static inline void mv88f6281gtw_ge_init(void) {};
+#endif
+
 /* early init functions not converted to fdt yet */
 char *kirkwood_id(void);
 void kirkwood_l2_init(void);
arch/arm/mach-kirkwood/mv88f6281gtw_ge-setup.c deleted +0 -172

172 lines not on this page · raw message

Signature · 1 line
1.8.1.2
#18 lore raw

PATCH v2 7/9 ARM: kirkwood: convert LaCie Net{2, 5}Big v2 platforms to DT

In reply to Thomas Petazzoni

This commit converts the LaCie Net2big and Net5Big Kirkwood boards to use a Device Tree representation. All devices are converted to use a DT representation, except the GPIO extension leds that use a special leds-netxbig driver that does not yet have a DT binding.

---
 arch/arm/boot/dts/Makefile                |   2 +
 arch/arm/boot/dts/kirkwood-net2big-v2.dts | 219 ++++++++++++++++
 arch/arm/boot/dts/kirkwood-net5big-v2.dts | 265 +++++++++++++++++++
 arch/arm/mach-kirkwood/Kconfig            |  26 +-
 arch/arm/mach-kirkwood/Makefile           |   4 +-
 arch/arm/mach-kirkwood/board-dt.c         |   4 +
 arch/arm/mach-kirkwood/board-netxbig_v2.c | 199 ++++++++++++++
 arch/arm/mach-kirkwood/common.h           |   6 +
 arch/arm/mach-kirkwood/netxbig_v2-setup.c | 422 ------------------------------
 9 files changed, 709 insertions(+), 438 deletions(-)
 create mode 100644 arch/arm/boot/dts/kirkwood-net2big-v2.dts
 create mode 100644 arch/arm/boot/dts/kirkwood-net5big-v2.dts
 create mode 100644 arch/arm/mach-kirkwood/board-netxbig_v2.c
 delete mode 100644 arch/arm/mach-kirkwood/netxbig_v2-setup.c
arch/arm/boot/dts/Makefile +2 -0
index d168bed..20a6886 100644
@@ -85,6 +85,8 @@ dtb-$(CONFIG_ARCH_KIRKWOOD) += kirkwood-cloudbox.dtb \
 	kirkwood-lsxhl.dtb \
 	kirkwood-mplcec4.dtb \
 	kirkwood-mv88f6281gtw-ge.dtb \
+	kirkwood-net2big-v2.dtb \
+	kirkwood-net5big-v2.dtb \
 	kirkwood-netgear_readynas_duo_v2.dtb \
 	kirkwood-ns2.dtb \
 	kirkwood-ns2lite.dtb \
arch/arm/boot/dts/kirkwood-net2big-v2.dts new file +219 -0

219 lines not on this page · raw message

arch/arm/boot/dts/kirkwood-net5big-v2.dts new file +265 -0

265 lines not on this page · raw message

arch/arm/mach-kirkwood/Kconfig +12 -14
index f624162..b7e66fa 100644
@@ -5,20 +5,6 @@ menu "Marvell Kirkwood Implementations"
 config KIRKWOOD_LEGACY
 	bool
 
-config MACH_NET2BIG_V2
-	bool "LaCie 2Big Network v2 NAS Board"
-	select KIRKWOOD_LEGACY
-	help
-	  Say 'Y' here if you want your kernel to support the
-	  LaCie 2Big Network v2 NAS.
-
-config MACH_NET5BIG_V2
-	bool "LaCie 5Big Network v2 NAS Board"
-	select KIRKWOOD_LEGACY
-	help
-	  Say 'Y' here if you want your kernel to support the
-	  LaCie 5Big Network v2 NAS.
-
 config MACH_OPENRD
 	select KIRKWOOD_LEGACY
         bool
@@ -113,6 +99,18 @@ config MACH_MV88F6281GTW_GE_DT
 	  Say 'Y' here if you want your kernel to support the
 	  Marvell 88F6281 GTW GE Board (Flattened Device Tree).
 
+config MACH_NET2BIG_V2_DT
+	bool "LaCie 2Big Network v2 NAS Board (Flattened Device Tree)"
+	help
+	  Say 'Y' here if you want your kernel to support the
+	  LaCie 2Big Network v2 NAS  (Flattened Device Tree).
+
+config MACH_NET5BIG_V2_DT
+	bool "LaCie 5Big Network v2 NAS Board (Flattened Device Tree)"
+	help
+	  Say 'Y' here if you want your kernel to support the
+	  LaCie 5Big Network v2 NAS  (Flattened Device Tree).
+
 endmenu
 
 endif
arch/arm/mach-kirkwood/Makefile +2 -2
index 0dcc5d4..38d0d74 100644
@@ -1,8 +1,6 @@
 obj-y				+= common.o pcie.o
 obj-$(CONFIG_KIRKWOOD_LEGACY)	+= irq.o mpp.o
 
-obj-$(CONFIG_MACH_NET2BIG_V2)		+= netxbig_v2-setup.o lacie_v2-common.o
-obj-$(CONFIG_MACH_NET5BIG_V2)		+= netxbig_v2-setup.o lacie_v2-common.o
 obj-$(CONFIG_MACH_OPENRD)		+= openrd-setup.o
 obj-$(CONFIG_MACH_RD88F6192_NAS)	+= rd88f6192-nas-setup.o
 obj-$(CONFIG_MACH_RD88F6281)		+= rd88f6281-setup.o
@@ -13,3 +11,5 @@ obj-$(CONFIG_MACH_TS41X)		+= ts41x-setup.o tsx1x-common.o
 obj-$(CONFIG_ARCH_KIRKWOOD_DT)		+= board-dt.o
 obj-$(CONFIG_MACH_DLINK_KIRKWOOD_DT)	+= board-dnskw.o
 obj-$(CONFIG_MACH_MV88F6281GTW_GE_DT)	+= board-mv88f6281gtw_ge.o
+obj-$(CONFIG_MACH_NET2BIG_V2)		+= board-netxbig_v2.o
+obj-$(CONFIG_MACH_NET5BIG_V2)		+= board-netxbig_v2.o
arch/arm/mach-kirkwood/board-dt.c +4 -0
index b129c65..80955cc 100644
@@ -112,6 +112,10 @@ static void __init kirkwood_dt_init(void)
 	if (of_machine_is_compatible("marvell,mv88f6281gtw-ge"))
 		mv88f6281gtw_ge_init();
 
+	if (of_machine_is_compatible("lacie,net2big-v2") ||
+	    of_machine_is_compatible("lacie,net5big-v2"))
+		netxbig_v2_init();
+
 	of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
 }
 
arch/arm/mach-kirkwood/board-netxbig_v2.c new file +199 -0

199 lines not on this page · raw message

arch/arm/mach-kirkwood/common.h +6 -0
index cc639bb..a9010a3 100644
@@ -71,6 +71,12 @@ void mv88f6281gtw_ge_init(void);
 static inline void mv88f6281gtw_ge_init(void) {};
 #endif
 
+#if defined(MACH_NET2BIG_V2_DT) || defined(MACH_NET5BIG_V2_DT)
+void netxbig_v2_init(void);
+#else
+static inline void netxbig_v2_init(void) {};
+#endif
+
 /* early init functions not converted to fdt yet */
 char *kirkwood_id(void);
 void kirkwood_l2_init(void);
arch/arm/mach-kirkwood/netxbig_v2-setup.c deleted +0 -422

422 lines not on this page · raw message

Signature · 1 line
1.8.1.2
#19 lore raw

PATCH v2 7/9 ARM: kirkwood: convert LaCie Net{2, 5}Big v2 platforms to DT

Quoted 6 lines · Thomas Petazzoni

This commit converts the LaCie Net2big and Net5Big Kirkwood boards to use a Device Tree representation. All devices are converted to use a DT representation, except the GPIO extension leds that use a special leds-netxbig driver that does not yet have a DT binding.

Quoted 15 lines
---
 arch/arm/boot/dts/Makefile                |   2 +
 arch/arm/boot/dts/kirkwood-net2big-v2.dts | 219 ++++++++++++++++
 arch/arm/boot/dts/kirkwood-net5big-v2.dts | 265 +++++++++++++++++++
 arch/arm/mach-kirkwood/Kconfig            |  26 +-
 arch/arm/mach-kirkwood/Makefile           |   4 +-
 arch/arm/mach-kirkwood/board-dt.c         |   4 +
 arch/arm/mach-kirkwood/board-netxbig_v2.c | 199 ++++++++++++++
 arch/arm/mach-kirkwood/common.h           |   6 +
 arch/arm/mach-kirkwood/netxbig_v2-setup.c | 422 ------------------------------
 9 files changed, 709 insertions(+), 438 deletions(-)
 create mode 100644 arch/arm/boot/dts/kirkwood-net2big-v2.dts
 create mode 100644 arch/arm/boot/dts/kirkwood-net5big-v2.dts
 create mode 100644 arch/arm/mach-kirkwood/board-netxbig_v2.c
 delete mode 100644 arch/arm/mach-kirkwood/netxbig_v2-setup.c

Again, thanks for this patch. Please, see my comments below.

Quoted 32 lines
arch/arm/boot/dts/Makefile +2 -0
index d168bed..20a6886 100644
@@ -85,6 +85,8 @@ dtb-$(CONFIG_ARCH_KIRKWOOD) += kirkwood-cloudbox.dtb \
 	kirkwood-lsxhl.dtb \
 	kirkwood-mplcec4.dtb \
 	kirkwood-mv88f6281gtw-ge.dtb \
+	kirkwood-net2big-v2.dtb \
+	kirkwood-net5big-v2.dtb \
 	kirkwood-netgear_readynas_duo_v2.dtb \
 	kirkwood-ns2.dtb \
 	kirkwood-ns2lite.dtb \
arch/arm/boot/dts/kirkwood-net2big-v2.dts new file +12 -0
new file mode 100644
index 0000000..608ef01
@@ -0,0 +1,219 @@
+/*
+ * LaCie 2Big Network v2
+ *
+ * Simon Guinot <[email protected]>
+ *
+ * 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/;
+

arch/arm/boot/dts/kirkwood-net2big-v2.dts line 22

Quoted 10 lines
arch/arm/boot/dts/kirkwood-net2big-v2.dts new file +10 -0
+/include/ "kirkwood.dtsi"
+/include/ "kirkwood-6281.dtsi"
+
+/ {
+	model = "LaCie 2Big Network v2";
+	compatible = "lacie,net2big-v2", "marvell,kirkwood-88f6281", "marvell,kirkwood";
+
+	memory {
+		device_type = "memory";
+		reg = <0x00000000 0x20000000>; /* 512 MB */

The memory size is 256MB (0x10000000).

Quoted 91 lines
arch/arm/boot/dts/kirkwood-net2big-v2.dts new file +91 -0
+	};
+
+	chosen {
+		bootargs = "console=ttyS0,115200n8 earlyprintk";
+	};
+
+	ocp at f1000000 {
+		pinctrl at 10000 {
+			pinctrl-0 = <&pmx_misc &pmx_sysrst>;
+			pinctrl-names = "default";
+
+			pmx_keys: pmx-keys {
+				marvell,pins = "mpp13", "mpp15", "mpp34";
+				marvell,function = "gpio";
+			};
+
+			pmx_sata_power: pmx-sata-power {
+				marvell,pins = "mpp16", "mpp17";
+				marvell,function = "gpio";
+			};
+
+			pmx_sata1: pmx-sata1 {
+				marvell,pins = "mpp20";
+				marvell,function = "sata1";
+			};
+
+			pmx_sata0: pmx-sata0 {
+				marvell,pins = "mpp21";
+				marvell,function = "sata0";
+			};
+
+			pmx_poweroff: pmx-poweroff {
+				marvell,pins = "mpp7";
+				marvell,function = "gpo";
+			};
+
+			pmx_sysrst: pmx-sysrst {
+				marvell,pins = "mpp6";
+				marvell,function = "sysrst";
+			};
+
+			/*
+			 * MPP14: USB fuse alarm
+			 * MPP24: USB mode select
+			 * MPP26: USB device vbus
+			 * MPP28: USB enable host vbus
+			 * MPP35: inhibit switch power-off
+			 * MPP36: SATA HDD1 presence
+			 * MPP37: SATA HDD2 presence
+			 * MPP40: eSATA presence
+			 * MPP44: GPIO extension (data 0)
+			 * MPP45: GPIO extension (data 1)
+			 * MPP46: GPIO extension (data 2)
+			 * MPP47: GPIO extension (addr 0)
+			 * MPP48: GPIO extension (addr 1)
+			 * MPP49: GPIO extension (addr 2)
+			 */
+			pmx_misc: pmx-misc {
+				marvell,pins = "mpp14", "mpp24", "mpp26", "mpp28", "mpp29",
+					       "mpp35", "mpp36", "mpp37", "mpp40", "mpp44",
+					       "mpp45", "mpp46", "mpp47", "mpp48", "mpp49";
+				marvell,function = "gpio";
+			};
+		};
+
+		spi at 10600 {
+			status = "okay";
+			pinctrl-0 = <&pmx_spi>;
+			pinctrl-names = "default";
+
+			flash at 0 {
+				#address-cells = <1>;
+				#size-cells = <1>;
+				compatible = "mx25l4005a";
+				reg = <0>;
+				spi-max-frequency = <20000000>;
+				mode = <0>;
+
+				partition at 0 {
+					reg = <0x0 0x80000>;
+					label = "u-boot";
+				};
+			};
+		};
+
+		i2c at 11000 {
+			status = "okay";
+			pinctrl-0 = <&pmx_twsi0>;
+			pinctrl-names = "default";
+
+			eeprom at 50 {

arch/arm/boot/dts/kirkwood-net2big-v2.dts line 123

Quoted 10 lines
arch/arm/boot/dts/kirkwood-net2big-v2.dts new file +10 -0
+				compatible = "at,24c04";
+				pagesize = <16>;
+				reg = <0x50>;
+			};
+		};
+
+		serial at 12000 {
+			pinctrl-0 = <&pmx_uart0>;
+			pinctrl-names = "default";
+			clock-frequency = <200000000>;

The serial clock-frequency is 166666667 for the net2big_v2 as well as the TCLK frequency. It could smart to inherit the clock frequencies (if not given) from the TCLK.

Quoted 60 lines
arch/arm/boot/dts/kirkwood-net2big-v2.dts new file +60 -0
+			status = "ok";
+		};
+
+		ehci at 50000 {
+			status = "okay";
+		};
+
+		sata at 80000 {
+			pinctrl-0 = <&pmx_sata0 &pmx_sata1>;
+			pinctrl-names = "default";
+			status = "okay";
+			nr-ports = <2>;
+		};
+	};
+
+        gpio_poweroff {
+		compatible = "gpio-poweroff";
+		pinctrl-0 = <&pmx_poweroff>;
+		pinctrl-names = "default";
+		gpios = <&gpio0 7 0>;
+        };
+
+	gpio_keys {
+		compatible = "gpio-keys";
+		#address-cells = <1>;
+		#size-cells = <0>;
+		pinctrl-0 = <&pmx_keys>;
+		pinctrl-names = "default";
+
+		button at 1 {
+			label = "Back power switch (on|auto)";
+			linux,code = <0x1>;
+			linux,input-type = <5>; /* EV_SW */
+			gpios = <&gpio0 13 1>;
+		};
+		button at 2 {
+			label = "Back power switch (auto|off)";
+			linux,code = <0x2>;
+			linux,input-type = <5>; /* EV_SW */
+			gpios = <&gpio0 15 1>;
+		};
+		button at 3 {
+			label = "Function button";
+			linux,code = <0x165>; /* KEY_OPTION */
+			gpios = <&gpio1 3 1>;
+		};
+	};
+
+	regulators {
+		compatible = "simple-bus";
+		pinctrl-0 = <&pmx_sata_power>;
+		pinctrl-names = "default";
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		sata0_power: regulator at 1 {
+			compatible = "regulator-fixed";
+			reg = <1>;
+			regulator-name = "SATA0 Power";
+			regulator-min-microvolt = <5000000>;

arch/arm/boot/dts/kirkwood-net2big-v2.dts line 193

Quoted 10 lines
arch/arm/boot/dts/kirkwood-net2big-v2.dts new file +10 -0
+			regulator-max-microvolt = <5000000>;
+			enable-active-high;
+			regulator-always-on;
+			regulator-boot-on;
+			gpio = <&gpio0 16 0>;
+		};
+
+		sata1_power: regulator at 2 {
+			compatible = "regulator-fixed";
+			reg = <1>;

The regulator driver fails to register an already registred sysfs entry. If I set "reg = <2>;" then the error goes away.

arch/arm/boot/dts/kirkwood-net2big-v2.dts line 200

Quoted 7 lines
arch/arm/boot/dts/kirkwood-net2big-v2.dts new file +7 -0
+			regulator-name = "SATA1 Power";
+			regulator-min-microvolt = <5000000>;
+			regulator-max-microvolt = <5000000>;
+			enable-active-high;
+			regulator-always-on;
+			regulator-boot-on;
+			gpio = <&gpio0 17 0>;

As for the d2net_v2, it would be nice to allow to enable/disable power for the SATA disks.

Quoted 37 lines
arch/arm/boot/dts/kirkwood-net2big-v2.dts new file +19 -0
+		};
+	};
+};
+
+&mdio {
+	status = "okay";
+
+	ethphy0: ethernet-phy at 0 {
+		device_type = "ethernet-phy";
+		reg = <8>;
+	};
+};
+
+&eth0 {
+	status = "okay";
+	ethernet0-port at 0 {
+		phy-handle = <&ethphy0>;
+	};
+};
arch/arm/boot/dts/kirkwood-net5big-v2.dts new file +12 -0
new file mode 100644
index 0000000..46ca107
@@ -0,0 +1,265 @@
+/*
+ * LaCie 5Big Network v2
+ *
+ * Simon Guinot <[email protected]>
+ *
+ * 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/;
+

arch/arm/boot/dts/kirkwood-net5big-v2.dts line 22

Quoted 10 lines
arch/arm/boot/dts/kirkwood-net5big-v2.dts new file +10 -0
+/include/ "kirkwood.dtsi"
+/include/ "kirkwood-6281.dtsi"
+
+/ {
+	model = "LaCie 5Big Network v2";
+	compatible = "lacie,net5big-v2", "marvell,kirkwood-88f6281", "marvell,kirkwood";
+
+	memory {
+		device_type = "memory";
+		reg = <0x00000000 0x20000000>; /* 512 MB */

This time, the memory size is OK :)

Quoted 89 lines
arch/arm/boot/dts/kirkwood-net5big-v2.dts new file +89 -0
+	};
+
+	chosen {
+		bootargs = "console=ttyS0,115200n8 earlyprintk";
+	};
+
+	ocp at f1000000 {
+		pinctrl at 10000 {
+			pinctrl-0 = <&pmx_misc &pmx_sysrst>;
+			pinctrl-names = "default";
+
+			pmx_keys: pmx-keys {
+				marvell,pins = "mpp13", "mpp15", "mpp34";
+				marvell,function = "gpio";
+			};
+
+			pmx_sata_power: pmx-sata-power {
+				marvell,pins = "mpp16", "mpp17", "mpp41", "mpp42", "mpp43";
+				marvell,function = "gpio";
+			};
+
+			pmx_poweroff: pmx-poweroff {
+				marvell,pins = "mpp7";
+				marvell,function = "gpo";
+			};
+
+			pmx_sysrst: pmx-sysrst {
+				marvell,pins = "mpp6";
+				marvell,function = "sysrst";
+			};
+
+			/*
+			 * MPP14: USB fuse alarm
+			 * MPP28: USB enable host vbus
+			 * MPP29: GPIO extension ALE
+			 * MPP35: inhibit switch power-off
+			 * MPP36: SATA HDD1 presence
+			 * MPP37: SATA HDD2 presence
+			 * MPP38: SATA HDD3 presence
+			 * MPP39: SATA HDD4 presence
+			 * MPP40: SATA HDD5 presence
+			 * MPP44: GPIO extension (data 0)
+			 * MPP45: GPIO extension (data 1)
+			 * MPP46: GPIO extension (data 2)
+			 * MPP47: GPIO extension (addr 0)
+			 * MPP48: GPIO extension (addr 1)
+			 * MPP49: GPIO extension (addr 2)
+			 */
+			pmx_misc: pmx-misc {
+				marvell,pins = "mpp14", "mpp28", "mpp29", "mpp35", "mpp36",
+					       "mpp37", "mpp38", "mpp39", "mpp40", "mpp44",
+					       "mpp45", "mpp46", "mpp47", "mpp48", "mpp49";
+				marvell,function = "gpio";
+			};
+
+			pmx_ge1: pmx-ge1 {
+				marvell,pins = "mpp20", "mpp21", "mpp22", "mpp23", "mpp24",
+					       "mpp25", "mpp26", "mpp27", "mpp30", "mpp31",
+					       "mpp32", "mpp33";
+				marvell,function = "ge1";
+			};
+		};
+
+		spi at 10600 {
+			status = "okay";
+			pinctrl-0 = <&pmx_spi>;
+			pinctrl-names = "default";
+
+			flash at 0 {
+				#address-cells = <1>;
+				#size-cells = <1>;
+				compatible = "mx25l4005a";
+				reg = <0>;
+				spi-max-frequency = <20000000>;
+				mode = <0>;
+
+				partition at 0 {
+					reg = <0x0 0x80000>;
+					label = "u-boot";
+				};
+			};
+		};
+
+		i2c at 11000 {
+			status = "okay";
+			pinctrl-0 = <&pmx_twsi0>;
+			pinctrl-names = "default";
+
+			eeprom at 50 {

arch/arm/boot/dts/kirkwood-net5big-v2.dts line 121

Quoted 10 lines
arch/arm/boot/dts/kirkwood-net5big-v2.dts new file +10 -0
+				compatible = "at,24c04";
+				pagesize = <16>;
+				reg = <0x50>;
+			};
+		};
+
+		serial at 12000 {
+			pinctrl-0 = <&pmx_uart0>;
+			pinctrl-names = "default";
+			clock-frequency = <200000000>;

clock-frequency = <166666667>;

Quoted 60 lines
arch/arm/boot/dts/kirkwood-net5big-v2.dts new file +60 -0
+			status = "ok";
+		};
+
+		ehci at 50000 {
+			status = "okay";
+		};
+
+		sata at 80000 {
+			pinctrl-0 = <&pmx_sata0 &pmx_sata1>;
+			pinctrl-names = "default";
+			status = "okay";
+			nr-ports = <2>;
+		};
+	};
+
+        gpio_poweroff {
+		compatible = "gpio-poweroff";
+		pinctrl-0 = <&pmx_poweroff>;
+		pinctrl-names = "default";
+		gpios = <&gpio0 7 0>;
+        };
+
+	gpio_keys {
+		compatible = "gpio-keys";
+		#address-cells = <1>;
+		#size-cells = <0>;
+		pinctrl-0 = <&pmx_keys>;
+		pinctrl-names = "default";
+
+		button at 1 {
+			label = "Back power switch (on|auto)";
+			linux,code = <0x1>;
+			linux,input-type = <5>; /* EV_SW */
+			gpios = <&gpio0 13 1>;
+		};
+		button at 2 {
+			label = "Back power switch (auto|off)";
+			linux,code = <0x2>;
+			linux,input-type = <5>; /* EV_SW */
+			gpios = <&gpio0 15 1>;
+		};
+		button at 3 {
+			label = "Function button";
+			linux,code = <0x165>; /* KEY_OPTION */
+			gpios = <&gpio1 3 1>;
+		};
+	};
+
+	regulators {
+		compatible = "simple-bus";
+		pinctrl-0 = <&pmx_sata_power>;
+		pinctrl-names = "default";
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		sata0_power: regulator at 1 {
+			compatible = "regulator-fixed";
+			reg = <1>;
+			regulator-name = "SATA0 Power";
+			regulator-min-microvolt = <5000000>;

arch/arm/boot/dts/kirkwood-net5big-v2.dts line 191

Quoted 10 lines
arch/arm/boot/dts/kirkwood-net5big-v2.dts new file +10 -0
+			regulator-max-microvolt = <5000000>;
+			enable-active-high;
+			regulator-always-on;
+			regulator-boot-on;
+			gpio = <&gpio0 16 0>;
+		};
+
+		sata1_power: regulator at 2 {
+			compatible = "regulator-fixed";
+			reg = <1>;

reg = <2>; ?

arch/arm/boot/dts/kirkwood-net5big-v2.dts line 203

Quoted 12 lines
arch/arm/boot/dts/kirkwood-net5big-v2.dts new file +12 -0
+			regulator-name = "SATA1 Power";
+			regulator-min-microvolt = <5000000>;
+			regulator-max-microvolt = <5000000>;
+			enable-active-high;
+			regulator-always-on;
+			regulator-boot-on;
+			gpio = <&gpio0 17 0>;
+		};
+
+		sata2_power: regulator at 3 {
+			compatible = "regulator-fixed";
+			reg = <1>;

reg = <3>; ?

arch/arm/boot/dts/kirkwood-net5big-v2.dts line 215

Quoted 12 lines
arch/arm/boot/dts/kirkwood-net5big-v2.dts new file +12 -0
+			regulator-name = "SATA2 Power";
+			regulator-min-microvolt = <5000000>;
+			regulator-max-microvolt = <5000000>;
+			enable-active-high;
+			regulator-always-on;
+			regulator-boot-on;
+			gpio = <&gpio1 9 0>;
+		};
+
+		sata3_power: regulator at 4 {
+			compatible = "regulator-fixed";
+			reg = <1>;

reg = <4>; ?

arch/arm/boot/dts/kirkwood-net5big-v2.dts line 227

Quoted 12 lines
arch/arm/boot/dts/kirkwood-net5big-v2.dts new file +12 -0
+			regulator-name = "SATA3 Power";
+			regulator-min-microvolt = <5000000>;
+			regulator-max-microvolt = <5000000>;
+			enable-active-high;
+			regulator-always-on;
+			regulator-boot-on;
+			gpio = <&gpio1 10 0>;
+		};
+
+		sata4_power: regulator at 5 {
+			compatible = "regulator-fixed";
+			reg = <1>;

reg = <5>; ?

Quoted 27 lines
arch/arm/boot/dts/kirkwood-net5big-v2.dts new file +27 -0
+			regulator-name = "SATA4 Power";
+			regulator-min-microvolt = <5000000>;
+			regulator-max-microvolt = <5000000>;
+			enable-active-high;
+			regulator-always-on;
+			regulator-boot-on;
+			gpio = <&gpio1 11 0>;
+                };
+        };
+};
+
+&mdio {
+	status = "okay";
+
+	ethphy0: ethernet-phy at 0 {
+		device_type = "ethernet-phy";
+		reg = <8>;
+	};
+
+	ethphy1: ethernet-phy at 1 {
+		device_type = "ethernet-phy";
+		reg = <0>;
+	};
+};
+
+&eth0 {
+	status = "okay";

arch/arm/boot/dts/kirkwood-net5big-v2.dts line 264

Quoted 10 lines
arch/arm/boot/dts/kirkwood-net5big-v2.dts new file +10 -0
+	ethernet0-port at 0 {
+		phy-handle = <&ethphy0>;
+	};
+};
+
+&eth1 {
+	status = "okay";
+	ethernet1-port at 0 {
+		phy-handle = <&ethphy1>;
+	};

eth1 don't work and I don't know why. I can only say it works with the legacy board-setup and Linux v3.10.

Quoted 32 lines
arch/arm/boot/dts/kirkwood-net5big-v2.dts new file +1 -0
+};
arch/arm/mach-kirkwood/Kconfig +2 -14
index f624162..b7e66fa 100644
@@ -5,20 +5,6 @@ menu "Marvell Kirkwood Implementations"
 config KIRKWOOD_LEGACY
 	bool
 
-config MACH_NET2BIG_V2
-	bool "LaCie 2Big Network v2 NAS Board"
-	select KIRKWOOD_LEGACY
-	help
-	  Say 'Y' here if you want your kernel to support the
-	  LaCie 2Big Network v2 NAS.
-
-config MACH_NET5BIG_V2
-	bool "LaCie 5Big Network v2 NAS Board"
-	select KIRKWOOD_LEGACY
-	help
-	  Say 'Y' here if you want your kernel to support the
-	  LaCie 5Big Network v2 NAS.
-
 config MACH_OPENRD
 	select KIRKWOOD_LEGACY
         bool
@@ -113,6 +99,18 @@ config MACH_MV88F6281GTW_GE_DT
 	  Say 'Y' here if you want your kernel to support the
 	  Marvell 88F6281 GTW GE Board (Flattened Device Tree).
 
+config MACH_NET2BIG_V2_DT
+	bool "LaCie 2Big Network v2 NAS Board (Flattened Device Tree)"

arch/arm/mach-kirkwood/Kconfig config MACH_MV88F6281GTW_GE_DT · line 113

Quoted 10 lines
arch/arm/mach-kirkwood/Kconfig +10 -0
+	help
+	  Say 'Y' here if you want your kernel to support the
+	  LaCie 2Big Network v2 NAS  (Flattened Device Tree).
+
+config MACH_NET5BIG_V2_DT
+	bool "LaCie 5Big Network v2 NAS Board (Flattened Device Tree)"
+	help
+	  Say 'Y' here if you want your kernel to support the
+	  LaCie 5Big Network v2 NAS  (Flattened Device Tree).
+

Before changing this options, we need to fix the Kconfig dependencies for the driver led-netxbig. I will send a patch.

Quoted 17 lines
arch/arm/mach-kirkwood/Kconfig +0 -0
 endmenu
 
 endif
arch/arm/mach-kirkwood/Makefile +0 -2
index 0dcc5d4..38d0d74 100644
@@ -1,8 +1,6 @@
 obj-y				+= common.o pcie.o
 obj-$(CONFIG_KIRKWOOD_LEGACY)	+= irq.o mpp.o
 
-obj-$(CONFIG_MACH_NET2BIG_V2)		+= netxbig_v2-setup.o lacie_v2-common.o
-obj-$(CONFIG_MACH_NET5BIG_V2)		+= netxbig_v2-setup.o lacie_v2-common.o
 obj-$(CONFIG_MACH_OPENRD)		+= openrd-setup.o
 obj-$(CONFIG_MACH_RD88F6192_NAS)	+= rd88f6192-nas-setup.o
 obj-$(CONFIG_MACH_RD88F6281)		+= rd88f6281-setup.o

arch/arm/mach-kirkwood/Makefile obj-$(CONFIG_MACH_TS41X) += ts41x-setup.o tsx1x-common.o · line 14

Quoted 4 lines
arch/arm/mach-kirkwood/Makefile +1 -0
@@ -13,3 +11,5 @@ obj-$(CONFIG_MACH_TS41X)		+= ts41x-setup.o tsx1x-common.o
 obj-$(CONFIG_ARCH_KIRKWOOD_DT)		+= board-dt.o
 obj-$(CONFIG_MACH_DLINK_KIRKWOOD_DT)	+= board-dnskw.o
 obj-$(CONFIG_MACH_MV88F6281GTW_GE_DT)	+= board-mv88f6281gtw_ge.o
+obj-$(CONFIG_MACH_NET2BIG_V2)		+= board-netxbig_v2.o

CONFIG_MACH_NET2BIG_V2_DT

arch/arm/mach-kirkwood/Makefile obj-$(CONFIG_MACH_TS41X) += ts41x-setup.o tsx1x-common.o · line 15

Quoted 1 line
arch/arm/mach-kirkwood/Makefile +1 -0
+obj-$(CONFIG_MACH_NET5BIG_V2)		+= board-netxbig_v2.o

CONFIG_MACH_NET5BIG_V2_DT

Quoted 4 lines
arch/arm/mach-kirkwood/board-dt.c +0 -0
index b129c65..80955cc 100644

... snip ...

arch/arm/mach-kirkwood/common.h void mv88f6281gtw_ge_init(void); · line 74

Quoted 9 lines
arch/arm/mach-kirkwood/common.h +1 -0
index cc639bb..a9010a3 100644
@@ -71,6 +71,12 @@ void mv88f6281gtw_ge_init(void);
 static inline void mv88f6281gtw_ge_init(void) {};
 #endif
 
+#if defined(MACH_NET2BIG_V2_DT) || defined(MACH_NET5BIG_V2_DT)

#if defined(CONFIG_MACH_NET2BIG_V2_DT) || defined(CONFIG_MACH_NET5BIG_V2_DT)

Thanks,

Simon
-------------- 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/20130802/ea5796f2/attachment.sig>

#20 lore raw

PATCH v2 7/9 ARM: kirkwood: convert LaCie Net{2, 5}Big v2 platforms to DT

Quoted 22 lines · Simon Guinot
Quoted 21 lines · Thomas Petazzoni

This commit converts the LaCie Net2big and Net5Big Kirkwood boards to use a Device Tree representation. All devices are converted to use a DT representation, except the GPIO extension leds that use a special leds-netxbig driver that does not yet have a DT binding.

---
 arch/arm/boot/dts/Makefile                |   2 +
 arch/arm/boot/dts/kirkwood-net2big-v2.dts | 219 ++++++++++++++++
 arch/arm/boot/dts/kirkwood-net5big-v2.dts | 265 +++++++++++++++++++
 arch/arm/mach-kirkwood/Kconfig            |  26 +-
 arch/arm/mach-kirkwood/Makefile           |   4 +-
 arch/arm/mach-kirkwood/board-dt.c         |   4 +
 arch/arm/mach-kirkwood/board-netxbig_v2.c | 199 ++++++++++++++
 arch/arm/mach-kirkwood/common.h           |   6 +
 arch/arm/mach-kirkwood/netxbig_v2-setup.c | 422 ------------------------------
 9 files changed, 709 insertions(+), 438 deletions(-)
 create mode 100644 arch/arm/boot/dts/kirkwood-net2big-v2.dts
 create mode 100644 arch/arm/boot/dts/kirkwood-net5big-v2.dts
 create mode 100644 arch/arm/mach-kirkwood/board-netxbig_v2.c
 delete mode 100644 arch/arm/mach-kirkwood/netxbig_v2-setup.c

...

Quoted 8 lines

arch/arm/boot/dts/kirkwood-net2big-v2.dts line 123

Quoted 4 lines
arch/arm/boot/dts/kirkwood-net2big-v2.dts new file +4 -0
+		serial at 12000 {
+			pinctrl-0 = <&pmx_uart0>;
+			pinctrl-names = "default";
+			clock-frequency = <200000000>;

The serial clock-frequency is 166666667 for the net2big_v2 as well as the TCLK frequency. It could smart to inherit the clock frequencies (if not given) from the TCLK.

iirc, I wrote a patch a release or two ago removing the clock-frequency from the serial nodes because it jacked up the of_serial driver. Something about if it was specified, the driver skipped something critical.

Sorry I don't have it on hand atm, I'm away from my development station.

thx,

Jason.

#21 lore raw

PATCH 1/1 leds: leds-netxbig: depends on ARCH_KIRKWOOD

In reply to Thomas Petazzoni

With the DT conversion, the board Kconfig symbols MACH_ are going to be removed. In order to prepare this removal, this patch replaces alls the machines dependencies for leds-netxbig by ARCH_KIRKWOOD.

---
Thomas,

Please, insert this patch in your series before the patch named:
[PATCHv2 7/9] ARM: kirkwood: convert LaCie Net{2, 5}Big v2 platforms to DT

Simon

 drivers/leds/Kconfig |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/leds/Kconfig +1 -1
index 0e41460..7226696 100644
@@ -407,8 +407,8 @@ config LEDS_NS2
 
 config LEDS_NETXBIG
 	tristate "LED support for Big Network series LEDs"
-	depends on MACH_NET2BIG_V2 || MACH_NET5BIG_V2
 	depends on LEDS_CLASS
+	depends on ARCH_KIRKWOOD
 	default y
 	help
 	  This option enable support for LEDs found on the LaCie 2Big
Signature · 1 line
1.7.10.4
#22 lore raw

PATCH 1/1 leds: leds-netxbig: depends on ARCH_KIRKWOOD

Quoted 10 lines · Simon Guinot

With the DT conversion, the board Kconfig symbols MACH_ are going to be removed. In order to prepare this removal, this patch replaces alls the machines dependencies for leds-netxbig by ARCH_KIRKWOOD.

---
Thomas,

Please, insert this patch in your series before the patch named:
[PATCHv2 7/9] ARM: kirkwood: convert LaCie Net{2, 5}Big v2 platforms to DT

Nah, this should go through linux-leds.

thx,

Jason.

Quoted 20 lines
 drivers/leds/Kconfig |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/leds/Kconfig +1 -1
index 0e41460..7226696 100644
@@ -407,8 +407,8 @@ config LEDS_NS2
 
 config LEDS_NETXBIG
 	tristate "LED support for Big Network series LEDs"
-	depends on MACH_NET2BIG_V2 || MACH_NET5BIG_V2
 	depends on LEDS_CLASS
+	depends on ARCH_KIRKWOOD
 	default y
 	help
 	  This option enable support for LEDs found on the LaCie 2Big
Signature · 1 line
1.7.10.4
#23 lore raw

PATCH 1/1 leds: leds-netxbig: depends on ARCH_KIRKWOOD

Quoted 9 lines · Jason Cooper
Quoted 8 lines · Simon Guinot

With the DT conversion, the board Kconfig symbols MACH_ are going to be removed. In order to prepare this removal, this patch replaces alls the machines dependencies for leds-netxbig by ARCH_KIRKWOOD.

---
Thomas,

Quoted 7 lines
Quoted 2 lines

Please, insert this patch in your series before the patch named:
[PATCHv2 7/9] ARM: kirkwood: convert LaCie Net{2, 5}Big v2 platforms to DT

Nah, this should go through linux-leds.

I can merge this patch through my tree but when will that kirkwood patch be merged?
How about merge this with those kirkwood patches with my ack:

Thanks,
-Bryan

Quoted 21 lines
Quoted 21 lines
 drivers/leds/Kconfig |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/leds/Kconfig +1 -2
index 0e41460..7226696 100644
@@ -407,8 +407,8 @@ config LEDS_NS2
 
 config LEDS_NETXBIG
      tristate "LED support for Big Network series LEDs"
-     depends on MACH_NET2BIG_V2 || MACH_NET5BIG_V2
      depends on LEDS_CLASS
+     depends on ARCH_KIRKWOOD
      default y
      help
        This option enable support for LEDs found on the LaCie 2Big
--

1.7.10.4

#24 lore raw

PATCH 1/1 leds: leds-netxbig: depends on ARCH_KIRKWOOD

Bryan,

Quoted 13 lines · Bryan Wu
Quoted 12 lines · Jason Cooper
Quoted 10 lines · Simon Guinot

With the DT conversion, the board Kconfig symbols MACH_ are going to be removed. In order to prepare this removal, this patch replaces alls the machines dependencies for leds-netxbig by ARCH_KIRKWOOD.

---
Thomas,

Please, insert this patch in your series before the patch named:
[PATCHv2 7/9] ARM: kirkwood: convert LaCie Net{2, 5}Big v2 platforms to DT

Quoted 7 lines
Quoted 4 lines

Nah, this should go through linux-leds.

I can merge this patch through my tree but when will that kirkwood patch be merged?

It's okay, it falls in the same category as the other patch you merged. There's no dependency between this patch and the rest of this series, despite the above request to insert.

thx,

Jason.

Quoted 3 lines

How about merge this with those kirkwood patches with my ack:

No, no, no. I'm trying to encourage patches to go through the proper trees when possible. :-P

Quoted 21 lines
Quoted 21 lines
Quoted 21 lines
 drivers/leds/Kconfig |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/leds/Kconfig +1 -2
index 0e41460..7226696 100644
@@ -407,8 +407,8 @@ config LEDS_NS2
 
 config LEDS_NETXBIG
      tristate "LED support for Big Network series LEDs"
-     depends on MACH_NET2BIG_V2 || MACH_NET5BIG_V2
      depends on LEDS_CLASS
+     depends on ARCH_KIRKWOOD
      default y
      help
        This option enable support for LEDs found on the LaCie 2Big
--

1.7.10.4

#25 lore raw

PATCH 1/1 leds: leds-netxbig: depends on ARCH_KIRKWOOD

Quoted 30 lines · Jason Cooper

Bryan,

Quoted 13 lines · Bryan Wu
Quoted 12 lines · Jason Cooper
Quoted 10 lines · Simon Guinot

With the DT conversion, the board Kconfig symbols MACH_ are going to be removed. In order to prepare this removal, this patch replaces alls the machines dependencies for leds-netxbig by ARCH_KIRKWOOD.

---
Thomas,

Please, insert this patch in your series before the patch named:
[PATCHv2 7/9] ARM: kirkwood: convert LaCie Net{2, 5}Big v2 platforms to DT

Quoted 7 lines
Quoted 4 lines

Nah, this should go through linux-leds.

I can merge this patch through my tree but when will that kirkwood patch be merged?

It's okay, it falls in the same category as the other patch you merged. There's no dependency between this patch and the rest of this series, despite the above request to insert.

thx,

Quoted 9 lines

Jason.

Quoted 3 lines

How about merge this with those kirkwood patches with my ack:

No, no, no. I'm trying to encourage patches to go through the proper trees when possible. :-P

No problem, merged already.

-Bryan

Quoted 21 lines
Quoted 21 lines
Quoted 21 lines
Quoted 21 lines
 drivers/leds/Kconfig |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/leds/Kconfig +1 -2
index 0e41460..7226696 100644
@@ -407,8 +407,8 @@ config LEDS_NS2
 
 config LEDS_NETXBIG
      tristate "LED support for Big Network series LEDs"
-     depends on MACH_NET2BIG_V2 || MACH_NET5BIG_V2
      depends on LEDS_CLASS
+     depends on ARCH_KIRKWOOD
      default y
      help
        This option enable support for LEDs found on the LaCie 2Big
--

1.7.10.4

#26 lore raw

PATCH v2 8/9 ARM: kirkwood: remove unused common code for LaCie platforms

In reply to Thomas Petazzoni

Now that all LaCie platforms have been converted to use the Device Tree, we can get rid of the lacie_v2-common.{c,h} files.

---
 arch/arm/mach-kirkwood/lacie_v2-common.c | 114 -------------------------------
 arch/arm/mach-kirkwood/lacie_v2-common.h |  16 -----
 2 files changed, 130 deletions(-)
 delete mode 100644 arch/arm/mach-kirkwood/lacie_v2-common.c
 delete mode 100644 arch/arm/mach-kirkwood/lacie_v2-common.h
arch/arm/mach-kirkwood/lacie_v2-common.c deleted +0 -114
deleted file mode 100644
index 4894959..0000000
@@ -1,114 +0,0 @@
-/*
- * arch/arm/mach-kirkwood/lacie_v2-common.c
- *
- * This file is licensed under the terms of the GNU General Public
- * License version 2.  This program is licensed "as is" without any
- * warranty of any kind, whether express or implied.
- */
-
-#include <linux/kernel.h>
-#include <linux/init.h>
-#include <linux/mtd/physmap.h>
-#include <linux/spi/flash.h>
-#include <linux/spi/spi.h>
-#include <linux/i2c.h>
-#include <linux/i2c/at24.h>
-#include <linux/gpio.h>
-#include <asm/mach/time.h>
-#include <mach/kirkwood.h>
-#include <mach/irqs.h>
-#include <plat/time.h>
-#include "common.h"
-#include "lacie_v2-common.h"
-
-/*****************************************************************************
- * 512KB SPI Flash on Boot Device (MACRONIX MX25L4005)
- ****************************************************************************/
-
-static struct mtd_partition lacie_v2_flash_parts[] = {
-	{
-		.name = "u-boot",
-		.size = MTDPART_SIZ_FULL,
-		.offset = 0,
-		.mask_flags = MTD_WRITEABLE, /* force read-only */
-	},
-};
-
-static const struct flash_platform_data lacie_v2_flash = {
-	.type		= "mx25l4005a",
-	.name		= "spi_flash",
-	.parts		= lacie_v2_flash_parts,
-	.nr_parts	= ARRAY_SIZE(lacie_v2_flash_parts),
-};
-
-static struct spi_board_info __initdata lacie_v2_spi_slave_info[] = {
-	{
-		.modalias	= "m25p80",
-		.platform_data	= &lacie_v2_flash,
-		.irq		= -1,
-		.max_speed_hz	= 20000000,
-		.bus_num	= 0,
-		.chip_select	= 0,
-	},
-};
-
-void __init lacie_v2_register_flash(void)
-{
-	spi_register_board_info(lacie_v2_spi_slave_info,
-				ARRAY_SIZE(lacie_v2_spi_slave_info));
-	kirkwood_spi_init();
-}
-
-/*****************************************************************************
- * I2C devices
- ****************************************************************************/
-
-static struct at24_platform_data at24c04 = {
-	.byte_len	= SZ_4K / 8,
-	.page_size	= 16,
-};
-
-/*
- * i2c addr | chip         | description
- * 0x50     | HT24LC04     | eeprom (512B)
- */
-
-static struct i2c_board_info __initdata lacie_v2_i2c_info[] = {
-	{
-		I2C_BOARD_INFO("24c04", 0x50),
-		.platform_data  = &at24c04,
-	}
-};
-
-void __init lacie_v2_register_i2c_devices(void)
-{
-	kirkwood_i2c_init();
-	i2c_register_board_info(0, lacie_v2_i2c_info,
-				ARRAY_SIZE(lacie_v2_i2c_info));
-}
-
-/*****************************************************************************
- * Hard Disk power
- ****************************************************************************/
-
-static int __initdata lacie_v2_gpio_hdd_power[] = { 16, 17, 41, 42, 43 };
-
-void __init lacie_v2_hdd_power_init(int hdd_num)
-{
-	int i;
-	int err;
-
-	/* Power up all hard disks. */
-	for (i = 0; i < hdd_num; i++) {
-		err = gpio_request(lacie_v2_gpio_hdd_power[i], NULL);
-		if (err == 0) {
-			err = gpio_direction_output(
-					lacie_v2_gpio_hdd_power[i], 1);
-			/* Free the HDD power GPIOs. This allow user-space to
-			 * configure them via the gpiolib sysfs interface. */
-			gpio_free(lacie_v2_gpio_hdd_power[i]);
-		}
-		if (err)
-			pr_err("Failed to power up HDD%d\n", i + 1);
-	}
-}
arch/arm/mach-kirkwood/lacie_v2-common.h deleted +0 -16
deleted file mode 100644
index fc64f57..0000000
@@ -1,16 +0,0 @@
-/*
- * arch/arm/mach-kirkwood/lacie_v2-common.h
- *
- * 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.
- */
-
-#ifndef __ARCH_KIRKWOOD_LACIE_V2_COMMON_H
-#define __ARCH_KIRKWOOD_LACIE_V2_COMMON_H
-
-void lacie_v2_register_flash(void);
-void lacie_v2_register_i2c_devices(void);
-void lacie_v2_hdd_power_init(int hdd_num);
-
-#endif
Signature · 1 line
1.8.1.2
#27 lore raw

PATCH v2 8/9 ARM: kirkwood: remove unused common code for LaCie platforms

Quoted 4 lines · Thomas Petazzoni

Now that all LaCie platforms have been converted to use the Device Tree, we can get rid of the lacie_v2-common.{c,h} files.

Thanks,

Simon

Quoted 157 lines
---
 arch/arm/mach-kirkwood/lacie_v2-common.c | 114 -------------------------------
 arch/arm/mach-kirkwood/lacie_v2-common.h |  16 -----
 2 files changed, 130 deletions(-)
 delete mode 100644 arch/arm/mach-kirkwood/lacie_v2-common.c
 delete mode 100644 arch/arm/mach-kirkwood/lacie_v2-common.h
arch/arm/mach-kirkwood/lacie_v2-common.c deleted +0 -114
deleted file mode 100644
index 4894959..0000000
@@ -1,114 +0,0 @@
-/*
- * arch/arm/mach-kirkwood/lacie_v2-common.c
- *
- * This file is licensed under the terms of the GNU General Public
- * License version 2.  This program is licensed "as is" without any
- * warranty of any kind, whether express or implied.
- */
-
-#include <linux/kernel.h>
-#include <linux/init.h>
-#include <linux/mtd/physmap.h>
-#include <linux/spi/flash.h>
-#include <linux/spi/spi.h>
-#include <linux/i2c.h>
-#include <linux/i2c/at24.h>
-#include <linux/gpio.h>
-#include <asm/mach/time.h>
-#include <mach/kirkwood.h>
-#include <mach/irqs.h>
-#include <plat/time.h>
-#include "common.h"
-#include "lacie_v2-common.h"
-
-/*****************************************************************************
- * 512KB SPI Flash on Boot Device (MACRONIX MX25L4005)
- ****************************************************************************/
-
-static struct mtd_partition lacie_v2_flash_parts[] = {
-	{
-		.name = "u-boot",
-		.size = MTDPART_SIZ_FULL,
-		.offset = 0,
-		.mask_flags = MTD_WRITEABLE, /* force read-only */
-	},
-};
-
-static const struct flash_platform_data lacie_v2_flash = {
-	.type		= "mx25l4005a",
-	.name		= "spi_flash",
-	.parts		= lacie_v2_flash_parts,
-	.nr_parts	= ARRAY_SIZE(lacie_v2_flash_parts),
-};
-
-static struct spi_board_info __initdata lacie_v2_spi_slave_info[] = {
-	{
-		.modalias	= "m25p80",
-		.platform_data	= &lacie_v2_flash,
-		.irq		= -1,
-		.max_speed_hz	= 20000000,
-		.bus_num	= 0,
-		.chip_select	= 0,
-	},
-};
-
-void __init lacie_v2_register_flash(void)
-{
-	spi_register_board_info(lacie_v2_spi_slave_info,
-				ARRAY_SIZE(lacie_v2_spi_slave_info));
-	kirkwood_spi_init();
-}
-
-/*****************************************************************************
- * I2C devices
- ****************************************************************************/
-
-static struct at24_platform_data at24c04 = {
-	.byte_len	= SZ_4K / 8,
-	.page_size	= 16,
-};
-
-/*
- * i2c addr | chip         | description
- * 0x50     | HT24LC04     | eeprom (512B)
- */
-
-static struct i2c_board_info __initdata lacie_v2_i2c_info[] = {
-	{
-		I2C_BOARD_INFO("24c04", 0x50),
-		.platform_data  = &at24c04,
-	}
-};
-
-void __init lacie_v2_register_i2c_devices(void)
-{
-	kirkwood_i2c_init();
-	i2c_register_board_info(0, lacie_v2_i2c_info,
-				ARRAY_SIZE(lacie_v2_i2c_info));
-}
-
-/*****************************************************************************
- * Hard Disk power
- ****************************************************************************/
-
-static int __initdata lacie_v2_gpio_hdd_power[] = { 16, 17, 41, 42, 43 };
-
-void __init lacie_v2_hdd_power_init(int hdd_num)
-{
-	int i;
-	int err;
-
-	/* Power up all hard disks. */
-	for (i = 0; i < hdd_num; i++) {
-		err = gpio_request(lacie_v2_gpio_hdd_power[i], NULL);
-		if (err == 0) {
-			err = gpio_direction_output(
-					lacie_v2_gpio_hdd_power[i], 1);
-			/* Free the HDD power GPIOs. This allow user-space to
-			 * configure them via the gpiolib sysfs interface. */
-			gpio_free(lacie_v2_gpio_hdd_power[i]);
-		}
-		if (err)
-			pr_err("Failed to power up HDD%d\n", i + 1);
-	}
-}
arch/arm/mach-kirkwood/lacie_v2-common.h deleted +0 -16
deleted file mode 100644
index fc64f57..0000000
@@ -1,16 +0,0 @@
-/*
- * arch/arm/mach-kirkwood/lacie_v2-common.h
- *
- * 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.
- */
-
-#ifndef __ARCH_KIRKWOOD_LACIE_V2_COMMON_H
-#define __ARCH_KIRKWOOD_LACIE_V2_COMMON_H
-
-void lacie_v2_register_flash(void);
-void lacie_v2_register_i2c_devices(void);
-void lacie_v2_hdd_power_init(int hdd_num);
-
-#endif
Signature · 7 lines
1.8.1.2


_______________________________________________
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/20130802/1a74be57/attachment.sig>

#28 lore raw

PATCH v2 9/9 ARM: kirkwood: update defconfig after DT conversions

In reply to Thomas Petazzoni
---
 arch/arm/configs/kirkwood_defconfig | 15 ++++-----------
 1 file changed, 4 insertions(+), 11 deletions(-)
arch/arm/configs/kirkwood_defconfig +4 -11
index b180588..6d468cb 100644
@@ -9,27 +9,20 @@ CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
 # CONFIG_BLK_DEV_BSG is not set
 CONFIG_ARCH_KIRKWOOD=y
-CONFIG_MACH_D2NET_V2=y
 CONFIG_MACH_DB88F6281_BP=y
-CONFIG_MACH_DOCKSTAR=y
-CONFIG_MACH_ESATA_SHEEVAPLUG=y
-CONFIG_MACH_GURUPLUG=y
-CONFIG_MACH_INETSPACE_V2=y
-CONFIG_MACH_MV88F6281GTW_GE=y
-CONFIG_MACH_NET2BIG_V2=y
-CONFIG_MACH_NET5BIG_V2=y
-CONFIG_MACH_NETSPACE_MAX_V2=y
-CONFIG_MACH_NETSPACE_V2=y
 CONFIG_MACH_OPENRD_BASE=y
 CONFIG_MACH_OPENRD_CLIENT=y
 CONFIG_MACH_OPENRD_ULTIMATE=y
 CONFIG_MACH_RD88F6192_NAS=y
 CONFIG_MACH_RD88F6281=y
-CONFIG_MACH_SHEEVAPLUG=y
 CONFIG_MACH_T5325=y
 CONFIG_MACH_TS219=y
 CONFIG_MACH_TS41X=y
 CONFIG_MACH_DLINK_KIRKWOOD_DT=y
+CONFIG_MACH_DB88F628X_BP_DT=y
+CONFIG_MACH_MV88F6281GTW_GE_DT=y
+CONFIG_MACH_NET2BIG_V2_DT=y
+CONFIG_MACH_NET5BIG_V2_DT=y
 # CONFIG_CPU_FEROCEON_OLD_ID is not set
 CONFIG_PCI_MVEBU=y
 CONFIG_PREEMPT=y
Signature · 1 line
1.8.1.2
Applied
#29 lore raw

v2 cover ARM: kirkwood: convert a few more boards to DT

In reply to Thomas Petazzoni
Quoted 55 lines · Thomas Petazzoni

Hello,

Here is a set of patches that converts a few additional Kirkwood boards to use the Device Tree. I intend to continue this effort with the remaining Kirkwood boards. It is based on the mvebu/boards branch of linux-mvebu.git, which allows to use the Ethernet DT bindings.

Note that I don't have access to any of the platforms that are being converted in this patch series, so this means that:

- A careful review would be useful

- Testing from owners of the boards would be appreciated. The DT conversion of Kirkwood boards is a process that has now been started a while ago, and we would like to finalize it. If board owners don't react by testing the proposed patches, then the support for those boards might be broken.

To ease testing, the branch containing those changes has been pushed to:

https://github.com/MISL-EBU-System-SW/mainline-public/tree/kirkwood-dt-conversion-step1-v2

and kernel images for the affected boards have been uploaded to the following locations. They contain the correct appended DTB, and a small initramfs to ease testing:

http://free-electrons.com/~thomas/pub/kirkwood/uImage.kirkwood-d2net-v2
http://free-electrons.com/~thomas/pub/kirkwood/uImage.kirkwood-mv88f6281gtw-ge
http://free-electrons.com/~thomas/pub/kirkwood/uImage.kirkwood-net2big-v2
http://free-electrons.com/~thomas/pub/kirkwood/uImage.kirkwood-net5big-v2

In detail:

* Patch 1 converts the d2net_v2 board completely to DT.

* Patches 2, 3, 4 and 5 remove support for boards that have already been converted to the Deice Tree, but for which the legacy board file was not removed.

* Patch 6 converts the mv88f6281gtw_ge board to DT.

The remaining devices probed in a legacy way are the mv643xx_eth driver, and the DSA switch (note that I have an Armada 370 platform with a DSA switch, so I'll have to look at how to make this appear in the DT). I've left the Ethernet device not converted to DT because the interaction with the DSA switch is a bit special.

* Patch 7 converts the LaCie Net{2,5}Big v2 platforms to DT

The remaining device probed is the one managed by the leds-netxbig driver. For Ethernet, see above. For leds-netxbig, Simon Guinot is currently working on this (see the LAKML thread "Location for a kind of GPIO bus driver").

Quoted 4 lines

* Patch 8 removes some common code for LaCie boards that has become useless after the DT conversions.

* Patch 9 adjusts kirkwood_defconfig after the DT conversions.

I've applied patches 2,3,4,5,6 to mvebu/boards,

thx,

Jason.