blob: 56b5e7bf1fafe6489c965b0e30eb427b233596d2 [file] [log] [blame]
developer95b92632024-06-25 17:37:19 +08001From: Weijie Gao <weijie.gao@mediatek.com>
2Subject: [PATCH 4/8] mediatek: filogic: add support for MediaTek RBFs upgrade
3
4Add support for MediaTek RBFs upgrade (both normal and dual-image)
5
6Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
7
8--- a/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh
9+++ b/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh
10@@ -1,5 +1,5 @@
11 REQUIRE_IMAGE_METADATA=1
12-RAMFS_COPY_BIN='fitblk'
13+RAMFS_COPY_BIN='fitblk blkid'
14
15 asus_initial_setup()
16 {
developerf2fbad62024-07-24 17:33:36 +080017@@ -64,6 +64,29 @@ platform_do_upgrade() {
developer95b92632024-06-25 17:37:19 +080018 local board=$(board_name)
19
20 case "$board" in
21+ mediatek,mt7981-rfb|\
22+ mediatek,mt7988a-rfb)
23+ [ -e /dev/fit0 ] && fitblk /dev/fit0
24+ [ -e /dev/fitrw ] && fitblk /dev/fitrw
developerf2fbad62024-07-24 17:33:36 +080025+ export_fitblk_bootdev
26+ case "$CI_METHOD" in
27+ emmc)
developer95b92632024-06-25 17:37:19 +080028+ mmc_do_upgrade "$1"
29+ ;;
developerf2fbad62024-07-24 17:33:36 +080030+ default)
developer95b92632024-06-25 17:37:19 +080031+ default_do_upgrade "$1"
32+ ;;
developerf2fbad62024-07-24 17:33:36 +080033+ ubi)
developer95b92632024-06-25 17:37:19 +080034+ CI_KERNPART="firmware"
35+ ubi_do_upgrade "$1"
36+ ;;
37+ *)
38+ if grep \"rootfs_data\" /proc/mtd; then
39+ default_do_upgrade "$1"
40+ fi
41+ ;;
42+ esac
43+ ;;
developerf2fbad62024-07-24 17:33:36 +080044 abt,asr3000|\
45 bananapi,bpi-r3|\
46 bananapi,bpi-r3-mini|\
47@@ -175,6 +198,8 @@ platform_check_image() {
developer95b92632024-06-25 17:37:19 +080048 [ "$#" -gt 1 ] && return 1
49
50 case "$board" in
51+ mediatek,mt7981-rfb|\
52+ mediatek,mt7988a-rfb|\
53 bananapi,bpi-r3|\
developerf2fbad62024-07-24 17:33:36 +080054 bananapi,bpi-r3-mini|\
developer95b92632024-06-25 17:37:19 +080055 bananapi,bpi-r4|\
developerf2fbad62024-07-24 17:33:36 +080056@@ -197,6 +222,8 @@ platform_check_image() {
developer95b92632024-06-25 17:37:19 +080057
58 platform_copy_config() {
59 case "$(board_name)" in
60+ mediatek,mt7981-rfb|\
developerf2fbad62024-07-24 17:33:36 +080061+ mediatek,mt7988a-rfb|\
62 bananapi,bpi-r3|\
63 bananapi,bpi-r3-mini|\
64 bananapi,bpi-r4|\