Add support for Datto L8 with 8 copper ports.
POE+ support with 55W power budget.
Specifications:
---------------
* SoC: Realtek RTL8380M
* Flash: 32MiB Flash
* RAM: 256MiB
* Ethernet: 8x 10/100/1000 Mbps
* PoE: 8x
* Serial: UART 3.3V TTL logic, 115200 8N1
* pinout: G(ND) R(x) T(x) V(cc)
* Buttons: 1x Reset, 1x LED Mode (noop in OpenWrt)
Note: OpenWrt combines the stock dual firmware partitions
for more overlay capacity, however the OpenWrt image cannot
exceed 13504k
Installation:
-------------
> When connected to CloudTrax, the local management login will be disabled to prevent settings conflicts.
Ensure the switch does not have a working internet connection or the local
web management interface is disabled.
Go to the web management page of the switch (may require factory reset).
By default the switch will use DHCP to obtain an IP address.
The default login user is `admin` with password `0p3nm3$h!`
On the left menu, click "Management" and then "Dual Image" and ensure that
"Partition 0" is selected as the active partition. If it is not, select
"Partition 0" and click "Apply" to save changes.
Click on "Upgrade" in the top right of the web interface. Select the
Active boot partition to update. Select the OpenWrt file ending
in `-initramfs-kernel.bin` as the update file to upload.
Upload the file and follow the prompts to upgrade the firmware.
Reboot the switch from the web UI after the firmware update is completed.
Wait for OpenWrt to finish booting (~2 minutes)
Use SSH or the Luci UI (if available) to perform the sysupgrade.
Copy the sysupgrade file ending in `-squashfs-sysupgrade.bin` to the switch:
```
scp -O openwrt-realtek-rtl838x-datto_l8-squashfs-sysupgrade.bin root@192.168.1.1:/tmp/
```
SSH to the switch and run `sysupgrade`:
```
ssh root@192.168.1.1
$ sysupgrade -n /tmp/openwrt-realtek-rtl838x-datto_l8-squashfs-sysupgrade.bin
```
OpenWrt will be installed. Note that first boot after installing requires ~3
minutes for the JFFS2 overlay to be formatted. When the Power LED stops blinking
in the first boot after `sysupgrade`, JFFS2 formatting is completed.
----
Revert back to stock firmware:
You will need a tftp server and the original Datto firmware.
Download the firmware for the S8-L/L8 from Datto:
https://networkinghelp.datto.com/help/Content/kb/Networking/Switches/KB360023113291.html
Rename `s8-l_fw_01.03.24_180823-1639.bix` to `vmlinux.bix`,
put `vmlinux.bix` in the root directory of your tftp server.
Connect a serial console to the UART header and power on the switch.
Interrupt U-Boot by typing `pac` when you see
`Enter correct key to stop autoboot:`
Run the following commands:
```
setenv serverip <tftp_server_ip>
setenv ipaddr <ip_on_same_subnet>
setenv netmask 255.255.255.0
run rtkon
run update_linux
run update_linux2
reset
```
The switch will boot the Datto firmware.
Signed-off-by: Hal Martin <hal.martin@gmail.com>
Tested-By: Raylynn Knight <rayknight@me.com>
Signed-off-by: Sander Vanheule <sander@svanheule.net>
246 lines
6.3 KiB
Plaintext
246 lines
6.3 KiB
Plaintext
|
|
. /lib/functions.sh
|
|
. /lib/functions/uci-defaults.sh
|
|
. /lib/functions/system.sh
|
|
|
|
_filter_port_list_ordered() {
|
|
local ports="$1"
|
|
local excluded="$2"
|
|
local sort_opts="$3"
|
|
echo $ports $excluded | xargs -n1 basename | sort -V $sort_opts | uniq -u | xargs
|
|
}
|
|
|
|
filter_port_list() {
|
|
_filter_port_list_ordered "$1" "$2"
|
|
}
|
|
|
|
filter_port_list_reverse() {
|
|
_filter_port_list_ordered "$1" "$2" "-r"
|
|
}
|
|
|
|
realtek_setup_interfaces()
|
|
{
|
|
local board="$1"
|
|
local lan_list="$2"
|
|
|
|
ucidef_set_bridge_device switch
|
|
ucidef_set_interface_lan "$lan_list"
|
|
}
|
|
|
|
realtek_setup_macs_lan()
|
|
{
|
|
local lan_list="$1"
|
|
local lan_mac_start="$2"
|
|
local lan_mac_end="$3"
|
|
|
|
for lan in $lan_list; do
|
|
ucidef_set_network_device_mac $lan $lan_mac_start
|
|
[ -z "$lan_mac_end" ] || [ "$lan_mac_start" == "$lan_mac_end" ] && lan_mac_start=$(macaddr_setbit_la $lan_mac_start)
|
|
lan_mac_start=$(macaddr_add $lan_mac_start 1)
|
|
done
|
|
}
|
|
|
|
realtek_setup_macs()
|
|
{
|
|
local board="$1"
|
|
local lan_list="$2"
|
|
|
|
local eth0_mac=""
|
|
local lan_mac=""
|
|
local lan_mac_start=""
|
|
local lan_mac_end=""
|
|
local label_mac=""
|
|
|
|
case $board in
|
|
datto,l8|\
|
|
edgecore,ecs4100-12ph|\
|
|
linksys,lgs310c|\
|
|
linksys,lgs328c|\
|
|
linksys,lgs352c|\
|
|
netgear,gs108t-v3|\
|
|
netgear,gs110tpp-v1|\
|
|
netgear,gs110tup-v1|\
|
|
netgear,gs308t-v1|\
|
|
netgear,gs310tp-v1|\
|
|
tplink,sg2008p-v1|\
|
|
tplink,sg2210p-v3|\
|
|
tplink,sg2452p-v4|\
|
|
tplink,t1600g-28ts-v3|\
|
|
xikestor,sks8300-8t|\
|
|
xikestor,sks8300-12e2t2x|\
|
|
xikestor,sks8300-12x-v1|\
|
|
xikestor,sks8310-8x|\
|
|
zyxel,xgs1210-12-a1|\
|
|
zyxel,xgs1210-12-b1)
|
|
lan_mac=$(get_mac_label)
|
|
lan_mac_start=$lan_mac
|
|
;;
|
|
d-link,dgs-1250-28x|\
|
|
hasivo,s1100wp-8gt-se|\
|
|
hpe,1920-8g|\
|
|
hpe,1920-8g-poe-65w|\
|
|
hpe,1920-8g-poe-180w|\
|
|
hpe,1920-16g|\
|
|
hpe,1920-24g|\
|
|
hpe,1920-24g-poe-180w|\
|
|
hpe,1920-24g-poe-370w|\
|
|
hpe,1920-48g|\
|
|
hpe,1920-48g-poe|\
|
|
plasmacloud,esx28|\
|
|
plasmacloud,mcx3|\
|
|
plasmacloud,psx8|\
|
|
plasmacloud,psx10|\
|
|
plasmacloud,psx28|\
|
|
zyxel,gs1920-24hp-v2)
|
|
lan_mac="$(get_mac_label)"
|
|
;;
|
|
tplink,tl-st1008f-v2|\
|
|
zyxel,xgs1010-12-a1)
|
|
lan_mac=$(mtd_get_mac_ascii u-boot-env ethaddr)
|
|
[ -z "$lan_mac" ] || [ "$lan_mac" = "00:e0:4c:00:00:00" ] && lan_mac=$(macaddr_random)
|
|
lan_mac_start=$lan_mac
|
|
eth0_mac=$lan_mac
|
|
;;
|
|
xikestor,sks8300-8x)
|
|
lan_mac=$(mtd_get_mac_binary board-info 0x1f1)
|
|
lan_mac_start=$lan_mac
|
|
eth0_mac=$lan_mac
|
|
;;
|
|
allnet,all-sg8208m|\
|
|
apresia,aplgs120gtss|\
|
|
d-link,dgs-1210-10mp-f|\
|
|
d-link,dgs-1210-10p|\
|
|
d-link,dgs-1210-16|\
|
|
d-link,dgs-1210-20|\
|
|
d-link,dgs-1210-26|\
|
|
d-link,dgs-1210-28|\
|
|
d-link,dgs-1210-28mp-f|\
|
|
d-link,dgs-1210-28p-f|\
|
|
d-link,dgs-1210-52|\
|
|
engenius,ews2910p-v1|\
|
|
engenius,ews2910p-v3|\
|
|
hasivo,s1100w-8xgt-se|\
|
|
inaba,aml2-17gp|\
|
|
iodata,bsh-g24mb|\
|
|
netgear,gs750e|\
|
|
panasonic,m16eg-pn28160k|\
|
|
panasonic,m24eg-pn28240k|\
|
|
panasonic,m48eg-pn28480k|\
|
|
panasonic,m8eg-pn28080k|\
|
|
vimin,vm-s100-0800ms|\
|
|
zyxel,gs1900-10hp-a1|\
|
|
zyxel,gs1900-16-a1|\
|
|
zyxel,gs1900-24-a1|\
|
|
zyxel,gs1900-24-b1|\
|
|
zyxel,gs1900-24e-a1|\
|
|
zyxel,gs1900-24ep-a1|\
|
|
zyxel,gs1900-24hp-a1|\
|
|
zyxel,gs1900-24hp-b1|\
|
|
zyxel,gs1900-48-a1|\
|
|
zyxel,gs1900-8-a1|\
|
|
zyxel,gs1900-8-b1|\
|
|
zyxel,gs1900-8hp-a1|\
|
|
zyxel,gs1900-8hp-b1|\
|
|
zyxel,gs1920-24hp-v1|\
|
|
zyxel,xgs1250-12-a1|\
|
|
zyxel,xgs1250-12-b1)
|
|
lan_mac=$(mtd_get_mac_ascii u-boot-env2 mac_start)
|
|
lan_mac_end=$(mtd_get_mac_ascii u-boot-env2 mac_end)
|
|
label_mac=$(mtd_get_mac_ascii u-boot-env ethaddr)
|
|
[ -z "$lan_mac" ] && lan_mac=$label_mac
|
|
lan_mac_start=$lan_mac
|
|
eth0_mac=$lan_mac
|
|
;;
|
|
esac
|
|
|
|
[ -n "$eth0_mac" ] && ucidef_set_network_device_mac eth0 $eth0_mac
|
|
|
|
[ -n "$lan_mac" ] && ucidef_set_interface_macaddr "lan" $lan_mac
|
|
[ -n "$lan_mac" ] && ucidef_set_bridge_mac "$lan_mac"
|
|
|
|
[ -n "$lan_mac_start" ] && realtek_setup_macs_lan "$lan_list" "$lan_mac_start" "$lan_mac_end"
|
|
|
|
[ -n "$label_mac" ] && ucidef_set_label_macaddr $label_mac
|
|
}
|
|
|
|
realtek_setup_poe()
|
|
{
|
|
local board="$1"
|
|
local lan_list="$2"
|
|
|
|
case $board in
|
|
d-link,dgs-1210-10mp-f)
|
|
ucidef_set_poe 130 "$(filter_port_list "$lan_list" "lan9 lan10")"
|
|
;;
|
|
d-link,dgs-1210-10p)
|
|
ucidef_set_poe 65 "$(filter_port_list "$lan_list" "lan9 lan10")"
|
|
;;
|
|
d-link,dgs-1210-28mp-f)
|
|
ucidef_set_poe 370 "lan8 lan7 lan6 lan5 lan4 lan3 lan2 lan1 lan16 lan15 lan14 lan13 lan12 lan11 lan10 lan9 lan24 lan23
|
|
lan22 lan21 lan20 lan19 lan18 lan17"
|
|
;;
|
|
d-link,dgs-1210-28p-f)
|
|
ucidef_set_poe 193 "lan8 lan7 lan6 lan5 lan4 lan3 lan2 lan1 lan16 lan15 lan14 lan13 lan12 lan11 lan10 lan9 lan24 lan23
|
|
lan22 lan21 lan20 lan19 lan18 lan17"
|
|
;;
|
|
edgecore,ecs4100-12ph|\
|
|
netgear,gs110tpp-v1)
|
|
ucidef_set_poe 130 "$(filter_port_list "$lan_list" "lan9 lan10")"
|
|
;;
|
|
datto,l8)
|
|
ucidef_set_poe 55 "lan5 lan6 lan7 lan8 lan4 lan3 lan2 lan1"
|
|
;;
|
|
engenius,ews2910p-v1|\
|
|
engenius,ews2910p-v3)
|
|
ucidef_set_poe 60 "$(filter_port_list "$lan_list" "lan9 lan10")"
|
|
;;
|
|
hpe,1920-8g-poe-65w)
|
|
ucidef_set_poe 65 "$(filter_port_list_reverse "$lan_list" "lan9 lan10")"
|
|
;;
|
|
hpe,1920-8g-poe-180w)
|
|
ucidef_set_poe 180 "$(filter_port_list_reverse "$lan_list" "lan9 lan10")"
|
|
;;
|
|
hpe,1920-24g-poe-180w)
|
|
ucidef_set_poe 180 "$(filter_port_list_reverse "$lan_list" "lan25 lan26 lan27 lan28")"
|
|
;;
|
|
hpe,1920-24g-poe-370w)
|
|
ucidef_set_poe 370 "$(filter_port_list_reverse "$lan_list" "lan25 lan26 lan27 lan28")"
|
|
;;
|
|
hpe,1920-48g-poe)
|
|
ucidef_set_poe 370 "lan8 lan7 lan6 lan5 lan4 lan3 lan2 lan1 lan16 lan15 lan14 lan13 lan12 lan11 lan10 lan9 lan24 lan23
|
|
lan22 lan21 lan20 lan19 lan18 lan17 lan32 lan31 lan30 lan29 lan28 lan27 lan26 lan25 lan40 lan39 lan38 lan37
|
|
lan36 lan35 lan34 lan33 lan48 lan47 lan46 lan45 lan44 lan43 lan42 lan41"
|
|
;;
|
|
netgear,gs110tup-v1)
|
|
ucidef_set_poe 240 "$(filter_port_list "$lan_list" "lan9 lan10")"
|
|
;;
|
|
netgear,gs310tp-v1)
|
|
ucidef_set_poe 55 "$(filter_port_list "$lan_list" "lan9 lan10")"
|
|
;;
|
|
zyxel,gs1900-10hp-a1)
|
|
ucidef_set_poe 77 "$(filter_port_list "$lan_list" "lan9 lan10")"
|
|
;;
|
|
zyxel,gs1900-8hp-a1|\
|
|
zyxel,gs1900-8hp-b1)
|
|
ucidef_set_poe 70 "$lan_list"
|
|
;;
|
|
zyxel,gs1900-24ep-a1)
|
|
ucidef_set_poe 130 "lan1 lan2 lan3 lan4 lan5 lan6 lan7 lan8 lan9 lan10 lan11 lan12"
|
|
;;
|
|
zyxel,gs1900-24hp-a1|\
|
|
zyxel,gs1900-24hp-b1)
|
|
ucidef_set_poe 170 "$(filter_port_list "$lan_list" "lan25 lan26")"
|
|
;;
|
|
esac
|
|
}
|
|
|
|
board=$(board_name)
|
|
board_config_update
|
|
lan_list=$(ls -1 -v -d /sys/class/net/lan* | xargs -n1 basename | xargs)
|
|
realtek_setup_interfaces "$board" "$lan_list"
|
|
realtek_setup_macs "$board" "$lan_list"
|
|
realtek_setup_poe "$board" "$lan_list"
|
|
board_config_flush
|
|
|
|
exit 0
|