mediatek: Add support for Xiaomi Redmi Router AX6S
[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 board=$(board_name)
13
14 case "$board" in
15 linksys,e8450-ubi)
16 ubootenv_add_uci_config "/dev/ubi0_0" "0x0" "0x1f000" "0x1f000" "1"
17 ubootenv_add_uci_config "/dev/ubi0_1" "0x0" "0x1f000" "0x1f000" "1"
18 ;;
19 bananapi,bpi-r64)
20 . /lib/upgrade/common.sh
21 export_bootdevice
22 export_partdevice rootdev 0
23 case "$rootdev" in
24 mmc*)
25 local envdev=$(find_mmc_part "ubootenv" $rootdev)
26 ubootenv_add_uci_config "$envdev" "0x0" "0x80000" "0x80000" "1"
27 ubootenv_add_uci_config "$envdev" "0x80000" "0x80000" "0x80000" "1"
28 ;;
29 *)
30 ubootenv_add_uci_config "/dev/ubi0_0" "0x0" "0x1f000" "0x1f000" "1"
31 ubootenv_add_uci_config "/dev/ubi0_1" "0x0" "0x1f000" "0x1f000" "1"
32 ;;
33 esac
34 ;;
35 buffalo,wsr-2533dhp2)
36 ubootenv_add_uci_config "/dev/mtd3" "0x0" "0x1000" "0x20000"
37 ;;
38 ruijie,rg-ew3200gx-pro)
39 ubootenv_add_uci_config "/dev/mtd3" "0x0" "0x20000" "0x20000"
40 ;;
41 ubnt,unifi-6-lr-ubootmod)
42 ubootenv_add_uci_config "/dev/mtd2" "0x0" "0x4000" "0x10000"
43 ;;
44 xiaomi,redmi-router-ax6s)
45 ubootenv_add_uci_config "/dev/mtd3" "0x0" "0x10000" "0x40000"
46 ;;
47 esac
48
49 config_load ubootenv
50 config_foreach ubootenv_add_app_config ubootenv
51
52 exit 0