ramips: mt7621: ASUS RT-AX53U add NMBM, nest firmware
authorFelix Baumann <felix.bau@gmx.de>
Fri, 31 Mar 2023 04:16:04 +0000 (06:16 +0200)
committerFelix Baumann <felix.bau@gmx.de>
Sun, 2 Apr 2023 10:24:07 +0000 (12:24 +0200)
Nests kernel and ubi into firmware partition in-order to be compatible
with OEM firmware. This allows restoring oem firmware from a backup of
firmware2. Add jffs2 partition which is present in the oem firmware.
Add support for mediatek NMBM (wear leveling on newer mediatek devices).
Exclude UBI partition from NMBM management.
Continues PR #10685.

Tested-by: Felix Baumann <felix.bau@gmx.de>
Signed-off-by: Felix Baumann <felix.bau@gmx.de>
(cherry picked from commit 787ecdf66de6798540fb8b756404566341b4733c)

target/linux/ramips/dts/mt7621_asus_rt-ax53u.dts

index a958d9909a295a99a311803c992eb2bee78fa4cb..601a70078fd7f95df070e4850c1bf79cab57d85f 100644 (file)
 &nand {
        status = "okay";
 
+       mediatek,nmbm;
+       mediatek,bmt-remap-range =
+               <0x000000 0x7e0000>,
+               <0x35e0000 0x7800000>;
+
        partitions {
                compatible = "fixed-partitions";
                #address-cells = <1>;
                };
 
                partition@3e0000 {
-                       label = "kernel";
-                       reg = <0x3e0000 0x400000>;
-               };
+                       label = "firmware";
+                       reg = <0x3e0000 0x3200000>;
+
+                       compatible = "fixed-partitions";
+                       #address-cells = <1>;
+                       #size-cells = <1>;
 
-               partition@7e0000 {
-                       label = "ubi";
-                       reg = <0x7e0000 0x2e00000>;
+                       partition@0 {
+                               label = "kernel";
+                               reg = <0x0 0x400000>;
+                       };
+
+                       partition@400000 {
+                               label = "ubi";
+                               reg = <0x400000 0x2e00000>;
+                       };
                };
 
                partition@35e0000 {
                        reg = <0x35e0000 0x3200000>;
                };
 
-               /* Last 8M possibly store the bad block table */
+               partition@67e0000 {
+                       label = "jffs2";
+                       reg = <0x67e0000 0x1020000>;
+               };
+
+               /* Last 8M are reserved for NMBM management (bad blocks) */
        };
 };