[OpenWrt-Devel] [PATCH 2/2] mvebu: LS421DE: add linkstation-poweroff module

Daniel González Cabanelas dgcbueu at gmail.com
Wed Apr 22 17:42:24 EDT 2020


The Buffalo LinkStation LS421DE has the power off function broken

Fix it by including the linkstation-poweroff module to the image creation
and adding it to the device tree file.

Signed-off-by: Daniel González Cabanelas <dgcbueu at gmail.com>
---
 .../arm/boot/dts/armada-370-buffalo-ls421de.dts | 17 ++++++++---------
 .../arm/boot/dts/armada-370-buffalo-ls421de.dts | 17 ++++++++---------
 target/linux/mvebu/image/cortexa9.mk            |  5 +++--
 3 files changed, 19 insertions(+), 20 deletions(-)

diff --git a/target/linux/mvebu/files-4.19/arch/arm/boot/dts/armada-370-buffalo-ls421de.dts b/target/linux/mvebu/files-4.19/arch/arm/boot/dts/armada-370-buffalo-ls421de.dts
index 6b8a964ab3..212c05c15b 100644
--- a/target/linux/mvebu/files-4.19/arch/arm/boot/dts/armada-370-buffalo-ls421de.dts
+++ b/target/linux/mvebu/files-4.19/arch/arm/boot/dts/armada-370-buffalo-ls421de.dts
@@ -172,10 +172,9 @@
 		};
 	};
 
-	/* FIXME: this driver needs to be aware of the LED2 eth phy use,
-	   which must be set to off state before shutting down the machine */
 	restart_poweroff {
-		compatible = "restart-poweroff";
+		compatible = "linkstation,power-off";
+		phy-handle,led = <&ethphy0>;
 	};
 };
 
@@ -183,8 +182,8 @@
 	pinctrl-0 = <&ge1_rgmii_pins>;
 	pinctrl-names = "default";
 	status = "okay";
-	phy = <&phy0>;
-	phy-mode = "rgmii-id";
+	phy-handle = <&ethphy0>;
+	phy-connection-type = "rgmii-id";
 };
 
 &i2c0 {
@@ -201,11 +200,11 @@
 	pinctrl-0 = <&mdio_pins>;
 	pinctrl-names = "default";
 
-	phy0: ethernet-phy at 0 { /* Marvell 88E1518 */
+	ethphy0: ethernet-phy at 0 { /* Marvell 88E1518 */
 		reg = <0>;
-		/* LED2 is used to inform uBoot if the power-switch was slided
-		   to the "off" position, and then power off the machine.
-		   Page 0x3, Register 0x10, bit 8:
+		/* LED2 is used to inform, after restarting, if the power-switch
+		   was slided to the "off" position, and then power off the machine.
+		   Page 0x3, Register 0x10, bits 8-11:
 				0x800: LED2 off, power off the machine
 				0x900: LED2 on, boot the machine */
 		marvell,reg-init = <0x3 0x10 0x1 0x1991>, /* LED Function */
diff --git a/target/linux/mvebu/files-5.4/arch/arm/boot/dts/armada-370-buffalo-ls421de.dts b/target/linux/mvebu/files-5.4/arch/arm/boot/dts/armada-370-buffalo-ls421de.dts
index 6b8a964ab3..212c05c15b 100644
--- a/target/linux/mvebu/files-5.4/arch/arm/boot/dts/armada-370-buffalo-ls421de.dts
+++ b/target/linux/mvebu/files-5.4/arch/arm/boot/dts/armada-370-buffalo-ls421de.dts
@@ -172,10 +172,9 @@
 		};
 	};
 
-	/* FIXME: this driver needs to be aware of the LED2 eth phy use,
-	   which must be set to off state before shutting down the machine */
 	restart_poweroff {
-		compatible = "restart-poweroff";
+		compatible = "linkstation,power-off";
+		phy-handle,led = <&ethphy0>;
 	};
 };
 
@@ -183,8 +182,8 @@
 	pinctrl-0 = <&ge1_rgmii_pins>;
 	pinctrl-names = "default";
 	status = "okay";
-	phy = <&phy0>;
-	phy-mode = "rgmii-id";
+	phy-handle = <&ethphy0>;
+	phy-connection-type = "rgmii-id";
 };
 
 &i2c0 {
@@ -201,11 +200,11 @@
 	pinctrl-0 = <&mdio_pins>;
 	pinctrl-names = "default";
 
-	phy0: ethernet-phy at 0 { /* Marvell 88E1518 */
+	ethphy0: ethernet-phy at 0 { /* Marvell 88E1518 */
 		reg = <0>;
-		/* LED2 is used to inform uBoot if the power-switch was slided
-		   to the "off" position, and then power off the machine.
-		   Page 0x3, Register 0x10, bit 8:
+		/* LED2 is used to inform, after restarting, if the power-switch
+		   was slided to the "off" position, and then power off the machine.
+		   Page 0x3, Register 0x10, bits 8-11:
 				0x800: LED2 off, power off the machine
 				0x900: LED2 on, boot the machine */
 		marvell,reg-init = <0x3 0x10 0x1 0x1991>, /* LED Function */
diff --git a/target/linux/mvebu/image/cortexa9.mk b/target/linux/mvebu/image/cortexa9.mk
index 4ab6f4a7e8..77be07801d 100644
--- a/target/linux/mvebu/image/cortexa9.mk
+++ b/target/linux/mvebu/image/cortexa9.mk
@@ -17,8 +17,9 @@ define Device/buffalo_ls421de
   KERNEL_INITRAMFS := kernel-bin | append-dtb | uImage none
   DEVICE_DTS := armada-370-buffalo-ls421de
   DEVICE_PACKAGES :=  \
-    kmod-rtc-rs5c372a kmod-hwmon-gpiofan kmod-usb3 kmod-md-raid0 \
-    kmod-md-raid1 kmod-md-mod kmod-fs-xfs mkf2fs e2fsprogs partx-utils
+    kmod-rtc-rs5c372a kmod-hwmon-gpiofan kmod-linkstation-poweroff \
+    kmod-usb3 kmod-md-raid0 kmod-md-raid1 kmod-md-mod kmod-fs-xfs \
+    mkf2fs e2fsprogs partx-utils
 endef
 TARGET_DEVICES += buffalo_ls421de
 
-- 
2.26.2





_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


More information about the openwrt-devel mailing list