Commit Graph

210 Commits (08d9828b767a3555ed655392725a7fb7d633ee8c)

Author SHA1 Message Date
Maxim Anisimov 08d9828b76 ramips: fix leds for TP-Link Archer C20 v4
- add "gpio" group for wan_orange led
- use tpt triggers for wifi led indication
- add wifi 5 GHz led support

Signed-off-by: Maxim Anisimov <maxim.anisimov.ua@gmail.com>
[slight commit message adjustment, backport]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
(cherry picked from commit 3a538db60a)
4 years ago
David Bauer 80e0b97d07 ramips: convert TP-Link MT7620 boards to tpt trigger
This converts all MediaTek MT7620 boards from TP-Link to use the now
supported WiFi throughput LED trigger. This way, the LED state now
covers all VAPs regardless of their name.

Also align all single-WiFi LEDs to represent the state of the 2.4GHz
radio. This was not always the case previously, as later-added support
for the MT7610 altered the phy probing order.

Signed-off-by: David Bauer <mail@david-bauer.net>
(cherry picked from commit 1e7c6381f0)
4 years ago
David Bauer 7ab5dc77b2 ramips: add LED trigger for TL-WR902AC v3 WAN LED
This adds an LED trigger for the WAN LED on top of the TP-Link
TL-WR902AC v3. Currently, only the LED on the port itself shows the link
state, while the LED on top of the device stays dark.

The WAN port of the device is a hybrid LAN/WAN one, hence why the LED at
the port was labled LAN.

Signed-off-by: David Bauer <mail@david-bauer.net>
(cherry picked from commit c48b571ad7)
4 years ago
Sungbo Eo 08c850f046 ramips: fix USB LED for Belkin F9K1109v1
Device support for Belkin F9K1109v1 was added using set_usb_led()
although this was removed in 772b27c207 ("ramips: set F5D8235 v1
usb led trigger via devicetree").

Use ucidef_set_led_usbport() instead.

Fixes: f2c83532f9 ("ramips: add support for Belkin F9K1109v1")

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
[rephrase commit title and message, backport]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
(cherry picked from commit 1f455418ef)
4 years ago
Piotr Dymacz c515cd7c34 ramips: add support for ALFA Network R36M-E4G
ALFA Network R36M-E4G is a dual-SIM, N300 Wi-Fi, compact size platform
based on MediaTek MT7620A WiSoC. This product is designed for operation
with 4G modem (can be bought in bundle with Quectel EC25, EG25 or EP06)
but supports also Wi-Fi modules (miniPCIe slot has USB and PCIe buses).

Specification:

- MT7620A (580 MHz)
- 64/128/256 MB of RAM (DDR2)
- 16/32+ MB of FLASH (SPI NOR)
- 2x 10/100 Mbps Ethernet, with passive PoE support (24 V)
- 2T2R 2.4 GHz (MT7620A), with ext. LNA (RFFM4227)
- 1x miniPCIe slot (with PCIe and USB 2.0 buses and optional 5 V)
- 2x SIM slot (mini, micro) with detect and switch driven by GPIO
- 2x u.fl antenna connectors (for Wi-Fi)
- 8x LED (7 driven by GPIO)
- 2x button (reset, wifi)
- 2x UART (4-pin/2.54 mm pitch, 10-pin/1.27 mm pitch) headers on PCB
- 1x I2C (4-pin, 1.27 mm pitch) header on PCB
- 1x LED (8-pin, 1.27 mm pitch) header on PCB
- 1x DC jack with lock (12 V)

Other:

- there is a dedicated, 4-pin connector for optional RTC module (Holtek
  HT138x) with 'enable' input, not available at the time of preparing
  support for this board
- miniPCIe slot supports additional 5 V supply on pins 47 and 49 but a
  jumper resistor (R174) is not installed by default
- U-Boot selects default SIM slot, based on value of 'default_sim' env
  variable: '1' or unset -> SIM1 (mini), '2' -> SIM2 (micro). This will
  work only if both slots are occupied, otherwise U-Boot will always
  select slot with SIM card inside (user can override it later, in
  user-space)
- U-Boot resets the modem, using PERSTn signal, before starting kernel
- this board supports 'dual image' feature (controlled by 'dual_image'
  U-Boot environment variable)

Flash instruction:

You can use the 'sysupgrade' image directly in vendor firmware which is
based on OpenWrt (make sure to not preserve settings - use 'sysupgrade
-n -F ...' command). Alternatively, use web recovery mode in U-Boot:

1. Power the device with reset button pressed, the modem LED will start
   blinking slowly and after ~3 seconds, when it starts blinking faster,
   you can release the button.
2. Setup static IP 192.168.1.2/24 on your PC.
3. Go to 192.168.1.1 in browser and upload 'sysupgrade' image.

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
(backported from commit dfecf94c20)
5 years ago
David Bauer f057133349 ramips: use phy trigger for various Netgear boards
This commit switches the default trigger for the WiFi LED from a netdev
trigger on "wlan0" to a wireless-phy based trigger. THis allows the LED
to work, even when the wireless interface is not named "wlan0" without
modifiying the LED settings.

Signed-off-by: David Bauer <mail@david-bauer.net>
(cherry picked from commit fa46c9b208)
5 years ago
Kristian Evensen 86b6d31e6e ramips: Remove redundant LED-cases
01_leds has several redundant LED-cases. This commit cleans
up the file by merging these cases into shared cases.

Signed-off-by: Kristian Evensen <kristian.evensen@gmail.com>
5 years ago
Jan Hoffmann 085f66de9a ramips: create R6220 dtsi and improve WNDR3700v5 support
The R6220 and WNDR3700v5 are identical apart from using NAND/NOR flash and
having a different casing. This adds a new cleaned up R6220.dtsi with the
common bits for both devices. Both devices now have feature parity.

Performed cleanup:
 * generic DTS node names
 * regulator for usb power
 * added missing pinctrl groups
 * use switch port instead of VLAN as trigger for WAN LED

Fixes for WNDR3700v5:
 * all LEDS work
 * correct ethernet MAC addresses

Signed-off-by: Jan Hoffmann <jan@3e8.eu>
5 years ago
Davide Fioravanti 7c91144ae6 ramips: add CUDY WR1000 support
Cudy WR1200 is an AC1200 AP with 3-port FE and 2 non-detachable antennas

Specifications:

MT7628 (580 MHz)
64 MB of RAM (DDR2)
8 MB of FLASH
2T2R 2.4 GHz (MT7628)
2T2R 5 GHz (MT7612E)
3x 10/100 Mbps Ethernet (2 LAN + 1 WAN)
2x external, non-detachable antennas (5dbi)
UART header on PCB (57600 8n1)
7x LED, 2x button

Known issues:
The Power LED is always ON, probably because it is connected
directly to power.

Flash instructions
------------------
Load the ...-factory.bin image via the stock web interface.

Openwrt upgrade instructions
----------------------------
Use the ...-sysupgrade.bin image for future upgrades.

Revert to stock FW
------------------
Warning! This tutorial will work only with the following OEM FW:
  WR1000_EU_92.122.2.4987.201806261618.bin
  WR1000_US_92.122.2.4987.201806261609.bin
If in the future these firmwares will not be available anymore,
you have to find the new XOR key.

1) Download the original FW from the Cudy website.

   (For example WR1000_EU_92.122.2.4987.201806261618.bin)

2) Remove the header.

   dd if="WR1000_EU_92.122.2.4987.201806261618.bin" of="WR1000_EU_92.122.2.4987.201806261618.bin.mod" skip=8 bs=64

