All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCHv2 0/9] ARM: kirkwood: convert a few more boards to DT
@ 2013-08-01 15:07 Thomas Petazzoni
  2013-08-01 15:07 ` [PATCHv2 1/9] ARM: kirkwood: convert d2net_v2 " Thomas Petazzoni
                   ` (9 more replies)
  0 siblings, 10 replies; 30+ messages in thread
From: Thomas Petazzoni @ 2013-08-01 15:07 UTC (permalink / raw)
  To: linux-arm-kernel

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

-- 
1.8.1.2

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

* [PATCHv2 1/9] ARM: kirkwood: convert d2net_v2 to DT
  2013-08-01 15:07 [PATCHv2 0/9] ARM: kirkwood: convert a few more boards to DT Thomas Petazzoni
@ 2013-08-01 15:07 ` Thomas Petazzoni
  2013-08-02 14:31   ` Simon Guinot
                     ` (2 more replies)
  2013-08-01 15:07 ` [PATCHv2 2/9] ARM: kirkwood: remove support for legacy booting of Dockstar Thomas Petazzoni
                   ` (8 subsequent siblings)
  9 siblings, 3 replies; 30+ messages in thread
From: Thomas Petazzoni @ 2013-08-01 15:07 UTC (permalink / raw)
  To: linux-arm-kernel

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

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 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

diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index 641b3c9..277685f 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -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 \
diff --git a/arch/arm/boot/dts/kirkwood-d2net-v2.dts b/arch/arm/boot/dts/kirkwood-d2net-v2.dts
new file mode 100644
index 0000000..3b2d75b
--- /dev/null
+++ b/arch/arm/boot/dts/kirkwood-d2net-v2.dts
@@ -0,0 +1,231 @@
+/dts-v1/;
+
+/include/ "kirkwood.dtsi"
+/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>;
+	};
+
+	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";
+			};
+
+			pmx_uart: pmx-uart {
+				marvell,pins = "mpp10", "mpp11";
+				marvell,function = "uart0";
+			};
+
+			pmx_leds: pmx-leds {
+				marvell,pins = "mpp12";
+				marvell,function = "gpo";
+			};
+
+			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>;
+		};
+	};
+
+	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";
+		};
+	};
+
+	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>;
+
+		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>;
+		};
+	};
+};
+
+&mdio {
+	status = "okay";
+
+	ethphy0: ethernet-phy at 0 {
+		device_type = "ethernet-phy";
+		reg = <8>;
+	};
+};
+
+&eth0 {
+	status = "okay";
+	ethernet0-port at 0 {
+		phy-handle = <&ethphy0>;
+	};
+};
diff --git a/arch/arm/mach-kirkwood/Kconfig b/arch/arm/mach-kirkwood/Kconfig
index 60d0896..8bcd659 100644
--- a/arch/arm/mach-kirkwood/Kconfig
+++ b/arch/arm/mach-kirkwood/Kconfig
@@ -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
diff --git a/arch/arm/mach-kirkwood/Makefile b/arch/arm/mach-kirkwood/Makefile
index 88e2dd3..805028a 100644
--- a/arch/arm/mach-kirkwood/Makefile
+++ b/arch/arm/mach-kirkwood/Makefile
@@ -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
diff --git a/arch/arm/mach-kirkwood/d2net_v2-setup.c b/arch/arm/mach-kirkwood/d2net_v2-setup.c
deleted file mode 100644
index 4534180..0000000
--- a/arch/arm/mach-kirkwood/d2net_v2-setup.c
+++ /dev/null
@@ -1,231 +0,0 @@
-/*
- * arch/arm/mach-kirkwood/d2net_v2-setup.c
- *
- * LaCie d2 Network Space v2 Board Setup
- *
- * Copyright (C) 2010 Simon Guinot <sguinot@lacie.com>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#include <linux/kernel.h>
-#include <linux/init.h>
-#include <linux/platform_device.h>
-#include <linux/ata_platform.h>
-#include <linux/mv643xx_eth.h>
-#include <linux/input.h>
-#include <linux/gpio.h>
-#include <linux/gpio_keys.h>
-#include <linux/leds.h>
-#include <asm/mach-types.h>
-#include <asm/mach/arch.h>
-#include <mach/kirkwood.h>
-#include <linux/platform_data/leds-kirkwood-ns2.h>
-#include "common.h"
-#include "mpp.h"
-#include "lacie_v2-common.h"
-
-/*****************************************************************************
- * Ethernet
- ****************************************************************************/
-
-static struct mv643xx_eth_platform_data d2net_v2_ge00_data = {
-	.phy_addr	= MV643XX_ETH_PHY_ADDR(8),
-};
-
-/*****************************************************************************
- * SATA
- ****************************************************************************/
-
-static struct mv_sata_platform_data d2net_v2_sata_data = {
-	.n_ports	= 2,
-};
-
-/*****************************************************************************
- * GPIO keys
- ****************************************************************************/
-
-#define D2NET_V2_GPIO_PUSH_BUTTON          34
-#define D2NET_V2_GPIO_POWER_SWITCH_ON      13
-#define D2NET_V2_GPIO_POWER_SWITCH_OFF     15
-
-#define D2NET_V2_SWITCH_POWER_ON           0x1
-#define D2NET_V2_SWITCH_POWER_OFF          0x2
-
-static struct gpio_keys_button d2net_v2_buttons[] = {
-	[0] = {
-		.type           = EV_SW,
-		.code           = D2NET_V2_SWITCH_POWER_ON,
-		.gpio           = D2NET_V2_GPIO_POWER_SWITCH_ON,
-		.desc           = "Back power switch (on|auto)",
-		.active_low     = 0,
-	},
-	[1] = {
-		.type           = EV_SW,
-		.code           = D2NET_V2_SWITCH_POWER_OFF,
-		.gpio           = D2NET_V2_GPIO_POWER_SWITCH_OFF,
-		.desc           = "Back power switch (auto|off)",
-		.active_low     = 0,
-	},
-	[2] = {
-		.code           = KEY_POWER,
-		.gpio           = D2NET_V2_GPIO_PUSH_BUTTON,
-		.desc           = "Front Push Button",
-		.active_low     = 1,
-	},
-};
-
-static struct gpio_keys_platform_data d2net_v2_button_data = {
-	.buttons	= d2net_v2_buttons,
-	.nbuttons	= ARRAY_SIZE(d2net_v2_buttons),
-};
-
-static struct platform_device d2net_v2_gpio_buttons = {
-	.name		= "gpio-keys",
-	.id		= -1,
-	.dev		= {
-		.platform_data	= &d2net_v2_button_data,
-	},
-};
-
-/*****************************************************************************
- * GPIO LEDs
- ****************************************************************************/
-
-#define D2NET_V2_GPIO_RED_LED		12
-
-static struct gpio_led d2net_v2_gpio_led_pins[] = {
-	{
-		.name	= "d2net_v2:red:fail",
-		.gpio	= D2NET_V2_GPIO_RED_LED,
-	},
-};
-
-static struct gpio_led_platform_data d2net_v2_gpio_leds_data = {
-	.num_leds	= ARRAY_SIZE(d2net_v2_gpio_led_pins),
-	.leds		= d2net_v2_gpio_led_pins,
-};
-
-static struct platform_device d2net_v2_gpio_leds = {
-	.name		= "leds-gpio",
-	.id		= -1,
-	.dev		= {
-		.platform_data	= &d2net_v2_gpio_leds_data,
-	},
-};
-
-/*****************************************************************************
- * Dual-GPIO CPLD LEDs
- ****************************************************************************/
-
-#define D2NET_V2_GPIO_BLUE_LED_SLOW	29
-#define D2NET_V2_GPIO_BLUE_LED_CMD	30
-
-static struct ns2_led d2net_v2_led_pins[] = {
-	{
-		.name	= "d2net_v2:blue:sata",
-		.cmd	= D2NET_V2_GPIO_BLUE_LED_CMD,
-		.slow	= D2NET_V2_GPIO_BLUE_LED_SLOW,
-	},
-};
-
-static struct ns2_led_platform_data d2net_v2_leds_data = {
-	.num_leds	= ARRAY_SIZE(d2net_v2_led_pins),
-	.leds		= d2net_v2_led_pins,
-};
-
-static struct platform_device d2net_v2_leds = {
-	.name		= "leds-ns2",
-	.id		= -1,
-	.dev		= {
-		.platform_data	= &d2net_v2_leds_data,
-	},
-};
-
-/*****************************************************************************
- * General Setup
- ****************************************************************************/
-
-static unsigned int d2net_v2_mpp_config[] __initdata = {
-	MPP0_SPI_SCn,
-	MPP1_SPI_MOSI,
-	MPP2_SPI_SCK,
-	MPP3_SPI_MISO,
-	MPP6_SYSRST_OUTn,
-	MPP7_GPO,		/* Request power-off */
-	MPP8_TW0_SDA,
-	MPP9_TW0_SCK,
-	MPP10_UART0_TXD,
-	MPP11_UART0_RXD,
-	MPP12_GPO,		/* Red led */
-	MPP13_GPIO,		/* Rear power switch (on|auto) */
-	MPP14_GPIO,		/* USB fuse */
-	MPP15_GPIO,		/* Rear power switch (auto|off) */
-	MPP16_GPIO,		/* SATA 0 power */
-	MPP21_SATA0_ACTn,
-	MPP24_GPIO,		/* USB mode select */
-	MPP26_GPIO,		/* USB device vbus */
-	MPP28_GPIO,		/* USB enable host vbus */
-	MPP29_GPIO,		/* Blue led (slow register) */
-	MPP30_GPIO,		/* Blue led (command register) */
-	MPP34_GPIO,		/* Power button (1 = Released, 0 = Pushed) */
-	MPP35_GPIO,		/* Inhibit power-off */
-	0
-};
-
-#define D2NET_V2_GPIO_POWER_OFF		7
-
-static void d2net_v2_power_off(void)
-{
-	gpio_set_value(D2NET_V2_GPIO_POWER_OFF, 1);
-}
-
-static void __init d2net_v2_init(void)
-{
-	/*
-	 * Basic setup. Needs to be called early.
-	 */
-	kirkwood_init();
-	kirkwood_mpp_conf(d2net_v2_mpp_config);
-
-	lacie_v2_hdd_power_init(1);
-
-	kirkwood_ehci_init();
-	kirkwood_ge00_init(&d2net_v2_ge00_data);
-	kirkwood_sata_init(&d2net_v2_sata_data);
-	kirkwood_uart0_init();
-	lacie_v2_register_flash();
-	lacie_v2_register_i2c_devices();
-
-	platform_device_register(&d2net_v2_leds);
-	platform_device_register(&d2net_v2_gpio_leds);
-	platform_device_register(&d2net_v2_gpio_buttons);
-
-	if (gpio_request(D2NET_V2_GPIO_POWER_OFF, "power-off") == 0 &&
-	    gpio_direction_output(D2NET_V2_GPIO_POWER_OFF, 0) == 0)
-		pm_power_off = d2net_v2_power_off;
-	else
-		pr_err("d2net_v2: failed to configure power-off GPIO\n");
-}
-
-MACHINE_START(D2NET_V2, "LaCie d2 Network v2")
-	.atag_offset	= 0x100,
-	.init_machine	= d2net_v2_init,
-	.map_io		= kirkwood_map_io,
-	.init_early	= kirkwood_init_early,
-	.init_irq	= kirkwood_init_irq,
-	.init_time	= kirkwood_timer_init,
-	.restart	= kirkwood_restart,
-MACHINE_END
-- 
1.8.1.2

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

* [PATCHv2 2/9] ARM: kirkwood: remove support for legacy booting of Dockstar
  2013-08-01 15:07 [PATCHv2 0/9] ARM: kirkwood: convert a few more boards to DT Thomas Petazzoni
  2013-08-01 15:07 ` [PATCHv2 1/9] ARM: kirkwood: convert d2net_v2 " Thomas Petazzoni
@ 2013-08-01 15:07 ` Thomas Petazzoni
  2013-08-03 18:27   ` Jason Cooper
  2013-08-01 15:07 ` [PATCHv2 3/9] ARM: kirkwood: remove support for legacy booting of Guruplug Thomas Petazzoni
                   ` (7 subsequent siblings)
  9 siblings, 1 reply; 30+ messages in thread
From: Thomas Petazzoni @ 2013-08-01 15:07 UTC (permalink / raw)
  To: linux-arm-kernel

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

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 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

diff --git a/arch/arm/mach-kirkwood/Kconfig b/arch/arm/mach-kirkwood/Kconfig
index 8bcd659..cf6c938 100644
--- a/arch/arm/mach-kirkwood/Kconfig
+++ b/arch/arm/mach-kirkwood/Kconfig
@@ -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
diff --git a/arch/arm/mach-kirkwood/Makefile b/arch/arm/mach-kirkwood/Makefile
index 805028a..5edba89 100644
--- a/arch/arm/mach-kirkwood/Makefile
+++ b/arch/arm/mach-kirkwood/Makefile
@@ -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
diff --git a/arch/arm/mach-kirkwood/dockstar-setup.c b/arch/arm/mach-kirkwood/dockstar-setup.c
deleted file mode 100644
index 060ccf9..0000000
--- a/arch/arm/mach-kirkwood/dockstar-setup.c
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * arch/arm/mach-kirkwood/dockstar-setup.c
- *
- * Seagate FreeAgent DockStar Setup
- *
- * This file is licensed under the terms of the GNU General Public
- * License version 2.  This program is licensed "as is" without any
- * warranty of any kind, whether express or implied.
- */
-
-#include <linux/kernel.h>
-#include <linux/init.h>
-#include <linux/platform_device.h>
-#include <linux/ata_platform.h>
-#include <linux/mtd/partitions.h>
-#include <linux/mv643xx_eth.h>
-#include <linux/gpio.h>
-#include <linux/leds.h>
-#include <asm/mach-types.h>
-#include <asm/mach/arch.h>
-#include <mach/kirkwood.h>
-#include "common.h"
-#include "mpp.h"
-
-static struct mtd_partition dockstar_nand_parts[] = {
-	{
-		.name = "u-boot",
-		.offset = 0,
-		.size = SZ_1M
-	}, {
-		.name = "uImage",
-		.offset = MTDPART_OFS_NXTBLK,
-		.size = SZ_4M
-	}, {
-		.name = "root",
-		.offset = MTDPART_OFS_NXTBLK,
-		.size = MTDPART_SIZ_FULL
-	},
-};
-
-static struct mv643xx_eth_platform_data dockstar_ge00_data = {
-	.phy_addr	= MV643XX_ETH_PHY_ADDR(0),
-};
-
-static struct gpio_led dockstar_led_pins[] = {
-	{
-		.name			= "dockstar:green:health",
-		.default_trigger	= "default-on",
-		.gpio			= 46,
-		.active_low		= 1,
-	},
-	{
-		.name			= "dockstar:orange:misc",
-		.default_trigger	= "none",
-		.gpio			= 47,
-		.active_low		= 1,
-	},
-};
-
-static struct gpio_led_platform_data dockstar_led_data = {
-	.leds		= dockstar_led_pins,
-	.num_leds	= ARRAY_SIZE(dockstar_led_pins),
-};
-
-static struct platform_device dockstar_leds = {
-	.name	= "leds-gpio",
-	.id	= -1,
-	.dev	= {
-		.platform_data	= &dockstar_led_data,
-	}
-};
-
-static unsigned int dockstar_mpp_config[] __initdata = {
-	MPP29_GPIO,	/* USB Power Enable */
-	MPP46_GPIO,	/* LED green */
-	MPP47_GPIO,	/* LED orange */
-	0
-};
-
-static void __init dockstar_init(void)
-{
-	/*
-	 * Basic setup. Needs to be called early.
-	 */
-	kirkwood_init();
-
-	/* setup gpio pin select */
-	kirkwood_mpp_conf(dockstar_mpp_config);
-
-	kirkwood_uart0_init();
-	kirkwood_nand_init(ARRAY_AND_SIZE(dockstar_nand_parts), 25);
-
-	if (gpio_request(29, "USB Power Enable") != 0 ||
-	    gpio_direction_output(29, 1) != 0)
-		pr_err("can't set up GPIO 29 (USB Power Enable)\n");
-	kirkwood_ehci_init();
-
-	kirkwood_ge00_init(&dockstar_ge00_data);
-
-	platform_device_register(&dockstar_leds);
-}
-
-MACHINE_START(DOCKSTAR, "Seagate FreeAgent DockStar")
-	.atag_offset	= 0x100,
-	.init_machine	= dockstar_init,
-	.map_io		= kirkwood_map_io,
-	.init_early	= kirkwood_init_early,
-	.init_irq	= kirkwood_init_irq,
-	.init_time	= kirkwood_timer_init,
-	.restart	= kirkwood_restart,
-MACHINE_END
-- 
1.8.1.2

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

