From 94112212993c425324cacb227e715a37cd24d512 Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Mon, 27 Nov 2023 04:01:33 +0000 Subject: [PATCH] uboot-envtools: filogic: add support for BananaPi R4 Add environment settings for the BananaPi BPI-R4 router board which can boot from (and store its bootloader environment on) micro SD card, SPI-NAND and eMMC. Signed-off-by: Daniel Golle --- package/boot/uboot-envtools/files/mediatek_filogic | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/package/boot/uboot-envtools/files/mediatek_filogic b/package/boot/uboot-envtools/files/mediatek_filogic index 1abfa06359f23a..c40daeb84f6a2a 100644 --- a/package/boot/uboot-envtools/files/mediatek_filogic +++ b/package/boot/uboot-envtools/files/mediatek_filogic @@ -44,6 +44,17 @@ bananapi,bpi-r3) ;; esac ;; +bananapi,bpi-r4) + rootdisk="$(cat /sys/firmware/devicetree/base/chosen/rootdisk)" + rootdisk_nand="$(cat /sys/firmware/devicetree/base/chosen/rootdisk-spim-nand)" + if [ "$rootdisk" = "$rootdisk_nand" ]; then + ubootenv_add_ubi_default + else + local envdev=$(find_mmc_part "ubootenv" $rootdev) + ubootenv_add_uci_config "$envdev" "0x0" "0x40000" "0x40000" "1" + ubootenv_add_uci_config "$envdev" "0x40000" "0x40000" "0x40000" "1" + fi + ;; cmcc,rax3000m) case "$(cmdline_get_var root)" in /dev/mmc*)