All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCHv2] ARM: mvebu: Add Netgear ReadyNAS 2120 board
@ 2013-11-11 20:01 ` Arnaud Ebalard
  0 siblings, 0 replies; 20+ messages in thread
From: Arnaud Ebalard @ 2013-11-11 20:01 UTC (permalink / raw)
  To: Jason Cooper, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Ezequiel Garcia, Thomas Petazzoni
  Cc: Mark Rutland, devicetree, Russell King, Pawel Moll,
	Stephen Warren, Ian Campbell, Rob Herring, Guenter Roeck,
	linux-arm-kernel


All hardware parts of the (mv78230 Armada XP based) NETGEAR ReadyNAS
2120 are supported by mainline kernel (USB 3.0 and eSATA rear ports,
USB 2.0 front port, Gigabit controller and PHYs for the two rear ports,
serial port, LEDs, Buttons, 88SE9170 SATA controllers, three G762 fan
controllers, G751 temperature sensor) except for:

 - the Intersil ISL12057 I2C RTC Chip,
 - the Armada NAND controller.

Support for both of those is currently work in progress and does not
prevent boot.

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

Initial message:

 This one is intended for v3.14. This depends on the recent fix I pushed
 for mv78230 PCIe and also on a small patch Guenter Roeck just accepted
 to have lm75 driver support GMT G751 Temperature sensor (see 
 https://lkml.org/lkml/2013/11/9/273).
 
 Regarding the SATA presence and power pin definitions under pinctrl
 node if you wonder, I thought it would not harm to have them for
 reference even though they are currently not used. FWIW, I am currently
 looking if a GPIO regulator can make any use of those.

Changes since v1:

 After Andrew's comment:
  - Added comment about G751 function

 After Sebastian's comments:
  - Changed clock frequency for a clock provider for serial line
  - Added compatible string for PHY (marvell,mv88e1318s)
  - Removed useless properties in clocks and gpio_keys nodes
  - Made G762 clock node name unique by including g762 in it
  - Changed values for macros for GPIO voltage level
  - Removed comments after GPIOs
  - Changed buttons and button pins names

 After Jason's comment:
  - Changed values for macros for input keys, removed comments

 After more documenation reading:
  - changed i2c compatible string to marvell,mv78230-i2c

Comments welcome,

Cheers,

a+

 arch/arm/boot/dts/Makefile                     |   1 +
 arch/arm/boot/dts/armada-xp-netgear-rn2120.dts | 288 +++++++++++++++++++++++++
 2 files changed, 289 insertions(+)
 create mode 100644 arch/arm/boot/dts/armada-xp-netgear-rn2120.dts

diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index 802720e..c6dd4de 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -112,6 +112,7 @@ dtb-$(CONFIG_ARCH_MVEBU) += armada-370-db.dtb \
 	armada-xp-axpwifiap.dtb \
 	armada-xp-db.dtb \
 	armada-xp-gp.dtb \
+	armada-xp-netgear-rn2120.dtb \
 	armada-xp-openblocks-ax3-4.dtb
 dtb-$(CONFIG_ARCH_MXC) += \
 	imx25-karo-tx25.dtb \
diff --git a/arch/arm/boot/dts/armada-xp-netgear-rn2120.dts b/arch/arm/boot/dts/armada-xp-netgear-rn2120.dts
new file mode 100644
index 0000000..ba1e0de
--- /dev/null
+++ b/arch/arm/boot/dts/armada-xp-netgear-rn2120.dts
@@ -0,0 +1,288 @@
+/*
+ * Device Tree file for NETGEAR ReadyNAS 2120
+ *
+ * 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.
+ */
+
+/dts-v1/;
+
+#include "armada-xp-mv78230.dtsi"
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+
+/ {
+	model = "NETGEAR ReadyNAS 2120";
+	compatible = "netgear,readynas-2120", "marvell,armadaxp-mv78230", "marvell,armadaxp", "marvell,armada-370-xp";
+
+	chosen {
+		bootargs = "console=ttyS0,115200 earlyprintk";
+	};
+
+	memory {
+		device_type = "memory";
+		reg = <0 0x00000000 0 0x80000000>; /* 2GB */
+	};
+
+	soc {
+		ranges = <MBUS_ID(0xf0, 0x01) 0 0 0xd0000000 0x100000
+			  MBUS_ID(0x01, 0x1d) 0 0 0xfff00000 0x100000>;
+
+		pcie-controller {
+			status = "okay";
+
+			/* Connected to first Marvell 88SE9170 SATA controller */
+			pcie@1,0 {
+				/* Port 0, Lane 0 */
+				status = "okay";
+			};
+
+			/* Connected to second Marvell 88SE9170 SATA controller */
+			pcie@2,0 {
+				/* Port 0, Lane 1 */
+				status = "okay";
+			};
+
+			/* Connected to Fresco Logic FL1009 USB 3.0 controller */
+			pcie@5,0 {
+				/* Port 1, Lane 0 */
+				status = "okay";
+			};
+		};
+
+		internal-regs {
+			pinctrl {
+				poweroff: poweroff {
+					marvell,pins = "mpp42";
+					marvell,function = "gpio";
+				};
+
+				power_button_pin: power-button-pin {
+					marvell,pins = "mpp27";
+					marvell,function = "gpio";
+				};
+
+				reset_button_pin: reset-button-pin {
+					marvell,pins = "mpp41";
+					marvell,function = "gpio";
+				};
+
+				sata1_led_pin: sata1-led-pin {
+					marvell,pins = "mpp31";
+					marvell,function = "gpio";
+				};
+
+				sata2_led_pin: sata2-led-pin {
+					marvell,pins = "mpp40";
+					marvell,function = "gpio";
+				};
+
+				sata3_led_pin: sata3-led-pin {
+					marvell,pins = "mpp44";
+					marvell,function = "gpio";
+				};
+
+				sata4_led_pin: sata4-led-pin {
+					marvell,pins = "mpp47";
+					marvell,function = "gpio";
+				};
+
+				sata1_power_pin: sata1-power-pin {
+					marvell,pins = "mpp24";
+					marvell,function = "gpio";
+				};
+
+				sata2_power_pin: sata2-power-pin {
+					marvell,pins = "mpp25";
+					marvell,function = "gpio";
+				};
+
+				sata3_power_pin: sata3-power-pin {
+					marvell,pins = "mpp26";
+					marvell,function = "gpio";
+				};
+
+				sata4_power_pin: sata4-power-pin {
+					marvell,pins = "mpp28";
+					marvell,function = "gpio";
+				};
+
+				sata1_pres_pin: sata1-pres-pin {
+					marvell,pins = "mpp32";
+					marvell,function = "gpio";
+				};
+
+				sata2_pres_pin: sata2-pres-pin {
+					marvell,pins = "mpp33";
+					marvell,function = "gpio";
+				};
+
+				sata3_pres_pin: sata3-pres-pin {
+					marvell,pins = "mpp34";
+					marvell,function = "gpio";
+				};
+
+				sata4_pres_pin: sata4-pres-pin {
+					marvell,pins = "mpp35";
+					marvell,function = "gpio";
+				};
+
+				err_led_pin: err-led-pin {
+					marvell,pins = "mpp45";
+					marvell,function = "gpio";
+				};
+			};
+
+			serial@12000 {
+				clocks = <&coreclk 0>;
+				status = "okay";
+			};
+
+			mdio {
+				phy0: ethernet-phy@0 {
+					compatible = "marvell,88e1318s";
+					reg = <0>;
+				};
+
+				phy1: ethernet-phy@1 {
+					compatible = "marvell,88e1318s";
+					reg = <1>;
+				};
+			};
+
+			ethernet@70000 {
+				status = "okay";
+				phy = <&phy0>;
+				phy-mode = "rgmii-id";
+			};
+
+			ethernet@74000 {
+				status = "okay";
+				phy = <&phy1>;
+				phy-mode = "rgmii-id";
+			};
+
+			/* Front USB 2.0 port */
+			usb@50000 {
+				status = "okay";
+			};
+
+			i2c@11000 {
+				compatible = "marvell,mv78230-i2c";
+				clock-frequency = <400000>;
+				status = "okay";
+
+				/* Controller for rear fan #1 of 3 (Protechnic
+				 * MGT4012XB-O20, 8000RPM) near eSATA port */
+				g762_fan1: g762@3e {
+					compatible = "gmt,g762";
+					reg = <0x3e>;
+					clocks = <&g762_clk>; /* input clock */
+					fan_gear_mode = <0>;
+					fan_startv = <1>;
+					pwm_polarity = <0>;
+				};
+
+				/*  Controller for rear (center) fan #2 of 3 */
+				g762_fan2: g762@48 {
+					compatible = "gmt,g762";
+					reg = <0x48>;
+					clocks = <&g762_clk>; /* input clock */
+					fan_gear_mode = <0>;
+					fan_startv = <1>;
+					pwm_polarity = <0>;
+				};
+
+				/*  Controller for rear fan #3 of 3 */
+				g762_fan3: g762@49 {
+					compatible = "gmt,g762";
+					reg = <0x49>;
+					clocks = <&g762_clk>; /* input clock */
+					fan_gear_mode = <0>;
+					fan_startv = <1>;
+					pwm_polarity = <0>;
+				};
+
+				/* Temperature sensor */
+				g751: g751@4c {
+					compatible = "gmt,g751";
+					reg = <0x4c>;
+				};
+			};
+		};
+	};
+
+	clocks {
+	       g762_clk: g762_oscillator {
+			 compatible = "fixed-clock";
+			 #clock-cells = <0>;
+			 clock-frequency = <32768>;
+	       };
+	};
+
+	gpio_leds {
+		compatible = "gpio-leds";
+		pinctrl-0 = <&sata1_led_pin &sata2_led_pin &err_led_pin
+			     &sata3_led_pin &sata4_led_pin>;
+		pinctrl-names = "default";
+
+		red_sata1_led {
+			label = "rn2120:red:sata1";
+			gpios = <&gpio0 31 GPIO_ACTIVE_HIGH>;
+			default-state = "off";
+		};
+
+		red_sata2_led {
+			label = "rn2120:red:sata2";
+			gpios = <&gpio1 8 GPIO_ACTIVE_HIGH>;
+			default-state = "off";
+		};
+
+		red_sata3_led {
+			label = "rn2120:red:sata3";
+			gpios = <&gpio1 12 GPIO_ACTIVE_HIGH>;
+			default-state = "off";
+		};
+
+		red_sata4_led {
+			label = "rn2120:red:sata4";
+			gpios = <&gpio1 15 GPIO_ACTIVE_HIGH>;
+			default-state = "off";
+		};
+
+		red_err_led {
+			label = "rn2120:red:err";
+			gpios = <&gpio1 13 GPIO_ACTIVE_LOW>;
+			default-state = "off";
+		};
+	};
+
+	gpio_keys {
+		compatible = "gpio-keys";
+		pinctrl-0 = <&power_button_pin &reset_button_pin>;
+		pinctrl-names = "default";
+
+		power_button {
+			label = "Power Button";
+			linux,code = <KEY_POWER>;
+			gpios = <&gpio0 27 GPIO_ACTIVE_HIGH>;
+		};
+
+		reset_button {
+			label = "Reset Button";
+			linux,code = <KEY_RESTART>;
+			gpios = <&gpio1 9 GPIO_ACTIVE_LOW>;
+		};
+	};
+
+	gpio_poweroff {
+		compatible = "gpio-poweroff";
+		pinctrl-0 = <&poweroff>;
+		pinctrl-names = "default";
+		gpios = <&gpio1 10 GPIO_ACTIVE_LOW>;
+	};
+};
-- 
1.8.4.rc3

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

* [PATCHv2] ARM: mvebu: Add Netgear ReadyNAS 2120 board
@ 2013-11-11 20:01 ` Arnaud Ebalard
  0 siblings, 0 replies; 20+ messages in thread
