mediatek: rework and fix mt7622-rfb1-ubi support
authorFelix Fietkau <nbd@nbd.name>
Mon, 10 Jan 2022 11:35:08 +0000 (12:35 +0100)
committerFelix Fietkau <nbd@nbd.name>
Thu, 13 Jan 2022 17:33:06 +0000 (18:33 +0100)
Limit bmt remapping range to cover everything up to and including the kernel image,
use the rest of the flash area for ubi.
Fix partition table and sysupgrade support

Signed-off-by: Felix Fietkau <nbd@nbd.name>
target/linux/mediatek/dts/mt7622-rfb1-ubi.dts
target/linux/mediatek/image/mt7622.mk
target/linux/mediatek/mt7622/base-files/etc/board.d/02_network
target/linux/mediatek/mt7622/base-files/lib/upgrade/platform.sh

index 3816dcb9cc117aecb7b828c5a17976a287b64267..1a94446c7a499510738e7aa95e515655672dc68a 100644 (file)
@@ -3,10 +3,13 @@
 #include "mt7622-rfb1.dts"
 / {
        model = "MT7622_MT7531 RFB (UBI)";
-       compatible = "mediatek,mt7622,ubi";
+       compatible = "mediatek,mt7622-rfb1-ubi";
 };
 
 &snand {
+       mediatek,bmt-v2;
+       mediatek,bmt-remap-range = <0x0 0x6c0000>;
+
        partitions {
                compatible = "fixed-partitions";
                #address-cells = <1>;
 
                factory: partition@1c0000 {
                        label = "Factory";
-                       reg = <0x1c0000 0x0040000>;
+                       reg = <0x1c0000 0x0100000>;
                };
 
                partition@200000 {
                        label = "kernel";
-                       reg = <0x200000 0x400000>;
+                       reg = <0x2c0000 0x400000>;
                };
 
-               partition@600000 {
+               partition@6c0000 {
                        label = "ubi";
-                       reg = <0x600000 0x1C00000>;
+                       reg = <0x6c0000 0x6f00000>;
                };
 
-               partition@2200000 {
-                       label = "User_data";
-                       reg = <0x2200000 0x4000000>;
-               };
+               /delete-node/ partition@2200000;
        };
 };
index 795bb3fc7684ca13ec1e3a4bccd112daa0737b6a..3b0afa98dffc888bec325c57fd891817baaf7599 100644 (file)
@@ -190,6 +190,7 @@ define Device/mediatek_mt7622-rfb1-ubi
   DEVICE_DTS := mt7622-rfb1-ubi
   DEVICE_DTS_DIR := ../dts
   DEVICE_PACKAGES := kmod-ata-ahci-mtk kmod-btmtkuart kmod-usb3
+  BOARD_NAME := mediatek,mt7622-rfb1-ubi
   UBINIZE_OPTS := -E 5
   BLOCKSIZE := 128k
   PAGESIZE := 2048
index 3724fd6d5c850b56ee6ec37d72cc2f15d5d18775..7b454314cf4a5d43ed59758428e58fde493daa17 100644 (file)
@@ -11,7 +11,8 @@ mediatek_setup_interfaces()
        bananapi,bpi-r64|\
        linksys,e8450|\
        linksys,e8450-ubi|\
-       mediatek,mt7622-rfb1)
+       mediatek,mt7622-rfb1|\
+       mediatek,mt7622-rfb1-ubi)
                ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4" wan
                ;;
        buffalo,wsr-2533dhp2)
index e6afb9547c9b9db0be66433f21a12a6fb20fa50e..bd86a92c7b764fb4a8e2e2376d9b129ccec7029c 100755 (executable)
@@ -34,8 +34,7 @@ platform_do_upgrade() {
                        nand_do_upgrade "$1"
                fi
                ;;
-       linksys,e8450-ubi|\
-       mediatek,mt7622,ubi)
+       linksys,e8450-ubi)
                CI_KERNPART="fit"
                nand_do_upgrade "$1"
                ;;
@@ -47,6 +46,7 @@ platform_do_upgrade() {
                fi
                default_do_upgrade "$1"
                ;;
+       mediatek,mt7622-rfb1-ubi|\
        totolink,a8000ru)
                nand_do_upgrade "$1"
                ;;
@@ -68,6 +68,7 @@ platform_check_image() {
        buffalo,wsr-2533dhp2)
                buffalo_check_image "$board" "$magic" "$1" || return 1
                ;;
+       mediatek,mt7622-rfb1-ubi|\
        totolink,a8000ru)
                nand_do_platform_check "$board" "$1"
                ;;