mediatek: switch to fitblk for cmcc rax3000m

Use the new fitblk driver.

Tested-by: Yangyu Chen <cyy@cyyself.name>
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
This commit is contained in:
Tianling Shen
2024-04-02 20:26:45 +08:00
parent eb105e5dde
commit 146818ff9e
6 changed files with 42 additions and 41 deletions

View File

@@ -56,6 +56,7 @@ bananapi,bpi-r3|\
bananapi,bpi-r3-mini|\
bananapi,bpi-r4|\
bananapi,bpi-r4-poe|\
cmcc,rax3000m|\
jdcloud,re-cp-03)
. /lib/upgrade/common.sh
@@ -81,16 +82,6 @@ zbtlink,zbt-z8102ax|\
zbtlink,zbt-z8103ax)
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x20000"
;;
cmcc,rax3000m)
case "$(cmdline_get_var root)" in
/dev/mmc*)
ubootenv_add_mmc_default
;;
*)
ubootenv_add_ubi_default
;;
esac
;;
comfast,cf-e393ax)
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x80000"
;;

View File

@@ -585,7 +585,7 @@
+serverip=192.168.1.254
+loadaddr=0x46000000
+console=earlycon=uart8250,mmio32,0x11002000 console=ttyS0
+bootargs=root=/dev/mmcblk0p65
+bootargs=root=/dev/fit0 rootwait
+bootcmd=if pstore check ; then run boot_recovery ; else run boot_emmc ; fi
+bootconf=config-1#mt7981b-cmcc-rax3000m-emmc
+bootdelay=0
@@ -638,12 +638,13 @@
+_bootmenu_update_title=setenv _bootmenu_update_title ; setenv bootmenu_title "$bootmenu_title $ver"
--- /dev/null
+++ b/cmcc_rax3000m-nand_env
@@ -0,0 +1,56 @@
@@ -0,0 +1,57 @@
+ipaddr=192.168.1.1
+serverip=192.168.1.254
+loadaddr=0x46000000
+console=earlycon=uart8250,mmio32,0x11002000 console=ttyS0
+bootconf=config-1#mt7981b-cmcc-rax3000m-nand
+bootargs=root=/dev/fit0 rootwait
+bootcmd=if pstore check ; then run boot_recovery ; else run boot_ubi ; fi
+bootdelay=0
+bootfile=immortalwrt-mediatek-filogic-cmcc_rax3000m-initramfs-recovery.itb

View File

@@ -7,6 +7,13 @@
compatible = "cmcc,rax3000m", "mediatek,mt7981";
fragment@0 {
target = <&chosen>;
__overlay__ {
rootdisk = <&emmc_rootdisk>;
};
};
fragment@1 {
target = <&gmac0>;
__overlay__ {
nvmem-cells = <&macaddr_factory_2a 0>;
@@ -14,7 +21,7 @@
};
};
fragment@1 {
fragment@2 {
target = <&gmac1>;
__overlay__ {
nvmem-cells = <&macaddr_factory_24 0>;
@@ -22,7 +29,7 @@
};
};
fragment@2 {
fragment@3 {
target = <&mmc0>;
__overlay__ {
bus-width = <8>;
@@ -69,13 +76,17 @@
};
};
};
emmc_rootdisk: block-partition-production {
partname = "production";
};
};
};
};
};
};
fragment@3 {
fragment@4 {
target = <&pio>;
__overlay__ {
mmc0_pins_default: mmc0-pins {
@@ -94,7 +105,7 @@
};
};
fragment@4 {
fragment@5 {
target = <&wifi>;
__overlay__ {
nvmem-cells = <&eeprom_factory_0>;

View File

@@ -7,6 +7,13 @@
compatible = "cmcc,rax3000m", "mediatek,mt7981";
fragment@0 {
target = <&chosen>;
__overlay__ {
rootdisk = <&ubi_rootdisk>;
};
};
fragment@1 {
target = <&gmac0>;
__overlay__ {
nvmem-cells = <&macaddr_factory_2a 0>;
@@ -14,7 +21,7 @@
};
};
fragment@1 {
fragment@2 {
target = <&gmac1>;
__overlay__ {
nvmem-cells = <&macaddr_factory_24 0>;
@@ -22,7 +29,7 @@
};
};
fragment@2 {
fragment@3 {
target = <&pio>;
__overlay__ {
spi0_flash_pins: spi0-pins {
@@ -46,7 +53,7 @@
};
};
fragment@3 {
fragment@4 {
target = <&spi0>;
__overlay__ {
pinctrl-names = "default";
@@ -114,15 +121,22 @@
};
partition@580000 {
compatible = "linux,ubi";
label = "ubi";
reg = <0x580000 0x7200000>;
volumes {
ubi_rootdisk: ubi-volume-fit {
volname = "fit";
};
};
};
};
};
};
};
fragment@4 {
fragment@5 {
target = <&wifi>;
__overlay__ {
nvmem-cells = <&eeprom_factory_0>;

View File

@@ -22,7 +22,8 @@
serial0 = &uart0;
};
chosen {
chosen: chosen {
bootargs-override = "root=/dev/fit0 rootwait";
stdout-path = "serial0:115200n8";
};

View File

@@ -98,6 +98,7 @@ platform_do_upgrade() {
bananapi,bpi-r3-mini|\
bananapi,bpi-r4|\
bananapi,bpi-r4-poe|\
cmcc,rax3000m|\
jdcloud,re-cp-03|\
mediatek,mt7988a-rfb|\
openwrt,one)
@@ -119,18 +120,6 @@ platform_do_upgrade() {
;;
esac
;;
cmcc,rax3000m)
case "$(cmdline_get_var root)" in
/dev/mmc*)
CI_KERNPART="production"
emmc_do_upgrade "$1"
;;
*)
CI_KERNPART="fit"
nand_do_upgrade "$1"
;;
esac
;;
cudy,re3000-v1|\
cudy,wr3000-v1|\
yuncore,ax835)
@@ -247,20 +236,14 @@ platform_copy_config() {
bananapi,bpi-r3|\
bananapi,bpi-r3-mini|\
bananapi,bpi-r4|\
bananapi,bpi-r4-poe)
bananapi,bpi-r4-poe|\
cmcc,rax3000m)
case "$(fitblk_get_bootdev)" in
mmcblk*)
emmc_copy_config
;;
esac
;;
cmcc,rax3000m)
case "$(cmdline_get_var root)" in
/dev/mmc*)
emmc_copy_config
;;
esac
;;
esac
}