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