From: Arnaud Ebalard @ 2013-11-11 20:01 UTC (permalink / raw)
  To: linux-arm-kernel


All hardware parts of the (mv78230 Armada XP based) NETGEAR ReadyNAS
2120 are supported by mainline kernel (USB 3.0 and eSATA rear ports,
USB 2.0 front port, Gigabit controller and PHYs for the two rear ports,
serial port, LEDs, Buttons, 88SE9170 SATA controllers, three G762 fan
controllers, G751 temperature sensor) except for:

 - the Intersil ISL12057 I2C RTC Chip,
 - the Armada NAND controller.

Support for both of those is currently work in progress and does not
prevent boot.

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

Initial message:

 This one is intended for v3.14. This depends on the recent fix I pushed
 for mv78230 PCIe and also on a small patch Guenter Roeck just accepted
 to have lm75 driver support GMT G751 Temperature sensor (see 
 https://lkml.org/lkml/2013/11/9/273).
 
 Regarding the SATA presence and power pin definitions under pinctrl
 node if you wonder, I thought it would not harm to have them for
 reference even though they are currently not used. FWIW, I am currently
 looking if a GPIO regulator can make any use of those.

Changes since v1:

 After Andrew's comment:
  - Added comment about G751 function

 After Sebastian's comments:
  - Changed clock frequency for a clock provider for serial line
  - Added compatible string for PHY (marvell,mv88e1318s)
  - Removed useless properties in clocks and gpio_keys nodes
  - Made G762 clock node name unique by including g762 in it
  - Changed values for macros for GPIO voltage level
  - Removed comments after GPIOs
  - Changed buttons and button pins names

 After Jason's comment:
  - Changed values for macros for input keys, removed comments

 After more documenation reading:
  - changed i2c compatible string to marvell,mv78230-i2c

Comments welcome,

Cheers,

a+

 arch/arm/boot/dts/Makefile                     |   1 +
 arch/arm/boot/dts/armada-xp-netgear-rn2120.dts | 288 +++++++++++++++++++++++++
 2 files changed, 289 insertions(+)
 create mode 100644 arch/arm/boot/dts/armada-xp-netgear-rn2120.dts

diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index 802720e..c6dd4de 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -112,6 +112,7 @@ dtb-$(CONFIG_ARCH_MVEBU) += armada-370-db.dtb \
 	armada-xp-axpwifiap.dtb \
 	armada-xp-db.dtb \
 	armada-xp-gp.dtb \
+	armada-xp-netgear-rn2120.dtb \
 	armada-xp-openblocks-ax3-4.dtb
 dtb-$(CONFIG_ARCH_MXC) += \
 	imx25-karo-tx25.dtb \
diff --git a/arch/arm/boot/dts/armada-xp-netgear-rn2120.dts b/arch/arm/boot/dts/armada-xp-netgear-rn2120.dts
new file mode 100644
index 0000000..ba1e0de
--- /dev/null
+++ b/arch/arm/boot/dts/armada-xp-netgear-rn2120.dts
@@ -0,0 +1,288 @@
+/*
+ * Device Tree file for NETGEAR ReadyNAS 2120
+ *
+ * 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.
+ */
+
+/dts-v1/;
+
+#include "armada-xp-mv78230.dtsi"
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+
+/ {
+	model = "NETGEAR ReadyNAS 2120";
+	compatible = "netgear,readynas-2120", "marvell,armadaxp-mv78230", "marvell,armadaxp", "marvell,armada-370-xp";
+
+	chosen {
+		bootargs = "console=ttyS0,115200 earlyprintk";
+	};
+
+	memory {
+		device_type = "memory";
+		reg = <0 0x00000000 0 0x80000000>; /* 2GB */
+	};
+
+	soc {
+		ranges = <MBUS_ID(0xf0, 0x01) 0 0 0xd0000000 0x100000
+			  MBUS_ID(0x01, 0x1d) 0 0 0xfff00000 0x100000>;
+
+		pcie-controller {
+			status = "okay";
+
+			/* Connected to first Marvell 88SE9170 SATA controller */
+			pcie at 1,0 {
+				/* Port 0, Lane 0 */
+				status = "okay";
+			};
+
+			/* Connected to second Marvell 88SE9170 SATA controller */
+			pcie at 2,0 {
+				/* Port 0, Lane 1 */
+				status = "okay";
+			};
+
+			/* Connected to Fresco Logic FL1009 USB 3.0 controller */
+			pcie at 5,0 {
+				/* Port 1, Lane 0 */
+				status = "okay";
+			};
+		};
+
+		internal-regs {
+			pinctrl {
+				poweroff: poweroff {
+					marvell,pins = "mpp42";
+					marvell,function = "gpio";
+				};
+
+				power_button_pin: power-button-pin {
+					marvell,pins = "mpp27";
+					marvell,function = "gpio";
+				};
+
+				reset_button_pin: reset-button-pin {
+					marvell,pins = "mpp41";
+					marvell,function = "gpio";
+				};
+
+				sata1_led_pin: sata1-led-pin {
+					marvell,pins = "mpp31";
+					marvell,function = "gpio";
+				};
+
+				sata2_led_pin: sata2-led-pin {
+					marvell,pins = "mpp40";
+					marvell,function = "gpio";
+				};
+
+				sata3_led_pin: sata3-led-pin {
+					marvell,pins = "mpp44";
+					marvell,function = "gpio";
+				};
+
+				sata4_led_pin: sata4-led-pin {
+					marvell,pins = "mpp47";
+					marvell,function = "gpio";
+				};
+
+				sata1_power_pin: sata1-power-pin {
+					marvell,pins = "mpp24";
+					marvell,function = "gpio";
+				};
+
+				sata2_power_pin: sata2-power-pin {
+					marvell,pins = "mpp25";
+					marvell,function = "gpio";
+				};
+
+				sata3_power_pin: sata3-power-pin {
+					marvell,pins = "mpp26";
+					marvell,function = "gpio";
+				};
+
+				sata4_power_pin: sata4-power-pin {
+					marvell,pins = "mpp28";
+					marvell,function = "gpio";
+				};
+
+				sata1_pres_pin: sata1-pres-pin {
+					marvell,pins = "mpp32";
+					marvell,function = "gpio";
+				};
+
+				sata2_pres_pin: sata2-pres-pin {
+					marvell,pins = "mpp33";
+					marvell,function = "gpio";
+				};
+
+				sata3_pres_pin: sata3-pres-pin {
+					marvell,pins = "mpp34";
+					marvell,function = "gpio";
+				};
+
+				sata4_pres_pin: sata4-pres-pin {
+					marvell,pins = "mpp35";
+					marvell,function = "gpio";
+				};
+
+				err_led_pin: err-led-pin {
+					marvell,pins = "mpp45";
+					marvell,function = "gpio";
+				};
+			};
+
+			serial at 12000 {
+				clocks = <&coreclk 0>;
+				status = "okay";
+			};
+
+			mdio {
+				phy0: ethernet-phy at 0 {
+					compatible = "marvell,88e1318s";
+					reg = <0>;
+				};
+
+				phy1: ethernet-phy at 1 {
+					compatible = "marvell,88e1318s";
+					reg = <1>;
+				};
+			};
+
+			ethernet at 70000 {
+				status = "okay";
+				phy = <&phy0>;
+				phy-mode = "rgmii-id";
+			};
+
+			ethernet at 74000 {
+				status = "okay";
+				phy = <&phy1>;
+				phy-mode = "rgmii-id";
+			};
+
+			/* Front USB 2.0 port */
+			usb at 50000 {
+				status = "okay";
+			};
+
+			i2c at 11000 {
+				compatible = "marvell,mv78230-i2c";
+				clock-frequency = <400000>;
+				status = "okay";
+
+				/* Controller for rear fan #1 of 3 (Protechnic
+				 * MGT4012XB-O20, 8000RPM) near eSATA port */
+				g762_fan1: g762 at 3e {
+					compatible = "gmt,g762";
+					reg = <0x3e>;
+					clocks = <&g762_clk>; /* input clock */
+					fan_gear_mode = <0>;
+					fan_startv = <1>;
+					pwm_polarity = <0>;
+				};
+
+				/*  Controller for rear (center) fan #2 of 3 */
+				g762_fan2: g762 at 48 {
+					compatible = "gmt,g762";
+					reg = <0x48>;
+					clocks = <&g762_clk>; /* input clock */
+					fan_gear_mode = <0>;
+					fan_startv = <1>;
+					pwm_polarity = <0>;
+				};
+
+				/*  Controller for rear fan #3 of 3 */
+				g762_fan3: g762 at 49 {
+					compatible = "gmt,g762";
+					reg = <0x49>;
+					clocks = <&g762_clk>; /* input clock */
+					fan_gear_mode = <0>;
+					fan_startv = <1>;
+					pwm_polarity = <0>;
+				};
+
+				/* Temperature sensor */
+				g751: g751 at 4c {
+					compatible = "gmt,g751";
+					reg = <0x4c>;
+				};
+			};
+		};
+	};
+
+	clocks {
+	       g762_clk: g762_oscillator {
+			 compatible = "fixed-clock";
+			 #clock-cells = <0>;
+			 clock-frequency = <32768>;
+	       };
+	};
+
+	gpio_leds {
+		compatible = "gpio-leds";
+		pinctrl-0 = <&sata1_led_pin &sata2_led_pin &err_led_pin
+			     &sata3_led_pin &sata4_led_pin>;
+		pinctrl-names = "default";
+
+		red_sata1_led {
+			label = "rn2120:red:sata1";
+			gpios = <&gpio0 31 GPIO_ACTIVE_HIGH>;
+			default-state = "off";
+		};
+
+		red_sata2_led {
+			label = "rn2120:red:sata2";
+			gpios = <&gpio1 8 GPIO_ACTIVE_HIGH>;
+			default-state = "off";
+		};
+
+		red_sata3_led {
+			label = "rn2120:red:sata3";
+			gpios = <&gpio1 12 GPIO_ACTIVE_HIGH>;
+			default-state = "off";
+		};
+
+		red_sata4_led {
+			label = "rn2120:red:sata4";
+			gpios = <&gpio1 15 GPIO_ACTIVE_HIGH>;
+			default-state = "off";
+		};
+
+		red_err_led {
+			label = "rn2120:red:err";
+			gpios = <&gpio1 13 GPIO_ACTIVE_LOW>;
+			default-state = "off";
+		};
+	};
+
+	gpio_keys {
+		compatible = "gpio-keys";
+		pinctrl-0 = <&power_button_pin &reset_button_pin>;
+		pinctrl-names = "default";
+
+		power_button {
+			label = "Power Button";
+			linux,code = <KEY_POWER>;
+			gpios = <&gpio0 27 GPIO_ACTIVE_HIGH>;
+		};
+
+		reset_button {
+			label = "Reset Button";
+			linux,code = <KEY_RESTART>;
+			gpios = <&gpio1 9 GPIO_ACTIVE_LOW>;
+		};
+	};
+
+	gpio_poweroff {
+		compatible = "gpio-poweroff";
+		pinctrl-0 = <&poweroff>;
+		pinctrl-names = "default";
+		gpios = <&gpio1 10 GPIO_ACTIVE_LOW>;
+	};
+};
-- 
1.8.4.rc3

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

* Re: [PATCHv2] ARM: mvebu: Add Netgear ReadyNAS 2120 board
  2013-11-11 20:01 ` Arnaud Ebalard
@ 2013-11-11 20:33     ` Sebastian Hesselbarth
  -1 siblings, 0 replies; 20+ messages in thread
From: Sebastian Hesselbarth @ 2013-11-11 20:33 UTC (permalink / raw)
  To: Arnaud Ebalard, Jason Cooper, Andrew Lunn, Gregory Clement,
	Ezequiel Garcia, Thomas Petazzoni
  Cc: Russell King, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	Rob Herring, Pawel Moll, Mark Rutland, Stephen Warren,
	Ian Campbell, devicetree-u79uwXL29TY76Z2rM5mHXA, Guenter Roeck

On 11/11/2013 09:01 PM, Arnaud Ebalard wrote:
> All hardware parts of the (mv78230 Armada XP based) NETGEAR ReadyNAS
> 2120 are supported by mainline kernel (USB 3.0 and eSATA rear ports,
> USB 2.0 front port, Gigabit controller and PHYs for the two rear ports,
> serial port, LEDs, Buttons, 88SE9170 SATA controllers, three G762 fan
> controllers, G751 temperature sensor) except for:
>
>   - the Intersil ISL12057 I2C RTC Chip,
>   - the Armada NAND controller.
>
> Support for both of those is currently work in progress and does not
> prevent boot.
>
> Signed-off-by: Arnaud Ebalard <arno-LkuqDEemtHBg9hUCZPvPmw@public.gmane.org>
> ---
[...]
> diff --git a/arch/arm/boot/dts/armada-xp-netgear-rn2120.dts b/arch/arm/boot/dts/armada-xp-netgear-rn2120.dts
> new file mode 100644
> index 0000000..ba1e0de
> --- /dev/null
> +++ b/arch/arm/boot/dts/armada-xp-netgear-rn2120.dts
> @@ -0,0 +1,288 @@
> +/*
> + * Device Tree file for NETGEAR ReadyNAS 2120
> + *
> + * Copyright (C) 2013, Arnaud EBALARD <arno-LkuqDEemtHBg9hUCZPvPmw@public.gmane.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.
> + */
> +
> +/dts-v1/;
> +
> +#include "armada-xp-mv78230.dtsi"
> +#include <dt-bindings/gpio/gpio.h>
> +#include <dt-bindings/input/input.h>

nit: order includes global before local, i.e. {gpio,input}.h before .dtsi

> +/ {
> +	model = "NETGEAR ReadyNAS 2120";
> +	compatible = "netgear,readynas-2120", "marvell,armadaxp-mv78230", "marvell,armadaxp", "marvell,armada-370-xp";
> +
> +	chosen {
> +		bootargs = "console=ttyS0,115200 earlyprintk";
> +	};
> +
> +	memory {
> +		device_type = "memory";
> +		reg = <0 0x00000000 0 0x80000000>; /* 2GB */
> +	};
> +
[...]
> +			serial@12000 {
> +				clocks = <&coreclk 0>;
> +				status = "okay";
> +			};

For your possible cleanup later: move clocks = <&coreclk 0> to
armada-370-xp.dtsi and remove this then.

Also for cleanup later: It would be great if most SoC nodes get
a node label. That way you can just write:

uart0: { status = "okay" };

without replaying node hierarchy over and over again.

> +			mdio {
> +				phy0: ethernet-phy@0 {
> +					compatible = "marvell,88e1318s";
> +					reg = <0>;
> +				};
> +
> +				phy1: ethernet-phy@1 {
> +					compatible = "marvell,88e1318s";
> +					reg = <1>;
> +				};
> +			};
> +
> +			ethernet@70000 {
> +				status = "okay";
> +				phy = <&phy0>;
> +				phy-mode = "rgmii-id";
> +			};
> +
> +			ethernet@74000 {
> +				status = "okay";
> +				phy = <&phy1>;
> +				phy-mode = "rgmii-id";
> +			};
> +
> +			/* Front USB 2.0 port */
> +			usb@50000 {
> +				status = "okay";
> +			};
> +
> +			i2c@11000 {
> +				compatible = "marvell,mv78230-i2c";
> +				clock-frequency = <400000>;
> +				status = "okay";
> +
> +				/* Controller for rear fan #1 of 3 (Protechnic
> +				 * MGT4012XB-O20, 8000RPM) near eSATA port */
> +				g762_fan1: g762@3e {
> +					compatible = "gmt,g762";
> +					reg = <0x3e>;
> +					clocks = <&g762_clk>; /* input clock */
> +					fan_gear_mode = <0>;
> +					fan_startv = <1>;
> +					pwm_polarity = <0>;

I haven't looked at g762 dt-bindings, but above properties should have
s/_/- and possibly also vendor prefix if device specific,
e.g. gmt,fan-hear-mode. Depends on your g762 binding review.

> +				};
> +
> +				/*  Controller for rear (center) fan #2 of 3 */
> +				g762_fan2: g762@48 {
> +					compatible = "gmt,g762";
> +					reg = <0x48>;
> +					clocks = <&g762_clk>; /* input clock */
> +					fan_gear_mode = <0>;
> +					fan_startv = <1>;
> +					pwm_polarity = <0>;
> +				};
> +
> +				/*  Controller for rear fan #3 of 3 */
> +				g762_fan3: g762@49 {
> +					compatible = "gmt,g762";
> +					reg = <0x49>;
> +					clocks = <&g762_clk>; /* input clock */
> +					fan_gear_mode = <0>;
> +					fan_startv = <1>;
> +					pwm_polarity = <0>;
> +				};
> +
> +				/* Temperature sensor */
> +				g751: g751@4c {
> +					compatible = "gmt,g751";
> +					reg = <0x4c>;
> +				};
> +			};
> +		};
> +	};
> +
> +	clocks {
> +	       g762_clk: g762_oscillator {

While node labels have '_', node names usually have '-'.

> +			 compatible = "fixed-clock";
> +			 #clock-cells = <0>;
> +			 clock-frequency = <32768>;
> +	       };
> +	};
> +
> +	gpio_leds {
> +		compatible = "gpio-leds";
> +		pinctrl-0 = <&sata1_led_pin &sata2_led_pin &err_led_pin
> +			     &sata3_led_pin &sata4_led_pin>;
> +		pinctrl-names = "default";
> +
> +		red_sata1_led {

ditto here and below.

> +			label = "rn2120:red:sata1";
> +			gpios = <&gpio0 31 GPIO_ACTIVE_HIGH>;
> +			default-state = "off";
> +		};
> +
> +		red_sata2_led {
> +			label = "rn2120:red:sata2";
> +			gpios = <&gpio1 8 GPIO_ACTIVE_HIGH>;
> +			default-state = "off";
> +		};
> +
> +		red_sata3_led {
> +			label = "rn2120:red:sata3";
> +			gpios = <&gpio1 12 GPIO_ACTIVE_HIGH>;
> +			default-state = "off";
> +		};
> +
> +		red_sata4_led {
> +			label = "rn2120:red:sata4";
> +			gpios = <&gpio1 15 GPIO_ACTIVE_HIGH>;
> +			default-state = "off";
> +		};
> +
> +		red_err_led {
> +			label = "rn2120:red:err";
> +			gpios = <&gpio1 13 GPIO_ACTIVE_LOW>;
> +			default-state = "off";
> +		};
> +	};
> +
> +	gpio_keys {
> +		compatible = "gpio-keys";
> +		pinctrl-0 = <&power_button_pin &reset_button_pin>;
> +		pinctrl-names = "default";
> +
> +		power_button {

ditto here and below.

> +			label = "Power Button";
> +			linux,code = <KEY_POWER>;
> +			gpios = <&gpio0 27 GPIO_ACTIVE_HIGH>;
> +		};
> +
> +		reset_button {
> +			label = "Reset Button";
> +			linux,code = <KEY_RESTART>;
> +			gpios = <&gpio1 9 GPIO_ACTIVE_LOW>;
> +		};
> +	};
> +
> +	gpio_poweroff {

ditto.

Besides the nits,

Acked-by: Sebastian Hesselbarth <sebastian.hesselbarth-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>

> +		compatible = "gpio-poweroff";
> +		pinctrl-0 = <&poweroff>;
> +		pinctrl-names = "default";
> +		gpios = <&gpio1 10 GPIO_ACTIVE_LOW>;
> +	};
> +};
>

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCHv2] ARM: mvebu: Add Netgear ReadyNAS 2120 board
@ 2013-11-11 20:33     ` Sebastian Hesselbarth
  0 siblings, 0 replies; 20+ messages in thread
From: Sebastian Hesselbarth @ 2013-11-11 20:33 UTC (permalink / raw)
  To: linux-arm-kernel

On 11/11/2013 09:01 PM, Arnaud Ebalard wrote:
> All hardware parts of the (mv78230 Armada XP based) NETGEAR ReadyNAS
> 2120 are supported by mainline kernel (USB 3.0 and eSATA rear ports,
> USB 2.0 front port, Gigabit controller and PHYs for the two rear ports,
> serial port, LEDs, Buttons, 88SE9170 SATA controllers, three G762 fan
> controllers, G751 temperature sensor) except for:
>
>   - the Intersil ISL12057 I2C RTC Chip,
>   - the Armada NAND controller.
>
> Support for both of those is currently work in progress and does not
> prevent boot.
>
> Signed-off-by: Arnaud Ebalard <arno@natisbad.org>
> ---
[...]
> diff --git a/arch/arm/boot/dts/armada-xp-netgear-rn2120.dts b/arch/arm/boot/dts/armada-xp-netgear-rn2120.dts
> new file mode 100644
> index 0000000..ba1e0de
> --- /dev/null
> +++ b/arch/arm/boot/dts/armada-xp-netgear-rn2120.dts
> @@ -0,0 +1,288 @@
> +/*
> + * Device Tree file for NETGEAR ReadyNAS 2120
> + *
> + * 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.
> + */
> +
> +/dts-v1/;
> +
> +#include "armada-xp-mv78230.dtsi"
> +#include <dt-bindings/gpio/gpio.h>
> +#include <dt-bindings/input/input.h>

nit: order includes global before local, i.e. {gpio,input}.h before .dtsi

> +/ {
> +	model = "NETGEAR ReadyNAS 2120";
> +	compatible = "netgear,readynas-2120", "marvell,armadaxp-mv78230", "marvell,armadaxp", "marvell,armada-370-xp";
> +
> +	chosen {
> +		bootargs = "console=ttyS0,115200 earlyprintk";
> +	};
> +
> +	memory {
> +		device_type = "memory";
> +		reg = <0 0x00000000 0 0x80000000>; /* 2GB */
> +	};
> +
[...]
> +			serial at 12000 {
> +				clocks = <&coreclk 0>;
> +				status = "okay";
> +			};

For your possible cleanup later: move clocks = <&coreclk 0> to
armada-370-xp.dtsi and remove this then.

Also for cleanup later: It would be great if most SoC nodes get
a node label. That way you can just write:

uart0: { status = "okay" };

without replaying node hierarchy over and over again.

> +			mdio {
> +				phy0: ethernet-phy at 0 {
> +					compatible = "marvell,88e1318s";
> +					reg = <0>;
> +				};
> +
> +				phy1: ethernet-phy at 1 {
> +					compatible = "marvell,88e1318s";
> +					reg = <1>;
> +				};
> +			};
> +
> +			ethernet at 70000 {
> +				status = "okay";
> +				phy = <&phy0>;
> +				phy-mode = "rgmii-id";
> +			};
> +
> +			ethernet at 74000 {
> +				status = "okay";
> +				phy = <&phy1>;
> +				phy-mode = "rgmii-id";
> +			};
> +
> +			/* Front USB 2.0 port */
> +			usb at 50000 {
> +				status = "okay";
> +			};
> +
> +			i2c at 11000 {
> +				compatible = "marvell,mv78230-i2c";
> +				clock-frequency = <400000>;
> +				status = "okay";
> +
> +				/* Controller for rear fan #1 of 3 (Protechnic
> +				 * MGT4012XB-O20, 8000RPM) near eSATA port */
> +				g762_fan1: g762 at 3e {
> +					compatible = "gmt,g762";
> +					reg = <0x3e>;
> +					clocks = <&g762_clk>; /* input clock */
> +					fan_gear_mode = <0>;
> +					fan_startv = <1>;
> +					pwm_polarity = <0>;

I haven't looked at g762 dt-bindings, but above properties should have
s/_/- and possibly also vendor prefix if device specific,
e.g. gmt,fan-hear-mode. Depends on your g762 binding review.

> +				};
> +
> +				/*  Controller for rear (center) fan #2 of 3 */
> +				g762_fan2: g762 at 48 {
> +					compatible = "gmt,g762";
> +					reg = <0x48>;
> +					clocks = <&g762_clk>; /* input clock */
> +					fan_gear_mode = <0>;
> +					fan_startv = <1>;
> +					pwm_polarity = <0>;
> +				};
> +
> +				/*  Controller for rear fan #3 of 3 */
> +				g762_fan3: g762 at 49 {
> +					compatible = "gmt,g762";
> +					reg = <0x49>;
> +					clocks = <&g762_clk>; /* input clock */
> +					fan_gear_mode = <0>;
> +					fan_startv = <1>;
> +					pwm_polarity = <0>;
> +				};
> +
> +				/* Temperature sensor */
> +				g751: g751 at 4c {
> +					compatible = "gmt,g751";
> +					reg = <0x4c>;
> +				};
> +			};
> +		};
> +	};
> +
> +	clocks {
> +	       g762_clk: g762_oscillator {

While node labels have '_', node names usually have '-'.

> +			 compatible = "fixed-clock";
> +			 #clock-cells = <0>;
> +			 clock-frequency = <32768>;
> +	       };
> +	};
> +
> +	gpio_leds {
> +		compatible = "gpio-leds";
> +		pinctrl-0 = <&sata1_led_pin &sata2_led_pin &err_led_pin
> +			     &sata3_led_pin &sata4_led_pin>;
> +		pinctrl-names = "default";
> +
> +		red_sata1_led {

ditto here and below.

> +			label = "rn2120:red:sata1";
> +			gpios = <&gpio0 31 GPIO_ACTIVE_HIGH>;
> +			default-state = "off";
> +		};
> +
> +		red_sata2_led {
> +			label = "rn2120:red:sata2";
> +			gpios = <&gpio1 8 GPIO_ACTIVE_HIGH>;
> +			default-state = "off";
> +		};
> +
> +		red_sata3_led {
> +			label = "rn2120:red:sata3";
> +			gpios = <&gpio1 12 GPIO_ACTIVE_HIGH>;
> +			default-state = "off";
> +		};
> +
> +		red_sata4_led {
> +			label = "rn2120:red:sata4";
> +			gpios = <&gpio1 15 GPIO_ACTIVE_HIGH>;
> +			default-state = "off";
> +		};
> +
> +		red_err_led {
> +			label = "rn2120:red:err";
> +			gpios = <&gpio1 13 GPIO_ACTIVE_LOW>;
> +			default-state = "off";
> +		};
> +	};
> +
> +	gpio_keys {
> +		compatible = "gpio-keys";
> +		pinctrl-0 = <&power_button_pin &reset_button_pin>;
> +		pinctrl-names = "default";
> +
> +		power_button {

ditto here and below.

> +			label = "Power Button";
> +			linux,code = <KEY_POWER>;
> +			gpios = <&gpio0 27 GPIO_ACTIVE_HIGH>;
> +		};
> +
> +		reset_button {
> +			label = "Reset Button";
> +			linux,code = <KEY_RESTART>;
> +			gpios = <&gpio1 9 GPIO_ACTIVE_LOW>;
> +		};
> +	};
> +
> +	gpio_poweroff {

ditto.

Besides the nits,

Acked-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>

> +		compatible = "gpio-poweroff";
> +		pinctrl-0 = <&poweroff>;
> +		pinctrl-names = "default";
> +		gpios = <&gpio1 10 GPIO_ACTIVE_LOW>;
> +	};
> +};
>

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

* Re: [PATCHv2] ARM: mvebu: Add Netgear ReadyNAS 2120 board
  2013-11-11 20:33     ` Sebastian Hesselbarth