3) XOR the new file with the region key.

   FOR EU: 7B76741E67594351555042461D625F4545514B1B03050208000603020803000D
   FOR US: 7B76741E675943555D5442461D625F454555431F03050208000603060007010C

   You can use OpenWrt's tools/firmware-utils/src/xorimage.c tool for this:

   xorimage -i WR1000..bin.mod -o stock-firmware.bin -x -p 7B767..

   Or, you can use this tool (CHANGE THE XOR KEY ACCORDINGLY!):
   https://gchq.github.io/CyberChef/#recipe=XOR(%7B'option':'Hex','string':''%7D,'',false)

4) Check the resulting decrypted image.

   Check if bytes from 0x20 to 0x3f are:
   4C 69 6E 75 78 20 4B 65 72 6E 65 6C 20 49 6D 61 67 65 00 00 00 00 00 00 00 00 00 00 00 00 00 00

   Alternatively, you can use u-boot's tool dumpimage tool to check
   if the decryption was successful. It should look like:

   # dumpimage -l stock-firmware.bin
   Image Name:   Linux Kernel Image
   Created:      Tue Jun 26 10:24:54 2018
   Image Type:   MIPS Linux Kernel Image (lzma compressed)
   Data Size:    4406635 Bytes = 4303.35 KiB = 4.20 MiB
   Load Address: 80000000
   Entry Point:  8000c150

5) Flash it via forced firmware upgrade and don't "Keep Settings"

   CLI: sysupgrade -F -n stock-firmware.bin

   LuCI: make sure to click on the "Keep settings" checkbox
         to disable it. You'll need to do this !TWICE! because
         on the first try, LuCI will refuse the image and reset
	 the "Keep settings" to enable. However a new
         "Force upgrade" checkbox will appear as well.
         Make sure to do this very carefully!

Signed-off-by: Davide Fioravanti <pantanastyle@gmail.com>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
[added wifi compatible, spiffed-up the returned to stock instructions]
5 years ago
Liu Yu 671c9d16e3 ramips: add support for HILINK HLK-7628N
Specification:

CPU:       MT7628 580 MHz. MIPS 24K
RAM:       128 MB
Flash:     32 MB
WIFI:      802.11n/g/b 20/40 MHz
Ethernet:  5 Port ethernet switch
UART:      2x

Flash instruction:
The U-boot is based on Ralink SDK so we can flash the firmware using UART:
1. Configure PC with a static IP address and setup an TFTP server.
2. Put the firmware into the tftp directory.
3. Connect the UART0 line as described on the PCB.
4. Power up the device and press 2, follow the instruction to
   set device and tftp server IP address and input the firmware
   file name. U-boot will then load the firmware and write it into
   the flash.
5. After firmware is started connect via ethernet at 192.168.1.1

Signed-off-by: Liu Yu <f78fk@live.com>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com> [removed dupped subject]
5 years ago
Kristian Evensen 869376710d ramips: Add support for ZBT WE826-E
ZBT WE826-E is a dual-SIM version of the ZBT WE826. The router has the
following specifications:

- MT7620A (580 MHz)
- 128MB RAM
- 32MB of flash (SPI NOR)
- 5x 10/100Mbps Ethernet (MT7620A built-in switch)
- 1x microSD slot
- 1x miniPCIe slot (only USB2.0 bus)
- 2x SIM card slots (standard size)
- 1x USB2.0 port
- 1x 2.4GHz wifi (rt2800)
- 10x LEDs (4 GPIO-controlled)
- 1x reset button

The following have been tested and working:
- Ethernet switch
- wifi
- miniPCIe slot
- USB port
- microSD slot
- sysupgrade
- reset button

Installation and recovery:

In order to install OpenWRT the first time or recover the router, you
can use the web-based recovery system. Keep the reset button pressed
during boot and access 192.168.1.1 in your browser when your machine
obtains an IP address.  Upload the firmware to start the recovery
process.

How to swap SIMs:

You control which SIM slot to use by writing 0/1 to
/sys/class/gpio/gpio13/value. In order for the change to take effect,
you can either use AT-commands (AT+CFUN) or power-cycle the modem (write
0/1 to /sys/class/gpio/gpio14/value).

