ar71xx:add support for E750A v4
[openwrt/openwrt.git] / target / linux / ar71xx / base-files / lib / upgrade / platform.sh
1 #
2 # Copyright (C) 2011 OpenWrt.org
3 #
4
5 . /lib/functions/system.sh
6 . /lib/ar71xx.sh
7
8 PART_NAME=firmware
9 RAMFS_COPY_DATA=/lib/ar71xx.sh
10 RAMFS_COPY_BIN='nandwrite'
11
12 CI_BLKSZ=65536
13 CI_LDADR=0x80060000
14
15 PLATFORM_DO_UPGRADE_COMBINED_SEPARATE_MTD=0
16
17 platform_find_partitions() {
18 local first dev size erasesize name
19 while read dev size erasesize name; do
20 name=${name#'"'}; name=${name%'"'}
21 case "$name" in
22 vmlinux.bin.l7|vmlinux|kernel|linux|linux.bin|rootfs|filesystem)
23 if [ -z "$first" ]; then
24 first="$name"
25 else
26 echo "$erasesize:$first:$name"
27 break
28 fi
29 ;;
30 esac
31 done < /proc/mtd
32 }
33
34 platform_find_kernelpart() {
35 local part
36 for part in "${1%:*}" "${1#*:}"; do
37 case "$part" in
38 vmlinux.bin.l7|vmlinux|kernel|linux|linux.bin)
39 echo "$part"
40 break
41 ;;
42 esac
43 done
44 }
45
46 platform_find_rootfspart() {
47 local part
48 for part in "${1%:*}" "${1#*:}"; do
49 [ "$part" != "$2" ] && echo "$part" && break
50 done
51 }
52
53 platform_do_upgrade_combined() {
54 local partitions=$(platform_find_partitions)
55 local kernelpart=$(platform_find_kernelpart "${partitions#*:}")
56 local erase_size=$((0x${partitions%%:*})); partitions="${partitions#*:}"
57 local kern_length=0x$(dd if="$1" bs=2 skip=1 count=4 2>/dev/null)
58 local kern_blocks=$(($kern_length / $CI_BLKSZ))
59 local root_blocks=$((0x$(dd if="$1" bs=2 skip=5 count=4 2>/dev/null) / $CI_BLKSZ))
60
61 if [ -n "$partitions" ] && [ -n "$kernelpart" ] && \
62 [ ${kern_blocks:-0} -gt 0 ] && \
63 [ ${root_blocks:-0} -gt 0 ] && \
64 [ ${erase_size:-0} -gt 0 ];
65 then
66 local rootfspart=$(platform_find_rootfspart "$partitions" "$kernelpart")
67 local append=""
68 [ -f "$CONF_TAR" -a "$SAVE_CONFIG" -eq 1 ] && append="-j $CONF_TAR"
69
70 if [ "$PLATFORM_DO_UPGRADE_COMBINED_SEPARATE_MTD" -ne 1 ]; then
71 ( dd if="$1" bs=$CI_BLKSZ skip=1 count=$kern_blocks 2>/dev/null; \
72 dd if="$1" bs=$CI_BLKSZ skip=$((1+$kern_blocks)) count=$root_blocks 2>/dev/null ) | \
73 mtd -r $append -F$kernelpart:$kern_length:$CI_LDADR,rootfs write - $partitions
74 elif [ -n "$rootfspart" ]; then
75 dd if="$1" bs=$CI_BLKSZ skip=1 count=$kern_blocks 2>/dev/null | \
76 mtd write - $kernelpart
77 dd if="$1" bs=$CI_BLKSZ skip=$((1+$kern_blocks)) count=$root_blocks 2>/dev/null | \
78 mtd -r $append write - $rootfspart
79 fi
80 fi
81 PLATFORM_DO_UPGRADE_COMBINED_SEPARATE_MTD=0
82 }
83
84 tplink_get_image_hwid() {
85 get_image "$@" | dd bs=4 count=1 skip=16 2>/dev/null | hexdump -v -n 4 -e '1/1 "%02x"'
86 }
87
88 tplink_get_image_mid() {
89 get_image "$@" | dd bs=4 count=1 skip=17 2>/dev/null | hexdump -v -n 4 -e '1/1 "%02x"'
90 }
91
92 tplink_get_image_boot_size() {
93 get_image "$@" | dd bs=4 count=1 skip=37 2>/dev/null | hexdump -v -n 4 -e '1/1 "%02x"'
94 }
95
96 tplink_pharos_check_support_list() {
97 local image="$1"
98 local offset="$2"
99 local model="$3"
100 local trargs="$4"
101
102 # Here $image is given to dd directly instead of using get_image;
103 # otherwise the skip will take almost a second (as dd can't seek)
104 dd if="$image" bs=1 skip=$offset count=1024 2>/dev/null | tr -d "$trargs" | (
105 while IFS= read -r line; do
106 [ "$line" = "$model" ] && exit 0
107 done
108
109 exit 1
110 )
111 }
112
113 tplink_pharos_check_image() {
114 local image_magic="$(get_magic_long "$1")"
115 local board_magic="$2"
116 [ "$image_magic" != "$board_magic" ] && {
117 echo "Invalid image magic '$image_magic'. Expected '$board_magic'."
118 return 1
119 }
120
121 local model_string="$3"
122 local trargs="$4"
123
124 # New images have the support list at 7802888, old ones at 1511432
125 tplink_pharos_check_support_list "$1" 7802888 "$model_string" "$trargs" || \
126 tplink_pharos_check_support_list "$1" 1511432 "$model_string" "$trargs" || {
127 echo "Unsupported image (model not in support-list)"
128 return 1
129 }
130
131 return 0
132 }
133
134 seama_get_type_magic() {
135 get_image "$@" | dd bs=1 count=4 skip=53 2>/dev/null | hexdump -v -n 4 -e '1/1 "%02x"'
136 }
137
138 wrgg_get_image_magic() {
139 get_image "$@" | dd bs=4 count=1 skip=8 2>/dev/null | hexdump -v -n 4 -e '1/1 "%02x"'
140 }
141
142 cybertan_get_image_magic() {
143 get_image "$@" | dd bs=8 count=1 skip=0 2>/dev/null | hexdump -v -n 8 -e '1/1 "%02x"'
144 }
145
146 cybertan_check_image() {
147 local magic="$(cybertan_get_image_magic "$1")"
148 local fw_magic="$(cybertan_get_hw_magic)"
149
150 [ "$fw_magic" != "$magic" ] && {
151 echo "Invalid image, ID mismatch, got:$magic, but need:$fw_magic"
152 return 1
153 }
154
155 return 0
156 }
157
158 platform_do_upgrade_compex() {
159 local fw_file=$1
160 local fw_part=$PART_NAME
161 local fw_mtd=$(find_mtd_part $fw_part)
162 local fw_length=0x$(dd if="$fw_file" bs=2 skip=1 count=4 2>/dev/null)
163 local fw_blocks=$(($fw_length / 65536))
164
165 if [ -n "$fw_mtd" ] && [ ${fw_blocks:-0} -gt 0 ]; then
166 local append=""
167 [ -f "$CONF_TAR" -a "$SAVE_CONFIG" -eq 1 ] && append="-j $CONF_TAR"
168
169 sync
170 dd if="$fw_file" bs=64k skip=1 count=$fw_blocks 2>/dev/null | \
171 mtd $append write - "$fw_part"
172 fi
173 }
174
175 alfa_check_image() {
176 local magic_long="$(get_magic_long "$1")"
177 local fw_part_size=$(mtd_get_part_size firmware)
178
179 case "$magic_long" in
180 "27051956")
181 [ "$fw_part_size" != "16318464" ] && {
182 echo "Invalid image magic \"$magic_long\" for $fw_part_size bytes"
183 return 1
184 }
185 ;;
186 "68737173")
187 [ "$fw_part_size" != "7929856" ] && {
188 echo "Invalid image magic \"$magic_long\" for $fw_part_size bytes"
189 return 1
190 }
191 ;;
192 esac
193
194 return 0
195 }
196
197 platform_check_image() {
198 local board=$(board_name)
199 local magic="$(get_magic_word "$1")"
200 local magic_long="$(get_magic_long "$1")"
201
202 [ "$#" -gt 1 ] && return 1
203
204 case "$board" in
205 airgateway|\
206 airgatewaypro|\
207 airrouter|\
208 ap121f|\
209 ap132|\
210 ap531b0|\
211 ap90q|\
212 archer-c25-v1|\
213 archer-c58-v1|\
214 archer-c59-v1|\
215 archer-c60-v1|\
216 archer-c60-v2|\
217 archer-c7-v4|\
218 archer-c7-v5|\
219 bullet-m|\
220 c-55|\
221 carambola2|\
222 cf-e316n-v2|\
223 cf-e320n-v2|\
224 cf-e355ac-v1|\
225 cf-e355ac-v2|\
226 cf-e375ac|\
227 cf-e380ac-v1|\
228 cf-e380ac-v2|\
229 cf-e385ac|\
230 cf-e520n|\
231 cf-e530n|\
232 cpe505n|\
233 cpe830|\
234 cpe870|\
235 dap-1330-a1|\
236 dgl-5500-a1|\
237 dhp-1565-a1|\
238 dir-505-a1|\
239 dir-600-a1|\
240 dir-615-c1|\
241 dir-615-e1|\
242 dir-615-e4|\
243 dir-615-i1|\
244 dir-825-c1|\
245 dir-835-a1|\
246 dlan-hotspot|\
247 dlan-pro-1200-ac|\
248 dlan-pro-500-wp|\
249 dr342|\
250 dr531|\
251 dragino2|\
252 e1700ac-v2|\
253 e558-v2|\
254 e600g-v2|\
255 e600gac-v2|\
256 e750a-v4|\
257 ebr-2310-c1|\
258 ens202ext|\
259 epg5000|\
260 esr1750|\
261 esr900|\
262 ew-balin|\
263 ew-dorin|\
264 ew-dorin-router|\
265 gl-ar150|\
266 gl-ar300m|\
267 gl-ar300|\
268 gl-ar750|\
269 gl-domino|\
270 gl-mifi|\
271 gl-usb150|\
272 hiwifi-hc6361|\
273 hornet-ub-x2|\
274 jwap230|\
275 lbe-m5|\
276 lima|\
277 loco-m-xw|\
278 mzk-w04nu|\
279 mzk-w300nh|\
280 n5q|\
281 nanostation-m|\
282 nanostation-m-xw|\
283 nbg460n_550n_550nh|\
284 pqi-air-pen|\
285 r36a|\
286 r602n|\
287 rme-eg200|\
288 rocket-m|\
289 rocket-m-ti|\
290 rocket-m-xw|\
291 rw2458n|\
292 sc1750|\
293 sc300m|\
294 sc450|\
295 sr3200|\
296 t830|\
297 tew-632brp|\
298 tew-712br|\
299 tew-732br|\
300 tew-823dru|\
301 tl-wr1043n-v5|\
302 tl-wr942n-v1|\
303 unifi|\
304 unifi-outdoor|\
305 unifiac-lite|\
306 unifiac-pro|\
307 wam250|\
308 weio|\
309 whr-g301n|\
310 whr-hp-g300n|\
311 whr-hp-gn|\
312 wlae-ag300n|\
313 wndap360|\
314 wpj342|\
315 wpj344|\
316 wpj531|\
317 wpj558|\
318 wpj563|\
319 wrt400n|\
320 wrtnode2q|\
321 wzr-450hp2|\
322 wzr-hp-ag300h|\
323 wzr-hp-g300nh|\
324 wzr-hp-g300nh2|\
325 wzr-hp-g450h|\
326 xd3200)
327 [ "$magic" != "2705" ] && {
328 echo "Invalid image type."
329 return 1
330 }
331
332 return 0
333 ;;
334 alfa-ap96|\
335 alfa-nx|\
336 ap121|\
337 ap121-mini|\
338 ap135-020|\
339 ap136-010|\
340 ap136-020|\
341 ap147-010|\
342 ap152|\
343 ap91-5g|\
344 ap96|\
345 arduino-yun|\
346 bhr-4grv2|\
347 bxu2000n-2-a1|\
348 db120|\
349 dr344|\
350 dw33d|\
351 f9k1115v2|\
352 hornet-ub|\
353 mr12|\
354 mr16|\
355 zbt-we1526|\
356 zcn-1523h-2|\
357 zcn-1523h-5)
358 [ "$magic_long" != "68737173" -a "$magic_long" != "19852003" ] && {
359 echo "Invalid image type."
360 return 1
361 }
362
363 return 0
364 ;;
365 all0258n|\
366 all0315n|\
367 cap324|\
368 cap4200ag|\
369 cr3000|\
370 cr5000)
371 platform_check_image_allnet "$1" && return 0
372 return 1
373 ;;
374 all0305|\
375 eap300v2|\
376 eap7660d|\
377 ja76pf|\
378 ja76pf2|\
379 jwap003|\
380 ls-sr71|\
381 pb42|\
382 pb44|\
383 routerstation|\
384 routerstation-pro|\
385 wp543|\
386 wpe72)
387 [ "$magic" != "4349" ] && {
388 echo "Invalid image. Use *-sysupgrade.bin files on this board"
389 return 1
390 }
391
392 local md5_img=$(dd if="$1" bs=2 skip=9 count=16 2>/dev/null)
393 local md5_chk=$(dd if="$1" bs=$CI_BLKSZ skip=1 2>/dev/null | md5sum -); md5_chk="${md5_chk%% *}"
394
395 if [ -n "$md5_img" -a -n "$md5_chk" ] && [ "$md5_img" = "$md5_chk" ]; then
396 return 0
397 else
398 echo "Invalid image. Contents do not match checksum (image:$md5_img calculated:$md5_chk)"
399 return 1
400 fi
401
402 return 0
403 ;;
404 antminer-s1|\
405 antminer-s3|\
406 antrouter-r1|\
407 archer-c5|\
408 archer-c7|\
409 el-m150|\
410 el-mini|\
411 gl-inet|\
412 lan-turtle|\
413 mc-mac1200r|\
414 minibox-v1|\
415 omy-g1|\
416 omy-x1|\
417 onion-omega|\
418 oolite-v1|\
419 oolite-v5.2|\
420 oolite-v5.2-dev|\
421 packet-squirrel|\
422 re355|\
423 re450|\
424 rut900|\
425 smart-300|\
426 som9331|\
427 tellstick-znet-lite|\
428 tl-mr10u|\
429 tl-mr11u|\
430 tl-mr12u|\
431 tl-mr13u|\
432 tl-mr3020|\
433 tl-mr3040|\
434 tl-mr3040-v2|\
435 tl-mr3220|\
436 tl-mr3220-v2|\
437 tl-mr3420|\
438 tl-mr3420-v2|\
439 tl-mr6400|\
440 tl-wa701nd-v2|\
441 tl-wa7210n-v2|\
442 tl-wa750re|\
443 tl-wa7510n|\
444 tl-wa801nd-v2|\
445 tl-wa801nd-v3|\
446 tl-wa830re-v2|\
447 tl-wa850re|\
448 tl-wa850re-v2|\
449 tl-wa855re-v1|\
450 tl-wa860re|\
451 tl-wa901nd|\
452 tl-wa901nd-v2|\
453 tl-wa901nd-v3|\
454 tl-wa901nd-v4|\
455 tl-wa901nd-v5|\
456 tl-wdr3320-v2|\
457 tl-wdr3500|\
458 tl-wdr4300|\
459 tl-wdr4900-v2|\
460 tl-wdr6500-v2|\
461 tl-wpa8630|\
462 tl-wr1041n-v2|\
463 tl-wr1043nd|\
464 tl-wr1043nd-v2|\
465 tl-wr1043nd-v4|\
466 tl-wr2543n|\
467 tl-wr703n|\
468 tl-wr710n|\
469 tl-wr720n-v3|\
470 tl-wr740n-v6|\
471 tl-wr741nd|\
472 tl-wr741nd-v4|\
473 tl-wr802n-v1|\
474 tl-wr802n-v2|\
475 tl-wr810n|\
476 tl-wr810n-v2|\
477 tl-wr840n-v2|\
478 tl-wr840n-v3|\
479 tl-wr841n-v1|\
480 tl-wr841n-v7|\
481 tl-wr841n-v8|\
482 tl-wr841n-v9|\
483 tl-wr841n-v11|\
484 tl-wr842n-v2|\
485 tl-wr842n-v3|\
486 tl-wr902ac-v1|\
487 tl-wr940n-v4|\
488 tl-wr940n-v6|\
489 tl-wr941nd|\
490 tl-wr941nd-v5|\
491 tl-wr941nd-v6|\
492 ts-d084|\
493 wifi-pineapple-nano)
494 local magic_ver="0100"
495
496 case "$board" in
497 tl-wdr6500-v2)
498 magic_ver="0200"
499 ;;
500 esac
501
502 [ "$magic" != "$magic_ver" ] && {
503 echo "Invalid image type."
504 return 1
505 }
506
507 local hwid
508 local mid
509 local imagehwid
510 local imagemid
511
512 hwid=$(tplink_get_hwid)
513 mid=$(tplink_get_mid)
514 imagehwid=$(tplink_get_image_hwid "$1")
515 imagemid=$(tplink_get_image_mid "$1")
516
517 [ "$hwid" != "$imagehwid" -o "$mid" != "$imagemid" ] && {
518 echo "Invalid image, hardware ID mismatch, hw:$hwid $mid image:$imagehwid $imagemid."
519 return 1
520 }
521
522 local boot_size
523
524 boot_size=$(tplink_get_image_boot_size "$1")
525 [ "$boot_size" != "00000000" ] && {
526 echo "Invalid image, it contains a bootloader."
527 return 1
528 }
529
530 return 0
531 ;;
532 bsb|\
533 dir-825-b1|\
534 tew-673gru)
535 dir825b_check_image "$1" && return 0
536 ;;
537 rb-411|\
538 rb-411u|\
539 rb-433|\
540 rb-433u|\
541 rb-435g|\
542 rb-450|\
543 rb-450g|\
544 rb-493|\
545 rb-493g|\
546 rb-750|\
547 rb-750gl|\
548 rb-751|\
549 rb-751g|\
550 rb-911g-2hpnd|\
551 rb-911g-5hpnd|\
552 rb-911g-5hpacd|\
553 rb-912uag-2hpnd|\
554 rb-912uag-5hpnd|\
555 rb-921gs-5hpacd-r2|\
556 rb-951g-2hnd|\
557 rb-951ui-2hnd|\
558 rb-2011l|\
559 rb-2011il|\
560 rb-2011ils|\
561 rb-2011uas|\
562 rb-2011uas-2hnd|\
563 rb-2011uias|\
564 rb-2011uias-2hnd|\
565 rb-sxt2n|\
566 rb-sxt5n)
567 nand_do_platform_check routerboard $1
568 return $?
569 ;;
570 c-60|\
571 hiveap-121|\
572 nbg6716|\
573 r6100|\
574 rambutan|\
575 wi2a-ac200i|\
576 wndr3700v4|\
577 wndr4300)
578 nand_do_platform_check $board $1
579 return $?
580 ;;
581 cpe210|\
582 cpe510|\
583 eap120|\
584 wbs210|\
585 wbs510)
586 tplink_pharos_check_image "$1" "7f454c46" "$(tplink_pharos_get_model_string)" '' && return 0
587 return 1
588 ;;
589 cpe210-v2)
590 tplink_pharos_check_image "$1" "01000000" "$(tplink_pharos_v2_get_model_string)" '\0\xff\r' && return 0
591 return 1
592 ;;
593 a40|\
594 a60|\
595 mr1750|\
596 mr1750v2|\
597 mr600|\
598 mr600v2|\
599 mr900|\
600 mr900v2|\
601 om2p|\
602 om2p-hs|\
603 om2p-hsv2|\
604 om2p-hsv3|\
605 om2p-hsv4|\
606 om2p-lc|\
607 om2pv2|\
608 om2pv4|\
609 om5p|\
610 om5p-ac|\
611 om5p-acv2|\
612 om5p-an)
613 platform_check_image_openmesh "$magic_long" "$1" && return 0
614 return 1
615 ;;
616 mr18|\
617 z1)
618 merakinand_do_platform_check $board $1
619 return $?
620 ;;
621 dir-869-a1|\
622 mynet-n600|\
623 mynet-n750|\
624 qihoo-c301)
625 [ "$magic_long" != "5ea3a417" ] && {
626 echo "Invalid image, bad magic: $magic_long"
627 return 1
628 }
629
630 local typemagic=$(seama_get_type_magic "$1")
631 [ "$typemagic" != "6669726d" ] && {
632 echo "Invalid image, bad type: $typemagic"
633 return 1
634 }
635
636 return 0
637 ;;
638 e2100l|\
639 mynet-rext|\
640 wrt160nl)
641 cybertan_check_image "$1" && return 0
642 return 1
643 ;;
644 nbg6616|\
645 uap-pro|\
646 unifi-outdoor-plus)
647 [ "$magic_long" != "19852003" ] && {
648 echo "Invalid image type."
649 return 1
650 }
651
652 return 0
653 ;;
654 tube2h)
655 alfa_check_image "$1" && return 0
656 return 1
657 ;;
658 wndr3700|\
659 wnr1000-v2|\
660 wnr2000-v3|\
661 wnr612-v2|\
662 wpn824n)
663 local hw_magic
664
665 hw_magic="$(ar71xx_get_mtd_part_magic firmware)"
666 [ "$magic_long" != "$hw_magic" ] && {
667 echo "Invalid image, hardware ID mismatch, hw:$hw_magic image:$magic_long."
668 return 1
669 }
670
671 return 0
672 ;;
673 wnr2000-v4)
674 [ "$magic_long" != "32303034" ] && {
675 echo "Invalid image type."
676 return 1
677 }
678
679 return 0
680 ;;
681 wnr2200)
682 [ "$magic_long" != "32323030" ] && {
683 echo "Invalid image type."
684 return 1
685 }
686
687 return 0
688 ;;
689 dap-2695-a1)
690 local magic=$(wrgg_get_image_magic "$1")
691 [ "$magic" != "21030820" ] && {
692 echo "Invalid image, bad type: $magic"
693 return 1
694 }
695
696 return 0;
697 ;;
698 # these boards use metadata images
699 fritz300e|\
700 fritz4020|\
701 fritz450e|\
702 koala|\
703 rb-750-r2|\
704 rb-750p-pbr2|\
705 rb-750up-r2|\
706 rb-911-2hn|\
707 rb-911-5hn|\
708 rb-941-2nd|\
709 rb-951ui-2nd|\
710 rb-952ui-5ac2nd|\
711 rb-962uigs-5hact2hnt|\
712 rb-lhg-5nd|\
713 rb-map-2nd|\
714 rb-mapl-2nd|\
715 rb-wap-2nd|\
716 rb-wapg-5hact2hnd)
717 return 0
718 ;;
719 esac
720
721 echo "Sysupgrade is not yet supported on $board."
722 return 1
723 }
724
725 platform_pre_upgrade() {
726 local board=$(board_name)
727
728 case "$board" in
729 rb-750-r2|\
730 rb-750p-pbr2|\
731 rb-750up-r2|\
732 rb-911-2hn|\
733 rb-911-5hn|\
734 rb-941-2nd|\
735 rb-951ui-2nd|\
736 rb-952ui-5ac2nd|\
737 rb-962uigs-5hact2hnt|\
738 rb-lhg-5nd|\
739 rb-map-2nd|\
740 rb-mapl-2nd|\
741 rb-wap-2nd|\
742 rb-wapg-5hact2hnd)
743 # erase firmware if booted from initramfs
744 [ -z "$(rootfs_type)" ] && mtd erase firmware
745 ;;
746 esac
747 }
748
749 platform_nand_pre_upgrade() {
750 local board=$(board_name)
751
752 case "$board" in
753 rb*)
754 CI_KERNPART=none
755 local fw_mtd=$(find_mtd_part kernel)
756 fw_mtd="${fw_mtd/block/}"
757 [ -n "$fw_mtd" ] || return
758 mtd erase kernel
759 tar xf "$1" sysupgrade-routerboard/kernel -O | nandwrite -o "$fw_mtd" -
760 ;;
761 wi2a-ac200i)
762 case "$(fw_printenv -n dualPartition)" in
763 imgA)
764 fw_setenv dualPartition imgB
765 fw_setenv ActImg NokiaImageB
766 ;;
767 imgB)
768 fw_setenv dualPartition imgA
769 fw_setenv ActImg NokiaImageA
770 ;;
771 esac
772 ubiblock -r /dev/ubiblock0_0 2>/dev/null >/dev/null
773 rm -f /dev/ubiblock0_0
774 ubidetach -d 0 2>/dev/null >/dev/null
775 CI_UBIPART=ubi_alt
776 CI_KERNPART=kernel_alt
777 ;;
778 esac
779 }
780
781 platform_do_upgrade() {
782 local board=$(board_name)
783
784 case "$board" in
785 all0258n)
786 platform_do_upgrade_allnet "0x9f050000" "$ARGV"
787 ;;
788 all0305|\
789 eap7660d|\
790 ja76pf|\
791 ja76pf2|\
792 jwap003|\
793 ls-sr71|\
794 pb42|\
795 pb44|\
796 routerstation|\
797 routerstation-pro)
798 platform_do_upgrade_combined "$ARGV"
799 ;;
800 all0315n)
801 platform_do_upgrade_allnet "0x9f080000" "$ARGV"
802 ;;
803 cap4200ag|\
804 eap300v2|\
805 ens202ext)
806 platform_do_upgrade_allnet "0xbf0a0000" "$ARGV"
807 ;;
808 dir-825-b1|\
809 tew-673gru)
810 platform_do_upgrade_dir825b "$ARGV"
811 ;;
812 a40|\
813 a60|\
814 mr1750|\
815 mr1750v2|\
816 mr600|\
817 mr600v2|\
818 mr900|\
819 mr900v2|\
820 om2p|\
821 om2p-hs|\
822 om2p-hsv2|\
823 om2p-hsv3|\
824 om2p-hsv4|\
825 om2p-lc|\
826 om2pv2|\
827 om2pv4|\
828 om5p|\
829 om5p-ac|\
830 om5p-acv2|\
831 om5p-an)
832 platform_do_upgrade_openmesh "$ARGV"
833 ;;
834 c-60|\
835 hiveap-121|\
836 nbg6716|\
837 r6100|\
838 rambutan|\
839 rb-411|\
840 rb-411u|\
841 rb-433|\
842 rb-433u|\
843 rb-435g|\
844 rb-450|\
845 rb-450g|\
846 rb-493|\
847 rb-493g|\
848 rb-750|\
849 rb-750gl|\
850 rb-751|\
851 rb-751g|\
852 rb-911g-2hpnd|\
853 rb-911g-5hpacd|\
854 rb-911g-5hpnd|\
855 rb-912uag-2hpnd|\
856 rb-912uag-5hpnd|\
857 rb-921gs-5hpacd-r2|\
858 rb-951g-2hnd|\
859 rb-951ui-2hnd|\
860 rb-2011il|\
861 rb-2011ils|\
862 rb-2011l|\
863 rb-2011uas|\
864 rb-2011uas-2hnd|\
865 rb-2011uias|\
866 rb-2011uias-2hnd|\
867 rb-sxt2n|\
868 rb-sxt5n|\
869 wi2a-ac200i|\
870 wndr3700v4|\
871 wndr4300)
872 nand_do_upgrade "$1"
873 ;;
874 mr18|\
875 z1)
876 merakinand_do_upgrade "$1"
877 ;;
878 uap-pro|\
879 unifi-outdoor-plus)
880 MTD_CONFIG_ARGS="-s 0x180000"
881 default_do_upgrade "$ARGV"
882 ;;
883 wp543|\
884 wpe72)
885 platform_do_upgrade_compex "$ARGV"
886 ;;
887 *)
888 default_do_upgrade "$ARGV"
889 ;;
890 esac
891 }