* [PATCHv2 3/9] ARM: kirkwood: remove support for legacy booting of Guruplug
  2013-08-01 15:07 [PATCHv2 0/9] ARM: kirkwood: convert a few more boards to DT Thomas Petazzoni
  2013-08-01 15:07 ` [PATCHv2 1/9] ARM: kirkwood: convert d2net_v2 " Thomas Petazzoni
  2013-08-01 15:07 ` [PATCHv2 2/9] ARM: kirkwood: remove support for legacy booting of Dockstar Thomas Petazzoni
@ 2013-08-01 15:07 ` Thomas Petazzoni
  2013-08-02 12:49   ` Jason Cooper
  2013-08-01 15:07 ` [PATCHv2 4/9] ARM: kirkwood: remove support for legacy booting of Sheevaplug Thomas Petazzoni
                   ` (6 subsequent siblings)
  9 siblings, 1 reply; 30+ messages in thread
From: Thomas Petazzoni @ 2013-08-01 15:07 UTC (permalink / raw)
  To: linux-arm-kernel

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

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 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

diff --git a/arch/arm/mach-kirkwood/Kconfig b/arch/arm/mach-kirkwood/Kconfig
index cf6c938..1d100f6 100644
--- a/arch/arm/mach-kirkwood/Kconfig
+++ b/arch/arm/mach-kirkwood/Kconfig
@@ -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
diff --git a/arch/arm/mach-kirkwood/Makefile b/arch/arm/mach-kirkwood/Makefile
index 5edba89..157be02 100644
--- a/arch/arm/mach-kirkwood/Makefile
+++ b/arch/arm/mach-kirkwood/Makefile
@@ -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
diff --git a/arch/arm/mach-kirkwood/guruplug-setup.c b/arch/arm/mach-kirkwood/guruplug-setup.c
deleted file mode 100644
index 08dd739..0000000
--- a/arch/arm/mach-kirkwood/guruplug-setup.c
+++ /dev/null
@@ -1,133 +0,0 @@
-/*
- * arch/arm/mach-kirkwood/guruplug-setup.c
- *
- * Marvell GuruPlug Reference Board Setup
- *
- * This file is licensed under the terms of the GNU General Public
- * License version 2.  This program is licensed "as is" without any
- * warranty of any kind, whether express or implied.
- */
-
-#include <linux/kernel.h>
-#include <linux/init.h>
-#include <linux/platform_device.h>
-#include <linux/mtd/partitions.h>
-#include <linux/ata_platform.h>
-#include <linux/mv643xx_eth.h>
-#include <linux/gpio.h>
-#include <linux/leds.h>
-#include <asm/mach-types.h>
-#include <asm/mach/arch.h>
-#include <mach/kirkwood.h>
-#include <linux/platform_data/mmc-mvsdio.h>
-#include "common.h"
-#include "mpp.h"
-
-static struct mtd_partition guruplug_nand_parts[] = {
-	{
-		.name = "u-boot",
-		.offset = 0,
-		.size = SZ_1M
-	}, {
-		.name = "uImage",
-		.offset = MTDPART_OFS_NXTBLK,
-		.size = SZ_4M
-	}, {
-		.name = "root",
-		.offset = MTDPART_OFS_NXTBLK,
-		.size = MTDPART_SIZ_FULL
-	},
-};
-
-static struct mv643xx_eth_platform_data guruplug_ge00_data = {
-	.phy_addr	= MV643XX_ETH_PHY_ADDR(0),
-};
-
-static struct mv643xx_eth_platform_data guruplug_ge01_data = {
-	.phy_addr	= MV643XX_ETH_PHY_ADDR(1),
-};
-
-static struct mv_sata_platform_data guruplug_sata_data = {
-	.n_ports	= 1,
-};
-
-static struct mvsdio_platform_data guruplug_mvsdio_data = {
-	/* unfortunately the CD signal has not been connected */
-	.gpio_card_detect = -1,
-	.gpio_write_protect = -1,
-};
-
-static struct gpio_led guruplug_led_pins[] = {
-	{
-		.name			= "guruplug:red:health",
-		.gpio			= 46,
-		.active_low		= 1,
-	},
-	{
-		.name			= "guruplug:green:health",
-		.gpio			= 47,
-		.active_low		= 1,
-	},
-	{
-		.name			= "guruplug:red:wmode",
-		.gpio			= 48,
-		.active_low		= 1,
-	},
-	{
-		.name			= "guruplug:green:wmode",
-		.gpio			= 49,
-		.active_low		= 1,
-	},
-};
-
-static struct gpio_led_platform_data guruplug_led_data = {
-	.leds		= guruplug_led_pins,
-	.num_leds	= ARRAY_SIZE(guruplug_led_pins),
-};
-
-static struct platform_device guruplug_leds = {
-	.name	= "leds-gpio",
-	.id	= -1,
-	.dev	= {
-		.platform_data	= &guruplug_led_data,
-	}
-};
-
-static unsigned int guruplug_mpp_config[] __initdata = {
-	MPP46_GPIO,	/* M_RLED */
-	MPP47_GPIO,	/* M_GLED */
-	MPP48_GPIO,	/* B_RLED */
-	MPP49_GPIO,	/* B_GLED */
-	0
-};
-
-static void __init guruplug_init(void)
-{
-	/*
-	 * Basic setup. Needs to be called early.
-	 */
-	kirkwood_init();
-	kirkwood_mpp_conf(guruplug_mpp_config);
-
-	kirkwood_uart0_init();
-	kirkwood_nand_init(ARRAY_AND_SIZE(guruplug_nand_parts), 25);
-
-	kirkwood_ehci_init();
-	kirkwood_ge00_init(&guruplug_ge00_data);
-	kirkwood_ge01_init(&guruplug_ge01_data);
-	kirkwood_sata_init(&guruplug_sata_data);
-	kirkwood_sdio_init(&guruplug_mvsdio_data);
-
-	platform_device_register(&guruplug_leds);
-}
-
-MACHINE_START(GURUPLUG, "Marvell GuruPlug Reference Board")
-	/* Maintainer: Siddarth Gore <gores@marvell.com> */
-	.atag_offset	= 0x100,
-	.init_machine	= guruplug_init,
-	.map_io		= kirkwood_map_io,
-	.init_early	= kirkwood_init_early,
-	.init_irq	= kirkwood_init_irq,
-	.init_time	= kirkwood_timer_init,
-	.restart	= kirkwood_restart,
-MACHINE_END
-- 
1.8.1.2

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

* [PATCHv2 4/9] ARM: kirkwood: remove support for legacy booting of Sheevaplug
  2013-08-01 15:07 [PATCHv2 0/9] ARM: kirkwood: convert a few more boards to DT Thomas Petazzoni
                   ` (2 preceding siblings ...)
  2013-08-01 15:07 ` [PATCHv2 3/9] ARM: kirkwood: remove support for legacy booting of Guruplug Thomas Petazzoni
@ 2013-08-01 15:07 ` Thomas Petazzoni
  2013-08-01 15:07 ` [PATCHv2 5/9] ARM: kirkwood: remove LaCie boards that are supported through DT Thomas Petazzoni
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 30+ messages in thread
From: Thomas Petazzoni @ 2013-08-01 15:07 UTC (permalink / raw)
  To: linux-arm-kernel

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

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 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

diff --git a/arch/arm/mach-kirkwood/Kconfig b/arch/arm/mach-kirkwood/Kconfig
index 1d100f6..cb4688e 100644
--- a/arch/arm/mach-kirkwood/Kconfig
+++ b/arch/arm/mach-kirkwood/Kconfig
@@ -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
diff --git a/arch/arm/mach-kirkwood/Makefile b/arch/arm/mach-kirkwood/Makefile
index 157be02..2d1eb52 100644
--- a/arch/arm/mach-kirkwood/Makefile
+++ b/arch/arm/mach-kirkwood/Makefile
@@ -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
diff --git a/arch/arm/mach-kirkwood/sheevaplug-setup.c b/arch/arm/mach-kirkwood/sheevaplug-setup.c
deleted file mode 100644
index 55b68fa..0000000
--- a/arch/arm/mach-kirkwood/sheevaplug-setup.c
+++ /dev/null
@@ -1,161 +0,0 @@
-/*
- * arch/arm/mach-kirkwood/sheevaplug-setup.c
- *
- * Marvell SheevaPlug Reference Board Setup
- *
- * This file is licensed under the terms of the GNU General Public
- * License version 2.  This program is licensed "as is" without any
- * warranty of any kind, whether express or implied.
- */
-
-#include <linux/kernel.h>
-#include <linux/init.h>
-#include <linux/platform_device.h>
-#include <linux/ata_platform.h>
-#include <linux/mtd/partitions.h>
-#include <linux/mv643xx_eth.h>
-#include <linux/gpio.h>
-#include <linux/leds.h>
-#include <asm/mach-types.h>
-#include <asm/mach/arch.h>
-#include <mach/kirkwood.h>
-#include <linux/platform_data/mmc-mvsdio.h>
-#include "common.h"
-#include "mpp.h"
-
-static struct mtd_partition sheevaplug_nand_parts[] = {
-	{
-		.name = "u-boot",
-		.offset = 0,
-		.size = SZ_1M
-	}, {
-		.name = "uImage",
-		.offset = MTDPART_OFS_NXTBLK,
-		.size = SZ_4M
-	}, {
-		.name = "root",
-		.offset = MTDPART_OFS_NXTBLK,
-		.size = MTDPART_SIZ_FULL
-	},
-};
-
-static struct mv643xx_eth_platform_data sheevaplug_ge00_data = {
-	.phy_addr	= MV643XX_ETH_PHY_ADDR(0),
-};
-
-static struct mv_sata_platform_data sheeva_esata_sata_data = {
-	.n_ports	= 2,
-};
-
-static struct mvsdio_platform_data sheevaplug_mvsdio_data = {
-	/* unfortunately the CD signal has not been connected */
-};
-
-static struct mvsdio_platform_data sheeva_esata_mvsdio_data = {
-	.gpio_write_protect = 44, /* MPP44 used as SD write protect */
-	.gpio_card_detect = 47,	  /* MPP47 used as SD card detect */
-};
-
-static struct gpio_led sheevaplug_led_pins[] = {
-	{
-		.name			= "plug:red:misc",
-		.default_trigger	= "none",
-		.gpio			= 46,
-		.active_low		= 1,
-	},
-	{
-		.name			= "plug:green:health",
-		.default_trigger	= "default-on",
-		.gpio			= 49,
-		.active_low		= 1,
-	},
-};
-
-static struct gpio_led_platform_data sheevaplug_led_data = {
-	.leds		= sheevaplug_led_pins,
-	.num_leds	= ARRAY_SIZE(sheevaplug_led_pins),
-};
-
-static struct platform_device sheevaplug_leds = {
-	.name	= "leds-gpio",
-	.id	= -1,
-	.dev	= {
-		.platform_data	= &sheevaplug_led_data,
-	}
-};
-
-static unsigned int sheevaplug_mpp_config[] __initdata = {
-	MPP29_GPIO,	/* USB Power Enable */
-	MPP46_GPIO,	/* LED Red */
-	MPP49_GPIO,	/* LED */
-	0
-};
-
-static unsigned int sheeva_esata_mpp_config[] __initdata = {
-	MPP29_GPIO,	/* USB Power Enable */
-	MPP44_GPIO,	/* SD Write Protect */
-	MPP47_GPIO,	/* SD Card Detect */
-	MPP49_GPIO,	/* LED Green */
-	0
-};
-
-static void __init sheevaplug_init(void)
-{
-	/*
-	 * Basic setup. Needs to be called early.
-	 */
-	kirkwood_init();
-
-	/* setup gpio pin select */
-	if (machine_is_esata_sheevaplug())
-		kirkwood_mpp_conf(sheeva_esata_mpp_config);
-	else
-		kirkwood_mpp_conf(sheevaplug_mpp_config);
-
-	kirkwood_uart0_init();
-	kirkwood_nand_init(ARRAY_AND_SIZE(sheevaplug_nand_parts), 25);
-
-	if (gpio_request(29, "USB Power Enable") != 0 ||
-	    gpio_direction_output(29, 1) != 0)
-		pr_err("can't set up GPIO 29 (USB Power Enable)\n");
-	kirkwood_ehci_init();
-
-	kirkwood_ge00_init(&sheevaplug_ge00_data);
-
-	/* honor lower power consumption for plugs with out eSATA */
-	if (machine_is_esata_sheevaplug())
-		kirkwood_sata_init(&sheeva_esata_sata_data);
-
-	/* enable sd wp and sd cd on plugs with esata */
-	if (machine_is_esata_sheevaplug())
-		kirkwood_sdio_init(&sheeva_esata_mvsdio_data);
-	else
-		kirkwood_sdio_init(&sheevaplug_mvsdio_data);
-
-	platform_device_register(&sheevaplug_leds);
-}
-
-#ifdef CONFIG_MACH_SHEEVAPLUG
-MACHINE_START(SHEEVAPLUG, "Marvell SheevaPlug Reference Board")
-	/* Maintainer: shadi Ammouri <shadi@marvell.com> */
-	.atag_offset	= 0x100,
-	.init_machine	= sheevaplug_init,
-	.map_io		= kirkwood_map_io,
-	.init_early	= kirkwood_init_early,
-	.init_irq	= kirkwood_init_irq,
-	.init_time	= kirkwood_timer_init,
-	.restart	= kirkwood_restart,
-MACHINE_END
-#endif
-
-#ifdef CONFIG_MACH_ESATA_SHEEVAPLUG
-MACHINE_START(ESATA_SHEEVAPLUG, "Marvell eSATA SheevaPlug Reference Board")
-	.atag_offset	= 0x100,
-	.init_machine	= sheevaplug_init,
-	.map_io		= kirkwood_map_io,
-	.init_early	= kirkwood_init_early,
-	.init_irq	= kirkwood_init_irq,
-	.init_time	= kirkwood_timer_init,
-	.restart	= kirkwood_restart,
-MACHINE_END
-#endif
-- 
1.8.1.2

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

