Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ARM: dts: armada-370: Add WD My Cloud EX2 (Gen1)
@ 2026-11-17 22:02 ImAthanasia
  0 siblings, 0 replies; 2+ messages in thread
From: ImAthanasia @ 2026-11-17 22:02 UTC (permalink / raw)
  To: linux-arm-kernel; +Cc: devicetree, linux-kernel, ImAthanasia

Hello,

This adds a board file for the Western Digital My Cloud EX2 (Gen1) NAS
(board RD-88F6710 "KingsCanyon", Marvell Armada 370 / 88F6710), which has
no mainline board file today.

Enabled by the board: both SATA ports, USB2 and USB3 hosts, gpio HDD
status LEDs, the 4-GPIO chassis fan (gpio-fan, 1500/1700/1800/2100 rpm
speed map), the rear reset button, mvneta ethernet with the Marvell
88E1510 phy (rgmii-id), fixed regulators gating USB and SATA disk power,
and the NAND controller with the stock fixed partition layout.

The NAND node sets "marvell,nand-keep-config". This is required on this
board: the stock bootloader programs controller timings that mainline does
not reproduce, and reprogramming them corrupts reads and aborts writes.
This is the established pattern for NAS boxes on this platform, not a WD
quirk: the same property (with nand-on-flash-bbt and ECC 4/512) is used by
armada-370-dlink-dns327l.dts, armada-370-netgear-rn102.dts and
armada-370-netgear-rn104.dts, and by WD's own EX2 Ultra / Mirror Gen2 board
file (arch/arm/boot/dts/marvell/armada-385-wd_cloud.dtsi in OpenWrt).

The file is derived from the Armada 370 DB reference design with the
community GPL description for the WD My Cloud Mirror Gen1 as the hardware
reference, adjusted to the EX2: NAND moved to the mainline
nand-controller + nand@0 binding (the legacy "nand@d0000" node has no reg
resource), and the gpio-fan node does not claim an alarm gpio overlapping
one of the fan speed GPIOs.

Tested on hardware with 6.12.117: boots unattended from NAND with a USB
root, RAID1 md0 assembles, LEDs/fan/ethernet/NAND operational; UBI/UBIFS
volumes attach, mount and persist across reboots. The DTB passes
dtbs_check with the same legacy-dtsi warning set as the existing
armada-370 boards (57, identical to armada-370-netgear-rn102.dtb), with
zero board-specific findings.

Tool-assistance disclosure: portions of this patch were prepared with the
help of an AI coding assistant; I reviewed, built, and tested the result on
hardware and take full responsibility for its content. Signed-off-by is
mine (human).

Best regards,
ImAthanasia
https://github.com/ImAthanasia


Signed-off-by: ImAthanasia <pwnzorius@gmail.com>
---
 arch/arm/boot/dts/marvell/Makefile            |   1 +
 .../marvell/armada-370-wd-my-cloud-ex2.dts    | 285 ++++++++++++++++++
 2 files changed, 286 insertions(+)
 create mode 100644 arch/arm/boot/dts/marvell/armada-370-wd-my-cloud-ex2.dts

diff --git a/arch/arm/boot/dts/marvell/Makefile b/arch/arm/boot/dts/marvell/Makefile
index fc4273b..e923397 100644
--- a/arch/arm/boot/dts/marvell/Makefile
+++ b/arch/arm/boot/dts/marvell/Makefile
@@ -164,6 +164,7 @@ dtb-$(CONFIG_MACH_KIRKWOOD) += \
 	kirkwood-ts419-6281.dtb \
 	kirkwood-ts419-6282.dtb
 
+dtb-$(CONFIG_MACH_ARMADA_370) += armada-370-wd-my-cloud-ex2.dtb
 dtb-$(CONFIG_MACH_ARMADA_370) += armada-370-wd-my-cloud-ex2-appliance.dtb
 dtb-$(CONFIG_MACH_ARMADA_370) += armada-370-wd-my-cloud-ex2-appliance-big.dtb
 dtb-$(CONFIG_MACH_ARMADA_370) += armada-370-wd-my-cloud-ex2-appliance-big-keepcfg.dtb
