ramips: add user-space detection for ALL5002/ALL5003
authorGabor Juhos <juhosg@openwrt.org>
Sun, 3 Mar 2013 12:47:28 +0000 (12:47 +0000)
committerGabor Juhos <juhosg@openwrt.org>
Sun, 3 Mar 2013 12:47:28 +0000 (12:47 +0000)
Signed-off-by: Daniel Golle <dgolle@allnet.de>
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
SVN-Revision: 35852

target/linux/ramips/base-files/lib/ramips.sh

index 4b3e362accb02f419334de7b86ddfab3e5360e4c..070214535875e08182dd3cda98ee2a870fdcda8a 100755 (executable)
@@ -6,6 +6,19 @@
 RAMIPS_BOARD_NAME=
 RAMIPS_MODEL=
 
+all500x_board_detect() {
+       local systype
+
+       systype=$(awk 'BEGIN{FS="[ \t]+:[ \t]"} /system type/ {print $2}' /proc/cpuinfo)
+       case "$systype" in
+       *"RT5350"*)
+               RAMIPS_MODEL="Allnet ALL5003"
+               ;;
+       *"RT3352"*)
+               RAMIPS_MODEL="Allnet ALL5002"
+               ;;
+       esac
+}
 
 ramips_board_detect() {
        local machine
@@ -193,6 +206,12 @@ ramips_board_detect() {
                ;;
        esac
 
+       case "$machine" in
+       *"Allnet ALL5002/ALL5003")
+               all500x_board_detect
+               ;;
+       esac
+
        [ -z "$RAMIPS_BOARD_NAME" ] && RAMIPS_BOARD_NAME="$name"
        [ -z "$RAMIPS_MODEL" ] && RAMIPS_MODEL="$machine"