Help needed for porting Buffalo LS421DE img to LS220DE

Well, kernel at least uses that driver:
[ 10.978617] mvneta d0074000.ethernet eth0: PHY [d0072004.mdio-mii:00] driver [Marvell 88E1318S] (irq=POLL)
In the 421's, that eth chip is visible? So I would disassemble my case and doublecheck before proceeding.

I sysupgded maintaining the configs, via webgui, and "works" -- but now webgui stalls in the "Loading view…" redirect of cgi-bin/luci/. SSH normal.

After sysupg boot, fan just didn't started. But in the subsequent reboots, fan starts at full throttle (Buffalo style), and calm downs l8r. I'll see how behaves on heat.

Indeed, eth led wasn't blinking before, now behaves as expected.

Power button working as expected.

L8r will sysupg again via console, resetting configs, let's see if webgui returns.

This wiki says it's a 88EC048, probably an alias of Marvell 88E1318S

BTW this bug comes from the Buffalo software. They didn't configure the correct voltage in the bootloader nor in the firmware. It might cause unexpected errors on the device.

1 Like

It seems there is a bug with last Luci commits. I reverted Luci to 09d68fb2e3061710be1b3b56467eb43c9c0dc32d commit.

I reuploaded the stuff with Luci fixed: openwrt-ls220de-test.zip

1 Like

Luci webgui returned in last file.

Just to clarify, it's a ram or a nand write? If nand, need to run just once after sysupg? The address/pointer won't change on each sysupg version/commit?

In order to configure mdadm, it's needed to rename/delete /etc/config/mdadm and restart service.
I'm unable to mount the buffalo xfs share, after getting /dev/md10 with mdadm, mount returns:
mount: mounting /dev/md10 on /mnt/warezRAID/ failed: Invalid argument

And dmesg | tail:

[  265.408270] F2FS-fs (md10): Magic Mismatch, valid(0xf2f52010) - read(0x0)
[  265.415115] F2FS-fs (md10): Can't find valid F2FS filesystem in 1th superblock
[  265.422915] F2FS-fs (md10): Magic Mismatch, valid(0xf2f52010) - read(0x0)
[  265.429838] F2FS-fs (md10): Can't find valid F2FS filesystem in 2th superblock
[  265.440052] XFS (md10): Deprecated V4 format (crc=0) not supported by kernel.

I observed lsblk (and libmount1 dependency) missing on main build, I think it's a fundamental tool.

Couldn't do stress tests on cooling behavior, yet.

It's a RAM write. Therefore required on every boot. To fix it forever you need an Uboot modification to configure this particular register on the SoC.

I removed trailing whitespaces that git apply claimed, and renamed to ls220dE.patch.

diff --git a/package/boot/uboot-envtools/files/mvebu b/package/boot/uboot-envtools/files/mvebu
index cffd396ae1..e07e797858 100644
--- a/package/boot/uboot-envtools/files/mvebu
+++ b/package/boot/uboot-envtools/files/mvebu
@@ -13,6 +13,7 @@ touch /etc/config/ubootenv
 board=$(board_name)
 
 case "$board" in
+buffalo,ls220de|\
 buffalo,ls421de)
 	ubootenv_add_uci_config "/dev/mtd3" "0x0" "0x10000"
 	;;
diff --git a/target/linux/mvebu/cortexa9/base-files/etc/board.d/02_network b/target/linux/mvebu/cortexa9/base-files/etc/board.d/02_network
index c613a3cd60..d2229fe6bf 100644
--- a/target/linux/mvebu/cortexa9/base-files/etc/board.d/02_network
+++ b/target/linux/mvebu/cortexa9/base-files/etc/board.d/02_network
@@ -61,6 +61,7 @@ mvebu_setup_macs()
 	local label_mac=""
 
 	case "$board" in
+	buffalo,ls220de|\
 	buffalo,ls421de)
 		lan_mac=$(mtd_get_mac_ascii u-boot-env eth1addr)
 		;;
diff --git a/target/linux/mvebu/cortexa9/base-files/lib/upgrade/platform.sh b/target/linux/mvebu/cortexa9/base-files/lib/upgrade/platform.sh
index 18b978d437..b879296e3b 100755
--- a/target/linux/mvebu/cortexa9/base-files/lib/upgrade/platform.sh
+++ b/target/linux/mvebu/cortexa9/base-files/lib/upgrade/platform.sh
@@ -23,8 +23,29 @@ platform_check_image() {
 	esac
 }
 
+platform_do_upgrade_buffalo_nand() {
+	CI_KERNPART=none
+
+	local fw_mtd=$(find_mtd_part kernel)
+	fw_mtd="${fw_mtd/block/}"
+	[ -n "$fw_mtd" ] || return
+
+	local board_dir=$(tar tf "$1" | grep -m 1 '^sysupgrade-.*/$')
+	board_dir=${board_dir%/}
+	[ -n "$board_dir" ] || return
+
+	mtd erase kernel
+	tar xf "$1" ${board_dir}/kernel
+	nandwrite "$fw_mtd" ${board_dir}/kernel
+
+	nand_do_upgrade "$1"
+}
+
 platform_do_upgrade() {
 	case "$(board_name)" in
+	buffalo,ls220de)
+		platform_do_upgrade_buffalo_nand "$1"
+		;;
 	buffalo,ls421de)
 		nand_do_upgrade "$1"
 		;;