Signed-off-by: Kristian Evensen <kristian.evensen@gmail.com>
5 years ago
Kristian Evensen 52b59a984f ramips: Add support for Head Weblink HDRM200
Head Weblink HDRM200 is a dual-sim router based on MT7620A. The detailed
specifications are:

- MT7620A (580MHz)
- 64MB RAM
- 16MB of flash (SPI NOR)
- 6x 10/100Mbps Ethernet (MT7620A built-in switch)
- 1x microSD slot
- 1x miniPCIe slot (only USB2.0 bus). Device is shipped with a SIMCOM
SIM7100E LTE modem.
- 2x SIM slots (standard size)
- 1x USB2.0 port
- 1x 2.4GHz wifi (rt2800)
- 1x 5GHz wifi (mt7612)
- 1x reset button
- 1x WPS button
- 3x GPIO-controllable LEDs
- 1x 10 pin terminal block (RS232, RS485, 4 x GPIO)

Tested:
- Ethernet switch
- Wifi
- USB slot
- SD card slot
- miniPCIe-slot
- sysupgrade
- reset button

Installation instructions:

Installing OpenWRT for the first time requires a bit of work, as the
board does not ship with OpenWRT. In addition, the bootloader
automatically reboots when installing an image over tftp. In order to
install OpenWRT on the HDRM200, you need to do the following:

* Copy the initramfs-image to your tftp-root (default filename is
test.bin) and configure networking accordingly (default server IP is
10.10.10.3, client 10.10.10.123). Start your tftp server.
* Open the board and connect to UART. The pins are exposed and clearly
marked.
* Boot the board and press 1.
* Either use the default filename and client/server IP-addresses, or
specify your own.

The image should now be loaded to memory and board boot. If the router
reboots while the image is loading, you need to try again. Once the
board has booted, copy the sysupgrade-image to the router and run
sysupgrade in order to install OpenWRT to the flash.

Notes:

- You control which SIM slot to use by writing 0/1 to
/sys/class/gpio/gpio0/value. In order for the change to take
effect, you can either use AT-commands (AT+CFUN) or power-cycle the
modem (write 0/1 to /sys/class/gpio/gpio21/value).
- RS485 is available on /dev/ttyS0.
- RS232 is available on /dev/ttyS1.
- The name of the ioX-gpios map to the labels on the casing.

Signed-off-by: Kristian Evensen <kristian.evensen@gmail.com>
[fixed whitespace issue and merge conflict in target.mk]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
5 years ago
Eike Feldmann 9e0fb5a27f ramips: add support for Rakwireless RAK633
It's OEM module with 2*26 pin header, similar to LinkIt Smart 7688 or
Vocore2.

Specification:

CPU:       MT7628 580 MHz. MIPS 24K
RAM:       64 MB
Flash:     8 MB
WIFI:      802.11n/g/b 20/40 MHz
USB:       1x Port USB 2.0
Ethernet:  5 Port ethernet switch
UART:      2x

Installation: Use the installed uboot Bootloader. Connect a serial cable
to serialport 0. Turn power on.  Choose the option: "Load system code
then write to Flash via TFTP".  Choose the local device IP and the TFTP
server IP and the file name of the system image.  After if the
Bootloader will copy the image to the local flash.

Notes: The I2C Kernel module work not correctly. You can send and
receive data. But the command i2cdetect doesn’t work. FS#845

Signed-off-by: Eike Feldmann <eike.feldmann@outlook.com>
[commit subject and message touches, DTS whitespace fixes, wifi LED
rename, pinctrl fixes, network settings fixes, lan/wmac mac addresses,
removed i2c kernel modules]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
5 years ago
Vladimir Kot 58becdb30d ramips: add support for ZyXEL Keenetic Start
Device specification:
- SoC: RT5350F
- CPU Frequency: 360 MHz
- Flash Chip: Winbond 25Q32 (4096 KiB)
- RAM: 32768 KiB
- 5x 10/100 Mbps Ethernet (4x LAN, 1x WAN)
- 1x external, non-detachable antenna
- UART (J1) header on PCB (57800 8n1)
- Wireless: SoC-intergated: 2.4GHz 802.11bgn
- USB: None
- 3x LED, 2x button

Flash instruction:
1. Configure PC with static IP 192.168.1.2/24 and start TFTP server.
2. Rename "openwrt-ramips-rt305x-kn_st-squashfs-sysupgrade.bin"
   to "kstart_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 until power LED start blinking.
4. Router will download file from TFTP server, write it to flash and reboot.

Signed-off-by: Vladimir Kot <vova28rus@gmail.com>
[fixed git commit author and whitespace issues in DTS]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
5 years ago
Ozgur Can Leonard 201d3d1a82 ramips: Xiaomi MIR3G: detect board name from DTS
- Former "mir3g" board name becomes "xiaomi,mir3g".
- Reorder some entries to maintain alphabetical order.
- Change DTS so status LEDs (yellow/red/blue) mimic
  Xiaomi stock firmware: (Section Indicator)
<http://files.xiaomi-mi.co.uk/files/router_pro/router%20PRO%20EN.pdf>
<http://files.xiaomi-mi.co.uk/files/Mi_WiFi_router_3/MiWiFi_router3_EN.pdf>
|Yellow: Update (LED flickering), the launch of the system (steady light);
|Blue: during normal operation (steady light);
|Red: Safe mode (display flicker), system failure (steady light);

Signed-off-by: Ozgur Can Leonard <ozgurcan@gmail.com>
[Added link to similar Router 3 model]
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
5 years ago
INAGAKI Hiroshi 5c11258297 ramips: add support for I-O DATA WN-AC733GR3
I-O DATA WN-AC733GR3 is a 2.4/5 GHz band 11ac router, based on
MediaTek MT7620A.

Specification

- SoC		: MediaTek MT7620A
- RAM		: DDR2 64 MiB
- Flash		: SPI-NOR 8 MiB
- WLAN		: 2.4/5 GHz
  - 2.4 GHz : MT7620A (SoC), 2T2R
  - 5 GHz   : MT7610E, 1T1R
