ramips: minew g1-c: Allow dynamic RAM sizes
[openwrt/openwrt.git] / target / linux / ipq806x / base-files / etc / board.d / 02_network
1 #
2 # Copyright (c) 2015 The Linux Foundation. All rights reserved.
3 # Copyright (c) 2011-2015 OpenWrt.org
4 #
5
6 . /lib/functions/uci-defaults.sh
7 . /lib/functions/system.sh
8
9 board_config_update
10
11 board=$(board_name)
12
13 case "$board" in
14 askey,rt4230w-rev6 |\
15 asrock,g10 |\
16 nec,wg2600hp)
17 ucidef_add_switch "switch0" \
18 "2:lan" "3:lan" "4:lan" "5:lan" "6@eth1" "1:wan" "0@eth0"
19 ;;
20 buffalo,wxr-2533dhp |\
21 compex,wpq864 |\
22 netgear,d7800 |\
23 netgear,r7500 |\
24 netgear,r7500v2 |\
25 qcom,ipq8064-ap148 |\
26 tplink,vr2600v)
27 ucidef_add_switch "switch0" \
28 "1:lan" "2:lan" "3:lan" "4:lan" "6@eth1" "5:wan" "0@eth0"
29 ;;
30 edgecore,ecw5410)
31 ucidef_set_interfaces_lan_wan "eth1" "eth0"
32 if [ -b "$(find_mtd_part 0:art)" ]; then
33 ucidef_set_interface_macaddr "lan" "$(mtd_get_mac_binary "0:art" 0x6)"
34 ucidef_set_interface_macaddr "wan" "$(mtd_get_mac_binary "0:art" 0x0)"
35 else
36 # XXX: drop upper case after kernel v5.4 is gone (qcom-smem)
37 ucidef_set_interface_macaddr "lan" "$(mtd_get_mac_binary "0:ART" 0x6)"
38 ucidef_set_interface_macaddr "wan" "$(mtd_get_mac_binary "0:ART" 0x0)"
39 fi
40 ;;
41 linksys,ea7500-v1)
42 hw_mac_addr=$(mtd_get_mac_ascii devinfo hw_mac_addr)
43 ucidef_add_switch "switch0" \
44 "2:lan:1" "3:lan:2" "4:lan:3" "5:lan:4" "6@eth1" "1:wan" "0@eth0"
45 ucidef_set_interface_macaddr "lan" "$hw_mac_addr"
46 ucidef_set_interface_macaddr "wan" "$hw_mac_addr"
47 ;;
48 linksys,ea8500)
49 hw_mac_addr=$(mtd_get_mac_ascii devinfo hw_mac_addr)
50 ucidef_add_switch "switch0" \
51 "1:lan" "2:lan" "3:lan" "4:lan" "6@eth1" "5:wan" "0@eth0"
52 ucidef_set_interface_macaddr "lan" "$hw_mac_addr"
53 ucidef_set_interface_macaddr "wan" "$hw_mac_addr"
54 ;;
55 nec,wg2600hp3)
56 ucidef_add_switch "switch0" \
57 "2:lan" "3:lan" "4:lan" "5:lan" "0@eth1" "1:wan" "6@eth0"
58 ;;
59 netgear,r7800 |\
60 tplink,c2600)
61 ucidef_add_switch "switch0" \
62 "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "6@eth1" "5:wan" "0@eth0"
63 ;;
64 qcom,ipq8064-ap161)
65 ucidef_set_interface_lan "eth1 eth2"
66 ucidef_add_switch "switch0" \
67 "0:lan" "1:lan" "2:lan" "3u@eth1" "6:wan" "4u@eth0"
68 ;;
69 qcom,ipq8064-db149)
70 ucidef_set_interface_lan "eth1 eth2 eth3"
71 ucidef_add_switch "switch0" \
72 "1:lan" "2:lan" "3:lan" "4:lan" "6u@eth1" "5:wan" "0u@eth0"
73 ;;
74 tplink,ad7200)
75 ucidef_add_switch "switch0" \
76 "2:lan:1" "3:lan:2" "4:lan:3" "5:lan:4" "6@eth1" "1:wan" "0@eth0"
77 ;;
78 ubnt,unifi-ac-hd)
79 ucidef_set_interface_lan "eth0 eth1"
80 ;;
81 zyxel,nbg6817)
82 hw_mac_addr=$(mtd_get_mac_ascii 0:appsblenv ethaddr)
83 # XXX: drop upper case after kernel v5.4 is gone (qcom-smem)
84 [ -n "$hw_mac_addr" ] || \
85 hw_mac_addr=$(mtd_get_mac_ascii 0:APPSBLENV ethaddr)
86 ucidef_add_switch "switch0" \
87 "1:lan" "2:lan" "3:lan" "4:lan" "6@eth1" "5:wan" "0@eth0"
88 ucidef_set_interface_macaddr "lan" "$(macaddr_add $hw_mac_addr 2)"
89 ucidef_set_interface_macaddr "wan" "$(macaddr_add $hw_mac_addr 3)"
90 ;;
91 *)
92 echo "Unsupported hardware. Network interfaces not intialized"
93 ;;
94 esac
95
96 board_config_flush
97
98 exit 0