kernel: bump 6.1 to 6.1.89
[openwrt/openwrt.git] / package / boot / uboot-envtools / files / mediatek_mt7622
1 #
2 # Copyright (C) 2021 OpenWrt.org
3 #
4
5 [ -e /etc/config/ubootenv ] && exit 0
6
7 touch /etc/config/ubootenv
8
9 . /lib/uboot-envtools.sh
10 . /lib/functions.sh
11
12 ubootenv_add_mmc_default() {
13 local envdev="$(find_mmc_part "ubootenv" "${1:-mmcblk0}")"
14 ubootenv_add_uci_config "$envdev" "0x0" "0x80000" "0x80000" "1"
15 ubootenv_add_uci_config "$envdev" "0x80000" "0x80000" "0x80000" "1"
16 }
17
18 ubootenv_add_ubi_default() {
19 . /lib/upgrade/nand.sh
20 local envubi=$(nand_find_ubi ubi)
21 local envdev=/dev/$(nand_find_volume $envubi ubootenv)
22 local envdev2=/dev/$(nand_find_volume $envubi ubootenv2)
23 ubootenv_add_uci_config "$envdev" "0x0" "0x1f000" "0x1f000" "1"
24 ubootenv_add_uci_config "$envdev2" "0x0" "0x1f000" "0x1f000" "1"
25 }
26
27 board=$(board_name)
28
29 case "$board" in
30 dlink,eagle-pro-ai-m32-a1|\
31 dlink,eagle-pro-ai-r32-a1)
32 ubootenv_add_uci_config "/dev/mtd3" "0x0" "0x2000" "0x2000"
33 ;;
34 linksys,e8450-ubi)
35 ubootenv_add_ubi_default
36 ;;
37 bananapi,bpi-r64)
38 . /lib/upgrade/common.sh
39 bootdev="$(fitblk_get_bootdev)"
40 case "$bootdev" in
41 mmc*)
42 ubootenv_add_mmc_default "${bootdev%p[0-9]*}"
43 ;;
44 ubi*)
45 ubootenv_add_ubi_default
46 ;;
47 esac
48 ;;
49 buffalo,wsr-2533dhp2)
50 ubootenv_add_uci_config "/dev/mtd3" "0x0" "0x1000" "0x20000"
51 ;;
52 ruijie,rg-ew3200gx-pro)
53 ubootenv_add_uci_config "/dev/mtd3" "0x0" "0x20000" "0x20000"
54 ;;
55 ubnt,unifi-6-lr-v1-ubootmod|\
56 ubnt,unifi-6-lr-v2-ubootmod|\
57 ubnt,unifi-6-lr-v3-ubootmod)
58 ubootenv_add_uci_config "/dev/mtd$(find_mtd_index "u-boot-env")" "0x0" "0x4000" "0x1000"
59 ;;
60 xiaomi,redmi-router-ax6s)
61 ubootenv_add_uci_config "/dev/mtd3" "0x0" "0x10000" "0x40000"
62 ;;
63 esac
64
65 config_load ubootenv
66 config_foreach ubootenv_add_app_config ubootenv
67
68 exit 0