- Ethernet	: 10/100/1000 Mbps (RTL8367RB)
- LED/key	: 4x/4x (2x buttons, 1x slide-switch)
- UART		: through-hole on PCB
  - J1: Vcc, RX, GND, TX from LED side
  - 57600n8

Flash instruction using factory image:

1. Boot WN-AC733GR3 normaly
2. Access to "http://192.168.0.1/" and open firmware update page
("ファームウェア")
3. Select the OpenWrt factory image and click update ("更新") button
to perform firmware update
4. Wait ~150 seconds to complete flashing

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
5 years ago
Ozgur Can Leonard d009033911 ramips: add support for Xiaomi Mi Router 3 Pro
Hardware:

CPU:   MediaTek MT7621AT (2x880MHz)
RAM:   512MB DDR3
FLASH: 256MB NAND
WiFi:  2.4GHz 4x4 MT7615 b/g/n (Needs driver, See Issues!)
WiFI:  5GHz 4x4 MT7615 a/n/ac  (Needs driver, See Issues!)
USB:   1x 3.0
ETH:   1x WAN 10/100/1000 3x LAN 10/100/1000
LED:   Power/Status
BTN:   RESET
UART:  115200 8n1

Partition layout and boot:

Stock Xiaomi firmware has the MTD split into (among others)

- kernel0 (@0x200000)
- kernel1 (@0x600000)
- rootfs0
- rootfs1
- overlay (ubi)

Xiaomi uboot expects to find kernels at 0x200000 & 0x600000
referred to as system 1 & system 2 respectively.
a kernel is considered suitable for handing control over
if its linux magic number exists & uImage CRC are correct.
If either of those conditions fail, a matching sys'n'_fail flag
is set in uboot env & a restart performed in the hope that the
alternate kernel is okay.
If neither kernel checksums ok and both are marked failed, system 2
is booted anyway.

Note uboot's tftp flash install writes the transferred
image to both kernel partitions.

Installation:

Similar to the Xiaomi MIR3G, we keep stock Xiaomi firmware in
kernel0 for ease of recovery, and install OpenWRT into kernel1 and
after.

The installation file for OpenWRT is a *squashfs-factory.bin file that
contains the kernel and a ubi partition. This is flashed as follows:

nvram set flag_try_sys1_failed=1
nvram set flag_try_sys2_failed=0
nvram commit
dd if=factory.bin bs=1M count=4 | mtd write - kernel1
dd if=factory.bin bs=1M skip=4 | mtd write - rootfs0
reboot

Reverting to stock:

The part of stock firmware we've kept in kernel0 allows us to run stock
recovery, which will re-flash stock firmware from a *.bin file on a USB.

For this we do the following:

fw_setenv flag_try_sys1_failed 0
fw_setenv flag_try_sys2_failed 1
reboot

After reboot the LED status light will blink red, at which point pressing
the 'reset' button will cause stock firmware to be installed from USB.

Issues:

OpenWRT currently does not have support for the MT7615 wifi chips. There is
ongoing work to add mt7615 support to the open source mt76 driver. Until that
support is in place, there are closed-source kernel modules that can be used.

See: https://forum.openwrt.org/t/support-for-xiaomi-wifi-r3p-pro/20290/170

Signed-off-by: Ozgur Can Leonard <ozgurcan@gmail.com>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
[02_network remaps, Added link to notes]
5 years ago
Piotr Dymacz 9b6413982c ramips: add support for ALFA Network Tube-E4G
ALFA Network Tube-E4G is an outdoor, dual-SIM LTE Cat. 4 CPE, based on
MediaTek MT7620A, equipped with Quectel EC25 miniPCIe modem.

Specification:

- MT7620A (580 MHz)
- 64/128/256 MB of RAM (DDR2)
- 16/32 MB of flash (SPI NOR)
- 1x 10/100 Mbps Ethernet, with passive PoE support (24 V)
- 1x miniPCIe slot (with PCIe and USB 2.0 buses)
- 2x SIM slot (mini, micro) with detect and switch driven by GPIO
- 1x detachable antenna (modem main)
- 1x internal antenna (modem div)
- 1x GPS passive antenna (optional)
- 5x LED (all driven by GPIO)
- 1x button (reset)
- UART (4-pin, 2.54 mm pitch) header on PCB

Other:

Default SIM slot is selected at an early stage by U-Boot, based on
'default_sim' environment value: 1 or unset = SIM1 (mini), 2 = SIM2
(micro). U-Boot also resets the modem, using #PERST signal, before
starting kernel.

Flash instruction:

You can use the 'sysupgrade' image directly in vendor firmware which is
based on OpenWrt (make sure to not preserve settings - use 'sysupgrade
-n -F ...' command). Alternatively, use web recovery mode in U-Boot:

1. Power the device with reset button pressed, the LAN LED will start
   blinking slowly and after ~3 seconds, when it starts blinking faster,
   you can release the button.
2. Setup static IP 192.168.1.2/24 on your PC.
3. Go to 192.168.1.1 in browser and upload 'sysupgrade' image.

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
5 years ago
Kip Porterfield f2c83532f9 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]
5 years ago
Thomas Vincent-Cross a915ad8464 ramips: use generic board detection for Wavlink WL-WN575A3
Bring Wavlink WL-WN575A3 in line with other Wavlink ramips devices.

Signed-off-by: Thomas Vincent-Cross <me@tvc.id.au>
5 years ago
David Bauer 7bf6b59724 ramips: various Netgear R6120 fixes
The R6120 has no 5GHz WLAN LED, the assigned GPIO in fact controls
the WAN LED.

Renames the LED accordingly in the device-tree.
Removes the 5GHz WLAN LED trigger.
Adds the correct WAN port LED trigger.

----

Currently, the MAC address for the Netgear R6120 is read from the NVRAM
partition. The offset for the MAC address however is not consistent
across devices or firmware versions.