* [PATCHv2 5/9] ARM: kirkwood: remove LaCie boards that are supported through DT
  2013-08-01 15:07 [PATCHv2 0/9] ARM: kirkwood: convert a few more boards to DT Thomas Petazzoni
                   ` (3 preceding siblings ...)
  2013-08-01 15:07 ` [PATCHv2 4/9] ARM: kirkwood: remove support for legacy booting of Sheevaplug Thomas Petazzoni
@ 2013-08-01 15:07 ` Thomas Petazzoni
  2013-08-01 15:07 ` [PATCHv2 6/9] ARM: kirkwood: convert the mv88f6281gtw_ge board to DT Thomas Petazzoni
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 30+ messages in thread
From: Thomas Petazzoni @ 2013-08-01 15:07 UTC (permalink / raw)
  To: linux-arm-kernel

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.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 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

diff --git a/arch/arm/mach-kirkwood/Kconfig b/arch/arm/mach-kirkwood/Kconfig
index cb4688e..48c61ad 100644
--- a/arch/arm/mach-kirkwood/Kconfig
+++ b/arch/arm/mach-kirkwood/Kconfig
@@ -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
diff --git a/arch/arm/mach-kirkwood/Makefile b/arch/arm/mach-kirkwood/Makefile
index 2d1eb52..c58723d 100644
--- a/arch/arm/mach-kirkwood/Makefile
+++ b/arch/arm/mach-kirkwood/Makefile
@@ -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
diff --git a/arch/arm/mach-kirkwood/netspace_v2-setup.c b/arch/arm/mach-kirkwood/netspace_v2-setup.c
deleted file mode 100644
index 3b70661..0000000
--- a/arch/arm/mach-kirkwood/netspace_v2-setup.c
+++ /dev/null
@@ -1,293 +0,0 @@
-/*
- * arch/arm/mach-kirkwood/netspace_v2-setup.c
- *
- * LaCie Network Space v2 board setup
- *
- * Copyright (C) 2009 Simon Guinot <sguinot@lacie.com>
- * Copyright (C) 2009 Beno??t Canet <benoit.canet@gmail.com>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#include <linux/kernel.h>
-#include <linux/init.h>
-#include <linux/platform_device.h>
-#include <linux/ata_platform.h>
-#include <linux/mv643xx_eth.h>
-#include <linux/input.h>
-#include <linux/gpio.h>
-#include <linux/gpio_keys.h>
-#include <linux/leds.h>
-#include <linux/gpio-fan.h>
-#include <asm/mach-types.h>
-#include <asm/mach/arch.h>
-#include <mach/kirkwood.h>
-#include <linux/platform_data/leds-kirkwood-ns2.h>
-#include "common.h"
-#include "mpp.h"
-#include "lacie_v2-common.h"
-
-/*****************************************************************************
- * Ethernet
- ****************************************************************************/
-
-static struct mv643xx_eth_platform_data netspace_v2_ge00_data = {
-	.phy_addr	= MV643XX_ETH_PHY_ADDR(8),
-};
-
-/*****************************************************************************
- * SATA
- ****************************************************************************/
-
-static struct mv_sata_platform_data netspace_v2_sata_data = {
-	.n_ports	= 2,
-};
-
-/*****************************************************************************
- * GPIO keys
- ****************************************************************************/
-
-#define NETSPACE_V2_PUSH_BUTTON		32
-
-static struct gpio_keys_button netspace_v2_buttons[] = {
-	[0] = {
-		.code		= KEY_POWER,
-		.gpio		= NETSPACE_V2_PUSH_BUTTON,
-		.desc		= "Power push button",
-		.active_low	= 0,
-	},
-};
-
-static struct gpio_keys_platform_data netspace_v2_button_data = {
-	.buttons	= netspace_v2_buttons,
-	.nbuttons	= ARRAY_SIZE(netspace_v2_buttons),
-};
-
-static struct platform_device netspace_v2_gpio_buttons = {
-	.name		= "gpio-keys",
-	.id		= -1,
-	.dev		= {
-		.platform_data	= &netspace_v2_button_data,
-	},
-};
-
-/*****************************************************************************
- * GPIO LEDs
- ****************************************************************************/
-
-#define NETSPACE_V2_GPIO_RED_LED	12
-
-static struct gpio_led netspace_v2_gpio_led_pins[] = {
-	{
-		.name	= "ns_v2:red:fail",
-		.gpio	= NETSPACE_V2_GPIO_RED_LED,
-	},
-};
-
-static struct gpio_led_platform_data netspace_v2_gpio_leds_data = {
-	.num_leds	= ARRAY_SIZE(netspace_v2_gpio_led_pins),
-	.leds		= netspace_v2_gpio_led_pins,
-};
-
-static struct platform_device netspace_v2_gpio_leds = {
-	.name		= "leds-gpio",
-	.id		= -1,
-	.dev		= {
-		.platform_data	= &netspace_v2_gpio_leds_data,
-	},
-};
-
-/*****************************************************************************
- * Dual-GPIO CPLD LEDs
- ****************************************************************************/
-
-#define NETSPACE_V2_GPIO_BLUE_LED_SLOW	29
-#define NETSPACE_V2_GPIO_BLUE_LED_CMD	30
-
-static struct ns2_led netspace_v2_led_pins[] = {
-	{
-		.name	= "ns_v2:blue:sata",
-		.cmd	= NETSPACE_V2_GPIO_BLUE_LED_CMD,
-		.slow	= NETSPACE_V2_GPIO_BLUE_LED_SLOW,
-	},
-};
-
-static struct ns2_led_platform_data netspace_v2_leds_data = {
-	.num_leds	= ARRAY_SIZE(netspace_v2_led_pins),
-	.leds		= netspace_v2_led_pins,
-};
-
-static struct platform_device netspace_v2_leds = {
-	.name		= "leds-ns2",
-	.id		= -1,
-	.dev		= {
-		.platform_data	= &netspace_v2_leds_data,
-	},
-};
-
-/*****************************************************************************
- * GPIO fan
- ****************************************************************************/
-
-/* Designed for fan 40x40x16: ADDA AD0412LB-D50 6000rpm at 12v */
-static struct gpio_fan_speed netspace_max_v2_fan_speed[] = {
-	{    0,  0 },
-	{ 1500,	15 },
-	{ 1700,	14 },
-	{ 1800,	13 },
-	{ 2100,	12 },
-	{ 3100,	11 },
-	{ 3300,	10 },
-	{ 4300,	 9 },
-	{ 5500,	 8 },
-};
-
-static unsigned netspace_max_v2_fan_ctrl[] = { 22, 7, 33, 23 };
-
-static struct gpio_fan_alarm netspace_max_v2_fan_alarm = {
-	.gpio		= 25,
-	.active_low	= 1,
-};
-
-static struct gpio_fan_platform_data netspace_max_v2_fan_data = {
-	.num_ctrl	= ARRAY_SIZE(netspace_max_v2_fan_ctrl),
-	.ctrl		= netspace_max_v2_fan_ctrl,
-	.alarm		= &netspace_max_v2_fan_alarm,
-	.num_speed	= ARRAY_SIZE(netspace_max_v2_fan_speed),
-	.speed		= netspace_max_v2_fan_speed,
-};
-
-static struct platform_device netspace_max_v2_gpio_fan = {
-	.name	= "gpio-fan",
-	.id	= -1,
-	.dev	= {
-		.platform_data	= &netspace_max_v2_fan_data,
-	},
-};
-
-/*****************************************************************************
- * General Setup
- ****************************************************************************/
-
-static unsigned int netspace_v2_mpp_config[] __initdata = {
-	MPP0_SPI_SCn,
-	MPP1_SPI_MOSI,
-	MPP2_SPI_SCK,
-	MPP3_SPI_MISO,
-	MPP4_NF_IO6,
-	MPP5_NF_IO7,
-	MPP6_SYSRST_OUTn,
-	MPP7_GPO,		/* Fan speed (bit 1) */
-	MPP8_TW0_SDA,
-	MPP9_TW0_SCK,
-	MPP10_UART0_TXD,
-	MPP11_UART0_RXD,
-	MPP12_GPO,		/* Red led */
-	MPP14_GPIO,		/* USB fuse */
-	MPP16_GPIO,		/* SATA 0 power */
-	MPP17_GPIO,		/* SATA 1 power */
-	MPP18_NF_IO0,
-	MPP19_NF_IO1,
-	MPP20_SATA1_ACTn,
-	MPP21_SATA0_ACTn,
-	MPP22_GPIO,		/* Fan speed (bit 0) */
-	MPP23_GPIO,		/* Fan power */
-	MPP24_GPIO,		/* USB mode select */
-	MPP25_GPIO,		/* Fan rotation fail */
-	MPP26_GPIO,		/* USB device vbus */
-	MPP28_GPIO,		/* USB enable host vbus */
-	MPP29_GPIO,		/* Blue led (slow register) */
-	MPP30_GPIO,		/* Blue led (command register) */
-	MPP31_GPIO,		/* Board power off */
-	MPP32_GPIO,		/* Power button (0 = Released, 1 = Pushed) */
-	MPP33_GPO,		/* Fan speed (bit 2) */
-	0
-};
-
-#define NETSPACE_V2_GPIO_POWER_OFF	31
-
-static void netspace_v2_power_off(void)
-{
-	gpio_set_value(NETSPACE_V2_GPIO_POWER_OFF, 1);
-}
-
-static void __init netspace_v2_init(void)
-{
-	/*
-	 * Basic setup. Needs to be called early.
-	 */
-	kirkwood_init();
-	kirkwood_mpp_conf(netspace_v2_mpp_config);
-
-	if (machine_is_netspace_max_v2())
-		lacie_v2_hdd_power_init(2);
-	else
-		lacie_v2_hdd_power_init(1);
-
-	kirkwood_ehci_init();
-	kirkwood_ge00_init(&netspace_v2_ge00_data);
-	kirkwood_sata_init(&netspace_v2_sata_data);
-	kirkwood_uart0_init();
-	lacie_v2_register_flash();
-	lacie_v2_register_i2c_devices();
-
-	platform_device_register(&netspace_v2_leds);
-	platform_device_register(&netspace_v2_gpio_leds);
-	platform_device_register(&netspace_v2_gpio_buttons);
-	if (machine_is_netspace_max_v2())
-		platform_device_register(&netspace_max_v2_gpio_fan);
-
-	if (gpio_request(NETSPACE_V2_GPIO_POWER_OFF, "power-off") == 0 &&
-	    gpio_direction_output(NETSPACE_V2_GPIO_POWER_OFF, 0) == 0)
-		pm_power_off = netspace_v2_power_off;
-	else
-		pr_err("netspace_v2: failed to configure power-off GPIO\n");
-}
-
-#ifdef CONFIG_MACH_NETSPACE_V2
-MACHINE_START(NETSPACE_V2, "LaCie Network Space v2")
-	.atag_offset	= 0x100,
-	.init_machine	= netspace_v2_init,
-	.map_io		= kirkwood_map_io,
-	.init_early	= kirkwood_init_early,
-	.init_irq	= kirkwood_init_irq,
-	.init_time	= kirkwood_timer_init,
-	.restart	= kirkwood_restart,
-MACHINE_END
-#endif
-
-#ifdef CONFIG_MACH_INETSPACE_V2
-MACHINE_START(INETSPACE_V2, "LaCie Internet Space v2")
-	.atag_offset	= 0x100,
-	.init_machine	= netspace_v2_init,
-	.map_io		= kirkwood_map_io,
-	.init_early	= kirkwood_init_early,
-	.init_irq	= kirkwood_init_irq,
-	.init_time	= kirkwood_timer_init,
-	.restart	= kirkwood_restart,
-MACHINE_END
-#endif
-
-#ifdef CONFIG_MACH_NETSPACE_MAX_V2
-MACHINE_START(NETSPACE_MAX_V2, "LaCie Network Space Max v2")
-	.atag_offset	= 0x100,
-	.init_machine	= netspace_v2_init,
-	.map_io		= kirkwood_map_io,
-	.init_early	= kirkwood_init_early,
-	.init_irq	= kirkwood_init_irq,
-	.init_time	= kirkwood_timer_init,
-	.restart	= kirkwood_restart,
-MACHINE_END
-#endif
-- 
1.8.1.2

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

* [PATCHv2 6/9] ARM: kirkwood: convert the mv88f6281gtw_ge board to DT
  2013-08-01 15:07 [PATCHv2 0/9] ARM: kirkwood: convert a few more boards to DT Thomas Petazzoni
                   ` (4 preceding siblings ...)
  2013-08-01 15:07 ` [PATCHv2 5/9] ARM: kirkwood: remove LaCie boards that are supported through DT Thomas Petazzoni
@ 2013-08-01 15:07 ` Thomas Petazzoni
  2013-08-01 15:07 ` [PATCHv2 7/9] ARM: kirkwood: convert LaCie Net{2, 5}Big v2 platforms " Thomas Petazzoni
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 30+ messages in thread
From: Thomas Petazzoni @ 2013-08-01 15:07 UTC (permalink / raw)
  To: linux-arm-kernel

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.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 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

diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index 277685f..d168bed 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -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 \
diff --git a/arch/arm/boot/dts/kirkwood-mv88f6281gtw-ge.dts b/arch/arm/boot/dts/kirkwood-mv88f6281gtw-ge.dts
new file mode 100644
index 0000000..13e3576
--- /dev/null
+++ b/arch/arm/boot/dts/kirkwood-mv88f6281gtw-ge.dts
@@ -0,0 +1,125 @@
+/*
+ * Marvell 88F6281 GTW GE Board
+ *
+ * Lennert Buytenhek <buytenh@marvell.com>
+ * Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+ *
+ * This file is licensed under the terms of the GNU General Public
+ * License version 2.  This program is licensed "as is" without any
+ * warranty of any kind, whether express or implied.
+ *
+ * This file contains the definitions that are common between the 6281
+ * and 6282 variants of the Marvell Kirkwood Development Board.
+ */
+
+/dts-v1/;
+
+/include/ "kirkwood.dtsi"
+/include/ "kirkwood-6281.dtsi"
+
+/ {
+	model = "Marvell 88F6281 GTW GE Board";
+	compatible = "marvell,mv88f6281gtw-ge", "marvell,kirkwood-88f6281", "marvell,kirkwood";
+
+	memory {
+		device_type = "memory";
+		reg = <0x00000000 0x20000000>; /* 512 MB */
+	};
+
+	chosen {
+		bootargs = "console=ttyS0,115200n8 earlyprintk";
+	};
+
+	ocp at f1000000 {
+		pinctrl at 10000 {
+			pmx_usb_led: pmx-usb-led {
+				marvell,pins = "mpp12";
+				marvell,function = "gpo";
+			};
+
+			pmx_leds: pmx-leds {
+				marvell,pins = "mpp20", "mpp21";
+				marvell,function = "gpio";
+			};
+
+			pmx_keys: pmx-keys {
+				marvell,pins = "mpp46", "mpp47";
+				marvell,function = "gpio";
+			};
+		};
+
+		spi at 10600 {
+			pinctrl-0 = <&pmx_spi>;
+			pinctrl-names = "default";
+			status = "okay";
+
+			flash at 0 {
+				#address-cells = <1>;
+				#size-cells = <1>;
+				compatible = "mx25l12805d";
+				reg = <0>;
+				spi-max-frequency = <50000000>;
+				mode = <0>;
+			};
+		};
+
+		serial at 12000 {
+			pinctrl-0 = <&pmx_uart0>;
+			pinctrl-names = "default";
+			clock-frequency = <200000000>;
+			status = "ok";
+		};
+
+		ehci at 50000 {
+			status = "okay";
+		};
+
+		pcie-controller {
+			status = "okay";
+
+			pcie at 1,0 {
+				status = "okay";
+			};
+		};
+	};
+
+	gpio-leds {
+		compatible = "gpio-leds";
+		pinctrl-0 = <&pmx_leds &pmx_usb_led>;
+		pinctrl-names = "default";
+
+		green-status {
+			label = "gtw:green:Status";
+			gpios = <&gpio0 20 0>;
+		};
+
+		red-status {
+			label = "gtw:red:Status";
+			gpios = <&gpio0 21 0>;
+		};
+
+		green-usb {
+			label = "gtw:green:USB";
+			gpios = <&gpio0 12 0>;
+		};
+	};
+
+	gpio_keys {
+		compatible = "gpio-keys";
+		#address-cells = <1>;
+		#size-cells = <0>;
+		pinctrl-0 = <&pmx_keys>;
+		pinctrl-names = "default";
+
+		button at 1 {
+			label = "SWR Button";
+			linux,code = <0x198>; /* KEY_RESTART */
+			gpios = <&gpio1 15 1>;
+		};
+		button at 2 {
+			label = "WPS Button";
+			linux,code = <0x211>; /* KEY_WPS_BUTTON */
+			gpios = <&gpio1 14 1>;
+		};
+	};
+};
diff --git a/arch/arm/mach-kirkwood/Kconfig b/arch/arm/mach-kirkwood/Kconfig
index 48c61ad..f624162 100644
--- a/arch/arm/mach-kirkwood/Kconfig
+++ b/arch/arm/mach-kirkwood/Kconfig
@@ -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
diff --git a/arch/arm/mach-kirkwood/Makefile b/arch/arm/mach-kirkwood/Makefile
index c58723d..0dcc5d4 100644
--- a/arch/arm/mach-kirkwood/Makefile
+++ b/arch/arm/mach-kirkwood/Makefile
@@ -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
diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c
index fac0f8e..b129c65 100644
--- a/arch/arm/mach-kirkwood/board-dt.c
+++ b/arch/arm/mach-kirkwood/board-dt.c
@@ -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);
 }
 
diff --git a/arch/arm/mach-kirkwood/board-mv88f6281gtw_ge.c b/arch/arm/mach-kirkwood/board-mv88f6281gtw_ge.c
new file mode 100644
index 0000000..ee5eea6
--- /dev/null
+++ b/arch/arm/mach-kirkwood/board-mv88f6281gtw_ge.c
@@ -0,0 +1,50 @@
+/*
+ * arch/arm/mach-kirkwood/board-mv88f6281gtw_ge.c
+ *
+ * Marvell 88F6281 GTW GE Board Setup
+ *
+ * This file is licensed under the terms of the GNU General Public
+ * License version 2.  This program is licensed "as is" without any
+ * warranty of any kind, whether express or implied.
+ */
+
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/platform_device.h>
+#include <linux/irq.h>
+#include <linux/timer.h>
+#include <linux/mv643xx_eth.h>
+#include <linux/ethtool.h>
+#include <linux/gpio.h>
+#include <net/dsa.h>
+#include <asm/mach-types.h>
+#include <asm/mach/arch.h>
+#include <asm/mach/pci.h>
+#include <mach/kirkwood.h>
+#include "common.h"
+
+static struct mv643xx_eth_platform_data mv88f6281gtw_ge_ge00_data = {
+	.phy_addr	= MV643XX_ETH_PHY_NONE,
+	.speed		= SPEED_1000,
+	.duplex		= DUPLEX_FULL,
+};
+
+static struct dsa_chip_data mv88f6281gtw_ge_switch_chip_data = {
+	.port_names[0]	= "lan1",
+	.port_names[1]	= "lan2",
+	.port_names[2]	= "lan3",
+	.port_names[3]	= "lan4",
+	.port_names[4]	= "wan",
+	.port_names[5]	= "cpu",
+};
+
+static struct dsa_platform_data mv88f6281gtw_ge_switch_plat_data = {
+	.nr_chips	= 1,
+	.chip		= &mv88f6281gtw_ge_switch_chip_data,
+};
+
+void __init mv88f6281gtw_ge_init(void)
+{
+	kirkwood_ge00_init(&mv88f6281gtw_ge_ge00_data);
+	kirkwood_ge00_switch_init(&mv88f6281gtw_ge_switch_plat_data, NO_IRQ);
+}
diff --git a/arch/arm/mach-kirkwood/common.h b/arch/arm/mach-kirkwood/common.h
index 9d8caae..cc639bb 100644
--- a/arch/arm/mach-kirkwood/common.h
+++ b/arch/arm/mach-kirkwood/common.h
@@ -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);
diff --git a/arch/arm/mach-kirkwood/mv88f6281gtw_ge-setup.c b/arch/arm/mach-kirkwood/mv88f6281gtw_ge-setup.c
deleted file mode 100644
index ba384b9..0000000
--- a/arch/arm/mach-kirkwood/mv88f6281gtw_ge-setup.c
+++ /dev/null
@@ -1,172 +0,0 @@
-/*
- * arch/arm/mach-kirkwood/mv88f6281gtw_ge-setup.c
- *
- * Marvell 88F6281 GTW GE Board Setup
- *
- * This file is licensed under the terms of the GNU General Public
- * License version 2.  This program is licensed "as is" without any
- * warranty of any kind, whether express or implied.
- */
-
-#include <linux/kernel.h>
-#include <linux/init.h>
-#include <linux/platform_device.h>
-#include <linux/pci.h>
-#include <linux/irq.h>
-#include <linux/mtd/physmap.h>
-#include <linux/timer.h>
-#include <linux/mv643xx_eth.h>
-#include <linux/ethtool.h>
-#include <linux/gpio.h>
-#include <linux/leds.h>
-#include <linux/input.h>
-#include <linux/gpio_keys.h>
-#include <linux/spi/flash.h>
-#include <linux/spi/spi.h>
-#include <net/dsa.h>
-#include <asm/mach-types.h>
-#include <asm/mach/arch.h>
-#include <asm/mach/pci.h>
-#include <mach/kirkwood.h>
-#include "common.h"
-#include "mpp.h"
-
-static struct mv643xx_eth_platform_data mv88f6281gtw_ge_ge00_data = {
-	.phy_addr	= MV643XX_ETH_PHY_NONE,
-	.speed		= SPEED_1000,
-	.duplex		= DUPLEX_FULL,
-};
-
-static struct dsa_chip_data mv88f6281gtw_ge_switch_chip_data = {
-	.port_names[0]	= "lan1",
-	.port_names[1]	= "lan2",
-	.port_names[2]	= "lan3",
-	.port_names[3]	= "lan4",
-	.port_names[4]	= "wan",
-	.port_names[5]	= "cpu",
-};
-
-static struct dsa_platform_data mv88f6281gtw_ge_switch_plat_data = {
-	.nr_chips	= 1,
-	.chip		= &mv88f6281gtw_ge_switch_chip_data,
-};
-
-static const struct flash_platform_data mv88f6281gtw_ge_spi_slave_data = {
-	.type		= "mx25l12805d",
-};
-
-static struct spi_board_info __initdata mv88f6281gtw_ge_spi_slave_info[] = {
-	{
-		.modalias	= "m25p80",
-		.platform_data	= &mv88f6281gtw_ge_spi_slave_data,
-		.irq		= -1,
-		.max_speed_hz	= 50000000,
-		.bus_num	= 0,
-		.chip_select	= 0,
-	},
-};
-
-static struct gpio_keys_button mv88f6281gtw_ge_button_pins[] = {
-	{
-		.code		= KEY_RESTART,
-		.gpio		= 47,
-		.desc		= "SWR Button",
-		.active_low	= 1,
-	}, {
-		.code		= KEY_WPS_BUTTON,
-		.gpio		= 46,
-		.desc		= "WPS Button",
-		.active_low	= 1,
-	},
-};
-
-static struct gpio_keys_platform_data mv88f6281gtw_ge_button_data = {
-	.buttons	= mv88f6281gtw_ge_button_pins,
-	.nbuttons	= ARRAY_SIZE(mv88f6281gtw_ge_button_pins),
-};
-
-static struct platform_device mv88f6281gtw_ge_buttons = {
-	.name		= "gpio-keys",
-	.id		= -1,
-	.num_resources	= 0,
-	.dev		= {
-		.platform_data	= &mv88f6281gtw_ge_button_data,
-	},
-};
-
-static struct gpio_led mv88f6281gtw_ge_led_pins[] = {
-	{
-		.name		= "gtw:green:Status",
-		.gpio		= 20,
-		.active_low	= 0,
-	}, {
-		.name		= "gtw:red:Status",
-		.gpio		= 21,
-		.active_low	= 0,
-	}, {
-		.name		= "gtw:green:USB",
-		.gpio		= 12,
-		.active_low	= 0,
-	},
-};
-
-static struct gpio_led_platform_data mv88f6281gtw_ge_led_data = {
-	.leds		= mv88f6281gtw_ge_led_pins,
-	.num_leds	= ARRAY_SIZE(mv88f6281gtw_ge_led_pins),
-};
-
-static struct platform_device mv88f6281gtw_ge_leds = {
-	.name	= "leds-gpio",
-	.id	= -1,
-	.dev	= {
-		.platform_data	= &mv88f6281gtw_ge_led_data,
-	},
-};
-
-static unsigned int mv88f6281gtw_ge_mpp_config[] __initdata = {
-	MPP12_GPO,	/* Status#_USB pin  */
-	MPP20_GPIO,	/* Status#_GLED pin */
-	MPP21_GPIO,	/* Status#_RLED pin */
-	MPP46_GPIO,	/* WPS_Switch pin   */
-	MPP47_GPIO,	/* SW_Init pin      */
-	0
-};
-
-static void __init mv88f6281gtw_ge_init(void)
-{
-	/*
-	 * Basic setup. Needs to be called early.
-	 */
-	kirkwood_init();
-	kirkwood_mpp_conf(mv88f6281gtw_ge_mpp_config);
-
-	kirkwood_ehci_init();
-	kirkwood_ge00_init(&mv88f6281gtw_ge_ge00_data);
-	kirkwood_ge00_switch_init(&mv88f6281gtw_ge_switch_plat_data, NO_IRQ);
-	spi_register_board_info(mv88f6281gtw_ge_spi_slave_info,
-				ARRAY_SIZE(mv88f6281gtw_ge_spi_slave_info));
-	kirkwood_spi_init();
-	kirkwood_uart0_init();
-	platform_device_register(&mv88f6281gtw_ge_leds);
-	platform_device_register(&mv88f6281gtw_ge_buttons);
-}
-
-static int __init mv88f6281gtw_ge_pci_init(void)
-{
-	if (machine_is_mv88f6281gtw_ge())
-		kirkwood_pcie_init(KW_PCIE0);
-
-	return 0;
-}
-subsys_initcall(mv88f6281gtw_ge_pci_init);
-
-MACHINE_START(MV88F6281GTW_GE, "Marvell 88F6281 GTW GE Board")
-	/* Maintainer: Lennert Buytenhek <buytenh@marvell.com> */
-	.atag_offset	= 0x100,
-	.init_machine	= mv88f6281gtw_ge_init,
-	.map_io		= kirkwood_map_io,
-	.init_early	= kirkwood_init_early,
-	.init_irq	= kirkwood_init_irq,
-	.init_time	= kirkwood_timer_init,
-	.restart	= kirkwood_restart,
-MACHINE_END
-- 
1.8.1.2

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

* [PATCHv2 7/9] ARM: kirkwood: convert LaCie Net{2, 5}Big v2 platforms to DT
  2013-08-01 15:07 [PATCHv2 0/9] ARM: kirkwood: convert a few more boards to DT Thomas Petazzoni
                   ` (5 preceding siblings ...)
  2013-08-01 15:07 ` [PATCHv2 6/9] ARM: kirkwood: convert the mv88f6281gtw_ge board to DT Thomas Petazzoni
