ipq806x: convert to dt-based board-detection
[openwrt/staging/wigyori.git] / target / linux / ipq806x / base-files / lib / upgrade / platform.sh
1 PART_NAME=firmware
2 REQUIRE_IMAGE_METADATA=1
3
4 RAMFS_COPY_BIN='fw_printenv fw_setenv'
5 RAMFS_COPY_DATA='/etc/fw_env.config /var/lock/fw_printenv.lock'
6
7 platform_check_image() {
8 return 0;
9 }
10
11 platform_do_upgrade() {
12 case "$(board_name)" in
13 netgear,d7800 |\
14 netgear,r7500 |\
15 netgear,r7500v2 |\
16 netgear,r7800 |\
17 qcom,ap-dk04.1-c1 |\
18 qcom,ipq8064-ap148 |\
19 zyxel,nbg6817)
20 nand_do_upgrade "$ARGV"
21 ;;
22 tplink,c2600)
23 PART_NAME="os-image:rootfs"
24 MTD_CONFIG_ARGS="-s 0x200000"
25 default_do_upgrade "$ARGV"
26 ;;
27 linksys,ea8500)
28 platform_do_upgrade_linksys "$ARGV"
29 ;;
30 tplink,vr2600v)
31 PART_NAME="kernel:rootfs"
32 MTD_CONFIG_ARGS="-s 0x200000"
33 default_do_upgrade "$ARGV"
34 ;;
35 *)
36 default_do_upgrade "$ARGV"
37 ;;
38 esac
39 }
40
41 platform_nand_pre_upgrade() {
42 case "$(board_name)" in
43 zyxel,nbg6817)
44 zyxel_do_upgrade "$1"
45 ;;
46 esac
47 }
48
49 blink_led() {
50 . /etc/diag.sh; set_state upgrade
51 }
52
53 append sysupgrade_pre_upgrade blink_led