Switch to using the factory partition like all other Netgear devices do.

----

The LAN ports of the R6120 are labled in reverse on the casing.

Adjust LuCI switchport numbering accordingly.

----

The WiFi eeprom offsets for the R6120 are currently wrong (5GHz offset
is bigger than the partition itself).

Fixes poor performance on 2.4 and 5 GHz.

Signed-off-by: David Bauer <mail@david-bauer.net>
5 years ago
INAGAKI Hiroshi f305ce5c35 ramips: add support for I-O DATA WN-AC1167GR
I-O DATA WN-AC1167GR is a 2.4/5 GHz band 11ac router, based on
MediaTek MT7620A.

Specification:

- SoC     : MediaTek MT7620A
- RAM     : DDR2 64 MB
- Flash   : SPI-NOR 8MB
- WLAN    : 2.4/5 GHz, 2T2R
  - 2.4 GHz: MT7620A (SoC)
  - 5 GHz  : MT7612E
- Ethernet: 10/100/1000 Mbps (ext. MT7530)
- LED/key : 4x/3x (2x buttons, 1x slide-switch)
- UART    : through-hole on PCB
  - J2: TX, GND, RX, Vcc from SoC side
  - 115200n8

Flash instruction using factory image:

1. Boot WN-AC1167GR normaly
2. Access to "http://192.168.0.1/" and open firmware update page
("ファームウェア")
3. Select the OpenWrt factory image and click update ("更新") button
to perform firmware update
4. Wait ~150 seconds to complete flashing

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
5 years ago
David Bauer 01dcd574a2 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>
5 years ago
Deng Qingfang 5580a9dd31 ramips: add support for GeHua GHL-R-001
Specs
	SoC: MT7621AT
	RAM: 512MiB
	Flash: 32MiB MX25L25635F SPI NOR
	2.4G: MT7603EN
	5G: MT7612EN
	Ethernet: 4x GE ports (1x WAN, 3x LAN) with link status LEDs
	USB 3.0
	LEDs: POWER, 5G WIFI, 2.4G WIFI, USB, Internet.
	      The last two ones are controlled by GPIO
	UART: There are 2 UARTs (UARTLITE1/ttyS0 and UARTLITE3/ttyS1) on board.
	      UARTLITE1 is close to LEDs, and UARTLITE3 is close to flash chip.
	      The stock u-boot uses UARTLITE1 by default. Baud rate is 57600

Flash instruction
	1. telnet 192.168.9.1 2317, username is "root" and password is "admin"
	   One can alternatively use UART to log in
	2. Put OpenWrt firmware in a FAT32 USB drive, and connect it to the router
	   One can alternatively download the firmware via wget through Internet
	3. mtd write /path/to/openwrt.bin firmware
	4. reboot

Signed-off-by: Deng Qingfang <dengqf6@mail2.sysu.edu.cn>
5 years ago
Simon Quigley 9f0e233576 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>
5 years ago
Weijie Gao 74af8a833a ramips: add support for CreativeBox v1
Hardware:
SoC: MT7621
DRAM: 512MB DDR3
Flash: 32MB SPI-NOR
WiFi 2.4GHz: MT7603 @ PCIe0
WiFi 5.8GHz: MT7612 @ PCIe1
SATA: ASM1061 @ PCIe2

Interfaces:
GBE RJ45 x5
USB3.0 x1
eSATA (with USB2.0) x1
SATA x1
UART x1
I2C x1
JTAG x1

Flash instructions:
Through factory bootloader or firmware web interface

Signed-off-by: Weijie Gao <hackpascal@gmail.com>
5 years ago
NOGUCHI Hiroshi 83a97c53fa ramips: add support for Netgear R6350
Netgear R6350 is a wireless router, aka Netgear AC1750.

Specification:
- SoC: Mediatek MT7621AT (2 CPU cores, 4 threads)
- RAM: 128MiB (Nanya NT5CC64M16GP-DI)
- ROM: 128MiB NAND Flash (Macronix MX30LF1G18AC-TI)
- Wireless:
   for 11b/g/n (upto 300Mbps): MT7603
   for 11a/ac  (upto 1450Mbps) : MT7615, is not avaliable now
