linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ARM: kirkwood: Add support for NETGEAR ReadyNAS Duo v2 using DT
@ 2013-03-17 20:31 Arnaud Ebalard
  2013-03-17 20:40 ` Jason Cooper
  2013-03-17 20:50 ` Andrew Lunn
  0 siblings, 2 replies; 15+ messages in thread
From: Arnaud Ebalard @ 2013-03-17 20:31 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

Add support for the NETGEAR ReadyNAS Duo v2 (Hardware specs available
here: http://natisbad.org/NAS/). Almost everything is supported via
provided .dts. A board-readynas.c file is nonetheless required for
devices not only converted (Gbit controller) and USB 3.0 controller
power on.

FWIW, the most noticeable lack regarding hardware support is the fan
controller (GMT G762) for which nothing is currently available
upstream. 

A previous version of the patch has been tested against 3.8.3 and the
one below has been tested against current arm tree.

Cheers,

a+

Signed-off-by: Arnaud Ebalard <arno@natisbad.org>
---
 arch/arm/boot/dts/Makefile                      |    1 +
 arch/arm/boot/dts/kirkwood-netgear_readynas.dts |  169 +++++++++++++++++++++++
 arch/arm/configs/kirkwood_defconfig             |    1 +
 arch/arm/mach-kirkwood/Kconfig                  |    9 ++
 arch/arm/mach-kirkwood/Makefile                 |    1 +
 arch/arm/mach-kirkwood/board-dt.c               |    4 +
 arch/arm/mach-kirkwood/board-readynas.c         |   39 ++++++
 arch/arm/mach-kirkwood/common.h                 |    6 +
 8 files changed, 230 insertions(+)
 create mode 100644 arch/arm/boot/dts/kirkwood-netgear_readynas.dts
 create mode 100644 arch/arm/mach-kirkwood/board-readynas.c

diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index 9c62558..99122ba 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -71,6 +71,7 @@ dtb-$(CONFIG_ARCH_KIRKWOOD) += kirkwood-dns320.dtb \
 	kirkwood-ns2mini.dtb \
 	kirkwood-nsa310.dtb \
 	kirkwood-topkick.dtb \
+	kirkwood-netgear_readynas.dtb \
 	kirkwood-ts219-6281.dtb \
 	kirkwood-ts219-6282.dtb \
 	kirkwood-openblocks_a6.dtb
diff --git a/arch/arm/boot/dts/kirkwood-netgear_readynas.dts b/arch/arm/boot/dts/kirkwood-netgear_readynas.dts
new file mode 100644
index 0000000..d89d436
--- /dev/null
+++ b/arch/arm/boot/dts/kirkwood-netgear_readynas.dts
@@ -0,0 +1,169 @@
+/dts-v1/;
+
+/include/ "kirkwood.dtsi"
+/include/ "kirkwood-6282.dtsi"
+
+/ {
+	model = "NETGEAR ReadyNAS Duo v2";
+	compatible = "netgear,readynas", "marvell,kirkwood-88f6282", "marvell,kirkwood";
+
+	memory { /* 256 MB */
+		device_type = "memory";
+		reg = <0x00000000 0x10000000>;
+	};
+
+	chosen {
+		bootargs = "console=ttyS0,115200n8 earlyprintk";
+	};
+
+	ocp at f1000000 {
+		pinctrl: pinctrl at 10000 {
+
+			pinctrl-0 = < &pmx_uart0
+				      &pmx_button_power
+				      &pmx_button_backup
+				      &pmx_button_power
+				      &pmx_led_power
+				      &pmx_led_blue_activity
+				      &pmx_led_blue_disk1
+				      &pmx_led_blue_disk2
+				      &pmx_led_blue_backup >;
+			pinctrl-names = "default";
+
+			pmx_button_power: pmx-button-power {
+				marvell,pins = "mpp47";
+				marvell,function = "gpio";
+			};
+			pmx_button_backup: pmx-button-backup {
+				marvell,pins = "mpp45";
+				marvell,function = "gpio";
+			};
+			pmx_button_reset: pmx-button-reset {
+				marvell,pins = "mpp13";
+				marvell,function = "gpio";
+			};
+			pmx_led_power: pmx-led-power {
+				marvell,pins = "mpp31";
+				marvell,function = "gpio";
+			};
+			pmx_led_blue_activity: pmx-led-blue-activity {
+				marvell,pins = "mpp38";
+				marvell,function = "gpio";
+			};
+			pmx_led_blue_disk1: pmx-led-blue-disk1 {
+				marvell,pins = "mpp23";
+				marvell,function = "gpio";
+			};
+			pmx_led_blue_disk2: pmx-led-blue-disk2 {
+				marvell,pins = "mpp22";
+				marvell,function = "gpio";
+			};
+			pmx_led_blue_backup: pmx-led-blue-backup {
+				marvell,pins = "mpp29";
+				marvell,function = "gpio";
+			};
+		};
+
+		thermal at 10078 {
+			compatible = "marvell,kirkwood-thermal";
+			reg = <0x10078 0x4>;
+			status = "okay";
+		};
+
+		i2c at 11000 {
+			status = "okay";
+
+			rs5c372a: rs5c372a at 32 {
+				compatible = "ricoh,rs5c372a";
+				reg = <0x32>;
+			};
+		};
+
+		serial at 12000 {
+			status = "okay";
+		};
+
+		nand at 3000000 {
+			status = "okay";
+
+			partition at 0 {
+				label = "u-boot";
+				reg = <0x0000000 0x180000>;
+				read-only;
+			};
+
+			partition at 180000 {
+				label = "u-boot-env";
+				reg = <0x180000 0x20000>;
+			};
+
+			partition at 200000 {
+				label = "uImage";
+				reg = <0x0200000 0x600000>;
+			};
+
+			partition at 800000 {
+				label = "minirootfs";
+				reg = <0x0800000 0x1000000>;
+			};
+
+			partition at 1800000 {
+				label = "jffs2";
+				reg = <0x1800000 0x6800000>;
+			};
+		};
+
+		sata at 80000 {
+			status = "okay";
+			nr-ports = <2>;
+		};
+	};
+
+	gpio-leds {
+		compatible = "gpio-leds";
+
+		power_led {
+			label = "status:blue:power_led";
+			gpios = <&gpio0 31 1>;   /* GPIO 31 Active Low */
+			linux,default-trigger = "default-on";
+		};
+		activity_led {
+			label = "status:blue:activity_led";
+			gpios = <&gpio1 6 1>;    /* GPIO 38 Active Low */
+		};
+		disk1_led {
+			label = "status:blue:disk1_led";
+			gpios = <&gpio0 23 1>;   /* GPIO 23 Active Low */
+		};
+		disk2_led {
+			label = "status:blue:disk2_led";
+			gpios = <&gpio0 22 1>;   /* GPIO 22 Active Low */
+		};
+		backup_led {
+			label = "status:blue:backup_led";
+			gpios = <&gpio0 29 1>;   /* GPIO 29 Active Low*/
+			linux,default-trigger = "timer";
+		};
+	};
+
+	gpio_keys {
+		compatible = "gpio-keys";
+		#address-cells = <1>;
+		#size-cells = <0>;
+		button at 1 {
+			label = "Power Button";
+			linux,code = <116>;     /* KEY_POWER */
+			gpios = <&gpio1 15 1>;
+		};
+		button at 2 {
+			label = "Reset Button";
+			linux,code = <0x198>;   /* KEY_RESTART */
+			gpios = <&gpio0 13 1>;
+		};
+		button at 3 {
+			label = "Backup Button";
+			linux,code = <133>;     /* KEY_COPY */
+			gpios = <&gpio1 13 1>;
+		};
+	};
+};
diff --git a/arch/arm/configs/kirkwood_defconfig b/arch/arm/configs/kirkwood_defconfig
index 13482ea..511cd7d 100644
--- a/arch/arm/configs/kirkwood_defconfig
+++ b/arch/arm/configs/kirkwood_defconfig
@@ -35,6 +35,7 @@ CONFIG_MACH_NETSPACE_LITE_V2_DT=y
 CONFIG_MACH_NETSPACE_MINI_V2_DT=y
 CONFIG_MACH_OPENBLOCKS_A6_DT=y
 CONFIG_MACH_TOPKICK_DT=y
+CONFIG_MACH_READYNAS_DT=y
 CONFIG_MACH_TS219=y
 CONFIG_MACH_TS41X=y
 CONFIG_MACH_DOCKSTAR=y
diff --git a/arch/arm/mach-kirkwood/Kconfig b/arch/arm/mach-kirkwood/Kconfig
index 7b6a64b..94df386 100644
--- a/arch/arm/mach-kirkwood/Kconfig
+++ b/arch/arm/mach-kirkwood/Kconfig
@@ -108,6 +108,15 @@ config MACH_TS219_DT
 	  or MV6282. If you have the wrong one, the buttons will not
 	  work.
 
+config MACH_READYNAS_DT
+	bool "NETGEAR ReadyNAS Duo v2 (Flattened Device Tree)"
+	select ARCH_KIRKWOOD_DT
+	select ARM_APPENDED_DTB
+	select ARM_ATAG_DTB_COMPAT
+	help
+	  Say 'Y' here if you want your kernel to support the
+	  NETGEAR ReadyNAS Duo v2 using Fattened Device Tree.
+
 config MACH_DOCKSTAR_DT
 	bool "Seagate FreeAgent Dockstar (Flattened Device Tree)"
 	select ARCH_KIRKWOOD_DT
diff --git a/arch/arm/mach-kirkwood/Makefile b/arch/arm/mach-kirkwood/Makefile
index 4cc4bee..b9108ea 100644
--- a/arch/arm/mach-kirkwood/Makefile
+++ b/arch/arm/mach-kirkwood/Makefile
@@ -26,6 +26,7 @@ obj-$(CONFIG_MACH_ICONNECT_DT)		+= board-iconnect.o
 obj-$(CONFIG_MACH_DLINK_KIRKWOOD_DT)	+= board-dnskw.o
 obj-$(CONFIG_MACH_IB62X0_DT)		+= board-ib62x0.o
 obj-$(CONFIG_MACH_TS219_DT)		+= board-ts219.o tsx1x-common.o
+obj-$(CONFIG_MACH_READYNAS_DT)		+= board-readynas.o
 obj-$(CONFIG_MACH_DOCKSTAR_DT)		+= board-dockstar.o
 obj-$(CONFIG_MACH_GOFLEXNET_DT)		+= board-goflexnet.o
 obj-$(CONFIG_MACH_LSXL_DT)		+= board-lsxl.o
diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c
index 2e73e9d..7418e03 100644
--- a/arch/arm/mach-kirkwood/board-dt.c
+++ b/arch/arm/mach-kirkwood/board-dt.c
@@ -144,6 +144,9 @@ static void __init kirkwood_dt_init(void)
 	if (of_machine_is_compatible("usi,topkick"))
 		usi_topkick_init();
 
+	if (of_machine_is_compatible("netgear,readynas"))
+		netgear_readynas_init();
+
 	of_platform_populate(NULL, kirkwood_dt_match_table, NULL, NULL);
 }
 
@@ -169,6 +172,7 @@ static const char * const kirkwood_dt_board_compat[] = {
 	"plathome,openblocks-a6",
 	"usi,topkick",
 	"zyxel,nsa310",
+	"netgear,readynas",
 	NULL
 };
 
diff --git a/arch/arm/mach-kirkwood/board-readynas.c b/arch/arm/mach-kirkwood/board-readynas.c
new file mode 100644
index 0000000..1d0a6a0
--- /dev/null
+++ b/arch/arm/mach-kirkwood/board-readynas.c
@@ -0,0 +1,39 @@
+/*
+ * NETGEAR ReadyNAS Duo v2 Board setup for drivers not already
+ * converted to DT.
+ *
+ * Copyright (C) 2013, Arnaud EBALARD <arno@natisbad.org>
+ *
+ * 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.
+ */
+
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/platform_device.h>
+#include <linux/mv643xx_eth.h>
+#include <linux/delay.h>
+#include <asm/io.h>
+#include <mach/kirkwood.h>
+#include "common.h"
+
+static struct mv643xx_eth_platform_data netgear_readynas_ge00_data = {
+	.phy_addr	= MV643XX_ETH_PHY_ADDR(0),
+};
+
+void __init netgear_readynas_init(void)
+{
+	u32 val;
+
+	kirkwood_ge00_init(&netgear_readynas_ge00_data);
+	kirkwood_pcie_init(KW_PCIE0);
+
+	/* USB 3.0 controller power on */
+	mdelay(3000);
+	val = readl(GPIO_HIGH_VIRT_BASE + 0x4);
+	writel(val & ~(0x1 << 14), GPIO_HIGH_VIRT_BASE + 0x4);
+	val = readl(GPIO_HIGH_VIRT_BASE);
+	writel(val | (0x1 << 14), GPIO_HIGH_VIRT_BASE);
+}
diff --git a/arch/arm/mach-kirkwood/common.h b/arch/arm/mach-kirkwood/common.h
index 5ed7056..ed9a4bd 100644
--- a/arch/arm/mach-kirkwood/common.h
+++ b/arch/arm/mach-kirkwood/common.h
@@ -147,6 +147,12 @@ void usi_topkick_init(void);
 static inline void usi_topkick_init(void) {};
 #endif
 
