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