- Ethernet LAN speed: up to 1000Mbps
- Ethernet LAN ports: 4
- Ethernet WAN speed: up to 1000Mbps
- Ethernet WAN ports: 1
- USB ports: 1 (USB 2.0)
- LEDs: 4 (all can be controlled by SoC's GPIO)
- buttons: 2
- serial ports: unknown

Installation through telnet:
  - Copy kernel.bin and rootfs.bin to a USB flash disk,
    plug to usb port on the router.
  - Enable telnet with link: http://192.168.1.1/setup.cgi?todo=debug
    (login if required, default: admin password)
  - You will see "Debug Enabled!"
  - Telnet 192.168.1.1 and login with "root"
  - ls /mnt/shares/ to find out path of your USB disk.
    'myUdisk' for example.
  - cd /mnt/shares/myUdisk
  - mtd_write write rootfs.bin Rootfs
  - mtd_write write kernel.bin Kernel
  - reboot

recovery when bricked:
  nmrpflash can be used to recover to the netgear firmware
  if a broken image was flashed.

The SC_PART_MAP partition suggests that an on flash partition table
exists. After implementing a partition parser/builder for the sercom
partition format, the definitions don't match the flash layout used by
the stock firmware.

It either means the partition format has not yet been completely
understood or it isn't used by the stock firmware. For now, use fixed
partitions instead.

Signed-off-by: NOGUCHI Hiroshi <drvlabo@gmail.com>
[apply latest ramips changes and document the on flash partition map
issues]
Signed-off-by: Mathias Kresin <dev@kresin.me>
6 years ago
Deng Qingfang 47381aadd5 ramips: several fixes for HC5x61
- Mark other partitions as read-only for HC5x61

 - Only enable USB and PCIe for HC5761/HC5861
   HC5661 doesn't have a USB port, and there is nothing attached to its PCIe.

 - Fix HC5761 switch ports
   HC5761 has only 3 ethernet ports (1x WAN + 2x LAN). Remove unused ports.

 - Fix HC5861 5GHz radio
   HC5861 has MT7612EN 5GHz WiFi chip, not MT7610EN.

 - Fix HC5761/HC5861 WiFi LEDs
   After 5GHz is enabled, it becomes wlan0. And 2.4GHz would be wlan1.

 - Fix HC5x61 image size
   It should be 15872k (0xf80000)

Signed-off-by: Deng Qingfang <dengqf6@mail2.sysu.edu.cn>
6 years ago
Pawel Dembicki e9a9b7d1ed ramips: add support for D-Link DWR-118-A1
The DWR-118-A1 Wireless Router is based on the MT7620A SoC.

Specification:

- MediaTek MT7620A (580 Mhz)
- 64 MB of RAM
- 16 MB of FLASH
- 1x 802.11bgn radio
- 1x 802.11ac radio (MT7610EN)
- 3x 10/100 Mbps Ethernet (3 LAN)
- 2x 10/100/1000 Mbps ICPlus IP1001 Ethernet PHY (1 WAN AND 1 LAN)
- 1x internal, non-detachable antenna
- 2x external, non-detachable antennas
- 1x USB 2.0
- UART (J1) header on PCB (57600 8n1)
- 7x LED (5x GPIO-controlled), 2x button
- JBOOT bootloader

Known issues:
- WIFI 5G LED not working
- flash is very slow

The status led has been assigned to the dwr-118-a1:green:internet led.
At the end of the boot it is switched off and is available for other
operation. Work correctly also during sysupgrade operation.

Installation:
Apply factory image via http web-gui or JBOOT recovery page

How to revert to OEM firmware:
- push the reset button and turn on the power. Wait until LED start
  blinking (~10sec.)
- upload original factory image via JBOOT http (IP: 192.168.123.254)

Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
6 years ago
Valentín Kivachuk 30a7ab8f61 ramips: add support for MTC Wireless Router WR1201
MTC Wireless Router WR1201 is the OEM name of the board. It is also sold
rebranded as STRONG Dual Band Gigabit Router 1200.

Specification:
- SoC: MediaTek MT7621A (880 MHz)
- Flash: 16 MiB
- RAM: 128 MiB
- Wireless: 2.4Ghz(MT7602EN) and 5Ghz (MT7612EN)
- Ethernet speed: 10/100/1000
- Ethernet ports: 4+1
- 1x USB 3.0
- 1x microSD reader
- Serial baud rate of Bootloader and factory firmware: 57600

The OEM webinterface writes only as much bytes as listed in the
uImage header field to the flash. Also, the OEM webinterface
evaluates the name field of uImage header before flashing (the
string "WR1201_8_128")

To flash via webinterface, is mandatory to use first initramfs.bin
and after (from the OpenWrt) the sysupgrade.bin

Some notes:
- Some microSD will not work:

  mtk-sd 1e130000.sdhci: no support for card's volts
  mmc0: error -22 whilst initialising SDIO card
  mtk-sd 1e130000.sdhci: no support for card's volts
  mmc0: error -22 whilst initialising MMC card
  mtk-sd 1e130000.sdhci: no support for card's volts
  mmc0: error -22 whilst initialising SDIO card
  mtk-sd 1e130000.sdhci: card claims to support voltages below defined range
  mtk-sd 1e130000.sdhci: no support for card's volts
  mmc0: error -22 whilst initialising MMC card
  mtk-sd 1e130000.sdhci: no support for card's volts
  mmc0: error -22 whilst initialising SDIO card
  mtk-sd 1e130000.sdhci: no support for card's volts
  mmc0: error -22 whilst initialising MMC card

Signed-off-by: Valentín Kivachuk <vk18496@gmail.com>
6 years ago
Thomas Vincent-Cross a160f50d4f ramips: add support for Wavlink WL-WN570HA1
This commit adds support for the Wavlink WL-WN570HA1, a dual-band PoE
wireless router with the following specifications:

 - CPU: MediaTek MT7688AN 580MHz
 - Flash: 8MB
 - RAM: 64MB
 - Ethernet: 1x 10/100Mbps
 - 2.4 GHz: 802.11b/g/n SoC, 1T1R, 27 dBm
 - 5 GHz: 802.11a/n/ac MT7610E, 1T1R, 25 dBm
 - Antennas: 2x external (1 per radio), detachable
 - LEDs: 3 programmable + Wi-Fi, WAN/LAN, Power
 - Buttons: Reset

Flashing instructions:

Factory U-boot launches a TFTP client if reset button is pressed during power-on.
Rename the sysupgrade file and configure TFTP as follows:

 - Client (WL-WN570HA1) IP: 192.168.10.101
 - Server IP: 192.168.10.100
 - Filename: firmware.bin

Signed-off-by: Thomas Vincent-Cross <me@tvc.id.au>
[use generic board detection, add firmware partition compatible]
Signed-off-by: Mathias Kresin <dev@kresin.me>
6 years ago
Mathias Kresin e4d9217fe5 ramips: improve BDCOM WAP2100-SK support
Use the generic board detection instead of the target specific one as
all recent additions are doing.

Setup the USB led via devicetree (a58535771f) and include the required
driver by default. Merge the led userspace setting with an existing
identical case.

Use the wps led for boot status indication.

Move the partitions into a partition table node (6031ab345d) and drop
needless labels. Drop misplaced cells properties (53624c1702).

Cleanup the pinmux and only switch pins to gpio functions which a
referenced as gpio in the dts.

Match the maximum image size with the size of the firmware partition.

Signed-off-by: Mathias Kresin <dev@kresin.me>
6 years ago
Mathias Kresin 8ec1a66c34 ramips: improve Skylab SKW92A support
Use the generic board detection instead of the target specific one as
all recent additions are doing.

Add the wireless led according the gpio number from the datasheet.
Rename the board part of the leds to match the name used for the
compatible string. Finally, do not hijack the wps led for boot status
indication longer than necessary.

Merge userspace config into existing cases.

Include the manufacture Name in the dts model string.

Signed-off-by: Mathias Kresin <dev@kresin.me>
6 years ago
Pawel Dembicki 20b09a2125 ramips: add support for Lava LR-25G001
The Lava LR-25G001 Wireless Router is based on the MT7620A SoC.

Specification:

- MediaTek MT7620A (580 Mhz)
- 64 MB of RAM
- 16 MB of FLASH
- 1x 802.11bgn radio
- 1x 802.11ac radio (MT7610EN)
- 5x 10/100/1000 Mbps AR8337 Switch (1 WAN AND 4 LAN)
- 2x external, detachable antennas
- 1x USB 2.0
- UART (J3) header on PCB (57600 8n1)
- 8x LED (3x GPIO-controlled), 2x button
- JBOOT bootloader

Known issues:
- Work only three Gigabit ports (3/5, 1 WAN and 2LAN)

Installation:
Apply factory image via http web-gui or JBOOT recovery page

How to revert to OEM firmware:
- push the reset button and turn on the power. Wait until LED start
  blinking (~10sec.)
- upload original factory image via JBOOT http (IP: 192.168.123.254)

Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
6 years ago
Petr Štetiar 16b950c981 ramips: Add support for ZTE ZXECS EBG3130 aka BDCOM WAP2100-SK
On the bottom sticker it's branded as ZTE ZXECS EBG3130 device, but in factory
OpenWrt image it's referenced as BDCOM WAP2100-SK device.

Specifications:

- SoC: MediaTek MT7620A
- RAM: 128 MB
- Flash: 16 MB
- Ethernet: 5 FE ports
- Wireless radio: 2T2R 2.4 GHz and 1T1R 5 GHz (MT7610EN, unsupported)
- UART: 1 x UART on PCB marked as J2 (R=RX, T=TX, G=GND) with 115200 8N1 config
- LEDs: Power, FE ports 1-5, WPS, USB, RF 2.4G, RF 5G
- Other: USB port, SD card slot and 2x external antennas (non-detachable)

Flashing instructions:

A) The U-Boot has HTTP based firmware upgrade

  A1) Flashing notes

  We've identified so far two different batches of units, unfortunately
  each batch has different U-Boot bootloader flashed with different
  default environment variables, thus each batch has different IP address
  for accessing web based firmware updater.

  * First batch has web based bootloader IP address 1.1.1.1
  * Second batch has web based bootloader IP address 192.168.1.250

  In case you can't connect to either of those IPs, you can try to get
  the default IP address via two methods:

  A1.1) Serial console, then the IP address is visible during the boot

   ...
   HTTP server is starting at IP: 1.1.1.1
   raspi_read: from:40004 len:6
   HTTP server is ready!
   ...

  A1.2) Over telnet/SSH using this command:

   root@bdcom:/# grep ipaddr= /dev/mtd0
   ipaddr=1.1.1.1

  A2) Flashing with browser

  * Change IP address of PC to 1.1.1.2 with 255.255.255.0 netmask
  * Reboot the device and try to reach web based bootloader in the
    browser with the following URL http://1.1.1.1

  * Quickly select the firmware sysupgrade file and click on the
    `Update firmware` button, this all has to be done within 10 seconds,
    bootloader doesn't wait any longer

   If done correctly, the web page should show UPDATE IN PROGRESS page
   with progress indicator. Once the flashing completes (it takes roughly
   around 1 minute), the device will reboot to the OpenWrt firmware

  A3) Flashing with curl

   sudo ip addr add 1.1.1.2/24 dev eth0
   curl \
      --verbose \
      --retry 3 \
      --retry-delay 1 \
      --retry-max-time 30 \
      --connect-timeout 30 \
      --form "firmware=@openwrt-ramips-mt7620-BDCOM-WAP2100-SK-squashfs-sysupgrade.bin" \
      http://1.1.1.1

   Now power on the router.

