ipq806x/base-files: Add support for Archer C2600
authorAsh Benz <ash.benz@bk.ru>
Fri, 27 May 2016 14:26:42 +0000 (22:26 +0800)
committerJohn Crispin <john@phrozen.org>
Fri, 27 May 2016 13:50:17 +0000 (15:50 +0200)
Signed-off-by: Ash Benz <ash.benz@bk.ru>
target/linux/ipq806x/base-files/lib/ipq806x.sh
target/linux/ipq806x/base-files/lib/upgrade/platform.sh

index db227087f41e5d339a612cb574ad46a14909496f..73202c0b8814da5c9f8ba0515d47516c4819e891 100644 (file)
@@ -17,6 +17,9 @@ ipq806x_board_detect() {
        *"AP148")
                name="ap148"
                ;;
+       *"C2600")
+               name="c2600"
+               ;;
        *"D7800")
                name="d7800"
                ;;
index 542b5cecde111f0bb66ed9237a3145a51bf7777e..a181f13b43a2f02916c97e713a75adff571a79e6 100644 (file)
@@ -12,6 +12,14 @@ platform_check_image() {
                nand_do_platform_check $board $1
                return $?;
                ;;
+       c2600)
+               local magic_long="$(get_magic_long "$1")"
+               [ "$magic_long" != "27051956" ] && {
+                       echo "Invalid image, bad magic: $magic_long"
+                       return 1
+               }
+               return 0;
+               ;;
        *)
                return 1;
        esac
@@ -29,4 +37,14 @@ platform_pre_upgrade() {
        esac
 }
 
-# use default for platform_do_upgrade()
+platform_do_upgrade() {
+       local board=$(ipq806x_board_name)
+
+       case "$board" in
+       c2600)
+               PART_NAME="os-image:rootfs"
+               MTD_CONFIG_ARGS="-s 0x200000"
+               default_do_upgrade "$ARGV"
+               ;;
+       esac
+}