ipq806x: add initial support for Netgear R7800
[openwrt/staging/lynxis/omap.git] / target / linux / ipq806x / base-files / lib / upgrade / platform.sh
1 . /lib/ipq806x.sh
2
3 PART_NAME=firmware
4
5 platform_check_image() {
6 local board=$(ipq806x_board_name)
7
8 case "$board" in
9 ap148 |\
10 d7800 |\
11 ea8500 |\
12 r7500 |\
13 r7800)
14 nand_do_platform_check $board $1
15 return $?;
16 ;;
17 c2600)
18 local magic_long="$(get_magic_long "$1")"
19 [ "$magic_long" != "27051956" ] && {
20 echo "Invalid image, bad magic: $magic_long"
21 return 1
22 }
23 return 0;
24 ;;
25 *)
26 return 1;
27 esac
28 }
29
30 platform_pre_upgrade() {
31 local board=$(ipq806x_board_name)
32
33 case "$board" in
34 ap148 |\
35 d7800 |\
36 r7500 |\
37 r7800)
38 nand_do_upgrade "$1"
39 ;;
40 ea8500)
41 linksys_preupgrade "$1"
42 ;;
43 esac
44 }
45
46 platform_do_upgrade() {
47 local board=$(ipq806x_board_name)
48
49 case "$board" in
50 c2600)
51 PART_NAME="os-image:rootfs"
52 MTD_CONFIG_ARGS="-s 0x200000"
53 default_do_upgrade "$ARGV"
54 ;;
55 ea8500)
56 platform_do_upgrade_linksys "$ARGV"
57 ;;
58 esac
59 }