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