forked from Ivasoft/openwrt
1. Add leds and configs 2. Add network configs 3. Add script to clear partial boot flag 4. Hack to use port 5 as cpu port as port 8 connected to eth2 wont pass any frames 5. Enable EA9500 image generation Hardware Info: - Processor - Broadcom BCM4709C0KFEBG dual-core @ 1.4 GHz - Switch - BCM53012 in BCM4709C0KFEBG & external BCM53125 - DDR3 RAM - 256 MB - Flash - 128 MB (Toshiba TC58BVG0S3HTA00) - 2.4GHz - BCM4366 4×4 2.4/5G single chip 802.11ac SoC - Power Amp - Skyworks SE2623L 2.4 GHz power amp (x4) - 5GHz x 2 - BCM4366 4×4 2.4/5G single chip 802.11ac SoC - Power Amp - PLX Technology PEX8603 3-lane, 3-port PCIe switch - Ports - 8 Ports, 1 WAN Ports - Antennas - 8 Antennas - Serial Port - @j6 [GND,TX,RX] (VCC NC) 115200 8n1 Flashing Instructions: 1. Connect a USB-TTL table to J6 on the router as well as a ethernet cable to a lan port and your PC. 2. Power-on the router. 3. Use putty or a serial port program to view the terminal. Hit Ctrl+C and interrupt the CFE terminal terminal. 4. Setup a TFTP server on your local machine at setup you local IP to 192.168.1.2 5. Start the TFTP Server 6. Run following commands at the CFE terminal flash -noheader 192.168.1.2:/openwrt.trx nflash0.trx flash -noheader 192.168.1.2:/openwrt.trx nflash0.trx2 nvram set bootpartition=0 && nvram set partialboots=0 && nvram commit 7. Reboot router to be presented by OpenWrt Note: Only installation method via serial cable is supported at the moment. The trx firmware has to be flashed to both the partitions using following commands from CFE prompt. This will cover US and Non-US variants. Signed-off-by: Vivek Unune <npcomplete13@gmail.com> Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
143 lines
3.7 KiB
Plaintext
143 lines
3.7 KiB
Plaintext
#
|
|
# Copyright (C) 2011 OpenWrt.org
|
|
#
|
|
|
|
. /lib/functions/system.sh
|
|
. /lib/functions/uci-defaults.sh
|
|
|
|
bcm53xx_setup_interfaces()
|
|
{
|
|
local board="$1"
|
|
|
|
# On BCM4708 / BCM4709(4) there are 3 Ethernet interfaces connected to 3 switch
|
|
# ports. It's up to vendor which to use.
|
|
case "$board" in
|
|
tenda,ac9)
|
|
ucidef_add_switch "switch0" \
|
|
"1:lan" "2:lan" "3:lan" "4:lan" "8@eth0" "0:wan" "5@eth1"
|
|
;;
|
|
buffalo,wxr-1900dhp| \
|
|
buffalo,wzr-1750dhp)
|
|
ucidef_add_switch "switch0" \
|
|
"0:lan:1" "1:lan:2" "2:lan:3" "3:lan:4" "4:wan:5" "5@eth0"
|
|
;;
|
|
dlink,dir-885l | \
|
|
netgear,r7900 | \
|
|
netgear,r8000 | \
|
|
netgear,r8500)
|
|
# NVRAM specifies port 8 (eth2) - unsupported by OpenWrt b53
|
|
# Use port 5 (eth0) as workaround
|
|
ucidef_add_switch "switch0" \
|
|
"0:lan" "1:lan" "2:lan" "3:lan" "4:wan" "5t@eth0"
|
|
;;
|
|
linksys,panamera)
|
|
ucidef_add_switch "switch1" \
|
|
"0:lan" "1:lan:7" "2:lan:4" "3:lan:8" "4:wan" "5t@eth0"
|
|
;;
|
|
luxul,abr-4500-v1|\
|
|
luxul,xbr-4500-v1)
|
|
ucidef_add_switch "switch0" \
|
|
"0:wan" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "5@eth0"
|
|
;;
|
|
luxul,xap-1610-v1)
|
|
ucidef_add_switch "switch0" \
|
|
"0:lan" "1:lan" "5@eth0"
|
|
ucidef_set_interface_lan "eth0.1" "dhcp"
|
|
;;
|
|
luxul,xwr-3150-v1)
|
|
ucidef_add_switch "switch0" \
|
|
"0:lan:1" "1:lan:2" "2:lan:3" "3:lan:4" "4:wan" "5@eth0"
|
|
;;
|
|
phicomm,k3)
|
|
ucidef_add_switch "switch0" \
|
|
"0:lan" "1:lan" "2:lan" "3:wan" "5@eth0"
|
|
;;
|
|
*)
|
|
# NVRAM entries may contain unsorted ports, e.g. Netgear R6250 uses
|
|
# vlan1ports=3 2 1 0 5*
|
|
# vlan2ports=4 5u
|
|
# and early Netgear R8000 was using
|
|
# vlan1ports=3 2 1 0 5 7 8*
|
|
# (the enclosing echo is needed to convert newline back to space)
|
|
vlan1ports="$(echo $(nvram get vlan1ports | tr " " "\n" | sort))"
|
|
vlan2ports="$(echo $(nvram get vlan2ports | tr " " "\n" | sort))"
|
|
if echo "$vlan1ports" | egrep -q "^1 2 3 4 5" && \
|
|
echo "$vlan2ports" | egrep -q "^0 5"; then
|
|
ucidef_add_switch "switch0" \
|
|
"1:lan" "2:lan" "3:lan" "4:lan" "0:wan" "5t@eth0"
|
|
elif echo "$vlan1ports" | egrep -q "^1 2 3 5 7" && \
|
|
echo "$vlan2ports" | egrep -q "^0 7"; then
|
|
ucidef_add_switch "switch0" \
|
|
"1:lan" "2:lan" "3:lan" "5:lan" "0:wan" "7t@eth1"
|
|
elif echo "$vlan1ports" | egrep -q "^0 1 2 3 5 7 8" && \
|
|
echo "$vlan2ports" | egrep -q "^4 8"; then
|
|
ucidef_add_switch "switch0" \
|
|
"0:lan" "1:lan" "2:lan" "3:lan" "5:lan" "7:lan" "4:wan" "8t@eth2"
|
|
else
|
|
ucidef_add_switch "switch0" \
|
|
"0:lan" "1:lan" "2:lan" "3:lan" "4:wan" "5t@eth0"
|
|
fi
|
|
;;
|
|
esac
|
|
}
|
|
|
|
bcm53xx_setup_macs()
|
|
{
|
|
local board="$1"
|
|
|
|
case "$board" in
|
|
dlink,dir-885l | \
|
|
linksys,panamera | \
|
|
netgear,r7900 | \
|
|
netgear,r8000 | \
|
|
netgear,r8500)
|
|
# As vendor doesn't use eth0 its MAC may be missing. Use one from eth2.
|
|
et2macaddr="$(nvram get et2macaddr)"
|
|
;;
|
|
meraki,mr32)
|
|
# The MAC is stored on an AT24C64 eeprom and not on the nvram
|
|
et2macaddr=$(get_mac_binary "/sys/bus/i2c/devices/0-0050/eeprom" 0x66)
|
|
;;
|
|
esac
|
|
|
|
[ -n "$et2macaddr" ] && ucidef_set_interface_macaddr "lan" "$et2macaddr"
|
|
|
|
wan_macaddr="$(nvram get wan_hwaddr)"
|
|
case "$board" in
|
|
asus,rt-ac87u)
|
|
etXmacaddr=$(nvram get et1macaddr)
|
|
offset=1
|
|
;;
|
|
dlink,dir-885l | \
|
|
linksys,panamera | \
|
|
netgear,r7900 | \
|
|
netgear,r8000 | \
|
|
netgear,r8500)
|
|
etXmacaddr=$(nvram get et2macaddr)
|
|
offset=1
|
|
;;
|
|
luxul,xwr-3100v1 | \
|
|
luxul,xwr-3150-v1)
|
|
etXmacaddr=$(nvram get et0macaddr)
|
|
offset=5
|
|
;;
|
|
*)
|
|
etXmacaddr=$(nvram get et0macaddr)
|
|
offset=1
|
|
;;
|
|
esac
|
|
|
|
# If WAN MAC isn't explicitly set, calculate it using base MAC as reference.
|
|
[ -z "$wan_macaddr" -a -n "$etXmacaddr" ] && wan_macaddr=$(macaddr_add "$etXmacaddr" $offset)
|
|
|
|
[ -n "$wan_macaddr" ] && ucidef_set_interface_macaddr "wan" "$wan_macaddr"
|
|
}
|
|
|
|
board_config_update
|
|
board=$(board_name)
|
|
bcm53xx_setup_interfaces "$board"
|
|
bcm53xx_setup_macs "$board"
|
|
board_config_flush
|
|
|
|
exit 0
|