@ 2013-08-01 15:07 ` Thomas Petazzoni
  2013-08-02 21:25   ` Simon Guinot
  2013-08-02 21:34   ` [PATCH] leds: leds-netxbig: depends on ARCH_KIRKWOOD Simon Guinot
  2013-08-01 15:07 ` [PATCHv2 8/9] ARM: kirkwood: remove unused common code for LaCie platforms Thomas Petazzoni
                   ` (2 subsequent siblings)
  9 siblings, 2 replies; 30+ messages in thread
From: Thomas Petazzoni @ 2013-08-01 15:07 UTC (permalink / raw)
  To: linux-arm-kernel

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.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 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

diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index d168bed..20a6886 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -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 \
diff --git a/arch/arm/boot/dts/kirkwood-net2big-v2.dts b/arch/arm/boot/dts/kirkwood-net2big-v2.dts
new file mode 100644
index 0000000..608ef01
--- /dev/null
+++ b/arch/arm/boot/dts/kirkwood-net2big-v2.dts
@@ -0,0 +1,219 @@
+/*
+ * LaCie 2Big Network v2
+ *
+ * Simon Guinot <sguinot@lacie.com>
+ *
+ * This file is licensed under the terms of the GNU General Public
+ * License version 2.  This program is licensed "as is" without any
+ * warranty of any kind, whether express or implied.
+ */
+
+/dts-v1/;
+
+/include/ "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 */
+	};
+
+	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 {
+				compatible = "at,24c04";
+				pagesize = <16>;
+				reg = <0x50>;
+			};
+		};
+
+		serial at 12000 {
+			pinctrl-0 = <&pmx_uart0>;
+			pinctrl-names = "default";
+			clock-frequency = <200000000>;
+			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>;
+			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>;
+			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>;
+		};
+	};
+};
+
+&mdio {
+	status = "okay";
+
+	ethphy0: ethernet-phy at 0 {
+		device_type = "ethernet-phy";
+		reg = <8>;
+	};
+};
+
+&eth0 {
+	status = "okay";
+	ethernet0-port at 0 {
+		phy-handle = <&ethphy0>;
+	};
+};
diff --git a/arch/arm/boot/dts/kirkwood-net5big-v2.dts b/arch/arm/boot/dts/kirkwood-net5big-v2.dts
new file mode 100644
index 0000000..46ca107
--- /dev/null
+++ b/arch/arm/boot/dts/kirkwood-net5big-v2.dts
@@ -0,0 +1,265 @@
+/*
+ * LaCie 5Big Network v2
+ *
+ * Simon Guinot <sguinot@lacie.com>
+ *
+ * This file is licensed under the terms of the GNU General Public
+ * License version 2.  This program is licensed "as is" without any
+ * warranty of any kind, whether express or implied.
+ */
+
+/dts-v1/;
+
+/include/ "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 */
+	};
+
+	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 {
+				compatible = "at,24c04";
+				pagesize = <16>;
+				reg = <0x50>;
+			};
+		};
+
+		serial at 12000 {
+			pinctrl-0 = <&pmx_uart0>;
+			pinctrl-names = "default";
+			clock-frequency = <200000000>;
+			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>;
+			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>;
+			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>;
+			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>;
+			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>;
+			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";
+	ethernet0-port at 0 {
+		phy-handle = <&ethphy0>;
+	};
+};
+
+&eth1 {
+	status = "okay";
+	ethernet1-port at 0 {
+		phy-handle = <&ethphy1>;
+	};
+};
diff --git a/arch/arm/mach-kirkwood/Kconfig b/arch/arm/mach-kirkwood/Kconfig
index f624162..b7e66fa 100644
--- a/arch/arm/mach-kirkwood/Kconfig
+++ b/arch/arm/mach-kirkwood/Kconfig
@@ -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
diff --git a/arch/arm/mach-kirkwood/Makefile b/arch/arm/mach-kirkwood/Makefile
index 0dcc5d4..38d0d74 100644
--- a/arch/arm/mach-kirkwood/Makefile
+++ b/arch/arm/mach-kirkwood/Makefile
@@ -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
diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c
index b129c65..80955cc 100644
--- a/arch/arm/mach-kirkwood/board-dt.c
+++ b/arch/arm/mach-kirkwood/board-dt.c
@@ -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);
 }
 
diff --git a/arch/arm/mach-kirkwood/board-netxbig_v2.c b/arch/arm/mach-kirkwood/board-netxbig_v2.c
new file mode 100644
index 0000000..dd4a222
--- /dev/null
+++ b/arch/arm/mach-kirkwood/board-netxbig_v2.c
@@ -0,0 +1,199 @@
+/*
+ * arch/arm/mach-kirkwood/board-netxbig_v2.c
+ *
+ * LaCie 2Big and 5Big Network v2 board setup
+ *
+ * Copyright (C) 2010 Simon Guinot <sguinot@lacie.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/platform_device.h>
+#include <linux/gpio.h>
+#include <linux/leds.h>
+#include <asm/mach-types.h>
+#include <asm/mach/arch.h>
+#include <mach/kirkwood.h>
+#include <linux/platform_data/leds-kirkwood-netxbig.h>
+#include "common.h"
+
+/*****************************************************************************
+ * GPIO extension LEDs
+ ****************************************************************************/
+
+/*
+ * The LEDs are controlled by a CPLD and can be configured through a GPIO
+ * extension bus:
+ *
+ * - address register : bit [0-2] -> GPIO [47-49]
+ * - data register    : bit [0-2] -> GPIO [44-46]
+ * - enable register  : GPIO 29
+ */
+
+static int netxbig_v2_gpio_ext_addr[] = { 47, 48, 49 };
+static int netxbig_v2_gpio_ext_data[] = { 44, 45, 46 };
+
+static struct netxbig_gpio_ext netxbig_v2_gpio_ext = {
+	.addr		= netxbig_v2_gpio_ext_addr,
+	.num_addr	= ARRAY_SIZE(netxbig_v2_gpio_ext_addr),
+	.data		= netxbig_v2_gpio_ext_data,
+	.num_data	= ARRAY_SIZE(netxbig_v2_gpio_ext_data),
+	.enable		= 29,
+};
+
+/*
+ * Address register selection:
+ *
+ * addr | register
+ * ----------------------------
+ *   0  | front LED
+ *   1  | front LED brightness
+ *   2  | SATA LED brightness
+ *   3  | SATA0 LED
+ *   4  | SATA1 LED
+ *   5  | SATA2 LED
+ *   6  | SATA3 LED
+ *   7  | SATA4 LED
+ *
+ * Data register configuration:
+ *
+ * data | LED brightness
+ * -------------------------------------------------
+ *   0  | min (off)
+ *   -  | -
+ *   7  | max
+ *
+ * data | front LED mode
+ * -------------------------------------------------
+ *   0  | fix off
+ *   1  | fix blue on
+ *   2  | fix red on
+ *   3  | blink blue on=1 sec and blue off=1 sec
+ *   4  | blink red on=1 sec and red off=1 sec
+ *   5  | blink blue on=2.5 sec and red on=0.5 sec
+ *   6  | blink blue on=1 sec and red on=1 sec
+ *   7  | blink blue on=0.5 sec and blue off=2.5 sec
+ *
+ * data | SATA LED mode
+ * -------------------------------------------------
+ *   0  | fix off
+ *   1  | SATA activity blink
+ *   2  | fix red on
+ *   3  | blink blue on=1 sec and blue off=1 sec
+ *   4  | blink red on=1 sec and red off=1 sec
+ *   5  | blink blue on=2.5 sec and red on=0.5 sec
+ *   6  | blink blue on=1 sec and red on=1 sec
+ *   7  | fix blue on
+ */
+
+static int netxbig_v2_red_mled[NETXBIG_LED_MODE_NUM] = {
+	[NETXBIG_LED_OFF]	= 0,
+	[NETXBIG_LED_ON]	= 2,
+	[NETXBIG_LED_SATA]	= NETXBIG_LED_INVALID_MODE,
+	[NETXBIG_LED_TIMER1]	= 4,
+	[NETXBIG_LED_TIMER2]	= NETXBIG_LED_INVALID_MODE,
+};
+
+static int netxbig_v2_blue_pwr_mled[NETXBIG_LED_MODE_NUM] = {
+	[NETXBIG_LED_OFF]	= 0,
+	[NETXBIG_LED_ON]	= 1,
+	[NETXBIG_LED_SATA]	= NETXBIG_LED_INVALID_MODE,
+	[NETXBIG_LED_TIMER1]	= 3,
+	[NETXBIG_LED_TIMER2]	= 7,
+};
+
+static int netxbig_v2_blue_sata_mled[NETXBIG_LED_MODE_NUM] = {
+	[NETXBIG_LED_OFF]	= 0,
+	[NETXBIG_LED_ON]	= 7,
+	[NETXBIG_LED_SATA]	= 1,
+	[NETXBIG_LED_TIMER1]	= 3,
+	[NETXBIG_LED_TIMER2]	= NETXBIG_LED_INVALID_MODE,
+};
+
+static struct netxbig_led_timer netxbig_v2_led_timer[] = {
+	[0] = {
+		.delay_on	= 500,
+		.delay_off	= 500,
+		.mode		= NETXBIG_LED_TIMER1,
+	},
+	[1] = {
+		.delay_on	= 500,
+		.delay_off	= 1000,
+		.mode		= NETXBIG_LED_TIMER2,
+	},
+};
+
+#define NETXBIG_LED(_name, maddr, mval, baddr)			\
+	{ .name		= _name,				\
+	  .mode_addr	= maddr,				\
+	  .mode_val	= mval,					\
+	  .bright_addr	= baddr }
+
+static struct netxbig_led net2big_v2_leds_ctrl[] = {
+	NETXBIG_LED("net2big-v2:blue:power", 0, netxbig_v2_blue_pwr_mled,  1),
+	NETXBIG_LED("net2big-v2:red:power",  0, netxbig_v2_red_mled,       1),
+	NETXBIG_LED("net2big-v2:blue:sata0", 3, netxbig_v2_blue_sata_mled, 2),
+	NETXBIG_LED("net2big-v2:red:sata0",  3, netxbig_v2_red_mled,       2),
+	NETXBIG_LED("net2big-v2:blue:sata1", 4, netxbig_v2_blue_sata_mled, 2),
+	NETXBIG_LED("net2big-v2:red:sata1",  4, netxbig_v2_red_mled,       2),
+};
+
+static struct netxbig_led_platform_data net2big_v2_leds_data = {
+	.gpio_ext	= &netxbig_v2_gpio_ext,
+	.timer		= netxbig_v2_led_timer,
+	.num_timer	= ARRAY_SIZE(netxbig_v2_led_timer),
+	.leds		= net2big_v2_leds_ctrl,
+	.num_leds	= ARRAY_SIZE(net2big_v2_leds_ctrl),
+};
+
+static struct netxbig_led net5big_v2_leds_ctrl[] = {
+	NETXBIG_LED("net5big-v2:blue:power", 0, netxbig_v2_blue_pwr_mled,  1),
+	NETXBIG_LED("net5big-v2:red:power",  0, netxbig_v2_red_mled,       1),
+	NETXBIG_LED("net5big-v2:blue:sata0", 3, netxbig_v2_blue_sata_mled, 2),
+	NETXBIG_LED("net5big-v2:red:sata0",  3, netxbig_v2_red_mled,       2),
+	NETXBIG_LED("net5big-v2:blue:sata1", 4, netxbig_v2_blue_sata_mled, 2),
+	NETXBIG_LED("net5big-v2:red:sata1",  4, netxbig_v2_red_mled,       2),
+	NETXBIG_LED("net5big-v2:blue:sata2", 5, netxbig_v2_blue_sata_mled, 2),
+	NETXBIG_LED("net5big-v2:red:sata2",  5, netxbig_v2_red_mled,       2),
+	NETXBIG_LED("net5big-v2:blue:sata3", 6, netxbig_v2_blue_sata_mled, 2),
+	NETXBIG_LED("net5big-v2:red:sata3",  6, netxbig_v2_red_mled,       2),
+	NETXBIG_LED("net5big-v2:blue:sata4", 7, netxbig_v2_blue_sata_mled, 2),
+	NETXBIG_LED("net5big-v2:red:sata5",  7, netxbig_v2_red_mled,       2),
+};
+
+static struct netxbig_led_platform_data net5big_v2_leds_data = {
+	.gpio_ext	= &netxbig_v2_gpio_ext,
+	.timer		= netxbig_v2_led_timer,
+	.num_timer	= ARRAY_SIZE(netxbig_v2_led_timer),
+	.leds		= net5big_v2_leds_ctrl,
+	.num_leds	= ARRAY_SIZE(net5big_v2_leds_ctrl),
+};
+
+static struct platform_device netxbig_v2_leds = {
+	.name		= "leds-netxbig",
+	.id		= -1,
+	.dev		= {
+		.platform_data	= &net2big_v2_leds_data,
+	},
+};
+
+void __init netxbig_v2_init(void)
+{
+	if (of_machine_is_compatible("lacie,net5big-v2"))
+		netxbig_v2_leds.dev.platform_data = &net5big_v2_leds_data;
+	platform_device_register(&netxbig_v2_leds);
+}
diff --git a/arch/arm/mach-kirkwood/common.h b/arch/arm/mach-kirkwood/common.h
index cc639bb..a9010a3 100644
--- a/arch/arm/mach-kirkwood/common.h
+++ b/arch/arm/mach-kirkwood/common.h
@@ -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);
diff --git a/arch/arm/mach-kirkwood/netxbig_v2-setup.c b/arch/arm/mach-kirkwood/netxbig_v2-setup.c
deleted file mode 100644
index 913d032..0000000
--- a/arch/arm/mach-kirkwood/netxbig_v2-setup.c
+++ /dev/null
@@ -1,422 +0,0 @@
-/*
- * arch/arm/mach-kirkwood/netxbig_v2-setup.c
- *
- * LaCie 2Big and 5Big Network v2 board setup
- *
- * Copyright (C) 2010 Simon Guinot <sguinot@lacie.com>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#include <linux/kernel.h>
-#include <linux/init.h>
-#include <linux/platform_device.h>
-#include <linux/ata_platform.h>
-#include <linux/mv643xx_eth.h>
-#include <linux/input.h>
-#include <linux/gpio.h>
-#include <linux/gpio_keys.h>
-#include <linux/leds.h>
-#include <asm/mach-types.h>
-#include <asm/mach/arch.h>
-#include <mach/kirkwood.h>
-#include <linux/platform_data/leds-kirkwood-netxbig.h>
-#include "common.h"
-#include "mpp.h"
-#include "lacie_v2-common.h"
-
-/*****************************************************************************
- * Ethernet
- ****************************************************************************/
-
-static struct mv643xx_eth_platform_data netxbig_v2_ge00_data = {
-	.phy_addr	= MV643XX_ETH_PHY_ADDR(8),
-};
-
-static struct mv643xx_eth_platform_data netxbig_v2_ge01_data = {
-	.phy_addr	= MV643XX_ETH_PHY_ADDR(0),
-};
-
-/*****************************************************************************
- * SATA
- ****************************************************************************/
-
-static struct mv_sata_platform_data netxbig_v2_sata_data = {
-	.n_ports	= 2,
-};
-
-/*****************************************************************************
- * GPIO keys
- ****************************************************************************/
-
-#define NETXBIG_V2_GPIO_SWITCH_POWER_ON		13
-#define NETXBIG_V2_GPIO_SWITCH_POWER_OFF	15
-#define NETXBIG_V2_GPIO_FUNC_BUTTON		34
-
-#define NETXBIG_V2_SWITCH_POWER_ON		0x1
-#define NETXBIG_V2_SWITCH_POWER_OFF		0x2
-
-static struct gpio_keys_button netxbig_v2_buttons[] = {
-	[0] = {
-		.type           = EV_SW,
-		.code           = NETXBIG_V2_SWITCH_POWER_ON,
-		.gpio           = NETXBIG_V2_GPIO_SWITCH_POWER_ON,
-		.desc           = "Back power switch (on|auto)",
-		.active_low     = 1,
-	},
-	[1] = {
-		.type           = EV_SW,
-		.code           = NETXBIG_V2_SWITCH_POWER_OFF,
-		.gpio           = NETXBIG_V2_GPIO_SWITCH_POWER_OFF,
-		.desc           = "Back power switch (auto|off)",
-		.active_low     = 1,
-	},
-	[2] = {
-		.code		= KEY_OPTION,
-		.gpio		= NETXBIG_V2_GPIO_FUNC_BUTTON,
-		.desc		= "Function button",
-		.active_low	= 1,
-	},
-};
-
-static struct gpio_keys_platform_data netxbig_v2_button_data = {
-	.buttons	= netxbig_v2_buttons,
-	.nbuttons	= ARRAY_SIZE(netxbig_v2_buttons),
-};
-
-static struct platform_device netxbig_v2_gpio_buttons = {
-	.name		= "gpio-keys",
-	.id		= -1,
-	.dev		= {
-		.platform_data	= &netxbig_v2_button_data,
-	},
-};
-
-/*****************************************************************************
- * GPIO extension LEDs
- ****************************************************************************/
-
-/*
- * The LEDs are controlled by a CPLD and can be configured through a GPIO
- * extension bus:
- *
- * - address register : bit [0-2] -> GPIO [47-49]
- * - data register    : bit [0-2] -> GPIO [44-46]
- * - enable register  : GPIO 29
- */
-
-static int netxbig_v2_gpio_ext_addr[] = { 47, 48, 49 };
-static int netxbig_v2_gpio_ext_data[] = { 44, 45, 46 };
-
-static struct netxbig_gpio_ext netxbig_v2_gpio_ext = {
-	.addr		= netxbig_v2_gpio_ext_addr,
-	.num_addr	= ARRAY_SIZE(netxbig_v2_gpio_ext_addr),
-	.data		= netxbig_v2_gpio_ext_data,
-	.num_data	= ARRAY_SIZE(netxbig_v2_gpio_ext_data),
-	.enable		= 29,
-};
-
-/*
- * Address register selection:
- *
- * addr | register
- * ----------------------------
- *   0  | front LED
- *   1  | front LED brightness
- *   2  | SATA LED brightness
- *   3  | SATA0 LED
- *   4  | SATA1 LED
- *   5  | SATA2 LED
- *   6  | SATA3 LED
- *   7  | SATA4 LED
- *
- * Data register configuration:
- *
- * data | LED brightness
- * -------------------------------------------------
- *   0  | min (off)
- *   -  | -
- *   7  | max
- *
- * data | front LED mode
- * -------------------------------------------------
- *   0  | fix off
- *   1  | fix blue on
- *   2  | fix red on
- *   3  | blink blue on=1 sec and blue off=1 sec
- *   4  | blink red on=1 sec and red off=1 sec
- *   5  | blink blue on=2.5 sec and red on=0.5 sec
- *   6  | blink blue on=1 sec and red on=1 sec
- *   7  | blink blue on=0.5 sec and blue off=2.5 sec
- *
- * data | SATA LED mode
- * -------------------------------------------------
- *   0  | fix off
- *   1  | SATA activity blink
- *   2  | fix red on
- *   3  | blink blue on=1 sec and blue off=1 sec
- *   4  | blink red on=1 sec and red off=1 sec
- *   5  | blink blue on=2.5 sec and red on=0.5 sec
- *   6  | blink blue on=1 sec and red on=1 sec
- *   7  | fix blue on
- */
-
-static int netxbig_v2_red_mled[NETXBIG_LED_MODE_NUM] = {
-	[NETXBIG_LED_OFF]	= 0,
-	[NETXBIG_LED_ON]	= 2,
-	[NETXBIG_LED_SATA]	= NETXBIG_LED_INVALID_MODE,
-	[NETXBIG_LED_TIMER1]	= 4,
-	[NETXBIG_LED_TIMER2]	= NETXBIG_LED_INVALID_MODE,
-};
-
-static int netxbig_v2_blue_pwr_mled[NETXBIG_LED_MODE_NUM] = {
-	[NETXBIG_LED_OFF]	= 0,
-	[NETXBIG_LED_ON]	= 1,
-	[NETXBIG_LED_SATA]	= NETXBIG_LED_INVALID_MODE,
-	[NETXBIG_LED_TIMER1]	= 3,
-	[NETXBIG_LED_TIMER2]	= 7,
-};
-
-static int netxbig_v2_blue_sata_mled[NETXBIG_LED_MODE_NUM] = {
-	[NETXBIG_LED_OFF]	= 0,
-	[NETXBIG_LED_ON]	= 7,
-	[NETXBIG_LED_SATA]	= 1,
-	[NETXBIG_LED_TIMER1]	= 3,
-	[NETXBIG_LED_TIMER2]	= NETXBIG_LED_INVALID_MODE,
-};
-
-static struct netxbig_led_timer netxbig_v2_led_timer[] = {
-	[0] = {
-		.delay_on	= 500,
-		.delay_off	= 500,
-		.mode		= NETXBIG_LED_TIMER1,
-	},
-	[1] = {
-		.delay_on	= 500,
-		.delay_off	= 1000,
-		.mode		= NETXBIG_LED_TIMER2,
-	},
-};
-
-#define NETXBIG_LED(_name, maddr, mval, baddr)			\
-	{ .name		= _name,				\
-	  .mode_addr	= maddr,				\
-	  .mode_val	= mval,					\
-	  .bright_addr	= baddr }
-
-static struct netxbig_led net2big_v2_leds_ctrl[] = {
-	NETXBIG_LED("net2big-v2:blue:power", 0, netxbig_v2_blue_pwr_mled,  1),
-	NETXBIG_LED("net2big-v2:red:power",  0, netxbig_v2_red_mled,       1),
-	NETXBIG_LED("net2big-v2:blue:sata0", 3, netxbig_v2_blue_sata_mled, 2),
-	NETXBIG_LED("net2big-v2:red:sata0",  3, netxbig_v2_red_mled,       2),
-	NETXBIG_LED("net2big-v2:blue:sata1", 4, netxbig_v2_blue_sata_mled, 2),
-	NETXBIG_LED("net2big-v2:red:sata1",  4, netxbig_v2_red_mled,       2),
-};
-
-static struct netxbig_led_platform_data net2big_v2_leds_data = {
-	.gpio_ext	= &netxbig_v2_gpio_ext,
-	.timer		= netxbig_v2_led_timer,
-	.num_timer	= ARRAY_SIZE(netxbig_v2_led_timer),
-	.leds		= net2big_v2_leds_ctrl,
-	.num_leds	= ARRAY_SIZE(net2big_v2_leds_ctrl),
-};
-
-static struct netxbig_led net5big_v2_leds_ctrl[] = {
-	NETXBIG_LED("net5big-v2:blue:power", 0, netxbig_v2_blue_pwr_mled,  1),
-	NETXBIG_LED("net5big-v2:red:power",  0, netxbig_v2_red_mled,       1),
-	NETXBIG_LED("net5big-v2:blue:sata0", 3, netxbig_v2_blue_sata_mled, 2),
-	NETXBIG_LED("net5big-v2:red:sata0",  3, netxbig_v2_red_mled,       2),
-	NETXBIG_LED("net5big-v2:blue:sata1", 4, netxbig_v2_blue_sata_mled, 2),
-	NETXBIG_LED("net5big-v2:red:sata1",  4, netxbig_v2_red_mled,       2),
-	NETXBIG_LED("net5big-v2:blue:sata2", 5, netxbig_v2_blue_sata_mled, 2),
-	NETXBIG_LED("net5big-v2:red:sata2",  5, netxbig_v2_red_mled,       2),
-	NETXBIG_LED("net5big-v2:blue:sata3", 6, netxbig_v2_blue_sata_mled, 2),
-	NETXBIG_LED("net5big-v2:red:sata3",  6, netxbig_v2_red_mled,       2),
-	NETXBIG_LED("net5big-v2:blue:sata4", 7, netxbig_v2_blue_sata_mled, 2),
-	NETXBIG_LED("net5big-v2:red:sata5",  7, netxbig_v2_red_mled,       2),
-};
-
-static struct netxbig_led_platform_data net5big_v2_leds_data = {
-	.gpio_ext	= &netxbig_v2_gpio_ext,
-	.timer		= netxbig_v2_led_timer,
-	.num_timer	= ARRAY_SIZE(netxbig_v2_led_timer),
-	.leds		= net5big_v2_leds_ctrl,
-	.num_leds	= ARRAY_SIZE(net5big_v2_leds_ctrl),
-};
-
-static struct platform_device netxbig_v2_leds = {
-	.name		= "leds-netxbig",
-	.id		= -1,
-	.dev		= {
-		.platform_data	= &net2big_v2_leds_data,
-	},
-};
-
-/*****************************************************************************
- * General Setup
- ****************************************************************************/
-
-static unsigned int net2big_v2_mpp_config[] __initdata = {
-	MPP0_SPI_SCn,
-	MPP1_SPI_MOSI,
-	MPP2_SPI_SCK,
-	MPP3_SPI_MISO,
-	MPP6_SYSRST_OUTn,
-	MPP7_GPO,		/* Request power-off */
-	MPP8_TW0_SDA,
-	MPP9_TW0_SCK,
-	MPP10_UART0_TXD,
-	MPP11_UART0_RXD,
-	MPP13_GPIO,		/* Rear power switch (on|auto) */
-	MPP14_GPIO,		/* USB fuse alarm */
-	MPP15_GPIO,		/* Rear power switch (auto|off) */
-	MPP16_GPIO,		/* SATA HDD1 power */
-	MPP17_GPIO,		/* SATA HDD2 power */
-	MPP20_SATA1_ACTn,
-	MPP21_SATA0_ACTn,
-	MPP24_GPIO,		/* USB mode select */
-	MPP26_GPIO,		/* USB device vbus */
-	MPP28_GPIO,		/* USB enable host vbus */
-	MPP29_GPIO,		/* GPIO extension ALE */
-	MPP34_GPIO,		/* Rear Push button */
-	MPP35_GPIO,		/* Inhibit switch power-off */
-	MPP36_GPIO,		/* SATA HDD1 presence */
-	MPP37_GPIO,		/* SATA HDD2 presence */
-	MPP40_GPIO,		/* eSATA presence */
-	MPP44_GPIO,		/* GPIO extension (data 0) */
-	MPP45_GPIO,		/* GPIO extension (data 1) */
-	MPP46_GPIO,		/* GPIO extension (data 2) */
-	MPP47_GPIO,		/* GPIO extension (addr 0) */
-	MPP48_GPIO,		/* GPIO extension (addr 1) */
-	MPP49_GPIO,		/* GPIO extension (addr 2) */
-	0
-};
-
-static unsigned int net5big_v2_mpp_config[] __initdata = {
-	MPP0_SPI_SCn,
-	MPP1_SPI_MOSI,
-	MPP2_SPI_SCK,
-	MPP3_SPI_MISO,
-	MPP6_SYSRST_OUTn,
-	MPP7_GPO,		/* Request power-off */
-	MPP8_TW0_SDA,
-	MPP9_TW0_SCK,
-	MPP10_UART0_TXD,
-	MPP11_UART0_RXD,
-	MPP13_GPIO,		/* Rear power switch (on|auto) */
-	MPP14_GPIO,		/* USB fuse alarm */
-	MPP15_GPIO,		/* Rear power switch (auto|off) */
-	MPP16_GPIO,		/* SATA HDD1 power */
-	MPP17_GPIO,		/* SATA HDD2 power */
-	MPP20_GE1_TXD0,
-	MPP21_GE1_TXD1,
-	MPP22_GE1_TXD2,
-	MPP23_GE1_TXD3,
-	MPP24_GE1_RXD0,
-	MPP25_GE1_RXD1,
-	MPP26_GE1_RXD2,
-	MPP27_GE1_RXD3,
-	MPP28_GPIO,		/* USB enable host vbus */
-	MPP29_GPIO,		/* GPIO extension ALE */
-	MPP30_GE1_RXCTL,
-	MPP31_GE1_RXCLK,
-	MPP32_GE1_TCLKOUT,
-	MPP33_GE1_TXCTL,
-	MPP34_GPIO,		/* Rear Push button */
-	MPP35_GPIO,		/* Inhibit switch power-off */
-	MPP36_GPIO,		/* SATA HDD1 presence */
-	MPP37_GPIO,		/* SATA HDD2 presence */
-	MPP38_GPIO,		/* SATA HDD3 presence */
-	MPP39_GPIO,		/* SATA HDD4 presence */
-	MPP40_GPIO,		/* SATA HDD5 presence */
-	MPP41_GPIO,		/* SATA HDD3 power */
-	MPP42_GPIO,		/* SATA HDD4 power */
-	MPP43_GPIO,		/* SATA HDD5 power */
-	MPP44_GPIO,		/* GPIO extension (data 0) */
-	MPP45_GPIO,		/* GPIO extension (data 1) */
-	MPP46_GPIO,		/* GPIO extension (data 2) */
-	MPP47_GPIO,		/* GPIO extension (addr 0) */
-	MPP48_GPIO,		/* GPIO extension (addr 1) */
-	MPP49_GPIO,		/* GPIO extension (addr 2) */
-	0
-};
-
-#define NETXBIG_V2_GPIO_POWER_OFF		7
-
-static void netxbig_v2_power_off(void)
-{
-	gpio_set_value(NETXBIG_V2_GPIO_POWER_OFF, 1);
-}
-
-static void __init netxbig_v2_init(void)
-{
-	/*
-	 * Basic setup. Needs to be called early.
-	 */
-	kirkwood_init();
-	if (machine_is_net2big_v2())
-		kirkwood_mpp_conf(net2big_v2_mpp_config);
-	else
-		kirkwood_mpp_conf(net5big_v2_mpp_config);
-
-	if (machine_is_net2big_v2())
-		lacie_v2_hdd_power_init(2);
-	else
-		lacie_v2_hdd_power_init(5);
-
-	kirkwood_ehci_init();
-	kirkwood_ge00_init(&netxbig_v2_ge00_data);
-	if (machine_is_net5big_v2())
-		kirkwood_ge01_init(&netxbig_v2_ge01_data);
-	kirkwood_sata_init(&netxbig_v2_sata_data);
-	kirkwood_uart0_init();
-	lacie_v2_register_flash();
-	lacie_v2_register_i2c_devices();
-
-	if (machine_is_net5big_v2())
-		netxbig_v2_leds.dev.platform_data = &net5big_v2_leds_data;
-	platform_device_register(&netxbig_v2_leds);
-	platform_device_register(&netxbig_v2_gpio_buttons);
-
-	if (gpio_request(NETXBIG_V2_GPIO_POWER_OFF, "power-off") == 0 &&
-	    gpio_direction_output(NETXBIG_V2_GPIO_POWER_OFF, 0) == 0)
-		pm_power_off = netxbig_v2_power_off;
-	else
-		pr_err("netxbig_v2: failed to configure power-off GPIO\n");
-}
-
-#ifdef CONFIG_MACH_NET2BIG_V2
-MACHINE_START(NET2BIG_V2, "LaCie 2Big Network v2")
-	.atag_offset	= 0x100,
-	.init_machine	= netxbig_v2_init,
-	.map_io		= kirkwood_map_io,
-	.init_early	= kirkwood_init_early,
-	.init_irq	= kirkwood_init_irq,
-	.init_time	= kirkwood_timer_init,
-	.restart	= kirkwood_restart,
-MACHINE_END
-#endif
-
-#ifdef CONFIG_MACH_NET5BIG_V2
-MACHINE_START(NET5BIG_V2, "LaCie 5Big Network v2")
-	.atag_offset	= 0x100,
-	.init_machine	= netxbig_v2_init,
-	.map_io		= kirkwood_map_io,
-	.init_early	= kirkwood_init_early,
-	.init_irq	= kirkwood_init_irq,
-	.init_time	= kirkwood_timer_init,
-	.restart	= kirkwood_restart,
-MACHINE_END
-#endif
-- 
1.8.1.2

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

* [PATCHv2 8/9] ARM: kirkwood: remove unused common code for LaCie platforms
  2013-08-01 15:07 [PATCHv2 0/9] ARM: kirkwood: convert a few more boards to DT Thomas Petazzoni
                   ` (6 preceding siblings ...)
  2013-08-01 15:07 ` [PATCHv2 7/9] ARM: kirkwood: convert LaCie Net{2, 5}Big v2 platforms " Thomas Petazzoni
@ 2013-08-01 15:07 ` Thomas Petazzoni
  2013-08-02 21:45   ` Simon Guinot
  2013-08-01 15:07 ` [PATCHv2 9/9] ARM: kirkwood: update defconfig after DT conversions Thomas Petazzoni
  2013-08-03 18:56 ` [PATCHv2 0/9] ARM: kirkwood: convert a few more boards to DT Jason Cooper
  9 siblings, 1 reply; 30+ messages in thread
From: Thomas Petazzoni @ 2013-08-01 15:07 UTC (permalink / raw)
  To: linux-arm-kernel

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.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 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

diff --git a/arch/arm/mach-kirkwood/lacie_v2-common.c b/arch/arm/mach-kirkwood/lacie_v2-common.c
deleted file mode 100644
index 4894959..0000000
--- a/arch/arm/mach-kirkwood/lacie_v2-common.c
+++ /dev/null
@@ -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);
-	}
-}
diff --git a/arch/arm/mach-kirkwood/lacie_v2-common.h b/arch/arm/mach-kirkwood/lacie_v2-common.h
deleted file mode 100644
index fc64f57..0000000
--- a/arch/arm/mach-kirkwood/lacie_v2-common.h
+++ /dev/null
@@ -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
-- 
1.8.1.2

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

* [PATCHv2 9/9] ARM: kirkwood: update defconfig after DT conversions
  2013-08-01 15:07 [PATCHv2 0/9] ARM: kirkwood: convert a few more boards to DT Thomas Petazzoni
                   ` (7 preceding siblings ...)
  2013-08-01 15:07 ` [PATCHv2 8/9] ARM: kirkwood: remove unused common code for LaCie platforms Thomas Petazzoni
@ 2013-08-01 15:07 ` Thomas Petazzoni
  2013-08-03 18:56 ` [PATCHv2 0/9] ARM: kirkwood: convert a few more boards to DT Jason Cooper
  9 siblings, 0 replies; 30+ messages in thread
From: Thomas Petazzoni @ 2013-08-01 15:07 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 arch/arm/configs/kirkwood_defconfig | 15 ++++-----------
 1 file changed, 4 insertions(+), 11 deletions(-)

diff --git a/arch/arm/configs/kirkwood_defconfig b/arch/arm/configs/kirkwood_defconfig
index b180588..6d468cb 100644
--- a/arch/arm/configs/kirkwood_defconfig
+++ b/arch/arm/configs/kirkwood_defconfig
@@ -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
-- 
1.8.1.2

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

* [PATCHv2 3/9] ARM: kirkwood: remove support for legacy booting of Guruplug
  2013-08-01 15:07 ` [PATCHv2 3/9] ARM: kirkwood: remove support for legacy booting of Guruplug Thomas Petazzoni
