mvebu: add support for WRT32X (venom)
[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 armada-385-db-ap)
15 ucidef_set_interfaces_lan_wan "eth0 eth1" "eth2"
16 ;;
17 armada-385-linksys-caiman|\
18 armada-385-linksys-cobra|\
19 armada-385-linksys-rango|\
20 armada-385-linksys-shelby|\
21 armada-385-linksys-venom|\
22 armada-xp-linksys-mamba)
23 ucidef_set_interfaces_lan_wan "eth0.1" "eth1.2"
24 ucidef_add_switch "switch0" \
25 "0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "5@eth0" "4:wan" "6@eth1"
26 ;;
27 armada-385-turris-omnia)
28 ucidef_set_interface_lan "lan0 lan1 lan2 lan3 lan4"
29 ucidef_set_interface_wan "eth2"
30 ;;
31 armada-388-clearfog-*)
32 # eth0 is standalone ethernet
33 # eth1 is switch (-pro) or standalone ethernet (-base)
34 # eth2 is SFP
35 ucidef_set_interfaces_lan_wan "eth1" "eth0 eth2"
36
37 # if switch exists (clearfog-pro)
38 # switch port 5 is connected to eth1
39 swconfig list 2>&1 | grep -q switch0 && \
40 ucidef_add_switch "switch0" \
41 "0:lan:5" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "5u@eth1" "6:lan:6"
42 ;;
43 armada-xp-gp)
44 ucidef_set_interface_lan "eth0 eth1 eth2 eth3"
45 ;;
46 globalscale,espressobin)
47 ucidef_set_interfaces_lan_wan "lan0 lan1" "wan"
48 ;;
49 marvell,armada8040-mcbin)
50 ucidef_set_interfaces_lan_wan "eth0 eth1 eth3" "eth2"
51 ;;
52 *)
53 ucidef_set_interface_lan "eth0"
54 ;;
55 esac
56
57 board_config_flush
58
59 exit 0