[openwrt/openwrt] mediatek: switch to fitblk for JDCloud RE-CP-03

LEDE Commits lede-commits at lists.infradead.org
Mon Apr 29 19:29:19 PDT 2024


dangole pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/790082098e3e5541e75b396ea1c78192f416e13f

commit 790082098e3e5541e75b396ea1c78192f416e13f
Author: Tianling Shen <cnsztl at immortalwrt.org>
AuthorDate: Tue Apr 2 18:53:29 2024 +0800

    mediatek: switch to fitblk for JDCloud RE-CP-03
    
    Use the new fitblk driver.
    
    Tested-By: Yangyu Chen <cyy at cyyself.name>
    Signed-off-by: Tianling Shen <cnsztl at immortalwrt.org>
---
 package/boot/uboot-envtools/files/mediatek_filogic       |  8 ++------
 .../patches/441-add-jdcloud_re-cp-03.patch               |  2 +-
 target/linux/mediatek/dts/mt7986a-jdcloud-re-cp-03.dts   | 16 ++++++++++++++++
 .../mediatek/filogic/base-files/lib/upgrade/platform.sh  |  5 +----
 4 files changed, 20 insertions(+), 11 deletions(-)

diff --git a/package/boot/uboot-envtools/files/mediatek_filogic b/package/boot/uboot-envtools/files/mediatek_filogic
index 02f43ebc7f..7d46e73dbe 100644
--- a/package/boot/uboot-envtools/files/mediatek_filogic
+++ b/package/boot/uboot-envtools/files/mediatek_filogic
@@ -38,7 +38,8 @@ asus,rt-ax59u)
 	;;
 bananapi,bpi-r3|\
 bananapi,bpi-r3-mini|\
-bananapi,bpi-r4)
+bananapi,bpi-r4|\
+jdcloud,re-cp-03)
 	. /lib/upgrade/common.sh
 
 	bootdev="$(fitblk_get_bootdev)"
@@ -98,11 +99,6 @@ glinet,gl-mt6000)
 glinet,gl-mt3000)
 	ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x80000" "0x20000"
 	;;
-jdcloud,re-cp-03)
-	local envdev=$(find_mmc_part "ubootenv" "mmcblk0")
-	ubootenv_add_uci_config "$envdev" "0x0" "0x40000" "0x40000" "1"
-	ubootenv_add_uci_config "$envdev" "0x40000" "0x40000" "0x40000" "1"
-	;;
 mercusys,mr90x-v1|\
 routerich,ax3000)
 	local envdev=/dev/mtd$(find_mtd_index "u-boot-env")
diff --git a/package/boot/uboot-mediatek/patches/441-add-jdcloud_re-cp-03.patch b/package/boot/uboot-mediatek/patches/441-add-jdcloud_re-cp-03.patch
index e0f3a6e235..dc8dfe0140 100644
--- a/package/boot/uboot-mediatek/patches/441-add-jdcloud_re-cp-03.patch
+++ b/package/boot/uboot-mediatek/patches/441-add-jdcloud_re-cp-03.patch
@@ -271,7 +271,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
 +bootdelay=0
diff --git a/target/linux/mediatek/dts/mt7986a-jdcloud-re-cp-03.dts b/target/linux/mediatek/dts/mt7986a-jdcloud-re-cp-03.dts
index b62c2f4215..93a5bb86f3 100644
--- a/target/linux/mediatek/dts/mt7986a-jdcloud-re-cp-03.dts
+++ b/target/linux/mediatek/dts/mt7986a-jdcloud-re-cp-03.dts
@@ -23,7 +23,9 @@
 	};
 
 	chosen {
+		bootargs-override = "root=/dev/fit0 rootwait";
 		stdout-path = "serial0:115200n8";
+		rootdisk = <&emmc_rootdisk>;
 	};
 
 	memory at 40000000 {
@@ -157,6 +159,20 @@
 	vmmc-supply = <&reg_3p3v>;
 	vqmmc-supply = <&reg_1p8v>;
 	status = "okay";
+
+	card at 0 {
+		compatible = "mmc-card";
+		reg = <0>;
+
+		block {
+			compatible = "block-device";
+			partitions {
+				emmc_rootdisk: block-partition-production {
+					partname = "production";
+				};
+			};
+		};
+	};
 };
 
 &pio {
diff --git a/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh b/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh
index 6f69706d79..ee0e8b62d7 100755
--- a/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh
+++ b/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh
@@ -83,6 +83,7 @@ platform_do_upgrade() {
 	bananapi,bpi-r3|\
 	bananapi,bpi-r3-mini|\
 	bananapi,bpi-r4|\
+	jdcloud,re-cp-03|\
 	tplink,tl-xdr4288|\
 	tplink,tl-xdr6086|\
 	tplink,tl-xdr6088|\
@@ -140,10 +141,6 @@ platform_do_upgrade() {
 		CI_KERNPART="fit"
 		nand_do_upgrade "$1"
 		;;
-	jdcloud,re-cp-03)
-		CI_KERNPART="production"
-		emmc_do_upgrade "$1"
-		;;
 	mercusys,mr90x-v1)
 		CI_UBIPART="ubi0"
 		nand_do_upgrade "$1"




More information about the lede-commits mailing list