@ 2013-08-02 12:49   ` Jason Cooper
  2013-08-02 13:08     ` Arnaud Patard (Rtp)
  0 siblings, 1 reply; 30+ messages in thread
From: Jason Cooper @ 2013-08-02 12:49 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Aug 01, 2013 at 05:07:29PM +0200, Thomas Petazzoni wrote:
> The Kirkwood Guruplug platform has already been converted to the
> Device Tree, so we can remove the legacy booting option for this
> platform.
> 
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> ---
>  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
> 
...
> diff --git a/arch/arm/mach-kirkwood/guruplug-setup.c b/arch/arm/mach-kirkwood/guruplug-setup.c
...
> -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.

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

* [PATCHv2 3/9] ARM: kirkwood: remove support for legacy booting of Guruplug
  2013-08-02 12:49   ` Jason Cooper
@ 2013-08-02 13:08     ` Arnaud Patard (Rtp)
  0 siblings, 0 replies; 30+ messages in thread
From: Arnaud Patard (Rtp) @ 2013-08-02 13:08 UTC (permalink / raw)
  To: linux-arm-kernel

Jason Cooper <jason@lakedaemon.net> writes:

> On Thu, Aug 01, 2013 at 05:07:29PM +0200, Thomas Petazzoni wrote:
>> The Kirkwood Guruplug platform has already been converted to the
>> Device Tree, so we can remove the legacy booting option for this
>> platform.
>> 
>> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
>> ---
>>  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
>> 
> ...
>> diff --git a/arch/arm/mach-kirkwood/guruplug-setup.c b/arch/arm/mach-kirkwood/guruplug-setup.c
> ...
>> -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

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

