mediatek: filogic: add specific layout for WR30U
authorHank Moretti <mchank9999@gmail.com>
Wed, 26 Jul 2023 14:39:16 +0000 (14:39 +0000)
committerDaniel Golle <daniel@makrotopia.org>
Mon, 7 Aug 2023 15:31:27 +0000 (16:31 +0100)
Because this device enable NMBM by default, most users use custom
U-Boot with NMBM-Enabled in Chinese forums.

This layout is the same as the ubootmod layout but enabling NMBM.

Signed-off-by: Hank Moretti <mchank9999@gmail.com>
package/boot/uboot-envtools/files/mediatek_filogic
target/linux/mediatek/dts/mt7981b-xiaomi-mi-router-wr30u-112m-nmbm.dts [new file with mode: 0644]
target/linux/mediatek/filogic/base-files/etc/board.d/01_leds
target/linux/mediatek/filogic/base-files/etc/board.d/02_network
target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh
target/linux/mediatek/image/filogic.mk

index 81b1283690cc4edf5ae824b515bf49ef0811c0ca..4fb1af82183eee3503979557167c008354e33ef2 100644 (file)
@@ -47,6 +47,7 @@ mercusys,mr90x-v1)
 netgear,wax220)
        ubootenv_add_uci_config "/dev/mtd5" "0x0" "0x20000" "0x20000"
        ;;
+xiaomi,mi-router-wr30u-112m-nmbm|\
 xiaomi,mi-router-wr30u-stock|\
 xiaomi,redmi-router-ax6000-stock)
        ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x10000" "0x20000"
diff --git a/target/linux/mediatek/dts/mt7981b-xiaomi-mi-router-wr30u-112m-nmbm.dts b/target/linux/mediatek/dts/mt7981b-xiaomi-mi-router-wr30u-112m-nmbm.dts
new file mode 100644 (file)
index 0000000..7244cdf
--- /dev/null
@@ -0,0 +1,22 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+
+/dts-v1/;
+#include "mt7981b-xiaomi-mi-router-wr30u.dtsi"
+
+/ {
+       model = "Xiaomi Mi Router WR30U (112M UBI with NMBM-Enabled layout)";
+       compatible = "xiaomi,mi-router-wr30u-112m-nmbm", "mediatek,mt7981";
+};
+
+&spi_nand {
+       mediatek,nmbm;
+       mediatek,bmt-max-ratio = <1>;
+       mediatek,bmt-max-reserved-blocks = <64>;
+};
+
+&partitions {
+       partition@600000 {
+               label = "ubi";
+               reg = <0x600000 0x7000000>;
+       };
+};
index a125c5fccb8e2c8d039a9edc0977425307465046..ea126bc46f9e40553536b0814b08b5d7e96ef9ba 100644 (file)
@@ -20,6 +20,7 @@ netgear,wax220)
        ucidef_set_led_netdev "wlan2g" "WLAN2G" "blue:wlan2g" "phy0-ap0"
        ucidef_set_led_netdev "wlan5g" "WLAN5G" "blue:wlan5g" "phy1-ap0"
        ;;
+xiaomi,mi-router-wr30u-112m-nmbm|\
 xiaomi,mi-router-wr30u-stock|\
 xiaomi,mi-router-wr30u-ubootmod)
        ucidef_set_led_netdev "wan" "wan" "blue:network" "wan"
index 556560266b78064e52dd99d55d1221c8f9cb7d30..4013c149f1efbc7f8cd3220ba6239cccafc07118 100644 (file)
@@ -52,6 +52,7 @@ mediatek_setup_interfaces()
        tplink,tl-xdr6086)
                ucidef_set_interfaces_lan_wan "lan1 lan2" eth1
                ;;
+       xiaomi,mi-router-wr30u-112m-nmbm|\
        xiaomi,mi-router-wr30u-stock|\
        xiaomi,mi-router-wr30u-ubootmod|\
        xiaomi,redmi-router-ax6000-stock|\
@@ -99,6 +100,7 @@ mediatek_setup_macs()
                wan_mac=$(macaddr_add "$lan_mac" 1)
                label_mac=$wan_mac
                ;;
+       xiaomi,mi-router-wr30u-112m-nmbm|\
        xiaomi,mi-router-wr30u-stock|\
        xiaomi,mi-router-wr30u-ubootmod|\
        xiaomi,redmi-router-ax6000-stock|\
index 5db4dab9b24768a1e7fcc9ab18873d93bc471c5e..f620f915e368d54b9ade3b3250d66119841e38bb 100755 (executable)
@@ -92,6 +92,7 @@ platform_do_upgrade() {
        tplink,tl-xdr4288|\
        tplink,tl-xdr6086|\
        tplink,tl-xdr6088|\
+       xiaomi,mi-router-wr30u-112m-nmbm|\
        xiaomi,mi-router-wr30u-ubootmod|\
        xiaomi,redmi-router-ax6000-ubootmod)
                CI_KERNPART="fit"
index 12085efbd4ca1e0c4b94c727f83d5c05a2faf035..e008c23c0afcaeea11913736d4ec1c9bd045ce3e 100644 (file)
@@ -380,6 +380,23 @@ define Device/tplink_tl-xdr6088
 endef
 TARGET_DEVICES += tplink_tl-xdr6088
 
+define Device/xiaomi_mi-router-wr30u-112m-nmbm
+  DEVICE_VENDOR := Xiaomi
+  DEVICE_MODEL := Mi Router WR30U (112M UBI with NMBM-Enabled layout)
+  DEVICE_DTS := mt7981b-xiaomi-mi-router-wr30u-112m-nmbm
+  DEVICE_DTS_DIR := ../dts
+  UBINIZE_OPTS := -E 5
+  BLOCKSIZE := 128k
+  PAGESIZE := 2048
+  DEVICE_PACKAGES := kmod-mt7981-firmware mt7981-wo-firmware
+ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),)
+  ARTIFACTS := initramfs-factory.ubi
+  ARTIFACT/initramfs-factory.ubi := append-image-stage initramfs-kernel.bin | ubinize-kernel
+endif
+  IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
+endef
+TARGET_DEVICES += xiaomi_mi-router-wr30u-112m-nmbm
+
 define Device/xiaomi_mi-router-wr30u-stock
   DEVICE_VENDOR := Xiaomi
   DEVICE_MODEL := Mi Router WR30U (stock layout)