@ 2013-11-11 20:53         ` Arnaud Ebalard
  -1 siblings, 0 replies; 20+ messages in thread
From: Arnaud Ebalard @ 2013-11-11 20:53 UTC (permalink / raw)
  To: Sebastian Hesselbarth
  Cc: Jason Cooper, Andrew Lunn, Gregory Clement, Ezequiel Garcia,
	Thomas Petazzoni, Russell King,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, Rob Herring,
	Pawel Moll, Mark Rutland, Stephen Warren, Ian Campbell,
	devicetree-u79uwXL29TY76Z2rM5mHXA, Guenter Roeck

Hi Sebastian.

Sebastian Hesselbarth <sebastian.hesselbarth-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:

>> +			serial@12000 {
>> +				clocks = <&coreclk 0>;
>> +				status = "okay";
>> +			};
>
> For your possible cleanup later: move clocks = <&coreclk 0> to
> armada-370-xp.dtsi and remove this then.
>
> Also for cleanup later: It would be great if most SoC nodes get
> a node label. That way you can just write:
>
> uart0: { status = "okay" };
>
> without replaying node hierarchy over and over again.

I will keep that in mind for later cleanups. Regarding the nits, as you
took the time to report those, I will send a v3 fixing them tomorrow.

Cheers,,

a+
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCHv2] ARM: mvebu: Add Netgear ReadyNAS 2120 board
@ 2013-11-11 20:53         ` Arnaud Ebalard
  0 siblings, 0 replies; 20+ messages in thread
