a quick and dirty implementation of EAP220
[openwrt/staging/lynxis.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 e600g-v2|\
254 e600gac-v2|\
255 ebr-2310-c1|\
256 ens202ext|\
257 epg5000|\
258 esr1750|\
259 esr900|\
260 ew-balin|\
261 ew-dorin|\
262 ew-dorin-router|\
263 gl-ar150|\
264 gl-ar300m|\
265 gl-ar300|\
266 gl-ar750|\
267 gl-ar750s|\
268 gl-domino|\
269 gl-mifi|\
270 gl-usb150|\
271 hiwifi-hc6361|\
272 hornet-ub-x2|\
273 jwap230|\
274 lbe-m5|\
275 lima|\
276 loco-m-xw|\
277 mzk-w04nu|\
278 mzk-w300nh|\
279 n5q|\
280 nanostation-m|\
281 nanostation-m-xw|\
282 nbg460n_550n_550nh|\
283 pqi-air-pen|\
284 r36a|\
285 r602n|\
286 rme-eg200|\
287 rocket-m|\
288 rocket-m-ti|\
289 rocket-m-xw|\
290 rw2458n|\
291 sc1750|\
292 sc300m|\
293 sc450|\
294 sr3200|\
295 t830|\
296 tew-632brp|\
297 tew-712br|\
298 tew-732br|\
299 tew-823dru|\
300 tl-wr1043n-v5|\
301 tl-wr942n-v1|\
302 unifi|\
303 unifi-outdoor|\
304 unifiac-lite|\
305 unifiac-pro|\
306 wam250|\
307 weio|\
308 whr-g301n|\
309 whr-hp-g300n|\
310 whr-hp-gn|\
311 wlae-ag300n|\
312 wndap360|\
313 wpj342|\
314 wpj344|\
315 wpj531|\
316 wpj558|\
317 wpj563|\
318 wrt400n|\
319 wrtnode2q|\
320 wzr-450hp2|\
321 wzr-hp-ag300h|\
322 wzr-hp-g300nh|\
323 wzr-hp-g300nh2|\
324 wzr-hp-g450h|\
325 xd3200)
326 [ "$magic" != "2705" ] && {
327 echo "Invalid image type."
328 return 1
329 }
330
331 return 0
332 ;;
333 alfa-ap96|\
334 alfa-nx|\
335 ap121|\
336 ap121-mini|\
337 ap135-020|\
338 ap136-010|\
339 ap136-020|\
340 ap147-010|\
341 ap152|\
342 ap91-5g|\
343 ap96|\
344 arduino-yun|\
345 bhr-4grv2|\
346 bxu2000n-2-a1|\
347 db120|\
348 dr344|\
349 dw33d|\
350 f9k1115v2|\
351 hornet-ub|\
352 mr12|\
353 mr16|\
354 zbt-we1526|\
355 zcn-1523h-2|\
356 zcn-1523h-5)
357 [ "$magic_long" != "68737173" -a "$magic_long" != "19852003" ] && {
358 echo "Invalid image type."
359 return 1
360 }
361
362 return 0
363 ;;
364 all0258n|\
365 all0315n|\
366 cap324|\
367 cap4200ag|\
368 cr3000|\
369 cr5000)
370 platform_check_image_allnet "$1" && return 0
371 return 1
372 ;;
373 all0305|\
374 eap300v2|\
375 eap7660d|\
376 ja76pf|\
377 ja76pf2|\
378 jwap003|\
379 ls-sr71|\
380 pb42|\
381 pb44|\
382 routerstation|\
383 routerstation-pro|\
384 wp543|\
385 wpe72)
386 [ "$magic" != "4349" ] && {
387 echo "Invalid image. Use *-sysupgrade.bin files on this board"
388 return 1
389 }
390
391 local md5_img=$(dd if="$1" bs=2 skip=9 count=16 2>/dev/null)
392 local md5_chk=$(dd if="$1" bs=$CI_BLKSZ skip=1 2>/dev/null | md5sum -); md5_chk="${md5_chk%% *}"
393
394 if [ -n "$md5_img" -a -n "$md5_chk" ] && [ "$md5_img" = "$md5_chk" ]; then
395 return 0
396 else
397 echo "Invalid image. Contents do not match checksum (image:$md5_img calculated:$md5_chk)"
398 return 1
399 fi
400
401 return 0
402 ;;
403 antminer-s1|\
404 antminer-s3|\
405 antrouter-r1|\
406 archer-c5|\
407 archer-c7|\
408 el-m150|\
409 el-mini|\
410 gl-inet|\
411 lan-turtle|\
412 mc-mac1200r|\
413 minibox-v1|\
414 omy-g1|\
415 omy-x1|\
416 onion-omega|\
417 oolite-v1|\
418 oolite-v5.2|\
419 oolite-v5.2-dev|\
420 packet-squirrel|\
421 re355|\
422 re450|\
423 rut900|\
424 smart-300|\
425 som9331|\
426 tellstick-znet-lite|\
427 tl-mr10u|\
428 tl-mr11u|\
429 tl-mr12u|\
430 tl-mr13u|\
431 tl-mr3020|\
432 tl-mr3040|\
433 tl-mr3040-v2|\
434 tl-mr3220|\
435 tl-mr3220-v2|\
436 tl-mr3420|\
437 tl-mr3420-v2|\
438 tl-mr6400|\
439 tl-wa701nd-v2|\
440 tl-wa7210n-v2|\
441 tl-wa750re|\
442 tl-wa7510n|\
443 tl-wa801nd-v2|\
444 tl-wa801nd-v3|\
445 tl-wa830re-v2|\
446 tl-wa850re|\
447 tl-wa850re-v2|\
448 tl-wa855re-v1|\
449 tl-wa860re|\
450 tl-wa901nd|\
451 tl-wa901nd-v2|\
452 tl-wa901nd-v3|\
453 tl-wa901nd-v4|\
454 tl-wa901nd-v5|\
455 tl-wdr3320-v2|\
456 tl-wdr3500|\
457 tl-wdr4300|\
458 tl-wdr4900-v2|\
459 tl-wdr6500-v2|\
460 tl-wpa8630|\
461 tl-wr1041n-v2|\
462 tl-wr1043nd|\
463 tl-wr1043nd-v2|\
464 tl-wr1043nd-v4|\
465 tl-wr2543n|\
466 tl-wr703n|\
467 tl-wr710n|\
468 tl-wr720n-v3|\
469 tl-wr740n-v6|\
470 tl-wr741nd|\
471 tl-wr741nd-v4|\
472 tl-wr802n-v1|\
473 tl-wr802n-v2|\
474 tl-wr810n|\
475 tl-wr810n-v2|\
476 tl-wr840n-v2|\
477 tl-wr840n-v3|\
478 tl-wr841n-v1|\
479 tl-wr841n-v7|\
480 tl-wr841n-v8|\
481 tl-wr841n-v9|\
482 tl-wr841n-v11|\
483 tl-wr842n-v2|\
484 tl-wr842n-v3|\
485 tl-wr902ac-v1|\
486 tl-wr940n-v4|\
487 tl-wr940n-v6|\
488 tl-wr941nd|\
489 tl-wr941nd-v5|\
490 tl-wr941nd-v6|\
491 ts-d084|\
492 wifi-pineapple-nano)
493 local magic_ver="0100"
494
495 case "$board" in
496 tl-wdr6500-v2)
497 magic_ver="0200"
498 ;;
499 esac
500
501 [ "$magic" != "$magic_ver" ] && {
502 echo "Invalid image type."
503 return 1
504 }
505
506 local hwid
507 local mid
508 local imagehwid
509 local imagemid
510
511 hwid=$(tplink_get_hwid)
512 mid=$(tplink_get_mid)
513 imagehwid=$(tplink_get_image_hwid "$1")
514 imagemid=$(tplink_get_image_mid "$1")
515
516 [ "$hwid" != "$imagehwid" -o "$mid" != "$imagemid" ] && {
517 echo "Invalid image, hardware ID mismatch, hw:$hwid $mid image:$imagehwid $imagemid."
518 return 1
519 }
520
521 local boot_size
522
523 boot_size=$(tplink_get_image_boot_size "$1")
524 [ "$boot_size" != "00000000" ] && {
525 echo "Invalid image, it contains a bootloader."
526 return 1
527 }
528
529 return 0
530 ;;
531 bsb|\
532 dir-825-b1|\
533 tew-673gru)
534 dir825b_check_image "$1" && return 0
535 ;;
536 rb-411|\
537 rb-411u|\
538 rb-433|\
539 rb-433u|\
540 rb-435g|\
541 rb-450|\
542 rb-450g|\
543 rb-493|\
544 rb-493g|\
545 rb-750|\
546 rb-750gl|\
547 rb-751|\
548 rb-751g|\
549 rb-911g-2hpnd|\
550 rb-911g-5hpnd|\
551 rb-911g-5hpacd|\
552 rb-912uag-2hpnd|\
553 rb-912uag-5hpnd|\
554 rb-921gs-5hpacd-r2|\
555 rb-951g-2hnd|\
556 rb-951ui-2hnd|\
557 rb-2011l|\
558 rb-2011il|\
559 rb-2011ils|\
560 rb-2011uas|\
561 rb-2011uas-2hnd|\
562 rb-2011uias|\
563 rb-2011uias-2hnd|\
564 rb-sxt2n|\
565 rb-sxt5n)
566 nand_do_platform_check routerboard $1
567 return $?
568 ;;
569 c-60|\
570 hiveap-121|\
571 nbg6716|\
572 r6100|\
573 rambutan|\
574 wi2a-ac200i|\
575 wndr3700v4|\
576 wndr4300)
577 nand_do_platform_check $board $1
578 return $?
579 ;;
580 cpe210|\
581 cpe510|\
582 eap120|\
583 eap220|\
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 rb-wapr-2nd)
718 return 0
719 ;;
720 esac
721
722 echo "Sysupgrade is not yet supported on $board."
723 return 1
724 }
725
726 platform_pre_upgrade() {
727 local board=$(board_name)
728
729 case "$board" in
730 rb-750-r2|\
731 rb-750p-pbr2|\
732 rb-750up-r2|\
733 rb-911-2hn|\
734 rb-911-5hn|\
735 rb-941-2nd|\
736 rb-951ui-2nd|\
737 rb-952ui-5ac2nd|\
738 rb-962uigs-5hact2hnt|\
739 rb-lhg-5nd|\
740 rb-map-2nd|\
741 rb-mapl-2nd|\
742 rb-wap-2nd|\
743 rb-wapg-5hact2hnd|\
744 rb-wapr-2nd)
745 # erase firmware if booted from initramfs
746 [ -z "$(rootfs_type)" ] && mtd erase firmware
747 ;;
748 esac
749 }
750
751 platform_nand_pre_upgrade() {
752 local board=$(board_name)
753
754 case "$board" in
755 rb*)
756 CI_KERNPART=none
757 local fw_mtd=$(find_mtd_part kernel)
758 fw_mtd="${fw_mtd/block/}"
759 [ -n "$fw_mtd" ] || return
760 mtd erase kernel
761 tar xf "$1" sysupgrade-routerboard/kernel -O | nandwrite -o "$fw_mtd" -
762 ;;
763 wi2a-ac200i)
764 case "$(fw_printenv -n dualPartition)" in
765 imgA)
766 fw_setenv dualPartition imgB
767 fw_setenv ActImg NokiaImageB
768 ;;
769 imgB)
770 fw_setenv dualPartition imgA
771 fw_setenv ActImg NokiaImageA
772 ;;
773 esac
774 ubiblock -r /dev/ubiblock0_0 2>/dev/null >/dev/null
775 rm -f /dev/ubiblock0_0
776 ubidetach -d 0 2>/dev/null >/dev/null
777 CI_UBIPART=ubi_alt
778 CI_KERNPART=kernel_alt
779 ;;
780 esac
781 }
782
783 platform_do_upgrade() {
784 local board=$(board_name)
785
786 case "$board" in
787 all0258n)
788 platform_do_upgrade_allnet "0x9f050000" "$ARGV"
789 ;;
790 all0305|\
791 eap7660d|\
792 ja76pf|\
793 ja76pf2|\
794 jwap003|\
795 ls-sr71|\
796 pb42|\
797 pb44|\
798 routerstation|\
799 routerstation-pro)
800 platform_do_upgrade_combined "$ARGV"
801 ;;
802 all0315n)
803 platform_do_upgrade_allnet "0x9f080000" "$ARGV"
804 ;;
805 cap4200ag|\
806 eap300v2|\
807 ens202ext)
808 platform_do_upgrade_allnet "0xbf0a0000" "$ARGV"
809 ;;
810 dir-825-b1|\
811 tew-673gru)
812 platform_do_upgrade_dir825b "$ARGV"
813 ;;
814 a40|\
815 a60|\
816 mr1750|\
817 mr1750v2|\
818 mr600|\
819 mr600v2|\
820 mr900|\
821 mr900v2|\
822 om2p|\
823 om2p-hs|\
824 om2p-hsv2|\
825 om2p-hsv3|\
826 om2p-hsv4|\
827 om2p-lc|\
828 om2pv2|\
829 om2pv4|\
830 om5p|\
831 om5p-ac|\
832 om5p-acv2|\
833 om5p-an)
834 platform_do_upgrade_openmesh "$ARGV"
835 ;;
836 c-60|\
837 hiveap-121|\
838 nbg6716|\
839 r6100|\
840 rambutan|\
841 rb-411|\
842 rb-411u|\
843 rb-433|\
844 rb-433u|\
845 rb-435g|\
846 rb-450|\
847 rb-450g|\
848 rb-493|\
849 rb-493g|\
850 rb-750|\
851 rb-750gl|\
852 rb-751|\
853 rb-751g|\
854 rb-911g-2hpnd|\
855 rb-911g-5hpacd|\
856 rb-911g-5hpnd|\
857 rb-912uag-2hpnd|\
858 rb-912uag-5hpnd|\
859 rb-921gs-5hpacd-r2|\
860 rb-951g-2hnd|\
861 rb-951ui-2hnd|\
862 rb-2011il|\
863 rb-2011ils|\
864 rb-2011l|\
865 rb-2011uas|\
866 rb-2011uas-2hnd|\
867 rb-2011uias|\
868 rb-2011uias-2hnd|\
869 rb-sxt2n|\
870 rb-sxt5n|\
871 wi2a-ac200i|\
872 wndr3700v4|\
873 wndr4300)
874 nand_do_upgrade "$1"
875 ;;
876 mr18|\
877 z1)
878 merakinand_do_upgrade "$1"
879 ;;
880 uap-pro|\
881 unifi-outdoor-plus)
882 MTD_CONFIG_ARGS="-s 0x180000"
883 default_do_upgrade "$ARGV"
884 ;;
885 wp543|\
886 wpe72)
887 platform_do_upgrade_compex "$ARGV"
888 ;;
889 *)
890 default_do_upgrade "$ARGV"
891 ;;
892 esac
893 }