Commit Graph

516 Commits (6ba58b7b020c4b793e6fb7a43c8adef070579d8d)

Author SHA1 Message Date
Zoltan HERPAI 58e0673900 ramips: add support for Asus RT-N11P / RT-N12+ / RT-N12E b1
This is a variant of the MT7620N-based Asus routers.

Specifications:

- MT7620N (580 MHz)
- 32 MB RAM
- 8 MB Flash
- 5x 10/100Mbps Ethernet (built-in switch)
- 2.4 GHz WLAN
- 2x external, non-detachable antennas
- UART (J2) header on PCB (115200 8n1)

Flash instructions:

1. Configure PC with static IP 192.168.1.75/24
2. Connect PC with one of LAN ports, press the reset button, power up
   the router and keep button pressed for around 6-7 seconds. All 4 LEDs will
   start to blink, which is when the router will accept firmware files via TFTP.
   No known limitations on firmware filenames, just send it with a TFTP client
   to 192.168.1.1.
3. Router will download file from server, write it to flash and reboot.

Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu>
7 years ago
Felix Fietkau 9996480b0e ramips: add support for ZBT WE3526
This is a variant of the ZBT WG3526 with a few minor modifications.
The wifi chips are swapped, and there is no GPIO controllable status
LED. There is also no SATA port.

Specifications:

- MT7621AT (880 MHz)
- 512 MB RAM
- 16 MB Flash (SPI NOR)
- 5x 1Gbps Ethernet (built-in switch)
- MT7612E 802.11ac 5 GHz WLAN
- MT7603E 802.11n 2.4 GHz WLAN

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Piotr Dymacz fa36bea470 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
Piotr Dymacz 46ab81e405 ramips: add support for UniElec U7621-06
UniElec U7621-06 is a router platform board based on MediaTek MT7621AT.
The device has the following specifications:

- MT7621AT (880 MHz)
- 256/512 MB of RAM (DDR3)
- 8/16/32/64 MB of FLASH (SPI NOR)
- 5x 1 Gbps Ethernet (MT7621 built-in switch)
- 1x ASMedia ASM1061 (for mSATA and SATA)
- 2x miniPCIe slots (PCIe bus only)
- 1x mSATA slot (with USB 2.0 bus for modem)
- 1x SATA
- 1x miniSIM slot
- 1x microSD slot
- 1x USB 3.0
- 12x LEDs (3 GPIO-controlled)
- 1x reset button
- 1x UART header (4-pins)
- 1x GPIO header (30-pins)
- 1x FPC connector for LEDs (20-pin, 0.5 mm pitch)
- 1x DC jack for main power (12 V)

The following has been tested and is working:

- Ethernet switch
- miniPCIe slots (tested with Wi-Fi cards)
- mSATA slot (tested with modem and mSATA drive)
- miniSIM slot
- sysupgrade
- reset button
- microSD slot

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 256MB
RAM/16MB flash version):

sysupgrade -n -F lede-ramips-mt7621-u7621-06-256M-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.

LEDs list (top row, left to right):

- LED_WWAN# (connected with pin 42 in LTE/mSATA slot)
- Power (connected directly to 3V3)
- CTS2_N (GPIO10, configured as "status" LED)
- TXD2 (GPIO11, configured as "led4", without default trigger)
- RXD2 (GPIO12, configured as "led5", without default trigger)
- LED_WLAN# (connected with pin 44 in wifi0 slot)

LEDs list (bottom row, left to right):

- ESW_P0_LED_0
- ESW_P1_LED_0
- ESW_P2_LED_0
- ESW_P3_LED_0
- ESW_P4_LED_0
- LED_WLAN# (connected with pin 44 in wifi1 slot)

Other notes:

1. The board is available with different amounts of RAM and flash. We
have only added support for the 256/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.

2. The manufacturer offers five different wireless cards with MediaTek
chipsets, based on MT76x2, MT7603 and MT7615. Images of the board all
show that the miniPCIe slots are dedicated to specific Wi-Fi cards.
However, the slots are generic.

3. All boards we got access to had the same EEPROM content. The default
firmware reads the Ethernet MAC from offset 0xe000 in factory partition.
This offset only contains 0xffs, so a random MAC will be generated on
every boot of the router. There is a valid MAC stored at offset 0xe006
and this MAC is shown as the WAN MAC in the bootloader. However, it is
the same on all boards we have checked. Based on information provided
by the vendor, all boards sold in small quantities are considered more
as samples for development purposes.

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
Signed-off-by: Kristian Evensen <kristian.evensen@gmail.com>
7 years ago
Robert Marko d0ef27594a ramips: add support for TP-Link TL-WR840N v5
TP-Link TL-WR840N v5 is simple N300 router with 5-port FE switch and
non-detachable antennas, based on MediaTek MT7628NN (aka MT7628N) WiSoC.

Specification:

- MT7628N/N (580 MHz)
- 64 MB of RAM (DDR2)
- 4 MB of FLASH
- 2T2R 2.4 GHz
- 5x 10/100 Mbps Ethernet
- 2x external, non-detachable antennas
- UART (J1) header on PCB (115200 8n1)
- 1x LED (GPIO-controlled), 1x button

* LED in TL-WR840N v5 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.
  Orange LED is registered so you can later use it for your own purposes.

  Flash instruction:

  Unlike TL-WR840N v4 flashing through WEB UI works in v5.
  1. Download lede-ramips-mt76x8-tl-wr840n-v5-squashfs-sysupgrade.bin image.
  2. Go to 192.168.0.1
  3. Flash the sysupgrade image through Firmware upgrade section of WEB UI.
  4. Wait until green LED stops flashing and use the router.

Notes:
TFTP recovery is broken since TP-Link reused bootloader code for v4 and
that does not take into account only 4 MB of flash and bricks the device.
So do not use TFTP Recovery or you will have to rewrite SPI flash.
They fixed it in later GPL code,but it is unknown which version of
bootloader you have.

After manually compiling and flashing bootloader from GPL sources TFTP
recovery works properly.

Signed-off-by: Robert Marko <robimarko@gmail.com>
7 years ago
Edmunt Pienkowsky 9786b53efb ramips: fix Youku-YK1 support
Remove the ephy-pins from the ethernet device tree node. The ephy-pins
are useed to controll the ePHY LEDs and this board doesn't have these.
Instead one of the ePHY pins is used in GPIO mode to control the WAN
LED.

Use the switch LED trigger to control the WAN LED. Move the power LED
handling to diag.sh to show the boot status via this LED.

Add the missing kernel packages for USB and microSD card reader to the
default package selection.

Fix the maximum image size value. The board has a 32MByte flash chip.

Fixes: FS#1055

Signed-off-by: Edmunt Pienkowsky <roed@onet.eu>
[make the commit message more verbose, remove GPIO pinmux for pins not
used as GPIOs]
Signed-off-by: Mathias Kresin <dev@kresin.me>
7 years ago
Daniel Kucera 6f008af3f0 ramips: add support for Kimax U25AWF-H1
Kimax U-25AWF-H1 is is a 2,5" HDD Enclosure with Wi-Fi/Eth conection
and battery, based on MediaTek MT7620A.

Patch rewritten from: https://forum.openwrt.org/viewtopic.php?pid=305643

Specification:

- MT7620A CPU
- 64 MB of RAM
- 16 MB of FLASH
- 802.11bgn WiFi
- 1x 10/100 Mbps Ethernet
- USB 2.0 Host
- UART for serial console

Flash instruction:
1. Download lede-ramips-mt7620-u25awf-h1-squashfs-sysupgrade.bin
2. Open webinterface a upgrade
3. After boot connect via ethernet to ip 192.168.1.1

Signed-off-by: Daniel Kucera <daniel.kucera@gmail.com>
[fix reset button gpio, don't add a lan/wan vlan config for single
port board, add -H1 suffix do make sure that this revision of the
board is supported/tested]
Signed-off-by: Mathias Kresin <dev@kresin.me>
7 years ago
Kevin Darbyshire-Bryant f2107fc328 ramips: improve Xiaomi Mi Router 3G support
This commit improves support for the Xiaomi Mi Router 3G originally
added in commit 6e283cdc0d

Improvements:

- Remove software watchdog as hardware watchdog now working as per
  commit 3fbf3ab44f 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
Maxim Anisimov 161a3be5ad ramips: add support for TP-Link Archer C20 v1
TP-Link Archer C20 v1 is a router with 5-port FE switch and
non-detachable antennas. It's very similiar to TP-Link Archer C50.
Also it's based on MediaTek MT7620A+MT7610EN.

Specification:
- MediaTek MT7620A (580 Mhz)
- 64 MB of RAM
- 8 MB of FLASH
- 2T2R 2.4 GHz and 1T1R 5 GHz
- 5x 10/100 Mbps Ethernet
- 2x external, non-detachable antennas
- UART (J1) header on PCB (115200 8n1)
- 8x LED (GPIO-controlled*), 2x button, power input switch
- 1 x USB 2.0 port

* WAN LED in this devices 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 blue part of the LED.
* MT7610EN ac chip isn't not supported by LEDE. Therefore 5Ghz won't
  work.

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.

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. So, to flash this device we must
to prepare image using original firmware from tp-link site with uboot.

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.
There are two ways to flash the device to LEDE:

1) Using tftp mode with UART connection and original LEDE image

 - Place lede-ramips-mt7620-ArcherC20-squashfs-factory.bin in tftp
   server directory
 - Configure PC with static IP 192.168.0.66/24 and tftp server.
 - Connect PC with one of LAN ports, power up the router and press
   key "4" to access U-Boot CLI.
 - Use the following commands to update the device to LEDE:

    setenv serverip 192.168.0.66
    tftp 0x80060000 lede-ramips-mt7620-ArcherC20-squashfs-factory.bin
    erase tplink 0x20000 0x7a0000
    cp.b 0x80060000 0x20000 0x7a0000
    reset

 - After that the device will reboot and boot to LEDE