From: Arnaud Ebalard @ 2013-11-11 20:53 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Sebastian.

Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> writes:

>> +			serial at 12000 {
>> +				clocks = <&coreclk 0>;
>> +				status = "okay";
>> +			};
>
> For your possible cleanup later: move clocks = <&coreclk 0> to
> armada-370-xp.dtsi and remove this then.
>
> Also for cleanup later: It would be great if most SoC nodes get
> a node label. That way you can just write:
>
> uart0: { status = "okay" };
>
> without replaying node hierarchy over and over again.

I will keep that in mind for later cleanups. Regarding the nits, as you
took the time to report those, I will send a v3 fixing them tomorrow.

Cheers,,

a+

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

* Re: [PATCHv2] ARM: mvebu: Add Netgear ReadyNAS 2120 board
  2013-11-24 13:02           ` Jason Cooper
@ 2013-11-24 14:09               ` Arnaud Ebalard
  -1 siblings, 0 replies; 20+ messages in thread
From: Arnaud Ebalard @ 2013-11-24 14:09 UTC (permalink / raw)
  To: Jason Cooper
  Cc: Andrew Lunn, Gregory Clement, Sebastian Hesselbarth,
	Ezequiel Garcia, Thomas Petazzoni, Mark Rutland,
	devicetree-u79uwXL29TY76Z2rM5mHXA, Russell King, Pawel Moll,
	Stephen Warren, Ian Campbell, Rob Herring, Guenter Roeck,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r


Jason Cooper <jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org> writes:

>> > Applied to mvebu/dt
>> 
>> Thanks, Jason. Based on the response to the question raised by Jason
>> Gunthorpe regarding PHY compatible string [1], I'll keep in mind to send
>> you a patch at some point (.dts file for RN2120 also has compatible =
>> "marvell,88e1318s") if needed.
>
> d*mn.  You're right.  I missed that.  I'll drop this from mvebu/dt until
> that's resolved.  I don't want to inadvertently force supporting a
> compatible string we don't want.
>
> Please resend this once that's resolved.

Ack.

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCHv2] ARM: mvebu: Add Netgear ReadyNAS 2120 board
@ 2013-11-24 14:09               ` Arnaud Ebalard
  0 siblings, 0 replies; 20+ messages in thread
From: Arnaud Ebalard @ 2013-11-24 14:09 UTC (permalink / raw)
  To: linux-arm-kernel


Jason Cooper <jason@lakedaemon.net> writes:

>> > Applied to mvebu/dt
>> 
>> Thanks, Jason. Based on the response to the question raised by Jason
>> Gunthorpe regarding PHY compatible string [1], I'll keep in mind to send
>> you a patch at some point (.dts file for RN2120 also has compatible =
>> "marvell,88e1318s") if needed.
>
> d*mn.  You're right.  I missed that.  I'll drop this from mvebu/dt until
> that's resolved.  I don't want to inadvertently force supporting a
> compatible string we don't want.
>
> Please resend this once that's resolved.

Ack.

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

* Re: [PATCHv2] ARM: mvebu: Add Netgear ReadyNAS 2120 board
  2013-11-24 11:52       ` Arnaud Ebalard