diff --git a/target/linux/mvebu/files/arch/arm/boot/dts/armada-370-buffalo-ls220de.dts b/target/linux/mvebu/files/arch/arm/boot/dts/armada-370-buffalo-ls220de.dts
new file mode 100644
index 0000000000..d82a3f23bb
--- /dev/null
+++ b/target/linux/mvebu/files/arch/arm/boot/dts/armada-370-buffalo-ls220de.dts
@@ -0,0 +1,361 @@
+// SPDX-License-Identifier: (GPL-2.0-or-later OR MIT)
+/*
+ * Device Tree file for Buffalo LinkStation LS220DE
+ *
+ * Copyright (C) 2020 Daniel González Cabanelas <dgcbueu@gmail.com>
+ */
+
+/dts-v1/;
+
+#include "armada-370.dtsi"
+#include "mvebu-linkstation-fan.dtsi"
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/thermal/thermal.h>
+
+/ {
+	model = "Buffalo LinkStation LS220DE";
+	compatible = "buffalo,ls220de", "marvell,armada370", "marvell,armada-370-xp";
+
+	aliases {
+		led-boot = &led_boot;
+		led-failsafe = &led_failsafe;
+		led-running = &led_power;
+		led-upgrade = &led_upgrade;
+	};
+
+	chosen {
+		bootargs = "earlycon";
+		stdout-path = "serial0:115200n8";
+		append-rootblock = "nullparameter="; /* override the bootloader args */
+	};
+
+	memory {
+		device_type = "memory";
+		reg = <0x00000000 0x10000000>; /* 256 MB */
+	};
+
+	soc {
+		ranges = <MBUS_ID(0xf0, 0x01) 0 0xd0000000 0x100000
+			  MBUS_ID(0x01, 0xe0) 0 0xfff00000 0x100000
+			  MBUS_ID(0x09, 0x01) 0 0xf1100000 0x10000>;
+	};
+
+	system_fan: gpio_fan {
+		gpios = <&gpio0 13 GPIO_ACTIVE_HIGH
+			 &gpio0 14 GPIO_ACTIVE_HIGH>;
+		alarm-gpios = <&gpio0 10 GPIO_ACTIVE_HIGH>;
+
+		#cooling-cells = <2>;
+	};
+
+	thermal-zones {
+		hdd-thermal {
+			polling-delay = <20000>;
+			polling-delay-passive = <2000>;
+
+			thermal-sensors = <&hdd0_temp>; /* only one drivetemp sensor is supported */
+
+			trips {
+				hdd_alert1: trip1 {
+					temperature = <36000>;
+					hysteresis = <2000>;
+					type = "active";
+				};
+				hdd_alert2: trip2 {
+					temperature = <44000>;
+					hysteresis = <2000>;
+					type = "active";
+				};
+				hdd_alert3: trip3 {
+					temperature = <52000>;
+					hysteresis = <2000>;
+					type = "passive";
+				};
+				hdd_crit: trip4 {
+					temperature = <60000>;
+					hysteresis = <2000>;
+					type = "critical";
+				};
+			};
+
+			cooling-maps {
+				map1 {
+					trip = <&hdd_alert1>;
+					cooling-device = <&system_fan THERMAL_NO_LIMIT 1>;
+				};
+				map2 {
+					trip = <&hdd_alert2>;
+					cooling-device = <&system_fan 2 2>;
+				};
+				map3 {
+					trip = <&hdd_alert3>;
+					cooling-device = <&system_fan 3 THERMAL_NO_LIMIT>;
+				};
+			};
+		};
+	};
+
+	gpio_keys {
+		compatible = "gpio-keys";
+		pinctrl-0 = <&pmx_buttons>;
+		pinctrl-names = "default";
+
+		power {
+			label = "Power Switch";
+			linux,code = <KEY_POWER>;
+			linux,input-type = <EV_SW>;
+			gpios = <&gpio0 15 GPIO_ACTIVE_LOW>;
+		};
+
+		function {
+			label = "Function Button";
+			linux,code = <KEY_CONFIG>;
+			gpios = <&gpio0 16 GPIO_ACTIVE_LOW>;
+		};
+	};
+
+	gpio_leds {
+		compatible = "gpio-leds";
+		pinctrl-names = "default";
+		pinctrl-0 = <&pmx_leds1 &pmx_leds2>;
+
+		system_red {
+			label = "ls421de:red:system";
+			gpios = <&gpio0 7 GPIO_ACTIVE_HIGH>;
+		};
+
+		led_power: power_white {
+			label = "ls421de:white:power";
+			gpios = <&gpio1 22 GPIO_ACTIVE_HIGH>;
+			default-state = "on";
+		};
+
+		led_failsafe: power_red {
+			label = "ls421de:red:power";
+			gpios = <&gpio1 23 GPIO_ACTIVE_HIGH>;
+		};
+
+		led_upgrade: power_orange {
+			label = "ls421de:orange:power";
+			gpios = <&gpio1 25 GPIO_ACTIVE_HIGH>;
+		};
+
+		led_boot: system_white {
+			label = "ls421de:white:system";
+			gpios = <&gpio1 27 GPIO_ACTIVE_HIGH>;
+		};
+
+		hdd1_red {
+			label = "ls421de:red:hdd1";
+			gpios = <&gpio1 29 GPIO_ACTIVE_HIGH>;
+			linux,default-trigger = "ata1";
+		};
+
+		hdd2_red {
+			label = "ls421de:red:hdd2";
+			gpios = <&gpio1 30 GPIO_ACTIVE_HIGH>;
+			linux,default-trigger = "ata2";
+		};
+	};
+
+	regulators {
+		compatible = "simple-bus";
+		#address-cells = <1>;
+		#size-cells = <0>;
+		pinctrl-0 = <&pmx_power_hdd1 &pmx_power_hdd2>;
+		pinctrl-names = "default";
+
+		sata1_power: regulator@1 {
+			compatible = "regulator-fixed";
+			reg = <1>;
+			regulator-name = "HDD1";
+			regulator-min-microvolt = <12000000>;
+			regulator-max-microvolt = <12000000>;
+			startup-delay-us = <2000000>;
+			enable-active-high;
+			regulator-always-on;
+			regulator-boot-on;
+			gpio = <&gpio0 8 GPIO_ACTIVE_HIGH>;
+		};
+
+		sata2_power: regulator@2 {
+			compatible = "regulator-fixed";
+			reg = <2>;
+			regulator-name = "HDD2";
+			regulator-min-microvolt = <12000000>;
+			regulator-max-microvolt = <12000000>;
+			startup-delay-us = <4000000>;
+			enable-active-high;
+			regulator-always-on;
+			regulator-boot-on;
+			gpio = <&gpio0 2 GPIO_ACTIVE_HIGH>;
+		};
+	};
+};
+
+&coherencyfab {
+	broken-idle;
+};
+
+&eth1 {
+	pinctrl-0 = <&ge1_rgmii_pins>;
+	pinctrl-names = "default";
+	status = "okay";
+	phy-handle = <&ethphy0>;
+	phy-connection-type = "rgmii-id";
+};
+
+&mdio {
+	pinctrl-0 = <&mdio_pins>;
+	pinctrl-names = "default";
+
+	ethphy0: ethernet-phy@0 { /* Marvell 88E1318 */
+		reg = <0>;
+		marvell,reg-init = <0x2 0x10 0xffff 0x0006>, /* disable CLK125 */
+				   <0x3 0x10 0xf000 0x0918>, /* LED function */
+				   <0x3 0x11 0x0000 0x4401>, /* LED polarity */
+				   <0x3 0x12 0x0000 0x4905>; /* LED timer */
+		#thermal-sensor-cells = <0>;
+	};
+};
+
+&pmsu {
+	pinctrl-0 = <&pmx_power_cpu>;
+	pinctrl-names = "default";
+};
+
+&sata {
+	nr-ports = <2>;
+	status = "okay";
+	#address-cells = <1>;
+	#size-cells = <0>;
+
+	hdd0_temp: sata-port@0 {
+		reg = <0>;
+		#thermal-sensor-cells = <0>;
+	};
+
+	hdd1_temp: sata-port@1 {
+		reg = <1>;
+		#thermal-sensor-cells = <0>;
+	};
+};
+
+&uart0 {
+	status = "okay";
+};
+
+&usb0 {
+	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 = "kernel";
+				reg = <0x00000000 0x02000000>;  /* 32 MiB */
+			};
+
+			partition@2000000 {
+				label = "ubi";
+				reg = <0x02000000 0x1e000000>;  /* 480 MiB */
+			};
+		};
+	};
+};
+
+&spi0 {
+	status = "okay";
+	pinctrl-0 = <&spi0_pins2>;
+	pinctrl-names = "default";
+
+	spi-flash@0 {
+		compatible = "mxicy,mx25l8005", "jedec,spi-nor";
+		reg = <0>; /* Chip select 0 */
+		spi-max-frequency = <50000000>;
+
+		partitions {
+			compatible = "fixed-partitions";
+			#address-cells = <1>;
+			#size-cells = <1>;
+
+			partition@0 {
+				reg = <0x00000 0xf0000>; /* 960 KiB*/
+				label = "u-boot";
+				read-only;
+			};
+			partition@f0000 {
+				reg = <0xf0000 0x10000>; /* 64 KiB */
+				label = "u-boot-env";
+			};
+		};
+	};
+};
+
+&pinctrl {
+	pmx_power_cpu: pmx-power-cpu {
+		marvell,pins = "mpp4";
+		marvell,function = "vdd";
+	};
+
+	pmx_power_hdd1: pmx-power-hdd1 {
+		marvell,pins = "mpp8";
+		marvell,function = "gpio";
+	};
+
+	pmx_power_hdd2: pmx-power-hdd2 {
+		marvell,pins = "mpp2";
+		marvell,function = "gpo";
+	};
+
+	pmx_fan_lock: pmx-fan-lock {
+		marvell,pins = "mpp10";
+		marvell,function = "gpio";
+	};
+
+	pmx_hdd_present: pmx-hdd-present {
+		marvell,pins = "mpp11", "mpp12";
+		marvell,function = "gpio";
+	};
+
+	pmx_fan_high: pmx-fan-high {
+		marvell,pins = "mpp13";
+		marvell,function = "gpio";
+	};
+
+	pmx_fan_low: pmx-fan-low {
+		marvell,pins = "mpp14";
+		marvell,function = "gpio";
+	};
+
+	pmx_buttons: pmx-buttons {
+		marvell,pins = "mpp15", "mpp16";
+		marvell,function = "gpio";
+	};
+
+	pmx_leds1: pmx-leds {
+		marvell,pins = "mpp7", "mpp54", "mpp59", "mpp61";
+		marvell,function = "gpo";
+	};
+
+	pmx_leds2: pmx-leds {
+		marvell,pins = "mpp55", "mpp57", "mpp62";
+		marvell,function = "gpio";
+	};
+};
diff --git a/target/linux/mvebu/image/Makefile b/target/linux/mvebu/image/Makefile
index 44e66a5f87..a13b61c1eb 100644
--- a/target/linux/mvebu/image/Makefile
+++ b/target/linux/mvebu/image/Makefile
@@ -51,6 +51,20 @@ define Build/buffalo-kernel-jffs2
 	rm -rf $(KDIR)/kernel_jffs2 $@.fakerd
 endef
 
