mvebu: fix regression for non-generic ESPRESSObin versions
[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 globalscale,espressobin-emmc|\
20 globalscale,espressobin-v7|\
21 globalscale,espressobin-v7-emmc)
22 ucidef_set_interfaces_lan_wan "lan0 lan1" "wan"
23 ;;
24 linksys,caiman|\
25 linksys,cobra|\
26 linksys,mamba|\
27 linksys,rango|\
28 linksys,shelby|\
29 linksys,venom)
30 ucidef_set_interfaces_lan_wan "eth0.1" "eth1.2"
31 ucidef_add_switch "switch0" \
32 "0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "5@eth0" "4:wan" "6@eth1"
33 ;;
34 marvell,a385-db-ap)
35 ucidef_set_interfaces_lan_wan "eth0 eth1" "eth2"
36 ;;
37 marvell,armada8040-mcbin)
38 ucidef_set_interfaces_lan_wan "eth0 eth1 eth3" "eth2"
39 ;;
40 marvell,armada8040-db)
41 ucidef_set_interfaces_lan_wan "eth0 eth2 eth3" "eth1"
42 ;;
43 marvell,armada7040-db)
44 ucidef_set_interfaces_lan_wan "eth0 eth2" "eth1"
45 ;;
46 marvell,armada-3720-db)
47 ucidef_set_interfaces_lan_wan "eth1" "eth0"
48 ;;
49 marvell,axp-gp)
50 ucidef_set_interface_lan "eth0 eth1 eth2 eth3"
51 ;;
52 solidrun,clearfog*a1)
53 # eth0 is standalone ethernet
54 # eth1 is switch (-pro) or standalone ethernet (-base)
55 # eth2 is SFP
56 ucidef_set_interfaces_lan_wan "eth1" "eth0 eth2"
57
58 # if switch exists (clearfog-pro)
59 # switch port 5 is connected to eth1
60 swconfig list 2>&1 | grep -q switch0 && \
61 ucidef_add_switch "switch0" \
62 "0:lan:5" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "5u@eth1" "6:lan:6"
63 ;;
64 *)
65 ucidef_set_interface_lan "eth0"
66 ;;
67 esac
68
69 board_config_flush
70
71 exit 0