@ 2013-11-24 13:02           ` Jason Cooper
  -1 siblings, 0 replies; 20+ messages in thread
From: Jason Cooper @ 2013-11-24 13:02 UTC (permalink / raw)
  To: Arnaud Ebalard
  Cc: Andrew Lunn, Gregory Clement, Sebastian Hesselbarth,
	Ezequiel Garcia, Thomas Petazzoni, Mark Rutland,
	devicetree-u79uwXL29TY76Z2rM5mHXA, Russell King, Pawel Moll,
	Stephen Warren, Ian Campbell, Rob Herring, Guenter Roeck,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On Sun, Nov 24, 2013 at 12:52:58PM +0100, Arnaud Ebalard wrote:
> Hi,
> 
> Jason Cooper <jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org> writes:
> 
> > On Tue, Nov 12, 2013 at 08:46:48PM +0100, Arnaud Ebalard wrote:
> >> 
> >> All hardware parts of the (mv78230 Armada XP based) NETGEAR ReadyNAS
> >> 2120 are supported by mainline kernel (USB 3.0 and eSATA rear ports,
> >> USB 2.0 front port, Gigabit controller and PHYs for the two rear ports,
> >> serial port, LEDs, Buttons, 88SE9170 SATA controllers, three G762 fan
> >> controllers, G751 temperature sensor) except for:
> >> 
> >>  - the Intersil ISL12057 I2C RTC Chip,
> >>  - the Armada NAND controller.
> >> 
> >> Support for both of those is currently work in progress and does not
> >> prevent boot.
> >> 
> >> Acked-by: Sebastian Hesselbarth <sebastian.hesselbarth-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> >> Signed-off-by: Arnaud Ebalard <arno-LkuqDEemtHBg9hUCZPvPmw@public.gmane.org>
> >> ---
> > ...
> >>  arch/arm/boot/dts/Makefile                     |   1 +
> >>  arch/arm/boot/dts/armada-xp-netgear-rn2120.dts | 288 +++++++++++++++++++++++++
> >>  2 files changed, 289 insertions(+)
> >>  create mode 100644 arch/arm/boot/dts/armada-xp-netgear-rn2120.dts
> >
> > Applied to mvebu/dt
> 
> Thanks, Jason. Based on the response to the question raised by Jason
> Gunthorpe regarding PHY compatible string [1], I'll keep in mind to send
> you a patch at some point (.dts file for RN2120 also has compatible =
> "marvell,88e1318s") if needed.

d*mn.  You're right.  I missed that.  I'll drop this from mvebu/dt until
that's resolved.  I don't want to inadvertently force supporting a
compatible string we don't want.

Please resend this once that's resolved.

thx,

Jason.
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCHv2] ARM: mvebu: Add Netgear ReadyNAS 2120 board
@ 2013-11-24 13:02           ` Jason Cooper
  0 siblings, 0 replies; 20+ messages in thread
From: Jason Cooper @ 2013-11-24 13:02 UTC (permalink / raw)
  To: linux-arm-kernel

On Sun, Nov 24, 2013 at 12:52:58PM +0100, Arnaud Ebalard wrote:
> Hi,
> 
> Jason Cooper <jason@lakedaemon.net> writes:
> 
> > On Tue, Nov 12, 2013 at 08:46:48PM +0100, Arnaud Ebalard wrote:
> >> 
> >> All hardware parts of the (mv78230 Armada XP based) NETGEAR ReadyNAS
> >> 2120 are supported by mainline kernel (USB 3.0 and eSATA rear ports,
> >> USB 2.0 front port, Gigabit controller and PHYs for the two rear ports,
> >> serial port, LEDs, Buttons, 88SE9170 SATA controllers, three G762 fan
> >> controllers, G751 temperature sensor) except for:
> >> 
> >>  - the Intersil ISL12057 I2C RTC Chip,
> >>  - the Armada NAND controller.
> >> 
> >> Support for both of those is currently work in progress and does not
> >> prevent boot.
> >> 
> >> Acked-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
> >> Signed-off-by: Arnaud Ebalard <arno@natisbad.org>
> >> ---
> > ...
> >>  arch/arm/boot/dts/Makefile                     |   1 +
> >>  arch/arm/boot/dts/armada-xp-netgear-rn2120.dts | 288 +++++++++++++++++++++++++
> >>  2 files changed, 289 insertions(+)
> >>  create mode 100644 arch/arm/boot/dts/armada-xp-netgear-rn2120.dts
> >
> > Applied to mvebu/dt
> 
> Thanks, Jason. Based on the response to the question raised by Jason
> Gunthorpe regarding PHY compatible string [1], I'll keep in mind to send
> you a patch at some point (.dts file for RN2120 also has compatible =
> "marvell,88e1318s") if needed.

d*mn.  You're right.  I missed that.  I'll drop this from mvebu/dt until
that's resolved.  I don't want to inadvertently force supporting a
compatible string we don't want.

Please resend this once that's resolved.

thx,

Jason.

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

* Re: [PATCHv2] ARM: mvebu: Add Netgear ReadyNAS 2120 board
  2013-11-24  3:49     ` Jason Cooper
@ 2013-11-24 11:52       ` Arnaud Ebalard
  -1 siblings, 0 replies; 20+ messages in thread
From: Arnaud Ebalard @ 2013-11-24 11:52 UTC (permalink / raw)
  To: Jason Cooper
  Cc: Andrew Lunn, Gregory Clement, Sebastian Hesselbarth,
	Ezequiel Garcia, Thomas Petazzoni, Mark Rutland,
	devicetree-u79uwXL29TY76Z2rM5mHXA, Russell King, Pawel Moll,
	Stephen Warren, Ian Campbell, Rob Herring, Guenter Roeck,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

Hi,

Jason Cooper <jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org> writes:

> On Tue, Nov 12, 2013 at 08:46:48PM +0100, Arnaud Ebalard wrote:
>> 
>> All hardware parts of the (mv78230 Armada XP based) NETGEAR ReadyNAS
>> 2120 are supported by mainline kernel (USB 3.0 and eSATA rear ports,
>> USB 2.0 front port, Gigabit controller and PHYs for the two rear ports,
>> serial port, LEDs, Buttons, 88SE9170 SATA controllers, three G762 fan
>> controllers, G751 temperature sensor) except for:
>> 
>>  - the Intersil ISL12057 I2C RTC Chip,
>>  - the Armada NAND controller.
>> 
>> Support for both of those is currently work in progress and does not
>> prevent boot.
>> 
>> Acked-by: Sebastian Hesselbarth <sebastian.hesselbarth-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
>> Signed-off-by: Arnaud Ebalard <arno-LkuqDEemtHBg9hUCZPvPmw@public.gmane.org>
>> ---
> ...
>>  arch/arm/boot/dts/Makefile                     |   1 +
>>  arch/arm/boot/dts/armada-xp-netgear-rn2120.dts | 288 +++++++++++++++++++++++++
>>  2 files changed, 289 insertions(+)
>>  create mode 100644 arch/arm/boot/dts/armada-xp-netgear-rn2120.dts
>
> Applied to mvebu/dt

Thanks, Jason. Based on the response to the question raised by Jason
Gunthorpe regarding PHY compatible string [1], I'll keep in mind to send
you a patch at some point (.dts file for RN2120 also has compatible =
"marvell,88e1318s") if needed.

Cheers,

a+

[1]: http://www.spinics.net/lists/arm-kernel/msg288496.html
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCHv2] ARM: mvebu: Add Netgear ReadyNAS 2120 board
@ 2013-11-24 11:52       ` Arnaud Ebalard
  0 siblings, 0 replies; 20+ messages in thread
From: Arnaud Ebalard @ 2013-11-24 11:52 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

Jason Cooper <jason@lakedaemon.net> writes:

> On Tue, Nov 12, 2013 at 08:46:48PM +0100, Arnaud Ebalard wrote:
>> 
>> All hardware parts of the (mv78230 Armada XP based) NETGEAR ReadyNAS
>> 2120 are supported by mainline kernel (USB 3.0 and eSATA rear ports,
>> USB 2.0 front port, Gigabit controller and PHYs for the two rear ports,
>> serial port, LEDs, Buttons, 88SE9170 SATA controllers, three G762 fan
>> controllers, G751 temperature sensor) except for:
>> 
>>  - the Intersil ISL12057 I2C RTC Chip,
>>  - the Armada NAND controller.
>> 
>> Support for both of those is currently work in progress and does not
>> prevent boot.
>> 
>> Acked-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
>> Signed-off-by: Arnaud Ebalard <arno@natisbad.org>
>> ---
> ...
>>  arch/arm/boot/dts/Makefile                     |   1 +
>>  arch/arm/boot/dts/armada-xp-netgear-rn2120.dts | 288 +++++++++++++++++++++++++
>>  2 files changed, 289 insertions(+)
>>  create mode 100644 arch/arm/boot/dts/armada-xp-netgear-rn2120.dts
>
> Applied to mvebu/dt

Thanks, Jason. Based on the response to the question raised by Jason
Gunthorpe regarding PHY compatible string [1], I'll keep in mind to send
you a patch at some point (.dts file for RN2120 also has compatible =
"marvell,88e1318s") if needed.

Cheers,

a+

[1]: http://www.spinics.net/lists/arm-kernel/msg288496.html

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

* Re: [PATCHv2] ARM: mvebu: Add Netgear ReadyNAS 2120 board
  2013-11-12 19:46 ` Arnaud Ebalard
@ 2013-11-24  3:49     ` Jason Cooper
  -1 siblings, 0 replies; 20+ messages in thread
From: Jason Cooper @ 2013-11-24  3:49 UTC (permalink / raw)
  To: Arnaud Ebalard
  Cc: Andrew Lunn, Gregory Clement, Sebastian Hesselbarth,
	Ezequiel Garcia, Thomas Petazzoni, Mark Rutland,
	devicetree-u79uwXL29TY76Z2rM5mHXA, Russell King, Pawel Moll,
	Stephen Warren, Ian Campbell, Rob Herring, Guenter Roeck,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On Tue, Nov 12, 2013 at 08:46:48PM +0100, Arnaud Ebalard wrote:
> 
> All hardware parts of the (mv78230 Armada XP based) NETGEAR ReadyNAS
> 2120 are supported by mainline kernel (USB 3.0 and eSATA rear ports,
> USB 2.0 front port, Gigabit controller and PHYs for the two rear ports,
> serial port, LEDs, Buttons, 88SE9170 SATA controllers, three G762 fan
> controllers, G751 temperature sensor) except for:
> 
>  - the Intersil ISL12057 I2C RTC Chip,
>  - the Armada NAND controller.
> 
> Support for both of those is currently work in progress and does not
> prevent boot.
> 
> Acked-by: Sebastian Hesselbarth <sebastian.hesselbarth-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> Signed-off-by: Arnaud Ebalard <arno-LkuqDEemtHBg9hUCZPvPmw@public.gmane.org>
> ---
...
>  arch/arm/boot/dts/Makefile                     |   1 +
>  arch/arm/boot/dts/armada-xp-netgear-rn2120.dts | 288 +++++++++++++++++++++++++
>  2 files changed, 289 insertions(+)
>  create mode 100644 arch/arm/boot/dts/armada-xp-netgear-rn2120.dts

Applied to mvebu/dt

thx,

Jason.
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCHv2] ARM: mvebu: Add Netgear ReadyNAS 2120 board
@ 2013-11-24  3:49     ` Jason Cooper
  0 siblings, 0 replies; 20+ messages in thread