* [PATCHv2 1/9] ARM: kirkwood: convert d2net_v2 to DT
  2013-08-01 15:07 ` [PATCHv2 1/9] ARM: kirkwood: convert d2net_v2 " Thomas Petazzoni
@ 2013-08-02 14:31   ` Simon Guinot
  2013-10-12 15:26     ` Thomas Petazzoni
  2013-08-02 14:46   ` [PATCH] leds: leds-ns2: depends on ARCH_KIRKWOOD Simon Guinot
  2013-08-13  9:58   ` [PATCHv2 1/9] ARM: kirkwood: convert d2net_v2 to DT Mark Rutland
  2 siblings, 1 reply; 30+ messages in thread
From: Simon Guinot @ 2013-08-02 14:31 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Aug 01, 2013 at 05:07:27PM +0200, Thomas Petazzoni wrote:
> This commit completely converts the d2net_v2 Kirkwood board to use a
> Device Tree representation.
> 
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> ---
>  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.

> 
> diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
> index 641b3c9..277685f 100644
> --- a/arch/arm/boot/dts/Makefile
> +++ b/arch/arm/boot/dts/Makefile
> @@ -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 \
> diff --git a/arch/arm/boot/dts/kirkwood-d2net-v2.dts b/arch/arm/boot/dts/kirkwood-d2net-v2.dts
> new file mode 100644
> index 0000000..3b2d75b
> --- /dev/null
> +++ b/arch/arm/boot/dts/kirkwood-d2net-v2.dts
> @@ -0,0 +1,231 @@
> +/dts-v1/;
> +
> +/include/ "kirkwood.dtsi"
> +/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).

> +	};
> +
> +	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";
> +			};
> +
> +			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.

> +			};
> +
> +			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>;
> +		};
> +	};
> +
> +	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.

> +		};
> +	};
> +
> +	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>;
> +
> +		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.

> +		};
> +	};
> +};
> +
> +&mdio {
> +	status = "okay";
> +
> +	ethphy0: ethernet-phy at 0 {
> +		device_type = "ethernet-phy";
> +		reg = <8>;
> +	};
> +};
> +
> +&eth0 {
> +	status = "okay";
> +	ethernet0-port at 0 {
> +		phy-handle = <&ethphy0>;
> +	};
> +};
> diff --git a/arch/arm/mach-kirkwood/Kconfig b/arch/arm/mach-kirkwood/Kconfig
> index 60d0896..8bcd659 100644
> --- a/arch/arm/mach-kirkwood/Kconfig
> +++ b/arch/arm/mach-kirkwood/Kconfig
> @@ -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>

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

* [PATCH] leds: leds-ns2: depends on ARCH_KIRKWOOD
  2013-08-01 15:07 ` [PATCHv2 1/9] ARM: kirkwood: convert d2net_v2 " Thomas Petazzoni
  2013-08-02 14:31   ` Simon Guinot
@ 2013-08-02 14:46   ` Simon Guinot
  2013-08-03 18:16     ` Jason Cooper
  2013-08-13  9:58   ` [PATCHv2 1/9] ARM: kirkwood: convert d2net_v2 to DT Mark Rutland
  2 siblings, 1 reply; 30+ messages in thread
From: Simon Guinot @ 2013-08-02 14:46 UTC (permalink / raw)
  To: linux-arm-kernel

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.

Signed-off-by: Simon Guinot <simon.guinot@sequanux.org>
---
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(-)

diff --git a/drivers/leds/Kconfig b/drivers/leds/Kconfig
index e43402d..0e41460 100644
--- a/drivers/leds/Kconfig
+++ b/drivers/leds/Kconfig
@@ -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
-- 
1.7.10.4

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

* [PATCHv2 7/9] ARM: kirkwood: convert LaCie Net{2, 5}Big v2 platforms to DT
  2013-08-01 15:07 ` [PATCHv2 7/9] ARM: kirkwood: convert LaCie Net{2, 5}Big v2 platforms " Thomas Petazzoni
@ 2013-08-02 21:25   ` Simon Guinot
  2013-08-03 17:12     ` Jason Cooper
  2013-08-02 21:34   ` [PATCH] leds: leds-netxbig: depends on ARCH_KIRKWOOD Simon Guinot
  1 sibling, 1 reply; 30+ messages in thread
From: Simon Guinot @ 2013-08-02 21:25 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Aug 01, 2013 at 05:07:33PM +0200, Thomas Petazzoni wrote:
> 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.
> 
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> ---
>  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.

> 
> diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
> index d168bed..20a6886 100644
> --- a/arch/arm/boot/dts/Makefile
> +++ b/arch/arm/boot/dts/Makefile
> @@ -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 \
> diff --git a/arch/arm/boot/dts/kirkwood-net2big-v2.dts b/arch/arm/boot/dts/kirkwood-net2big-v2.dts
> new file mode 100644
> index 0000000..608ef01
> --- /dev/null
> +++ b/arch/arm/boot/dts/kirkwood-net2big-v2.dts
> @@ -0,0 +1,219 @@
> +/*
> + * LaCie 2Big Network v2
> + *
> + * Simon Guinot <sguinot@lacie.com>
> + *
> + * This file is licensed under the terms of the GNU General Public
> + * License version 2.  This program is licensed "as is" without any
> + * warranty of any kind, whether express or implied.
> + */
> +
> +/dts-v1/;
> +
> +/include/ "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).

> +	};
> +
> +	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 {
> +				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.

> +			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>;
> +			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.

> +			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.

> +		};
> +	};
> +};
> +
> +&mdio {
> +	status = "okay";
> +
> +	ethphy0: ethernet-phy at 0 {
> +		device_type = "ethernet-phy";
> +		reg = <8>;
> +	};
> +};
> +
> +&eth0 {
> +	status = "okay";
> +	ethernet0-port at 0 {
> +		phy-handle = <&ethphy0>;
> +	};
> +};
> diff --git a/arch/arm/boot/dts/kirkwood-net5big-v2.dts b/arch/arm/boot/dts/kirkwood-net5big-v2.dts
> new file mode 100644
> index 0000000..46ca107
> --- /dev/null
> +++ b/arch/arm/boot/dts/kirkwood-net5big-v2.dts
> @@ -0,0 +1,265 @@
> +/*
> + * LaCie 5Big Network v2
> + *
> + * Simon Guinot <sguinot@lacie.com>
> + *
> + * This file is licensed under the terms of the GNU General Public
> + * License version 2.  This program is licensed "as is" without any
> + * warranty of any kind, whether express or implied.
> + */
> +
> +/dts-v1/;
> +
> +/include/ "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 :)

> +	};
> +
> +	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 {
> +				compatible = "at,24c04";
> +				pagesize = <16>;
> +				reg = <0x50>;
> +			};
> +		};
> +
> +		serial at 12000 {
> +			pinctrl-0 = <&pmx_uart0>;
> +			pinctrl-names = "default";
> +			clock-frequency = <200000000>;

clock-frequency = <166666667>;

> +			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>;
> +			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>; ?

> +			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>; ?

> +			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>; ?

> +			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>; ?

> +			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";
> +	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.

> +};
> diff --git a/arch/arm/mach-kirkwood/Kconfig b/arch/arm/mach-kirkwood/Kconfig
> index f624162..b7e66fa 100644
> --- a/arch/arm/mach-kirkwood/Kconfig
> +++ b/arch/arm/mach-kirkwood/Kconfig
> @@ -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).
> +

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

>  endmenu
>  
>  endif
> diff --git a/arch/arm/mach-kirkwood/Makefile b/arch/arm/mach-kirkwood/Makefile
> index 0dcc5d4..38d0d74 100644
> --- a/arch/arm/mach-kirkwood/Makefile
> +++ b/arch/arm/mach-kirkwood/Makefile
> @@ -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

CONFIG_MACH_NET2BIG_V2_DT

> +obj-$(CONFIG_MACH_NET5BIG_V2)		+= board-netxbig_v2.o

CONFIG_MACH_NET5BIG_V2_DT

> diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c
> index b129c65..80955cc 100644
> --- a/arch/arm/mach-kirkwood/board-dt.c
> +++ b/arch/arm/mach-kirkwood/board-dt.c

... snip ...

> diff --git a/arch/arm/mach-kirkwood/common.h b/arch/arm/mach-kirkwood/common.h
> index cc639bb..a9010a3 100644
> --- a/arch/arm/mach-kirkwood/common.h
> +++ b/arch/arm/mach-kirkwood/common.h
> @@ -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>

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

* [PATCH] leds: leds-netxbig: depends on ARCH_KIRKWOOD
  2013-08-01 15:07 ` [PATCHv2 7/9] ARM: kirkwood: convert LaCie Net{2, 5}Big v2 platforms " Thomas Petazzoni
  2013-08-02 21:25   ` Simon Guinot
@ 2013-08-02 21:34   ` Simon Guinot
  2013-08-03 14:12     ` Jason Cooper
  1 sibling, 1 reply; 30+ messages in thread
From: Simon Guinot @ 2013-08-02 21:34 UTC (permalink / raw)
  To: linux-arm-kernel

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.

Signed-off-by: Simon Guinot <simon.guinot@sequanux.org>
---
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(-)

diff --git a/drivers/leds/Kconfig b/drivers/leds/Kconfig
index 0e41460..7226696 100644
--- a/drivers/leds/Kconfig
+++ b/drivers/leds/Kconfig
@@ -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

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

* [PATCHv2 8/9] ARM: kirkwood: remove unused common code for LaCie platforms
  2013-08-01 15:07 ` [PATCHv2 8/9] ARM: kirkwood: remove unused common code for LaCie platforms Thomas Petazzoni
@ 2013-08-02 21:45   ` Simon Guinot
  0 siblings, 0 replies; 30+ messages in thread
From: Simon Guinot @ 2013-08-02 21:45 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Aug 01, 2013 at 05:07:34PM +0200, Thomas Petazzoni wrote:
> 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.
> 
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>

Acked-by: Simon Guinot <simon.guinot@sequanux.org>

Thanks,

Simon

> ---
>  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
> 
> diff --git a/arch/arm/mach-kirkwood/lacie_v2-common.c b/arch/arm/mach-kirkwood/lacie_v2-common.c
> deleted file mode 100644
> index 4894959..0000000
> --- a/arch/arm/mach-kirkwood/lacie_v2-common.c
> +++ /dev/null
> @@ -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);
> -	}
> -}
> diff --git a/arch/arm/mach-kirkwood/lacie_v2-common.h b/arch/arm/mach-kirkwood/lacie_v2-common.h
> deleted file mode 100644
> index fc64f57..0000000
> --- a/arch/arm/mach-kirkwood/lacie_v2-common.h
> +++ /dev/null
> @@ -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
> -- 
> 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>

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