+#ifdef CONFIG_MACH_READYNAS_DT
+void netgear_readynas_init(void);
+#else
+static inline void netgear_readynas_init(void) {};
+#endif
+
 /* early init functions not converted to fdt yet */
 char *kirkwood_id(void);
 void kirkwood_l2_init(void);
-- 
1.7.10.4

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

* [PATCH] ARM: kirkwood: Add support for NETGEAR ReadyNAS Duo v2 using DT
  2013-03-17 20:31 [PATCH] ARM: kirkwood: Add support for NETGEAR ReadyNAS Duo v2 using DT Arnaud Ebalard
@ 2013-03-17 20:40 ` Jason Cooper
  2013-03-17 20:50 ` Andrew Lunn
  1 sibling, 0 replies; 15+ messages in thread
From: Jason Cooper @ 2013-03-17 20:40 UTC (permalink / raw)
  To: linux-arm-kernel

Arnaud,

Thanks for contribution!

On Sun, Mar 17, 2013 at 09:31:06PM +0100, Arnaud Ebalard wrote:
> Hi,
> 
> Add support for the NETGEAR ReadyNAS Duo v2 (Hardware specs available
> here: http://natisbad.org/NAS/). Almost everything is supported via
> provided .dts. A board-readynas.c file is nonetheless required for
> devices not only converted (Gbit controller) and USB 3.0 controller
> power on.

Yes, we're working on that.

> FWIW, the most noticeable lack regarding hardware support is the fan
> controller (GMT G762) for which nothing is currently available
> upstream. 


> 
> A previous version of the patch has been tested against 3.8.3 and the
> one below has been tested against current arm tree.
> 
> Cheers,
> 
> a+

Could you put the above comment two lines below:

> 
> Signed-off-by: Arnaud Ebalard <arno@natisbad.org>
> ---

here?

>  arch/arm/boot/dts/Makefile                      |    1 +
>  arch/arm/boot/dts/kirkwood-netgear_readynas.dts |  169 +++++++++++++++++++++++
>  arch/arm/configs/kirkwood_defconfig             |    1 +
>  arch/arm/mach-kirkwood/Kconfig                  |    9 ++
>  arch/arm/mach-kirkwood/Makefile                 |    1 +
>  arch/arm/mach-kirkwood/board-dt.c               |    4 +
>  arch/arm/mach-kirkwood/board-readynas.c         |   39 ++++++
>  arch/arm/mach-kirkwood/common.h                 |    6 +
>  8 files changed, 230 insertions(+)
>  create mode 100644 arch/arm/boot/dts/kirkwood-netgear_readynas.dts
>  create mode 100644 arch/arm/mach-kirkwood/board-readynas.c
> 
> diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
> index 9c62558..99122ba 100644
> --- a/arch/arm/boot/dts/Makefile
> +++ b/arch/arm/boot/dts/Makefile
> @@ -71,6 +71,7 @@ dtb-$(CONFIG_ARCH_KIRKWOOD) += kirkwood-dns320.dtb \
>  	kirkwood-ns2mini.dtb \
>  	kirkwood-nsa310.dtb \
>  	kirkwood-topkick.dtb \
> +	kirkwood-netgear_readynas.dtb \

please keep in alphabetical order.  It simplifies merge conflicts for
us.

>  	kirkwood-ts219-6281.dtb \
>  	kirkwood-ts219-6282.dtb \
>  	kirkwood-openblocks_a6.dtb
> diff --git a/arch/arm/boot/dts/kirkwood-netgear_readynas.dts b/arch/arm/boot/dts/kirkwood-netgear_readynas.dts
> new file mode 100644
> index 0000000..d89d436
> --- /dev/null
> +++ b/arch/arm/boot/dts/kirkwood-netgear_readynas.dts
> @@ -0,0 +1,169 @@
> +/dts-v1/;
> +
> +/include/ "kirkwood.dtsi"
> +/include/ "kirkwood-6282.dtsi"
> +
> +/ {
> +	model = "NETGEAR ReadyNAS Duo v2";
> +	compatible = "netgear,readynas", "marvell,kirkwood-88f6282", "marvell,kirkwood";

Please add a more specific compatible string here, eg
"netgear,readynas-duo-v2", "netgear,readynas", ...

> +
> +	memory { /* 256 MB */
> +		device_type = "memory";
> +		reg = <0x00000000 0x10000000>;
> +	};
> +
> +	chosen {
> +		bootargs = "console=ttyS0,115200n8 earlyprintk";
> +	};
> +
> +	ocp at f1000000 {
> +		pinctrl: pinctrl at 10000 {
> +
> +			pinctrl-0 = < &pmx_uart0
> +				      &pmx_button_power
> +				      &pmx_button_backup
> +				      &pmx_button_power
> +				      &pmx_led_power
> +				      &pmx_led_blue_activity
> +				      &pmx_led_blue_disk1
> +				      &pmx_led_blue_disk2
> +				      &pmx_led_blue_backup >;
> +			pinctrl-names = "default";
> +
> +			pmx_button_power: pmx-button-power {
> +				marvell,pins = "mpp47";
> +				marvell,function = "gpio";
> +			};
> +			pmx_button_backup: pmx-button-backup {
> +				marvell,pins = "mpp45";
> +				marvell,function = "gpio";
> +			};
> +			pmx_button_reset: pmx-button-reset {
> +				marvell,pins = "mpp13";
> +				marvell,function = "gpio";
> +			};
> +			pmx_led_power: pmx-led-power {
> +				marvell,pins = "mpp31";
> +				marvell,function = "gpio";
> +			};
> +			pmx_led_blue_activity: pmx-led-blue-activity {
> +				marvell,pins = "mpp38";
> +				marvell,function = "gpio";
> +			};
> +			pmx_led_blue_disk1: pmx-led-blue-disk1 {
> +				marvell,pins = "mpp23";
> +				marvell,function = "gpio";
> +			};
> +			pmx_led_blue_disk2: pmx-led-blue-disk2 {
> +				marvell,pins = "mpp22";
> +				marvell,function = "gpio";
> +			};
> +			pmx_led_blue_backup: pmx-led-blue-backup {
> +				marvell,pins = "mpp29";
> +				marvell,function = "gpio";
> +			};
> +		};
> +
> +		thermal at 10078 {
> +			compatible = "marvell,kirkwood-thermal";
> +			reg = <0x10078 0x4>;
> +			status = "okay";
> +		};
> +
> +		i2c at 11000 {
> +			status = "okay";
> +
> +			rs5c372a: rs5c372a at 32 {
> +				compatible = "ricoh,rs5c372a";
> +				reg = <0x32>;
> +			};
> +		};
> +
> +		serial at 12000 {
> +			status = "okay";
> +		};
> +
> +		nand at 3000000 {
> +			status = "okay";
> +
> +			partition at 0 {
> +				label = "u-boot";
> +				reg = <0x0000000 0x180000>;
> +				read-only;
> +			};
> +
> +			partition at 180000 {
> +				label = "u-boot-env";
> +				reg = <0x180000 0x20000>;
> +			};
> +
> +			partition at 200000 {
> +				label = "uImage";
> +				reg = <0x0200000 0x600000>;
> +			};
> +
> +			partition at 800000 {
> +				label = "minirootfs";
> +				reg = <0x0800000 0x1000000>;
> +			};
> +
> +			partition at 1800000 {
> +				label = "jffs2";
> +				reg = <0x1800000 0x6800000>;
> +			};
> +		};
> +
> +		sata at 80000 {
> +			status = "okay";
> +			nr-ports = <2>;
> +		};
> +	};
> +
> +	gpio-leds {
> +		compatible = "gpio-leds";
> +
> +		power_led {
> +			label = "status:blue:power_led";
> +			gpios = <&gpio0 31 1>;   /* GPIO 31 Active Low */
> +			linux,default-trigger = "default-on";
> +		};
> +		activity_led {
> +			label = "status:blue:activity_led";
> +			gpios = <&gpio1 6 1>;    /* GPIO 38 Active Low */
> +		};
> +		disk1_led {
> +			label = "status:blue:disk1_led";
> +			gpios = <&gpio0 23 1>;   /* GPIO 23 Active Low */
> +		};
> +		disk2_led {
> +			label = "status:blue:disk2_led";
> +			gpios = <&gpio0 22 1>;   /* GPIO 22 Active Low */
> +		};
> +		backup_led {
> +			label = "status:blue:backup_led";
> +			gpios = <&gpio0 29 1>;   /* GPIO 29 Active Low*/
> +			linux,default-trigger = "timer";
> +		};
> +	};
> +
> +	gpio_keys {
> +		compatible = "gpio-keys";
> +		#address-cells = <1>;
> +		#size-cells = <0>;
> +		button at 1 {
> +			label = "Power Button";
> +			linux,code = <116>;     /* KEY_POWER */
> +			gpios = <&gpio1 15 1>;
> +		};
> +		button at 2 {
> +			label = "Reset Button";
> +			linux,code = <0x198>;   /* KEY_RESTART */
> +			gpios = <&gpio0 13 1>;
> +		};
> +		button at 3 {
> +			label = "Backup Button";
> +			linux,code = <133>;     /* KEY_COPY */
> +			gpios = <&gpio1 13 1>;
> +		};
> +	};
> +};
> diff --git a/arch/arm/configs/kirkwood_defconfig b/arch/arm/configs/kirkwood_defconfig
> index 13482ea..511cd7d 100644
> --- a/arch/arm/configs/kirkwood_defconfig
> +++ b/arch/arm/configs/kirkwood_defconfig
> @@ -35,6 +35,7 @@ CONFIG_MACH_NETSPACE_LITE_V2_DT=y
>  CONFIG_MACH_NETSPACE_MINI_V2_DT=y
>  CONFIG_MACH_OPENBLOCKS_A6_DT=y
>  CONFIG_MACH_TOPKICK_DT=y
> +CONFIG_MACH_READYNAS_DT=y
>  CONFIG_MACH_TS219=y
>  CONFIG_MACH_TS41X=y
>  CONFIG_MACH_DOCKSTAR=y
> diff --git a/arch/arm/mach-kirkwood/Kconfig b/arch/arm/mach-kirkwood/Kconfig
> index 7b6a64b..94df386 100644
> --- a/arch/arm/mach-kirkwood/Kconfig
> +++ b/arch/arm/mach-kirkwood/Kconfig
> @@ -108,6 +108,15 @@ config MACH_TS219_DT
>  	  or MV6282. If you have the wrong one, the buttons will not
>  	  work.
>  
> +config MACH_READYNAS_DT
> +	bool "NETGEAR ReadyNAS Duo v2 (Flattened Device Tree)"
> +	select ARCH_KIRKWOOD_DT
> +	select ARM_APPENDED_DTB
> +	select ARM_ATAG_DTB_COMPAT
> +	help
> +	  Say 'Y' here if you want your kernel to support the
> +	  NETGEAR ReadyNAS Duo v2 using Fattened Device Tree.
> +
>  config MACH_DOCKSTAR_DT
>  	bool "Seagate FreeAgent Dockstar (Flattened Device Tree)"
>  	select ARCH_KIRKWOOD_DT
> diff --git a/arch/arm/mach-kirkwood/Makefile b/arch/arm/mach-kirkwood/Makefile
> index 4cc4bee..b9108ea 100644
> --- a/arch/arm/mach-kirkwood/Makefile
> +++ b/arch/arm/mach-kirkwood/Makefile
> @@ -26,6 +26,7 @@ obj-$(CONFIG_MACH_ICONNECT_DT)		+= board-iconnect.o
>  obj-$(CONFIG_MACH_DLINK_KIRKWOOD_DT)	+= board-dnskw.o
>  obj-$(CONFIG_MACH_IB62X0_DT)		+= board-ib62x0.o
>  obj-$(CONFIG_MACH_TS219_DT)		+= board-ts219.o tsx1x-common.o
> +obj-$(CONFIG_MACH_READYNAS_DT)		+= board-readynas.o
>  obj-$(CONFIG_MACH_DOCKSTAR_DT)		+= board-dockstar.o
>  obj-$(CONFIG_MACH_GOFLEXNET_DT)		+= board-goflexnet.o
>  obj-$(CONFIG_MACH_LSXL_DT)		+= board-lsxl.o
> diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c
> index 2e73e9d..7418e03 100644
> --- a/arch/arm/mach-kirkwood/board-dt.c
> +++ b/arch/arm/mach-kirkwood/board-dt.c
> @@ -144,6 +144,9 @@ static void __init kirkwood_dt_init(void)
>  	if (of_machine_is_compatible("usi,topkick"))
>  		usi_topkick_init();
>  
> +	if (of_machine_is_compatible("netgear,readynas"))
> +		netgear_readynas_init();
> +
>  	of_platform_populate(NULL, kirkwood_dt_match_table, NULL, NULL);
>  }
>  
> @@ -169,6 +172,7 @@ static const char * const kirkwood_dt_board_compat[] = {
>  	"plathome,openblocks-a6",
>  	"usi,topkick",
>  	"zyxel,nsa310",
> +	"netgear,readynas",
>  	NULL
>  };
>  
> diff --git a/arch/arm/mach-kirkwood/board-readynas.c b/arch/arm/mach-kirkwood/board-readynas.c
> new file mode 100644
> index 0000000..1d0a6a0
> --- /dev/null
> +++ b/arch/arm/mach-kirkwood/board-readynas.c
> @@ -0,0 +1,39 @@
> +/*
> + * NETGEAR ReadyNAS Duo v2 Board setup for drivers not already
> + * converted to DT.
> + *
> + * Copyright (C) 2013, Arnaud EBALARD <arno@natisbad.org>
> + *
> + * 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.
> + */
> +
> +#include <linux/kernel.h>
> +#include <linux/init.h>
> +#include <linux/platform_device.h>
> +#include <linux/mv643xx_eth.h>
> +#include <linux/delay.h>
> +#include <asm/io.h>
> +#include <mach/kirkwood.h>
> +#include "common.h"
> +
> +static struct mv643xx_eth_platform_data netgear_readynas_ge00_data = {
> +	.phy_addr	= MV643XX_ETH_PHY_ADDR(0),
> +};
> +
> +void __init netgear_readynas_init(void)
> +{
> +	u32 val;
> +
> +	kirkwood_ge00_init(&netgear_readynas_ge00_data);
> +	kirkwood_pcie_init(KW_PCIE0);
> +
> +	/* USB 3.0 controller power on */
> +	mdelay(3000);
> +	val = readl(GPIO_HIGH_VIRT_BASE + 0x4);
> +	writel(val & ~(0x1 << 14), GPIO_HIGH_VIRT_BASE + 0x4);
> +	val = readl(GPIO_HIGH_VIRT_BASE);
> +	writel(val | (0x1 << 14), GPIO_HIGH_VIRT_BASE);

Please look@kirkwood-topkick.dts regulators block to see if perhaps
that will fit here.

thx,

Jason.

> +}
> diff --git a/arch/arm/mach-kirkwood/common.h b/arch/arm/mach-kirkwood/common.h
> index 5ed7056..ed9a4bd 100644
> --- a/arch/arm/mach-kirkwood/common.h
> +++ b/arch/arm/mach-kirkwood/common.h
> @@ -147,6 +147,12 @@ void usi_topkick_init(void);
>  static inline void usi_topkick_init(void) {};
>  #endif
>  
> +#ifdef CONFIG_MACH_READYNAS_DT
> +void netgear_readynas_init(void);
> +#else
> +static inline void netgear_readynas_init(void) {};
> +#endif
> +
>  /* early init functions not converted to fdt yet */
>  char *kirkwood_id(void);
>  void kirkwood_l2_init(void);
> -- 
> 1.7.10.4
> 

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