+define Build/buffalo-kernel-ubifs
+	rm -rf $@-ubidir $@.ubi
+	mkdir -p $@-ubidir
+	mv $@ $@-ubidir/uImage.buffalo
+	touch $@
+	$(call Build/append-uImage-fakehdr, ramdisk)
+	mv $@ $@-ubidir/initrd.buffalo
+	$(STAGING_DIR_HOST)/bin/mkfs.ubifs \
+		$(KERNEL_UBIFS_OPTS) -r $@-ubidir $@.ubi
+	sh $(TOPDIR)/scripts/ubinize-image.sh \
+		--part boot=$@.ubi=20 $@ -p $(BLOCKSIZE:%k=%KiB) -m $(PAGESIZE) \
+		-s $(SUBPAGESIZE) -O $(VID_HDR_OFFSET) $(UBINIZE_OPTS)
+endef
+
 # Some info about Ctera firmware:
 # 1. It's simple tar file (GNU standard), but it must have ".firm" suffix.
 # 2. It contains two images: kernel and romdisk. Both are required.
diff --git a/target/linux/mvebu/image/cortexa9.mk b/target/linux/mvebu/image/cortexa9.mk
index 6715a41c9e..1c96ae47d6 100644
--- a/target/linux/mvebu/image/cortexa9.mk
+++ b/target/linux/mvebu/image/cortexa9.mk
@@ -14,14 +14,30 @@ define Device/kernel-size-migration
 	Upgrade via sysupgrade mechanism is not possible, so new installation via factory style image is required.
 endef
 
+define Device/buffalo_ls220de
+  $(Device/NAND-128K)
+  DEVICE_VENDOR := Buffalo
+  DEVICE_MODEL := LinkStation LS220DE
+  KERNEL_UBIFS_OPTS = -m $$(PAGESIZE) -e 124KiB -c $$(PAGESIZE) -x none
+  KERNEL_SIZE := 33554432
+  FILESYSTEMS := squashfs ubifs
+  KERNEL := kernel-bin | append-dtb | uImage none | buffalo-kernel-ubifs
+  KERNEL_INITRAMFS := kernel-bin | append-dtb | uImage none
+  DEVICE_DTS := armada-370-buffalo-ls220de
+  DEVICE_PACKAGES :=  \
+    kmod-hwmon-gpiofan kmod-hwmon-drivetemp kmod-linkstation-poweroff \
+    kmod-md-raid0 kmod-md-raid1 kmod-md-mod \
+    kmod-fs-xfs mkf2fs e2fsprogs partx-utils
+endef
+TARGET_DEVICES += buffalo_ls220de
 define Device/buffalo_ls421de
   $(Device/NAND-128K)
   DEVICE_VENDOR := Buffalo
   DEVICE_MODEL := LinkStation LS421DE
-  SUBPAGESIZE :=
+  KERNEL_UBIFS_OPTS = -m $$(PAGESIZE) -e 124KiB -c $$(PAGESIZE) -x none
   KERNEL_SIZE := 33554432
   FILESYSTEMS := squashfs ubifs
-  KERNEL := kernel-bin | append-dtb | uImage none | buffalo-kernel-jffs2
+  KERNEL := kernel-bin | append-dtb | uImage none | buffalo-kernel-ubifs
   KERNEL_INITRAMFS := kernel-bin | append-dtb | uImage none
   DEVICE_DTS := armada-370-buffalo-ls421de
   DEVICE_PACKAGES :=  \
diff --git a/target/linux/mvebu/patches-5.10/linkstation-poweroff.patch b/target/linux/mvebu/patches-5.10/linkstation-poweroff.patch
new file mode 100644
index 0000000000..e23ba81812
--- /dev/null
+++ b/target/linux/mvebu/patches-5.10/linkstation-poweroff.patch
@@ -0,0 +1,15 @@
+--- a/drivers/power/reset/linkstation-poweroff.c
++++ b/drivers/power/reset/linkstation-poweroff.c
+@@ -86,10 +86,12 @@
+
+	kernel_restart("Power off");
+ }
+
+ static const struct of_device_id ls_poweroff_of_match[] = {
++	{ .compatible = "buffalo,ls220d" },
++	{ .compatible = "buffalo,ls220de" },
+	{ .compatible = "buffalo,ls421d" },
+	{ .compatible = "buffalo,ls421de" },
+	{ },
+ };
+

[https://patchwork.kernel.org/project/xfs/patch/20200910182706.GD7964@magnolia/#23606847]
[If you are using XFS for USB harddrive now in 21.02, support for your filesystem is probably already dropped in 22.03]

Options:

  1. Downgrade OpenWrt to 21.02; or
  2. Lose a entire day backuping TB's of data, to remake the raid array as XFS v5. Seems that Buffalo stock kernel supports v5, when possible I'll confirm.

Or apply this patch:

diff --git a/package/kernel/linux/modules/fs.mk b/package/kernel/linux/modules/fs.mk
index c746479a3b..bab83cffa3 100644
--- a/package/kernel/linux/modules/fs.mk
+++ b/package/kernel/linux/modules/fs.mk
@@ -591,7 +591,8 @@ $(eval $(call KernelPackage,fs-vfat))
 define KernelPackage/fs-xfs
   SUBMENU:=$(FS_MENU)
   TITLE:=XFS filesystem support
-  KCONFIG:=CONFIG_XFS_FS
+  KCONFIG:=CONFIG_XFS_FS \
+	CONFIG_XFS_SUPPORT_V4=y
   DEPENDS:= +kmod-fs-exportfs +kmod-lib-crc32c
   FILES:=$(LINUX_DIR)/fs/xfs/xfs.ko
   AUTOLOAD:=$(call AutoLoad,30,xfs,1)

Maybe it should be included by default in the official Openwrt build, since it wont increase the firmware size.

1 Like

I made a build with this new patch, but got some bootloop: boots, blinks, got solid, but shutdown 3seg later. Probably messed with some build config -- one of that was setting llvm to none.

But finally I got a compile, without needing to disable kmod-hwmon-gpiofan because missing compatible kmod-thermal.

If eventually you make a new build with XFSv4, can you please made it with the same kernel commit/version shown in opkg -- so I'll be able to install necessary pkgs online, like kmod-usb-net-cdc-ether and kmod-usb-net-rndis?
Don't had wrote it down, but is 4643xxx or 4346xxx...

Will rename hdd files to get that initram boot and bring it back to life.

LK

Diff:

index cffd396ae1..e07e797858 100644
--- a/package/boot/uboot-envtools/files/mvebu
+++ b/package/boot/uboot-envtools/files/mvebu
@@ -13,6 +13,7 @@ touch /etc/config/ubootenv
 board=$(board_name)
 
 case "$board" in
+buffalo,ls220de|\
 buffalo,ls421de)
 	ubootenv_add_uci_config "/dev/mtd3" "0x0" "0x10000"
 	;;
diff --git a/target/linux/mvebu/cortexa9/base-files/etc/board.d/02_network b/target/linux/mvebu/cortexa9/base-files/etc/board.d/02_network
index c613a3cd60..d2229fe6bf 100644
--- a/target/linux/mvebu/cortexa9/base-files/etc/board.d/02_network
+++ b/target/linux/mvebu/cortexa9/base-files/etc/board.d/02_network
@@ -61,6 +61,7 @@ mvebu_setup_macs()
 	local label_mac=""
 
 	case "$board" in
+	buffalo,ls220de|\
 	buffalo,ls421de)
 		lan_mac=$(mtd_get_mac_ascii u-boot-env eth1addr)
 		;;
diff --git a/target/linux/mvebu/cortexa9/base-files/lib/upgrade/platform.sh b/target/linux/mvebu/cortexa9/base-files/lib/upgrade/platform.sh
index 18b978d437..b879296e3b 100755
--- a/target/linux/mvebu/cortexa9/base-files/lib/upgrade/platform.sh
+++ b/target/linux/mvebu/cortexa9/base-files/lib/upgrade/platform.sh
@@ -23,8 +23,29 @@ platform_check_image() {
 	esac
 }
 
+platform_do_upgrade_buffalo_nand() {
+	CI_KERNPART=none
+
+	local fw_mtd=$(find_mtd_part kernel)
+	fw_mtd="${fw_mtd/block/}"
+	[ -n "$fw_mtd" ] || return
+
+	local board_dir=$(tar tf "$1" | grep -m 1 '^sysupgrade-.*/$')
+	board_dir=${board_dir%/}
+	[ -n "$board_dir" ] || return
+
+	mtd erase kernel
+	tar xf "$1" ${board_dir}/kernel
+	nandwrite "$fw_mtd" ${board_dir}/kernel
+
+	nand_do_upgrade "$1"
+}
+
 platform_do_upgrade() {
 	case "$(board_name)" in
+	buffalo,ls220de)
+		platform_do_upgrade_buffalo_nand "$1"
+		;;
 	buffalo,ls421de)
 		nand_do_upgrade "$1"
 		;;