From: Jason Cooper @ 2013-11-24  3:49 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Nov 12, 2013 at 08:46:48PM +0100, Arnaud Ebalard wrote:
> 
> All hardware parts of the (mv78230 Armada XP based) NETGEAR ReadyNAS
> 2120 are supported by mainline kernel (USB 3.0 and eSATA rear ports,
> USB 2.0 front port, Gigabit controller and PHYs for the two rear ports,
> serial port, LEDs, Buttons, 88SE9170 SATA controllers, three G762 fan
> controllers, G751 temperature sensor) except for:
> 
>  - the Intersil ISL12057 I2C RTC Chip,
>  - the Armada NAND controller.
> 
> Support for both of those is currently work in progress and does not
> prevent boot.
> 
> Acked-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
> Signed-off-by: Arnaud Ebalard <arno@natisbad.org>
> ---
...
>  arch/arm/boot/dts/Makefile                     |   1 +
>  arch/arm/boot/dts/armada-xp-netgear-rn2120.dts | 288 +++++++++++++++++++++++++
>  2 files changed, 289 insertions(+)
>  create mode 100644 arch/arm/boot/dts/armada-xp-netgear-rn2120.dts

Applied to mvebu/dt

thx,

Jason.

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

* Re: [PATCHv2] ARM: mvebu: Add Netgear ReadyNAS 2120 board
  2013-11-12 20:11     ` Jason Cooper
@ 2013-11-12 20:53         ` Arnaud Ebalard
  -1 siblings, 0 replies; 20+ messages in thread
From: Arnaud Ebalard @ 2013-11-12 20:53 UTC (permalink / raw)
  To: Jason Cooper
  Cc: Thomas Petazzoni, Andrew Lunn, Russell King, Pawel Moll,
	Stephen Warren, Ian Campbell, Rob Herring,
	devicetree-u79uwXL29TY76Z2rM5mHXA, Guenter Roeck,
	Ezequiel Garcia, Gregory Clement, Mark Rutland,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	Sebastian Hesselbarth


Jason Cooper <jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org> writes:

>> Note changed since v2 (i.e. kept for later cleanup session):
>
> I presume s/Note/Not/ ?  Otherwise, I'm really confused. :)

Yep, and the subject of my email would also deserve a s/v2/v3/ ;-)

a+
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCHv2] ARM: mvebu: Add Netgear ReadyNAS 2120 board
@ 2013-11-12 20:53         ` Arnaud Ebalard
  0 siblings, 0 replies; 20+ messages in thread
From: Arnaud Ebalard @ 2013-11-12 20:53 UTC (permalink / raw)
  To: linux-arm-kernel


Jason Cooper <jason@lakedaemon.net> writes:

>> Note changed since v2 (i.e. kept for later cleanup session):
>
> I presume s/Note/Not/ ?  Otherwise, I'm really confused. :)

Yep, and the subject of my email would also deserve a s/v2/v3/ ;-)

a+

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

* Re: [PATCHv2] ARM: mvebu: Add Netgear ReadyNAS 2120 board
  2013-11-12 19:46 ` Arnaud Ebalard
@ 2013-11-12 20:11     ` Jason Cooper
  -1 siblings, 0 replies; 20+ messages in thread
From: Jason Cooper @ 2013-11-12 20:11 UTC (permalink / raw)
  To: Arnaud Ebalard
  Cc: Andrew Lunn, Gregory Clement, Sebastian Hesselbarth,
	Ezequiel Garcia, Thomas Petazzoni, Russell King,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, Rob Herring,
	Pawel Moll, Mark Rutland, Stephen Warren, Ian Campbell,
	devicetree-u79uwXL29TY76Z2rM5mHXA, Guenter Roeck

On Tue, Nov 12, 2013 at 08:46:48PM +0100, Arnaud Ebalard wrote:
> 
> All hardware parts of the (mv78230 Armada XP based) NETGEAR ReadyNAS
> 2120 are supported by mainline kernel (USB 3.0 and eSATA rear ports,
> USB 2.0 front port, Gigabit controller and PHYs for the two rear ports,
> serial port, LEDs, Buttons, 88SE9170 SATA controllers, three G762 fan
> controllers, G751 temperature sensor) except for:
> 
>  - the Intersil ISL12057 I2C RTC Chip,
>  - the Armada NAND controller.
> 
> Support for both of those is currently work in progress and does not
> prevent boot.
> 
> Acked-by: Sebastian Hesselbarth <sebastian.hesselbarth-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> Signed-off-by: Arnaud Ebalard <arno-LkuqDEemtHBg9hUCZPvPmw@public.gmane.org>
> ---
> Hi,
> 
> Initial message:
>  
>   This one is intended for v3.14. This depends on the recent fix I pushed
>   for mv78230 PCIe and also on a small patch Guenter Roeck just accepted
>   to have lm75 driver support GMT G751 Temperature sensor (see 
>   https://lkml.org/lkml/2013/11/9/273).
>   
>   Regarding the SATA presence and power pin definitions under pinctrl
>   node if you wonder, I thought it would not harm to have them for
>   reference even though they are currently not used. FWIW, I am currently
>   looking if a GPIO regulator can make any use of those.
>  
> 
> Note changed since v2 (i.e. kept for later cleanup session):

I presume s/Note/Not/ ?  Otherwise, I'm really confused. :)

>  - move clocks = <&coreclk 0> in serial node to armada-370-xp.dtsi
>  - add a label to most SoC nodes to avoid replaying the whole node hierarchy
>  - see if g762 dt binding can be fixed (no remarks done during review)

thx,

Jason.
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCHv2] ARM: mvebu: Add Netgear ReadyNAS 2120 board
@ 2013-11-12 20:11     ` Jason Cooper
  0 siblings, 0 replies; 20+ messages in thread