B) The U-boot is based on Ralink SDK so we can flash the firmware using UART.

   1. Configure PC with a static IP address and setup an TFTP server.
   2. Put the firmware into the tftp directory.
   3. Connect the UART line as described on the PCB (G=GND, R=RX, T=TX)
   4. Power up the device and press 2, follow the instruction to set device and
      tftp server IP address and input the firmware file name. U-boot will then load
      the firmware and write it into the flash.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
6 years ago
Russell Senior e42327aa89 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
Martin Weinelt 0411813c6f
ramips: fix leds on GL.iNet GL-MT300N-V2
The WAN LED now shows the link state. It's color is green,
not blue.

Signed-off-by: Martin Weinelt <hexa@darmstadt.ccc.de>
6 years ago
Mathias Kresin b07b3ddaad ramips: don't hijack the status led
Don't hijack the status led to indicate the wireless state. If we don't
have a dedicated wireless led, it's as simply as the wireless status
can't be indicated.

Such a led misuse should be set by the user and not shipped by default.

Signed-off-by: Mathias Kresin <dev@kresin.me>
6 years ago
Mathias Kresin c074239c79 ramips: move status led unset to devicetree
Release the led used for boot status indication via devicetree instead
of setting a default off trigger in userspace.

Signed-off-by: Mathias Kresin <dev@kresin.me>
6 years ago
Mathias Kresin 772b27c207 ramips: set F5D8235 v1 usb led trigger via devicetree
Assign the usbdev trigger via devicetree and drop the userspace
handling of the usb leds.

Signed-off-by: Mathias Kresin <dev@kresin.me>
6 years ago
Mathias Kresin a58535771f ramips: set usb led trigger via devicetree
Assign the usbdev trigger via devicetree for all subtargets and drop
the userspace handling of the usb leds.

With the change all usb ports are triggering the usb led instead of
only usb 1.1 XOR usb 2.0 XOR usb 3.0 as it was before.