2) Using tftp mode without UART connection but require some
   manipulations with target image

 - Download and unpack TP-Link Archer C20 v1 firmware from original web
   site
 - Split uboot.bin from original firmware by this command (example):

    dd if=Archer_C20v1_0.9.1_4.0_up_boot(160427)_2016-04-27_13.53.59.bin of=uboot.bin bs=512 count=256 skip=1

 - Create ArcherC20V1_tp_recovery.bin using this command:

    cat uboot.bin lede-ramips-mt7620-ArcherC20-squashfs-factory.bin > ArcherC20V1_tp_recovery.bin

 - Place ArcherC20V1_tp_recovery.bin in tftp server directory.
 - Configure PC with static IP 192.168.0.66/24 and tftp server.
 - 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.
 - Router will download file from server, write it to flash and reboot.

Signed-off-by: Maxim Anisimov <maxim.anisimov.ua@gmail.com>
7 years ago
David Yang fb128057da ramips: fix hg255d LED status support
Use the green power LED for boot status indication.

Source: https://my.oschina.net/osbin/blog/278782 Para 3

Signed-off-by: David Yang <mmyangfl@gmail.com>
7 years ago
Kristian Evensen 79440ea756 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
Kristian Evensen 80829022b0 ramips: add support for the HNET C108
The HNET C108
(http://www.szhwtech88.com/Product-product-cid-100-id-4374.html) is a
mifi based on MT7602A, which has the following specifications:

* CPU: MT7620A
* 1x 10/100Mbps Ethernet.
* 16 MB Flash.
* 64 MB RAM.
* 1x USB 2.0 port. Only power is connected, this port is meant for
charging other devices.
* 1x mini-PCIe slots.
* 1x SIM slots.
* 1x 2.4Ghz WIFI.
* 1x button.
* 6000 mAh battery.
* 5x controllable LEDs.

Works:
* Wifi.
* Switch.
* mini-PCIe slot. Only tested with a USB device (a modem).
* SIM slot.
* Sysupgrade.
* Button (reset).

Not working (also applies to the factory firmware):
* Wifi LED. It is always switched on, there is no relation to the
up/down state or activity of the wireless interface.

Not tested:
* SD card reader.

Notes:
* The C108 has no dedicated status LED. I therefore set the LAN LED as
status LED.

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 C108 supports recovery using TFTP. Keep the
reset button pressed for ~5sec when booting to trigger TFTP. Set the
address of the network interface on your machine to 10.10.10.3/24, and
rename your image file to Kernal.bin.

Signed-off-by: Kristian Evensen <kristian.evensen@gmail.com>
7 years ago
Kristian Evensen f3b4e50cee ramips: fix default LED configuration
Commit 77645ffcd9 ("ramips: add support for the GnuBee Personal Cloud
One") dropped the execution permission from 01_leds with the result
that the file isn't started during first boot and no default LED
configuration is added.

Revert the introduced file permission change.

Fixes: FS#979

Signed-off-by: Kristian Evensen <kristian.evensen@gmail.com>
[cherry picked the fix from a board support patch]
Signed-off-by: Mathias Kresin <dev@kresin.me>
7 years ago
Pavel Kubelun 6e283cdc0d ramips: add Xiaomi Mi Router 3G support
This commit adds support for Xiaomi Mi WiFi Router 3G.

Short specification:
 - MT7621AT + MT7603EN + 7612EN
 - 256MB DDR3 RAM
 - 128MB NAND flash
 - 1+2 x 1000M Ethernet
 - 1x USB 3.0 port
 - reset button
 - yellow, blue, red leds

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: mtd erase kernel0
- run: reboot

Originally stock firmware has following partitions:
 - ...
 - kernel0 (primary kernel image)
 - kernel1 (secondary kernel image, used by u-boot in failsafe routine)
 - rootfs0 (primary rootfs)
 - rootfs1 (secondary rootfs in case primary fails)
 - overlay (used as ubi overlay)

This commit squashes rootfs0, rootfs1 and overlay partitions into 1, so
it can be used by LEDE fully for package installation, resulting in 117,5MiB.

This device lacks hw watchdog, so adding softdog instead (stock does the same).

Signed-off-by: Pavel Kubelun <be.dissent@gmail.com>
7 years ago
L. D. Pinney df3295f50e ramips: add support for the VoCore2 Lite
The VoCore2 Lite uses the same PCB as the Vocore2.
This patch moves the common VoCore2 parts into dtsi.

Removed memory node in the device tree source file.
Memory is detected automatically.

http://vocore.io/
http://vonger.net/
http://vonger.cn/

Specifications:
- SoC: MediaTek MT7688AN
- RAM: 64MB DDR2 EtronTech EM68B16CWQH-25H
- Flash: 8MB NOR SPI Flash GigaDevice GD25Q64CWIG
- Wireless: Built into MT7688AN with onboard IPEX connector

Firmware installation:
- VoCore2-Lite ships with firmware forked from OpenWrt.
- Installation from the bootloader is recommended.
- If using luci/sysupgrade use the -n option (do not keep settings)
  original firmware uses a modified proprietary MediaTek wireless driver.
- The wireless is disabled by default in LEDE.
- If reverting to factory firmware using the bootloader is recommended.

Signed-off-by: L. D. Pinney <ldpinney@gmail.com>
Tested by: Noble Pepper <noblepepper@gmail.com>
7 years ago
Thibaut VARENE 1780d40f2b ramips: cleanup EX2700 and WN3000RPv3 LEDs
This patch cleans up the WN3000RPv3 and EX2700 setup, bringing it in line
with other similar devices:

The power led is a bicolor one. The bootloader brings the red side on at
powerup.

Instead of blinking the red side in diag.sh and need to forcefully turn it off
in 01_leds, this patch simplifies the setup by relying on the default off state
of the gpio-led driver for the red side and blinking the green side as with
other devices.

Signed-off-by: Thibaut VARENE <hacks@slashdirt.org>
7 years ago
Mathias Kresin b82ac84229 ramips: drop AsiaRF AWM003 eval board
Everything is identical to the AWM002 8m eval board. No need to
duplicate it once more.

Signed-off-by: Mathias Kresin <dev@kresin.me>
7 years ago
Mathias Kresin 60f6c2b2eb ramips: drop Edimax BR-6425 support
Code to build an image for the Edimax BR-6425 never existed.

Signed-off-by: Mathias Kresin <dev@kresin.me>
7 years ago
Thibaut VARENE a6f6f8df23 ramips: Archer C50v1: fix power led
01_leds had a workaround for the power led to compensate for the
inverted GPIO state. This patch was missing from my previous commit.

Signed-off-by: Thibaut VARENE <hacks@slashdirt.org>
[add the power led default-state which was omitted in the last commit
by me]
Signed-off-by: Mathias Kresin <dev@kresin.me>
7 years ago
Thibaut VARENE 5d7e23f5ad ramips: Archer C50v1: fix switch port numbering
Luci shows switch ports in wrong order on that device.
This patch fixes switch port numbering and matches them to the device
silkscreen.

Signed-off-by: Thibaut VARENE <hacks@slashdirt.org>
7 years ago
Oliver Fleischmann a92c64e8ae 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
L. D. Pinney 77645ffcd9 ramips: add support for the GnuBee Personal Cloud One
The GnuBee Personal Cloud One crowdfunded on https://www.crowdsupply.com
    It is a low-cost, low-power, network-attached storage device.

    Specifications:

    - SoC: MediaTek MT7621AT
    - RAM: DDR3 512 MB
    - Flash: 32 MB
    - Six SATA ports for 2.5" Drives
    - One micro SDcard
    - One USB 3.0
    - Two USB 2.0
    - Gigabit Ethernet: 1 x WAN and 1 x LAN
    - UART 3.5mm Audio Jack or 3 pin header - 57600 8N1
    - Four GPIOs available on a pin header

    Flash instructions:

    The GnuBee Personal Cloud One ships with libreCMC installed.
    libreCMC is a Free Software Foundation approved fork of LEDE/OpenWrt.
    As such one can upgrade using the webinterface or sysupgrade.

    Das U-Boot has multiple options for recovery or updates including :

    - USB
    - http
    - tftp

Signed-off-by: L. D. Pinney <ldpinney@gmail.com>
[use switchdev led trigger, all interfaces are in vlan1; rename leds
according to board.d setting; remove ge2 group from the pinmux, this
group doesn't exist in the driver]
Signed-off-by: Mathias Kresin <dev@kresin.me>
7 years ago
Thibaut VARENE 4faf314933 ramips: DIR-860L-B1 fix switch port numbering
Luci shows switch ports in inverted order on that device.
This patch fixes switch port numbering and matches them to the device
silkscreen.

Signed-off-by: Thibaut VARENE <hacks@slashdirt.org>
7 years ago
Alex Maclean f683385e73 ramips: add support for TP-Link RE350
The TP-Link RE350 is a wall-wart AC1200 range extender/access point with
a single gigabit ethernet port and two non-detachable antennas, based on
the MT7621A SoC with MT7603E and MT7612E radios.

Firmware wise it is very similar to the QCA based RE450.

SoC: MediaTek MT7621A (880MHz)
Flash: 8MiB (Winbond W25Q64)
RAM:   64MiB (DDR2)
Ethernet: 1x 1Gbit
Wireless: 2T2R 2.4Ghz (MT7603E) and 5GHz (MT7612E)
LEDs: Power, 2.4G, 5G (blue), WPS (red and blue), ethernet link/act
(green)
Buttons: On/off, LED, reset, WPS

Serial header at J1, 57600 8n1:
Pin 1 TX
Pin 2 RX
Pin 3 GND
Pin 4 3.3V

Factory image can be uploaded directly through the stock UI.

Signed-off-by: Alex Maclean <monkeh@monkeh.net>
7 years ago
Chuanhong Guo a4c84b2d73 ramips: add support for Phicomm K2P
It uses one MT7615D radio chip with DBDC mode enabled. This mode allows
this single chip act as an 2x2 11n radio and an 2x2 11ac radio at the
same time. However mt76 doesn't  support it currently so there is no
wireless available.

Specification:
- SoC: MediaTek MT7621AT
- Flash: 16 MB
- RAM: 128 MB
- Ethernet: 1 x WAN (10/100/1000Mbps) and 4 x LAN (10/100/1000 Mbps)
- Wireless radio: MT7615D on PCIE0
- UART: 1 x UART on PCB - 57600 8N1

Issue:
- Wireless radio doesn't work due to the lack of driver.

Flash instruction:
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.
4. Power up the device and press 2,then 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: Chuanhong Guo <gch981213@gmail.com>
7 years ago
Mathias Kresin f12a32630f treewide: use the generic board_name function
Use the generic function instead ot the target specific ones.

Signed-off-by: Mathias Kresin <dev@kresin.me>
7 years ago
John Marrett 4531bc4267 ramips: fix GL-inet GL-MT300N-V2 WAN/LAN MAC address
Correct MAC address lookup to appropriate offset based on vendor
source.

Override the WAN MAC to use the same address as LAN. The switch driver
increments the base MAC address for the WAN vlan but the stock firmware
uses the same MAC address for all interfaces.

Based on vendor source commit
https://github.com/domino-team/lede-1701/commit/efb0518

Signed-off-by: John Marrett <johnf@zioncluster.ca>
7 years ago
Piotr Dymacz 24043a0d2e 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>
7 years ago
Mathias Kresin 3ccca56eb0 ramips: remove optional ucidef_set_led_rssi parameters
The same values are set if the parameters are not specified.

Signed-off-by: Mathias Kresin <dev@kresin.me>
7 years ago
Pavlo Samko 82f9486142 ramips: add support for TRENDnet TEW-638APB V2
This patch add support for the TRENDnet TEW-638APB V2.

Specification:
- SoC: Ralink SoC RT3052F
- Flash: 4MB
- RAM: 32MB
- Ethernet: 1x LAN (100 Mbps)
- Wireless: 2.4GHz b/g/n, 2x external antenna
- Buttons: 1x Reset, 1x WPS
- LEDs: Power (green), Ethernet (green), WPS (green and orange),
  Wireless (green)
- UART: 1x UART on PCB (3.3V, GND, RX, TX) - 57600 8N1

Installation

via vendor firmware:
- upload sysupgrade.bin image

via TFTP:
- stop uboot into tftp-load into option "2"
- upload sysupgrade.bin image

Signed-off-by: Pavlo Samko <bulldozerbsg@gmail.com>
7 years ago
Sven Roederer 9715beb04c ramips: add support for Ubiquiti EdgeRouter X-SFP
This patch adds support for the Ubiquiti EdgeRouter X-SFP and
improves support for the EdgeRouter X (PoE-passthrough).

Specification:
- SoC: MediaTek MT7621AT
- Flash: 256 MiB
- RAM: 265 MiB
- Ethernet: 5 x LAN (1000 Mbps)
- UART: 1 x UART on PCB (3.3V, RX, TX, GND) - 57600 8N1
- EdgeRouter X:
  - 1 x PoE-Passtrough (Eth4)
  - powered by Wallwart or passive PoE
- EdgeRouter X-SFP:
  - 5 x PoE-Out (24V, passive)
  - 1 x SFP (unknown status)
  - powered by Wallwart (24V)

Doesn't work:
* 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.

Installation

via vendor firmware:
- build an Initrd-image (> 3MiB) and upload the factory-image
- initrd can have luci-mod-failsafe
- flash final firmware via LuCI / sysupgrade on rebooted system

via TFTP:
- stop uboot into tftp-load into option "1"
- upload factory.bin image

Signed-off-by: Sven Roederer <devel-sven@geroedel.de>
7 years ago
Filip Moc 43e4e1f4a5 Move enablemodem from ramips to new package adb-enablemodem and make it used also by TL-MR6400
Signed-off-by: Filip Moc <lede@moc6.cz>
7 years ago
Kyson Lok abbfcc8525 ramips: add support for GL-inet GL-MT300N-V2
This patch adds supports for the GL-inet GL-MT300N-V2.

Specification:
- SoC: MediaTek MT7628AN
- Flash: 16 MiB (W25Q128FVSG)
- RAM: 128 MiB DDR
- Ethernet: 1 x WAN (100 Mbps) and 1 x LAN (100 Mbps)
- USB: 1 x USB 2.0 port
- Button: 1 x switch button, 1 x reset button
- LED: 3 x LEDS (system power led is not GPIO controller)
- UART: 1 x UART on PCB (JP1: 3.3V, RX, TX, GND)

Installation through Luci:
- The original firmware is LEDE, so both LuCI or sysupgrade can be used.
- Do not keep settings, for sysupgrade please use the -n option.

Installation through bootloader webserver:
- Plug power and hold reset button until red LED blink to bright.
- Install sysupgrade image using web interface on 192.168.1.1.

Signed-off-by: Kyson Lok <kysonlok@gmail.com>
[match maximum image size with firmware partition]
Signed-off-by: Mathias Kresin <dev@kresin.me>
7 years ago
Ørjan Malde 5f932988c3 ramips: add support for Asus RT-AC51U
Specification:
 - SoC: MediaTek MT7620A (580 MHz)
 - RAM: 64 MiB (Winbond W9751G6JB-25)
 - Flash: 16 MiB (Spansion S25FL128SAIF00)
 - LAN: x4 100M
 - WAN: x1 100M
 - Others: USB 2.0, reset button, wps button and 9 LEDs

Issues:
 - 5 GHz band is not functional (missing driver support)

Installation:

Asus windows recovery tool:
 - install the Asus firmware restoration utility
 - unplug the router, hold the reset button while powering it on
 - release when the power LED flashes slowly
 - specify a static IP on your computer:
     IP address: 192.168.1.75;
     Subnet mask 255.255.255.0
 - Start the Asus firmware restoration utility, specify the sysupgrade
   image, and press upload

TFTP Recovery method:
 - set computer to a static ip, 192.168.1.75
 - connect computer to the LAN 1 port of the router
 - hold the reset button while powering on the router for a few seconds
 - send firmware image using a tftp client; i.e from linux:
 $ tftp
 tftp> binary
 tftp> connect 192.168.1.1
 tftp> put lede-ramips-mt7620-rt-ac51u-squashfs-sysupgrade.bin
 tftp> quit

Signed-off-by: Ørjan Malde <foxyred333@gmail.com>
7 years ago
Alexey Belyaev a7cbf59e0e ramips: add new device ZyXEL Keenetic as kn
This device exactly same as NBG-419N but with USB port and USB Led.

Specification:

- SoC: Ralink RT3052 (MIPS24Kc) @384MHz
- RAM: 32 MiB
- Flash: 8 MiB
- WLAN: WiSoC 2T2R/300Mbps (2.4GHz)
- LAN: 4x100M
- WAN: 1x100M
- USB: 1x2.0

Installation via serial console (57600 8N1) from TFTP server
 - rename the firmware to something shorter, for example
   "sysupgrade.bin" (max. 32 chars)
 - copy firmware TFTP server's directory
 - when you power on device, and see U-Boot log, immediatly push "2"
   once.
 - You will see this message:
     2: System Load Linux Kernel then write to Flash via TFTP.
        Warning!! Erase Linux in Flash then burn new one. Are you sure?
 - Push "y", and enter: device IP, then TFTP server's IP, and then
   image firmware file name.

The firmware will be downloaded within ~30 seconds and flashed to the
device (It will take about 2 minutes).

Signed-off-by: Alexey Belyaev <spider@spider.vc>
[squash commits, compact commit message, fix compatible string, remove
superfluous pinmuxes]
Signed-off-by: Mathias Kresin <dev@kresin.me>
7 years ago
Mathias Kresin 3a2cc2c8ad ramips: fix syntax error in board.d/01_leds
Fixes the following error:

  syntax error: unexpected newline (expecting ")")

Fixes: FS#739

Signed-off-by: Mathias Kresin <dev@kresin.me>
7 years ago
Mathias Kresin 725238f698 ramips: use the ZBT-WE826 power LED for status indication
Signed-off-by: Mathias Kresin <dev@kresin.me>
7 years ago
Mathias Kresin 2ddaf96a77 ramips: add ZBT-WE826 32MB variant
The ZBT-WG826 is available with 16 or 32 MByte of flash. Split the
device tree source file, rename the currently supported 16 MByte
version and add the 32 MByte variant.

Signed-off-by: Mathias Kresin <dev@kresin.me>
7 years ago
Mathias Kresin 3cfc909c54 ramips: rename Digineo AC1200 Pro to ZBT-WG3526 32MB
The Digineo AC1200 Pro is the 32MB flash variant of the ZBT-WG3526 with
unpopulated/exposed sdhci slot. Rename to board to the OEM/ODM name and
add the sdhci kernel module to use it for multiple clones.

Signed-off-by: Mathias Kresin <dev@kresin.me>
7 years ago
Mathias Kresin 619d68bfc9 ramips: prepare ZBT-WG3526 for hardware variants
The ZBT-WG3526 is available with 16 or 32 MByte of flash. Rename the
current supported 16MByte version to indicate which flash size variant
is supported.

Signed-off-by: Mathias Kresin <dev@kresin.me>
7 years ago
Jiawei Wang ff258effd5 ramips: add support for ZBT-WE1326
Specification:
- SoC: MT7621AT, MT7603EN and MT7612EN
- Flash: 16 MiB (W25Q128FVSG)
- RAM: 512 MiB (EM6GE16EWXD-12H)
- Ethernet: 1 x WAN (10/100/1000Mbps) and 4 x LAN (10/100/1000 Mbps)
- Others: USB 2.0, micro SD slot, reset button and 8 x LEDs

Issues:
- Two LEDs for 2.4 GHz and 5 GHz Wi-Fi do not work, can't find GPIOs.
- The pwr LED is not GPIO controllable

How to install:
- The original firmware is OpenWrt, so both LuCI or sysupgrade can be used.
- Do not keep settings, for sysupgrade please use the -n option.

Signed-off-by: Jiawei Wang <buaawjw@gmail.com>
7 years ago
Alexey Belyaev 3549bad814 ramips: fix ZyXEL Keenetic Omni switch config
The wan port is connected to switch port 0. Fix the mediatek,portmap as
well as the default switch config.

Signed-off-by: Alexey Belyaev <spider@spider.vc>
7 years ago
Mathias Kresin 18618695ae ramips: dont replace the board name
Use fixed led names and add each board variant instead of manipulating
the board name.

It makes the ramips board name function less different to the one used
in other targets and allows to merge them with a common function.

Signed-off-by: Mathias Kresin <dev@kresin.me>
7 years ago
Daniel Golle c6fe325587 ramips: rename PSG1218 to match label
Fix previous commit to be less ambigous:
PSG1218 rev.A = 5 ports, external PA, heatsinks
PSG1218 rev.B = 4 ports, internal PA, no heatsinks

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
7 years ago
Daniel Golle c5a7dc49d1 ramips: split Phicomm PSG1218 and PSG1218K2C
PSG1218 got only 4 Ethernet ports and WAN on port 3 while
PSG1218K2C got 5 Ethernet ports and WAN on port 4
Switch to use kmod-kt76x2 instead of kmod-mt76 for both devices while
at it.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
7 years ago
Vaclav Svoboda 6b9c25e927 ramips: fix switch port mapping for ZBT-WE2026
This patch fixes switch port mapping for Zbtlink ZBT-WE2026.

Signed-off-by: Vaclav Svoboda <svoboda@neng.cz>
7 years ago
Vaclav Svoboda 815cc2a69a ramips: add support for Zbtlink ZBT-WE2026
This patch adds support for the Zbtlink ZBT-WE2026.

Specification:
- SoC: MediaTek MT7620N (580MHz)
- RAM: 64 MiB
- Flash: 8 MiB SPI
- LAN: 4x100M
- WAN: 1x100M

Installation through bootloader webserver:
- With the power unplugged press and hold reset button.
- Plug power and hold reset button until LED starts to blink.
- Install sysupgrade image using web interface on 192.168.1.1.

Signed-off-by: Vaclav Svoboda <svoboda@neng.cz>
7 years ago
Joseph C. Lehner de33a4cef0 ramips: add support for Netgear EX3700
Specifications:
* SoC: MT7620A
* RAM: 64 MB DDR
* Flash: 8MB NOR SPI flash
* WiFi: MT7612E (5Ghz) and builtin MT7620A (2.4GHz)
* LAN: 1x100M

The -factory images can be flashed from the device's web
interface or via nmrpflash.

Co-authored-by: Paul Oranje <por@xs4all.nl>
Signed-off-by: Paul Oranje <por@xs4all.nl>
Signed-off-by: Joseph C. Lehner <joseph.c.lehner@gmail.com>
7 years ago
Hanqing Wong 38bee61dab ramips: add support for Netgear R6220
This patch adds support for the Netgear R6220, aka Netgear AC1200 and
R6220-100NAS.

Specification:
- SoC: MediaTek MT7621ST (880 MHz)
- Falsh: 128 MiB (Macronix MX30LF1G08AA-TI)
- RAM: 128 MiB (Nanya NT5CB64M16FP-DH)
- Wireless: MediaTek MT7603EN b/g/n , MediaTek MT7612EN an+ac
- LAN speed: 10/100/1000
- LAN ports: 4
- WAN speed: 10/100/1000
- WAN ports: 1
- Serial baud rate of Bootloader and factory firmware: 57600

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

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

Signed-off-by: Hanqing Wong <hquu@outlook.com>
7 years ago
Jo-Philipp Wich 2543e986ad ramips: fix Linksys RE6500 switch port mapping
Properly map the internal switch ports to the proper LAN1..LAN4 labels.

Fixes #530.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
7 years ago
Francois Goudal 9b35815f0f ramips: add support for Afoundry EW-1200
This device features both a 2.4 and 5Ghz radio, and supports
802.11a/b/g/n/ac modes.
It has 5 Gb-Ethernet ports and a USB 3.0 host port.

It is powered by the Mediatek MT7621 SoC, and the MT7602E and MT7612E wifi
chipsets, together with 128MB of RAM and 16 MB of SPI Flash.

The stock firmware is in fact based on some openwrt barrier breaker, with a
mediatek SDK kernel, and an afoundry custom made web interface (not LuCI
based).
Firmware update page on the stock web interface can not accept sysupgrade
images, it bricks the device.
At this point, the only working solution I found was to connect to the
serial console port (available on J4 header) and to use opkg to install
dropbear.
Then scp the sysupgrade file in the device's /tmp and run sysupgrade from
console without preserving configuration files.

Signed-off-by: Francois Goudal <francois@goudal.net>
7 years ago
ZengFei Zhang edae3479e6 ramips: add support for HiWiFi HC5962
This patch adds supports for the HiWiFi HC5962(gee4) http://www.hiwifi.com

Short specification:

 - MT7621AT + MT7612EN + 7603EN
 - 256MB DDR3 RAM
 - 128MB NAND flash
 - 1+3 x 1000M Ethernet
 - 1x USB 2.0 port. 1x USB 3.0 port.
 - reset button
 - UART pad on PCB (JP3: TX, RX, GND, 3.3V)

Flash instruction:

1, Download lede-ramips-mt7621-hc5962-squashfs-factory.bin
2, Login as root via SSH on 192.168.199.1 and then copy factory.bin(using wget or nc or...) to /tmp/
3, use the following commands:
   $ mtd write /tmp/lede-ramips-mt7621-hc5962-squashfs-factory.bin firmware
   $ mtd erase firmware_backup && reboot
After reboot you should be able to login as root via SSH on 192.168.1.1

Signed-off-by: ZengFei Zhang <zhangzengfei@kunteng.org>
7 years ago
Wang JiaWei d48cc5e044 ramips: add support for HiWiFi HC5661A
HC5661A is almost the same as HC5661 but MT7628AN is used instead of MT7620A.

- MT7628AN
- 128 MiB DDR2 RAM (W971GG6KB-25)
- 16 MiB SPI NOR flash (W25Q128)
- SD slot (not work yet)
- 1+4 x 100M Ethernet
- 802.11 b/g/n Wi-Fi
- 3 x LED
- 1 x button
- UART pad on PCB (JP1: TX, RX, GND, 3.3V)

The factory flash layout seems different from HC5661.
"hwf_config" is renamed to "oem" and its size changes to 0x20000.
It is modified accordingly in the dts file.

0x000000000000-0x000000030000 : "u-boot"
0x000000030000-0x000000040000 : "hw_panic"
0x000000040000-0x000000050000 : "Factory"
0x000000050000-0x000000160000 : "kernel"
0x000000160000-0x000000fc0000 : "rootfs"
0x000000bb0000-0x000000fc0000 : "rootfs_data"
0x000000fc0000-0x000000fe0000 : "oem"
0x000000fe0000-0x000000ff0000 : "bdinfo"
0x000000ff0000-0x000001000000 : "backup"
0x000000050000-0x000000fc0000 : "firmware"

To install LEDE, enabled the "developer mode",
which will *void your warranty* and open the SSH server at port 1022.

sysupgrade -n -F lede-ramips-mt7628-hc5661a-squashfs-sysupgrade.bin

SD slot:
- Tried to add modules kmod-sdhci kmod-sdhci-mt7620, and corresponding dts block.
- It will block WAN + 3xLAN ports, only one LAN works.
- I'm not sure why, everything else works fine.

Signed-off-by: Wang JiaWei <buaawjw@gmail.com>
7 years ago
Thibaut VARENE 157353c210 ramips: WN3000RPv3: do not setup switch
The WN3000RPv3 is a repeater with a single ethernet port. Setting up the
switch, even to disable it, is unnecessary and possibly confusing.

Configure LAN as eth0 instead.

Signed-off-by: Thibaut VARENE <hacks@slashdirt.org>
7 years ago
Chuanhong Guo 634328c0de ramips: correct switch configuration for Newifi D1
Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
7 years ago
Kristian Evensen bb7068f26c ramips: add support for Sanlinking D240
The Sanlinking Technologies D240
(http://www.sanlinking.com/en/29-dual-4g-wifi-router.html) is basically the same
device as the ZBT WE826, so adding support for it in LEDE is straight forward.
The differences is that the D240 has two mini-PCIe slots (instead of one), blue
LEDs and supports PoE.

Specification:
* CPU: MT7620A
* 1x 10/100Mbps POE (802.3af/802.3at) Ethernet, 4x 10/100Mbps.
* 16 MB Flash.
* 128 MB RAM.
* 1x USB 2.0 port.
* 2x mini-PCIe slots.
* 2x SIM slots.
* 1x 2.4Ghz WIFI.
* 1x button.

Wifi, USB, switch and both mini-PCIe slots are working. I have not been able to
test the SD card reader.

The device comes pre-installed with an older version of OpenWRT, including Luci.
In order to install LEDE, you need to follow the existing procedure for updating
OpenWRT/LEDE using Luci. I.e., you need to access the UI and update the firmware
using the sysupgrade-image. Remember to select that you do not want to keep
existing settings. The default router address is 192.168.10.1 and
username/password admin/root (at least on my devices).

If you brick the device, the procedure for recovery is the same as for the
WE826. Please see the wiki page for that device for instructions.

Signed-off-by: Kristian Evensen <kristian.evensen@gmail.com>
7 years ago
FUKAUMI Naoki 6b0b526a4f ramips: add support for Buffalo WCR-1166DS
Buffalo WCR-1166DS is a small wireless router with

 - MT7628AN + MT7612E
 - 64MiB DDR2 SDRAM
 - 16MiB SPI flash
 - 2T2R 11ac/a/b/g/n Wi-Fi
 - 2x 10/100M ethernet switch
 - 8x programmable LED
 - 3x button
 - UART pad on PCB (J2: 3.3V, GND, TX, RX)

factory image can be installed via stock web UI.

due to the "dual image" function in the bootloader, the second half of
the SPI flash ("firmware2" partition) cannot be used as a part of the
file system.

Signed-off-by: FUKAUMI Naoki <naobsd@gmail.com>
7 years ago
Vitaly Chekryzhev 07a02efd07 ramips: ZyXEL Keenetic series update wan mac
Signed-off-by: Vitaly Chekryzhev <13hakta@gmail.com>
7 years ago
Vitaly Chekryzhev f9d91a4ac7 ramips: correct keenetic-series switch index
Fix switch name typo

Signed-off-by: Vitaly Chekryzhev <13hakta@gmail.com>
7 years ago
Thibaut VARENE 7fb11c8ed2 ramips: add support for Netgear WN3000RPv3
This patch adds support for the Netgear WN3000RPv3
http://www.netgear.com/support/product/wn3000rpv3.aspx

Specifications:
- SoC: MediaTek MT7620A (580MHz, ramips)
- RAM: 32MB DDR
- Storage: 8MB NOR SPI flash
- Wireless: builtin MT7620A, 2x2:2 with u.FL connectors
- Ethernet: 1x100M
- Serial: JP1 header, 57600-8N1
- Stock firmware based on OpenWRT Kamikaze

Like the EX2700, the bootloader expects a secondary image signature,
see https://forum.openwrt.org/viewtopic.php?pid=312577#p312577
This is why the same fakeroot image is used for the WN3000

Signed-off-by: Thibaut VARENE <hacks@slashdirt.org>
7 years ago
BangLang Huang 2a7f669016 ramips: fix mac address of miwifi-mini
For the miwifi-mini, the offset of ethernet mac should be 0x28
which you can easyily dump from 'Factory' partition.

Signed-off-by: BangLang Huang <banglang.huang@foxmail.com>
7 years ago
Joseph C. Lehner 6b5dab9469 ramips: simplify EX2700 network config
Don't create a vlan for the Netgear EX2700's only Ethernet port.

Signed-off-by: Joseph C. Lehner <joseph.c.lehner@gmail.com>
7 years ago
Lazar Demin ab90f15c89 ramips: Added Onion Omega2 and Omega2+
This patch adds support for the Onion Omega2 and Omega2+ (https://onion.io)

Specifications:
- SoC: MediaTek MT7688AN (580MHz, ramips)
- Omega2
  - RAM: 64MB DDR
  - Storage: 16MB NOR SPI flash onboard
- Omega2+
  - RAM: 128MB DDR
  - Storage: 32MB NOR SPI flash onboard + microSD slot
- Wireless: Built into MT7688AN (mt76) with onboard 1x chip antenna and u.FL connecter
- Ethernet: 1x100M pins on Omega2 & Omega2+, can use Ethernet Expansion and an Omega Dock to get a physical Ethernet port
- Strongly recommend using the Omega2 & Omega2+ with a Dock (Expansion Dock, Power Dock, Arduino Dock 2, Mini Dock)
  - All Docks Provide:
    - Micro-USB port to provide power to the Omega
      - On the Expansion and Mini Docks, can also access the terminal (UART0) via serial
    - USB 2.0 socket connected to Omega
  - Just the Expansion Dock, Power Dock, and Arduino Dock 2 provide:
    - Omega GPIO breakout
    - Allows for connection of Omega Expansions:
      - Ethernet Expansion
      - Relay Expansion
      - PWM Expansion
      - OLED Expansion
      - Ethernet Expansion
      - Proto Expansion
      - Cellular Expansion

Signed-off-by: Lazar Demin <lazar@onion.io>
7 years ago
Andrew Yong 3f31029b19 ramips: add support for VoCore2
This patch adds support for the VoCore VoCore2 and its complementary
"ultimate" dock.

Specifications:
- SoC: MediaTek MT7628AN (580MHz, ramips)
- RAM: 128MB DDR2 166MHz
- Storage: 16MB NOR SPI flash onboard + microSD slot on dock
- Wireless: Built into MT7628AN (mt76) with 1T1R firmware on VoCore2
            boards with onboard 1x chip antenna
- Ethernet: 1x100M (port0) on dock, 1x100M (port2) on PCB header
- Dock hardware:
  - USB 2.0 socket
  - MicroSD socket
  - 100Mbps Ethernet x1
  - 3.5mm headphone jack (TRRS) connected to Everest Semi ES8388 I2S
    DAC/ADC (support WIP)
  - Micro USB for power and console (UART2)

Initial installation:
- VoCore2 comes preinstalled with a fork of OpenWrt CC and AP on
  SSID "VoCore2"
- Connect to VoCore2 by Ethernet or Wi-Fi
- `ssh root@192.168.1.1` (password is "vocore")
- scp/wget/etc. LEDE sysupgrade.bin to VoCore2
- `sysupgrade -n <your image>.bin` (don't keep old config, as the
  original firmware uses Ralink SDK Wi-Fi drivers and not
  mt76+mac80211)
- after sysupgrade completes, Wi-Fi will be disabled by default so use
  Ethernet or the micro USB console to configure Wi-Fi again

Signed-off-by: Andrew Yong <me@ndoo.sg>
7 years ago
L. D. Pinney b28e94d4bf ramips: MiWiFi Nano fixes
Use the the dt-bindings macros and add the reset button.

Set the correct polarity for the LEDs and drop the default state.
Remove all trigger for the LEDs. According to the manual the LEDs are
only used to show the operation state, where blue means normal
operation.

Use the MAC-Addresses stored in EEPROM for the ethernet and the
wireless interface.

Signed-off-by: L. D. Pinney <ldpinney@gmail.com>
[use leds only for boot status indication, add proper commit message]
Signed-off-by: Mathias Kresin <dev@kresin.me>
7 years ago
Mathias Kresin d2b1148e75 ramips: use D-Link DIR-600 B1 image for B2 version
Everything set for the B1 is identical to the values uses for the B2
version.

Signed-off-by: Mathias Kresin <dev@kresin.me>
8 years ago
Mathias Kresin ae3ac76e56 ramips: use destinct 11AC NAS board name
Use a distinct board name even if the board is near to identical to
the WeVO W2914NS v2.

To make sure that a 11AC NAS image can not be installed on a
WeVO W2914NS v2, both board need to use different names.

Signed-off-by: Mathias Kresin <dev@kresin.me>
8 years ago
Henryk Heisig 3a6353d910 ramips: enablemodem: move /lib/ramips.sh to start()
Fix build error: /etc/init.d/enablemodem: line 2: /lib/ramips.sh: No such file or directory

Signed-off-by: Henryk Heisig <hyniu@o2.pl>
8 years ago
Henryk Heisig c8043137bb ramips: Add support to TP-Link Archer MR200
CPU: MT7620N 580MHz
Flash: 8MB
RAM: 64MB
build-in modem 3G/4G
four ethernet port 10/100Mbps

Signed-off-by: Henryk Heisig <hyniu@o2.pl>
8 years ago
Vitaly Chekryzhev 190ee7d86b ramips: add support for ZyXEL Keenetic Omni / Omni II
Factory image can be installed via Zyxel WebUI.

Signed-off-by: Vitaly Chekryzhev <13hakta@gmail.com>
8 years ago
BangLang Huang 960c477432 ramips: Fix led init script for Lenovo Y1/Y1s
This commit fix the led init script for Lenovo Y1 and
Y1S due to the manual and dts file.

Signed-off-by: BangLang Huang <banglang.huang@foxmail.com>
8 years ago
Yong-hyu, Ban 377eac0ceb ramips: fix LAN port order of WeVO W2914NS v2
Signed-off-by: Yong-hyu, Ban <perillamint@gentoo.moe>
8 years ago
Tobias Wolf c2ed721e89 ramips: improve F5D8235 V1 support
This fixes the partition name for the firmware splitter, the cfi
address and adds the mtd-eeprom address for wmac. It adds additional
LEDs and make use of them in diag.sh and 01_leds.

Please note that the ":blue:wired" LED is used because the
":blue:router" behaviour is unpredictable for failsafe indication. The
issue with the router LED is that you have two states only.
"off" is steady on and "on" blinks. Therefore the wired LED is more
suitable.

Furthermore it reuses the correct switch configuration definition to
reflect the device ports and numbering. Additionally fixes the issue
that the default configuration is not applied as no port 6 exists on
this device.

Signed-off-by: Tobias Wolf <github-NTEO@vplace.de>
8 years ago
Andrew Yong 07b571a435 ramips: RB750Gr3: Add pwr LED and buzzer to DTS
use pwr LED in diag.sh
Expose unused pinmux pins as GPIOs
export power LED and buzzer pins
Use rb750gr3:blue:pwr LED in diag.sh for boot status instead of rb750gr3:green:usr

Signed-off-by: Andrew Yong <me@ndoo.sg>
8 years ago
Giuseppe Lippolis ec1de9b1a6 ramips: Add device DLINK DWR-512-B
The Dlink DWR-512-B modem is a ralink 5350 processor based embedding
a 3G mini-pcie router.

The oem JBOOT bootloader has to be replaced by a RT5350 SDK
U-Boot such as https://github.com/stevenylai/ralink_sdk - U-Boot
configured for the RT5350 256MiB SDR.

Main reason to change the bootloader is the encrypted header used to
store the kernel image. In this way an image can only be generated
using the propietary binboy tool (included in the GPL distribution
from Dlink). The binboy tool doesn't allow to modify the kernel/rootfs
partition scheme. This is considered a big constraint (limited kernel
size and inefficient usage of flash space).

For interested people I pubblished the details of my investigation
about the encrypted firmware header here:
http://lists.infradead.org/pipermail/lede-dev/2016-October/003435.html

Signed-off-by: Giuseppe Lippolis <giu.lippolis@gmail.com>
8 years ago
perillamint 68634426fe ramips: add support for WeVO W2914NS v2
Signed-off-by: Yong-hyu Ban <perillamint@gentoo.moe>
8 years ago
Vitaly Chekryzhev 348344874c ramips: add support for ZyXEL Keenetic Viva
Factory image can be installed via Zyxel WebUI.

Signed-off-by: Vitaly Chekryzhev <13hakta@gmail.com>
[removed linux,modalias parameter from flash node in dts]
[removed sdhci node from dts; no sd card slot here]
Signed-off-by: Mathias Kresin <dev@kresin.me>
8 years ago
Jasper Scholte 3d680c5728 ramips: add support for Sitecom WLR-6000
The Sitecom firmware upgrade file has SENAO_FIRMWARE_TYPE 2 set. This
looks rather wrong since SENAO_FIRMWARE_TYPE 2 is kernel only but the
file is way to big for only including a kernel.

The factory image need to have the dlf file extension. Otherwise the
Sitecom firmware rejects the file.

The stock firmware uses the following mac addresses:

LAN: 00:0C:F6:AA:BB:D8 (u-boot env: ethaddr)
2,4: 00:0C:F6:AA:BB:D8 (EEPROM)
5:   00:0C:F6:AA:BB:DC (EEPROM)
WAN: 00:0C:F6:AA:C8:43 (u-boot env: wanaddr)

Assuming the mac address range :D8 to :DC is reserved for this device,
the MAC addresses were reorder to have a unique MAC address for each
interface:

2.4GHz: 00:0C:F6:AA:BB:D8
LAN:    00:0C:F6:AA:BB:D9
WAN:    00:0C:F6:AA:BB:DA
5 GHz:  00:0C:F6:AA:BB:DC

The first MAC is assigned to the 2.4GHz WiFi interface
to keep compatibility with the SSIDs printed on the case, which have
the last three sextets of the MAC address appended.

There are still issues with the rt2x00 driver. It is not possible to
use both wireless interfaces at the same time. The 2.4 GHz
wireless (PCIe) only works if the internal 5GHz wireless is/has been
enabled or used for scanning. The internal 5GHz wireless only works if
the 2.4GHz wireless (PCIe) was never enabled. Disabling the 2.4Ghz
after it was enabled will result in stations seeing the 5Ghz AP but are
unable to connect.

Due to the not optimal working wifi the manufacture, backup and storage
partitions of the OEM firmware are kept for now to allow an easy switch
back to the Sitecom firmware.

Signed-off-by: Jasper Scholte <NightNL@outlook.com>
Signed-off-by: Mathias Kresin <dev@kresin.me>
8 years ago
Dominik Menke 8b65fef173 ramips: add support for Digineo AC1200 Pro
This is basically a ZBT-WG3526 (mt7621 SoC), but with 32M flash.

Signed-off-by: Dominik Menke <dom@digineo.de>
8 years ago
Martin Weinelt 5247ac2f80
ar71xx, ramips: reduce CPU load and flickering on devices using rsslieds
Polling every 40ms causes more than 10% CPU load on weak devices. An
interval of 200ms is much more reasonable.

Signed-off-by: Martin Weinelt <martin@darmstadt.freifunk.net>
[Matthias Schiffer: adapt OpenWrt patch; add ramips; extend commit message]
Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
8 years ago
Felix Fietkau 3d0e965c8b ramips: add port index in switch config for buffalo WHR-* and WSR-* devices
Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 years ago
Felix Fietkau a17872ec4f ramips: fix status LED for WHR-300HP2
Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 years ago
Mathias Kresin d8dd207ea6 ramips: use the ralink,mtd-eeprom device tree property
Use the ralink,mtd-eeprom instead of invoking the userspace firmware
loader.

Set the label and compatible string according to the the PCI binding
documentation.

Use the wifi@0,0 label and the pci0,0 compatible string in case the
PCI vendor and device id is unknown. It should work anyway since the
compatible string isn't evaluated (yet).

This commit might fixes the PCIe wireless for the Buffalo WHR-600D.
This board was mentioned in the board 10-rt2x00-eeprom firmware hotplug
script but never had the correct eeprom name set to trigger the
firmware from flash extraction.

Use the usual eeprom for the soc wmac of the Dovado Tiny AC.

Signed-off-by: Mathias Kresin <dev@kresin.me>
8 years ago
Roger Pueyo Centelles 5f6e948551 ramips: Add support for Wavlink WL-WN575A3
This commit adds support for the Wavlink WL-WN575A3, a dual-band wall-plug
wireless router with the following specifications:

 - CPU: MediaTek MT7628AN 580MHz
 - Flash: 8MB
 - RAM: 64MB
 - Ethernet: 2x 10/100 Mbps (switched)
 - 2.4 GHz: 802.11b/g/n SoC, MIMO 2x2, 20 dBm
 - 5 GHz: 802.11a/n/ac MT7612E, MIMO 2x2, 20 dBm
 - Antennas: 4x external (2 per radio), non-detachable
 - LEDs: 4 programmable + LAN, WAN, POWER
 - Buttons: reset, WPS

Flashing instructions:

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

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

Signed-off-by: Roger Pueyo Centelles <roger.pueyo@guifi.net>
8 years ago
Andrew Yong faf94d926e ramips: add support for MikroTik hEX v3 (RB750Gr3)
The MikroTik hEX v3 (RB750Gr3) is a MT7621AT board which is similar to most MT7621 reference designs, it can be easily supported by this patch; however, the stock RouterBOOT bootloader has to be replaced by a MT7621 SDK U-Boot such as https://github.com/ndoo/RB750Gr3-U-Boot - U-Boot configured for the RB750Gr3 (16MiB SPI flash, 256MiB DDR3 RAM at 1200MHz).

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

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

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

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

Signed-off-by: Andrew Yong <me@ndoo.sg>
8 years ago
Henryk Heisig a34f96d6cf ramips: Archer C50 cleanup
- setting read-only flag to important partitions
- enabling PA to improve 2.4 GHz signal strength
- add missing leds
- rename colour led
- add mac adress to 5GHz wlan interface
- included <dt-bindings/input/input.h> and <dt-bindings/gpio/gpio.h>

Signed-off-by: Henryk Heisig hyniu@o2.pl
8 years ago
Xuefu Lin 8312738806 ramips: fix PSG1218 LEDs
Signed-off-by: Xuefu Lin  <xuefulin@gmail.com>
8 years ago
YuheiOKAWA 4050cfebda ramips: add support for Planex VR500.
SOC:	MT7621A
RAM:	256MiB
NOR:	MX25L51245G

Non Wireless Router.

Issue: soft reboot problem. SPI Flash do not exit 4byte address mode.

Signed-off-by: Yuhei Okawa <tochiro.srchack@gmail.com>
8 years ago
Mathias Kresin bcfbeae79f ramips: use rfkill for wps button on wlan only boards
All of the touched boards don't have an ethernet port. Allow to use the
wps button on these boards to enable the wireless radio after boot.

The force enabled wireless for the DCH-M225 is removed. It is reckless
to bring up an unencrypted wireless network by default these days.

Using the wps button to bring up the radio seam to me the better
approach.

Signed-off-by: Mathias Kresin <dev@kresin.me>
8 years ago
Mathias Kresin 6391af2f1f ramips: improve edimax 6200n/nl support
Assign the reset functionality to the wps/reset buttons. Use the wlan
switch of the 6200n to enable/disable wlan.

Add the internet led of the 6200nl and use the led for boot status
indication

Signed-off-by: Mathias Kresin <dev@kresin.me>
8 years ago
Mathias Kresin 51bca43f39 ramips: fix edimax 6200nl switch config
With 3a9752bbd2 and later changes to
ramips_set_preinit_iface() the default vlan config applied during
preinit was changed. These changes were made without updating the
default network config to ensure that vlan interfaces used for lan/wan
are still configured.

Fix the issue by using the default all LAN portmap and disabling not
connected switch ports using portdisable device tree parameter.

Signed-off-by: Mathias Kresin <dev@kresin.me>
8 years ago
Mathias Kresin bbdf2ac305 ramips: tag the CPU switch port
With de51026515 the explicit tagging of
the CPU port was removed. This leads to a not working default network
config, with vlans enabled but disabled CPU tagging, for boards where
all switch ports are having the same role.

In case the ports are having different roles set, tagging is is set
implicit for the CPU port by ucidef_add_switch().

Signed-off-by: Mathias Kresin <dev@kresin.me>
8 years ago
Mathias Kresin b35dd9584e ramips: remove fixed lan/wan interface for switch configs
Don't set the lan/wan interface when using ucidef_add_switch. This
results into a wan interface albeit all ports a annotated as lan ports.

ucidef_add_switch takes care of setting the correct lan/wan interface
according to the annotation of the ports.

Signed-off-by: Mathias Kresin <dev@kresin.me>
8 years ago
Klaus df5416296c ramips: add support for Zyxel NBG-419N2 (WAP3205v2)
applied bb-final-ramips-add-zyxel-nbg-419n2.patch from
123serge123, found at https://yadi.sk/d/1ZV0lKJwbTE65;
see https://forum.openwrt.org/viewtopic.php?pid=246905#p246905,
modified slightly to fit to CC release and to new lede build
system: image/rt305x.mk include file is used now
changed NBG-419N2.dts format to fit style of other dts files

Signed-off-by: Klaus <k-laus@quantentunnel.de>
8 years ago
Xuefu Lin dce5c4f5c8 ramips: Add support for Phicomm K2 PSG1218
- CPU: MT7620A 580MHz
- Flash: 8MB - RAM: 64MB
- External PA+LNA on both WLAN2.4 and WLAN5
- 4x LAN ethernet and 1x WAN ethernet

Signed-off-by: Xuefu Lin <xuefulin@gmail.com>
8 years ago
Cezary Jackiewicz e79e555c0e ramips: Xiaomi MiWiFi Nano: fix status led
- add status led for Xiaomi MiWiFi Nano
- revert af1e70b4a7 , this should not be added.

Signed-off-by: Cezary Jackiewicz <cezary@eko.one.pl>
8 years ago
BangLang Huang 142ec7ada9 ramips : add support for Newifi D1
Signed-off-by: BangLang Huang <banglang.huang@foxmail.com>
8 years ago
BangLang Huang 9fe833e1d0 ramips : add support for PandoraBox D1
Signed-off-by: BangLang Huang <banglang.huang@foxmail.com>
8 years ago
Cezary Jackiewicz 66aae9a271 ramips: Add support for ZBT-CPE102
- CPU: MT7620N 580MHz
- Flash: 8MB
- RAM: 64MB
- build-in minipcie slot for modem 3G/4G
- one ethernet port 10/100Mbps

Signed-off-by: Cezary Jackiewicz <cezary@eko.one.pl>
8 years ago
Matthias Schiffer 175fbe4d4e
ramips: move /lib/ramips.sh include in /etc/init.d/bootcount into start()
Enabling the init script offline will print an error otherwise.

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
8 years ago
Martin Blumenstingl d72e838429 ramips: do not "local" variables outside of a function
Older busybox versions allowed using the local keyword outside of
functions, whereas 1.25.0 (which was introduced in 06fa1c46fc) do not
allow this anymore (leading to the following error when executing the
script: "file: local: line nn: not in a function").

Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
8 years ago
Mathias Kresin c1578d4fc9 cleanup ucidef_set_interface* usage
- quote the interface name
- remove call of not existing function
- remove the proto if it's the default proto

Signed-off-by: Mathias Kresin <dev@kresin.me>
8 years ago
Mathias Kresin 0f6d0afa13 ramips: board.d merge redundant switch/interface configs
Fix alphabetical order distortions as well.

Signed-off-by: Mathias Kresin <dev@kresin.me>
8 years ago
Daniel Golle 083ef3fefe ramips: add support for Mercury MAC1200R v2
MT7628AN + MT7612E, 8MB SPI flash, 64MB DDR RAM
reset button GPIO is still missing (anyone?)
bootloader password is 'slp'

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
8 years ago
Mathias Kresin bcd2113a32 ramips: TEW-691GR: fix switch and wireless
Due to the missing phy-mode setting, the switch wasn't initialised.

The wireless requires an eeprom to work. Use the same mac addresses as
the stock firmware.

Signed-off-by: Mathias Kresin <dev@kresin.me>
8 years ago
Mathias Kresin a7c6cf5182 ramips: TEW-692GR: fix switch and wireless
The AR8327 initvals were not copied to the DTS during the switch from
mach file to device tree and broke the switch on the device.

The former used PORT6 related initvals were wrong and have been
corrected.

The phy mode setting for the switch was missing in the DTS as well.

The wireless requires an eeprom to work. The dual band wireless chips
have both bands enabled by default but only one band per chip is
working.

The stock firmware uses the following mac addresses:

LAN:    AA:BB:CC:DD:EE:E4
WAN:    AA:BB:CC:DD:EE:E4
2.4GHz: AA:BB:CC:DD:EE:E4
5 GHz:  AA:BB:CC:DD:EE:E8

Assuming the mac address range :E4 to :E8 is reserved for this device,
the MAC addresses were reorder to have a unique MAC address for each
interface:

LAN:    AA:BB:CC:DD:EE:E4
2.4GHz: AA:BB:CC:DD:EE:E4
WAN:    AA:BB:CC:DD:EE:E5
5 GHz:  AA:BB:CC:DD:EE:E8

Signed-off-by: Mathias Kresin <dev@kresin.me>
8 years ago
Chuanhong Guo 0f73801f4f ramips: Add support for Thunder Timecloud
Thunder Timecloud is a small NAS with MT7621A. It has 1 USB port and an
SD Card slot. There is no wireless cards.

Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
8 years ago
Jimmy Zhong 2b1f4945b1 ramips: Add support for TEW-714TRU
Signed-off-by: Jimmy Zhong <mb300sd@mb300sd.net>
8 years ago
P.Wassi 686617ae39 ramips: Rename TP-Link Archer C50 LEDs
Rename LEDs in TP-Link Archer C50 from [manufacturer name]
to [board name] ("tp-link" -> "c50")

Signed-off-by: P.Wassi <p.wassi@gmx.at>
8 years ago
P.Wassi dbf107cd2b ramips: Improve TP-Link Archer C20i support
Improve / finalise TP-Link Archer C20i support.

Signed-off-by: P.Wassi <p.wassi@gmx.at>
8 years ago
P.Wassi 525b9edc8a ramips: unify etc/board.d/01_leds configuration
Introduce an optional parameter at the local set_usb_led and
set_wifi_led function such that they can take a triggering
device. If no parameter is passed, behaviour is unchanged.
Signed-off-by: P.Wassi <p.wassi@gmx.at>
8 years ago
Michael Lee 0d5277f73f ramips: dch-m225 don't have ethernet. default enable wifi
Signed-off-by: Michael Lee <igvtee@gmail.com>
8 years ago
Paul Wassi 104114fe00 ramips: remove indentation in etc/board.d/01_leds
Remove indentation at end of line in base-files/etc/board.d/01_leds
Signed-off-by: Paul Wassi <p.wassi@gmx.at>
8 years ago
Michael Lee c3e420f28c ramips: Add support for D-Link DCH-M225
D-Link DCH-M225 is based on Mediatek MT7620 with 64MB ram, 8MB flash,
3.5mm audio out support. but no ethernet and usb ports.
so you must default enable wifi.

Signed-off-by: Michael Lee <igvtee@gmail.com>
8 years ago
L. D. Pinney cf8c77be6b ramips: Add support for the NixCore X1 Module
The NixCore X1 is a Ralink/MediaTek rt5350 WiFi Module.

http://nixcores.com/

Signed-off-by: L. D. Pinney <ldpinney@gmail.com>
Acked-by: Drew Gaylo <drew@nixcores.com>
8 years ago
John Crispin eca1021e5c ramips: fix buffalo wmr-300 lan port
Signed-off-by: John Crispin <john@phrozen.org>
8 years ago
Matthias Schiffer 0a0caa2656
ramips: set correct LAN/WAN MAC addresses on DIR-860L B1
Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
Reviewed-by: Jo-Philipp Wich <jo@mein.io>
8 years ago
Matthias Schiffer 103ed00cfb
ramips: add button support and make LEDs known to userspace for DIR-860L B1
Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
Reviewed-by: Jo-Philipp Wich <jo@mein.io>
8 years ago
Matthias Schiffer fa9811814a
ramips: fix fixseama call on first boot
Commit "kernel: mtdsplit: calculate kernel partition precisely for Seama"
changed the kernel partition to only contain the kernel itself and not
the Seama header. Adjust the fixseama call to match what is used on
brcm53xx.

This fixes failing to boot a second time after flashing the factory image
on the affected devices.

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
Reviewed-by: Jo-Philipp Wich <jo@mein.io>
8 years ago
Roger Pueyo Centelles 5fba0f0c0c ramips: add suport for ZBT APE522II
The ZBT APE522II is a dual-radio outdoor CPE based on the MT7620a SoC. It has
64 MB RAM, 8 MB flash, 2 Fast Ethernet ports via internal switch (one with
802.3af 48V PoE support), a 802.11b/g/n SoC 2.4 GHz radio and an 802.11a/n/ac
MT7612E-based 5 GHz radio.

Signed-off-by: Roger Pueyo Centelles <roger.pueyo@guifi.net>
8 years ago
Henryk Heisig 75af981239 ramips/base-files: Add support for Archer C50
Signed-off-by: Henryk Heisig <hyniu@o2.pl>
8 years ago
Michael Lee 9a4935687d ramips: add support for DuZun DM06
DuZun DM06 is a develop board based on mt7628
64M RAM, 8M SPI Flash, 1 WAN, 1 LAN.
wm8960 codec with line out, line in and speaker output.

Signed-off-by: Michael Lee <igvtee@gmail.com>
8 years ago
Yuan Chenmang b38296f2f6 ramips: add Widora-NEO board support
The Widora board is similar to the Linkit 7688 but features a larger flash
capacity.

Signed-off-by: Yuan Chenmang <771992497@qq.com>
[Jo-Philipp Wich: Reword commit message, cleanup initial PR]
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
8 years ago
Cezary Jackiewicz af1e70b4a7 ramips: Add status led for Xiaomi MiWiFi Nano
Signed-off-by: Cezary Jackiewicz <cezary@eko.one.pl>
8 years ago
Cezary Jackiewicz 2965430999 ramips: cleanup for Hame MPR-A2
- disable all ethernet ports except port 0 on MPR-A2

Port 0 is the only ethernet port on this router, so disable all other PHYs in order to save power.

- don't use a VLAN for the single ethernet port of the MPR-A2

Like A5-V11, this router only has one ethernet port.

Signed-off-by: Cezary Jackiewicz <cezary@eko.one.pl>
8 years ago
Felix Fietkau 5166732a4e ramips: use green power LED as status indicator for Buffalo WSR-1166 and WSR-600
Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 years ago
Andrew Yong 8c9b8d70b1 ramips: add status led for ZBT-WE826
Signed-off-by: Andrew Yong <me@ndoo.sg>
8 years ago
Andrew Yong 374cae9e6f ramips: add initial support for SamKnows SK-WB8
Signed-off-by: Andrew Yong <me@ndoo.sg>
8 years ago
Vittorio Gambaletta (VittGam) 1570277094 ramips: Fix alphabetical sorting for 02_network
Signed-off-by: Vittorio Gambaletta <openwrt@vittgam.net>
8 years ago
Vittorio Gambaletta (VittGam) 39f035fdc7 ramips: Don't use a VLAN for the single ethernet port of the A5-V11.
This router only has one ethernet port, so a VLAN is useless here, now that the rt3050 TCP bug that happened without VLANs has been fixed for a very long time.

Add this router to the VLAN-less config that is used by other single-port routers.

Also fix MAC address detection code since this router has no WAN port.

Signed-off-by: Vittorio Gambaletta <openwrt@vittgam.net>
8 years ago
Vittorio Gambaletta (VittGam) ffb7bf7672 ramips: Fix network for routers without VLANs on eth0.
Some routers only have one port, so eth0 is used without VLANs for them.

Revision r47720 introduced some changes, but wrongly confused "enable" with "reset".

VLANs need to be disabled for those routers, and the switch may be reset.

Fix this, by explicitly disabling VLANs instead of resetting the switch for these routers.

Also merge duplicate configuration for the "m2m".

Signed-off-by: Vittorio Gambaletta <openwrt@vittgam.net>
8 years ago
blogic 6b0425a187 ramips: add support for Planex MZK-EX750NP.
add support for Planex MZK-EX750NP.
MZK-EX750NP is MT7620A and MT7610E based 11ac wifi repeater.
Built-in power supply.
64MiB RAM, 8MiB SPI Flash, non Wired Ethernet.

Signed-off-by: YuheiOKAWA <tochiro.srchack@gmail.com>

SVN-Revision: 49268
8 years ago
John Crispin dc92917409 image / basefiles: make console password configurable
Signed-off-by: Daniel Dickinson <openwrt@daniel.thecshore.com>
Signed-off-by: John Crispin <john@phrozen.org>
8 years ago
John Crispin cb049e71cd ramips: Add support for the Netgear WNDR3700v5
https://wiki.openwrt.org/toh/netgear/wndr3700

wndr3700v5 uses the single-core dual thread MediaTek MT7621S SoC.

Signed-off-by: L. D. Pinney <ldpinney@gmail.com>

SVN-Revision: 49247
8 years ago
John Crispin 279eeeb744 ramips: add support for Planex MZK-EX300NP
MZK-EX300NP is MT7620A based wifi repeater.
Built-in power supply.
64MiB RAM, 8MiB SPI Flash, non Wired Ethernet.

Signed-off-by: YuheiOKAWA <tochiro.srchack@gmail.com>

SVN-Revision: 49235
8 years ago
John Crispin e55d86ef32 ramips: add support for Planex CS-QR10
CS-QR10 is MT7620A based IP Camera.

the camera and sound does not work with kernel 4.4.
 - camera chip is sn9c291.
 - sound chip is wm8960.

Signed-off-by: YuheiOKAWA <tochiro.srchack@gmail.com>

SVN-Revision: 49234
8 years ago
John Crispin 30fbc1a4d1 ramips: Add support for ZBT WG3526
The WG3526 is the follow-up to the 2626 and is mostly the same, with the
excaption that the mt7602 has been replaced with the mt7603. The internal wifi
setup has also changed slightly. Based on my tests, everything that worked on
the 2626 works on the 3526 and with roughly the same performance.

v1->v2:
* Remove some references to 2626 that I had missed in the dts.

v2->v3:
* Update patch to match new file structure.
* Removed SD driver to be consistent with other MT7621 targets.

Signed-off-by: Kristian Evensen <kristian.evensen@gmail.com>

SVN-Revision: 49213
8 years ago
John Crispin 37b50fdb92 ramips: add support for ELECOM WRH-300CR
ELECOM WRH-300CR is MT7620N based very small Wi-Fi router with 64MiB
DDR2 SDRAM, 16MiB SPI Flash, one fast ethernet port, and (internal but
easy-to-access) UART.

it also has internal USB hub and USB card reader which provide one USB
port, one SD card slot, and one microSD card slot.

Signed-off-by: YuheiOKAWA <tochiro.srchack@gmail.com>
Signed-off-by: FUKAUMI Naoki <naobsd@gmail.com>

SVN-Revision: 49211
8 years ago
John Crispin 890eb0c126 ramips: fix support Planex MZK-750DHP.
fix script for Planex MZK-750DHP.
modification of the GPIO definition.
add Profile.

Signed-off-by: YuheiOKAWA <tochiro.srchack@gmail.com>

SVN-Revision: 49205
8 years ago
John Crispin cc82da0bc1 ramips: MiWifi-Nano - change gpios to leds, add to default build group
1) Use leds to indicate:
Red - Power
Amber - Radio On
Blue - Wifi associated
2) Add profile to default build group for MT7628 subtarget

Signed-off-by: Noble Pepper <openwrtmail@noblepepper.com>

SVN-Revision: 49045
8 years ago
John Crispin 99414dbcf1 ramips: Add support for Xiaomi MiWiFi Nano
Xiaomi MiWiFi Nano is based on Mediatek MT7628 with 64MB ram 16MB flash

Signed-off-by: Noble Pepper <openwrtmail@noblepepper.com>

v3  includes changes suggested by L. D. Pinney & Karl Palsson-
Eliminate en25q64 (4MB) flash chip
Alphabetization
Remove hyphen in model
Rename profile from miwifinano.mk to xiaomi.mk
Add gpios that are attached to leds

SVN-Revision: 49024
8 years ago
John Crispin be79629259 ramips: Add support for GL-MT750
This patch adds support for GL-MT750.
GL-MT750 is powered by MT7620A and MT7610e, dual band 802.11ac, 2.4G 300Mbps and 5G 450Mbps.
It has 5 LANs, MMC interface, USB, a lot of IOs and PoE support.

SVN-Revision: 48994
8 years ago
John Crispin be53e5a154 ramips: Add support for GL-MT300N
This patch adds support for GL-MT300N.
GL-MT300N is powered by MT7620N with 16MB flash, 64MB RAM,
2 LANs, USB, UART, GPIO and PoE support.

SVN-Revision: 48993
8 years ago
John Crispin 96ee39b184 ramips: Add support for GL-MT300A
This patches adds support for GL-MT300A.
GL-MT300A is powered by MT7620A. It has 16MB flash, 128MB RAM,
Two LANs, USB, UART and MMC daughter board.

SVN-Revision: 48992
8 years ago
John Crispin 1b9985cfe2 ramips: add support for Planex MZK-WDPR.
add support for Planex MZK-WDPR.
MZK-WDPR(MZK-WDPR-R01) is internet radio tuner.
This patch is "network board" in MZK-WDPR.
LCD board is non OpenWrt Platform.

Signed-off-by: YuheiOKAWA <tochiro.srchack@gmail.com>

SVN-Revision: 48968
8 years ago
John Crispin 43dd2b9965 ramips: Add JCG routers to base-files
This patch adds support for JHR-N805R, JHR-N825R and JHR-N926R to
various scripts in the base-files directory.

Signed-off-by: Reinhard Max <reinhard@m4x.de>
Reviewed-by: Torsten Duwe <duwe@lst.de>

SVN-Revision: 48905
8 years ago
John Crispin e4dc6acd31 ramips: Incorrect file mode change
Commit d0f5ab6d95a1 ("ramips: Added support for ZBT-826 / ZBT-1026")
incorrectly changed the mode of the ramips shell scripts from 755 to 644.
I.e., they are not excutable any more and for example devices will be left
with broken configs.

Signed-off-by: Kristian Evensen <kristian.evensen@gmail.com>

SVN-Revision: 48893
8 years ago
John Crispin 96eb5c6fa8 ramips: Added support for ZBT-826 / ZBT-1026
Support for these MT7620-based routers: https://wiki.openwrt.org/toh/zbt/we-826
Based on Oskari’s patches found here: https://dev.openwrt.org/ticket/19996

Signed-off-by: Jamie Stuart <jamie@onebillion.org>

SVN-Revision: 48865
8 years ago
John Crispin 8b38a9450b ramips: Add support for Phicomm PSG1208
This patch adds support for Phicomm PSG1208.This is a router with MT7620A SoC with 8M flash and 64M ram.
The WPS led is uesd as status_led because the power light can't be controlled with GPIO.
It seems that the 5g wifi led is connected to MT7612E and it can't be controlled with GPIO too.

Signed-off-by: Chuanhong Guo <gch981213@gmail.com>

SVN-Revision: 48721
8 years ago
John Crispin 9f9682a79b ramips: Add support for Netgear EX2700
This patch adds support for the Netgear EX2700 and builds an approriate
sysupgrade image.

What's missing is the option to build a factory image flashable via the
router's stock web interface, but this approach is hindered by the fact
that u-boot operforms an additional integrity check, which expects a
uImage header in the last 64 bytes of the "kernel" partition, which
the bootloader expects to be 960k, a size exceeded by the standard
OpenWrt kernel.

Signed-off-by: Joseph C. Lehner <joseph.c.lehner@gmail.com>

SVN-Revision: 48698
8 years ago