summaryrefslogtreecommitdiffstats
path: root/target/linux/mediatek/mt7623
diff options
context:
space:
mode:
authorDaniel Golle <daniel@makrotopia.org>2024-02-24 03:00:27 +0000
committerDaniel Golle <daniel@makrotopia.org>2024-02-24 03:02:35 +0000
commit6368ed1ae5b628898b33273c8950f7b7575e4414 (patch)
tree45696ee55fb1b536e810dfcf6665e78a12371ce7 /target/linux/mediatek/mt7623
parent9b6427e9083fc2baeb67fca977f621d0c93fd6f2 (diff)
downloadopenwrt-6368ed1ae5b628898b33273c8950f7b7575e4414.tar.gz
openwrt-6368ed1ae5b628898b33273c8950f7b7575e4414.tar.bz2
openwrt-6368ed1ae5b628898b33273c8950f7b7575e4414.zip
mediatek: mt7623: phase out uImage.FIT partition parser
Use the new fitblk driver on the BananaPi R2 as well as UniElec U7623. Introduce boot device selection for fitblk's /chosen/rootdisk handle, similar to how it is already done on MT7622, MT7986 and MT7988. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Diffstat (limited to 'target/linux/mediatek/mt7623')
-rwxr-xr-xtarget/linux/mediatek/mt7623/base-files/lib/upgrade/platform.sh23
-rw-r--r--target/linux/mediatek/mt7623/config-6.13
2 files changed, 21 insertions, 5 deletions
diff --git a/target/linux/mediatek/mt7623/base-files/lib/upgrade/platform.sh b/target/linux/mediatek/mt7623/base-files/lib/upgrade/platform.sh
index 5d12b6989e..98f76ff49f 100755
--- a/target/linux/mediatek/mt7623/base-files/lib/upgrade/platform.sh
+++ b/target/linux/mediatek/mt7623/base-files/lib/upgrade/platform.sh
@@ -1,5 +1,20 @@
REQUIRE_IMAGE_METADATA=1
+platform_get_bootdev() {
+ local rootdisk="$(cat /sys/firmware/devicetree/base/chosen/rootdisk)"
+ local handle bootdev
+ for handle in /sys/class/block/*/of_node/phandle /sys/class/block/*/device/of_node/phandle; do
+ [ ! -e "$handle" ] && continue
+ if [ "$rootdisk" = "$(cat $handle)" ]; then
+ bootdev="${handle%/of_node/phandle}"
+ bootdev="${bootdev%/device}"
+ bootdev="${bootdev#/sys/class/block/}"
+ echo "$bootdev"
+ break
+ fi
+ done
+}
+
# Legacy full system upgrade including preloader for MediaTek SoCs on eMMC or SD
legacy_mtk_mmc_full_upgrade() {
local diskdev partdev diff oldrecovery
@@ -83,10 +98,10 @@ platform_do_upgrade() {
case "$board" in
bananapi,bpi-r2|\
unielec,u7623-02)
- export_bootdevice
- export_partdevice fitpart 3
- [ "$fitpart" ] || return 1
- EMMC_KERN_DEV="/dev/$fitpart"
+ [ -e /dev/fit0 ] && fitblk /dev/fit0
+ [ -e /dev/fitrw ] && fitblk /dev/fitrw
+ bootdev="$(platform_get_bootdev)"
+ EMMC_KERN_DEV="/dev/$bootdev"
emmc_do_upgrade "$1"
;;
unielec,u7623-02-emmc-512m)
diff --git a/target/linux/mediatek/mt7623/config-6.1 b/target/linux/mediatek/mt7623/config-6.1
index 765f14fe90..a083809e34 100644
--- a/target/linux/mediatek/mt7623/config-6.1
+++ b/target/linux/mediatek/mt7623/config-6.1
@@ -214,7 +214,7 @@ CONFIG_FB_SYS_COPYAREA=y
CONFIG_FB_SYS_FILLRECT=y
CONFIG_FB_SYS_FOPS=y
CONFIG_FB_SYS_IMAGEBLIT=y
-CONFIG_FIT_PARTITION=y
+# CONFIG_FIT_PARTITION is not set
CONFIG_FIXED_PHY=y
CONFIG_FIX_EARLYCON_MEM=y
CONFIG_FONT_8x16=y
@@ -563,6 +563,7 @@ CONFIG_TREE_SRCU=y
# CONFIG_UACCE is not set
CONFIG_UBIFS_FS=y
CONFIG_UEVENT_HELPER_PATH=""
+CONFIG_UIMAGE_FIT_BLK=y
CONFIG_UNCOMPRESS_INCLUDE="debug/uncompress.h"
CONFIG_UNINLINE_SPIN_UNLOCK=y
CONFIG_UNWINDER_ARM=y