Signed-off-by: Mathias Kresin <dev@kresin.me>
6 years ago
Carlo Nel 6bbb220255 ramips: add support for TP-Link TL-MR3020 v3
TP-Link TL-MR3020 v3 is a pocket-size router based on MediaTek MT7628N.

This PR is based on the work of @meyergru[1], with his permission.

Specification:
- MediaTek MT7628N/N (575 Mhz)
- 64 MB of RAM
- 8 MB of FLASH
- 2T2R 2.4 GHz
- 1x 10/100 Mbps Ethernet

Flash instruction:

The only way to flash the image in TL-MR3020 v3 is to use
tftp recovery mode in U-Boot:

1. Configure PC with static IP 192.168.0.225/24 and tftp server.
2. Rename "openwrt-ramips-mt76x8-tplink_tl-mr3020-v3-squashfs-tftp-recovery.bin"
   to "tp_recovery.bin" and place it in tftp server directory.
3. Connect PC with the LAN port, 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.

[1] https://github.com/meyergru/lede-source/commits/TL-MR3020-V3

Signed-off-by: Carlo Nel <carlojnel@gmail.com>
6 years ago
Mathias Kresin c134210b8f ramips: drop pointless default led definitions
The LEDs should be triggered/lit by any kind of state change instead of
turned on/off unconditional.

If LEDs really need to be turned off by default, it should be done via
the default-state devicetree led property.

The handling of the wndr3700v5 and wt3020 power led is at least
strange. Something is for sure wrong with them. Either the leds are
misnamed, the default off trigger is a typo or the polarity of the
gpios is wrong. Drop the power led from userspace and wait for someone
with access to the hardware to fix it properly.

Signed-off-by: Mathias Kresin <dev@kresin.me>
6 years ago
Mathias Kresin 99045dfc59 ramips: express diag led handling via devicetree
Use the default-state property to express the desired led handling in
the devicetree source file instead of the userspace.

Signed-off-by: Mathias Kresin <dev@kresin.me>
6 years ago
Mathias Kresin 111907e8d3 ramips: remove default on userspace trigger for diag leds
All the LEDs are turned on by diag.sh at the end of the boot process.
No need to do the same via userspace configuration again.

Signed-off-by: Mathias Kresin <dev@kresin.me>
6 years ago
Mathias Kresin 56e6ebdea4 ramips: fix multi colour led handling
All boards either have a multi colour led or a single lightpipe. It
makes it impossible to handle the LEDs individual. Change the LED
config for these boards to take it into account.

Signed-off-by: Mathias Kresin <dev@kresin.me>
6 years ago
Mathias Kresin fe1e90deb4 ramips: rt-n12p: use the boardname helper variable
Use the helper variable for the Asus RT-N12P as it is done by all
boards.

Signed-off-by: Mathias Kresin <dev@kresin.me>
6 years ago
Cezary Jackiewicz 37af596593 ramips: add support for D-Link DWR-118-A2
The DWR-118-A2 Wireless Router is based on the MT7620A SoC.

Specification:

- MediaTek MT7620A (580 Mhz)
- 128 MB of RAM
- 16 MB of FLASH
- 1x 802.11bgn radio
- 1x 802.11ac radio (MT7612EN)
- 4x 10/100 Mbps Ethernet (1 WAN and 3 LAN)
- 1x 10/100/1000 Mbps Marvell Ethernet PHY (1 LAN)
- 2x external, non-detachable antennas
- 1x USB 2.0
- UART (J1) header on PCB (57600 8n1)
- 7x LED (5x GPIO-controlled), 2x button
- JBOOT bootloader

Known issues:
- GELAN not working
- flash is very slow

The status led has been assigned to the dwr-118-a2:green:internet led.
At the end of the boot it is switched off and is available for other
operation. Work correctly also during sysupgrade operation.

Installation:
Apply factory image via http web-gui or JBOOT recovery page

How to revert to OEM firmware:
- push the reset button and turn on the power. Wait until LED start
  blinking (~10sec.)
- upload original factory image via JBOOT http (IP: 192.168.123.254)

Signed-off-by: Cezary Jackiewicz <cezary@eko.one.pl>
Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
6 years ago
Deng Qingfang d20f4fc628 ramips: add support for HiWiFi HC5861B
HiWiFi "Gee Enjoy1200" HC5861B is a dual-band router based on MediaTek MT7628AN
https://www.hiwifi.com/enjoy-view

Specifications:
- MediaTek MT7628AN 580MHz
- 128 MB DDR2 RAM
- 16 MB SPI Flash
- 2.4G MT7628AN 802.11bgn 2T2R 300Mbps
- 5G MT7612EN 802.11ac 2T2R 867Mbps
- 5x 10/100 Mbps Ethernet

Flash instruction:
1. Get SSH access to the router
2. SSH to router with `ssh -p 1022 root@192.168.199.1`, The SSH password is the same as the webconfig one
3. Upload OpenWrt sysupgrade firmware into the router's `/tmp` folder with SCP
4. Run `mtd write /tmp/<filename> firmware`
5. reboot

Everything is working

Signed-off-by: Deng Qingfang <dengqf6@mail2.sysu.edu.cn>
6 years ago
Daniel Gimpelevich 1d3ea7874d ramips: fix BR-6478ACv2 support
The wholesale changes introduced in commit f9b8328 missed this DTS file
because it hadn't been merged yet. This patch brings it in line to match
the other mt7620a devices' DTS files.

Additionally, the Internet LED is now labeled correctly and set to unused
by default, since the WAN interface is not known in every configuration.

Using sysupgrade between images before and after this commit will require
the -F flag.

Tested-by: Rohan Murch <rohan.murch@gmail.com>
Signed-off-by: Daniel Gimpelevich <daniel@gimpelevich.san-francisco.ca.us>
[drop internet led default setting]
Signed-off-by: Mathias Kresin <dev@kresin.me>
6 years ago