diff --git a/target/linux/mvebu/files/arch/arm/boot/dts/armada-370-buffalo-ls220de.dts b/target/linux/mvebu/files/arch/arm/boot/dts/armada-370-buffalo-ls220de.dts
new file mode 100644
index 0000000000..d82a3f23bb
--- /dev/null
+++ b/target/linux/mvebu/files/arch/arm/boot/dts/armada-370-buffalo-ls220de.dts
@@ -0,0 +1,361 @@
+// SPDX-License-Identifier: (GPL-2.0-or-later OR MIT)
+/*
+ * Device Tree file for Buffalo LinkStation LS220DE
+ *
+ * Copyright (C) 2020 Daniel González Cabanelas <dgcbueu@gmail.com>
+ */
+
+/dts-v1/;
+
+#include "armada-370.dtsi"
+#include "mvebu-linkstation-fan.dtsi"
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/thermal/thermal.h>
+
+/ {
+	model = "Buffalo LinkStation LS220DE";
+	compatible = "buffalo,ls220de", "marvell,armada370", "marvell,armada-370-xp";
+
+	aliases {
+		led-boot = &led_boot;
+		led-failsafe = &led_failsafe;
+		led-running = &led_power;
+		led-upgrade = &led_upgrade;
+	};
+
+	chosen {
+		bootargs = "earlycon";
+		stdout-path = "serial0:115200n8";
+		append-rootblock = "nullparameter="; /* override the bootloader args */
+	};
+
+	memory {
+		device_type = "memory";
+		reg = <0x00000000 0x10000000>; /* 256 MB */
+	};
+
+	soc {
+		ranges = <MBUS_ID(0xf0, 0x01) 0 0xd0000000 0x100000
+			  MBUS_ID(0x01, 0xe0) 0 0xfff00000 0x100000
+			  MBUS_ID(0x09, 0x01) 0 0xf1100000 0x10000>;
+	};
+
+	system_fan: gpio_fan {
+		gpios = <&gpio0 13 GPIO_ACTIVE_HIGH
+			 &gpio0 14 GPIO_ACTIVE_HIGH>;
+		alarm-gpios = <&gpio0 10 GPIO_ACTIVE_HIGH>;
+
+		#cooling-cells = <2>;
+	};
+
+	thermal-zones {
+		hdd-thermal {
+			polling-delay = <20000>;
+			polling-delay-passive = <2000>;
+
+			thermal-sensors = <&hdd0_temp>; /* only one drivetemp sensor is supported */
+
+			trips {
+				hdd_alert1: trip1 {
+					temperature = <36000>;
+					hysteresis = <2000>;
+					type = "active";
+				};
+				hdd_alert2: trip2 {
+					temperature = <44000>;
+					hysteresis = <2000>;
+					type = "active";
+				};
+				hdd_alert3: trip3 {
+					temperature = <52000>;
+					hysteresis = <2000>;
+					type = "passive";
+				};
+				hdd_crit: trip4 {
+					temperature = <60000>;
+					hysteresis = <2000>;
+					type = "critical";
+				};
+			};
+
+			cooling-maps {
+				map1 {
+					trip = <&hdd_alert1>;
+					cooling-device = <&system_fan THERMAL_NO_LIMIT 1>;
+				};
+				map2 {
+					trip = <&hdd_alert2>;
+					cooling-device = <&system_fan 2 2>;
+				};
+				map3 {
+					trip = <&hdd_alert3>;
+					cooling-device = <&system_fan 3 THERMAL_NO_LIMIT>;
+				};
+			};
+		};
+	};
+
+	gpio_keys {
+		compatible = "gpio-keys";
+		pinctrl-0 = <&pmx_buttons>;
+		pinctrl-names = "default";
+
+		power {
+			label = "Power Switch";
+			linux,code = <KEY_POWER>;
+			linux,input-type = <EV_SW>;
+			gpios = <&gpio0 15 GPIO_ACTIVE_LOW>;
+		};
+
+		function {
+			label = "Function Button";
+			linux,code = <KEY_CONFIG>;
+			gpios = <&gpio0 16 GPIO_ACTIVE_LOW>;
+		};
+	};
+
+	gpio_leds {
+		compatible = "gpio-leds";
+		pinctrl-names = "default";
+		pinctrl-0 = <&pmx_leds1 &pmx_leds2>;
+
+		system_red {
+			label = "ls421de:red:system";
+			gpios = <&gpio0 7 GPIO_ACTIVE_HIGH>;
+		};
+
+		led_power: power_white {
+			label = "ls421de:white:power";
+			gpios = <&gpio1 22 GPIO_ACTIVE_HIGH>;
+			default-state = "on";
+		};
+
+		led_failsafe: power_red {
+			label = "ls421de:red:power";
+			gpios = <&gpio1 23 GPIO_ACTIVE_HIGH>;
+		};
+
+		led_upgrade: power_orange {
+			label = "ls421de:orange:power";
+			gpios = <&gpio1 25 GPIO_ACTIVE_HIGH>;
+		};
+
+		led_boot: system_white {
+			label = "ls421de:white:system";
+			gpios = <&gpio1 27 GPIO_ACTIVE_HIGH>;
+		};
+
+		hdd1_red {
+			label = "ls421de:red:hdd1";
+			gpios = <&gpio1 29 GPIO_ACTIVE_HIGH>;
+			linux,default-trigger = "ata1";
+		};
+
+		hdd2_red {
+			label = "ls421de:red:hdd2";
+			gpios = <&gpio1 30 GPIO_ACTIVE_HIGH>;
+			linux,default-trigger = "ata2";
+		};
+	};
+
+	regulators {
+		compatible = "simple-bus";
+		#address-cells = <1>;
+		#size-cells = <0>;
+		pinctrl-0 = <&pmx_power_hdd1 &pmx_power_hdd2>;
+		pinctrl-names = "default";
+
+		sata1_power: regulator@1 {
+			compatible = "regulator-fixed";
+			reg = <1>;
+			regulator-name = "HDD1";
+			regulator-min-microvolt = <12000000>;
+			regulator-max-microvolt = <12000000>;
+			startup-delay-us = <2000000>;
+			enable-active-high;
+			regulator-always-on;
+			regulator-boot-on;
+			gpio = <&gpio0 8 GPIO_ACTIVE_HIGH>;
+		};
+
+		sata2_power: regulator@2 {
+			compatible = "regulator-fixed";
+			reg = <2>;
+			regulator-name = "HDD2";
+			regulator-min-microvolt = <12000000>;
+			regulator-max-microvolt = <12000000>;
+			startup-delay-us = <4000000>;
+			enable-active-high;
+			regulator-always-on;
+			regulator-boot-on;
+			gpio = <&gpio0 2 GPIO_ACTIVE_HIGH>;
+		};
+	};
+};
+
+&coherencyfab {
+	broken-idle;
+};
+
+&eth1 {
+	pinctrl-0 = <&ge1_rgmii_pins>;
+	pinctrl-names = "default";
+	status = "okay";
+	phy-handle = <&ethphy0>;
+	phy-connection-type = "rgmii-id";
+};
+
+&mdio {
+	pinctrl-0 = <&mdio_pins>;
+	pinctrl-names = "default";
+
+	ethphy0: ethernet-phy@0 { /* Marvell 88E1318 */
+		reg = <0>;
+		marvell,reg-init = <0x2 0x10 0xffff 0x0006>, /* disable CLK125 */
+				   <0x3 0x10 0xf000 0x0918>, /* LED function */
+				   <0x3 0x11 0x0000 0x4401>, /* LED polarity */
+				   <0x3 0x12 0x0000 0x4905>; /* LED timer */
+		#thermal-sensor-cells = <0>;
+	};
+};
+
+&pmsu {
+	pinctrl-0 = <&pmx_power_cpu>;
+	pinctrl-names = "default";
+};
+
+&sata {
+	nr-ports = <2>;
+	status = "okay";
+	#address-cells = <1>;
+	#size-cells = <0>;
+
+	hdd0_temp: sata-port@0 {
+		reg = <0>;
+		#thermal-sensor-cells = <0>;
+	};
+
+	hdd1_temp: sata-port@1 {
+		reg = <1>;
+		#thermal-sensor-cells = <0>;
+	};
+};
+
+&uart0 {
+	status = "okay";
+};
+
+&usb0 {
+	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 = "kernel";
+				reg = <0x00000000 0x02000000>;  /* 32 MiB */
+			};
+
+			partition@2000000 {
+				label = "ubi";
+				reg = <0x02000000 0x1e000000>;  /* 480 MiB */
+			};
+		};
+	};
+};
+
+&spi0 {
+	status = "okay";
+	pinctrl-0 = <&spi0_pins2>;
+	pinctrl-names = "default";
+
+	spi-flash@0 {
+		compatible = "mxicy,mx25l8005", "jedec,spi-nor";
+		reg = <0>; /* Chip select 0 */
+		spi-max-frequency = <50000000>;
+
+		partitions {
+			compatible = "fixed-partitions";
+			#address-cells = <1>;
+			#size-cells = <1>;
+
+			partition@0 {
+				reg = <0x00000 0xf0000>; /* 960 KiB*/
+				label = "u-boot";
+				read-only;
+			};
+			partition@f0000 {
+				reg = <0xf0000 0x10000>; /* 64 KiB */
+				label = "u-boot-env";
+			};
+		};
+	};
+};
+
+&pinctrl {
+	pmx_power_cpu: pmx-power-cpu {
+		marvell,pins = "mpp4";
+		marvell,function = "vdd";
+	};
+
+	pmx_power_hdd1: pmx-power-hdd1 {
+		marvell,pins = "mpp8";
+		marvell,function = "gpio";
+	};
+
+	pmx_power_hdd2: pmx-power-hdd2 {
+		marvell,pins = "mpp2";
+		marvell,function = "gpo";
+	};
+
+	pmx_fan_lock: pmx-fan-lock {
+		marvell,pins = "mpp10";
+		marvell,function = "gpio";
+	};
+
+	pmx_hdd_present: pmx-hdd-present {
+		marvell,pins = "mpp11", "mpp12";
+		marvell,function = "gpio";
+	};
+
+	pmx_fan_high: pmx-fan-high {
+		marvell,pins = "mpp13";
+		marvell,function = "gpio";
+	};
+
+	pmx_fan_low: pmx-fan-low {
+		marvell,pins = "mpp14";
+		marvell,function = "gpio";
+	};
+
+	pmx_buttons: pmx-buttons {
+		marvell,pins = "mpp15", "mpp16";
+		marvell,function = "gpio";
+	};
+
+	pmx_leds1: pmx-leds {
+		marvell,pins = "mpp7", "mpp54", "mpp59", "mpp61";
+		marvell,function = "gpo";
+	};
+
+	pmx_leds2: pmx-leds {
+		marvell,pins = "mpp55", "mpp57", "mpp62";
+		marvell,function = "gpio";
+	};
+};
diff --git a/target/linux/mvebu/image/Makefile b/target/linux/mvebu/image/Makefile
index 44e66a5f87..a13b61c1eb 100644
--- a/target/linux/mvebu/image/Makefile
+++ b/target/linux/mvebu/image/Makefile
@@ -51,6 +51,20 @@ define Build/buffalo-kernel-jffs2
 	rm -rf $(KDIR)/kernel_jffs2 $@.fakerd
 endef
 
