Author: blogic
Date: 2015-10-05 12:25:47 +0200 (Mon, 05 Oct 2015)
New Revision: 47111

Modified:
   trunk/target/linux/ramips/base-files/etc/board.d/01_leds
   trunk/target/linux/ramips/base-files/etc/board.d/02_network
   trunk/target/linux/ramips/base-files/etc/diag.sh
   trunk/target/linux/ramips/base-files/lib/ramips.sh
   trunk/target/linux/ramips/base-files/lib/upgrade/platform.sh
Log:
ramips: Add base-files for HiWiFi HC5x61 models

HiWiFi HC5661/5761/5861 models are manufactured by http://www.hiwifi.com. These 
models have similar hardware specs(MT7620A + 128M DDR2 + 16M flash). This patch 
adds support for them.

The original author is Justin Liu ([email protected]). I ported the patch to 
trunk and submitted it here with his approval.

v3 fix
   1: Fixed model order
   2: Remove manufacturer name from model name
   3: Use a hacky but prettier way to get mac address.

Signed-off-by: Xiaoning Kang <[email protected]>

Modified: trunk/target/linux/ramips/base-files/etc/board.d/01_leds
===================================================================
--- trunk/target/linux/ramips/base-files/etc/board.d/01_leds    2015-10-05 
10:25:40 UTC (rev 47110)
+++ trunk/target/linux/ramips/base-files/etc/board.d/01_leds    2015-10-05 
10:25:47 UTC (rev 47111)
@@ -132,6 +132,24 @@
        set_usb_led "$board:orange:usb"
        set_wifi_led "$board:orange:wifi"
        ;;
+hc5661)
+       ucidef_set_led_default "system" "system" "$board:blue:system" "1"
+       ucidef_set_led_netdev "internet" "internet" "$board:blue:internet" 
"eth0.2"
+       set_wifi_led "$board:blue:wlan2g"
+       ;;      
+hc5761)
+       ucidef_set_led_default "system" "system" "$board:blue:system" "1"
+       ucidef_set_led_netdev "internet" "internet" "$board:blue:internet" 
"eth0.2"
+       set_wifi_led "$board:blue:wlan2g"
+       ucidef_set_led_netdev "wifi5g" "wifi5g" "$board:blue:wlan5g" "rai0"
+       ;;
+hc5861)
+       ucidef_set_led_default "system" "system" "$board:blue:system" "1"
+       ucidef_set_led_netdev "internet" "internet" "$board:blue:internet" 
"eth0.2"
+       set_wifi_led "$board:blue:wlan2g"
+       ucidef_set_led_netdev "wifi5g" "wifi5g" "$board:blue:wlan5g" "rai0"
+       ucidef_set_led_default "turbo" "turbo" "$board:blue:turbo" "0"
+       ;;
 hg255d)
        set_wifi_led "$board:green:wlan"
        set_usb_led "$board:green:usb"

Modified: trunk/target/linux/ramips/base-files/etc/board.d/02_network
===================================================================
--- trunk/target/linux/ramips/base-files/etc/board.d/02_network 2015-10-05 
10:25:40 UTC (rev 47110)
+++ trunk/target/linux/ramips/base-files/etc/board.d/02_network 2015-10-05 
10:25:47 UTC (rev 47111)
@@ -170,6 +170,13 @@
                ucidef_add_switch_vlan "switch1" "1" "0 1 2 3 6t"
                ucidef_add_switch_vlan "switch1" "2" "4 6t"
                ;;
+       hc5*61|\
+       y1s)
+               ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
+               ucidef_add_switch "switch0" "1" "1"
+               ucidef_add_switch_vlan "switch0" "1" "1 2 3 4 5 6t"
+               ucidef_add_switch_vlan "switch0" "2" "0 6t"
+               ;;
        m2m)
                ucidef_add_switch "switch0" "4"
                ucidef_set_interface_lan "eth0"
@@ -224,12 +231,6 @@
                ucidef_add_switch_vlan "switch0" "1" "1 2 6t"
                ucidef_add_switch_vlan "switch0" "2" "0 6t"
                ;;
-       y1s)
-               ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
-               ucidef_add_switch "switch0" "1" "1"
-               ucidef_add_switch_vlan "switch0" "1" "1 2 3 4 5 6t"
-               ucidef_add_switch_vlan "switch0" "2" "0 6t"
-               ;;
        zbt-wr8305rt)
                ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
                ucidef_add_switch "switch0" "1" "1"
@@ -293,6 +294,11 @@
        e1700)
                wan_mac=$(mtd_get_mac_ascii config WAN_MAC_ADDR)
                ;;
+       hc5*61)
+               lan_mac=`mtd_get_mac_ascii bdinfo "Vfac_mac "`
+               [ -n "$lan_mac" ] || lan_mac=$(cat /sys/class/net/eth0/address)
+               wan_mac=$(macaddr_add "$lan_mac" 1)
+               ;;
        ht-tm02)
                lan_mac=$(cat /sys/class/net/eth0/address)
                ;;

Modified: trunk/target/linux/ramips/base-files/etc/diag.sh
===================================================================
--- trunk/target/linux/ramips/base-files/etc/diag.sh    2015-10-05 10:25:40 UTC 
(rev 47110)
+++ trunk/target/linux/ramips/base-files/etc/diag.sh    2015-10-05 10:25:47 UTC 
(rev 47111)
@@ -104,6 +104,11 @@
        f7c027)
                status_led="$board:orange:status"
                ;;
+       hc5*61|\
+       mlw221|\
+       mlwg2)
+               status_led="$board:blue:system"
+               ;;
        m2m)
                status_led="$board:blue:wifi"
                ;;
@@ -115,10 +120,6 @@
        zte-q7)
                status_led="$board:red:status"
                ;;
-       mlw221|\
-       mlwg2)
-               status_led="$board:blue:system"
-               ;;
        mr-102n)
                status_led="$board:amber:status"
                ;;

Modified: trunk/target/linux/ramips/base-files/lib/ramips.sh
===================================================================
--- trunk/target/linux/ramips/base-files/lib/ramips.sh  2015-10-05 10:25:40 UTC 
(rev 47110)
+++ trunk/target/linux/ramips/base-files/lib/ramips.sh  2015-10-05 10:25:47 UTC 
(rev 47111)
@@ -169,6 +169,15 @@
        *"FreeStation5")
                name="freestation5"
                ;;
+       *"HC5661")
+               name="hc5661"
+               ;;
+       *"HC5761")
+               name="hc5761"
+               ;;
+       *"HC5861")
+               name="hc5861"
+               ;;
        *"HG255D")
                name="hg255d"
                ;;

Modified: trunk/target/linux/ramips/base-files/lib/upgrade/platform.sh
===================================================================
--- trunk/target/linux/ramips/base-files/lib/upgrade/platform.sh        
2015-10-05 10:25:40 UTC (rev 47110)
+++ trunk/target/linux/ramips/base-files/lib/upgrade/platform.sh        
2015-10-05 10:25:47 UTC (rev 47111)
@@ -55,6 +55,7 @@
        firewrt|\
        fonera20n|\
        freestation5|\
+       hc5*61|\
        hg255d|\
        hlk-rm04|\
        hpm|\
_______________________________________________
openwrt-commits mailing list
[email protected]
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-commits

Reply via email to