diff options
author | Daniel Golle <daniel@makrotopia.org> | 2024-01-21 23:50:02 +0000 |
---|---|---|
committer | Daniel Golle <daniel@makrotopia.org> | 2024-02-15 19:30:08 +0000 |
commit | 208f6c1232901835708eb4ace44ae17628fc12f5 (patch) | |
tree | 7a8b3f199d98baccdf3e356b203b6249ae71aa78 /package/boot/uboot-envtools | |
parent | 8f9b10d917dd812e2549d9ef0375420135c25e8b (diff) |
mediatek: mt7622: convert BPi-R64 to all-UBI layout and fitblk
Modernize bootloader and flash memory layout of the BPi-R64 similar to
how it has also been done for the BPi-R3.
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Diffstat (limited to 'package/boot/uboot-envtools')
-rw-r--r-- | package/boot/uboot-envtools/files/mediatek_mt7622 | 32 |
1 files changed, 21 insertions, 11 deletions
diff --git a/package/boot/uboot-envtools/files/mediatek_mt7622 b/package/boot/uboot-envtools/files/mediatek_mt7622 index fdf0d331fc..732f7d5a0e 100644 --- a/package/boot/uboot-envtools/files/mediatek_mt7622 +++ b/package/boot/uboot-envtools/files/mediatek_mt7622 @@ -9,6 +9,21 @@ touch /etc/config/ubootenv . /lib/uboot-envtools.sh . /lib/functions.sh +ubootenv_add_mmc_default() { + local envdev="$(find_mmc_part "ubootenv" "${1:-mmcblk0}")" + ubootenv_add_uci_config "$envdev" "0x0" "0x80000" "0x80000" "1" + ubootenv_add_uci_config "$envdev" "0x80000" "0x80000" "0x80000" "1" +} + +ubootenv_add_ubi_default() { + . /lib/upgrade/nand.sh + local envubi=$(nand_find_ubi ubi) + local envdev=/dev/$(nand_find_volume $envubi ubootenv) + local envdev2=/dev/$(nand_find_volume $envubi ubootenv2) + ubootenv_add_uci_config "$envdev" "0x0" "0x1f000" "0x1f000" "1" + ubootenv_add_uci_config "$envdev2" "0x0" "0x1f000" "0x1f000" "1" +} + board=$(board_name) case "$board" in @@ -17,22 +32,17 @@ dlink,eagle-pro-ai-r32-a1) ubootenv_add_uci_config "/dev/mtd3" "0x0" "0x2000" "0x2000" ;; linksys,e8450-ubi) - ubootenv_add_uci_config "/dev/ubi0_0" "0x0" "0x1f000" "0x1f000" "1" - ubootenv_add_uci_config "/dev/ubi0_1" "0x0" "0x1f000" "0x1f000" "1" + ubootenv_add_ubi_default ;; bananapi,bpi-r64) - rootdev="$(cmdline_get_var root)" - rootdev="${rootdev##*/}" - rootdev="${rootdev%%p[0-9]*}" - case "$rootdev" in + . /lib/upgrade/platform.sh + bootdev="$(platform_get_bootdev)" + case "$bootdev" in mmc*) - local envdev=$(find_mmc_part "ubootenv" $rootdev) - ubootenv_add_uci_config "$envdev" "0x0" "0x80000" "0x80000" "1" - ubootenv_add_uci_config "$envdev" "0x80000" "0x80000" "0x80000" "1" + ubootenv_add_mmc_default "${bootdev%p[0-9]*}" ;; ubi*) - ubootenv_add_uci_config "/dev/ubi0_0" "0x0" "0x1f000" "0x1f000" "1" - ubootenv_add_uci_config "/dev/ubi0_1" "0x0" "0x1f000" "0x1f000" "1" + ubootenv_add_ubi_default ;; esac ;; |