41e60d7f01242b5830a8dbe60db42eb0ce0d6c71
[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 wbs210|\
584 wbs510)
585 tplink_pharos_check_image "$1" "7f454c46" "$(tplink_pharos_get_model_string)" '' && return 0
586 return 1
587 ;;
588 cpe210-v2)
589 tplink_pharos_check_image "$1" "01000000" "$(tplink_pharos_v2_get_model_string)" '\0\xff\r' && return 0
590 return 1
591 ;;
592 a40|\
593 a60|\
594 mr1750|\
595 mr1750v2|\
596 mr600|\
597 mr600v2|\
598 mr900|\
599 mr900v2|\
600 om2p|\
601 om2p-hs|\
602 om2p-hsv2|\
603 om2p-hsv3|\
604 om2p-hsv4|\
605 om2p-lc|\
606 om2pv2|\
607 om2pv4|\
608 om5p|\
609 om5p-ac|\
610 om5p-acv2|\
611 om5p-an)
612 platform_check_image_openmesh "$magic_long" "$1" && return 0
613 return 1
614 ;;
615 mr18|\
616 z1)
617 merakinand_do_platform_check $board $1
618 return $?
619 ;;
620 dir-869-a1|\
621 mynet-n600|\
622 mynet-n750|\
623 qihoo-c301)
624 [ "$magic_long" != "5ea3a417" ] && {
625 echo "Invalid image, bad magic: $magic_long"
626 return 1
627 }
628
629 local typemagic=$(seama_get_type_magic "$1")
630 [ "$typemagic" != "6669726d" ] && {
631 echo "Invalid image, bad type: $typemagic"
632 return 1
633 }
634
635 return 0
636 ;;
637 e2100l|\
638 mynet-rext|\
639 wrt160nl)
640 cybertan_check_image "$1" && return 0
641 return 1
642 ;;
643 nbg6616|\
644 uap-pro|\
645 unifi-outdoor-plus)
646 [ "$magic_long" != "19852003" ] && {
647 echo "Invalid image type."
648 return 1
649 }
650
651 return 0
652 ;;
653 tube2h)
654 alfa_check_image "$1" && return 0
655 return 1
656 ;;
657 wndr3700|\
658 wnr1000-v2|\
659 wnr2000-v3|\
660 wnr612-v2|\
661 wpn824n)
662 local hw_magic
663
664 hw_magic="$(ar71xx_get_mtd_part_magic firmware)"
665 [ "$magic_long" != "$hw_magic" ] && {
666 echo "Invalid image, hardware ID mismatch, hw:$hw_magic image:$magic_long."
667 return 1
668 }
669
670 return 0
671 ;;
672 wnr2000-v4)
673 [ "$magic_long" != "32303034" ] && {
674 echo "Invalid image type."
675 return 1
676 }
677
678 return 0
679 ;;
680 wnr2200)
681 [ "$magic_long" != "32323030" ] && {
682 echo "Invalid image type."
683 return 1
684 }
685
686 return 0
687 ;;
688 dap-2695-a1)
689 local magic=$(wrgg_get_image_magic "$1")
690 [ "$magic" != "21030820" ] && {
691 echo "Invalid image, bad type: $magic"
692 return 1
693 }
694
695 return 0;
696 ;;
697 # these boards use metadata images
698 fritz300e|\
699 fritz4020|\
700 fritz450e|\
701 koala|\
702 rb-750-r2|\
703 rb-750p-pbr2|\
704 rb-750up-r2|\
705 rb-911-2hn|\
706 rb-911-5hn|\
707 rb-941-2nd|\
708 rb-951ui-2nd|\
709 rb-952ui-5ac2nd|\
710 rb-962uigs-5hact2hnt|\
711 rb-lhg-5nd|\
712 rb-map-2nd|\
713 rb-mapl-2nd|\
714 rb-wap-2nd|\
715 rb-wapg-5hact2hnd|\
716 rb-wapr-2nd)
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 rb-wapr-2nd)
744 # erase firmware if booted from initramfs
745 [ -z "$(rootfs_type)" ] && mtd erase firmware
746 ;;
747 esac
748 }
749
750 platform_nand_pre_upgrade() {
751 local board=$(board_name)
752
753 case "$board" in
754 rb*)
755 CI_KERNPART=none
756 local fw_mtd=$(find_mtd_part kernel)
757 fw_mtd="${fw_mtd/block/}"
758 [ -n "$fw_mtd" ] || return
759 mtd erase kernel
760 tar xf "$1" sysupgrade-routerboard/kernel -O | nandwrite -o "$fw_mtd" -
761 ;;
762 wi2a-ac200i)
763 case "$(fw_printenv -n dualPartition)" in
764 imgA)
765 fw_setenv dualPartition imgB
766 fw_setenv ActImg NokiaImageB
767 ;;
768 imgB)
769 fw_setenv dualPartition imgA
770 fw_setenv ActImg NokiaImageA
771 ;;
772 esac
773 ubiblock -r /dev/ubiblock0_0 2>/dev/null >/dev/null
774 rm -f /dev/ubiblock0_0
775 ubidetach -d 0 2>/dev/null >/dev/null
776 CI_UBIPART=ubi_alt
777 CI_KERNPART=kernel_alt
778 ;;
779 esac
780 }
781
782 platform_do_upgrade() {
783 local board=$(board_name)
784
785 case "$board" in
786 all0258n)
787 platform_do_upgrade_allnet "0x9f050000" "$ARGV"
788 ;;
789 all0305|\
790 eap7660d|\
791 ja76pf|\
792 ja76pf2|\
793 jwap003|\
794 ls-sr71|\
795 pb42|\
796 pb44|\
797 routerstation|\
798 routerstation-pro)
799 platform_do_upgrade_combined "$ARGV"
800 ;;
801 all0315n)
802 platform_do_upgrade_allnet "0x9f080000" "$ARGV"
803 ;;
804 cap4200ag|\
805 eap300v2|\
806 ens202ext)
807 platform_do_upgrade_allnet "0xbf0a0000" "$ARGV"
808 ;;
809 dir-825-b1|\
810 tew-673gru)
811 platform_do_upgrade_dir825b "$ARGV"
812 ;;
813 a40|\
814 a60|\
815 mr1750|\
816 mr1750v2|\
817 mr600|\
818 mr600v2|\
819 mr900|\
820 mr900v2|\
821 om2p|\
822 om2p-hs|\
823 om2p-hsv2|\
824 om2p-hsv3|\
825 om2p-hsv4|\
826 om2p-lc|\
827 om2pv2|\
828 om2pv4|\
829 om5p|\
830 om5p-ac|\
831 om5p-acv2|\
832 om5p-an)
833 platform_do_upgrade_openmesh "$ARGV"
834 ;;
835 c-60|\
836 hiveap-121|\
837 nbg6716|\
838 r6100|\
839 rambutan|\
840 rb-411|\
841 rb-411u|\
842 rb-433|\
843 rb-433u|\
844 rb-435g|\
845 rb-450|\
846 rb-450g|\
847 rb-493|\
848 rb-493g|\
849 rb-750|\
850 rb-750gl|\
851 rb-751|\
852 rb-751g|\
853 rb-911g-2hpnd|\
854 rb-911g-5hpacd|\
855 rb-911g-5hpnd|\
856 rb-912uag-2hpnd|\
857 rb-912uag-5hpnd|\
858 rb-921gs-5hpacd-r2|\
859 rb-951g-2hnd|\
860 rb-951ui-2hnd|\
861 rb-2011il|\
862 rb-2011ils|\
863 rb-2011l|\
864 rb-2011uas|\
865 rb-2011uas-2hnd|\
866 rb-2011uias|\
867 rb-2011uias-2hnd|\
868 rb-sxt2n|\
869 rb-sxt5n|\
870 wi2a-ac200i|\
871 wndr3700v4|\
872 wndr4300)
873 nand_do_upgrade "$1"
874 ;;
875 mr18|\
876 z1)
877 merakinand_do_upgrade "$1"
878 ;;
879 uap-pro|\
880 unifi-outdoor-plus)
881 MTD_CONFIG_ARGS="-s 0x180000"
882 default_do_upgrade "$ARGV"
883 ;;
884 wp543|\
885 wpe72)
886 platform_do_upgrade_compex "$ARGV"
887 ;;
888 *)
889 default_do_upgrade "$ARGV"
890 ;;
891 esac
892 }