diff --git a/arch/arm/boot/dts/marvell/armada-370-wd-my-cloud-ex2.dts b/arch/arm/boot/dts/marvell/armada-370-wd-my-cloud-ex2.dts
new file mode 100644
index 0000000..6394ba0
--- /dev/null
+++ b/arch/arm/boot/dts/marvell/armada-370-wd-my-cloud-ex2.dts
@@ -0,0 +1,285 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * Device Tree file for the Western Digital My Cloud EX2 (Gen1)
+ *
+ * Board: RD-88F6710_Alpha_KingsCanyon, Marvell Armada 370 (88F6710)
+ *
+ * Derived from the Marvell Armada 370 DB reference design and the
+ * community WD My Cloud Mirror Gen1 description.
+ *
+ * Copyright (C) 2012 Marvell
+ *   Lior Amsalem <alior@marvell.com>
+ *   Gregory C Clement <gregory.clement@free-electrons.com>
+ *   Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+ *   Allester Fox <fox.axon@gmail.com>
+ */
+
+/dts-v1/;
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/gpio/gpio.h>
+#include "armada-370.dtsi"
+
+/ {
+	model = "WD My Cloud EX2 (Gen1)";
+	compatible = "wd,my-cloud-ex2", "marvell,armada370", "marvell,armada-370-xp";
+
+	chosen {
+		stdout-path = "serial0:115200n8";
+	};
+
+	memory@0 {
+		device_type = "memory";
+		reg = <0x00000000 0x20000000>; /* 512 MiB */
+	};
+
+	soc {
+		ranges = <MBUS_ID(0xf0, 0x01) 0 0xf1000000 0x100000
+			  MBUS_ID(0x01, 0xe0) 0 0xfff00000 0x100000
+			  MBUS_ID(0x09, 0x01) 0 0xf1100000 0x10000>;
+
+		internal-regs {
+			sata@a0000 {
+				nr-ports = <2>;
+				status = "okay";
+			};
+
+			usb@50000 {
+				status = "okay";
+			};
+
+			usb@51000 {
+				status = "okay";
+			};
+		};
+	};
+
+	gpio-keys {
+		compatible = "gpio-keys";
+		pinctrl-0 = <&reset_button_pin>;
+		pinctrl-names = "default";
+
+		reset-button {
+			label = "Reset Button";
+			linux,code = <KEY_RESTART>;
+			gpios = <&gpio2 1 GPIO_ACTIVE_LOW>;
+		};
+	};
+
+	gpio-leds {
+		compatible = "gpio-leds";
+		pinctrl-names = "default";
+		pinctrl-0 = <&led_pins>;
+
+		led-0 {
+			label = "hdd1-blue";
+			gpios = <&gpio1 25 GPIO_ACTIVE_HIGH>;
+			default-state = "keep";
+		};
+
+		led-1 {
+			label = "hdd2-blue";
+			gpios = <&gpio1 23 GPIO_ACTIVE_HIGH>;
+			default-state = "keep";
+		};
+
+		led-2 {
+			label = "hdd1-red";
+			gpios = <&gpio1 21 GPIO_ACTIVE_HIGH>;
+			default-state = "keep";
+		};
+
+		led-3 {
+			label = "hdd2-red";
+			gpios = <&gpio1 20 GPIO_ACTIVE_HIGH>;
+			default-state = "keep";
+		};
+	};
+
+	gpio-fan {
+		status = "okay";
+		compatible = "gpio-fan";
+		pinctrl-names = "default";
+		pinctrl-0 = <&fan_pins>;
+
+		gpios = <&gpio0 8 GPIO_ACTIVE_HIGH>,
+			<&gpio0 16 GPIO_ACTIVE_HIGH>,
+			<&gpio1 0 GPIO_ACTIVE_HIGH>,
+			<&gpio0 6 GPIO_ACTIVE_HIGH>;
+		gpio-fan,speed-map = <0 0>,
+				     <1500 1>,
+				     <1700 2>,
+				     <1800 3>,
+				     <2100 4>;
+	};
+
+	usb_power: regulator-usb {
+		compatible = "regulator-fixed";
+		pinctrl-0 = <&xhci_pwr_pin>;
+		pinctrl-names = "default";
+		regulator-name = "USB3.0 Port Power";
+		regulator-min-microvolt = <5000000>;
+		regulator-max-microvolt = <5000000>;
+		enable-active-high;
+		regulator-boot-on;
+		regulator-always-on;
+		gpio = <&gpio0 13 GPIO_ACTIVE_HIGH>;
+	};
+
+	sata_1_power: regulator-sata1 {
+		compatible = "regulator-fixed";
+		regulator-name = "SATA-1 Power";
+		regulator-min-microvolt = <5000000>;
+		regulator-max-microvolt = <5000000>;
+		startup-delay-us = <2000000>;
+		enable-active-high;
+		regulator-always-on;
+		regulator-boot-on;
+		gpio = <&gpio1 22 GPIO_ACTIVE_HIGH>;
+	};
+
+	sata_2_power: regulator-sata2 {
+		compatible = "regulator-fixed";
+		pinctrl-0 = <&sata_2_pwr_pin>;
+		pinctrl-names = "default";
+		regulator-name = "SATA-2 Power";
+		regulator-min-microvolt = <5000000>;
+		regulator-max-microvolt = <5000000>;
+		startup-delay-us = <4000000>;
+		enable-active-high;
+		regulator-always-on;
+		regulator-boot-on;
+		gpio = <&gpio1 24 GPIO_ACTIVE_HIGH>;
+	};
+};
+
+&pciec {
+	status = "okay";
+
+	pcie@1,0 {
+		status = "okay";
+	};
+
+	pcie@2,0 {
+		status = "okay";
+	};
+};
+
+&pinctrl {
+	led_pins: led-pins {
+		marvell,pins = "mpp52", "mpp53", "mpp57", "mpp55";
+		marvell,function = "gpio";
+	};
+
+	fan_pins: fan-pins {
+		marvell,pins = "mpp6", "mpp8", "mpp16", "mpp32";
+		marvell,function = "gpio";
+	};
+
+	xhci_pwr_pin: xhci-pwr-pin {
+		marvell,pins = "mpp13";
+		marvell,function = "gpio";
+	};
+
+	sata_1_pwr_pin: sata-1-pwr-pin {
+		marvell,pins = "mpp54";
+		marvell,function = "gpio";
+	};
+
+	sata_2_pwr_pin: sata-2-pwr-pin {
+		marvell,pins = "mpp56";
+		marvell,function = "gpio";
+	};
+
+	uart1_pins: uart1-pins {
+		marvell,pins = "mpp60", "mpp61";
+		marvell,function = "uart1";
+	};
+
+	reset_button_pin: reset-button-pin {
+		marvell,pins = "mpp64";
+		marvell,function = "gpio";
+	};
+};
+
+&uart0 {
+	status = "okay";
+};
+
+&uart1 {
+	pinctrl-0 = <&uart1_pins>;
+	pinctrl-names = "default";
+	status = "okay";
+};
+
+&mdio {
+	phy0: ethernet-phy@0 {
+		reg = <0>;
+	};
+};
+
+&eth1 {
+	phy = <&phy0>;
+	phy-mode = "rgmii-id";
+	status = "okay";
+};
+
+&i2c0 {
+	clock-frequency = <100000>;
+	status = "okay";
+};
+
+&nand_controller {
+	status = "okay";
+
+	nand@0 {
+		reg = <0>;
+		label = "pxa3xx_nand-0";
+		nand-rb = <0>;
+		marvell,nand-keep-config;
+		nand-on-flash-bbt;
+		nand-ecc-strength = <4>;
+		nand-ecc-step-size = <512>;
+
+		partitions {
+			compatible = "fixed-partitions";
+			#address-cells = <1>;
+			#size-cells = <1>;
+
+			partition@0 {
+				label = "u-boot";
+				reg = <0x00000000 0x00500000>;
+				read-only;
+			};
+
+			partition@500000 {
+				label = "uimage";
+				reg = <0x00500000 0x00500000>;
+			};
+
+			partition@a00000 {
+				label = "ramdisk";
+				reg = <0x00a00000 0x00500000>;
+			};
+
+			partition@f00000 {
+				label = "image.cfs";
+				reg = <0x00f00000 0x0c900000>;
+			};
+
+			partition@dd00000 {
+				label = "rescue-firmware";
+				reg = <0x0dd00000 0x00f00000>;
+			};
+
+			partition@ec00000 {
+				label = "config";
+				reg = <0x0ec00000 0x01400000>;
+			};
+
+			partition@d800000 {
+				label = "reserve";
+				reg = <0x0d800000 0x00500000>;
+			};
+		};
+	};
+};
-- 
2.39.5



^ permalink raw reply related	[flat|nested] 2+ messages in thread
[parent not found: <CADS6G6JDXAP7PzKWqmq69ViC6Gim9o+9pQ=ctuaiEboJ-WsS6g@mail.gmail.com>]

end of thread, other threads:[~2026-11-17 22:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-17 22:02 [PATCH] ARM: dts: armada-370: Add WD My Cloud EX2 (Gen1) ImAthanasia
     [not found] <CADS6G6JDXAP7PzKWqmq69ViC6Gim9o+9pQ=ctuaiEboJ-WsS6g@mail.gmail.com>
2026-11-17 21:11 ` Andrew Lunn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox