|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
. /lib/functions.sh
|
|
|
|
. /lib/functions/uci-defaults.sh
|
|
|
|
. /lib/functions/system.sh
|
|
|
|
|
|
|
|
ramips_setup_rt3x5x_vlans()
|
|
|
|
{
|
|
|
|
if [ ! -x /sbin/swconfig ]; then
|
|
|
|
# legacy default
|
|
|
|
ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
|
|
|
|
return
|
|
|
|
fi
|
|
|
|
local wanports=""
|
|
|
|
local lanports=""
|
|
|
|
for port in 5 4 3 2 1 0; do
|
|
|
|
if [ `swconfig dev rt305x port $port get disable` = "1" ]; then
|
|
|
|
continue
|
|
|
|
fi
|
|
|
|
if [ `swconfig dev rt305x port $port get lan` = "0" ]; then
|
|
|
|
wanports="$port:wan $wanports"
|
|
|
|
else
|
|
|
|
lanports="$port:lan $lanports"
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
ucidef_add_switch "rt305x" $lanports $wanports "6t@eth0"
|
|
|
|
}
|
|
|
|
|
|
|
|
ramips_setup_interfaces()
|
|
|
|
{
|
|
|
|
local board="$1"
|
|
|
|
|
|
|
|
case $board in
|
|
|
|
11acnas|\
|
|
|
|
d-team,newifi-d2|\
|
|
|
|
dir-615-h1|\
|
|
|
|
w2914nsv2|\
|
|
|
|
zbt-we2026)
|
|
|
|
ucidef_add_switch "switch0" \
|
|
|
|
"0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "4:wan:5" "6@eth0"
|
|
|
|
;;
|
|
|
|
3g150b|\
|
|
|
|
3g300m|\
|
|
|
|
a5-v11|\
|
|
|
|
all0256n-4M|\
|
|
|
|
all0256n-8M|\
|
|
|
|
all5002|\
|
|
|
|
all5003|\
|
|
|
|
bocco|\
|
|
|
|
broadway|\
|
|
|
|
dcs-930|\
|
|
|
|
dcs-930l-b1|\
|
|
|
|
ht-tm02|\
|
|
|
|
kimax,u35wf|\
|
|
|
|
linkits7688 | \
|
|
|
|
m2m|\
|
|
|
|
microwrt|\
|
|
|
|
mikrotik,rbm11g|\
|
|
|
|
mpr-a2|\
|
|
|
|
ncs601w|\
|
|
|
|
omega2 | \
|
|
|
|
omega2p | \
|
|
|
|
timecloud|\
|
|
|
|
tplink,tl-wa801nd-v5|\
|
|
|
|
w150m|\
|
|
|
|
widora,neo-16m|\
|
|
|
|
widora,neo-32m|\
|
|
|
|
wnce2001|\
|
|
|
|
zbt-cpe102|\
|
|
|
|
zorlik,zl5900v2|\
|
|
|
|
zte-q7)
|
|
|
|
ucidef_add_switch "switch0"
|
|
|
|
ucidef_add_switch_attr "switch0" "enable" "false"
|
|
|
|
ucidef_set_interface_lan "eth0"
|
|
|
|
;;
|
|
|
|
mlw221|\
|
|
|
|
mr-102n)
|
|
|
|
ucidef_set_interface_lan "eth0.2"
|
|
|
|
;;
|
|
|
|
3g-6200n|\
|
|
|
|
ai-br100|\
|
|
|
|
alfa-network,ac1200rm|\
|
|
|
|
mediatek,ap-mt7621a-v60|\
|
|
|
|
xzwifi,creativebox-v1|\
|
|
|
|
d240|\
|
|
|
|
db-wrt01|\
|
|
|
|
dir-300-b7|\
|
|
|
|
dir-320-b1|\
|
|
|
|
dir-610-a1|\
|
|
|
|
dir-615-h1|\
|
|
|
|
dir-810l|\
|
|
|
|
dlink,dwr-116-a1|\
|
|
|
|
dlink,dwr-921-c1|\
|
ramips: add support for DLINK DWR-922-E2
Very similar to the DWR-921-C1, except has a telephony/RJ11 port (not
sure if supported, I didn't try), wireless router with QMI LTE embedded
modem is based on the MT7620N SoC.
Specification:
* MediaTek MT7620N (580 Mhz)
* 64 MB of RAM
* 16 MB of FLASH
* 802.11bgn radio
* 5x 10/100 Mbps Ethernet (1 WAN and 4 LAN)
* 2x external, detachable (LTE) antennas
* UART header on PCB (57600 8n1)
* 6x LED (GPIO-controlled)
* 1x bi-color Signal Strength LED (GPIO-controlled)
* 2x button
* JBOOT bootloader
The status led has been assigned to the dwr-922-e2:green:signalstrength
(lte signal strength) led. At the end of the boot it is switched off and
is available for lte operation. Works correctly also during sysupgrade
operation.
Installation:
Apply factory image via d-link http web-gui, or via recovery interface:
How to recover/revert to OEM firmware:
1.) Push and hold the reset button and turn on the power. Wait until all
LEDs start rapidly blinking (~10sec.)
2.) DHCP should give you an IP in the 192.168.123.0/24 subnet, or set
one manually
3.) Upload original factory image via JBOOT http interface at IP
192.168.123.254
4.) If http doesn't work, it can be done with curl command:
curl -F FN=@XXXXX.bin http://192.168.123.254/upg
where XXXXX.bin is name of firmware file.
5.) You can optionally telnet to 192.168.123.254 before or during the
upload and it will report the flashing status, memory address etc.
6.) Once web UI and/or telnet says "Success", power cycle the router, or
type "reboot" into the telnet session.
Signed-off-by: Simon Quigley <squigley@squigley.net>
[squashed commits, word wrap commit message, rename signal strenght led
name to match what is used for the DWR-921-C1 since they share the led
configuration, add label referenced in the aliases node]
Signed-off-by: Mathias Kresin <dev@kresin.me>
6 years ago
|
|
|
dlink,dwr-922-e2|\
|
|
|
|
ew1200|\
|
|
|
|
firewrt|\
|
|
|
|
hc5661a|\
|
|
|
|
hc5962|\
|
|
|
|
hlk-rm04|\
|
|
|
|
k2p|\
|
|
|
|
kn|\
|
|
|
|
kn_rc|\
|
|
|
|
mac1200rv2|\
|
|
|
|
miwifi-mini|\
|
|
|
|
miwifi-nano|\
|
|
|
|
mt7621|\
|
|
|
|
mt7628|\
|
|
|
|
mtc,wr1201|\
|
|
|
|
mzk-750dhp|\
|
|
|
|
mzk-w300nh2|\
|
|
|
|
nixcore-x1-8M|\
|
|
|
|
nixcore-x1-16M|\
|
|
|
|
oy-0001|\
|
|
|
|
pbr-m1|\
|
|
|
|
psg1208|\
|
|
|
|
psg1218a|\
|
|
|
|
r6220|\
|
|
|
|
netgear,r6350|\
|
|
|
|
rt-n12p|\
|
|
|
|
sap-g3200u3|\
|
|
|
|
sk-wb8|\
|
|
|
|
unielec,u7621-06-256m-16m|\
|
|
|
|
unielec,u7621-06-512m-64m|\
|
|
|
|
vr500|\
|
|
|
|
wavlink,wl-wn570ha1|\
|
|
|
|
wavlink,wl-wn575a3|\
|
|
|
|
wf-2881|\
|
|
|
|
whr-g300n|\
|
|
|
|
mqmaker,witi-256m|\
|
|
|
|
mqmaker,witi-512m|\
|
|
|
|
wndr3700v5|\
|
|
|
|
youku-yk1|\
|
|
|
|
zbt-ape522ii|\
|
|
|
|
zbt-we1326|\
|
|
|
|
zbtlink,zbt-we3526|\
|
|
|
|
zbt-we826-16M|\
|
|
|
|
zbt-we826-32M|\
|
|
|
|
zbt-wg2626|\
|
|
|
|
zbt-wg3526-16M|\
|
|
|
|
zbt-wg3526-32M|\
|
|
|
|
zbt-wr8305rt)
|
|
|
|
ucidef_add_switch "switch0" \
|
|
|
|
"0:lan" "1:lan" "2:lan" "3:lan" "4:wan" "6@eth0"
|
|
|
|
;;
|
|
|
|
gehua,ghl-r-001)
|
|
|
|
ucidef_add_switch "switch0" \
|
|
|
|
"0:lan" "1:lan" "2:lan" "4:wan" "6@eth0"
|
|
|
|
;;
|
|
|
|
alfa-network,awusfree1|\
|
|
|
|
cs-qr10|\
|
|
|
|
d105|\
|
|
|
|
dlink,dap-1522-a1|\
|
|
|
|
dch-m225|\
|
|
|
|
ex2700|\
|
|
|
|
ex3700|\
|
|
|
|
hpm|\
|
|
|
|
mzk-ex300np|\
|
|
|
|
mzk-ex750np|\
|
|
|
|
na930|\
|
|
|
|
pbr-d1|\
|
|
|
|
ravpower,wd03|\
|
|
|
|
tama,w06|\
|
|
|
|
tplink,tl-mr3020-v3|\
|
|
|
|
tplink,tl-wr802n-v4|\
|
|
|
|
u25awf-h1|\
|
|
|
|
wli-tx4-ag300n|\
|
|
|
|
wmdr-143n|\
|
|
|
|
wmr-300|\
|
|
|
|
wn3000rpv3|\
|
|
|
|
wrh-300cr)
|
|
|
|
ucidef_set_interface_lan "eth0"
|
|
|
|
;;
|
|
|
|
dlink,dwr-118-a1)
|
|
|
|
ucidef_add_switch "switch0" \
|
|
|
|
"1:lan:2" "2:lan:3" "3:lan:1" "4:lan:0" "5:wan" "6@eth0"
|
|
|
|
;;
|
|
|
|
dlink,dwr-118-a2)
|
|
|
|
ucidef_add_switch "switch0" \
|
|
|
|
"1:lan:2" "2:lan:1" "3:lan:3" "4:lan" "0:wan" "6@eth0"
|
|
|
|
;;
|
|
|
|
mir3g)
|
|
|
|
ucidef_add_switch "switch0" \
|
ramips: improve Xiaomi Mi Router 3G support
This commit improves support for the Xiaomi Mi Router 3G originally
added in commit 6e283cdc0da25928f8148805ebef7f8f2b769ee8
Improvements:
- Remove software watchdog as hardware watchdog now working as per
commit 3fbf3ab44f5cebb22e30a4c8681b13341feed6a6 for all mt7621
devices.
- Reset button polarity corrected - length of press determines reboot
(short press) vs. reset to defaults (long press) behaviour.
- Enable GPIO amber switch port LEDs on board rear - lit indicates 1Gbit
link and blink on activity. Green LEDs driven directly by switch
indicating any link speed and tx activity.
- USB port power on/off GPIO exposed as 'usbpower'
- Add access to uboot environment settings for checking/setting uboot
boot order preference from user space.
Changes:
- Front LED indicator is physically made of independent Yellow/Amber,
Red & Blue LEDs combined via a plastic 'lightpipe' to a front panel
indicator, hence the colour behaviour is similar to an RGB LED. RGB
LEDs are not supported at this time because they produce colour results
that do not then match colour labels, e.g. enabling 'mir3g:red' and
'mir3g:blue' would result in a purple indicator and we have no such
label for purple.
The yellow, red & blue LEDs have been split out as individual yellow,
red & blue status LEDs, with yellow being the default status LED as
before and with red's WAN and blue's USB default associations removed.
- Swapped order of vlan interfaces (eth0.1 & eth0.2) to match stock vlan
layout. eth0.1 is LAN, eth0.2 is WAN
- Add 'lwlll' vlan layout to mt7530 switch driver to prevent packet
leakage between kernel switch init and uci swconfig
uboot behaviour & system 'recovery'
uboot expects to find bootable kernels at nand addresses 0x200000 &
0x600000 known by uboot as "system 1" and "system 2" respectively.
uboot chooses which system to hand control to based on 3 environment
variables: flag_last_success, flag_try_sys1_failed & flag_try_sys2_failed
last_success represents a preference for a particular system and is set
to 0 for system 1, set to 1 for system 2. last_success is considered *if*
and only if both try_sys'n'_failed flags are 0 (ie. unset) If *either*
failed flags are set then uboot will attempt to hand control to the
non failed system. If both failed flags are set then uboot will check
the uImage CRC of system 1 and hand control to it if ok. If the uImage
CRC of system is not ok, uboot will hand control to system 2
irrespective of system 2's uImage CRC.
NOTE: uboot only ever sets failed flags, it *never* clears them. uboot
sets a system's failed flag if that system's was selected for boot but
the uImage CRC is incorrect.
Fortunately with serial console access, uboot provides the ability to
boot an initramfs image transferred via tftp, similarly an image may
be flashed to nand however it will flash to *both* kernels so a backup
of stock kernel image is suggested. Note that the suggested install
procedure below set's system 1's failed flag (stock) thus uboot ignores
the last_success preference and boots LEDE located in system 2.
Considerable thought has gone into whether LEDE should replace both
kernels, only one (and which one) etc. LEDE kernels do not include a
minimal rootfs and thus unlike the stock kernel cannot include a
method of controlling uboot environment variables in the event of
rootfs mount failure. Similarly uboot fails to provide an external
mechanism for indicating boot system failure.
Installation - from stock.
Installation through telnet/ssh:
- copy lede-ramips-mt7621-mir3g-squashfs-kernel1.bin and
lede-ramips-mt7621-mir3g-squashfs-rootfs0.bin to usb disk or wget it
from LEDE download site to /tmp
- switch to /extdisks/sda1/ (if copied to USB drive) or to /tmp if
wgetted from LEDE download site
- run: mtd write lede-ramips-mt7621-mir3g-squashfs-kernel1.bin kernel1
- run: mtd write lede-ramips-mt7621-mir3g-squashfs-rootfs0.bin rootfs0
- run: nvram set flag_try_sys1_failed=1
- run: nvram commit
- run: reboot
Recovery - to stock.
Assuming you used the above installation instructions you will have a
stock kernel image in system 1. If it can be booted then it may be used
to perform a stock firmware recovery, thus erasing LEDE completely. From
a 'working' LEDE state (even failsafe)
Failsafe only:
- run: mount_root
- run: sh /etc/uci-defaults/30_uboot-envtools
Then do the steps for 'All'
All:
- run: fw_setenv flag_try_sys2_failed 1
- run: reboot
The board will reboot into system 1 (stock basic kernel) and wait with
system red light slowly blinking for a FAT formatted usb stick with a
recovery image to be inserted. Press and hold the reset button for
around 1 second. Status LED will turn yellow during recovery and blue
when recovery complete.
Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
7 years ago
|
|
|
"2:lan:2" "3:lan:1" "1:wan" "6t@eth0"
|
|
|
|
;;
|
|
|
|
psg1218b)
|
|
|
|
ucidef_add_switch "switch0" \
|
|
|
|
"0:lan:3" "1:lan:2" "2:lan:1" "3:wan" "6@eth0"
|
|
|
|
;;
|
|
|
|
whr-300hp2|\
|
|
|
|
whr-600d|\
|
|
|
|
wsr-1166|\
|
|
|
|
wsr-600)
|
|
|
|
ucidef_add_switch "switch0" \
|
|
|
|
"0:lan:1" "1:lan:2" "2:lan:3" "3:lan:4" "4:wan:5" "6@eth0"
|
|
|
|
;;
|
|
|
|
ar670w|\
|
|
|
|
ar725w|\
|
|
|
|
rt-ac51u)
|
|
|
|
ucidef_add_switch "switch0" \
|
|
|
|
"0:wan" "1:lan" "2:lan" "3:lan" "4:lan" "6t@eth0"
|
|
|
|
;;
|
ramips: add support for Belkin F9K1109v1
Device specification:
- SoC: Ralink RT3883 (MIPS 74Kc) 500Mhz
- RAM: 64Mb
- Flash: 8MB (SPI-NOR)
- Ethernet: 10/100/1000 Mbps
- WLAN
Wireless 1: SoC-integrated : 2.4/5 GHz
Wireless 2: 2.4 GHz RT3092L
- LED: 2x USB, WAN, LAN
- Key: WPS, reset
- Serial: 4-pin header, (57600,8,N,1), 3.3V TTL,
GND, RX, TX, V - J12 marking on board
- USB ports: 2 x USB 2.0
Flashing instructions:
Option 1 (from bootloader web)
- Hold reset button on the back of router when plugging
in power (for at-least 10 seconds after plugged in)
- Connect to a Lan port
- Set computer IP to 10.10.10.3
- Go to http://10.10.10.123 in a web browser
- Click the Browse... Button and select the
*squashfs.sysupgrade.bin file then click APPLY
Option 2 (from the stock admin web)
- Go to firmware upgrade
- Upload the **factory** image *initramfs.bin first
- Boot into openwrt
- From Luci web in openwrt upload the *squashfs.sysupgrade.bin
Signed-off-by: Kip Porterfield <kip.porterfield@gmail.com>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
[added v1 to the compatible identifier, added pciid for
the RT3092L, fixed pci unit-address, split out the F9K110X.dtsi
to prepare for a possible F9K1103 patch]
6 years ago
|
|
|
belkin,f9k1109v1|\
|
|
|
|
rt-n15|\
|
|
|
|
wl-351)
|
|
|
|
ucidef_add_switch "switch0" \
|
|
|
|
"0:lan" "1:lan" "2:lan" "3:lan" "4:wan" "5@eth0"
|
|
|
|
;;
|
|
|
|
asl26555-8M|\
|
|
|
|
asl26555-16M|\
|
|
|
|
rp-n53)
|
|
|
|
ucidef_add_switch "switch0" \
|
|
|
|
"1:lan" "2:lan" "3:lan" "4:lan" "6t@eth0"
|
|
|
|
;;
|
|
|
|
atp-52b|\
|
|
|
|
awm002-evb-4M|\
|
|
|
|
awm002-evb-8M|\
|
|
|
|
bdcom,wap2100-sk|\
|
|
|
|
c20i|\
|
|
|
|
dir-645|\
|
|
|
|
gl-mt300a|\
|
|
|
|
gl-mt300n|\
|
|
|
|
gl-mt750|\
|
|
|
|
hiwifi,hc5861b|\
|
|
|
|
jhr-n805r|\
|
|
|
|
jhr-n825r|\
|
|
|
|
jhr-n926r|\
|
|
|
|
mikrotik,rb750gr3|\
|
ramips: Add support for Mikrotik RouterBOARD RBM33g
This commit adds support for the Mikrotik RouterBOARD RBM33g.
=Hardware=
The RBM33g is a mt7621 based device featuring three gigabit ports, 2
miniPCIe slots with sim card sockets, 1 M.2 slot, 1 USB 3.0 port and a male
onboard RS-232 serial port. Additionally there are a lot of accessible
GPIO ports and additional buses like i2c, mdio, spi and uart.
==Switch==
The three Ethernet ports are all connected to the internal switch of the
mt7621 SoC:
port 0: Ethernet Port next to barrel jack with PoE printed on it
port 1: Innermost Ethernet Port on opposite side of RS-232 port
port 2: Outermost Ethernet Port on opposite side of RS-232 port
port 6: CPU
==Flash==
The device has two spi flash chips. The first flash chips is rather small
(512 kB), connected to CS0 by default and contains only the RouterBOOT
bootloader and some factory information (e.g. mac address).
The second chip has a size of 16 MB, is by default connected to CS1 and
contains the firmware image.
==PCIe==
The board features three PCIe-enabled slots. Two of them are miniPCIe
slots (PCIe0, PCIe1) and one is a M.2 (Key M) slot (PCIe2).
Each of the miniPCIe slots is connected to a dedicated mini SIM socket
on the back of the board.
Power to all three PCIe-enabled slots is controlled via GPIOs on the
mt7621 SoC:
PCIe0: GPIO9
PCIe1: GPIO10
PCIe2: GPIO11
==USB==
The board has one external USB 3.0 port at the rear. Additionally PCIe
port 0 has a permanently enabled USB interface. PCIe slot 1 shares its
USB interface with the rear USB port. Thus only either the rear USB port
or the USB interface of PCIe slot 1 can be active at the same time. The
jumper next to the rear USB port controls which one is active:
open: USB on PCIe 1 is active
closed: USB on rear USB port is active
==Power==
The board can accept both, passive PoE and external power via a 2.1 mm
barrel jack. The input voltage range is 11-32 V.
=Installation=
==Prerequisites==
A USB -> RS-232 Adapter and a null modem cable are required for
installation.
To install an OpenWRT image to the device two components must be built:
1. A openwrt initramfs image
2. A openwrt sysupgrade image
===initramfs & sysupgrade image===
Select target devices "Mikrotik RBM33G" in
openwrt menuconfig and build the images. This will create the images
"openwrt-ramips-mt7621-mikrotik_rbm33g-initramfs-kernel.bin" and
"openwrt-ramips-mt7621-mikrotik_rbm33g-squashfs-sysupgrade.bin" in the output
directory.
==Installing==
**Make sure to back up your RouterOS license in case you do ever want to
go back to RouterOS using "/system license output" and back up the created
license file.**
Serial settings: 115200 8N1
The installation is a two-step process. First the
"openwrt-ramips-mt7621-mikrotik_rbm33g-initramfs-kernel.bin" must be booted
via tftp:
1. Set up a dhcp server that points the bootfile to tftp server serving
the "openwrt-ramips-mt7621-mikrotik_rbm33g-initramfs-kernel.bin"
initramfs image
2. Connect to WAN port (left side, next to sys-LED and power indicator)
3. Connect to serial port of board
4. Power on board and enter RouterBOOT setup menu
5. Set boot device to "boot over ethernet"
6. Set boot protocol to "dhcp protocol" (can be omitted if DHCP server
allows dynamic bootp)
6. Save config
7. Wait for board to boot via Ethernet
On the serial port you should now be presented with the OpenWRT boot log.
The next steps will install OpenWRT persistently.
1. Copy "openwrt-ramips-mt7621-mikrotik_rbm33g-squashfs-sysupgrade.bin" to the device
using scp.
2. Write openwrt to flash using "sysupgrade
openwrt-ramips-mt7621-mikrotik_rbm33g-squashfs-sysupgrade.bin"
Once the flashing completes reboot the router and let it boot from flash.
It should boot straight to OpenWRT.
Signed-off-by: Tobias Schramm <tobleminer@gmail.com>
7 years ago
|
|
|
mikrotik,rbm33g|\
|
|
|
|
mzk-wdpr|\
|
|
|
|
rt-n14u|\
|
|
|
|
skylab,skw92a|\
|
|
|
|
tplink,c20-v4|\
|
|
|
|
tplink,c50-v3|\
|
ramips: add support for Archer C50 v4
This adds support for the TP-Link Archer C50 v4.
It uses the same hardware as the v3 variant, sharing the same FCC-ID.
CPU: MediaTek MT7628 (580MHz)
RAM: 64M DDR2
FLASH: 8M SPI
WiFi: 2.4GHz 2x2 MT7628 b/g/n integrated
WiFI: 5GHz 2x2 MT7612 a/n/ac
ETH: 1x WAN 4x LAN
LED: Power, WiFi2, WiFi5, LAN, WAN, WPS
BTN: WPS/WiFi, RESET
UART: Near ETH ports, 115200 8n1, TP-Link pinout
Create Factory image
--------------------
As all installation methods require a U-Boot to be integrated into the
Image (and we do not ship one with the image) we are not able to create
an image in the OpenWRT build-process.
Download a TP-Link image from their Wesite and a OpenWRT sysupgrade
image for the device and build yourself a factory image like following:
TP-Link image: tpl.bin
OpenWRT sysupgrade image: owrt.bin
> dd if=tpl.bin of=boot.bin bs=131584 count=1
> cat owrt.bin >> boot.bin
Installing via Web-UI
---------------------
Upload the boot.bin via TP-Links firmware upgrade tool in the
web-interface.
Installing via Recovery
-----------------------
Activate Web-Recovery by beginning the upgrade Process with a
Firmware-Image from TP-Link. After starting the Firmware Upgrade,
wait ~3 seconds (When update status is switching to 0%), then
disconnect the power supply from the device. Upgrade flag (which
activates Web-Recovery) is written before the OS-image is touched and
removed after write is succesfull, so this procedure should be safe.
Plug the power back in. It will come up in Recovery-Mode on 192.168.0.1.
When active, all LEDs but the WPS LED are off.
Remeber to assign yourself a static IP-address as DHCP is not active in
this mode.
The boot.bin can now be uploaded and flashed using the web-recovery.
Installing via TFTP
-------------------
Prepare an image like following (Filenames from factory image steps
apply here)
> dd if=/dev/zero of=tp_recovery.bin bs=196608 count=1
> dd if=tpl.bin of=tmp.bin bs=131584 count=1
> dd if=tmp.bin of=boot.bin bs=512 skip=1
> cat boot.bin >> tp_recovery.bin
> cat owrt.bin >> tp_recovery.bin
Place tp_recovery.bin in root directory of TFTP server and listen on
192.168.0.66/24.
Connect router LAN ports with your computer and power up the router
while pressing the reset button. The router will download the image via
tftp and after ~1 Minute reboot into OpenWRT.
U-Boot CLI
----------
U-Boot CLI can be activated by holding down '4' on bootup.
Dual U-Boot
-----------
This is the first TP-Link MediaTek device to feature a split-uboot
design. The first (factory-uboot) provides recovery via TFTP and HTTP,
jumping straight into the second (firmware-uboot) if no recovery needs
to be performed. The firmware-uboot unpacks and executed the kernel.
Web-Recovery
------------
TP-Link integrated a new Web-Recovery like the one on the Archer C7v4 /
TL-WR1043v5. Stock-firmware sets a flag in the "romfile" partition
before beginning to write and removes it afterwards. If the router boots
with this flag set, bootloader will automatically start Web-recovery and
listens on 192.168.0.1. This way, the vendor-firmware or an OpenWRT
factory image can be written.
By doing the same while performing sysupgrade, we can take advantage of
the Web-recovery in OpenWRT.
It is important to note that Web-Recovery is only based on this flag. It
can't detect e.g. a crashing kernel or other means. Once activated it
won't boot the OS before a recovery action (either via TFTP or HTTP) is
performed. This recovery-mode is indicated by an illuminated WPS-LED on
boot.
Signed-off-by: David Bauer <mail@david-bauer.net>
6 years ago
|
|
|
tplink,c50-v4|\
|
|
|
|
tplink,tl-mr3420-v5|\
|
|
|
|
tplink,tl-wr842n-v5|\
|
ramips: add support for TP-Link TL-WR840N v4 and TL-WR841N v13
TP-Link TL-WR840N v4 and TL-WR841N v13 are simple N300 routers with
5-port FE switch and non-detachable antennas. Both are very similar
and are based on MediaTek MT7628NN (aka MT7628N) WiSoC.
The difference between these two models is in number of available
LEDs, buttons and power input switch.
This work is partially based on GitHub PR#974.
Specification:
- MT7628N/N (580 MHz)
- 64 MB of RAM (DDR2)
- 8 MB of FLASH
- 2T2R 2.4 GHz
- 5x 10/100 Mbps Ethernet
- 2x external, non-detachable antennas
- UART (J1) header on PCB (115200 8n1)
- TL-WR840N v4: 5x LED (GPIO-controlled), 1x button
- TL-WR841N v13: 8x LED (GPIO-controlled*), 2x button, power input
switch
* WAN LED in TL-WR841N v13 is a dual-color, dual-leads type which isn't
(fully) supported by gpio-leds driver. This type of LED requires both
GPIOs state change at the same time to select color or turn it off.
For now, we support/use only the green part of the LED.
Factory image notes:
These devices use version 3 of TP-Link header, fortunately without RSA
signature (at least in case of devices sold in Europe). The difference
lays in the requirement for a non-zero value in "Additional Hardware
Version" field. Ideally, it should match the value stored in vendor
firmware header on device ("0x4"/"0x13" for these devices) but it seems
that anything other than "0" is correct.
We are able to prepare factory firwmare file which is accepted and
(almost) correctly flashed from the vendor GUI. As it turned out, it
accepts files without U-Boot image with second header at the beginning
but due to some kind of bug in upgrade routine, flashed image gets
corrupted before it's written to flash.
Tests showed that the GUI upgrade routine copies value of "Additional
Hardware Version" from existing firmware into offset "0x2023c" in
provided file, _before_ storing it in flash. In case of vendor firmware
upgrade files (which all include U-Boot image and two headers), this
offset points to the matching field in kernel+rootfs firmware part
header. Unfortunately, in case of LEDE factory image file which contains
only one header, it points to the offset "0x2023c" in kernel image. This
leads to a corrupted kernel and ends up with a "soft-bricked" device.
The good news is that U-Boot in these devices contains well known tftp
recovery mode, which can be triggered with "reset" button. What's more,
in comparison to some of older MediaTek based TP-Link devices, this
recovery mode doesn't write whole file at offset "0x0" in flash, without
verifying provided file in advance. In case of recovery mode in these
devices, first "0x20000" bytes are always skipped and "0x7a0000" bytes
from rest of the file are stored in flash at offset "0x20000".
Flash instruction:
Until (if at all) TP-Link fixes described problem, the only way to flash
LEDE image in these devices is to use tftp recovery mode in U-Boot:
1. Configure PC with static IP 192.168.0.66/24 and tftp server.
2. Rename "lede-ramips-mt7628-tl-wr84...-squashfs-tftp-recovery.bin"
to "tp_recovery.bin" and place it in tftp server directory.
3. Connect PC with one of LAN ports, press the reset button, power up
the router and keep button pressed for around 6-7 seconds, until
device starts downloading the file.
4. Router will download file from server, write it to flash and reboot.
To access U-Boot CLI, keep pressed "4" key during boot.
Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
8 years ago
|
|
|
tl-wr840n-v4|\
|
|
|
|
tl-wr840n-v5|\
|
ramips: add support for TP-Link TL-WR840N v4 and TL-WR841N v13
TP-Link TL-WR840N v4 and TL-WR841N v13 are simple N300 routers with
5-port FE switch and non-detachable antennas. Both are very similar
and are based on MediaTek MT7628NN (aka MT7628N) WiSoC.
The difference between these two models is in number of available
LEDs, buttons and power input switch.
This work is partially based on GitHub PR#974.
Specification:
- MT7628N/N (580 MHz)
- 64 MB of RAM (DDR2)
- 8 MB of FLASH
- 2T2R 2.4 GHz
- 5x 10/100 Mbps Ethernet
- 2x external, non-detachable antennas
- UART (J1) header on PCB (115200 8n1)
- TL-WR840N v4: 5x LED (GPIO-controlled), 1x button
- TL-WR841N v13: 8x LED (GPIO-controlled*), 2x button, power input
switch
* WAN LED in TL-WR841N v13 is a dual-color, dual-leads type which isn't
(fully) supported by gpio-leds driver. This type of LED requires both
GPIOs state change at the same time to select color or turn it off.
For now, we support/use only the green part of the LED.
Factory image notes:
These devices use version 3 of TP-Link header, fortunately without RSA
signature (at least in case of devices sold in Europe). The difference
lays in the requirement for a non-zero value in "Additional Hardware
Version" field. Ideally, it should match the value stored in vendor
firmware header on device ("0x4"/"0x13" for these devices) but it seems
that anything other than "0" is correct.
We are able to prepare factory firwmare file which is accepted and
(almost) correctly flashed from the vendor GUI. As it turned out, it
accepts files without U-Boot image with second header at the beginning
but due to some kind of bug in upgrade routine, flashed image gets
corrupted before it's written to flash.
Tests showed that the GUI upgrade routine copies value of "Additional
Hardware Version" from existing firmware into offset "0x2023c" in
provided file, _before_ storing it in flash. In case of vendor firmware
upgrade files (which all include U-Boot image and two headers), this
offset points to the matching field in kernel+rootfs firmware part
header. Unfortunately, in case of LEDE factory image file which contains
only one header, it points to the offset "0x2023c" in kernel image. This
leads to a corrupted kernel and ends up with a "soft-bricked" device.
The good news is that U-Boot in these devices contains well known tftp
recovery mode, which can be triggered with "reset" button. What's more,
in comparison to some of older MediaTek based TP-Link devices, this
recovery mode doesn't write whole file at offset "0x0" in flash, without
verifying provided file in advance. In case of recovery mode in these
devices, first "0x20000" bytes are always skipped and "0x7a0000" bytes
from rest of the file are stored in flash at offset "0x20000".
Flash instruction:
Until (if at all) TP-Link fixes described problem, the only way to flash
LEDE image in these devices is to use tftp recovery mode in U-Boot:
1. Configure PC with static IP 192.168.0.66/24 and tftp server.
2. Rename "lede-ramips-mt7628-tl-wr84...-squashfs-tftp-recovery.bin"
to "tp_recovery.bin" and place it in tftp server directory.
3. Connect PC with one of LAN ports, press the reset button, power up
the router and keep button pressed for around 6-7 seconds, until
device starts downloading the file.
4. Router will download file from server, write it to flash and reboot.
To access U-Boot CLI, keep pressed "4" key during boot.
Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
8 years ago
|
|
|
tl-wr841n-v13|\
|
ramips: add support for UniElec U7628-01
UniElec U7628-01 is a router platform board based on MediaTek MT7628AN.
The device has the following specifications:
- MT7628AN (580MHz)
- 64/128/256 MB of RAM (DDR2)
- 8/16 MB of flash (SPI NOR)
- 5x 10/100 Mbps Ethernet (MT7628 built-in switch)
- 1x 2T2R 2.4 GHz Wi-Fi (MT7628)
- 1x miniPCIe slot (with PCIe and USB 2.0 buses)
- 1x miniSIM slot
- 1x microSD slot
- 1x USB 2.0 port
- 7x single-color LEDs (GPIO-controlled)
- 1x bi-color LED (green GPIO-controlled, red -> LED_WLAN# in miniPCIe)
- 1x reset button
- 1x UART header (4-pins)
- 1x SDXC/GPIO header (10-pins, connected with microSD slot)
- 1x DC jack for main power (12 V)
The following has been tested and is working:
- Ethernet switch
- miniPCIe slot (tested with modem and Wi-Fi card)
- miniSIM slot
- sysupgrade
- reset button
- USB 2.0 port*
Due to a missing driver (MMC over GPIO) this is not supported:
- microSD card reader
* Warning:
USB buses in miniPCIe and regular A-type socket are connected together,
without any proper analog switch or USB HUB.
Installation:
This board might come with a different firmware versions (MediaTek SDK,
PandoraBox, Padavan, etc.). If your board comes with PandoraBox, you can
install LEDE using sysupgrade. Just SSH to the router and perform forced
sysupgrade (due to a board name mismatch). The default IP of this board
should be: 192.168.1.1 and username/password: root/admin. In case of a
different firmware, you can use web based recovery described below.
Use the following command to perform the sysupgrade (for the 128MB
RAM/16MB flash version):
sysupgrade -n -F lede-ramips-mt76x8-u7628-01-128M-16M-squashfs-sysupgrade.bin
Recovery:
This board contains a Chinese, closed-source bootloader called Breed
(Boot and Recovery Environment for Embedded Devices). Breed supports web
recovery and to enter it, you keep the reset button pressed for around
5 seconds during boot. Your machine will be assigned an IP through DHCP
and the router will use IP address 192.168.1.1. The recovery website is
in Chinese, but is easy to use. Click on the second item in the list to
access the recovery page, then the second item on the next page is where
you select the firmware. In order to start the recovery, you click the
button at the bottom.
SDXC/GPIO header (J3):
1. SDXC_D3 / I2C_SCLK
2. SDXC_D2 / I2C_SD
3. SDXC_D1 / I2S_DI
4. SDXC_D0 / I2S_WS
5. SDXC_CMD / I2S_CLK
6. SDXC_CLK / GPIO0
7. SDXC_CD / UART_RXD1
8. UART_TXD1
9. 3V3
10. GND
Other notes:
1. The board is available with different amounts of RAM and flash. We
have only added support for the 128/16 MB configuration, as that seems
to be the default. However, all the required infrastructure is in place
for making support for the other configurations easy.
Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
Signed-off-by: Kristian Evensen <kristian.evensen@gmail.com>
7 years ago
|
|
|
u7628-01-128M-16M|\
|
ramips: add support for Ubiquiti EdgeRouter X (UBNT-ERX)
This router is based on MT7621 SoC, no wifi, no usb, nand.
Works:
* Boots.
* Ethernet.
* Switch.
* Button (reset).
* Flashing OpenWrt from stock firmware.
* Upgrading OpenWrt.
Doesn't work:
* No GPIO leds. All leds are controlled by switch,
but stock firmware was able to control them.
* SoC has crypto engine but no open driver.
* SoC has nat acceleration, but no open driver.
* This router has 2MB spi flash soldered in but MT
nand/spi drivers do not support pin sharing,
so it is not accessable and disabled. Stock
firmware could read it and it was empty.
* PoE out.
Router has serial pins populated. If looking at the top
of the router, then counting from Eth sockets pins go as:
'GND, RX, TX, GND'. 3.3v, 57600.
U-boot bootloader supports tftpboot, controlled from serial.
This router has two kernel partitions: 'live' and 'backup'.
They are swapped during flashing (on both stock and OpenWrt).
Active partition is controlled by a flag in a factory partition.
U-boot has custom command to switch active kernel partition.
Kernel partitions are 'bare flash' 3MB. Stock bootloader has
no UBI support. Stock rootfs is UBIFS.
Flashing procedure.
Stock firmware uses custom kernel patch to mount squashfs
from a file that is located on UBIFS volume. This makes wiping
out this volume from within stock firmware difficult.
Instead this patch builds image that is flashable by stock firmware
and contains initrams image (with minimal set of packages
to fit into kernel partition). Once this is flashed one can reboot
into initramfs OpenWrt and use sysupgrade to flash OpenWrt including
rootfs into nand.
Note: factory image is only built if initramfs image is enabled.
Signed-off-by: Nikolay Martynov <mar.kolya@gmail.com>
SVN-Revision: 47881
9 years ago
|
|
|
ubnt-erx|\
|
|
|
|
ubnt-erx-sfp|\
|
|
|
|
ur-326n4g|\
|
|
|
|
wrtnode|\
|
|
|
|
wrtnode2p | \
|
|
|
|
wrtnode2r | \
|
|
|
|
youhua,wr1200js|\
|
|
|
|
zbt-wa05|\
|
|
|
|
zyxel,keenetic-extra-ii)
|
|
|
|
ucidef_add_switch "switch0" \
|
|
|
|
"1:lan" "2:lan" "3:lan" "4:lan" "0:wan" "6@eth0"
|
|
|
|
;;
|
|
|
|
c50|\
|
|
|
|
tplink,c20-v1)
|
|
|
|
ucidef_add_switch "switch0" \
|
|
|
|
"1:lan:3" "2:lan:4" "3:lan:1" "4:lan:2" "0:wan" "6@eth0"
|
|
|
|
;;
|
|
|
|
dir-860l-b1|\
|
|
|
|
elecom,wrc-1167ghbk2-s|\
|
|
|
|
elecom,wrc-2533gst|\
|
|
|
|
elecom,wrc-1900gst|\
|
|
|
|
hg255d|\
|
ramips: add support for I-O DATA WN-AX1167GR
I-O DATA WN-AX1167GR is a 2.4/5 GHz band 11ac router, based on
MediaTek MT7621A.
Specification:
- MT7621A (2-Cores, 4-Threads)
- 64 MB of RAM (DDR2)
- 16 MB of Flash (SPI)
- 2T2R 2.4/5 GHz
- 5x 10/100/1000 Mbps Ethernet
- 2x LEDs, 4x keys (2x buttons, 1x slide switch)
- UART header on PCB
- Vcc, GND, TX, RX from ethernet port side
- baudrate: 115200 bps (U-Boot, OpenWrt)
Stock firmware:
In the stock firmware, WN-AX1167GR has two os images each composed of
Linux kernel and rootfs.
These images are stored in "Kernel" and "app" partition of the
following partitions, respectively.
(excerpt from dmesg):
MX25L12805D(c2 2018c220) (16384 Kbytes)
mtd .name = raspi, .size = 0x01000000 (16M) .erasesize = 0x00010000 (64K) .numeraseregions = 0
Creating 10 MTD partitions on "raspi":
0x000000000000-0x000001000000 : "ALL"
0x000000000000-0x000000030000 : "Bootloader"
0x000000030000-0x000000040000 : "Config "
0x000000040000-0x000000050000 : "Factory"
0x000000050000-0x000000060000 : "iNIC_rf"
0x000000060000-0x0000007e0000 : "Kernel"
0x000000800000-0x000000f80000 : "app"
0x000000f90000-0x000000fa0000 : "Key"
0x000000fa0000-0x000000fb0000 : "backup"
0x000000fb0000-0x000001000000 : "storage"
The flag for boot partition is stored in "Key" partition, and U-Boot
reads this and determines the partition to boot.
If the image that U-Boot first reads according to the flag is
"Bad Magic Number", U-Boot then tries to boot from the other image.
If the second image is correct, change the flag to the number
corresponding to that image and boot from that image.
(example):
## Booting image at bc800000 ...
Bad Magic Number,FFFFFFFF
Boot from KERNEL 1 !!
## Booting image at bc060000 ...
Image Name: MIPS OpenWrt Linux-4.14.50
Image Type: MIPS Linux kernel Image (lzma compressed)
Data Size: 1865917 Bytes = 1.8 MB
Load Address: 80001000
Entry Point: 80001000
Verifying Checksum ... OK
Uncompressing Kernel Image ... OK
raspi_erase_write: offs:f90000, count:34
.
.
Done!
Starting kernel ...
Flash instruction using factory image:
1. Connect the computer to the LAN port of WN-AX1167GR
2. Connect power cable to WN-AX1167GR and turn on it
3. Access to "192.168.0.1" on the web browser and open firmware
update page ("ファームウェア")
4. Select the OpenWrt factory image and perform firmware update
5. On the initramfs image, execute "mtd erase firmware" to erase stock
firmware and execute sysupgrade with sysupgrade image for WN-AX1167GR
6. Wait ~180 seconds to complete flasing
Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
6 years ago
|
|
|
iodata,wn-ax1167gr|\
|
|
|
|
iodata,wn-gx300gr)
|
|
|
|
ucidef_add_switch "switch0" \
|
|
|
|
"1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "0:wan" "6@eth0"
|
|
|
|
;;
|
|
|
|
gnubee,gb-pc1|\
|
|
|
|
gnubee,gb-pc2)
|
|
|
|
ucidef_add_switch "switch0" \
|
|
|
|
"0:lan" "4:lan" "6@eth0"
|
|
|
|
;;
|
|
|
|
gl-mt300n-v2)
|
|
|
|
ucidef_add_switch "switch0" \
|
|
|
|
"1:lan" "0:wan" "6@eth0"
|
|
|
|
;;
|
|
|
|
awapn2403)
|
|
|
|
ucidef_add_switch "switch0" \
|
|
|
|
"0:lan" "1:wan" "6@eth0"
|
|
|
|
;;
|
|
|
|
b2c|\
|
|
|
|
nw718|\
|
|
|
|
psr-680w|\
|
|
|
|
sl-r7205|\
|
|
|
|
ur-336un|\
|
|
|
|
w502u|\
|
|
|
|
wr6202)
|
|
|
|
ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
|
|
|
|
;;
|
|
|
|
br-6475nd)
|
|
|
|
ucidef_add_switch "switch0" \
|
|
|
|
"1:lan" "2:lan" "3:lan" "4:lan" "0:wan" "9@eth0"
|
|
|
|
;;
|
|
|
|
c108|\
|
|
|
|
cf-wr800n)
|
|
|
|
ucidef_add_switch "switch0" \
|
|
|
|
"4:lan" "6t@eth0"
|
|
|
|
;;
|
|
|
|
cy-swr1100)
|
|
|
|
ucidef_add_switch "switch0" \
|
|
|
|
"0:lan" "1:lan" "2:lan" "3:lan" "4:wan" "9@eth0"
|
|
|
|
;;
|
|
|
|
duzun-dm06)
|
|
|
|
ucidef_add_switch "switch0" \
|
|
|
|
"1:lan" "0:wan" "6@eth0"
|
|
|
|
;;
|
|
|
|
e1700|\
|
|
|
|
mt7620a_mt7530)
|
|
|
|
ucidef_add_switch "switch1" \
|
|
|
|
"0:lan" "1:lan" "2:lan" "3:lan" "4:wan" "6@eth0"
|
|
|
|
;;
|
|
|
|
edimax,br-6478ac-v2|\
|
|
|
|
tplink,c2-v1)
|
|
|
|
ucidef_add_switch "switch1" \
|
|
|
|
"1:lan" "2:lan" "3:lan" "4:lan" "0:wan" "6@eth0"
|
|
|
|
;;
|
|
|
|
hc5661|\
|
|
|
|
hc5861|\
|
|
|
|
y1s)
|
|
|
|
ucidef_add_switch "switch0" \
|
|
|
|
"1:lan" "2:lan" "3:lan" "4:lan" "5:lan" "0:wan" "6@eth0"
|
|
|
|
;;
|
|
|
|
iodata,wn-ac1167gr)
|
|
|
|
ucidef_add_switch "switch1" \
|
|
|
|
"1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "0:wan" "6@eth0"
|
|
|
|
;;
|
|
|
|
kn_rf)
|
|
|
|
ucidef_add_switch "switch0" \
|
|
|
|
"0:wan" "1:lan" "2:lan" "3:lan" "4:lan" "6@eth0"
|
|
|
|
;;
|
|
|
|
kng_rc)
|
|
|
|
ucidef_add_switch "switch1" \
|
|
|
|
"0:lan" "1:lan" "2:lan" "3:lan" "4:wan" "7t@eth0"
|
|
|
|
;;
|
|
|
|
mlwg2|\
|
|
|
|
wizard8800|\
|
|
|
|
wl-330n)
|
|
|
|
ucidef_set_interface_lan "eth0.1"
|
|
|
|
;;
|
|
|
|
mr200)
|
|
|
|
ucidef_add_switch "switch0" \
|
|
|
|
"0:lan" "1:lan" "2:lan" "3:lan" "6t@eth0"
|
|
|
|
ucidef_set_interface_wan "usb0"
|
|
|
|
;;
|
|
|
|
netgear,r6120)
|
|
|
|
ucidef_add_switch "switch0" \
|
|
|
|
"0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "4:wan" "6@eth0"
|
|
|
|
;;
|
|
|
|
hc5761)
|
|
|
|
ucidef_add_switch "switch0" \
|
|
|
|
"1:lan" "4:lan" "0:wan" "6@eth0"
|
|
|
|
;;
|
|
|
|
mzk-dp150n|\
|
|
|
|
vocore-8M|\
|
|
|
|
vocore-16M)
|
|
|
|
ucidef_add_switch "switch0" \
|
|
|
|
"0:lan" "4:lan" "6t@eth0"
|
|
|
|
;;
|
|
|
|
newifi-d1)
|
|
|
|
ucidef_add_switch "switch0" \
|
|
|
|
"1:lan:2" "2:lan:1" "4:wan" "6@eth0"
|
|
|
|
;;
|
|
|
|
phicomm,k2g)
|
|
|
|
ucidef_add_switch "switch0" \
|
|
|
|
"0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "5:wan" "6@eth0"
|
|
|
|
;;
|
|
|
|
re350-v1)
|
|
|
|
ucidef_add_switch "switch0" \
|
|
|
|
"0:lan" "6@eth0"
|
|
|
|
;;
|
|
|
|
re6500)
|
|
|
|
ucidef_add_switch "switch0" \
|
|
|
|
"0:lan:1" "1:lan:2" "2:lan:3" "3:lan:4" "6@eth0"
|
|
|
|
;;
|
|
|
|
rt-n56u)
|
|
|
|
ucidef_add_switch "switch0" \
|
|
|
|
"0:lan" "1:lan" "2:lan" "3:lan" "4:wan" "8@eth0"
|
|
|
|
;;
|
|
|
|
tew-638apb-v2)
|
|
|
|
ucidef_add_switch "switch0" \
|
|
|
|
"4:lan" "6@eth0"
|
|
|
|
;;
|
|
|
|
lava,lr-25g001|\
|
|
|
|
tew-691gr|\
|
|
|
|
tew-692gr|\
|
|
|
|
wlr-6000)
|
|
|
|
ucidef_add_switch "switch0" \
|
|
|
|
"1:lan" "2:lan" "3:lan" "4:lan" "5:wan" "0@eth0"
|
|
|
|
;;
|
|
|
|
tplink,tl-wr902ac-v3)
|
|
|
|
ucidef_add_switch "switch0" \
|
|
|
|
"4:lan" "6@eth0"
|
|
|
|
;;
|
|
|
|
vonets,var11n-300|\
|
|
|
|
wt1520-4M|\
|
|
|
|
wt1520-8M)
|
ramips: add support for Vonets VAR11N-300
The VAR11N-300 is a tiny wireless-N device with a hardwired Ethernet
cable, one extra Ethernet port, and an internal antenna, based on the
MediaTek MT7620n chipset.
Specs:
- MT7620n WiSoC @ 600MHz
- 32 MB SDRAM
- 4 MB SPI flash
- 2T2R 2.4GHz WiFi-N
- 1 attached 10/100 Ethernet cable (LAN)
- 1 10/100 Ethernet port (WAN)
- 1 attached USB / barrel 5vdc power cable
- 5 LEDs (see notes below)
- 1 reset button
- 1 UART (3 pads on board)
Installation:
The stock firmware does not support uploading new firmware directly,
only checking the manufacturer's site for updates. This process may be
possible to spoof, but the update check uses some kind of homebrew
encryption that I didn't investigate. Instead, you can install via a
backdoor:
1. Set up a TFTP server to serve the firmware binary
(lede-ramips-mt7620-var11n-300-squashfs-sysupgrade.bin)
2. Factory reset the device by holding the reset button for a few
seconds.
3. Open the web interface (default IP: 192.168.253.254)
4. Log in with the "super admin" credentials: username `vonets`,
password `vonets26642519`.
5. On the "Operative Status" page, click the text "System Uptime", then
quickly click the uptime value.
6. If successful, an alert dialog will appear reading "Ated start", and
the device will now accept telnet connections. If the alert does not
appear, repeat step 5 until it works (the timing is a bit tricky).
7. Telnet to the device using credentials "admin / admin"
8. Retrieve the firmware binary from the tftp server: `tftp -l lede.bin
-r lede-ramips-mt7620-var11n-300-squashfs-sysupgrade.bin -g
<tftp-server-ip>`
9. Write the firmware to flash: `mtd_write write lede.bin /dev/mtd4`
10. Reboot
Tested:
- LAN / WAN ethernet
- WiFi
- LAN / WAN / status LED GPIOs (see notes below)
- Reset button
- Sysupgrade
Notes:
LEDs:
The board has 5 LEDs - two green LEDs for LAN / WAN activity, one blue
LED for WiFi, and a pair of "status" LEDs connected to the same GPIO
(the blue LED lights when the GPIO is low, and the green when it's
high). I was unable to determine how to operate the WiFi LED, as it
does not appear to be controlled by a GPIO directly.
Recovery:
The default U-boot installation will only boot from flash due to a
missing environment block. I generated a valid 4KB env block using
U-boot's `fw_setenv` tool and wrote it to flash at 0x30000 using an
external programmer. After this, it was possible to enter the U-boot
commandline interface and download a new image via TFTP (`tftpboot
81b00000 <image-filename>`), but while I could boot this image
sucessfully (`bootm`), writing it to flash (`cp.linux`) just corrupted
the flash chip. The sysupgrade file can be written to flash at 0x50000
using an external programmer.
Signed-off-by: Andrew Crawley <acrawley@gmail.com>
7 years ago
|
|
|
ucidef_add_switch "switch0" \
|
|
|
|
"0:lan" "4:wan" "6@eth0"
|
|
|
|
;;
|
|
|
|
vocore2|\
|
|
|
|
vocore2lite)
|
|
|
|
ucidef_add_switch "switch0" \
|
|
|
|
"0:lan" "2:lan" "6t@eth0"
|
|
|
|
;;
|
|
|
|
f5d8235-v1|\
|
|
|
|
f5d8235-v2|\
|
|
|
|
tew-714tru|\
|
|
|
|
v11st-fe|\
|
|
|
|
wzr-agl300nh)
|
|
|
|
ucidef_add_switch "switch0" \
|
|
|
|
"1:lan" "2:lan" "3:lan" "4:lan" "0:wan" "5@eth0"
|
|
|
|
;;
|
|
|
|
wcr-1166ds)
|
|
|
|
ucidef_add_switch "switch0" \
|
|
|
|
"3:lan" "4:wan" "6@eth0"
|
|
|
|
;;
|
ramips: Add support for ZBT WE1026-5G
The ZBT WE1026-5G
(http://www.zbtlink.com/products/router/WE1026-5G.html) is the follow-up
to the ZBT WE1026 and is based on MT7620. For the previous WE1026, the
ZBT WE826 image could be used. However, as the name implies, the -5G
comes equipped with a 5GHz wifi radio. As the WE826 only has a 2.4GHz
radio, the addition of 5GHz means that a separate image is needed for
the WE1026-5G. I suspect that this image will also work on the previous
WE1026, but I don't have a device to test with.
The WE1026-5G has following specifications:
* CPU: MT7620A
* 1x 10/100Mbps Ethernet.
* 16 MB Flash.
* 64 MB RAM.
* 1x USB 2.0 port.
* 1x mini-PCIe slots.
* 1x SIM slots.
* 1x 2.4Ghz WIFI.
* 1x 5GHz wifi (MT7612)
* 1x button.
* 3x controllable LEDs.
Works:
* Wifi.
* Switch.
* mini-PCIe slot. Only tested with a USB device (a modem).
* SIM slot.
* Sysupgrade.
* Button (reset).
Not working:
* The 5GHz WIFI LED is completely dead. I suspect the issue is the same
as on other devices with Mediatek 5Ghz wifi-cards/chips. The LED is
controlled by the driver, and mt76 (currently) does not support this.
Not tested:
* SD card reader.
Notes:
* The modem (labeled 3G/4G) and power LEDs are controlled by the
hardware.
* There is a 32MB version of this device available, but I do not have
access to it. I have therefor only added support for the 16MB version,
but added all the required infrastructure to make adding support for the
32MB version easy.
Installation:
The router comes pre-installed with OpenWRT, including a variant of
Luci. The initial firmware install can be done through this UI,
following normal procedure. I.e., access the UI and update the firmware
using the sysupgrade-image. Remember to select that you do not want to
keep existing settings.
Recovery:
If you brick the device, the WE1026-5G supports recovery using HTTP. Keep the
reset button pressed for ~5sec when booting to start the web server. Set the
address of the network interface on your machine to 192.168.1.2/24, and
point your browser to 192.168.1.1 to access the recovery UI. From the
recovery UI you can upload a firmware image.
Signed-off-by: Kristian Evensen <kristian.evensen@gmail.com>
7 years ago
|
|
|
wcr-150gn|\
|
|
|
|
we1026-5g-16m)
|
|
|
|
ucidef_add_switch "switch0" \
|
|
|
|
"0:lan" "6t@eth0"
|
|
|
|
;;
|
|
|
|
whr-1166d)
|
|
|
|
ucidef_add_switch "switch0" \
|
|
|
|
"0:lan" "1:lan" "2:lan" "3:lan" "5:wan" "6@eth0"
|
|
|
|
;;
|
|
|
|
wizfi630a)
|
|
|
|
ucidef_add_switch "switch0" \
|
|
|
|
"0:lan" "1:lan" "2:wan" "6@eth0"
|
|
|
|
;;
|
|
|
|
wt3020-4M|\
|
|
|
|
wt3020-8M)
|
|
|
|
ucidef_add_switch "switch0" \
|
|
|
|
"4:lan" "0:wan" "6@eth0"
|
|
|
|
;;
|
|
|
|
zbtlink,zbt-we1226|\
|
|
|
|
y1)
|
|
|
|
ucidef_add_switch "switch0" \
|
|
|
|
"0:lan:2" "1:lan:1" "4:wan" "6@eth0"
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
RT3X5X=`cat /proc/cpuinfo | egrep "(RT3.5|RT5350)"`
|
|
|
|
if [ -n "${RT3X5X}" ]; then
|
|
|
|
ramips_setup_rt3x5x_vlans
|
|
|
|
else
|
|
|
|
ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
}
|
|
|
|
|
|
|
|
ramips_setup_macs()
|
|
|
|
{
|
|
|
|
local board="$1"
|
|
|
|
local lan_mac=""
|
|
|
|
local wan_mac=""
|
|
|
|
|
|
|
|
case $board in
|
|
|
|
a5-v11|\
|
ramips: add support for Loewe WMDR-143N
The WMDR-143N is a small module originally used as a Wifi client
in some Loewe smart TV sets. It is sold cheaply at german surplus
shops. The module contains a RT3662 SOC.
Specifications:
- 500 MHz CPU Clock
- 1x 10/100Mbps Ethernet (pin header)
- 32 MB of RAM
- 8 MB of FLASH
- 2T3R 2.4/5 GHz (SOC internal)
- 3 Antennas on PCB
- UART pads on PCB (J3: 1 = +3.3V, 2 = RX, 3 = TX, 4 = GND), TX
and RX are 3,3V only! The square hole is pin 1
- Power supply pads on PCB (J6: 1 and 2 = +5V, 3 and 4 = GND)
The square hole is pin 1
The original firmware has two identical kernel/rootfs images and
two "Factory" calibration data blocks in flash. The LEDE image
leaves only the first "Factory" block in place and uses both
"Kernel" blocks and the redundant "Factory" block together to gain
enough space for the jffs2 partition.
Flash instructions:
You need UART and Ethernet connections to flash the board. Use
the LEDE "sysupgrade.bin" image with tftp.
Apply power to the board and in the first 5 seconds, hit 2 to
select TFTP upload. The bootloader asks for board- and server IP
addresses and filename.
Alternate method: With the vendor firmware running, assign an IP
address to the ethernet port, tftp the firmware image to
/tmp and write to mtd4 ("KernelA").
Signed-off-by: Oliver Fleischmann <ogf@bnv-bamberg.de>
[remove pinctrl node from dts, no pin is used as GPIO]
Signed-off-by: Mathias Kresin <dev@kresin.me>
7 years ago
|
|
|
ht-tm02|\
|
|
|
|
wmdr-143n)
|
|
|
|
lan_mac=$(cat /sys/class/net/eth0/address)
|
|
|
|
;;
|
|
|
|
carambola|\
|
|
|
|
freestation5|\
|
|
|
|
w502u|\
|
|
|
|
wnce2001)
|
|
|
|
wan_mac=$(mtd_get_mac_binary factory 46)
|
|
|
|
;;
|
|
|
|
bc2|\
|
|
|
|
broadway|\
|
|
|
|
d105|\
|
|
|
|
dir-300-b7|\
|
|
|
|
dir-320-b1|\
|
|
|
|
dir-620-a1|\
|
|
|
|
esr-9753|\
|
|
|
|
freestation5|\
|
|
|
|
hlk-rm04|\
|
|
|
|
mpr-a1|\
|
|
|
|
psr-680w|\
|
|
|
|
sl-r7205|\
|
|
|
|
y1|\
|
|
|
|
y1s)
|
|
|
|
lan_mac=$(cat /sys/class/net/eth0/address)
|
|
|
|
lan_mac=$(macaddr_setbit_la "$lan_mac")
|
|
|
|
wan_mac=$(macaddr_add "$lan_mac" 1)
|
|
|
|
;;
|
ramips: add support for Belkin F9K1109v1
Device specification:
- SoC: Ralink RT3883 (MIPS 74Kc) 500Mhz
- RAM: 64Mb
- Flash: 8MB (SPI-NOR)
- Ethernet: 10/100/1000 Mbps
- WLAN
Wireless 1: SoC-integrated : 2.4/5 GHz
Wireless 2: 2.4 GHz RT3092L
- LED: 2x USB, WAN, LAN
- Key: WPS, reset
- Serial: 4-pin header, (57600,8,N,1), 3.3V TTL,
GND, RX, TX, V - J12 marking on board
- USB ports: 2 x USB 2.0
Flashing instructions:
Option 1 (from bootloader web)
- Hold reset button on the back of router when plugging
in power (for at-least 10 seconds after plugged in)
- Connect to a Lan port
- Set computer IP to 10.10.10.3
- Go to http://10.10.10.123 in a web browser
- Click the Browse... Button and select the
*squashfs.sysupgrade.bin file then click APPLY
Option 2 (from the stock admin web)
- Go to firmware upgrade
- Upload the **factory** image *initramfs.bin first
- Boot into openwrt
- From Luci web in openwrt upload the *squashfs.sysupgrade.bin
Signed-off-by: Kip Porterfield <kip.porterfield@gmail.com>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
[added v1 to the compatible identifier, added pciid for
the RT3092L, fixed pci unit-address, split out the F9K110X.dtsi
to prepare for a possible F9K1103 patch]
6 years ago
|
|
|
belkin,f9k1109v1)
|
|
|
|
wan_mac=$(mtd_get_mac_ascii uboot-env HW_WAN_MAC)
|
|
|
|
lan_mac=$(mtd_get_mac_ascii uboot-env HW_LAN_MAC)
|
|
|
|
;;
|
|
|
|
br-6475nd)
|
|
|
|
lan_mac=$(cat /sys/class/net/eth0/address)
|
|
|
|
wan_mac=$(mtd_get_mac_binary devdata 7)
|
|
|
|
;;
|
|
|
|
cy-swr1100|\
|
|
|
|
dch-m225)
|
|
|
|
lan_mac=$(mtd_get_mac_ascii factory lanmac)
|
|
|
|
;;
|
|
|
|
dir-645)
|
|
|
|
lan_mac=$(mtd_get_mac_ascii nvram lanmac)
|
|
|
|
wan_mac=$(mtd_get_mac_ascii nvram wanmac)
|
|
|
|
;;
|
|
|
|
dir-860l-b1)
|
|
|
|
lan_mac=$(mtd_get_mac_ascii factory lanmac)
|
|
|
|
wan_mac=$(mtd_get_mac_ascii factory wanmac)
|
|
|
|
;;
|
|
|
|
dlink,dwr-116-a1|\
|
|
|
|
dlink,dwr-118-a1|\
|
|
|
|
dlink,dwr-118-a2|\
|
|
|
|
dlink,dwr-921-c1|\
|
ramips: add support for DLINK DWR-922-E2
Very similar to the DWR-921-C1, except has a telephony/RJ11 port (not
sure if supported, I didn't try), wireless router with QMI LTE embedded
modem is based on the MT7620N SoC.
Specification:
* MediaTek MT7620N (580 Mhz)
* 64 MB of RAM
* 16 MB of FLASH
* 802.11bgn radio
* 5x 10/100 Mbps Ethernet (1 WAN and 4 LAN)
* 2x external, detachable (LTE) antennas
* UART header on PCB (57600 8n1)
* 6x LED (GPIO-controlled)
* 1x bi-color Signal Strength LED (GPIO-controlled)
* 2x button
* JBOOT bootloader
The status led has been assigned to the dwr-922-e2:green:signalstrength
(lte signal strength) led. At the end of the boot it is switched off and
is available for lte operation. Works correctly also during sysupgrade
operation.
Installation:
Apply factory image via d-link http web-gui, or via recovery interface:
How to recover/revert to OEM firmware:
1.) Push and hold the reset button and turn on the power. Wait until all
LEDs start rapidly blinking (~10sec.)
2.) DHCP should give you an IP in the 192.168.123.0/24 subnet, or set
one manually
3.) Upload original factory image via JBOOT http interface at IP
192.168.123.254
4.) If http doesn't work, it can be done with curl command:
curl -F FN=@XXXXX.bin http://192.168.123.254/upg
where XXXXX.bin is name of firmware file.
5.) You can optionally telnet to 192.168.123.254 before or during the
upload and it will report the flashing status, memory address etc.
6.) Once web UI and/or telnet says "Success", power cycle the router, or
type "reboot" into the telnet session.
Signed-off-by: Simon Quigley <squigley@squigley.net>
[squashed commits, word wrap commit message, rename signal strenght led
name to match what is used for the DWR-921-C1 since they share the led
configuration, add label referenced in the aliases node]
Signed-off-by: Mathias Kresin <dev@kresin.me>
6 years ago
|
|
|
dlink,dwr-922-e2|\
|
|
|
|
lava,lr-25g001)
|
|
|
|
wan_mac=$(jboot_config_read -m -i $(find_mtd_part "config") -o 0xE000)
|
|
|
|
lan_mac=$(macaddr_add "$wan_mac" 1)
|
|
|
|
;;
|
|
|
|
e1700)
|
|
|
|
wan_mac=$(mtd_get_mac_ascii config WAN_MAC_ADDR)
|
|
|
|
;;
|
|
|
|
edimax,br-6478ac-v2)
|
|
|
|
lan_mac=$(cat /sys/class/net/eth0/address)
|
|
|
|
wan_mac=$(macaddr_add "$lan_mac" 2)
|
|
|
|
;;
|
|
|
|
elecom,wrc-1167ghbk2-s|\
|
|
|
|
elecom,wrc-2533gst|\
|
|
|
|
elecom,wrc-1900gst|\
|
|
|
|
sk-wb8)
|
|
|
|
wan_mac=$(mtd_get_mac_binary factory 57350)
|
|
|
|
;;
|
|
|
|
gl-mt300n-v2|\
|
|
|
|
whr-g300n)
|
|
|
|
wan_mac=$(mtd_get_mac_binary factory 4)
|
|
|
|
;;
|
|
|
|
hc5*61|\
|
|
|
|
hc5661a|\
|
|
|
|
hc5962|\
|
|
|
|
hiwifi,hc5861b)
|
|
|
|
lan_mac=`mtd_get_mac_ascii bdinfo "Vfac_mac "`
|
|
|
|
[ -n "$lan_mac" ] || lan_mac=$(cat /sys/class/net/eth0/address)
|
|
|
|
wan_mac=$(macaddr_add "$lan_mac" 1)
|
|
|
|
;;
|
|
|
|
iodata,wn-ac1167gr)
|
|
|
|
wan_mac=$(macaddr_add "$(mtd_get_mac_binary Factory 4)" -1)
|
|
|
|
;;
|
ramips: add support for I-O DATA WN-AX1167GR
I-O DATA WN-AX1167GR is a 2.4/5 GHz band 11ac router, based on
MediaTek MT7621A.
Specification:
- MT7621A (2-Cores, 4-Threads)
- 64 MB of RAM (DDR2)
- 16 MB of Flash (SPI)
- 2T2R 2.4/5 GHz
- 5x 10/100/1000 Mbps Ethernet
- 2x LEDs, 4x keys (2x buttons, 1x slide switch)
- UART header on PCB
- Vcc, GND, TX, RX from ethernet port side
- baudrate: 115200 bps (U-Boot, OpenWrt)
Stock firmware:
In the stock firmware, WN-AX1167GR has two os images each composed of
Linux kernel and rootfs.
These images are stored in "Kernel" and "app" partition of the
following partitions, respectively.
(excerpt from dmesg):
MX25L12805D(c2 2018c220) (16384 Kbytes)
mtd .name = raspi, .size = 0x01000000 (16M) .erasesize = 0x00010000 (64K) .numeraseregions = 0
Creating 10 MTD partitions on "raspi":
0x000000000000-0x000001000000 : "ALL"
0x000000000000-0x000000030000 : "Bootloader"
0x000000030000-0x000000040000 : "Config "
0x000000040000-0x000000050000 : "Factory"
0x000000050000-0x000000060000 : "iNIC_rf"
0x000000060000-0x0000007e0000 : "Kernel"
0x000000800000-0x000000f80000 : "app"
0x000000f90000-0x000000fa0000 : "Key"
0x000000fa0000-0x000000fb0000 : "backup"
0x000000fb0000-0x000001000000 : "storage"
The flag for boot partition is stored in "Key" partition, and U-Boot
reads this and determines the partition to boot.
If the image that U-Boot first reads according to the flag is
"Bad Magic Number", U-Boot then tries to boot from the other image.
If the second image is correct, change the flag to the number
corresponding to that image and boot from that image.
(example):
## Booting image at bc800000 ...
Bad Magic Number,FFFFFFFF
Boot from KERNEL 1 !!
## Booting image at bc060000 ...
Image Name: MIPS OpenWrt Linux-4.14.50
Image Type: MIPS Linux kernel Image (lzma compressed)
Data Size: 1865917 Bytes = 1.8 MB
Load Address: 80001000
Entry Point: 80001000
Verifying Checksum ... OK
Uncompressing Kernel Image ... OK
raspi_erase_write: offs:f90000, count:34
.
.
Done!
Starting kernel ...
Flash instruction using factory image:
1. Connect the computer to the LAN port of WN-AX1167GR
2. Connect power cable to WN-AX1167GR and turn on it
3. Access to "192.168.0.1" on the web browser and open firmware
update page ("ファームウェア")
4. Select the OpenWrt factory image and perform firmware update
5. On the initramfs image, execute "mtd erase firmware" to erase stock
firmware and execute sysupgrade with sysupgrade image for WN-AX1167GR
6. Wait ~180 seconds to complete flasing
Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
6 years ago
|
|
|
iodata,wn-ax1167gr|\
|
ramips: add support for I-O DATA WN-GX300GR
I-O DATA WN-GX300GR is a 2.4 GHz band 11n router, based on MediaTek
MT7621S.
Specification:
- MT7621S (1-Core, 2-Threads)
- 64 MB of RAM
- 8 MB of Flash (SPI)
- 2T2R 2.4 GHz
- 5x 10/100/1000 Mbps Ethernet
- 2x LEDs, 4x keys (2x buttons, 1x slide switch)
- UART header on PCB
- Vcc, GND, TX, RX from ethernet port side
- baudrate: 115200 bps (U-Boot, OpenWrt)
Flash instruction using initramfs image:
1. Connect serial cable to UART header
2. Rename OpenWrt initramfs image for WN-GX300GR to "uImageWN-GX300GR"
and place it in the TFTP directory
3. Set the IP address of the computer to 192.168.99.8, connect to the
LAN port of WN-GX300GR, and start the TFTP server on the computer
4. Connect power cable to WN-GX300GR and turn on the router
5. Press "1" key on the serial console to interrupt boot process on
U-Boot, press Enter key 3 times and start firmware download via TFTP
6. WN-GX300GR downloads initramfs image and boot with it
7. On the initramfs image, execute "mtd erase firmware" to erase stock
firmware and execute sysupgrade with sysupgrade image for WN-GX300GR
8. Wait ~150 seconds to complete flasing
Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
7 years ago
|
|
|
iodata,wn-gx300gr)
|
|
|
|
wan_mac=$(macaddr_add "$(mtd_get_mac_binary Factory 4)" 1)
|
|
|
|
;;
|
|
|
|
kn_rc|\
|
|
|
|
kn_rf|\
|
|
|
|
kng_rc)
|
|
|
|
wan_mac=$(mtd_get_mac_binary factory 40)
|
|
|
|
;;
|
|
|
|
linkits7688)
|
|
|
|
wan_mac=$(mtd_get_mac_binary factory 4)
|
|
|
|
lan_mac=$(mtd_get_mac_binary factory 46)
|
|
|
|
;;
|
|
|
|
mac1200rv2)
|
|
|
|
lan_mac=$(mtd_get_mac_binary factory_info 13)
|
|
|
|
wan_mac=$(macaddr_add "$lan_mac" 1)
|
|
|
|
;;
|
|
|
|
mir3g)
|
ramips: improve Xiaomi Mi Router 3G support
This commit improves support for the Xiaomi Mi Router 3G originally
added in commit 6e283cdc0da25928f8148805ebef7f8f2b769ee8
Improvements:
- Remove software watchdog as hardware watchdog now working as per
commit 3fbf3ab44f5cebb22e30a4c8681b13341feed6a6 for all mt7621
devices.
- Reset button polarity corrected - length of press determines reboot
(short press) vs. reset to defaults (long press) behaviour.
- Enable GPIO amber switch port LEDs on board rear - lit indicates 1Gbit
link and blink on activity. Green LEDs driven directly by switch
indicating any link speed and tx activity.
- USB port power on/off GPIO exposed as 'usbpower'
- Add access to uboot environment settings for checking/setting uboot
boot order preference from user space.
Changes:
- Front LED indicator is physically made of independent Yellow/Amber,
Red & Blue LEDs combined via a plastic 'lightpipe' to a front panel
indicator, hence the colour behaviour is similar to an RGB LED. RGB
LEDs are not supported at this time because they produce colour results
that do not then match colour labels, e.g. enabling 'mir3g:red' and
'mir3g:blue' would result in a purple indicator and we have no such
label for purple.
The yellow, red & blue LEDs have been split out as individual yellow,
red & blue status LEDs, with yellow being the default status LED as
before and with red's WAN and blue's USB default associations removed.
- Swapped order of vlan interfaces (eth0.1 & eth0.2) to match stock vlan
layout. eth0.1 is LAN, eth0.2 is WAN
- Add 'lwlll' vlan layout to mt7530 switch driver to prevent packet
leakage between kernel switch init and uci swconfig
uboot behaviour & system 'recovery'
uboot expects to find bootable kernels at nand addresses 0x200000 &
0x600000 known by uboot as "system 1" and "system 2" respectively.
uboot chooses which system to hand control to based on 3 environment
variables: flag_last_success, flag_try_sys1_failed & flag_try_sys2_failed
last_success represents a preference for a particular system and is set
to 0 for system 1, set to 1 for system 2. last_success is considered *if*
and only if both try_sys'n'_failed flags are 0 (ie. unset) If *either*
failed flags are set then uboot will attempt to hand control to the
non failed system. If both failed flags are set then uboot will check
the uImage CRC of system 1 and hand control to it if ok. If the uImage
CRC of system is not ok, uboot will hand control to system 2
irrespective of system 2's uImage CRC.
NOTE: uboot only ever sets failed flags, it *never* clears them. uboot
sets a system's failed flag if that system's was selected for boot but
the uImage CRC is incorrect.
Fortunately with serial console access, uboot provides the ability to
boot an initramfs image transferred via tftp, similarly an image may
be flashed to nand however it will flash to *both* kernels so a backup
of stock kernel image is suggested. Note that the suggested install
procedure below set's system 1's failed flag (stock) thus uboot ignores
the last_success preference and boots LEDE located in system 2.
Considerable thought has gone into whether LEDE should replace both
kernels, only one (and which one) etc. LEDE kernels do not include a
minimal rootfs and thus unlike the stock kernel cannot include a
method of controlling uboot environment variables in the event of
rootfs mount failure. Similarly uboot fails to provide an external
mechanism for indicating boot system failure.
Installation - from stock.
Installation through telnet/ssh:
- copy lede-ramips-mt7621-mir3g-squashfs-kernel1.bin and
lede-ramips-mt7621-mir3g-squashfs-rootfs0.bin to usb disk or wget it
from LEDE download site to /tmp
- switch to /extdisks/sda1/ (if copied to USB drive) or to /tmp if
wgetted from LEDE download site
- run: mtd write lede-ramips-mt7621-mir3g-squashfs-kernel1.bin kernel1
- run: mtd write lede-ramips-mt7621-mir3g-squashfs-rootfs0.bin rootfs0
- run: nvram set flag_try_sys1_failed=1
- run: nvram commit
- run: reboot
Recovery - to stock.
Assuming you used the above installation instructions you will have a
stock kernel image in system 1. If it can be booted then it may be used
to perform a stock firmware recovery, thus erasing LEDE completely. From
a 'working' LEDE state (even failsafe)
Failsafe only:
- run: mount_root
- run: sh /etc/uci-defaults/30_uboot-envtools
Then do the steps for 'All'
All:
- run: fw_setenv flag_try_sys2_failed 1
- run: reboot
The board will reboot into system 1 (stock basic kernel) and wait with
system red light slowly blinking for a FAT formatted usb stick with a
recovery image to be inserted. Press and hold the reset button for
around 1 second. Status LED will turn yellow during recovery and blue
when recovery complete.
Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
7 years ago
|
|
|
lan_mac=$(mtd_get_mac_binary Factory 0xe006)
|
|
|
|
;;
|
|
|
|
miwifi-mini)
|
|
|
|
wan_mac=$(cat /sys/class/net/eth0/address)
|
|
|
|
lan_mac=$(macaddr_setbit_la "$wan_mac")
|
|
|
|
;;
|
|
|
|
m3|\
|
|
|
|
m4-4M|\
|
|
|
|
m4-8M|\
|
|
|
|
x5|\
|
|
|
|
x8)
|
|
|
|
lan_mac=$(cat /sys/class/net/eth0/address)
|
|
|
|
lan_mac=$(macaddr_add "$lan_mac" -2)
|
|
|
|
;;
|
|
|
|
newifi-d1)
|
|
|
|
lan_mac=$(cat /sys/class/net/eth0/address)
|
|
|
|
lan_mac=$(macaddr_add "$lan_mac" 2)
|
|
|
|
;;
|
|
|
|
omega2|\
|
|
|
|
omega2p)
|
|
|
|
wan_mac=$(mtd_get_mac_binary factory 4)
|
|
|
|
lan_mac=$(mtd_get_mac_binary factory 46)
|
|
|
|
;;
|
|
|
|
oy-0001|\
|
|
|
|
phicomm,k2g)
|
|
|
|
lan_mac=$(mtd_get_mac_binary factory 40)
|
|
|
|
wan_mac=$(mtd_get_mac_binary factory 46)
|
|
|
|
;;
|
|
|
|
r6220|\
|
|
|
|
netgear,r6350)
|
|
|
|
wan_mac=$(mtd_get_mac_binary factory 4)
|
|
|
|
lan_mac=$(macaddr_add "$wan_mac" 1)
|
|
|
|
;;
|
|
|
|
rt-n56u)
|
|
|
|
lan_mac=$(cat /sys/class/net/eth0/address)
|
|
|
|
lan_mac=$(macaddr_setbit_la "$lan_mac")
|
|
|
|
wan_mac=$(mtd_get_mac_binary factory 32772)
|
|
|
|
;;
|
|
|
|
skylab,skw92a)
|
ramips: add support for Skylab SKW92A in EVB
Specifically, SKW92A_E16, described here:
http://www.skylabmodule.com/wp-content/uploads/SkyLab_SKW92A_V1.04_datasheet.pdf
Specification:
- MediaTek MT7628N/N (580 Mhz)
- 64 MB of RAM
- 16 MB of FLASH
- 2T2R 2.4 GHz
- 5x 10/100 Mbps Ethernet
- 2x u.FL
- Power by micro-USB connector at USB1 on EVB
- UART via micro-USB connector at USB3 on EVB (57600 8n1)
- 5x Ethernet LEDs
- 1x WLAN LEDs
- 1x WPS LED connected by jumper wire from I2S_CK on J20 to WPS_LED pin hole next
to daughter board on EVB
- WPS/Reset button (S2 on EVB)
- RESET button (S1 on EVB) is *not* connected to RST hole next to daughter board
Flash instruction:
>From Skylab firmware:
1. Associate with SKYLAP_AP
2. In a browser, load: http://10.10.10.254/
3. Username/password: admin/admin
4. In web admin interface: Administration / Upload Firmware, browse to
sysupgrade image, apply, flash will fail with a message:
Not a valid firmware. *** Warning: "/var/tmpFW" has corrupted data!
5. Telnet to 10.10.10.254, drops you into a root shell with no credentials
6. # cd /var
7. # mtd_write -r write tmpFW mtd4
Unlocking mtd4 ...
Writing from tmpFW to mtd4 ... [e]
8. When flash has completed, you will have booted into your firmware.
>From U-boot via TFTP and initramfs:
1. Place openwrt-ramips-mt76x8-skw92a-initramfs-kernel.bin on a TFTP server
2. Connect to serial console at USB3 on EVB
3. Connect ethernet between port 1 (not WAN) and your TFTP server (e.g.
192.168.11.20)
4. Start terminal software (e.g. screen /dev/ttyUSB0 57600) on PC
5. Apply power to EVB
6. Interrupt u-boot with keypress of "1"
7. At u-boot prompts:
Input device IP (10.10.10.123) ==:192.168.11.21
Input server IP (10.10.10.3) ==:192.168.11.20
Input Linux Kernel filename (root_uImage) ==:openwrt-ramips-mt76x8-skw92a-initramfs-kernel.bin
8. Move ethernet to port 0 (WAN) on EVB
9. At new OpenWrt console shell, fetch squashfs-sysupgrade image and flash
with sysupgrade.
>From U-boot via TFTP direct flash:
1. Place openwrt-ramips-mt76x8-skw92a-squashfs-sysupgrade.bin on a TFTP server
2. Connect to serial console at USB3 on EVB (57600 8N1)
3. Connect ethernet between port 1 (not WAN) an your TFTP server (e.g.
192.168.11.20)
4. Start terminal software (e.g. screen /dev/ttyUSB0 57600) on PC
5. Apply power to EVB
6. Interrupt u-boot with keypress of "2"
7. At u-boot prompts:
Warning!! Erase Linux in Flash then burn new one. Are you sure?(Y/N) Y
Input device IP (10.10.10.123) ==:192.168.11.21
Input server IP (10.10.10.3) ==:192.168.11.20
Input Linux Kernel filename (root_uImage) ==:openwrt-ramips-mt76x8-skw92a-squashfs-sysupgrade.bin
8. When transfer is complete or as OpenWrt begins booting, move ethernet to
port 0 (WAN).
Signed-off-by: Russell Senior <russell@personaltelco.net>
6 years ago
|
|
|
lan_mac=$(mtd_get_mac_binary factory 40)
|
|
|
|
wan_mac=$(mtd_get_mac_binary factory 46)
|
|
|
|
;;
|
|
|
|
tew-691gr)
|
|
|
|
wan_mac=$(macaddr_add "$(mtd_get_mac_binary factory 4)" 3)
|
|
|
|
;;
|
|
|
|
tew-692gr)
|
|
|
|
wan_mac=$(macaddr_add "$(mtd_get_mac_binary factory 4)" 1)
|
|
|
|
;;
|
|
|
|
tiny-ac)
|
|
|
|
lan_mac=$(mtd_get_mac_ascii u-boot-env LAN_MAC_ADDR)
|
|
|
|
wan_mac=$(mtd_get_mac_ascii u-boot-env WAN_MAC_ADDR)
|
|
|
|
;;
|
|
|
|
vr500)
|
|
|
|
lan_mac=$(mtd_get_mac_binary factory 57344)
|
|
|
|
wan_mac=$(mtd_get_mac_binary factory 57350)
|
|
|
|
;;
|
|
|
|
w306r-v20)
|
|
|
|
lan_mac=$(cat /sys/class/net/eth0/address)
|
|
|
|
wan_mac=$(macaddr_add "$lan_mac" 5)
|
|
|
|
;;
|
|
|
|
wcr-1166ds|\
|
|
|
|
wsr-1166)
|
|
|
|
local index="$(find_mtd_index "board_data")"
|
|
|
|
wan_mac="$(grep -m1 mac= "/dev/mtd${index}" | cut -d= -f2)"
|
|
|
|
lan_mac=$wan_mac
|
|
|
|
;;
|
|
|
|
wcr-150gn)
|
|
|
|
wan_mac=$(mtd_get_mac_binary factory 40)
|
|
|
|
;;
|
|
|
|
whr-1166d|\
|
|
|
|
whr-300hp2|\
|
|
|
|
whr-600d|\
|
|
|
|
wsr-600)
|
|
|
|
wan_mac=$(mtd_get_mac_binary factory 4)
|
|
|
|
lan_mac=$wan_mac
|
|
|
|
;;
|
|
|
|
wizfi630a)
|
|
|
|
lan_mac=$(mtd_get_mac_binary factory 4)
|
|
|
|
wan_mac=$(mtd_get_mac_binary factory 40)
|
|
|
|
;;
|
|
|
|
wlr-6000)
|
|
|
|
wan_mac=$(macaddr_add "$(mtd_get_mac_binary factory 32772)" 2)
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
lan_mac=$(cat /sys/class/net/eth0/address)
|
|
|
|
wan_mac=$(macaddr_add "$lan_mac" 1)
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
[ -n "$lan_mac" ] && ucidef_set_interface_macaddr "lan" $lan_mac
|
|
|
|
[ -n "$wan_mac" ] && ucidef_set_interface_macaddr "wan" $wan_mac
|
|
|
|
}
|
|
|
|
|
|
|
|
board_config_update
|
|
|
|
board=$(board_name)
|
|
|
|
ramips_setup_interfaces $board
|
|
|
|
ramips_setup_macs $board
|
|
|
|
board_config_flush
|
|
|
|
|
|
|
|
exit 0
|