kernel: bump 6.1 to 6.1.89
[openwrt/openwrt.git] / package / boot / uboot-envtools / files / mediatek_filogic
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 ubootenv_add_mmc_default() {
15 local envdev="$(find_mmc_part "ubootenv" "${1:-mmcblk0}")"
16 ubootenv_add_uci_config "$envdev" "0x0" "0x40000" "0x40000" "1"
17 ubootenv_add_uci_config "$envdev" "0x40000" "0x40000" "0x40000" "1"
18 }
19
20 ubootenv_add_nor_default() {
21 local envdev="/dev/mtd$(find_mtd_index "u-boot-env")"
22 ubootenv_add_uci_config "$envdev" "0x0" "0x20000" "0x20000" "1"
23 ubootenv_add_uci_config "$envdev" "0x20000" "0x20000" "0x20000" "1"
24 }
25
26 ubootenv_add_ubi_default() {
27 . /lib/upgrade/nand.sh
28 local envubi=$(nand_find_ubi ubi)
29 local envdev=/dev/$(nand_find_volume $envubi ubootenv)
30 local envdev2=/dev/$(nand_find_volume $envubi ubootenv2)
31 ubootenv_add_uci_config "$envdev" "0x0" "0x1f000" "0x1f000" "1"
32 ubootenv_add_uci_config "$envdev2" "0x0" "0x1f000" "0x1f000" "1"
33 }
34
35 case "$board" in
36 asus,rt-ax59u)
37 ubootenv_add_uci_config "/dev/mtd0" "0x100000" "0x20000" "0x20000"
38 ;;
39 bananapi,bpi-r3|\
40 bananapi,bpi-r3-mini|\
41 bananapi,bpi-r4)
42 . /lib/upgrade/common.sh
43
44 bootdev="$(fitblk_get_bootdev)"
45 case "$bootdev" in
46 ubi*)
47 ubootenv_add_ubi_default
48 ;;
49 mmc*)
50 ubootenv_add_mmc_default "${bootdev%%p[0-9]*}"
51 ;;
52 mtd*)
53 ubootenv_add_nor_default
54 ;;
55 esac
56 ;;
57 cmcc,rax3000m)
58 case "$(cmdline_get_var root)" in
59 /dev/mmc*)
60 ubootenv_add_mmc_default
61 ;;
62 *)
63 ubootenv_add_ubi_default
64 ;;
65 esac
66 ;;
67 comfast,cf-e393ax)
68 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x80000"
69 ;;
70 cetron,ct3003|\
71 edgecore,eap111|\
72 netgear,wax220|\
73 zbtlink,zbt-z8102ax|\
74 zbtlink,zbt-z8103ax)
75 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x20000"
76 ;;
77 dlink,aquila-pro-ai-m30-a1)
78 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x40000" "0x40000"
79 ;;
80 h3c,magic-nx30-pro|\
81 jcg,q30-pro|\
82 netcore,n60|\
83 qihoo,360t7|\
84 tplink,tl-xdr4288|\
85 tplink,tl-xdr6086|\
86 tplink,tl-xdr6088|\
87 xiaomi,mi-router-ax3000t-ubootmod|\
88 xiaomi,mi-router-wr30u-ubootmod|\
89 xiaomi,redmi-router-ax6000-ubootmod|\
90 zyxel,ex5601-t0-ubootmod)
91 ubootenv_add_ubi_default
92 ;;
93 glinet,gl-mt2500|\
94 glinet,gl-mt6000)
95 local envdev=$(find_mmc_part "u-boot-env")
96 ubootenv_add_uci_config "$envdev" "0x0" "0x80000"
97 ;;
98 glinet,gl-mt3000)
99 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x80000" "0x20000"
100 ;;
101 jdcloud,re-cp-03)
102 local envdev=$(find_mmc_part "ubootenv" "mmcblk0")
103 ubootenv_add_uci_config "$envdev" "0x0" "0x40000" "0x40000" "1"
104 ubootenv_add_uci_config "$envdev" "0x40000" "0x40000" "0x40000" "1"
105 ;;
106 mercusys,mr90x-v1|\
107 routerich,ax3000)
108 local envdev=/dev/mtd$(find_mtd_index "u-boot-env")
109 ubootenv_add_uci_config "$envdev" "0x0" "0x20000" "0x20000" "1"
110 ;;
111 openembed,som7981)
112 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x80000" "0x80000"
113 ubootenv_add_uci_sys_config "/dev/mtd3" "0x0" "0x100000" "0x100000"
114 ;;
115 ubnt,unifi-6-plus)
116 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x80000" "0x10000"
117 ;;
118 xiaomi,mi-router-ax3000t|\
119 xiaomi,mi-router-wr30u-stock|\
120 xiaomi,redmi-router-ax6000-stock)
121 ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x10000" "0x20000"
122 ubootenv_add_uci_sys_config "/dev/mtd2" "0x0" "0x10000" "0x20000"
123 ;;
124 zyxel,ex5601-t0)
125 local envdev=/dev/mtd$(find_mtd_index "u-boot-env")
126 ubootenv_add_uci_config "$envdev" "0x0" "0x20000" "0x40000" "2"
127 ;;
128 zyxel,ex5700-telenor)
129 ubootenv_add_uci_config "/dev/ubootenv" "0x0" "0x4000" "0x4000" "1"
130 ;;
131 esac
132
133 config_load ubootenv
134 config_foreach ubootenv_add_app_config
135
136 exit 0