* [PATCH] leds: leds-netxbig: depends on ARCH_KIRKWOOD
  2013-08-02 21:34   ` [PATCH] leds: leds-netxbig: depends on ARCH_KIRKWOOD Simon Guinot
@ 2013-08-03 14:12     ` Jason Cooper
  2013-08-05 22:52       ` Bryan Wu
  0 siblings, 1 reply; 30+ messages in thread
From: Jason Cooper @ 2013-08-03 14:12 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Aug 02, 2013 at 11:34:34PM +0200, Simon Guinot wrote:
> 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.
> 
> Signed-off-by: Simon Guinot <simon.guinot@sequanux.org>
> ---
> 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.

Acked-by: Jason Cooper <jason@lakedaemon.net>

thx,

Jason.

>  drivers/leds/Kconfig |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/leds/Kconfig b/drivers/leds/Kconfig
> index 0e41460..7226696 100644
> --- a/drivers/leds/Kconfig
> +++ b/drivers/leds/Kconfig
> @@ -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
> 

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

* [PATCHv2 7/9] ARM: kirkwood: convert LaCie Net{2, 5}Big v2 platforms to DT
  2013-08-02 21:25   ` Simon Guinot
@ 2013-08-03 17:12     ` Jason Cooper
  0 siblings, 0 replies; 30+ messages in thread
From: Jason Cooper @ 2013-08-03 17:12 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Aug 02, 2013 at 11:25:53PM +0200, Simon Guinot wrote:
> On Thu, Aug 01, 2013 at 05:07:33PM +0200, Thomas Petazzoni wrote:
> > 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.
> > 
> > Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> > ---
> >  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
...
> > +		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.

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

* [PATCH] leds: leds-ns2: depends on ARCH_KIRKWOOD
  2013-08-02 14:46   ` [PATCH] leds: leds-ns2: depends on ARCH_KIRKWOOD Simon Guinot
@ 2013-08-03 18:16     ` Jason Cooper
  2013-08-05 22:50       ` Bryan Wu
  0 siblings, 1 reply; 30+ messages in thread
From: Jason Cooper @ 2013-08-03 18:16 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Aug 02, 2013 at 04:46:38PM +0200, Simon Guinot wrote:
> 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.
> 
> Signed-off-by: Simon Guinot <simon.guinot@sequanux.org>
> ---
> 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(-)

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

Acked-by: Jason Cooper <jason@lakedaemon.net>

thx,

Jason.

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

* [PATCHv2 2/9] ARM: kirkwood: remove support for legacy booting of Dockstar
  2013-08-01 15:07 ` [PATCHv2 2/9] ARM: kirkwood: remove support for legacy booting of Dockstar Thomas Petazzoni
@ 2013-08-03 18:27   ` Jason Cooper
  0 siblings, 0 replies; 30+ messages in thread
From: Jason Cooper @ 2013-08-03 18:27 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Aug 01, 2013 at 05:07:28PM +0200, Thomas Petazzoni wrote:
> The Kirkwood Dockstar platform has already been converted to the
> Device Tree, so we can remove the legacy booting option for this
> platform.
> 
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> ---
>  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.

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

* [PATCHv2 0/9] ARM: kirkwood: convert a few more boards to DT
  2013-08-01 15:07 [PATCHv2 0/9] ARM: kirkwood: convert a few more boards to DT Thomas Petazzoni
                   ` (8 preceding siblings ...)
  2013-08-01 15:07 ` [PATCHv2 9/9] ARM: kirkwood: update defconfig after DT conversions Thomas Petazzoni
@ 2013-08-03 18:56 ` Jason Cooper
  9 siblings, 0 replies; 30+ messages in thread
From: Jason Cooper @ 2013-08-03 18:56 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Aug 01, 2013 at 05:07:26PM +0200, Thomas Petazzoni wrote:
> 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.

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

thx,

Jason.

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

* [PATCH] leds: leds-ns2: depends on ARCH_KIRKWOOD
  2013-08-03 18:16     ` Jason Cooper
@ 2013-08-05 22:50       ` Bryan Wu
  0 siblings, 0 replies; 30+ messages in thread
From: Bryan Wu @ 2013-08-05 22:50 UTC (permalink / raw)
  To: linux-arm-kernel

On Sat, Aug 3, 2013 at 11:16 AM, Jason Cooper <jason@lakedaemon.net> wrote:
> On Fri, Aug 02, 2013 at 04:46:38PM +0200, Simon Guinot wrote:
>> 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.
>>
>> Signed-off-by: Simon Guinot <simon.guinot@sequanux.org>
>> ---
>> 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(-)
>
> Almost missed this one.  This should also go through -leds.
>
> Acked-by: Jason Cooper <jason@lakedaemon.net>
>

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

Thanks,
-Bryan

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

* [PATCH] leds: leds-netxbig: depends on ARCH_KIRKWOOD
  2013-08-03 14:12     ` Jason Cooper
@ 2013-08-05 22:52       ` Bryan Wu
  2013-08-06 12:17         ` Jason Cooper
  0 siblings, 1 reply; 30+ messages in thread
From: Bryan Wu @ 2013-08-05 22:52 UTC (permalink / raw)
  To: linux-arm-kernel

On Sat, Aug 3, 2013 at 7:12 AM, Jason Cooper <jason@lakedaemon.net> wrote:
> On Fri, Aug 02, 2013 at 11:34:34PM +0200, Simon Guinot wrote:
>> 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.
>>
>> Signed-off-by: Simon Guinot <simon.guinot@sequanux.org>
>> ---
>> 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.
>
> Acked-by: Jason Cooper <jason@lakedaemon.net>
>

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:

Acked-by: Bryan Wu <cooloney@gmail.com>

Thanks,
-Bryan

>
>>  drivers/leds/Kconfig |    2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/leds/Kconfig b/drivers/leds/Kconfig
>> index 0e41460..7226696 100644
>> --- a/drivers/leds/Kconfig
>> +++ b/drivers/leds/Kconfig
>> @@ -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
>>

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

* [PATCH] leds: leds-netxbig: depends on ARCH_KIRKWOOD
  2013-08-05 22:52       ` Bryan Wu
@ 2013-08-06 12:17         ` Jason Cooper
  2013-08-06 17:40           ` Bryan Wu
  0 siblings, 1 reply; 30+ messages in thread
From: Jason Cooper @ 2013-08-06 12:17 UTC (permalink / raw)
  To: linux-arm-kernel

Bryan,

On Mon, Aug 05, 2013 at 03:52:35PM -0700, Bryan Wu wrote:
> On Sat, Aug 3, 2013 at 7:12 AM, Jason Cooper <jason@lakedaemon.net> wrote:
> > On Fri, Aug 02, 2013 at 11:34:34PM +0200, Simon Guinot wrote:
> >> 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.
> >>
> >> Signed-off-by: Simon Guinot <simon.guinot@sequanux.org>
> >> ---
> >> 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.
> >
> > Acked-by: Jason Cooper <jason@lakedaemon.net>
> >
> 
> 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.

> How about merge this with those kirkwood patches with my ack:
> 
> Acked-by: Bryan Wu <cooloney@gmail.com>

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

> >
> >>  drivers/leds/Kconfig |    2 +-
> >>  1 file changed, 1 insertion(+), 1 deletion(-)
> >>
> >> diff --git a/drivers/leds/Kconfig b/drivers/leds/Kconfig
> >> index 0e41460..7226696 100644
> >> --- a/drivers/leds/Kconfig
> >> +++ b/drivers/leds/Kconfig
> >> @@ -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
> >>

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

* [PATCH] leds: leds-netxbig: depends on ARCH_KIRKWOOD
  2013-08-06 12:17         ` Jason Cooper
@ 2013-08-06 17:40           ` Bryan Wu
  0 siblings, 0 replies; 30+ messages in thread
From: Bryan Wu @ 2013-08-06 17:40 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Aug 6, 2013 at 5:17 AM, Jason Cooper <jason@lakedaemon.net> wrote:
> Bryan,
>
> On Mon, Aug 05, 2013 at 03:52:35PM -0700, Bryan Wu wrote:
>> On Sat, Aug 3, 2013 at 7:12 AM, Jason Cooper <jason@lakedaemon.net> wrote:
>> > On Fri, Aug 02, 2013 at 11:34:34PM +0200, Simon Guinot wrote:
>> >> 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.
>> >>
>> >> Signed-off-by: Simon Guinot <simon.guinot@sequanux.org>
>> >> ---
>> >> 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.
>> >
>> > Acked-by: Jason Cooper <jason@lakedaemon.net>
>> >
>>
>> 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.
>
>> How about merge this with those kirkwood patches with my ack:
>>
>> Acked-by: Bryan Wu <cooloney@gmail.com>
>
> No, no, no.  I'm trying to encourage patches to go through the
> proper trees when possible.  :-P
>

No problem, merged already.

-Bryan

>> >
>> >>  drivers/leds/Kconfig |    2 +-
>> >>  1 file changed, 1 insertion(+), 1 deletion(-)
>> >>
>> >> diff --git a/drivers/leds/Kconfig b/drivers/leds/Kconfig
>> >> index 0e41460..7226696 100644
>> >> --- a/drivers/leds/Kconfig
>> >> +++ b/drivers/leds/Kconfig
>> >> @@ -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
>> >>

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

* [PATCHv2 1/9] ARM: kirkwood: convert d2net_v2 to DT
  2013-08-01 15:07 ` [PATCHv2 1/9] ARM: kirkwood: convert d2net_v2 " Thomas Petazzoni
  2013-08-02 14:31   ` Simon Guinot
  2013-08-02 14:46   ` [PATCH] leds: leds-ns2: depends on ARCH_KIRKWOOD Simon Guinot
@ 2013-08-13  9:58   ` Mark Rutland
  2013-10-12 15:29     ` Thomas Petazzoni
  2 siblings, 1 reply; 30+ messages in thread
From: Mark Rutland @ 2013-08-13  9:58 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

On Thu, Aug 01, 2013 at 04:07:27PM +0100, Thomas Petazzoni wrote:
> This commit completely converts the d2net_v2 Kirkwood board to use a
> Device Tree representation.
> 
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> ---
>  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
> 

[...]

> +       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.

> +
> +               sata0_power: regulator at 1 {
> +                       compatible = "regulator-fixed";
> +                       reg = <1>;

Do we even need the unit-address?

> +                       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.

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

* [PATCHv2 1/9] ARM: kirkwood: convert d2net_v2 to DT
  2013-08-02 14:31   ` Simon Guinot
@ 2013-10-12 15:26     ` Thomas Petazzoni
  0 siblings, 0 replies; 30+ messages in thread
From: Thomas Petazzoni @ 2013-10-12 15:26 UTC (permalink / raw)
  To: linux-arm-kernel

Dear Simon Guinot,

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

On Fri, 2 Aug 2013 16:31:39 +0200, Simon Guinot wrote:

> 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!

> > +	memory {
> > +		device_type = "memory";
> > +		/* TODO: verify memory installed on board */
> > +		reg = <0x00000000 0x20000000>;
> 
> The board only provides 256MB of memory (0x100000000).

Will fix.

> > +			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.


> > +		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.

> > +		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.

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.

> > -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
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

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

* [PATCHv2 1/9] ARM: kirkwood: convert d2net_v2 to DT
  2013-08-13  9:58   ` [PATCHv2 1/9] ARM: kirkwood: convert d2net_v2 to DT Mark Rutland
@ 2013-10-12 15:29     ` Thomas Petazzoni
  2013-10-14 11:26       ` Mark Rutland
  0 siblings, 1 reply; 30+ messages in thread
From: Thomas Petazzoni @ 2013-10-12 15:29 UTC (permalink / raw)
  To: linux-arm-kernel

Dear Mark Rutland,

On Tue, 13 Aug 2013 10:58:30 +0100, Mark Rutland wrote:

> > +       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.

> 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.

> > +
> > +               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
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

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

* [PATCHv2 1/9] ARM: kirkwood: convert d2net_v2 to DT
  2013-10-12 15:29     ` Thomas Petazzoni
@ 2013-10-14 11:26       ` Mark Rutland
  0 siblings, 0 replies; 30+ messages in thread
From: Mark Rutland @ 2013-10-14 11:26 UTC (permalink / raw)
  To: linux-arm-kernel

On Sat, Oct 12, 2013 at 04:29:00PM +0100, Thomas Petazzoni wrote:
> Dear Mark Rutland,
> 

Hi Thomas,

> On Tue, 13 Aug 2013 10:58:30 +0100, Mark Rutland wrote:
> 
> > > +       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.

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.

> 
> > 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.

> 
> > > +
> > > +               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.

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

end of thread, other threads:[~2013-10-14 11:26 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-01 15:07 [PATCHv2 0/9] ARM: kirkwood: convert a few more boards to DT Thomas Petazzoni
2013-08-01 15:07 ` [PATCHv2 1/9] ARM: kirkwood: convert d2net_v2 " Thomas Petazzoni
2013-08-02 14:31   ` Simon Guinot
2013-10-12 15:26     ` Thomas Petazzoni
2013-08-02 14:46   ` [PATCH] leds: leds-ns2: depends on ARCH_KIRKWOOD Simon Guinot
2013-08-03 18:16     ` Jason Cooper
2013-08-05 22:50       ` Bryan Wu
2013-08-13  9:58   ` [PATCHv2 1/9] ARM: kirkwood: convert d2net_v2 to DT Mark Rutland
2013-10-12 15:29     ` Thomas Petazzoni
2013-10-14 11:26       ` Mark Rutland
2013-08-01 15:07 ` [PATCHv2 2/9] ARM: kirkwood: remove support for legacy booting of Dockstar Thomas Petazzoni
2013-08-03 18:27   ` Jason Cooper
2013-08-01 15:07 ` [PATCHv2 3/9] ARM: kirkwood: remove support for legacy booting of Guruplug Thomas Petazzoni
2013-08-02 12:49   ` Jason Cooper
2013-08-02 13:08     ` Arnaud Patard (Rtp)
2013-08-01 15:07 ` [PATCHv2 4/9] ARM: kirkwood: remove support for legacy booting of Sheevaplug Thomas Petazzoni
2013-08-01 15:07 ` [PATCHv2 5/9] ARM: kirkwood: remove LaCie boards that are supported through DT Thomas Petazzoni
2013-08-01 15:07 ` [PATCHv2 6/9] ARM: kirkwood: convert the mv88f6281gtw_ge board to DT Thomas Petazzoni
2013-08-01 15:07 ` [PATCHv2 7/9] ARM: kirkwood: convert LaCie Net{2, 5}Big v2 platforms " Thomas Petazzoni
2013-08-02 21:25   ` Simon Guinot
2013-08-03 17:12     ` Jason Cooper
2013-08-02 21:34   ` [PATCH] leds: leds-netxbig: depends on ARCH_KIRKWOOD Simon Guinot
2013-08-03 14:12     ` Jason Cooper
2013-08-05 22:52       ` Bryan Wu
2013-08-06 12:17         ` Jason Cooper
2013-08-06 17:40           ` Bryan Wu
2013-08-01 15:07 ` [PATCHv2 8/9] ARM: kirkwood: remove unused common code for LaCie platforms Thomas Petazzoni
2013-08-02 21:45   ` Simon Guinot
2013-08-01 15:07 ` [PATCHv2 9/9] ARM: kirkwood: update defconfig after DT conversions Thomas Petazzoni
2013-08-03 18:56 ` [PATCHv2 0/9] ARM: kirkwood: convert a few more boards to DT Jason Cooper

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