From: Jason Cooper @ 2013-11-12 20:11 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Nov 12, 2013 at 08:46:48PM +0100, Arnaud Ebalard wrote:
> 
> All hardware parts of the (mv78230 Armada XP based) NETGEAR ReadyNAS
> 2120 are supported by mainline kernel (USB 3.0 and eSATA rear ports,
> USB 2.0 front port, Gigabit controller and PHYs for the two rear ports,
> serial port, LEDs, Buttons, 88SE9170 SATA controllers, three G762 fan
> controllers, G751 temperature sensor) except for:
> 
>  - the Intersil ISL12057 I2C RTC Chip,
>  - the Armada NAND controller.
> 
> Support for both of those is currently work in progress and does not
> prevent boot.
> 
> Acked-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
> Signed-off-by: Arnaud Ebalard <arno@natisbad.org>
> ---
> Hi,
> 
> Initial message:
>  
>   This one is intended for v3.14. This depends on the recent fix I pushed
>   for mv78230 PCIe and also on a small patch Guenter Roeck just accepted
>   to have lm75 driver support GMT G751 Temperature sensor (see 
>   https://lkml.org/lkml/2013/11/9/273).
>   
>   Regarding the SATA presence and power pin definitions under pinctrl
>   node if you wonder, I thought it would not harm to have them for
>   reference even though they are currently not used. FWIW, I am currently
>   looking if a GPIO regulator can make any use of those.
>  
> 
> Note changed since v2 (i.e. kept for later cleanup session):

I presume s/Note/Not/ ?  Otherwise, I'm really confused. :)

>  - move clocks = <&coreclk 0> in serial node to armada-370-xp.dtsi
>  - add a label to most SoC nodes to avoid replaying the whole node hierarchy
>  - see if g762 dt binding can be fixed (no remarks done during review)

thx,

Jason.

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

* [PATCHv2] ARM: mvebu: Add Netgear ReadyNAS 2120 board
@ 2013-11-12 19:46 ` Arnaud Ebalard
  0 siblings, 0 replies; 20+ messages in thread
From: Arnaud Ebalard @ 2013-11-12 19:46 UTC (permalink / raw)
  To: Jason Cooper, Andrew Lunn, Gregory Clement,
	Sebastian Hesselbarth, Ezequiel Garcia, Thomas Petazzoni
  Cc: Mark Rutland, devicetree, Russell King, Pawel Moll,
	Stephen Warren, Ian Campbell, Rob Herring, Guenter Roeck,
	linux-arm-kernel


All hardware parts of the (mv78230 Armada XP based) NETGEAR ReadyNAS
2120 are supported by mainline kernel (USB 3.0 and eSATA rear ports,
USB 2.0 front port, Gigabit controller and PHYs for the two rear ports,
serial port, LEDs, Buttons, 88SE9170 SATA controllers, three G762 fan
controllers, G751 temperature sensor) except for:

 - the Intersil ISL12057 I2C RTC Chip,
 - the Armada NAND controller.

Support for both of those is currently work in progress and does not
prevent boot.

Acked-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Signed-off-by: Arnaud Ebalard <arno@natisbad.org>
---
Hi,

Initial message:
 
  This one is intended for v3.14. This depends on the recent fix I pushed
  for mv78230 PCIe and also on a small patch Guenter Roeck just accepted
  to have lm75 driver support GMT G751 Temperature sensor (see 
  https://lkml.org/lkml/2013/11/9/273).
  
  Regarding the SATA presence and power pin definitions under pinctrl
  node if you wonder, I thought it would not harm to have them for
  reference even though they are currently not used. FWIW, I am currently
  looking if a GPIO regulator can make any use of those.
 

Note changed since v2 (i.e. kept for later cleanup session):
 - move clocks = <&coreclk 0> in serial node to armada-370-xp.dtsi
 - add a label to most SoC nodes to avoid replaying the whole node hierarchy
 - see if g762 dt binding can be fixed (no remarks done during review)


Changes since v2:

 After Sebastian's comments:
  - fixed order of includes (global before local)
  - fixed *all* node names to use '-' instead of '_'
  - Added Sebastian's Acked-by


Changes since v1:

 After Andrew's comment:
  - Added comment about G751 function

 After Sebastian's comments:
  - Changed clock frequency for a clock provider for serial line
  - Added compatible string for PHY (marvell,mv88e1318s)
  - Removed useless properties in clocks and gpio_keys nodes
  - Made G762 clock node name unique by including g762 in it
  - Changed values for macros for GPIO voltage level
  - Removed comments after GPIOs
  - Changed buttons and button pins names

 After Jason's comment:
  - Changed values for macros for input keys, removed comments

 After more documenation reading:
  - changed i2c compatible string to marvell,mv78230-i2c

Comments welcome,

Cheers,

a+

 arch/arm/boot/dts/Makefile                     |   1 +
 arch/arm/boot/dts/armada-xp-netgear-rn2120.dts | 288 +++++++++++++++++++++++++
 2 files changed, 289 insertions(+)
 create mode 100644 arch/arm/boot/dts/armada-xp-netgear-rn2120.dts

diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index 802720e..c6dd4de 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -112,6 +112,7 @@ dtb-$(CONFIG_ARCH_MVEBU) += armada-370-db.dtb \
 	armada-xp-axpwifiap.dtb \
 	armada-xp-db.dtb \
 	armada-xp-gp.dtb \
+	armada-xp-netgear-rn2120.dtb \
 	armada-xp-openblocks-ax3-4.dtb
 dtb-$(CONFIG_ARCH_MXC) += \
 	imx25-karo-tx25.dtb \
diff --git a/arch/arm/boot/dts/armada-xp-netgear-rn2120.dts b/arch/arm/boot/dts/armada-xp-netgear-rn2120.dts
new file mode 100644
index 0000000..7ea9fea
--- /dev/null
+++ b/arch/arm/boot/dts/armada-xp-netgear-rn2120.dts
@@ -0,0 +1,288 @@
+/*
+ * Device Tree file for NETGEAR ReadyNAS 2120
+ *
+ * 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.
+ */
+
+/dts-v1/;
+
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/gpio/gpio.h>
+#include "armada-xp-mv78230.dtsi"
+
+/ {
+	model = "NETGEAR ReadyNAS 2120";
+	compatible = "netgear,readynas-2120", "marvell,armadaxp-mv78230", "marvell,armadaxp", "marvell,armada-370-xp";
+
+	chosen {
+		bootargs = "console=ttyS0,115200 earlyprintk";
+	};
+
+	memory {
+		device_type = "memory";
+		reg = <0 0x00000000 0 0x80000000>; /* 2GB */
+	};
+
+	soc {
+		ranges = <MBUS_ID(0xf0, 0x01) 0 0 0xd0000000 0x100000
+			  MBUS_ID(0x01, 0x1d) 0 0 0xfff00000 0x100000>;
+
+		pcie-controller {
+			status = "okay";
+
+			/* Connected to first Marvell 88SE9170 SATA controller */
+			pcie@1,0 {
+				/* Port 0, Lane 0 */
+				status = "okay";
+			};
+
+			/* Connected to second Marvell 88SE9170 SATA controller */
+			pcie@2,0 {
+				/* Port 0, Lane 1 */
+				status = "okay";
+			};
+
+			/* Connected to Fresco Logic FL1009 USB 3.0 controller */
+			pcie@5,0 {
+				/* Port 1, Lane 0 */
+				status = "okay";
+			};
+		};
+
+		internal-regs {
+			pinctrl {
+				poweroff: poweroff {
+					marvell,pins = "mpp42";
+					marvell,function = "gpio";
+				};
+
+				power_button_pin: power-button-pin {
+					marvell,pins = "mpp27";
+					marvell,function = "gpio";
+				};
+
+				reset_button_pin: reset-button-pin {
+					marvell,pins = "mpp41";
+					marvell,function = "gpio";
+				};
+
+				sata1_led_pin: sata1-led-pin {
+					marvell,pins = "mpp31";
+					marvell,function = "gpio";
+				};
+
+				sata2_led_pin: sata2-led-pin {
+					marvell,pins = "mpp40";
+					marvell,function = "gpio";
+				};
+
+				sata3_led_pin: sata3-led-pin {
+					marvell,pins = "mpp44";
+					marvell,function = "gpio";
+				};
+
+				sata4_led_pin: sata4-led-pin {
+					marvell,pins = "mpp47";
+					marvell,function = "gpio";
+				};
+
+				sata1_power_pin: sata1-power-pin {
+					marvell,pins = "mpp24";
+					marvell,function = "gpio";
+				};
+
+				sata2_power_pin: sata2-power-pin {
+					marvell,pins = "mpp25";
+					marvell,function = "gpio";
+				};
+
+				sata3_power_pin: sata3-power-pin {
+					marvell,pins = "mpp26";
+					marvell,function = "gpio";
+				};
+
+				sata4_power_pin: sata4-power-pin {
+					marvell,pins = "mpp28";
+					marvell,function = "gpio";
+				};
+
+				sata1_pres_pin: sata1-pres-pin {
+					marvell,pins = "mpp32";
+					marvell,function = "gpio";
+				};
+
+				sata2_pres_pin: sata2-pres-pin {
+					marvell,pins = "mpp33";
+					marvell,function = "gpio";
+				};
+
+				sata3_pres_pin: sata3-pres-pin {
+					marvell,pins = "mpp34";
+					marvell,function = "gpio";
+				};
+
+				sata4_pres_pin: sata4-pres-pin {
+					marvell,pins = "mpp35";
+					marvell,function = "gpio";
+				};
+
+				err_led_pin: err-led-pin {
+					marvell,pins = "mpp45";
+					marvell,function = "gpio";
+				};
+			};
+
+			serial@12000 {
+				clocks = <&coreclk 0>;
+				status = "okay";
+			};
+
+			mdio {
+				phy0: ethernet-phy@0 {
+					compatible = "marvell,88e1318s";
+					reg = <0>;
+				};
+
+				phy1: ethernet-phy@1 {
+					compatible = "marvell,88e1318s";
+					reg = <1>;
+				};
+			};
+
+			ethernet@70000 {
+				status = "okay";
+				phy = <&phy0>;
+				phy-mode = "rgmii-id";
+			};
+
+			ethernet@74000 {
+				status = "okay";
+				phy = <&phy1>;
+				phy-mode = "rgmii-id";
+			};
+
+			/* Front USB 2.0 port */
+			usb@50000 {
+				status = "okay";
+			};
+
+			i2c@11000 {
+				compatible = "marvell,mv78230-i2c";
+				clock-frequency = <400000>;
+				status = "okay";
+
+				/* Controller for rear fan #1 of 3 (Protechnic
+				 * MGT4012XB-O20, 8000RPM) near eSATA port */
+				g762_fan1: g762@3e {
+					compatible = "gmt,g762";
+					reg = <0x3e>;
+					clocks = <&g762_clk>; /* input clock */
+					fan_gear_mode = <0>;
+					fan_startv = <1>;
+					pwm_polarity = <0>;
+				};
+
+				/*  Controller for rear (center) fan #2 of 3 */
+				g762_fan2: g762@48 {
+					compatible = "gmt,g762";
+					reg = <0x48>;
+					clocks = <&g762_clk>; /* input clock */
+					fan_gear_mode = <0>;
+					fan_startv = <1>;
+					pwm_polarity = <0>;
+				};
+
+				/*  Controller for rear fan #3 of 3 */
+				g762_fan3: g762@49 {
+					compatible = "gmt,g762";
+					reg = <0x49>;
+					clocks = <&g762_clk>; /* input clock */
+					fan_gear_mode = <0>;
+					fan_startv = <1>;
+					pwm_polarity = <0>;
+				};
+
+				/* Temperature sensor */
+				g751: g751@4c {
+					compatible = "gmt,g751";
+					reg = <0x4c>;
+				};
+			};
+		};
+	};
+
+	clocks {
+	       g762_clk: g762-oscillator {
+			 compatible = "fixed-clock";
+			 #clock-cells = <0>;
+			 clock-frequency = <32768>;
+	       };
+	};
+
+	gpio-leds {
+		compatible = "gpio-leds";
+		pinctrl-0 = <&sata1_led_pin &sata2_led_pin &err_led_pin
+			     &sata3_led_pin &sata4_led_pin>;
+		pinctrl-names = "default";
+
+		red-sata1-led {
+			label = "rn2120:red:sata1";
+			gpios = <&gpio0 31 GPIO_ACTIVE_HIGH>;
+			default-state = "off";
+		};
+
+		red-sata2-led {
+			label = "rn2120:red:sata2";
+			gpios = <&gpio1 8 GPIO_ACTIVE_HIGH>;
+			default-state = "off";
+		};
+
+		red-sata3-led {
+			label = "rn2120:red:sata3";
+			gpios = <&gpio1 12 GPIO_ACTIVE_HIGH>;
+			default-state = "off";
+		};
+
+		red-sata4-led {
+			label = "rn2120:red:sata4";
+			gpios = <&gpio1 15 GPIO_ACTIVE_HIGH>;
+			default-state = "off";
+		};
+
+		red-err-led {
+			label = "rn2120:red:err";
+			gpios = <&gpio1 13 GPIO_ACTIVE_LOW>;
+			default-state = "off";
+		};
+	};
+
+	gpio-keys {
+		compatible = "gpio-keys";
+		pinctrl-0 = <&power_button_pin &reset_button_pin>;
+		pinctrl-names = "default";
+
+		power-button {
+			label = "Power Button";
+			linux,code = <KEY_POWER>;
+			gpios = <&gpio0 27 GPIO_ACTIVE_HIGH>;
+		};
+
+		reset-button {
+			label = "Reset Button";
+			linux,code = <KEY_RESTART>;
+			gpios = <&gpio1 9 GPIO_ACTIVE_LOW>;
+		};
+	};
+
+	gpio-poweroff {
+		compatible = "gpio-poweroff";
+		pinctrl-0 = <&poweroff>;
+		pinctrl-names = "default";
+		gpios = <&gpio1 10 GPIO_ACTIVE_LOW>;
+	};
+};
-- 
1.8.4.rc3

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

* [PATCHv2] ARM: mvebu: Add Netgear ReadyNAS 2120 board
@ 2013-11-12 19:46 ` Arnaud Ebalard
  0 siblings, 0 replies; 20+ messages in thread
From: Arnaud Ebalard @ 2013-11-12 19:46 UTC (permalink / raw)
  To: linux-arm-kernel


All hardware parts of the (mv78230 Armada XP based) NETGEAR ReadyNAS
2120 are supported by mainline kernel (USB 3.0 and eSATA rear ports,
USB 2.0 front port, Gigabit controller and PHYs for the two rear ports,
serial port, LEDs, Buttons, 88SE9170 SATA controllers, three G762 fan
controllers, G751 temperature sensor) except for:

 - the Intersil ISL12057 I2C RTC Chip,
 - the Armada NAND controller.

Support for both of those is currently work in progress and does not
prevent boot.

Acked-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Signed-off-by: Arnaud Ebalard <arno@natisbad.org>
---
Hi,

Initial message:
 
  This one is intended for v3.14. This depends on the recent fix I pushed
  for mv78230 PCIe and also on a small patch Guenter Roeck just accepted
  to have lm75 driver support GMT G751 Temperature sensor (see 
  https://lkml.org/lkml/2013/11/9/273).
  
  Regarding the SATA presence and power pin definitions under pinctrl
  node if you wonder, I thought it would not harm to have them for
  reference even though they are currently not used. FWIW, I am currently
  looking if a GPIO regulator can make any use of those.
 

Note changed since v2 (i.e. kept for later cleanup session):
 - move clocks = <&coreclk 0> in serial node to armada-370-xp.dtsi
 - add a label to most SoC nodes to avoid replaying the whole node hierarchy
 - see if g762 dt binding can be fixed (no remarks done during review)


Changes since v2:

 After Sebastian's comments:
  - fixed order of includes (global before local)
  - fixed *all* node names to use '-' instead of '_'
  - Added Sebastian's Acked-by


Changes since v1:

 After Andrew's comment:
  - Added comment about G751 function

 After Sebastian's comments:
  - Changed clock frequency for a clock provider for serial line
  - Added compatible string for PHY (marvell,mv88e1318s)
  - Removed useless properties in clocks and gpio_keys nodes
  - Made G762 clock node name unique by including g762 in it
  - Changed values for macros for GPIO voltage level
  - Removed comments after GPIOs
  - Changed buttons and button pins names

 After Jason's comment:
  - Changed values for macros for input keys, removed comments

 After more documenation reading:
  - changed i2c compatible string to marvell,mv78230-i2c

Comments welcome,

Cheers,

a+

 arch/arm/boot/dts/Makefile                     |   1 +
 arch/arm/boot/dts/armada-xp-netgear-rn2120.dts | 288 +++++++++++++++++++++++++
 2 files changed, 289 insertions(+)
 create mode 100644 arch/arm/boot/dts/armada-xp-netgear-rn2120.dts

diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index 802720e..c6dd4de 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -112,6 +112,7 @@ dtb-$(CONFIG_ARCH_MVEBU) += armada-370-db.dtb \
 	armada-xp-axpwifiap.dtb \
 	armada-xp-db.dtb \
 	armada-xp-gp.dtb \
+	armada-xp-netgear-rn2120.dtb \
 	armada-xp-openblocks-ax3-4.dtb
 dtb-$(CONFIG_ARCH_MXC) += \
 	imx25-karo-tx25.dtb \
diff --git a/arch/arm/boot/dts/armada-xp-netgear-rn2120.dts b/arch/arm/boot/dts/armada-xp-netgear-rn2120.dts
new file mode 100644
index 0000000..7ea9fea
--- /dev/null
+++ b/arch/arm/boot/dts/armada-xp-netgear-rn2120.dts
@@ -0,0 +1,288 @@
+/*
+ * Device Tree file for NETGEAR ReadyNAS 2120
+ *
+ * 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.
+ */
+
+/dts-v1/;
+
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/gpio/gpio.h>
+#include "armada-xp-mv78230.dtsi"
+
+/ {
+	model = "NETGEAR ReadyNAS 2120";
+	compatible = "netgear,readynas-2120", "marvell,armadaxp-mv78230", "marvell,armadaxp", "marvell,armada-370-xp";
+
+	chosen {
+		bootargs = "console=ttyS0,115200 earlyprintk";
+	};
+
+	memory {
+		device_type = "memory";
+		reg = <0 0x00000000 0 0x80000000>; /* 2GB */
+	};
+
+	soc {
+		ranges = <MBUS_ID(0xf0, 0x01) 0 0 0xd0000000 0x100000
+			  MBUS_ID(0x01, 0x1d) 0 0 0xfff00000 0x100000>;
+
+		pcie-controller {
+			status = "okay";
+
+			/* Connected to first Marvell 88SE9170 SATA controller */
+			pcie at 1,0 {
+				/* Port 0, Lane 0 */
+				status = "okay";
+			};
+
+			/* Connected to second Marvell 88SE9170 SATA controller */
+			pcie at 2,0 {
+				/* Port 0, Lane 1 */
+				status = "okay";
+			};
+
+			/* Connected to Fresco Logic FL1009 USB 3.0 controller */
+			pcie at 5,0 {
+				/* Port 1, Lane 0 */
+				status = "okay";
+			};
+		};
+
+		internal-regs {
+			pinctrl {
+				poweroff: poweroff {
+					marvell,pins = "mpp42";
+					marvell,function = "gpio";
+				};
+
+				power_button_pin: power-button-pin {
+					marvell,pins = "mpp27";
+					marvell,function = "gpio";
+				};
+
+				reset_button_pin: reset-button-pin {
+					marvell,pins = "mpp41";
+					marvell,function = "gpio";
+				};
+
+				sata1_led_pin: sata1-led-pin {
+					marvell,pins = "mpp31";
+					marvell,function = "gpio";
+				};
+
+				sata2_led_pin: sata2-led-pin {
+					marvell,pins = "mpp40";
+					marvell,function = "gpio";
+				};
+
+				sata3_led_pin: sata3-led-pin {
+					marvell,pins = "mpp44";
+					marvell,function = "gpio";
+				};
+
+				sata4_led_pin: sata4-led-pin {
+					marvell,pins = "mpp47";
+					marvell,function = "gpio";
+				};
+
+				sata1_power_pin: sata1-power-pin {
+					marvell,pins = "mpp24";
+					marvell,function = "gpio";
+				};
+
+				sata2_power_pin: sata2-power-pin {
+					marvell,pins = "mpp25";
+					marvell,function = "gpio";
+				};
+
+				sata3_power_pin: sata3-power-pin {
+					marvell,pins = "mpp26";
+					marvell,function = "gpio";
+				};
+
+				sata4_power_pin: sata4-power-pin {
+					marvell,pins = "mpp28";
+					marvell,function = "gpio";
+				};
+
+				sata1_pres_pin: sata1-pres-pin {
+					marvell,pins = "mpp32";
+					marvell,function = "gpio";
+				};
+
+				sata2_pres_pin: sata2-pres-pin {
+					marvell,pins = "mpp33";
+					marvell,function = "gpio";
+				};
+
+				sata3_pres_pin: sata3-pres-pin {
+					marvell,pins = "mpp34";
+					marvell,function = "gpio";
+				};
+
+				sata4_pres_pin: sata4-pres-pin {
+					marvell,pins = "mpp35";
+					marvell,function = "gpio";
+				};
+
+				err_led_pin: err-led-pin {
+					marvell,pins = "mpp45";
+					marvell,function = "gpio";
+				};
+			};
+
+			serial at 12000 {
+				clocks = <&coreclk 0>;
+				status = "okay";
+			};
+
+			mdio {
+				phy0: ethernet-phy at 0 {
+					compatible = "marvell,88e1318s";
+					reg = <0>;
+				};
+
+				phy1: ethernet-phy at 1 {
+					compatible = "marvell,88e1318s";
+					reg = <1>;
+				};
+			};
+
+			ethernet at 70000 {
+				status = "okay";
+				phy = <&phy0>;
+				phy-mode = "rgmii-id";
+			};
+
+			ethernet at 74000 {
+				status = "okay";
+				phy = <&phy1>;
+				phy-mode = "rgmii-id";
+			};
+
+			/* Front USB 2.0 port */
+			usb at 50000 {
+				status = "okay";
+			};
+
+			i2c at 11000 {
+				compatible = "marvell,mv78230-i2c";
+				clock-frequency = <400000>;
+				status = "okay";
+
+				/* Controller for rear fan #1 of 3 (Protechnic
+				 * MGT4012XB-O20, 8000RPM) near eSATA port */
+				g762_fan1: g762 at 3e {
+					compatible = "gmt,g762";
+					reg = <0x3e>;
+					clocks = <&g762_clk>; /* input clock */
+					fan_gear_mode = <0>;
+					fan_startv = <1>;
+					pwm_polarity = <0>;
+				};
+
+				/*  Controller for rear (center) fan #2 of 3 */
+				g762_fan2: g762 at 48 {
+					compatible = "gmt,g762";
+					reg = <0x48>;
+					clocks = <&g762_clk>; /* input clock */
+					fan_gear_mode = <0>;
+					fan_startv = <1>;
+					pwm_polarity = <0>;
+				};
+
+				/*  Controller for rear fan #3 of 3 */
+				g762_fan3: g762 at 49 {
+					compatible = "gmt,g762";
+					reg = <0x49>;
+					clocks = <&g762_clk>; /* input clock */
+					fan_gear_mode = <0>;
+					fan_startv = <1>;
+					pwm_polarity = <0>;
+				};
+
+				/* Temperature sensor */
+				g751: g751 at 4c {
+					compatible = "gmt,g751";
+					reg = <0x4c>;
+				};
+			};
+		};
+	};
+
+	clocks {
+	       g762_clk: g762-oscillator {
+			 compatible = "fixed-clock";
+			 #clock-cells = <0>;
+			 clock-frequency = <32768>;
+	       };
+	};
+
+	gpio-leds {
+		compatible = "gpio-leds";
+		pinctrl-0 = <&sata1_led_pin &sata2_led_pin &err_led_pin
+			     &sata3_led_pin &sata4_led_pin>;
+		pinctrl-names = "default";
+
+		red-sata1-led {
+			label = "rn2120:red:sata1";
+			gpios = <&gpio0 31 GPIO_ACTIVE_HIGH>;
+			default-state = "off";
+		};
+
+		red-sata2-led {
+			label = "rn2120:red:sata2";
+			gpios = <&gpio1 8 GPIO_ACTIVE_HIGH>;
+			default-state = "off";
+		};
+
+		red-sata3-led {
+			label = "rn2120:red:sata3";
+			gpios = <&gpio1 12 GPIO_ACTIVE_HIGH>;
+			default-state = "off";
+		};
+
+		red-sata4-led {
+			label = "rn2120:red:sata4";
+			gpios = <&gpio1 15 GPIO_ACTIVE_HIGH>;
+			default-state = "off";
+		};
+
+		red-err-led {
+			label = "rn2120:red:err";
+			gpios = <&gpio1 13 GPIO_ACTIVE_LOW>;
+			default-state = "off";
+		};
+	};
+
+	gpio-keys {
+		compatible = "gpio-keys";
+		pinctrl-0 = <&power_button_pin &reset_button_pin>;
+		pinctrl-names = "default";
+
+		power-button {
+			label = "Power Button";
+			linux,code = <KEY_POWER>;
+			gpios = <&gpio0 27 GPIO_ACTIVE_HIGH>;
+		};
+
+		reset-button {
+			label = "Reset Button";
+			linux,code = <KEY_RESTART>;
+			gpios = <&gpio1 9 GPIO_ACTIVE_LOW>;
+		};
+	};
+
+	gpio-poweroff {
+		compatible = "gpio-poweroff";
+		pinctrl-0 = <&poweroff>;
+		pinctrl-names = "default";
+		gpios = <&gpio1 10 GPIO_ACTIVE_LOW>;
+	};
+};
-- 
1.8.4.rc3

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

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

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-11-11 20:01 [PATCHv2] ARM: mvebu: Add Netgear ReadyNAS 2120 board Arnaud Ebalard
2013-11-11 20:01 ` Arnaud Ebalard
     [not found] ` <87bo1qhfnf.fsf-LkuqDEemtHBg9hUCZPvPmw@public.gmane.org>
2013-11-11 20:33   ` Sebastian Hesselbarth
2013-11-11 20:33     ` Sebastian Hesselbarth
     [not found]     ` <52813F25.40703-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2013-11-11 20:53       ` Arnaud Ebalard
2013-11-11 20:53         ` Arnaud Ebalard
2013-11-12 19:46 Arnaud Ebalard
2013-11-12 19:46 ` Arnaud Ebalard
     [not found] ` <87ppq5flnb.fsf-LkuqDEemtHBg9hUCZPvPmw@public.gmane.org>
2013-11-12 20:11   ` Jason Cooper
2013-11-12 20:11     ` Jason Cooper
     [not found]     ` <20131112201109.GT10335-u4khhh1J0LxI1Ri9qeTfzeTW4wlIGRCZ@public.gmane.org>
2013-11-12 20:53       ` Arnaud Ebalard
2013-11-12 20:53         ` Arnaud Ebalard
2013-11-24  3:49   ` Jason Cooper
2013-11-24  3:49     ` Jason Cooper
2013-11-24 11:52     ` Arnaud Ebalard
2013-11-24 11:52       ` Arnaud Ebalard
     [not found]       ` <87y54e819h.fsf-LkuqDEemtHBg9hUCZPvPmw@public.gmane.org>
2013-11-24 13:02         ` Jason Cooper
2013-11-24 13:02           ` Jason Cooper
     [not found]           ` <20131124130203.GB29241-u4khhh1J0LxI1Ri9qeTfzeTW4wlIGRCZ@public.gmane.org>
2013-11-24 14:09             ` Arnaud Ebalard
2013-11-24 14:09               ` Arnaud Ebalard

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.