Skip to content

Commit

Permalink
mediatek: switch to fitblk for cmcc rax3000m
Browse files Browse the repository at this point in the history
Use the new fitblk driver.

Tested-by: Yangyu Chen <cyy@cyyself.name>
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
  • Loading branch information
1715173329 authored and dangowrt committed Jun 15, 2024
1 parent 7791b81 commit 99d4e4d
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 40 deletions.
11 changes: 1 addition & 10 deletions package/boot/uboot-envtools/files/mediatek_filogic
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,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

Expand All @@ -56,16 +57,6 @@ jdcloud,re-cp-03)
;;
esac
;;
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"
;;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
19 changes: 15 additions & 4 deletions target/linux/mediatek/dts/mt7981b-cmcc-rax3000m-emmc.dtso
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,29 @@
compatible = "cmcc,rax3000m", "mediatek,mt7981";

fragment@0 {
target = <&chosen>;
__overlay__ {
rootdisk = <&emmc_rootdisk>;
};
};

fragment@1 {
target = <&gmac0>;
__overlay__ {
nvmem-cells = <&macaddr_factory_2a 0>;
nvmem-cell-names = "mac-address";
};
};

fragment@1 {
fragment@2 {
target = <&gmac1>;
__overlay__ {
nvmem-cells = <&macaddr_factory_24 0>;
nvmem-cell-names = "mac-address";
};
};

fragment@2 {
fragment@3 {
target = <&mmc0>;
__overlay__ {
bus-width = <8>;
Expand Down Expand Up @@ -69,13 +76,17 @@
};
};
};

emmc_rootdisk: block-partition-production {
partname = "production";
};
};
};
};
};
};

fragment@3 {
fragment@4 {
target = <&pio>;
__overlay__ {
mmc0_pins_default: mmc0-pins {
Expand All @@ -94,7 +105,7 @@
};
};

fragment@4 {
fragment@5 {
target = <&wifi>;
__overlay__ {
nvmem-cells = <&eeprom_factory_0>;
Expand Down
22 changes: 18 additions & 4 deletions target/linux/mediatek/dts/mt7981b-cmcc-rax3000m-nand.dtso
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,29 @@
compatible = "cmcc,rax3000m", "mediatek,mt7981";

fragment@0 {
target = <&chosen>;
__overlay__ {
rootdisk = <&ubi_rootdisk>;
};
};

fragment@1 {
target = <&gmac0>;
__overlay__ {
nvmem-cells = <&macaddr_factory_2a 0>;
nvmem-cell-names = "mac-address";
};
};

fragment@1 {
fragment@2 {
target = <&gmac1>;
__overlay__ {
nvmem-cells = <&macaddr_factory_24 0>;
nvmem-cell-names = "mac-address";
};
};

fragment@2 {
fragment@3 {
target = <&pio>;
__overlay__ {
spi0_flash_pins: spi0-pins {
Expand All @@ -46,7 +53,7 @@
};
};

fragment@3 {
fragment@4 {
target = <&spi0>;
__overlay__ {
pinctrl-names = "default";
Expand Down Expand Up @@ -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>;
Expand Down
3 changes: 2 additions & 1 deletion target/linux/mediatek/dts/mt7981b-cmcc-rax3000m.dts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
serial0 = &uart0;
};

chosen {
chosen: chosen {
bootargs-override = "root=/dev/fit0 rootwait";
stdout-path = "serial0:115200n8";
};

Expand Down
23 changes: 3 additions & 20 deletions target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,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)
Expand All @@ -107,18 +108,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)
Expand Down Expand Up @@ -226,17 +215,11 @@ platform_check_image() {

platform_copy_config() {
case "$(board_name)" in
cmcc,rax3000m)
case "$(cmdline_get_var root)" in
/dev/mmc*)
emmc_copy_config
;;
esac
;;
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
Expand Down

0 comments on commit 99d4e4d

Please sign in to comment.