ipq40xx: add support for EZVIZ CS-W3-WD1200G EUP
[openwrt/openwrt.git] / target / linux / ipq40xx / base-files / etc / board.d / 02_network
index 9c232d49f792455d070b156a4cb1b24ab8ece0b9..57caa88c85865c4368865d720736f0d0aa242114 100755 (executable)
@@ -13,10 +13,12 @@ ipq40xx_setup_interfaces()
 
        case "$board" in
        8dev,jalapeno|\
-       alfa-network,ap120c-ac)
+       alfa-network,ap120c-ac|\
+       engenius,ens620ext)
                ucidef_set_interfaces_lan_wan "eth0" "eth1"
                ;;
        asus,map-ac2200|\
+       cilab,meshpoint-one|\
        openmesh,a42|\
        openmesh,a62)
                ucidef_set_interfaces_lan_wan "eth1" "eth0"
@@ -28,7 +30,8 @@ ipq40xx_setup_interfaces()
                        "0u@eth0" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1"
                ;;
        avm,fritzbox-4040|\
-       linksys,ea6350v3)
+       linksys,ea6350v3|\
+       linksys,ea8300)
                ucidef_set_interfaces_lan_wan "eth0" "eth1"
                ucidef_add_switch "switch0" \
                        "0u@eth0" "1:lan" "2:lan" "3:lan" "4:lan"
@@ -37,9 +40,8 @@ ipq40xx_setup_interfaces()
                ucidef_add_switch "switch0" \
                        "0u@eth0" "1:lan" "2:lan" "3:lan" "4:lan"
                ;;
-       compex,wpj428)
-               ucidef_set_interface_lan "eth0 eth1"
-               ;;
+       aruba,ap-303|\
+       avm,fritzrepeater-1200|\
        engenius,eap1300|\
        meraki,mr33|\
        netgear,ex6100v2|\
@@ -47,6 +49,16 @@ ipq40xx_setup_interfaces()
        zyxel,wre6606)
                ucidef_set_interface_lan "eth0"
                ;;
+       avm,fritzrepeater-3000|\
+       compex,wpj419|\
+       compex,wpj428)
+               ucidef_set_interface_lan "eth0 eth1"
+               ;;
+       ezviz,cs-w3-wd1200g-eup)
+               ucidef_set_interfaces_lan_wan "eth0" "eth1"
+               ucidef_add_switch "switch0" \
+                       "0u@eth0" "2:lan:3" "3:lan:2" "4:lan:1" "0u@eth1" "5:wan"
+               ;;
        glinet,gl-b1300)
                ucidef_set_interfaces_lan_wan "eth0" "eth1"
                ucidef_add_switch "switch0" \
@@ -58,6 +70,11 @@ ipq40xx_setup_interfaces()
                ucidef_add_switch "switch0" \
                        "0u@eth0" "3:lan" "4:lan" "0u@eth1" "5:wan"
                ;;
+       unielec,u4019-32m)
+               ucidef_set_interfaces_lan_wan "eth0" "eth1"
+               ucidef_add_switch "switch0" \
+                       "0u@eth0" "1:lan" "2:lan" "3:lan" "4:lan" "0u@eth1" "5:wan"
+               ;;
        *)
                echo "Unsupported hardware. Network interfaces not initialized"
                ;;
@@ -67,12 +84,26 @@ ipq40xx_setup_interfaces()
 ipq40xx_setup_macs()
 {
        local board="$1"
+       local lan_mac=""
+       local wan_mac=""
+       local label_mac=""
 
        case "$board" in
        asus,rt-ac58u)
                CI_UBIPART=UBI_DEV
-               wan_mac=$(mtd_get_mac_binary_ubi Factory 20486)
-               lan_mac=$(mtd_get_mac_binary_ubi Factory 4102)
+               wan_mac=$(mtd_get_mac_binary_ubi Factory 0x1006)
+               lan_mac=$(mtd_get_mac_binary_ubi Factory 0x5006)
+               label_mac=$wan_mac
+               ;;
+       cilab,meshpoint-one)
+               label_mac=$(mtd_get_mac_binary "ART" 0x1006)
+               ;;
+       engenius,ens620ext)
+               wan_mac=$(mtd_get_mac_ascii u-boot-env ethaddr)
+               lan_mac=$(macaddr_add "$wan_mac" 1)
+               ;;
+       ezviz,cs-w3-wd1200g-eup)
+               label_mac=$(mtd_get_mac_binary "ART" 0x6)
                ;;
        linksys,ea6350v3)
                wan_mac=$(mtd_get_mac_ascii devinfo hw_mac_addr)
@@ -80,8 +111,9 @@ ipq40xx_setup_macs()
                ;;
        esac
 
-        [ -n "$lan_mac" ] && ucidef_set_interface_macaddr "lan" $lan_mac
-        [ -n "$wan_mac" ] && ucidef_set_interface_macaddr "wan" $wan_mac
+       [ -n "$lan_mac" ] && ucidef_set_interface_macaddr "lan" $lan_mac
+       [ -n "$wan_mac" ] && ucidef_set_interface_macaddr "wan" $wan_mac
+       [ -n "$label_mac" ] && ucidef_set_label_macaddr $label_mac
 }
 
 board_config_update