openwrtv3/target/linux/ramips/base-files/etc/diag.sh
Andrew Yong faf94d926e ramips: add support for MikroTik hEX v3 (RB750Gr3)
The MikroTik hEX v3 (RB750Gr3) is a MT7621AT board which is similar to most MT7621 reference designs, it can be easily supported by this patch; however, the stock RouterBOOT bootloader has to be replaced by a MT7621 SDK U-Boot such as https://github.com/ndoo/RB750Gr3-U-Boot - U-Boot configured for the RB750Gr3 (16MiB SPI flash, 256MiB DDR3 RAM at 1200MHz).

RouterBOOT, the stock bootloader, does not initialize the UART and boots silently, making it preferable to replace it with a MT7621 SDK U-Boot with UART (57600 8N1) that supports HTTP, TFTP or serial upload of sysupgrade firmware and U-Boot.

Furthermore, RouterOS, the stock firmware, is contained in a proprietary modification of SquashFS without GPL sources; UART is also disabled in stock firmware.

The combination of LEDE firmware generated by this PR and MT7621 SDK U-Boot expects the printed MAC address to reside at offset `0xe000` of the factory partition (absolute offset is `0x4e000`); this is similar to the factory MAC address offset for several other MT7621 devices.

A 16MiB flash dump suitable for use with flashrom will be provided if/once this patch is accepted and binaries are built by LEDE buildbot. Alternatively, writing the U-Boot to the SPI flash starting at 0x0 offset and booting the board with serial console attached will allow TFTP, HTTP or serial upload of sysupgrade firmware.

Signed-off-by: Andrew Yong <me@ndoo.sg>
2016-11-02 10:25:44 +01:00

249 lines
3.4 KiB
Bash

#!/bin/sh
# Copyright (C) 2010-2013 OpenWrt.org
. /lib/functions/leds.sh
. /lib/ramips.sh
get_status_led() {
board=$(ramips_board_name)
case $board in
3g150b|\
3g300m|\
w150m)
status_led="$board:blue:ap"
;;
3g-6200n|\
ar670w|\
ar725w|\
asl26555|\
br-6425|\
br-6475nd|\
c50|\
dch-m225|\
dir-860l-b1|\
e1700|\
fonera20n|\
mzk-750dhp|\
mzk-dp150n|\
mzk-w300nh2|\
nbg-419n|\
nbg-419n2|\
pwh2004|\
vr500|\
wnce2001|\
wndr3700v5|\
x5|\
x8|\
xdxrn502j)
status_led="$board:green:power"
;;
3g-6200nl)
status_led="$board:green:internet"
;;
a5-v11|\
cs-qr10|\
d105|\
dcs-930l-b1|\
ex2700|\
hlk-rm04|\
jhr-n825r|\
mpr-a1|\
mpr-a2|\
mzk-ex750np)
status_led="$board:red:power"
;;
ai-br100|\
ht-tm02)
status_led="$board:blue:wlan"
;;
all0239-3g|\
dcs-930|\
dir-300-b1|\
dir-300-b7|\
dir-320-b1|\
dir-600-b1|\
dir-600-b2|\
dir-610-a1|\
dir-615-d|\
dir-615-h1|\
dir-620-a1|\
dir-620-d1|\
hpm|\
hw550-3g|\
mac1200rv2|\
miniembwifi|\
mofi3500-3gn|\
rut5xx|\
v11st-fe|\
vocore|\
wmr-300|\
zbt-wg2626|\
zbt-wg3526)
status_led="$board:green:status"
;;
atp-52b|\
ip2202)
status_led="$board:green:run"
;;
awapn2403|\
dir-645|\
sk-wb8|\
wrh-300cr)
status_led="$board:green:wps"
;;
cf-wr800n|\
psg1208)
status_led="$board:white:wps"
;;
psg1218)
status_led="$board:yellow:status"
;;
cy-swr1100|\
w502u)
status_led="$board:blue:wps"
;;
dap-1350|\
na930|\
pbr-m1|\
rt-n13u|\
rt-n14u|\
rt-n15|\
rt-n56u|\
wl-330n|\
wl-330n3g|\
wli-tx4-ag300n|\
wt3020|\
y1|\
y1s)
status_led="$board:blue:power"
;;
db-wrt01|\
esr-9753|\
pbr-d1)
status_led="$board:orange:power"
;;
f5d8235-v2)
status_led="$board:blue:router"
;;
f7c027|\
timecloud)
status_led="$board:orange:status"
;;
hc5*61|\
jhr-n805r|\
jhr-n926r|\
mlw221|\
mlwg2)
status_led="$board:blue:system"
;;
linkits7688| \
linkits7688d)
[ "$1" = "upgrade" ] && status_led="mediatek:orange:wifi"
;;
m2m)
status_led="$board:blue:wifi"
;;
m3|\
m4)
status_led="$board:blue:status"
;;
miwifi-mini|\
miwifi-nano|\
zte-q7)
status_led="$board:red:status"
;;
mr-102n)
status_led="$board:amber:status"
;;
nw718)
status_led="$board:amber:cpu"
;;
newifi-d1)
status_led="$board:blue:status"
;;
oy-0001|\
sl-r7205|\
zbt-we826)
status_led="$board:green:wifi"
;;
psr-680w)
status_led="$board:red:wan"
;;
px-4885|\
re6500|\
whr-1166d|\
whr-300hp2|\
whr-600d|\
widora-neo)
status_led="$board:orange:wifi"
;;
mzk-ex300np|\
rt-n10-plus|\
tew-691gr|\
tew-692gr|\
ur-326n4g|\
ur-336un|\
wf-2881|\
wr512-3gn)
status_led="$board:green:wps"
;;
rb750gr3)
status_led="$board:green:usr"
;;
sap-g3200u3)
status_led="$board:green:usb"
;;
v22rw-2x2)
status_led="$board:green:security"
;;
w306r-v20|\
witi|\
zbt-wr8305rt)
status_led="$board:green:sys"
;;
wcr-150gn|\
wl-351)
status_led="$board:amber:power"
;;
whr-g300n|\
wzr-agl300nh)
status_led="$board:green:router"
;;
wizfi630a)
status_led="$board::run"
;;
wsr-1166|\
wsr-600)
status_led="$board:green:power"
;;
wrtnode2r | \
wrtnode2p | \
wrtnode)
status_led="wrtnode:blue:indicator"
;;
zbt-cpe102)
status_led="$board:green:4g-0"
;;
esac
}
set_state() {
get_status_led $1
case "$1" in
preinit)
status_led_blink_preinit
;;
failsafe)
status_led_blink_failsafe
;;
upgrade | \
preinit_regular)
status_led_blink_preinit_regular
;;
done)
status_led_on
;;
esac
}