Skip to contentSkip to conversation

ARM: mvebu: Add Netgear ReadyNAS 2120 board

PATCH Superseded Arnaud Ebalard 2 participants 3 messages Nov 11, 2013

Subsystems (2)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 ARM: mvebu: Add Netgear ReadyNAS 2120 board

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.

---
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
arch/arm/boot/dts/Makefile +1 -0
index 802720e..c6dd4de 100644
@@ -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 \
arch/arm/boot/dts/armada-xp-netgear-rn2120.dts new file +288 -0

288 lines not on this page · raw message

Signature · 1 line
1.8.4.rc3
#1 lore raw

PATCH v2 1/1 ARM: mvebu: Add Netgear ReadyNAS 2120 board

Quoted 14 lines · Arnaud Ebalard

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.

---

[...]

Quoted 12 lines
arch/arm/boot/dts/armada-xp-netgear-rn2120.dts new file +6 -0
new file mode 100644
index 0000000..ba1e0de
@@ -0,0 +1,288 @@
+/*
+ * Device Tree file for NETGEAR ReadyNAS 2120
+ *
+ * Copyright (C) 2013, Arnaud EBALARD <[email protected]>
+ *
+ * This program is free software; you can redistribute it and/or

arch/arm/boot/dts/armada-xp-netgear-rn2120.dts line 16

Quoted 10 lines
arch/arm/boot/dts/armada-xp-netgear-rn2120.dts new file +10 -0
+ * 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

Quoted 13 lines
arch/arm/boot/dts/armada-xp-netgear-rn2120.dts new file +13 -0
+/ {
+	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 */
+	};
+

[...]

arch/arm/boot/dts/armada-xp-netgear-rn2120.dts line 143

Quoted 4 lines
arch/arm/boot/dts/armada-xp-netgear-rn2120.dts new file +4 -0
+			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.

Quoted 33 lines
arch/arm/boot/dts/armada-xp-netgear-rn2120.dts new file +33 -0
+			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";

arch/arm/boot/dts/armada-xp-netgear-rn2120.dts line 187

Quoted 10 lines
arch/arm/boot/dts/armada-xp-netgear-rn2120.dts new file +10 -0
+
+				/* 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.

Quoted 23 lines
arch/arm/boot/dts/armada-xp-netgear-rn2120.dts new file +23 -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 */

arch/arm/boot/dts/armada-xp-netgear-rn2120.dts line 220

Quoted 10 lines
arch/arm/boot/dts/armada-xp-netgear-rn2120.dts new file +10 -0
+				g751: g751 at 4c {
+					compatible = "gmt,g751";
+					reg = <0x4c>;
+				};
+			};
+		};
+	};
+
+	clocks {
+	       g762_clk: g762_oscillator {

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

arch/arm/boot/dts/armada-xp-netgear-rn2120.dts line 233

Quoted 13 lines
arch/arm/boot/dts/armada-xp-netgear-rn2120.dts new file +13 -0
+			 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.

Quoted 26 lines
arch/arm/boot/dts/armada-xp-netgear-rn2120.dts new file +26 -0
+			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>;

arch/arm/boot/dts/armada-xp-netgear-rn2120.dts line 269

Quoted 10 lines
arch/arm/boot/dts/armada-xp-netgear-rn2120.dts new file +10 -0
+			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.

arch/arm/boot/dts/armada-xp-netgear-rn2120.dts line 282

Quoted 13 lines
arch/arm/boot/dts/armada-xp-netgear-rn2120.dts new file +13 -0
+			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,

Quoted 7 lines
arch/arm/boot/dts/armada-xp-netgear-rn2120.dts new file +6 -0
+		compatible = "gpio-poweroff";
+		pinctrl-0 = <&poweroff>;
+		pinctrl-names = "default";
+		gpios = <&gpio1 10 GPIO_ACTIVE_LOW>;
+	};
+};
#2 lore raw

PATCH v2 1/1 ARM: mvebu: Add Netgear ReadyNAS 2120 board

Hi Sebastian.

Quoted 8 lines · Sebastian Hesselbarth

arch/arm/boot/dts/armada-xp-netgear-rn2120.dts line 143

Quoted 4 lines
arch/arm/boot/dts/armada-xp-netgear-rn2120.dts new file +4 -0
+			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.

Quoted 6 lines

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+