* [PATCH] ARM: kirkwood: Add support for NETGEAR ReadyNAS Duo v2 using DT
  2013-03-17 20:31 [PATCH] ARM: kirkwood: Add support for NETGEAR ReadyNAS Duo v2 using DT Arnaud Ebalard
  2013-03-17 20:40 ` Jason Cooper
@ 2013-03-17 20:50 ` Andrew Lunn
  2013-03-17 21:23   ` Arnaud Ebalard
                     ` (2 more replies)
  1 sibling, 3 replies; 15+ messages in thread
From: Andrew Lunn @ 2013-03-17 20:50 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Arnaud

> +
> +		thermal at 10078 {
> +			compatible = "marvell,kirkwood-thermal";
> +			reg = <0x10078 0x4>;
> +			status = "okay";
> +		};

This should not be needed. All 6282 have the thermal sensor, so the
kirkwood-6282.dtsi will contain this. For 3.9 we submitted the DT
change too late, so it did not make it in, but for 3.10 it should be
there.

> +void __init netgear_readynas_init(void)
> +{
> +	u32 val;
> +
> +	kirkwood_ge00_init(&netgear_readynas_ge00_data);
> +	kirkwood_pcie_init(KW_PCIE0);
> +
> +	/* USB 3.0 controller power on */
> +	mdelay(3000);
> +	val = readl(GPIO_HIGH_VIRT_BASE + 0x4);
> +	writel(val & ~(0x1 << 14), GPIO_HIGH_VIRT_BASE + 0x4);
> +	val = readl(GPIO_HIGH_VIRT_BASE);
> +	writel(val | (0x1 << 14), GPIO_HIGH_VIRT_BASE);

As Jason said, you can use a fixed regulator, in DT. Something like:

        regulators {
                compatible = "simple-bus";
                #address-cells = <1>;
                #size-cells = <0>;

                usb_power: regulator at 1 {
                        compatible = "regulator-fixed";
                        reg = <1>;
                        regulator-name = "USB Power";
                        regulator-min-microvolt = <5000000>;
                        regulator-max-microvolt = <5000000>;
                        enable-active-high;
                        regulator-always-on;
                        regulator-boot-on;
                        gpio = <&gpio0 14 0>;
                };
        };

Is the mdelay() really required?

   Andrew

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

* [PATCH] ARM: kirkwood: Add support for NETGEAR ReadyNAS Duo v2 using DT
  2013-03-17 20:50 ` Andrew Lunn
@ 2013-03-17 21:23   ` Arnaud Ebalard
  2013-03-18 23:10   ` Arnaud Ebalard
  2013-03-19 19:58   ` [PATCHv2] " Arnaud Ebalard
  2 siblings, 0 replies; 15+ messages in thread
From: Arnaud Ebalard @ 2013-03-17 21:23 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Andrew and Jason,

Jason, I have taken your comments into account.

Andrew Lunn <andrew@lunn.ch> writes:

> Hi Arnaud
>
>> +
>> +		thermal at 10078 {
>> +			compatible = "marvell,kirkwood-thermal";
>> +			reg = <0x10078 0x4>;
>> +			status = "okay";
>> +		};
>
> This should not be needed. All 6282 have the thermal sensor, so the
> kirkwood-6282.dtsi will contain this. For 3.9 we submitted the DT
> change too late, so it did not make it in, but for 3.10 it should be
> there.

Understood, will remove it.


>> +void __init netgear_readynas_init(void)
>> +{
>> +	u32 val;
>> +
>> +	kirkwood_ge00_init(&netgear_readynas_ge00_data);
>> +	kirkwood_pcie_init(KW_PCIE0);
>> +
>> +	/* USB 3.0 controller power on */
>> +	mdelay(3000);
>> +	val = readl(GPIO_HIGH_VIRT_BASE + 0x4);
>> +	writel(val & ~(0x1 << 14), GPIO_HIGH_VIRT_BASE + 0x4);
>> +	val = readl(GPIO_HIGH_VIRT_BASE);
>> +	writel(val | (0x1 << 14), GPIO_HIGH_VIRT_BASE);
>
> As Jason said, you can use a fixed regulator, in DT. Something like:
>
>         regulators {
>                 compatible = "simple-bus";
>                 #address-cells = <1>;
>                 #size-cells = <0>;
>
>                 usb_power: regulator at 1 {
>                         compatible = "regulator-fixed";
>                         reg = <1>;
>                         regulator-name = "USB Power";
>                         regulator-min-microvolt = <5000000>;
>                         regulator-max-microvolt = <5000000>;
>                         enable-active-high;
>                         regulator-always-on;
>                         regulator-boot-on;
>                         gpio = <&gpio0 14 0>;
>                 };
>         };

Thanks for providing this to bootstrap with. Tomorrow, I will test if it
works and report results.


> Is the mdelay() really required?

It was in NETGEAR's kernel (heavily patched 2.6.31.8) and thought people
who wrote the code had reasons (documentation) to put it here but I will
check if it is needed.

Thanks for your time,

Cheers,

a+

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

* [PATCH] ARM: kirkwood: Add support for NETGEAR ReadyNAS Duo v2 using DT
  2013-03-17 20:50 ` Andrew Lunn
  2013-03-17 21:23   ` Arnaud Ebalard
@ 2013-03-18 23:10   ` Arnaud Ebalard
  2013-03-18 23:44     ` Jason Cooper
  2013-03-19  6:07     ` Andrew Lunn
  2013-03-19 19:58   ` [PATCHv2] " Arnaud Ebalard
  2 siblings, 2 replies; 15+ messages in thread
From: Arnaud Ebalard @ 2013-03-18 23:10 UTC (permalink / raw)
  To: linux-arm-kernel

Hi guys,

Andrew Lunn <andrew@lunn.ch> writes:

>> +void __init netgear_readynas_init(void)
>> +{
>> +	u32 val;
>> +
>> +	kirkwood_ge00_init(&netgear_readynas_ge00_data);
>> +	kirkwood_pcie_init(KW_PCIE0);
>> +
>> +	/* USB 3.0 controller power on */
>> +	mdelay(3000);
>> +	val = readl(GPIO_HIGH_VIRT_BASE + 0x4);
>> +	writel(val & ~(0x1 << 14), GPIO_HIGH_VIRT_BASE + 0x4);
>> +	val = readl(GPIO_HIGH_VIRT_BASE);
>> +	writel(val | (0x1 << 14), GPIO_HIGH_VIRT_BASE);
>
> As Jason said, you can use a fixed regulator, in DT. Something like:
>
>         regulators {
>                 compatible = "simple-bus";
>                 #address-cells = <1>;
>                 #size-cells = <0>;
>
>                 usb_power: regulator at 1 {
>                         compatible = "regulator-fixed";
>                         reg = <1>;
>                         regulator-name = "USB Power";
>                         regulator-min-microvolt = <5000000>;
>                         regulator-max-microvolt = <5000000>;
>                         enable-active-high;
>                         regulator-always-on;
>                         regulator-boot-on;
>                         gpio = <&gpio0 14 0>;
>                 };
>         };

I spent a lot of time on this, trying various things and reading various
elements of Docomentation/ but for some reason, it does not work, i.e. I
always end up w/ something lik: 

[    7.599773] USB Power: Failed to request enable GPIO14: -517
[    7.605963] reg-fixed-voltage 1.regulator: Failed to register regulator: -517
[    7.613163] platform 1.regulator: Driver reg-fixed-voltage requests probe deferral

I must confess I am not familiar enough with the inner working of
regulators and dt-exposed options to map the following correctly to
a dts entry.

	val = readl(GPIO_HIGH_VIRT_BASE + 0x4);
	writel(val & ~(0x1 << 14), GPIO_HIGH_VIRT_BASE + 0x4);
	val = readl(GPIO_HIGH_VIRT_BASE);
	writel(val | (0x1 << 14), GPIO_HIGH_VIRT_BASE);

If you have any ideas/directions, I would be happy to dig and test.

> Is the mdelay() really required?

It does not seem to be required, i.e. removing it still allows me to
plug a usb key and mount it.

Cheers,

a+

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

* [PATCH] ARM: kirkwood: Add support for NETGEAR ReadyNAS Duo v2 using DT
  2013-03-18 23:10   ` Arnaud Ebalard
@ 2013-03-18 23:44     ` Jason Cooper
  2013-03-19  6:07     ` Andrew Lunn
  1 sibling, 0 replies; 15+ messages in thread
From: Jason Cooper @ 2013-03-18 23:44 UTC (permalink / raw)
  To: linux-arm-kernel

Arnaud,

On Tue, Mar 19, 2013 at 12:10:46AM +0100, Arnaud Ebalard wrote:
> Hi guys,
> 
> Andrew Lunn <andrew@lunn.ch> writes:
> 
> >> +void __init netgear_readynas_init(void)
> >> +{
> >> +	u32 val;
> >> +
> >> +	kirkwood_ge00_init(&netgear_readynas_ge00_data);
> >> +	kirkwood_pcie_init(KW_PCIE0);
> >> +
> >> +	/* USB 3.0 controller power on */
> >> +	mdelay(3000);
> >> +	val = readl(GPIO_HIGH_VIRT_BASE + 0x4);
> >> +	writel(val & ~(0x1 << 14), GPIO_HIGH_VIRT_BASE + 0x4);
> >> +	val = readl(GPIO_HIGH_VIRT_BASE);
> >> +	writel(val | (0x1 << 14), GPIO_HIGH_VIRT_BASE);
> >
> > As Jason said, you can use a fixed regulator, in DT. Something like:
> >
> >         regulators {
> >                 compatible = "simple-bus";
> >                 #address-cells = <1>;
> >                 #size-cells = <0>;
> >
> >                 usb_power: regulator at 1 {
> >                         compatible = "regulator-fixed";
> >                         reg = <1>;
> >                         regulator-name = "USB Power";
> >                         regulator-min-microvolt = <5000000>;
> >                         regulator-max-microvolt = <5000000>;
> >                         enable-active-high;
> >                         regulator-always-on;
> >                         regulator-boot-on;
> >                         gpio = <&gpio0 14 0>;

			    gpio = <&gpio1 14 0>;

GPIO_HIGH_VIRT_BASE is the second bank of gpios.

hth,

Jason.

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

* [PATCH] ARM: kirkwood: Add support for NETGEAR ReadyNAS Duo v2 using DT
  2013-03-18 23:10   ` Arnaud Ebalard
  2013-03-18 23:44     ` Jason Cooper
@ 2013-03-19  6:07     ` Andrew Lunn
  2013-03-19  6:59       ` Arnaud Ebalard
  1 sibling, 1 reply; 15+ messages in thread
From: Andrew Lunn @ 2013-03-19  6:07 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Mar 19, 2013 at 12:10:46AM +0100, Arnaud Ebalard wrote:
> Hi guys,
> 
> Andrew Lunn <andrew@lunn.ch> writes:
> 
> >> +void __init netgear_readynas_init(void)
> >> +{
> >> +	u32 val;
> >> +
> >> +	kirkwood_ge00_init(&netgear_readynas_ge00_data);
> >> +	kirkwood_pcie_init(KW_PCIE0);
> >> +
> >> +	/* USB 3.0 controller power on */
> >> +	mdelay(3000);
> >> +	val = readl(GPIO_HIGH_VIRT_BASE + 0x4);
> >> +	writel(val & ~(0x1 << 14), GPIO_HIGH_VIRT_BASE + 0x4);
> >> +	val = readl(GPIO_HIGH_VIRT_BASE);
> >> +	writel(val | (0x1 << 14), GPIO_HIGH_VIRT_BASE);
> >
> > As Jason said, you can use a fixed regulator, in DT. Something like:
> >
> >         regulators {
> >                 compatible = "simple-bus";
> >                 #address-cells = <1>;
> >                 #size-cells = <0>;
> >
> >                 usb_power: regulator at 1 {
> >                         compatible = "regulator-fixed";
> >                         reg = <1>;
> >                         regulator-name = "USB Power";
> >                         regulator-min-microvolt = <5000000>;
> >                         regulator-max-microvolt = <5000000>;
> >                         enable-active-high;
> >                         regulator-always-on;
> >                         regulator-boot-on;
> >                         gpio = <&gpio0 14 0>;
> >                 };
> >         };
> 
> I spent a lot of time on this, trying various things and reading various
> elements of Docomentation/ but for some reason, it does not work, i.e. I
> always end up w/ something lik: 
> 
> [    7.599773] USB Power: Failed to request enable GPIO14: -517
> [    7.605963] reg-fixed-voltage 1.regulator: Failed to register regulator: -517
> [    7.613163] platform 1.regulator: Driver reg-fixed-voltage requests probe deferral

Although this is quite noisy, it is actually not an error. What it is
saying is that it failed to get the gpio and it will try again
later. -517 is EDEFERE. It failed, because at this point, the GPIO
driver has not yet loaded. Later in the boot the gpio driver
loaded. It around the time you see:

kirkwood-pinctrl f1010000.pinctrl: registered pinctrl driver

At some point, the kernel will retry again to load all drivers which
failed with EDEFER and the second time the regulator driver should
load.

Take a look in /sys/class/regulator/ See if there is a regulator
there with the name file containing "USB power".

      Andrew

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

* [PATCH] ARM: kirkwood: Add support for NETGEAR ReadyNAS Duo v2 using DT
  2013-03-19  6:07     ` Andrew Lunn
@ 2013-03-19  6:59       ` Arnaud Ebalard
  0 siblings, 0 replies; 15+ messages in thread
From: Arnaud Ebalard @ 2013-03-19  6:59 UTC (permalink / raw)
  To: linux-arm-kernel

Thanks guys,

Andrew Lunn <andrew@lunn.ch> writes:

>> [    7.599773] USB Power: Failed to request enable GPIO14: -517
>> [    7.605963] reg-fixed-voltage 1.regulator: Failed to register regulator: -517
>> [    7.613163] platform 1.regulator: Driver reg-fixed-voltage requests probe deferral
>
> Although this is quite noisy, it is actually not an error. What it is
> saying is that it failed to get the gpio and it will try again
> later. -517 is EDEFERE. It failed, because at this point, the GPIO
> driver has not yet loaded. Later in the boot the gpio driver
> loaded. It around the time you see:
>
> kirkwood-pinctrl f1010000.pinctrl: registered pinctrl driver
>
> At some point, the kernel will retry again to load all drivers which
> failed with EDEFER and the second time the regulator driver should
> load.

Stupid me: I first tried w/ "gpio = <&gpio0 14 0>;", plugged a key to
notice it was not seen, then looked at the logs to discover what seems
to be an error message. Then, I noticed I was addressing gpio0 (as Jason
also pointer) and thought this was the reason changed it for gpio1. At
that point, I should have tested w/ a USB key but instead looked at the
log to check if the message was still here.

Bottome line: it works! I'll resubmit a v2 later this day.

Thanks again.

Cheers,

a+

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

* [PATCHv2] ARM: kirkwood: Add support for NETGEAR ReadyNAS Duo v2 using DT
  2013-03-17 20:50 ` Andrew Lunn
  2013-03-17 21:23   ` Arnaud Ebalard
  2013-03-18 23:10   ` Arnaud Ebalard
@ 2013-03-19 19:58   ` Arnaud Ebalard
  2013-03-19 21:16     ` Andrew Lunn
  2 siblings, 1 reply; 15+ messages in thread
From: Arnaud Ebalard @ 2013-03-19 19:58 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

Add support for NETGEAR ReadyNAS Duo v2 (Hardware specs available
here: http://natisbad.org/NAS/). Almost everything is supported via
provided .dts. A board-readynas.c file is nonetheless required for
device not only converted to DT (Gbit controller).

FWIW, the most noticeable lack regarding hardware support is the fan
controller (GMT G762) for which nothing is currently available
upstream.

Changes since v1:
 - More specific compatible string in dts
 - Moved declaration to keep dts Makefile in alphabetical order
 - Removed unneeded mdelay() for USB power on
 - Switched to fixed regulator in .dts for USB power on

Signed-off-by: Arnaud Ebalard <arno@natisbad.org>
Tested-By: Arnaud Ebalard <arno@natisbad.org>
---

A previous version of the patch has been tested against 3.8.3 and the
one below against current arm tree (current head of rmk/for-next).

 arch/arm/boot/dts/Makefile                         |    1 +
 .../boot/dts/kirkwood-netgear_readynas_duo_v2.dts  |  180 ++++++++++++++++++++
 arch/arm/configs/kirkwood_defconfig                |    1 +
 arch/arm/mach-kirkwood/Kconfig                     |    9 +
 arch/arm/mach-kirkwood/Makefile                    |    1 +
 arch/arm/mach-kirkwood/board-dt.c                  |    4 +
 arch/arm/mach-kirkwood/board-readynas.c            |   30 ++++
 arch/arm/mach-kirkwood/common.h                    |    6 +
 8 files changed, 232 insertions(+)
 create mode 100644 arch/arm/boot/dts/kirkwood-netgear_readynas_duo_v2.dts
 create mode 100644 arch/arm/mach-kirkwood/board-readynas.c

diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index 9c62558..125211d 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -65,6 +65,7 @@ dtb-$(CONFIG_ARCH_KIRKWOOD) += kirkwood-dns320.dtb \
 	kirkwood-lschlv2.dtb \
 	kirkwood-lsxhl.dtb \
 	kirkwood-mplcec4.dtb \
+	kirkwood-netgear_readynas_duo_v2.dtb \
 	kirkwood-ns2.dtb \
 	kirkwood-ns2lite.dtb \
 	kirkwood-ns2max.dtb \
diff --git a/arch/arm/boot/dts/kirkwood-netgear_readynas_duo_v2.dts b/arch/arm/boot/dts/kirkwood-netgear_readynas_duo_v2.dts
new file mode 100644
index 0000000..3756e5c
--- /dev/null
+++ b/arch/arm/boot/dts/kirkwood-netgear_readynas_duo_v2.dts
@@ -0,0 +1,180 @@
+/dts-v1/;
+
+/include/ "kirkwood.dtsi"
+/include/ "kirkwood-6282.dtsi"
+
+/ {
+	model = "NETGEAR ReadyNAS Duo v2";
+	compatible = "netgear,readynas-duo-v2", "netgear,readynas", "marvell,kirkwood-88f6282", "marvell,kirkwood";
+
+	memory { /* 256 MB */
+		device_type = "memory";
+		reg = <0x00000000 0x10000000>;
+	};
+
+	chosen {
+		bootargs = "console=ttyS0,115200n8 earlyprintk";
+	};
+
+	ocp at f1000000 {
+		pinctrl: pinctrl at 10000 {
+
+			pinctrl-0 = < &pmx_uart0
+				      &pmx_button_power
+				      &pmx_button_backup
+				      &pmx_button_power
+				      &pmx_led_power
+				      &pmx_led_blue_activity
+				      &pmx_led_blue_disk1
+				      &pmx_led_blue_disk2
+				      &pmx_led_blue_backup >;
+			pinctrl-names = "default";
+
+			pmx_button_power: pmx-button-power {
+				marvell,pins = "mpp47";
+				marvell,function = "gpio";
+			};
+			pmx_button_backup: pmx-button-backup {
+				marvell,pins = "mpp45";
+				marvell,function = "gpio";
+			};
+			pmx_button_reset: pmx-button-reset {
+				marvell,pins = "mpp13";
+				marvell,function = "gpio";
+			};
+			pmx_led_power: pmx-led-power {
+				marvell,pins = "mpp31";
+				marvell,function = "gpio";
+			};
+			pmx_led_blue_activity: pmx-led-blue-activity {
+				marvell,pins = "mpp38";
+				marvell,function = "gpio";
+			};
+			pmx_led_blue_disk1: pmx-led-blue-disk1 {
+				marvell,pins = "mpp23";
+				marvell,function = "gpio";
+			};
+			pmx_led_blue_disk2: pmx-led-blue-disk2 {
+				marvell,pins = "mpp22";
+				marvell,function = "gpio";
+			};
+			pmx_led_blue_backup: pmx-led-blue-backup {
+				marvell,pins = "mpp29";
+				marvell,function = "gpio";
+			};
+		};
+
+		i2c at 11000 {
+			status = "okay";
+
+			rs5c372a: rs5c372a at 32 {
+				compatible = "ricoh,rs5c372a";
+				reg = <0x32>;
+			};
+		};
+
+		serial at 12000 {
+			status = "okay";
+		};
+
+		nand at 3000000 {
+			status = "okay";
+
+			partition at 0 {
+				label = "u-boot";
+				reg = <0x0000000 0x180000>;
+				read-only;
+			};
+
+			partition at 180000 {
+				label = "u-boot-env";
+				reg = <0x180000 0x20000>;
+			};
+
+			partition at 200000 {
+				label = "uImage";
+				reg = <0x0200000 0x600000>;
+			};
+
+			partition at 800000 {
+				label = "minirootfs";
+				reg = <0x0800000 0x1000000>;
+			};
+
+			partition at 1800000 {
+				label = "jffs2";
+				reg = <0x1800000 0x6800000>;
+			};
+		};
+
+		sata at 80000 {
+			status = "okay";
+			nr-ports = <2>;
+		};
+	};
+
+	gpio-leds {
+		compatible = "gpio-leds";
+
+		power_led {
+			label = "status:blue:power_led";
+			gpios = <&gpio0 31 1>;   /* GPIO 31 Active Low */
+			linux,default-trigger = "default-on";
+		};
+		activity_led {
+			label = "status:blue:activity_led";
+			gpios = <&gpio1 6 1>;    /* GPIO 38 Active Low */
+		};
+		disk1_led {
+			label = "status:blue:disk1_led";
+			gpios = <&gpio0 23 1>;   /* GPIO 23 Active Low */
+		};
+		disk2_led {
+			label = "status:blue:disk2_led";
+			gpios = <&gpio0 22 1>;   /* GPIO 22 Active Low */
+		};
+		backup_led {
+			label = "status:blue:backup_led";
+			gpios = <&gpio0 29 1>;   /* GPIO 29 Active Low*/
+		};
+	};
+
+	gpio_keys {
+		compatible = "gpio-keys";
+		#address-cells = <1>;
+		#size-cells = <0>;
+		button at 1 {
+			label = "Power Button";
+			linux,code = <116>;     /* KEY_POWER */
+			gpios = <&gpio1 15 1>;
+		};
+		button at 2 {
+			label = "Reset Button";
+			linux,code = <0x198>;   /* KEY_RESTART */
+			gpios = <&gpio0 13 1>;
+		};
+		button at 3 {
+			label = "Backup Button";
+			linux,code = <133>;     /* KEY_COPY */
+			gpios = <&gpio1 13 1>;
+		};
+	};
+
+        regulators {
+                compatible = "simple-bus";
+                #address-cells = <1>;
+                #size-cells = <0>;
+
+                usb_power: regulator at 1 {
+                        compatible = "regulator-fixed";
+                        reg = <1>;
+                        regulator-name = "USB 3.0 Power";
+                        regulator-min-microvolt = <5000000>;
+                        regulator-max-microvolt = <5000000>;
+                        enable-active-high;
+                        regulator-always-on;
+                        regulator-boot-on;
+                        gpio = <&gpio1 14 0>;
+                };
+        };
+};
diff --git a/arch/arm/configs/kirkwood_defconfig b/arch/arm/configs/kirkwood_defconfig
index 13482ea..511cd7d 100644
--- a/arch/arm/configs/kirkwood_defconfig
+++ b/arch/arm/configs/kirkwood_defconfig
@@ -35,6 +35,7 @@ CONFIG_MACH_NETSPACE_LITE_V2_DT=y
 CONFIG_MACH_NETSPACE_MINI_V2_DT=y
 CONFIG_MACH_OPENBLOCKS_A6_DT=y
 CONFIG_MACH_TOPKICK_DT=y
+CONFIG_MACH_READYNAS_DT=y
 CONFIG_MACH_TS219=y
 CONFIG_MACH_TS41X=y
 CONFIG_MACH_DOCKSTAR=y
diff --git a/arch/arm/mach-kirkwood/Kconfig b/arch/arm/mach-kirkwood/Kconfig
index 7b6a64b..94df386 100644
--- a/arch/arm/mach-kirkwood/Kconfig
+++ b/arch/arm/mach-kirkwood/Kconfig
@@ -108,6 +108,15 @@ config MACH_TS219_DT
 	  or MV6282. If you have the wrong one, the buttons will not
 	  work.
 
+config MACH_READYNAS_DT
+	bool "NETGEAR ReadyNAS Duo v2 (Flattened Device Tree)"
+	select ARCH_KIRKWOOD_DT
+	select ARM_APPENDED_DTB
+	select ARM_ATAG_DTB_COMPAT
+	help
+	  Say 'Y' here if you want your kernel to support the
+	  NETGEAR ReadyNAS Duo v2 using Fattened Device Tree.
+
 config MACH_DOCKSTAR_DT
 	bool "Seagate FreeAgent Dockstar (Flattened Device Tree)"
 	select ARCH_KIRKWOOD_DT
diff --git a/arch/arm/mach-kirkwood/Makefile b/arch/arm/mach-kirkwood/Makefile
index 4cc4bee..b9108ea 100644
--- a/arch/arm/mach-kirkwood/Makefile
+++ b/arch/arm/mach-kirkwood/Makefile
@@ -26,6 +26,7 @@ obj-$(CONFIG_MACH_ICONNECT_DT)		+= board-iconnect.o
 obj-$(CONFIG_MACH_DLINK_KIRKWOOD_DT)	+= board-dnskw.o
 obj-$(CONFIG_MACH_IB62X0_DT)		+= board-ib62x0.o
 obj-$(CONFIG_MACH_TS219_DT)		+= board-ts219.o tsx1x-common.o
+obj-$(CONFIG_MACH_READYNAS_DT)		+= board-readynas.o
 obj-$(CONFIG_MACH_DOCKSTAR_DT)		+= board-dockstar.o
 obj-$(CONFIG_MACH_GOFLEXNET_DT)		+= board-goflexnet.o
 obj-$(CONFIG_MACH_LSXL_DT)		+= board-lsxl.o
diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c
index 2e73e9d..a29f2ee 100644
--- a/arch/arm/mach-kirkwood/board-dt.c
+++ b/arch/arm/mach-kirkwood/board-dt.c
@@ -144,6 +144,9 @@ static void __init kirkwood_dt_init(void)
 	if (of_machine_is_compatible("usi,topkick"))
 		usi_topkick_init();
 
+	if (of_machine_is_compatible("netgear,readynas-duo-v2"))
+		netgear_readynas_init();
+
 	of_platform_populate(NULL, kirkwood_dt_match_table, NULL, NULL);
 }
 
@@ -169,6 +172,7 @@ static const char * const kirkwood_dt_board_compat[] = {
 	"plathome,openblocks-a6",
 	"usi,topkick",
 	"zyxel,nsa310",
+	"netgear,readynas-duo-v2",
 	NULL
 };
 
diff --git a/arch/arm/mach-kirkwood/board-readynas.c b/arch/arm/mach-kirkwood/board-readynas.c
new file mode 100644
index 0000000..47bc25e
--- /dev/null
+++ b/arch/arm/mach-kirkwood/board-readynas.c
@@ -0,0 +1,30 @@
+/*
+ * NETGEAR ReadyNAS Duo v2 Board setup for drivers not already
+ * converted to DT.
+ *
+ * Copyright (C) 2013, Arnaud EBALARD <arno@natisbad.org>
+ *
+ * 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.
+ */
+
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/platform_device.h>
+#include <linux/mv643xx_eth.h>
+#include <linux/delay.h>
+#include <asm/io.h>
+#include <mach/kirkwood.h>
+#include "common.h"
+
+static struct mv643xx_eth_platform_data netgear_readynas_ge00_data = {
+	.phy_addr	= MV643XX_ETH_PHY_ADDR(0),
+};
+
+void __init netgear_readynas_init(void)
+{
+	kirkwood_ge00_init(&netgear_readynas_ge00_data);
+	kirkwood_pcie_init(KW_PCIE0);
+}
diff --git a/arch/arm/mach-kirkwood/common.h b/arch/arm/mach-kirkwood/common.h
index 5ed7056..ed9a4bd 100644
--- a/arch/arm/mach-kirkwood/common.h
+++ b/arch/arm/mach-kirkwood/common.h
@@ -147,6 +147,12 @@ void usi_topkick_init(void);
 static inline void usi_topkick_init(void) {};
 #endif
 
+#ifdef CONFIG_MACH_READYNAS_DT
+void netgear_readynas_init(void);
+#else
+static inline void netgear_readynas_init(void) {};
+#endif
+
 /* early init functions not converted to fdt yet */
 char *kirkwood_id(void);
 void kirkwood_l2_init(void);
-- 
1.7.10.4

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

* [PATCHv2] ARM: kirkwood: Add support for NETGEAR ReadyNAS Duo v2 using DT
  2013-03-19 19:58   ` [PATCHv2] " Arnaud Ebalard
@ 2013-03-19 21:16     ` Andrew Lunn
  2013-03-19 21:50       ` Arnaud Ebalard
  2013-03-19 22:28       ` [PATCHv3] " Arnaud Ebalard
  0 siblings, 2 replies; 15+ messages in thread
From: Andrew Lunn @ 2013-03-19 21:16 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Mar 19, 2013 at 08:58:22PM +0100, Arnaud Ebalard wrote:
> Hi,
> 
> Add support for NETGEAR ReadyNAS Duo v2 (Hardware specs available
> here: http://natisbad.org/NAS/).

Hi Arnaud

Thats a nice description of the hardware. There is another device
using the same power supply controller, the USI Topkick. A few of the
maintainers have these, so there would be the possibility of
cooperating on a driver. It does not seem that complex a device. The
topkick also seems to do Wake-on-LAN using this controller. There was
a patch added recently which may allow this to work, depending on the
PHY.

> index 13482ea..511cd7d 100644
> --- a/arch/arm/configs/kirkwood_defconfig
> +++ b/arch/arm/configs/kirkwood_defconfig
> @@ -35,6 +35,7 @@ CONFIG_MACH_NETSPACE_LITE_V2_DT=y
>  CONFIG_MACH_NETSPACE_MINI_V2_DT=y
>  CONFIG_MACH_OPENBLOCKS_A6_DT=y
>  CONFIG_MACH_TOPKICK_DT=y
> +CONFIG_MACH_READYNAS_DT=y
>  CONFIG_MACH_TS219=y
>  CONFIG_MACH_TS41X=y
>  CONFIG_MACH_DOCKSTAR=y

Keeping with alphabetic ordering, it should be one place higher....

> diff --git a/arch/arm/mach-kirkwood/Kconfig b/arch/arm/mach-kirkwood/Kconfig
> index 7b6a64b..94df386 100644
> --- a/arch/arm/mach-kirkwood/Kconfig
> +++ b/arch/arm/mach-kirkwood/Kconfig
> @@ -108,6 +108,15 @@ config MACH_TS219_DT
>  	  or MV6282. If you have the wrong one, the buttons will not
>  	  work.
>  
> +config MACH_READYNAS_DT
> +	bool "NETGEAR ReadyNAS Duo v2 (Flattened Device Tree)"
> +	select ARCH_KIRKWOOD_DT
> +	select ARM_APPENDED_DTB
> +	select ARM_ATAG_DTB_COMPAT
> +	help
> +	  Say 'Y' here if you want your kernel to support the
> +	  NETGEAR ReadyNAS Duo v2 using Fattened Device Tree.
> +

Again, should be a bit earlier.

>  config MACH_DOCKSTAR_DT
>  	bool "Seagate FreeAgent Dockstar (Flattened Device Tree)"
>  	select ARCH_KIRKWOOD_DT
> diff --git a/arch/arm/mach-kirkwood/Makefile b/arch/arm/mach-kirkwood/Makefile
> index 4cc4bee..b9108ea 100644
> --- a/arch/arm/mach-kirkwood/Makefile
> +++ b/arch/arm/mach-kirkwood/Makefile
> @@ -26,6 +26,7 @@ obj-$(CONFIG_MACH_ICONNECT_DT)		+= board-iconnect.o
>  obj-$(CONFIG_MACH_DLINK_KIRKWOOD_DT)	+= board-dnskw.o
>  obj-$(CONFIG_MACH_IB62X0_DT)		+= board-ib62x0.o
>  obj-$(CONFIG_MACH_TS219_DT)		+= board-ts219.o tsx1x-common.o
> +obj-$(CONFIG_MACH_READYNAS_DT)		+= board-readynas.o
>  obj-$(CONFIG_MACH_DOCKSTAR_DT)		+= board-dockstar.o
>  obj-$(CONFIG_MACH_GOFLEXNET_DT)		+= board-goflexnet.o
>  obj-$(CONFIG_MACH_LSXL_DT)		+= board-lsxl.o

Yes, you can guess.... Where ever you have inserted something, make
sure it follows the given ordering. The issue here is merge
conflicts. If we get another device contributed that is also added at
the end, we get conflicts. If merges happening in the middle, the
likelihood of a conflict is much smaller. 

> diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c
> index 2e73e9d..a29f2ee 100644
> --- a/arch/arm/mach-kirkwood/board-dt.c
> +++ b/arch/arm/mach-kirkwood/board-dt.c
> @@ -144,6 +144,9 @@ static void __init kirkwood_dt_init(void)
>  	if (of_machine_is_compatible("usi,topkick"))
>  		usi_topkick_init();
>  
> +	if (of_machine_is_compatible("netgear,readynas-duo-v2"))
> +		netgear_readynas_init();
> +
>  	of_platform_populate(NULL, kirkwood_dt_match_table, NULL, NULL);
>  }
>  
> @@ -169,6 +172,7 @@ static const char * const kirkwood_dt_board_compat[] = {
>  	"plathome,openblocks-a6",
>  	"usi,topkick",
>  	"zyxel,nsa310",
> +	"netgear,readynas-duo-v2",
>  	NULL
>  };
>  
> diff --git a/arch/arm/mach-kirkwood/board-readynas.c b/arch/arm/mach-kirkwood/board-readynas.c
> new file mode 100644
> index 0000000..47bc25e
> --- /dev/null
> +++ b/arch/arm/mach-kirkwood/board-readynas.c
> @@ -0,0 +1,30 @@
> +/*
> + * NETGEAR ReadyNAS Duo v2 Board setup for drivers not already
> + * converted to DT.
> + *
> + * Copyright (C) 2013, Arnaud EBALARD <arno@natisbad.org>
> + *
> + * 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.
> + */
> +
> +#include <linux/kernel.h>
> +#include <linux/init.h>
> +#include <linux/platform_device.h>
> +#include <linux/mv643xx_eth.h>
> +#include <linux/delay.h>
> +#include <asm/io.h>
> +#include <mach/kirkwood.h>
> +#include "common.h"

Now that the msleep() has gone, delay.h is probably not needed.  Maybe
also io.h is not needed any more with the regulator DT?

These are all minor issues. The code is good otherwise.

      Thanks
	Andrew

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

* [PATCHv2] ARM: kirkwood: Add support for NETGEAR ReadyNAS Duo v2 using DT
  2013-03-19 21:16     ` Andrew Lunn
@ 2013-03-19 21:50       ` Arnaud Ebalard
  2013-03-19 22:28       ` [PATCHv3] " Arnaud Ebalard
  1 sibling, 0 replies; 15+ messages in thread
From: Arnaud Ebalard @ 2013-03-19 21:50 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

Andrew Lunn <andrew@lunn.ch> writes:

> On Tue, Mar 19, 2013 at 08:58:22PM +0100, Arnaud Ebalard wrote:
>> Hi,
>> 
>> Add support for NETGEAR ReadyNAS Duo v2 (Hardware specs available
>> here: http://natisbad.org/NAS/).
>
> Hi Arnaud
>
> Thats a nice description of the hardware. There is another device
> using the same power supply controller, the USI Topkick. A few of the
> maintainers have these, so there would be the possibility of
> cooperating on a driver. It does not seem that complex a device. The
> topkick also seems to do Wake-on-LAN using this controller. There was
> a patch added recently which may allow this to work, depending on the
> PHY.

Does not come as a surprise. Netgear's 2.6.31.8 kernel contains a lot of
the following:
 
 This kernel which derived from kernel-2.6.31-topkick1281p2 used for
 both Netgear DUOv3 and NV+v4. It is based on kernel 2.6.31.8 and
 Marvell 5.1.3 patch. Specially the USB3.0 driver come from kernel
 2.6.39.

Note: everything in it is marked DUOv3 even though the device is branded
      Duo v2. Don't know why.

>> index 13482ea..511cd7d 100644
>> --- a/arch/arm/configs/kirkwood_defconfig
>> +++ b/arch/arm/configs/kirkwood_defconfig
>> @@ -35,6 +35,7 @@ CONFIG_MACH_NETSPACE_LITE_V2_DT=y
>>  CONFIG_MACH_NETSPACE_MINI_V2_DT=y
>>  CONFIG_MACH_OPENBLOCKS_A6_DT=y
>>  CONFIG_MACH_TOPKICK_DT=y
>> +CONFIG_MACH_READYNAS_DT=y
>>  CONFIG_MACH_TS219=y
>>  CONFIG_MACH_TS41X=y
>>  CONFIG_MACH_DOCKSTAR=y
>
> Keeping with alphabetic ordering, it should be one place higher....

Damned, I saw TS followed by DOCKSTAR and thought the rule did not
apply. Will resend a v3 with corrected ordering ...


>> diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c
>> +
>> +#include <linux/kernel.h>
>> +#include <linux/init.h>
>> +#include <linux/platform_device.h>
>> +#include <linux/mv643xx_eth.h>
>> +#include <linux/delay.h>
>> +#include <asm/io.h>
>> +#include <mach/kirkwood.h>
>> +#include "common.h"
>
> Now that the msleep() has gone, delay.h is probably not needed.  Maybe
> also io.h is not needed any more with the regulator DT?

... and that one too. Good catch.

Thanks,

a+

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

* [PATCHv3] ARM: kirkwood: Add support for NETGEAR ReadyNAS Duo v2 using DT
  2013-03-19 21:16     ` Andrew Lunn
  2013-03-19 21:50       ` Arnaud Ebalard
@ 2013-03-19 22:28       ` Arnaud Ebalard
  2013-03-20 19:42         ` Andrew Lunn
  2013-03-28 18:36         ` Jason Cooper
  1 sibling, 2 replies; 15+ messages in thread
From: Arnaud Ebalard @ 2013-03-19 22:28 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

Add support for NETGEAR ReadyNAS Duo v2 (Hardware specs available
here: http://natisbad.org/NAS/). Almost everything is supported via
provided .dts. A board-readynas.c file is nonetheless required for
device not only converted to DT (Gbit controller).

FWIW, the most noticeable lack regarding hardware support is the fan
controller (GMT G762) for which nothing is currently available
upstream.

Changes since v2:
 - tried and respect alphabetical order where possible in additions
 - removed useless inclusion of io.h and delay.h in board-readynas.c

Changes since v1:
 - More specific compatible string in dts
 - Moved declaration to keep dts Makefile in alphabetical order
 - Removed unneeded mdelay() for USB power on
 - Switched to fixed regulator in .dts for USB power on

Signed-off-by: Arnaud Ebalard <arno@natisbad.org>
Tested-By: Arnaud Ebalard <arno@natisbad.org>
---

A previous version of the patch has been tested against 3.8.3 and the
one below against current arm tree (current head of rmk/for-next).

 arch/arm/boot/dts/Makefile                         |    1 +
 .../boot/dts/kirkwood-netgear_readynas_duo_v2.dts  |  180 ++++++++++++++++++++
 arch/arm/configs/kirkwood_defconfig                |    1 +
 arch/arm/mach-kirkwood/Kconfig                     |    9 +
 arch/arm/mach-kirkwood/Makefile                    |    1 +
 arch/arm/mach-kirkwood/board-dt.c                  |    4 +
 arch/arm/mach-kirkwood/board-readynas.c            |   28 +++
 arch/arm/mach-kirkwood/common.h                    |    6 +
 8 files changed, 230 insertions(+)
 create mode 100644 arch/arm/boot/dts/kirkwood-netgear_readynas_duo_v2.dts
 create mode 100644 arch/arm/mach-kirkwood/board-readynas.c

diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index 9c62558..125211d 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -65,6 +65,7 @@ dtb-$(CONFIG_ARCH_KIRKWOOD) += kirkwood-dns320.dtb \
 	kirkwood-lschlv2.dtb \
 	kirkwood-lsxhl.dtb \
 	kirkwood-mplcec4.dtb \
+	kirkwood-netgear_readynas_duo_v2.dtb \
 	kirkwood-ns2.dtb \
 	kirkwood-ns2lite.dtb \
 	kirkwood-ns2max.dtb \
diff --git a/arch/arm/boot/dts/kirkwood-netgear_readynas_duo_v2.dts b/arch/arm/boot/dts/kirkwood-netgear_readynas_duo_v2.dts
new file mode 100644
index 0000000..3756e5c
--- /dev/null
+++ b/arch/arm/boot/dts/kirkwood-netgear_readynas_duo_v2.dts
@@ -0,0 +1,180 @@
+/dts-v1/;
+
+/include/ "kirkwood.dtsi"
+/include/ "kirkwood-6282.dtsi"
+
+/ {
+	model = "NETGEAR ReadyNAS Duo v2";
+	compatible = "netgear,readynas-duo-v2", "netgear,readynas", "marvell,kirkwood-88f6282", "marvell,kirkwood";
+
+	memory { /* 256 MB */
+		device_type = "memory";
+		reg = <0x00000000 0x10000000>;
+	};
+
+	chosen {
+		bootargs = "console=ttyS0,115200n8 earlyprintk";
+	};
+
+	ocp at f1000000 {
+		pinctrl: pinctrl at 10000 {
+
+			pinctrl-0 = < &pmx_uart0
+				      &pmx_button_power
+				      &pmx_button_backup
+				      &pmx_button_reset
+				      &pmx_led_blue_power
+				      &pmx_led_blue_activity
+				      &pmx_led_blue_disk1
+				      &pmx_led_blue_disk2
+				      &pmx_led_blue_backup >;
+			pinctrl-names = "default";
+
+			pmx_button_power: pmx-button-power {
+				marvell,pins = "mpp47";
+				marvell,function = "gpio";
+			};
+			pmx_button_backup: pmx-button-backup {
+				marvell,pins = "mpp45";
+				marvell,function = "gpio";
+			};
+			pmx_button_reset: pmx-button-reset {
+				marvell,pins = "mpp13";
+				marvell,function = "gpio";
+			};
+			pmx_led_blue_power: pmx-led-blue-power {
+				marvell,pins = "mpp31";
+				marvell,function = "gpio";
+			};
+			pmx_led_blue_activity: pmx-led-blue-activity {
+				marvell,pins = "mpp38";
+				marvell,function = "gpio";
+			};
+			pmx_led_blue_disk1: pmx-led-blue-disk1 {
+				marvell,pins = "mpp23";
+				marvell,function = "gpio";
+			};
+			pmx_led_blue_disk2: pmx-led-blue-disk2 {
+				marvell,pins = "mpp22";
+				marvell,function = "gpio";
+			};
+			pmx_led_blue_backup: pmx-led-blue-backup {
+				marvell,pins = "mpp29";
+				marvell,function = "gpio";
+			};
+		};
+
+		i2c at 11000 {
+			status = "okay";
+
+			rs5c372a: rs5c372a at 32 {
+				compatible = "ricoh,rs5c372a";
+				reg = <0x32>;
+			};
+		};
+
+		serial at 12000 {
+			status = "okay";
+		};
+
+		nand at 3000000 {
+			status = "okay";
+
+			partition at 0 {
+				label = "u-boot";
+				reg = <0x0000000 0x180000>;
+				read-only;
+			};
+
+			partition at 180000 {
+				label = "u-boot-env";
+				reg = <0x180000 0x20000>;
+			};
+
+			partition at 200000 {
+				label = "uImage";
+				reg = <0x0200000 0x600000>;
+			};
+
+			partition at 800000 {
+				label = "minirootfs";
+				reg = <0x0800000 0x1000000>;
+			};
+
+			partition at 1800000 {
+				label = "jffs2";
+				reg = <0x1800000 0x6800000>;
+			};
+		};
+
+		sata at 80000 {
+			status = "okay";
+			nr-ports = <2>;
+		};
+	};
+
+	gpio-leds {
+		compatible = "gpio-leds";
+
+		power_led {
+			label = "status:blue:power_led";
+			gpios = <&gpio0 31 1>;   /* GPIO 31 Active Low */
+			linux,default-trigger = "default-on";
+		};
+		activity_led {
+			label = "status:blue:activity_led";
+			gpios = <&gpio1 6 1>;    /* GPIO 38 Active Low */
+		};
+		disk1_led {
+			label = "status:blue:disk1_led";
+			gpios = <&gpio0 23 1>;   /* GPIO 23 Active Low */
+		};
+		disk2_led {
+			label = "status:blue:disk2_led";
+			gpios = <&gpio0 22 1>;   /* GPIO 22 Active Low */
+		};
+		backup_led {
+			label = "status:blue:backup_led";
+			gpios = <&gpio0 29 1>;   /* GPIO 29 Active Low*/
+		};
+	};
+
+	gpio_keys {
+		compatible = "gpio-keys";
+		#address-cells = <1>;
+		#size-cells = <0>;
+		button at 1 {
+			label = "Power Button";
+			linux,code = <116>;     /* KEY_POWER */
+			gpios = <&gpio1 15 1>;
+		};
+		button at 2 {
+			label = "Reset Button";
+			linux,code = <0x198>;   /* KEY_RESTART */
+			gpios = <&gpio0 13 1>;
+		};
+		button at 3 {
+			label = "Backup Button";
+			linux,code = <133>;     /* KEY_COPY */
+			gpios = <&gpio1 13 1>;
+		};
+	};
+
+        regulators {
+                compatible = "simple-bus";
+                #address-cells = <1>;
+                #size-cells = <0>;
+
+                usb_power: regulator at 1 {
+                        compatible = "regulator-fixed";
+                        reg = <1>;
+                        regulator-name = "USB 3.0 Power";
+                        regulator-min-microvolt = <5000000>;
+                        regulator-max-microvolt = <5000000>;
+                        enable-active-high;
+                        regulator-always-on;
+                        regulator-boot-on;
+                        gpio = <&gpio1 14 0>;
+                };
+        };
+};
diff --git a/arch/arm/configs/kirkwood_defconfig b/arch/arm/configs/kirkwood_defconfig
index 13482ea..9eb9f48 100644
--- a/arch/arm/configs/kirkwood_defconfig
+++ b/arch/arm/configs/kirkwood_defconfig
@@ -34,6 +34,7 @@ CONFIG_MACH_NETSPACE_MAX_V2_DT=y
 CONFIG_MACH_NETSPACE_LITE_V2_DT=y
 CONFIG_MACH_NETSPACE_MINI_V2_DT=y
 CONFIG_MACH_OPENBLOCKS_A6_DT=y
+CONFIG_MACH_READYNAS_DT=y
 CONFIG_MACH_TOPKICK_DT=y
 CONFIG_MACH_TS219=y
 CONFIG_MACH_TS41X=y
diff --git a/arch/arm/mach-kirkwood/Kconfig b/arch/arm/mach-kirkwood/Kconfig
index 7b6a64b..3fd07eb 100644
--- a/arch/arm/mach-kirkwood/Kconfig
+++ b/arch/arm/mach-kirkwood/Kconfig
@@ -194,6 +194,15 @@ config MACH_OPENBLOCKS_A6_DT
 	  Say 'Y' here if you want your kernel to support the
 	  Plat'Home OpenBlocks A6 (Flattened Device Tree).
 
+config MACH_READYNAS_DT
+	bool "NETGEAR ReadyNAS Duo v2 (Flattened Device Tree)"
+	select ARCH_KIRKWOOD_DT
+	select ARM_APPENDED_DTB
+	select ARM_ATAG_DTB_COMPAT
+	help
+	  Say 'Y' here if you want your kernel to support the
+	  NETGEAR ReadyNAS Duo v2 using Fattened Device Tree.
+
 config MACH_TOPKICK_DT
 	bool "USI Topkick (Flattened Device Tree)"
 	select ARCH_KIRKWOOD_DT
diff --git a/arch/arm/mach-kirkwood/Makefile b/arch/arm/mach-kirkwood/Makefile
index 4cc4bee..ff0f3cb 100644
--- a/arch/arm/mach-kirkwood/Makefile
+++ b/arch/arm/mach-kirkwood/Makefile
@@ -39,4 +39,5 @@ obj-$(CONFIG_MACH_NETSPACE_LITE_V2_DT)	+= board-ns2.o
 obj-$(CONFIG_MACH_NETSPACE_MINI_V2_DT)	+= board-ns2.o
 obj-$(CONFIG_MACH_NSA310_DT)		+= board-nsa310.o
 obj-$(CONFIG_MACH_OPENBLOCKS_A6_DT)	+= board-openblocks_a6.o
+obj-$(CONFIG_MACH_READYNAS_DT)		+= board-readynas.o
 obj-$(CONFIG_MACH_TOPKICK_DT)		+= board-usi_topkick.o
diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c
index 2e73e9d..42ade1f 100644
--- a/arch/arm/mach-kirkwood/board-dt.c
+++ b/arch/arm/mach-kirkwood/board-dt.c
@@ -138,6 +138,9 @@ static void __init kirkwood_dt_init(void)
 	if (of_machine_is_compatible("mpl,cec4"))
 		mplcec4_init();
 
+	if (of_machine_is_compatible("netgear,readynas-duo-v2"))
+		netgear_readynas_init();
+
 	if (of_machine_is_compatible("plathome,openblocks-a6"))
 		openblocks_a6_init();
 
@@ -166,6 +169,7 @@ static const char * const kirkwood_dt_board_compat[] = {
 	"lacie,netspace_lite_v2",
 	"lacie,netspace_mini_v2",
 	"mpl,cec4",
+	"netgear,readynas-duo-v2",
 	"plathome,openblocks-a6",
 	"usi,topkick",
 	"zyxel,nsa310",
diff --git a/arch/arm/mach-kirkwood/board-readynas.c b/arch/arm/mach-kirkwood/board-readynas.c
new file mode 100644
index 0000000..fb42c20
--- /dev/null
+++ b/arch/arm/mach-kirkwood/board-readynas.c
@@ -0,0 +1,28 @@
+/*
+ * NETGEAR ReadyNAS Duo v2 Board setup for drivers not already
+ * converted to DT.
+ *
+ * Copyright (C) 2013, Arnaud EBALARD <arno@natisbad.org>
+ *
+ * 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.
+ */
+
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/platform_device.h>
+#include <linux/mv643xx_eth.h>
+#include <mach/kirkwood.h>
+#include "common.h"
+
+static struct mv643xx_eth_platform_data netgear_readynas_ge00_data = {
+	.phy_addr	= MV643XX_ETH_PHY_ADDR(0),
+};
+
+void __init netgear_readynas_init(void)
+{
+	kirkwood_ge00_init(&netgear_readynas_ge00_data);
+	kirkwood_pcie_init(KW_PCIE0);
+}
diff --git a/arch/arm/mach-kirkwood/common.h b/arch/arm/mach-kirkwood/common.h
index 5ed7056..7ee8670 100644
--- a/arch/arm/mach-kirkwood/common.h
+++ b/arch/arm/mach-kirkwood/common.h
@@ -141,6 +141,12 @@ void openblocks_a6_init(void);
 static inline void openblocks_a6_init(void) {};
 #endif
 
+#ifdef CONFIG_MACH_READYNAS_DT
+void netgear_readynas_init(void);
+#else
+static inline void netgear_readynas_init(void) {};
+#endif
+
 #ifdef CONFIG_MACH_TOPKICK_DT
 void usi_topkick_init(void);
 #else
-- 
1.7.10.4

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

* [PATCHv3] ARM: kirkwood: Add support for NETGEAR ReadyNAS Duo v2 using DT
  2013-03-19 22:28       ` [PATCHv3] " Arnaud Ebalard
@ 2013-03-20 19:42         ` Andrew Lunn
  2013-03-28 18:36         ` Jason Cooper
  1 sibling, 0 replies; 15+ messages in thread
From: Andrew Lunn @ 2013-03-20 19:42 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Mar 19, 2013 at 11:28:06PM +0100, Arnaud Ebalard wrote:
> Hi,
> 
> Add support for NETGEAR ReadyNAS Duo v2 (Hardware specs available
> here: http://natisbad.org/NAS/). Almost everything is supported via
> provided .dts. A board-readynas.c file is nonetheless required for
> device not only converted to DT (Gbit controller).
> 
> FWIW, the most noticeable lack regarding hardware support is the fan
> controller (GMT G762) for which nothing is currently available
> upstream.
> 
> Changes since v2:
>  - tried and respect alphabetical order where possible in additions
>  - removed useless inclusion of io.h and delay.h in board-readynas.c
> 
> Changes since v1:
>  - More specific compatible string in dts
>  - Moved declaration to keep dts Makefile in alphabetical order
>  - Removed unneeded mdelay() for USB power on
>  - Switched to fixed regulator in .dts for USB power on
> 
> Signed-off-by: Arnaud Ebalard <arno@natisbad.org>
> Tested-By: Arnaud Ebalard <arno@natisbad.org>
> ---

Looks good

Acked-by: Andrew Lunn <andrew@lunn.ch>

> 
> A previous version of the patch has been tested against 3.8.3 and the
> one below against current arm tree (current head of rmk/for-next).
> 
>  arch/arm/boot/dts/Makefile                         |    1 +
>  .../boot/dts/kirkwood-netgear_readynas_duo_v2.dts  |  180 ++++++++++++++++++++
>  arch/arm/configs/kirkwood_defconfig                |    1 +
>  arch/arm/mach-kirkwood/Kconfig                     |    9 +
>  arch/arm/mach-kirkwood/Makefile                    |    1 +
>  arch/arm/mach-kirkwood/board-dt.c                  |    4 +
>  arch/arm/mach-kirkwood/board-readynas.c            |   28 +++
>  arch/arm/mach-kirkwood/common.h                    |    6 +
>  8 files changed, 230 insertions(+)
>  create mode 100644 arch/arm/boot/dts/kirkwood-netgear_readynas_duo_v2.dts
>  create mode 100644 arch/arm/mach-kirkwood/board-readynas.c
> 
> diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
> index 9c62558..125211d 100644
> --- a/arch/arm/boot/dts/Makefile
> +++ b/arch/arm/boot/dts/Makefile
> @@ -65,6 +65,7 @@ dtb-$(CONFIG_ARCH_KIRKWOOD) += kirkwood-dns320.dtb \
>  	kirkwood-lschlv2.dtb \
>  	kirkwood-lsxhl.dtb \
>  	kirkwood-mplcec4.dtb \
> +	kirkwood-netgear_readynas_duo_v2.dtb \
>  	kirkwood-ns2.dtb \
>  	kirkwood-ns2lite.dtb \
>  	kirkwood-ns2max.dtb \
> diff --git a/arch/arm/boot/dts/kirkwood-netgear_readynas_duo_v2.dts b/arch/arm/boot/dts/kirkwood-netgear_readynas_duo_v2.dts
> new file mode 100644
> index 0000000..3756e5c
> --- /dev/null
> +++ b/arch/arm/boot/dts/kirkwood-netgear_readynas_duo_v2.dts
> @@ -0,0 +1,180 @@
> +/dts-v1/;
> +
> +/include/ "kirkwood.dtsi"
> +/include/ "kirkwood-6282.dtsi"
> +
> +/ {
> +	model = "NETGEAR ReadyNAS Duo v2";
> +	compatible = "netgear,readynas-duo-v2", "netgear,readynas", "marvell,kirkwood-88f6282", "marvell,kirkwood";
> +
> +	memory { /* 256 MB */
> +		device_type = "memory";
> +		reg = <0x00000000 0x10000000>;
> +	};
> +
> +	chosen {
> +		bootargs = "console=ttyS0,115200n8 earlyprintk";
> +	};
> +
> +	ocp at f1000000 {
> +		pinctrl: pinctrl at 10000 {
> +
> +			pinctrl-0 = < &pmx_uart0
> +				      &pmx_button_power
> +				      &pmx_button_backup
> +				      &pmx_button_reset
> +				      &pmx_led_blue_power
> +				      &pmx_led_blue_activity
> +				      &pmx_led_blue_disk1
> +				      &pmx_led_blue_disk2
> +				      &pmx_led_blue_backup >;
> +			pinctrl-names = "default";
> +
> +			pmx_button_power: pmx-button-power {
> +				marvell,pins = "mpp47";
> +				marvell,function = "gpio";
> +			};
> +			pmx_button_backup: pmx-button-backup {
> +				marvell,pins = "mpp45";
> +				marvell,function = "gpio";
> +			};
> +			pmx_button_reset: pmx-button-reset {
> +				marvell,pins = "mpp13";
> +				marvell,function = "gpio";
> +			};
> +			pmx_led_blue_power: pmx-led-blue-power {
> +				marvell,pins = "mpp31";
> +				marvell,function = "gpio";
> +			};
> +			pmx_led_blue_activity: pmx-led-blue-activity {
> +				marvell,pins = "mpp38";
> +				marvell,function = "gpio";
> +			};
> +			pmx_led_blue_disk1: pmx-led-blue-disk1 {
> +				marvell,pins = "mpp23";
> +				marvell,function = "gpio";
> +			};
> +			pmx_led_blue_disk2: pmx-led-blue-disk2 {
> +				marvell,pins = "mpp22";
> +				marvell,function = "gpio";
> +			};
> +			pmx_led_blue_backup: pmx-led-blue-backup {
> +				marvell,pins = "mpp29";
> +				marvell,function = "gpio";
> +			};
> +		};
> +
> +		i2c at 11000 {
> +			status = "okay";
> +
> +			rs5c372a: rs5c372a at 32 {
> +				compatible = "ricoh,rs5c372a";
> +				reg = <0x32>;
> +			};
> +		};
> +
> +		serial at 12000 {
> +			status = "okay";
> +		};
> +
> +		nand at 3000000 {
> +			status = "okay";
> +
> +			partition at 0 {
> +				label = "u-boot";
> +				reg = <0x0000000 0x180000>;
> +				read-only;
> +			};
> +
> +			partition at 180000 {
> +				label = "u-boot-env";
> +				reg = <0x180000 0x20000>;
> +			};
> +
> +			partition at 200000 {
> +				label = "uImage";
> +				reg = <0x0200000 0x600000>;
> +			};
> +
> +			partition at 800000 {
> +				label = "minirootfs";
> +				reg = <0x0800000 0x1000000>;
> +			};
> +
> +			partition at 1800000 {
> +				label = "jffs2";
> +				reg = <0x1800000 0x6800000>;
> +			};
> +		};
> +
> +		sata at 80000 {
> +			status = "okay";
> +			nr-ports = <2>;
> +		};
> +	};
> +
> +	gpio-leds {
> +		compatible = "gpio-leds";
> +
> +		power_led {
> +			label = "status:blue:power_led";
> +			gpios = <&gpio0 31 1>;   /* GPIO 31 Active Low */
> +			linux,default-trigger = "default-on";
> +		};
> +		activity_led {
> +			label = "status:blue:activity_led";
> +			gpios = <&gpio1 6 1>;    /* GPIO 38 Active Low */
> +		};
> +		disk1_led {
> +			label = "status:blue:disk1_led";
> +			gpios = <&gpio0 23 1>;   /* GPIO 23 Active Low */
> +		};
> +		disk2_led {
> +			label = "status:blue:disk2_led";
> +			gpios = <&gpio0 22 1>;   /* GPIO 22 Active Low */
> +		};
> +		backup_led {
> +			label = "status:blue:backup_led";
> +			gpios = <&gpio0 29 1>;   /* GPIO 29 Active Low*/
> +		};
> +	};
> +
> +	gpio_keys {
> +		compatible = "gpio-keys";
> +		#address-cells = <1>;
> +		#size-cells = <0>;
> +		button at 1 {
> +			label = "Power Button";
> +			linux,code = <116>;     /* KEY_POWER */
> +			gpios = <&gpio1 15 1>;
> +		};
> +		button at 2 {
> +			label = "Reset Button";
> +			linux,code = <0x198>;   /* KEY_RESTART */
> +			gpios = <&gpio0 13 1>;
> +		};
> +		button at 3 {
> +			label = "Backup Button";
> +			linux,code = <133>;     /* KEY_COPY */
> +			gpios = <&gpio1 13 1>;
> +		};
> +	};
> +
> +        regulators {
> +                compatible = "simple-bus";
> +                #address-cells = <1>;
> +                #size-cells = <0>;
> +
> +                usb_power: regulator at 1 {
> +                        compatible = "regulator-fixed";
> +                        reg = <1>;
> +                        regulator-name = "USB 3.0 Power";
> +                        regulator-min-microvolt = <5000000>;
> +                        regulator-max-microvolt = <5000000>;
> +                        enable-active-high;
> +                        regulator-always-on;
> +                        regulator-boot-on;
> +                        gpio = <&gpio1 14 0>;
> +                };
> +        };
> +};
> diff --git a/arch/arm/configs/kirkwood_defconfig b/arch/arm/configs/kirkwood_defconfig
> index 13482ea..9eb9f48 100644
> --- a/arch/arm/configs/kirkwood_defconfig
> +++ b/arch/arm/configs/kirkwood_defconfig
> @@ -34,6 +34,7 @@ CONFIG_MACH_NETSPACE_MAX_V2_DT=y
>  CONFIG_MACH_NETSPACE_LITE_V2_DT=y
>  CONFIG_MACH_NETSPACE_MINI_V2_DT=y
>  CONFIG_MACH_OPENBLOCKS_A6_DT=y
> +CONFIG_MACH_READYNAS_DT=y
>  CONFIG_MACH_TOPKICK_DT=y
>  CONFIG_MACH_TS219=y
>  CONFIG_MACH_TS41X=y
> diff --git a/arch/arm/mach-kirkwood/Kconfig b/arch/arm/mach-kirkwood/Kconfig
> index 7b6a64b..3fd07eb 100644
> --- a/arch/arm/mach-kirkwood/Kconfig
> +++ b/arch/arm/mach-kirkwood/Kconfig
> @@ -194,6 +194,15 @@ config MACH_OPENBLOCKS_A6_DT
>  	  Say 'Y' here if you want your kernel to support the
>  	  Plat'Home OpenBlocks A6 (Flattened Device Tree).
>  
> +config MACH_READYNAS_DT
> +	bool "NETGEAR ReadyNAS Duo v2 (Flattened Device Tree)"
> +	select ARCH_KIRKWOOD_DT
> +	select ARM_APPENDED_DTB
> +	select ARM_ATAG_DTB_COMPAT
> +	help
> +	  Say 'Y' here if you want your kernel to support the
> +	  NETGEAR ReadyNAS Duo v2 using Fattened Device Tree.
> +
>  config MACH_TOPKICK_DT
>  	bool "USI Topkick (Flattened Device Tree)"
>  	select ARCH_KIRKWOOD_DT
> diff --git a/arch/arm/mach-kirkwood/Makefile b/arch/arm/mach-kirkwood/Makefile
> index 4cc4bee..ff0f3cb 100644
> --- a/arch/arm/mach-kirkwood/Makefile
> +++ b/arch/arm/mach-kirkwood/Makefile
> @@ -39,4 +39,5 @@ obj-$(CONFIG_MACH_NETSPACE_LITE_V2_DT)	+= board-ns2.o
>  obj-$(CONFIG_MACH_NETSPACE_MINI_V2_DT)	+= board-ns2.o
>  obj-$(CONFIG_MACH_NSA310_DT)		+= board-nsa310.o
>  obj-$(CONFIG_MACH_OPENBLOCKS_A6_DT)	+= board-openblocks_a6.o
> +obj-$(CONFIG_MACH_READYNAS_DT)		+= board-readynas.o
>  obj-$(CONFIG_MACH_TOPKICK_DT)		+= board-usi_topkick.o
> diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c
> index 2e73e9d..42ade1f 100644
> --- a/arch/arm/mach-kirkwood/board-dt.c
> +++ b/arch/arm/mach-kirkwood/board-dt.c
> @@ -138,6 +138,9 @@ static void __init kirkwood_dt_init(void)
>  	if (of_machine_is_compatible("mpl,cec4"))
>  		mplcec4_init();
>  
> +	if (of_machine_is_compatible("netgear,readynas-duo-v2"))
> +		netgear_readynas_init();
> +
>  	if (of_machine_is_compatible("plathome,openblocks-a6"))
>  		openblocks_a6_init();
>  
> @@ -166,6 +169,7 @@ static const char * const kirkwood_dt_board_compat[] = {
>  	"lacie,netspace_lite_v2",
>  	"lacie,netspace_mini_v2",
>  	"mpl,cec4",
> +	"netgear,readynas-duo-v2",
>  	"plathome,openblocks-a6",
>  	"usi,topkick",
>  	"zyxel,nsa310",
> diff --git a/arch/arm/mach-kirkwood/board-readynas.c b/arch/arm/mach-kirkwood/board-readynas.c
> new file mode 100644
> index 0000000..fb42c20
> --- /dev/null
> +++ b/arch/arm/mach-kirkwood/board-readynas.c
> @@ -0,0 +1,28 @@
> +/*
> + * NETGEAR ReadyNAS Duo v2 Board setup for drivers not already
> + * converted to DT.
> + *
> + * Copyright (C) 2013, Arnaud EBALARD <arno@natisbad.org>
> + *
> + * 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.
> + */
> +
> +#include <linux/kernel.h>
> +#include <linux/init.h>
> +#include <linux/platform_device.h>
> +#include <linux/mv643xx_eth.h>
> +#include <mach/kirkwood.h>
> +#include "common.h"
> +
> +static struct mv643xx_eth_platform_data netgear_readynas_ge00_data = {
> +	.phy_addr	= MV643XX_ETH_PHY_ADDR(0),
> +};
> +
> +void __init netgear_readynas_init(void)
> +{
> +	kirkwood_ge00_init(&netgear_readynas_ge00_data);
> +	kirkwood_pcie_init(KW_PCIE0);
> +}
> diff --git a/arch/arm/mach-kirkwood/common.h b/arch/arm/mach-kirkwood/common.h
> index 5ed7056..7ee8670 100644
> --- a/arch/arm/mach-kirkwood/common.h
> +++ b/arch/arm/mach-kirkwood/common.h
> @@ -141,6 +141,12 @@ void openblocks_a6_init(void);
>  static inline void openblocks_a6_init(void) {};
>  #endif
>  
> +#ifdef CONFIG_MACH_READYNAS_DT
> +void netgear_readynas_init(void);
> +#else
> +static inline void netgear_readynas_init(void) {};
> +#endif
> +
>  #ifdef CONFIG_MACH_TOPKICK_DT
>  void usi_topkick_init(void);
>  #else
> -- 
> 1.7.10.4
> 

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

* [PATCHv3] ARM: kirkwood: Add support for NETGEAR ReadyNAS Duo v2 using DT
  2013-03-19 22:28       ` [PATCHv3] " Arnaud Ebalard
  2013-03-20 19:42         ` Andrew Lunn
@ 2013-03-28 18:36         ` Jason Cooper
  2013-03-28 20:08           ` Arnaud Ebalard
  1 sibling, 1 reply; 15+ messages in thread
From: Jason Cooper @ 2013-03-28 18:36 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Mar 19, 2013 at 11:28:06PM +0100, Arnaud Ebalard wrote:
> Hi,
> 
> Add support for NETGEAR ReadyNAS Duo v2 (Hardware specs available
> here: http://natisbad.org/NAS/). Almost everything is supported via
> provided .dts. A board-readynas.c file is nonetheless required for
> device not only converted to DT (Gbit controller).
> 
> FWIW, the most noticeable lack regarding hardware support is the fan
> controller (GMT G762) for which nothing is currently available
> upstream.
> 
> Changes since v2:
>  - tried and respect alphabetical order where possible in additions
>  - removed useless inclusion of io.h and delay.h in board-readynas.c
> 
> Changes since v1:
>  - More specific compatible string in dts
>  - Moved declaration to keep dts Makefile in alphabetical order
>  - Removed unneeded mdelay() for USB power on
>  - Switched to fixed regulator in .dts for USB power on
> 
> Signed-off-by: Arnaud Ebalard <arno@natisbad.org>
> Tested-By: Arnaud Ebalard <arno@natisbad.org>
> ---

[1] see below.

> 
> A previous version of the patch has been tested against 3.8.3 and the
> one below against current arm tree (current head of rmk/for-next).
> 
>  arch/arm/boot/dts/Makefile                         |    1 +
>  .../boot/dts/kirkwood-netgear_readynas_duo_v2.dts  |  180 ++++++++++++++++++++
>  arch/arm/configs/kirkwood_defconfig                |    1 +
>  arch/arm/mach-kirkwood/Kconfig                     |    9 +
>  arch/arm/mach-kirkwood/Makefile                    |    1 +
>  arch/arm/mach-kirkwood/board-dt.c                  |    4 +
>  arch/arm/mach-kirkwood/board-readynas.c            |   28 +++
>  arch/arm/mach-kirkwood/common.h                    |    6 +
>  8 files changed, 230 insertions(+)
>  create mode 100644 arch/arm/boot/dts/kirkwood-netgear_readynas_duo_v2.dts
>  create mode 100644 arch/arm/mach-kirkwood/board-readynas.c

Applied to mvebu/boards

Edited the commit message to remove conversational text and changelog.
In the future, please place these here [1].  Other than that, great
first patch, thanks!

thx,

Jason.

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

* [PATCHv3] ARM: kirkwood: Add support for NETGEAR ReadyNAS Duo v2 using DT
  2013-03-28 18:36         ` Jason Cooper
@ 2013-03-28 20:08           ` Arnaud Ebalard
  0 siblings, 0 replies; 15+ messages in thread
From: Arnaud Ebalard @ 2013-03-28 20:08 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

Jason Cooper <jason@lakedaemon.net> writes:

> Edited the commit message to remove conversational text and changelog.
> In the future, please place these here [1].

Understood. Thanks.

Cheers,

a+

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

end of thread, other threads:[~2013-03-28 20:08 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-17 20:31 [PATCH] ARM: kirkwood: Add support for NETGEAR ReadyNAS Duo v2 using DT Arnaud Ebalard
2013-03-17 20:40 ` Jason Cooper
2013-03-17 20:50 ` Andrew Lunn
2013-03-17 21:23   ` Arnaud Ebalard
2013-03-18 23:10   ` Arnaud Ebalard
2013-03-18 23:44     ` Jason Cooper
2013-03-19  6:07     ` Andrew Lunn
2013-03-19  6:59       ` Arnaud Ebalard
2013-03-19 19:58   ` [PATCHv2] " Arnaud Ebalard
2013-03-19 21:16     ` Andrew Lunn
2013-03-19 21:50       ` Arnaud Ebalard
2013-03-19 22:28       ` [PATCHv3] " Arnaud Ebalard
2013-03-20 19:42         ` Andrew Lunn
2013-03-28 18:36         ` Jason Cooper
2013-03-28 20:08           ` Arnaud Ebalard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).