f099a078b254d824f655c5c472cf9a33609c1c95
[openwrt/openwrt.git] / target / linux / mvebu / base-files / etc / board.d / 02_network
1 #!/bin/sh
2 #
3 # Copyright (C) 2014-2016 OpenWrt.org
4 # Copyright (C) 2016 LEDE-Project.org
5 #
6
7 . /lib/functions/uci-defaults.sh
8
9 board_config_update
10
11 board=$(board_name)
12
13 case "$board" in
14 cznic,turris-omnia)
15 ucidef_set_interface_lan "lan0 lan1 lan2 lan3 lan4"
16 ucidef_set_interface_wan "eth2"
17 ;;
18 globalscale,espressobin)
19 ucidef_set_interfaces_lan_wan "lan0 lan1" "wan"
20 ;;
21 linksys,caiman|\
22 linksys,cobra|\
23 linksys,mamba|\
24 linksys,rango|\
25 linksys,shelby|\
26 linksys,venom)
27 ucidef_set_interfaces_lan_wan "eth0.1" "eth1.2"
28 ucidef_add_switch "switch0" \
29 "0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "5@eth0" "4:wan" "6@eth1"
30 ;;
31 marvell,a385-db-ap)
32 ucidef_set_interfaces_lan_wan "eth0 eth1" "eth2"
33 ;;
34 marvell,armada8040-mcbin)
35 ucidef_set_interfaces_lan_wan "eth0 eth1 eth3" "eth2"
36 ;;
37 marvell,armada8040-db)
38 ucidef_set_interfaces_lan_wan "eth0 eth2 eth3" "eth1"
39 ;;
40 marvell,armada7040-db)
41 ucidef_set_interfaces_lan_wan "eth0 eth2" "eth1"
42 ;;
43 marvell,armada-3720-db)
44 ucidef_set_interfaces_lan_wan "eth1" "eth0"
45 ;;
46 marvell,axp-gp)
47 ucidef_set_interface_lan "eth0 eth1 eth2 eth3"
48 ;;
49 solidrun,clearfog*a1)
50 # eth0 is standalone ethernet
51 # eth1 is switch (-pro) or standalone ethernet (-base)
52 # eth2 is SFP
53 ucidef_set_interfaces_lan_wan "eth1" "eth0 eth2"
54
55 # if switch exists (clearfog-pro)
56 # switch port 5 is connected to eth1
57 swconfig list 2>&1 | grep -q switch0 && \
58 ucidef_add_switch "switch0" \
59 "0:lan:5" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "5u@eth1" "6:lan:6"
60 ;;
61 *)
62 ucidef_set_interface_lan "eth0"
63 ;;
64 esac
65
66 board_config_flush
67
68 exit 0