+define Build/buffalo-kernel-ubifs
+	rm -rf $@-ubidir $@.ubi
+	mkdir -p $@-ubidir
+	mv $@ $@-ubidir/uImage.buffalo
+	touch $@
+	$(call Build/append-uImage-fakehdr, ramdisk)
+	mv $@ $@-ubidir/initrd.buffalo
+	$(STAGING_DIR_HOST)/bin/mkfs.ubifs \
+		$(KERNEL_UBIFS_OPTS) -r $@-ubidir $@.ubi
+	sh $(TOPDIR)/scripts/ubinize-image.sh \
+		--part boot=$@.ubi=20 $@ -p $(BLOCKSIZE:%k=%KiB) -m $(PAGESIZE) \
+		-s $(SUBPAGESIZE) -O $(VID_HDR_OFFSET) $(UBINIZE_OPTS)
+endef
+
 # Some info about Ctera firmware:
 # 1. It's simple tar file (GNU standard), but it must have ".firm" suffix.
 # 2. It contains two images: kernel and romdisk. Both are required.
diff --git a/target/linux/mvebu/image/cortexa9.mk b/target/linux/mvebu/image/cortexa9.mk
index 6715a41c9e..1c96ae47d6 100644
--- a/target/linux/mvebu/image/cortexa9.mk
+++ b/target/linux/mvebu/image/cortexa9.mk
@@ -14,14 +14,30 @@ define Device/kernel-size-migration
 	Upgrade via sysupgrade mechanism is not possible, so new installation via factory style image is required.
 endef
 
+define Device/buffalo_ls220de
+  $(Device/NAND-128K)
+  DEVICE_VENDOR := Buffalo
+  DEVICE_MODEL := LinkStation LS220DE
+  KERNEL_UBIFS_OPTS = -m $$(PAGESIZE) -e 124KiB -c $$(PAGESIZE) -x none
+  KERNEL_SIZE := 33554432
+  FILESYSTEMS := squashfs ubifs
+  KERNEL := kernel-bin | append-dtb | uImage none | buffalo-kernel-ubifs
+  KERNEL_INITRAMFS := kernel-bin | append-dtb | uImage none
+  DEVICE_DTS := armada-370-buffalo-ls220de
+  DEVICE_PACKAGES :=  \
+    kmod-hwmon-gpiofan kmod-hwmon-drivetemp kmod-linkstation-poweroff \
+    kmod-md-raid0 kmod-md-raid1 kmod-md-mod \
+    kmod-fs-xfs mkf2fs e2fsprogs partx-utils
+endef
+TARGET_DEVICES += buffalo_ls220de
 define Device/buffalo_ls421de
   $(Device/NAND-128K)
   DEVICE_VENDOR := Buffalo
   DEVICE_MODEL := LinkStation LS421DE
-  SUBPAGESIZE :=
+  KERNEL_UBIFS_OPTS = -m $$(PAGESIZE) -e 124KiB -c $$(PAGESIZE) -x none
   KERNEL_SIZE := 33554432
   FILESYSTEMS := squashfs ubifs
-  KERNEL := kernel-bin | append-dtb | uImage none | buffalo-kernel-jffs2
+  KERNEL := kernel-bin | append-dtb | uImage none | buffalo-kernel-ubifs
   KERNEL_INITRAMFS := kernel-bin | append-dtb | uImage none
   DEVICE_DTS := armada-370-buffalo-ls421de
   DEVICE_PACKAGES :=  \
diff --git a/target/linux/mvebu/patches-5.10/linkstation-poweroff.patch b/target/linux/mvebu/patches-5.10/linkstation-poweroff.patch
new file mode 100644
index 0000000000..e23ba81812
--- /dev/null
+++ b/target/linux/mvebu/patches-5.10/linkstation-poweroff.patch
@@ -0,0 +1,15 @@
+--- a/drivers/power/reset/linkstation-poweroff.c
++++ b/drivers/power/reset/linkstation-poweroff.c
+@@ -86,10 +86,12 @@
+
+	kernel_restart("Power off");
+ }
+
+ static const struct of_device_id ls_poweroff_of_match[] = {
++	{ .compatible = "buffalo,ls220d" },
++	{ .compatible = "buffalo,ls220de" },
+	{ .compatible = "buffalo,ls421d" },
+	{ .compatible = "buffalo,ls421de" },
+	{ },
+ };
+ 
diff --git a/package/kernel/linux/modules/fs.mk b/package/kernel/linux/modules/fs.mk
index c746479a3b..bab83cffa3 100644
--- a/package/kernel/linux/modules/fs.mk
+++ b/package/kernel/linux/modules/fs.mk
@@ -591,7 +591,8 @@ $(eval $(call KernelPackage,fs-vfat))
 define KernelPackage/fs-xfs
   SUBMENU:=$(FS_MENU)
   TITLE:=XFS filesystem support
-  KCONFIG:=CONFIG_XFS_FS
+  KCONFIG:=CONFIG_XFS_FS \
+	CONFIG_XFS_SUPPORT_V4=y
   DEPENDS:= +kmod-fs-exportfs +kmod-lib-crc32c
   FILES:=$(LINUX_DIR)/fs/xfs/xfs.ko
   AUTOLOAD:=$(call AutoLoad,30,xfs,1)

Got a successful build. Special thanks to danitool.

