summaryrefslogtreecommitdiff
path: root/target/linux/mvebu/base-files
diff options
context:
space:
mode:
authorImre Kaloz <kaloz@openwrt.org>2016-10-13 12:52:20 +0200
committerFelix Fietkau <nbd@nbd.name>2016-10-24 08:45:06 +0200
commit3764caa93478e3472df3128b79b6d0f6b0fb999c (patch)
tree3ddc2ed6f8a0eb6525ef0267042fd81bab749223 /target/linux/mvebu/base-files
parent5da412bf802f902bfa227157c457e41daa4558f8 (diff)
downloadmtk-20170518-3764caa93478e3472df3128b79b6d0f6b0fb999c.zip
mtk-20170518-3764caa93478e3472df3128b79b6d0f6b0fb999c.tar.gz
mtk-20170518-3764caa93478e3472df3128b79b6d0f6b0fb999c.tar.bz2
mvebu: add support for the Linksys WRT3200ACM (Rango)
Signed-off-by: Imre Kaloz <kaloz@openwrt.org> Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
Diffstat (limited to 'target/linux/mvebu/base-files')
-rwxr-xr-xtarget/linux/mvebu/base-files/etc/board.d/01_leds8
-rwxr-xr-xtarget/linux/mvebu/base-files/etc/board.d/02_network4
-rw-r--r--target/linux/mvebu/base-files/etc/diag.sh3
-rwxr-xr-xtarget/linux/mvebu/base-files/etc/init.d/linksys_recovery5
-rwxr-xr-xtarget/linux/mvebu/base-files/lib/mvebu.sh4
-rw-r--r--target/linux/mvebu/base-files/lib/preinit/06_set_iface_mac3
-rw-r--r--target/linux/mvebu/base-files/lib/preinit/81_linksys_syscfg14
-rwxr-xr-xtarget/linux/mvebu/base-files/lib/upgrade/platform.sh7
8 files changed, 34 insertions, 14 deletions
diff --git a/target/linux/mvebu/base-files/etc/board.d/01_leds b/target/linux/mvebu/base-files/etc/board.d/01_leds
index 71dd347..8310160 100755
--- a/target/linux/mvebu/base-files/etc/board.d/01_leds
+++ b/target/linux/mvebu/base-files/etc/board.d/01_leds
@@ -1,6 +1,7 @@
#!/bin/sh
#
-# Copyright (C) 2014-2015 OpenWrt.org
+# Copyright (C) 2014-2016 OpenWrt.org
+# Copyright (C) 2016 LEDE-Project.org
#
. /lib/functions/uci-defaults.sh
@@ -21,6 +22,11 @@ armada-385-linksys-cobra)
ucidef_set_led_usbdev "usb2" "USB2" "pca963x:cobra:white:usb2" "1-1"
ucidef_set_led_usbdev "usb3" "USB3" "pca963x:cobra:white:usb3_1" "2-1"
;;
+armada-385-linksys-rango)
+ ucidef_set_led_netdev "wan" "WAN" "pca963x:rango:white:wan" "eth0"
+ ucidef_set_led_usbdev "usb2" "USB2" "pca963x:rango:white:usb2" "1-1"
+ ucidef_set_led_usbdev "usb3" "USB3" "pca963x:rango:white:usb3_1" "2-1"
+ ;;
armada-385-linksys-shelby)
ucidef_set_led_netdev "wan" "WAN" "pca963x:shelby:white:wan" "eth0"
ucidef_set_led_usbdev "usb2" "USB2" "pca963x:shelby:white:usb2" "1-1"
diff --git a/target/linux/mvebu/base-files/etc/board.d/02_network b/target/linux/mvebu/base-files/etc/board.d/02_network
index 21c6660..614a0e2 100755
--- a/target/linux/mvebu/base-files/etc/board.d/02_network
+++ b/target/linux/mvebu/base-files/etc/board.d/02_network
@@ -1,6 +1,7 @@
#!/bin/sh
#
-# Copyright (C) 2014-2015 OpenWrt.org
+# Copyright (C) 2014-2016 OpenWrt.org
+# Copyright (C) 2016 LEDE-Project.org
#
. /lib/functions/uci-defaults.sh
@@ -13,6 +14,7 @@ board=$(mvebu_board_name)
case "$board" in
armada-385-linksys-caiman|\
armada-385-linksys-cobra|\
+armada-385-linksys-rango|\
armada-385-linksys-shelby)
ucidef_set_interfaces_lan_wan "eth1" "eth0"
ucidef_add_switch "switch0" \
diff --git a/target/linux/mvebu/base-files/etc/diag.sh b/target/linux/mvebu/base-files/etc/diag.sh
index a361fa7..622c7d9 100644
--- a/target/linux/mvebu/base-files/etc/diag.sh
+++ b/target/linux/mvebu/base-files/etc/diag.sh
@@ -13,6 +13,9 @@ get_status_led() {
armada-385-linksys-cobra)
status_led="cobra:white:power"
;;
+ armada-385-linksys-rango)
+ status_led="rango:white:power"
+ ;;
armada-385-linksys-shelby)
status_led="shelby:white:power"
;;
diff --git a/target/linux/mvebu/base-files/etc/init.d/linksys_recovery b/target/linux/mvebu/base-files/etc/init.d/linksys_recovery
index d9cae7b..8eeb5f9 100755
--- a/target/linux/mvebu/base-files/etc/init.d/linksys_recovery
+++ b/target/linux/mvebu/base-files/etc/init.d/linksys_recovery
@@ -1,5 +1,6 @@
#!/bin/sh /etc/rc.common
-# Copyright (C) 2015 OpenWrt.org
+# Copyright (C) 2015-2016 OpenWrt.org
+# Copyright (C) 2016 LEDE-Project.org
START=97
boot() {
@@ -7,7 +8,7 @@ boot() {
. /lib/mvebu.sh
case $(mvebu_board_name) in
- armada-385-linksys-caiman|armada-385-linksys-cobra|armada-385-linksys-shelby|armada-xp-linksys-mamba)
+ armada-385-linksys-caiman|armada-385-linksys-cobra|armada-385-linksys-rango|armada-385-linksys-shelby|armada-xp-linksys-mamba)
# make sure auto_recovery in uboot is always on
AUTO_RECOVERY_ENA="`fw_printenv -n auto_recovery`"
if [ "$AUTO_RECOVERY_ENA" != "yes" ] ; then
diff --git a/target/linux/mvebu/base-files/lib/mvebu.sh b/target/linux/mvebu/base-files/lib/mvebu.sh
index 836717d..9a4c53e 100755
--- a/target/linux/mvebu/base-files/lib/mvebu.sh
+++ b/target/linux/mvebu/base-files/lib/mvebu.sh
@@ -1,6 +1,7 @@
#!/bin/sh
#
# Copyright (C) 2013-2015 OpenWrt.org
+# Copyright (C) 2016 LEDE-Project.org
#
MVEBU_BOARD_NAME=
@@ -43,6 +44,9 @@ mvebu_board_detect() {
*"Linksys WRT1900ACS")
name="armada-385-linksys-shelby"
;;
+ *"Linksys WRT3200ACM")
+ name="armada-385-linksys-rango"
+ ;;
*"Marvell Armada 385 Access Point Development Board")
name="armada-385-db-ap"
;;
diff --git a/target/linux/mvebu/base-files/lib/preinit/06_set_iface_mac b/target/linux/mvebu/base-files/lib/preinit/06_set_iface_mac
index 876c08b..3e870e8 100644
--- a/target/linux/mvebu/base-files/lib/preinit/06_set_iface_mac
+++ b/target/linux/mvebu/base-files/lib/preinit/06_set_iface_mac
@@ -1,5 +1,6 @@
#
# Copyright (C) 2014-2015 OpenWrt.org
+# Copyright (C) 2016 LEDE-Project.org
#
preinit_set_mac_address() {
@@ -14,7 +15,7 @@ preinit_set_mac_address() {
ifconfig eth0 hw ether $mac 2>/dev/null
ifconfig eth1 hw ether $mac 2>/dev/null
;;
- armada-385-linksys-caiman|armada-385-linksys-cobra|armada-385-linksys-shelby)
+ armada-385-linksys-caiman|armada-385-linksys-cobra|armada-385-linksys-rango|armada-385-linksys-shelby)
mac=$(mtd_get_mac_ascii devinfo hw_mac_addr)
mac_wan=$(macaddr_setbit_la "$mac")
ifconfig eth1 hw ether $mac 2>/dev/null
diff --git a/target/linux/mvebu/base-files/lib/preinit/81_linksys_syscfg b/target/linux/mvebu/base-files/lib/preinit/81_linksys_syscfg
index a54226f..3edd82e 100644
--- a/target/linux/mvebu/base-files/lib/preinit/81_linksys_syscfg
+++ b/target/linux/mvebu/base-files/lib/preinit/81_linksys_syscfg
@@ -1,5 +1,6 @@
#
-# Copyright (C) 2014 OpenWrt.org
+# Copyright (C) 2014-2016 OpenWrt.org
+# Copyright (C) 2016 LEDE-Project.org
#
preinit_mount_syscfg() {
@@ -8,15 +9,16 @@ preinit_mount_syscfg() {
. /lib/mvebu.sh
case $(mvebu_board_name) in
- armada-385-linksys-caiman|armada-385-linksys-cobra|armada-385-linksys-shelby|armada-xp-linksys-mamba)
+ armada-385-linksys-caiman|armada-385-linksys-cobra|armada-385-linksys-rango|armada-385-linksys-shelby|armada-xp-linksys-mamba)
needs_recovery=0
- ubiattach -m 8 || needs_recovery=1
+ syscfg_part=$(grep syscfg /proc/mtd |cut -c4)
+ ubiattach -m $syscfg_part || needs_recovery=1
if [ $needs_recovery -eq 1 ]
then
echo "ubifs syscfg partition is damaged, reformatting"
- ubidetach -m 8
- ubiformat -y -O 2048 -q /dev/mtd8
- ubiattach -m 8
+ ubidetach -m $syscfg_part
+ ubiformat -y -O 2048 -q /dev/mtd$syscfg_part
+ ubiattach -m $syscfg_part
ubimkvol /dev/ubi1 -n 0 -N syscfg -t dynamic --maxavsize
fi
mkdir /tmp/syscfg
diff --git a/target/linux/mvebu/base-files/lib/upgrade/platform.sh b/target/linux/mvebu/base-files/lib/upgrade/platform.sh
index 5652e98..a8ad602 100755
--- a/target/linux/mvebu/base-files/lib/upgrade/platform.sh
+++ b/target/linux/mvebu/base-files/lib/upgrade/platform.sh
@@ -1,5 +1,6 @@
#
-# Copyright (C) 2014 OpenWrt.org
+# Copyright (C) 2014-2016 OpenWrt.org
+# Copyright (C) 2016 LEDE-Project.org
#
. /lib/mvebu.sh
@@ -13,7 +14,7 @@ platform_check_image() {
[ "$#" -gt 1 ] && return 1
case "$board" in
- armada-385-linksys-caiman|armada-385-linksys-cobra|armada-385-linksys-shelby|armada-xp-linksys-mamba)
+ armada-385-linksys-caiman|armada-385-linksys-cobra|armada-385-linksys-rango|armada-385-linksys-shelby|armada-xp-linksys-mamba)
[ "$magic_long" != "27051956" -a "$magic_long" != "73797375" ] && {
echo "Invalid image type."
return 1
@@ -34,7 +35,7 @@ platform_do_upgrade() {
local board=$(mvebu_board_name)
case "$board" in
- armada-385-linksys-caiman|armada-385-linksys-cobra|armada-385-linksys-shelby|armada-xp-linksys-mamba)
+ armada-385-linksys-caiman|armada-385-linksys-cobra|armada-385-linksys-rango|armada-385-linksys-shelby|armada-xp-linksys-mamba)
platform_do_upgrade_linksys "$ARGV"
;;
armada-388-clearfog)