[https://drive.google.com/file/d/1NRe07KdXGgEDcRYXUNMZuoFfNpv3tRj9/view?usp=share_link] [40mb zip with initram and sysupg]
[https://drive.google.com/file/d/1ou-Zd_HIjBDs3Cxj3YOJp3yn2A-c_p3R/view?usp=share_link] [25mb sysupg only]
[https://drive.google.com/file/d/1o3z_lkSFZXWb-BbcmmHTaEePv4TbroZ4/view?usp=share_link] [.config used]

Firmware Version: OpenWrt 22.03.3 r20028-43d71ad93e / LuCI openwrt-22.03 branch git-22.361.69894-438c598
Kernel Version: 5.10.161

XFS v4 working:

[  278.690208] XFS (md10): Deprecated V4 format (crc=0) will not be supported after September 2030.
[  278.879408] XFS (md10): Mounting V4 Filesystem
[  279.273242] XFS (md10): resetting quota flags
[  279.277742] XFS (md10): Ending clean mount
[  279.282007] xfs filesystem being mounted at /mnt/warezRAID supports timestamps until 2038 (0x7fffffff)

I'll see this l8r: [https://wiki.archlinux.org/title/XFS]

### Big timestamps

Starting in Linux 5.10, XFS supports using refactored timestamp and inode encoding functions to handle timestamps as a 64-bit nanosecond counter and bit shifting to increase the effective size. This now allows XFS to run well past the [Year 2038 problem](https://en.wikipedia.org/wiki/Year_2038_problem) to now the Year 2486. Making a new XFS file-system with *bigtime* enabled allows a timestamp range from December 1901 to July 2486 rather than December 1901 to January 2038. The feature will also allow quota timer expirations from January 1970 to July 2486 rather than January 1970 to February 2106.

Big timestamps are enabled by default for new filesystems as of xfsprogs 5.15.

#### Upgrading

Verify whether an existing filesystem has bigtime enabled with [xfs_info(8)](https://man.archlinux.org/man/xfs_info.8):

# xfs_info / | grep bigtime ... bigtime=0 ...

With [xfsprogs](https://archlinux.org/packages/?name=xfsprogs) 5.11 and newer you can upgrade an existing (unmounted) filesystem with [xfs_admin(8)](https://man.archlinux.org/man/xfs_admin.8):

# xfs_admin -O bigtime=1 *device*

Or with [xfs_repair(8)](https://man.archlinux.org/man/xfs_repair.8):

# xfs_repair -c bigtime=1 *device*

While there, you may want to enable `inobtcount` as well (another new default).

@danitool will you make a final build with devmem fix, or should I mark your last build as solution?
No hurry, just to know.

LK

The devmem fix can be done by yourself. Just add the command to the /etc/rc.local script. Unless you wanted to deal with a modified bootloader for fixing this issue to install official Openwrt firmwares in the future once supported.

I can compile another firmware with XFS V4 compatibiliy enabled. But kernel modules from Openwrt repo won't be compatible, even if I used the same kernel version there will be missing symbols.

Don't mark as solved the thread, at least until the device gets official OpenWrt support.

Does the FAN cooler work ok?

1 Like

Yeah, but I just asked because you said that would find a new solution, and I thought that the desired behavior was to mark here as solved pointing to the file. But you explained me about the official support, just mention my nick here when occurs so I mark it down.

Also, accordingly to this [https://openwrt.org/docs/guide-user/storage/usb-drives#optionalidle_spindown_timeout_on_disks_for_nas_usage], it's good to spin NAS hdd's eventually.

In my hdd's the hdparam -i doesn't return the standby variable, so my rc.local (webgui: System -> Startup -> Local Startup) is:

devmem 0xd00184e0 32 0xa8a
mount -a #didn't got why fstab isn't initializing at boot, but the entry is right, cos -a works
hdparm -S 180 /dev/sda6
hdparm -S 180 /dev/sdb6

exit 0

Output seems ok:
/dev/sda6: setting standby to 180 (15 minutes)
/dev/sdb6: setting standby to 180 (15 minutes)

Tyvm, but nvmd, I'm like dog in mud now since my compile got working.

I didn't noticed nothing anormal, but also didn't put it in his place (hotter), nor did stress tests. Will return asap with results.

LK

For spinning down HDDs you may prefer luci-app-hd-idle

1 Like

@lk.warez can you make a last test?

openwrt-snapshot-ls220de-test.zip

It's the current snapshot. I just need to know if it boots ok, before sending patches for official support. Also paste dmesg here.

1 Like

It's working.

Recompiling the kernel yesterday (and getting errors), I found that maybe you want do add some core pkgs on 220 and 421 descriptors in cortexa9.mk, what do you think?

kmod-mdio-gpio
kmod-mdio-netlink
kmod-phy-marvell

I did some temp tests, behaving as programmed, assuming that the trips->hdd alert values in .dts file are in Celsius ("36000", i.e.). That are Buffalo stock values?
I found a bit hot both that lower value, and the case itself after the tests, since hdd's usually runs between 21~28ºC.
Must admit that I would fell more confortable with a lower trigger than 36ºC -- like 30ºC.
I would set 30ºC, 36ºC, 42ºC and 48ºC for the four trips. The usual 70ºC max for hdd's it's too high for reliable data keeping -- more fresher, less particle and electron fuzz, more stability.
It doesn't hurt to ask, but "type = "passive";" on trip3 is the expected?

[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 5.15.92 (dani@tool) (arm-openwrt-linux-muslgnueabi-gcc (OpenWrt GCC 12.2.0 r21859-116c73fd71) 12.2.0, GNU ld (GNU Binutils) 2.39) #0 SMP Thu Feb 9 02:16:51 2023
[    0.000000] CPU: ARMv7 Processor [561f5811] revision 1 (ARMv7), cr=10c5387d
[    0.000000] CPU: PIPT / VIPT nonaliasing data cache, PIPT instruction cache
[    0.000000] OF: fdt: Machine model: Buffalo LinkStation LS220DE
[    0.000000] earlycon: uart0 at MMIO 0xd0012000 (options '115200n8')
[    0.000000] printk: bootconsole [uart0] enabled
[    0.000000] Memory policy: Data cache writeback
[    0.000000] Zone ranges:
[    0.000000]   Normal   [mem 0x0000000000000000-0x000000000fffffff]
[    0.000000]   HighMem  empty
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000000000000-0x000000000fffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x000000000fffffff]
[    0.000000] CPU: All CPU(s) started in SVC mode.
[    0.000000] percpu: Embedded 11 pages/cpu s14028 r8192 d22836 u45056
[    0.000000] pcpu-alloc: s14028 r8192 d22836 u45056 alloc=11*4096
[    0.000000] pcpu-alloc: [0] 0 
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 64960
[    0.000000] Kernel command line: earlycon 2
[    0.000000] Bootloader command line (ignored): console=ttyS0,115200 root=/dev/sda2 rw initrd=0x2600040 panic=5 BOOTVER=0.38 UBOOT_DATE=2019/12/18 mtdparts=armada-nand:0x2000000(boot),0x1e000000(rootfs) nandboot=yes
[    0.000000] Unknown kernel command line parameters "2", will be passed to user space.
[    0.000000] Dentry cache hash table entries: 32768 (order: 5, 131072 bytes, linear)
[    0.000000] Inode-cache hash table entries: 16384 (order: 4, 65536 bytes, linear)
[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[    0.000000] Memory: 246332K/262144K available (8192K kernel code, 631K rwdata, 1884K rodata, 1024K init, 232K bss, 15812K reserved, 0K cma-reserved, 0K highmem)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] rcu: Hierarchical RCU implementation.
[    0.000000] rcu: 	RCU restricting CPUs from NR_CPUS=4 to nr_cpu_ids=1.
[    0.000000] 	Tracing variant of Tasks RCU enabled.
[    0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 10 jiffies.
[    0.000000] rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=1
[    0.000000] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
[    0.000000] L2C: DT/platform modifies aux control register: 0x12086302 -> 0x1a086302
[    0.000000] Aurora cache controller enabled, 4 ways, 256 kB
[    0.000000] Aurora: CACHE_ID 0x00000100, AUX_CTRL 0x1a086302
[    0.000000] Switching to timer-based delay loop, resolution 60ns
[    0.000001] sched_clock: 32 bits at 16MHz, resolution 60ns, wraps every 128849023969ns
[    0.007898] clocksource: armada_370_xp_clocksource: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 114675631333 ns
[    0.019173] Calibrating delay loop (skipped), value calculated using timer frequency.. 33.33 BogoMIPS (lpj=166666)
[    0.029523] pid_max: default: 32768 minimum: 301
[    0.034344] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.041651] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.050296] CPU: Testing write buffer coherency: ok
[    0.055462] CPU0: thread -1, cpu 0, socket -1, mpidr 0
[    0.061721] Setting up static identity map for 0x100000 - 0x100060
[    0.068276] mvebu-soc-id: MVEBU SoC ID=0x6710, Rev=0x1
[    0.073573] mvebu-pmsu: Initializing Power Management Service Unit
[    0.079932] rcu: Hierarchical SRCU implementation.
[    0.084975] dyndbg: Ignore empty _ddebug table in a CONFIG_DYNAMIC_DEBUG_CORE build
[    0.092796] smp: Bringing up secondary CPUs ...
[    0.097312] smp: Brought up 1 node, 1 CPU
[    0.101337] SMP: Total of 1 processors activated (33.33 BogoMIPS).
[    0.107498] CPU: All CPU(s) started in SVC mode.
[    0.116653] VFP support v0.3: implementor 56 architecture 2 part 20 variant 9 rev 6
[    0.124455] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.134275] futex hash table entries: 256 (order: 2, 16384 bytes, linear)
[    0.141174] pinctrl core: initialized pinctrl subsystem
[    0.147682] NET: Registered PF_NETLINK/PF_ROUTE protocol family
[    0.154261] DMA: preallocated 256 KiB pool for atomic coherent allocations
[    0.162104] thermal_sys: Registered thermal governor 'step_wise'
[    0.162392] cpuidle: using governor ladder
[    0.172647] mvebu-pmsu: CPU idle is currently broken: disabling
[    0.196599] cryptd: max_cpu_qlen set to 1000
[    0.204448] SCSI subsystem initialized
[    0.208458] libata version 3.00 loaded.
[    0.208717] usbcore: registered new interface driver usbfs
[    0.214307] usbcore: registered new interface driver hub
[    0.219666] usbcore: registered new device driver usb
[    0.226210] clocksource: Switched to clocksource armada_370_xp_clocksource
[    0.234049] NET: Registered PF_INET protocol family
[    0.239186] IP idents hash table entries: 4096 (order: 3, 32768 bytes, linear)
[    0.247016] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 6144 bytes, linear)
[    0.255366] Table-perturb hash table entries: 65536 (order: 6, 262144 bytes, linear)
[    0.263112] TCP established hash table entries: 2048 (order: 1, 8192 bytes, linear)
[    0.270774] TCP bind hash table entries: 2048 (order: 2, 16384 bytes, linear)
[    0.277924] TCP: Hash tables configured (established 2048 bind 2048)
[    0.284360] UDP hash table entries: 256 (order: 1, 8192 bytes, linear)
[    0.290903] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes, linear)
[    0.298051] NET: Registered PF_UNIX/PF_LOCAL protocol family
[    0.303721] PCI: CLS 0 bytes, default 64
[    0.310975] workingset: timestamp_bits=14 max_order=16 bucket_order=2
[    0.322889] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.328783] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    0.342259] armada-370-pinctrl d0018000.pin-ctrl: registered pinctrl driver
[    0.350399] debugfs: Directory 'd0018100.gpio' with parent 'regmap' already present!
[    0.358762] debugfs: Directory 'd0018140.gpio' with parent 'regmap' already present!
[    0.367651] mv_xor d0060800.xor: Marvell shared XOR driver
[    0.427560] mv_xor d0060800.xor: Marvell XOR (Registers Mode): ( xor cpy intr )
[    0.435150] mv_xor d0060900.xor: Marvell shared XOR driver
[    0.497527] mv_xor d0060900.xor: Marvell XOR (Registers Mode): ( xor cpy intr )
[    0.505228] Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled
[    0.512292] printk: console [ttyS0] disabled
[    0.536743] d0012000.serial: ttyS0 at MMIO 0xd0012000 (irq = 27, base_baud = 12500000) is a 16550A
[    0.545721] printk: console [ttyS0] enabled
[    0.554147] printk: bootconsole [uart0] disabled
[    0.575507] loop: module loaded
[    0.583193] sata_mv d00a0000.sata: version 1.28
[    0.583456] sata_mv d00a0000.sata: slots 32 ports 2
[    0.593717] scsi host0: sata_mv
[    0.598764] scsi host1: sata_mv
[    0.602154] ata1: SATA max UDMA/133 irq 35
[    0.606365] ata2: SATA max UDMA/133 irq 35
[    0.611232] nand: device found, Manufacturer ID: 0x98, Chip ID: 0xdc
[    0.617667] nand: Toshiba NAND 512MiB 3,3V 8-bit
[    0.622313] nand: 512 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 64
[    0.632601] Bad block table found at page 262080, version 0x01
[    0.638990] Bad block table found at page 262016, version 0x01
[    0.645656] 2 fixed-partitions partitions found on MTD device pxa3xx_nand-0
[    0.652720] Creating 2 MTD partitions on "pxa3xx_nand-0":
[    0.658174] 0x000000000000-0x000002000000 : "kernel"
[    0.664702] 0x000002000000-0x000020000000 : "ubi"
[    0.677063] spi-nor spi0.0: mx25l8005 (1024 Kbytes)
[    0.682543] 2 fixed-partitions partitions found on MTD device spi0.0
[    0.689023] Creating 2 MTD partitions on "spi0.0":
[    0.693851] 0x000000000000-0x0000000f0000 : "u-boot"
[    0.700386] 0x0000000f0000-0x000000100000 : "u-boot-env"
[    0.720834] mvneta d0074000.ethernet eth0: Using random mac address 92:77:c6:e7:f4:65
[    0.729096] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    0.735665] ehci-pci: EHCI PCI platform driver
[    0.740216] ehci-platform: EHCI generic platform driver
[    0.745603] ehci-orion: EHCI orion driver
[    0.749794] orion-ehci d0050000.usb: EHCI Host Controller
[    0.755253] orion-ehci d0050000.usb: new USB bus registered, assigned bus number 1
[    0.763037] orion-ehci d0050000.usb: irq 33, io mem 0xd0050000
[    0.796228] orion-ehci d0050000.usb: USB 2.0 started, EHCI 1.00
[    0.803009] hub 1-0:1.0: USB hub found
[    0.807488] hub 1-0:1.0: 1 port detected
[    0.812386] usbcore: registered new interface driver usb-storage
[    0.819136] rtc-mv d0010300.rtc: registered as rtc0
[    0.824075] rtc-mv d0010300.rtc: setting system clock to 2023-02-11T05:32:40 UTC (1676093560)
[    0.832833] i2c_dev: i2c /dev entries driver
[    0.867030] orion_wdt: Initial timeout 257 sec
[    0.872019] sdhci: Secure Digital Host Controller Interface driver
[    0.878307] sdhci: Copyright(c) Pierre Ossman
[    0.882890] sdhci-pltfm: SDHCI platform and OF driver helper
[    0.899935] marvell-cesa d0090000.crypto: CESA device successfully registered
[    0.908198] NET: Registered PF_INET6 protocol family
[    0.915769] Segment Routing with IPv6
[    0.919651] In-situ OAM (IOAM) with IPv6
[    0.923684] NET: Registered PF_PACKET protocol family
[    0.929506] 8021q: 802.1Q VLAN Support v1.8
[    0.933829] Registering SWP/SWPB emulation handler
[    1.126206] ata1: SATA link up 3.0 Gbps (SStatus 123 SControl F300)
[    1.137086] ata1.00: ATA-9: ST4000DM000-1F2168, CC54, max UDMA/133
[    1.143315] ata1.00: 7814037168 sectors, multi 0: LBA48 NCQ (depth 31/32)
[    1.156910] ata1.00: configured for UDMA/133
[    1.161693] scsi 0:0:0:0: Direct-Access     ATA      ST4000DM000-1F21 CC54 PQ: 0 ANSI: 5
[    1.171438] sd 0:0:0:0: [sda] 7814037168 512-byte logical blocks: (4.00 TB/3.64 TiB)
[    1.179282] sd 0:0:0:0: [sda] 4096-byte physical blocks
[    1.185589] sd 0:0:0:0: [sda] Write Protect is off
[    1.190480] sd 0:0:0:0: [sda] Mode Sense: 00 3a 00 00
[    1.190654] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[    1.239134]  sda: sda1 sda2 sda3 sda4 sda5 sda6
[    1.245663] sd 0:0:0:0: [sda] Attached SCSI disk
[    1.676202] ata2: SATA link up 3.0 Gbps (SStatus 123 SControl F300)
[    1.687076] ata2.00: ATA-9: ST4000DM000-1F2168, CC54, max UDMA/133
[    1.693303] ata2.00: 7814037168 sectors, multi 0: LBA48 NCQ (depth 31/32)
[    1.706884] ata2.00: configured for UDMA/133
[    1.711647] scsi 1:0:0:0: Direct-Access     ATA      ST4000DM000-1F21 CC54 PQ: 0 ANSI: 5
[    1.721336] sd 1:0:0:0: [sdb] 7814037168 512-byte logical blocks: (4.00 TB/3.64 TiB)
[    1.729184] sd 1:0:0:0: [sdb] 4096-byte physical blocks
[    1.735272] sd 1:0:0:0: [sdb] Write Protect is off
[    1.740155] sd 1:0:0:0: [sdb] Mode Sense: 00 3a 00 00
[    1.740322] sd 1:0:0:0: [sdb] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[    1.810101]  sdb: sdb1 sdb2 sdb3 sdb4 sdb5 sdb6
[    1.816690] sd 1:0:0:0: [sdb] Attached SCSI disk
[    7.066577] armada-370-pinctrl d0018000.pin-ctrl: unsupported function gpo on pin mpp2
[    7.074558] pinctrl core: failed to register map default (0): invalid type given
[    7.083388] UBI: auto-attach mtd1
[    7.086802] ubi0: attaching mtd1
[    8.702302] ubi0: scanning is finished
[    8.718110] ubi0: attached mtd1 (name "ubi", size 480 MiB)
[    8.723658] ubi0: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes
[    8.730642] ubi0: min./max. I/O unit sizes: 2048/2048, sub-page size 2048
[    8.737499] ubi0: VID header offset: 2048 (aligned 2048), data offset: 4096
[    8.744503] ubi0: good PEBs: 3832, bad PEBs: 8, corrupted PEBs: 0
[    8.750647] ubi0: user volume: 2, internal volumes: 1, max. volumes count: 128
[    8.757924] ubi0: max/mean erase counter: 23/11, WL threshold: 4096, image sequence number: 2113268021
[    8.767296] ubi0: available PEBs: 0, total reserved PEBs: 3832, PEBs reserved for bad PEB handling: 72
[    8.777231] ubi0: background thread "ubi_bgt0d" started, PID 363
[    8.784236] block ubiblock0_0: created from ubi0:0(rootfs)
[    8.789816] ubiblock: device ubiblock0_0 (rootfs) set to be root filesystem
[    8.802174] VFS: Mounted root (squashfs filesystem) readonly on device 254:0.
[    8.812305] Freeing unused kernel image (initmem) memory: 1024K
[    8.827776] Run /sbin/init as init process
[    8.831905]   with arguments:
[    8.831911]     /sbin/init
[    8.831917]     2
[    8.831923]   with environment:
[    8.831928]     HOME=/
[    8.831933]     TERM=linux
[    9.089259] init: Console is alive
[    9.092950] init: - watchdog -
[    9.467013] kmodloader: loading kernel modules from /etc/modules-boot.d/*
[    9.595221] SGI XFS with security attributes, no debug enabled
[    9.652341] kmodloader: done loading kernel modules from /etc/modules-boot.d/*
[    9.663732] init: - preinit -
[   10.368958] random: jshn: uninitialized urandom read (4 bytes read)
[   10.457064] random: jshn: uninitialized urandom read (4 bytes read)
[   10.651414] random: jshn: uninitialized urandom read (4 bytes read)
[   10.830751] mvneta d0074000.ethernet eth0: PHY [d0072004.mdio-mii:00] driver [Marvell 88E1318S] (irq=POLL)
[   10.840881] mvneta d0074000.ethernet eth0: configuring for phy/rgmii-id link mode
[   13.040624] UBIFS (ubi0:1): Mounting in unauthenticated mode
[   13.061184] UBIFS (ubi0:1): background thread "ubifs_bgt0_1" started, PID 488
[   13.126144] UBIFS (ubi0:1): UBIFS: mounted UBI device 0, volume 1, name "rootfs_data"
[   13.134080] UBIFS (ubi0:1): LEB size: 126976 bytes (124 KiB), min./max. I/O unit sizes: 2048 bytes/2048 bytes
[   13.144066] UBIFS (ubi0:1): FS size: 471715840 bytes (449 MiB, 3715 LEBs), max 3730 LEBs, journal size 23617536 bytes (22 MiB, 186 LEBs)
[   13.156426] UBIFS (ubi0:1): reserved for root: 4952683 bytes (4836 KiB)
[   13.163082] UBIFS (ubi0:1): media format: w5/r0 (latest is w5/r0), UUID 97C6AC77-839D-43B4-AA8C-79979DA6D4F5, small LPT model
[   13.175785] mount_root: overlay filesystem has not been fully initialized yet
[   13.183716] mount_root: switching to ubifs overlay
[   13.528201] urandom-seed: Seed file not found (/etc/urandom.seed)
[   13.622383] procd: - early -
[   13.625463] procd: - watchdog -
[   14.236319] procd: - watchdog -
[   14.239871] procd: - ubus -
[   14.281013] random: ubusd: uninitialized urandom read (4 bytes read)
[   14.294418] random: ubusd: uninitialized urandom read (4 bytes read)
[   14.304070] random: ubusd: uninitialized urandom read (4 bytes read)
[   14.313550] procd: - init -
[   15.005370] kmodloader: loading kernel modules from /etc/modules.d/*
[   15.113872] urngd: v1.0.2 started.
[   15.226453] gpio-fan gpio_fan: GPIO fan initialized
[   15.315661] random: crng init done
[   15.319180] random: 27 urandom warning(s) missed due to ratelimiting
[   15.408954] PPP generic driver version 2.4.2
[   15.416807] NET: Registered PF_PPPOX protocol family
[   15.451590] kmodloader: done loading kernel modules from /etc/modules.d/*
[   23.928116] mvneta d0074000.ethernet eth0: PHY [d0072004.mdio-mii:00] driver [Marvell 88E1318S] (irq=POLL)
[   23.953931] mvneta d0074000.ethernet eth0: configuring for phy/rgmii-id link mode
[   23.988511] br-lan: port 1(eth0) entered blocking state
[   23.993805] br-lan: port 1(eth0) entered disabled state
[   23.999473] device eth0 entered promiscuous mode
[   27.147164] mvneta d0074000.ethernet eth0: Link is Up - 1Gbps/Full - flow control rx/tx
[   27.155273] br-lan: port 1(eth0) entered blocking state
[   27.160581] br-lan: port 1(eth0) entered forwarding state
[   27.196152] IPv6: ADDRCONF(NETDEV_CHANGE): br-lan: link becomes ready

LK

Bootloader ignores the bootline... Note that printk starts on uart0 and only after goes to ttyS0...

Attended-sysupg is on fw -- dunno if was intentional.

root@warezRAID:~# df
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/root                 3328      3328         0 100% /rom
tmpfs                   123676      3176    120500   3% /tmp
/dev/ubi0_1             425368     15948    404580   4% /overlay
overlayfs:/overlay      425368     15948    404580   4% /
tmpfs                      512         0       512   0% /dev

The new /dev partition.

And mdadm & lsblk got removed from build, they'r essential tools, it's possible to reinclude in the official snapshot?

I was able to install luci-app-samba4 and all it's tree from opkg, but not mdadm, cos a kmod mismatch:

Collected errors:
 * pkg_hash_check_unresolved: cannot find dependency kernel (= 5.15.92-1-17f02a487627527c3a9ac1494dc5e4ab) for kmod-md-raid10
 * pkg_hash_fetch_best_installation_candidate: Packages for kmod-md-raid10 found, but incompatible with the architectures configured
 * satisfy_dependencies_for: Cannot satisfy the following dependencies for mdadm:
 * 	kernel (= 5.15.92-1-17f02a487627527c3a9ac1494dc5e4ab)
 * opkg_install_cmd: Cannot install package mdadm.

LK

We don't need this.

Maintaining ideal temperatures is cool. However I prefer to keep the unit silence if possible and avoid sucking dust. If the temperatures are too low, the fan will run always at max speed. If we wanted low temperatures might be a better idea to keep the unit at a fresh location. Furthermore, SSDs use higher temperatures.

The critical 60º temperature powers off the unit, I think this is ok. I modified the rest of temperatures with lower values. Also a "hot trip" at 50º was added, wich will trigger a kernel alert. The "type = "passive" means more frequency when polling the temperature (it uses polling-delay-passive property)

This is ok as we don't want the buffalo kernel parameters.

This is true for all devices. Idle is broken on these plataforms.

Thanks for reporting, fixed. Not sure if all GPIOs are ok, since this is a different layout. I just used GPIOs found elsewhere. I assume now they're ok since there are no more complains.

Now included mdadm. I don't want to include more utilities, to avoid the patch to be rejected.

Recompiled again:
openwrt-snapshot-ls220de-test.zip

1 Like