Commit Graph

206 Commits (121c021989929c33036cc75ab9a8363200e8da0c)

Author SHA1 Message Date
Sungbo Eo 228bb84744 kernel: make kmod-ata-core selected by dependent modules
Currently kmod-ata-* will not get into images unless kmod-ata-core is added to
DEVICE_PACKAGES as well. By changing the dependencies from "depends on" to
"select", we do not have the issue anymore.

Furthermore, we can remove most occurrences of the package from DEVICE_PACKAGES
and similar variables, as it is now pulled by dependent modules such as:
- kmod-ata-ahci
- kmod-ata-ahci-mtk
- kmod-ata-sunxi

While at it, use AddDepends/ata for kmod-ata-pdc202xx-old.

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
4 years ago
David Bauer 4c8446bf39 ramips: add support for Ubiquiti UniFi nanoHD
Hardware
--------
SoC:   MediaTek MT7621AT
WiFi:  MediaTek MT7603 bgn 2T2R
       MediaTek MT7615 ac  4T4R
Flash: 32M SPI (Macronix MX25L25635F)
RAM:   128M DDR3 (Winbond W631GG6KB)
LED:   Dome (Blue / White)
BTN:   Reset

Installation
------------

These instructions were written for firmware version v3.9.27.
Downgrade if necessary.

1. Copy the OpenWrt sysupgrade image to the devices /tmp folder
   via scp. On factory defaults, user and password is "ubnt" at
   192.168.1.20/24.

2. Write the bootselect flag. Otherwise, the device might boot from the
   wrong partition. Verify the mtd partition used in the command below
   is the one labled "bs" in /proc/mtd (as this might change in the
   future).

   > dd if=/dev/zero bs=1 count=1 of=/dev/mtd4

3. Write the OpenWrt sysupgrade to the mtd partitions labled
   "kernel0" and "kernel1".

   > dd if=/tmp/openwrt-sysupgrade.bin of=/dev/mtdblock6
   > dd if=/tmp/openwrt-sysupgrade.bin of=/dev/mtdblock7

4. Reboot or powercycle the device.

Signed-off-by: David Bauer <mail@david-bauer.net>
4 years ago
Adrian Schmutzler 6e80df5e33 ramips: add support for NETGEAR R6700v2/AC2400
SoC: MediaTek MT7621AT
RAM: 256M DDR3
FLASH: 128M NAND
WiFi: MediaTek MT7615N an+ac
MediaTek MT7615N bgn
ETH: MediaTek MT7621AT
BTN: 1x Connect (WPS), 1x WLAN, 1x Reset
LED: Power (white/amber), WAN(white/amber), 2.4G(white), 5G(white),
USB(white) , GuestWifi(white) 4x LAN(white/amber), Wifi Button(white),
WPS Button(white)

Installation:

Login to netgear webinterface and flash factory.img

Based on a discontinued GitHub Pull Request by
kuyokushin <codenamezero@protonmail.com>

https://github.com/openwrt/openwrt/pull/2545

NOTE: Netgear R6700 v2 have five clones: R6900 v2, R7450, Nighthawk
AC2400, Nighthawk AC2100 and already added R6800. Rest of them  should
be really easy supportable. Image for R6700v2 should work perfectly with
them. Please refer:

https://github.com/openwrt/openwrt/pull/2614

Tested-by: Víctor Gibrán <victorgibranmz@hotmail.com> [R6700v2]
Tested-by: John Landrum <jl31m10@yahoo.com> [AC2400]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
[add guest led to mt7621_netgear_r6700-v2.dts end edit commit message]
Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
4 years ago
Pawel Dembicki 4e9317201d ramips: mt7621: add support for Netgear R6800
This patch adds support for the Netgear R6800, aka Netgear AC1900 and
R6800-100PES.

Specification:
- SoC: MediaTek MT7621AT (880 MHz)
- Flash: 128 MiB NAND
- RAM: 256 MiB
- Wireless: MediaTek MT7615EN b/g/n , MediaTek MT7615EN an+ac
- LAN speed: 10/100/1000
- LAN ports: 4
- WAN speed: 10/100/1000
- WAN ports: 1
- USB 2.0
- USB 3.0
- Serial baud rate of Bootloader and factory firmware: 57600

Known issues:
- Device has 3 wifi LEDs: Wifi 5Ghz, Wifi 2.4Ghz and Wifi on/off.
  Wifi on/off is not used.

Installation:
- apply factory image via stock web-gui.

Back to stock:
- nmrpflash can be used to recover to the stock Netgear firmware.

Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
4 years ago
Sungbo Eo be3e98ce26 ramips: append tail to WF2881 initramfs image
Stock firmware has a vendor-defined tail at the end of uImage for image
validation. This patch enables OpenWrt installation from stock firmware
without having to access the UART console.

Installation via web interface:
1.  Flash **initramfs** image through the stock web interface.
2.  Boot into OpenWrt and perform sysupgrade with sysupgrade image.

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
4 years ago
Sungbo Eo cc89c5fe27 ramips: fix device name of netis WF-2881 to WF2881
The correct model name of WF-2881 is WF2881 without hyphen. The former used
boardnames are not added to SUPPORTED_DEVICES, to make it explicit that the
sysupgrade-tar image, which is newly added in the previous commit, should
not be used to upgrade from older version.

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
[adjust commit title]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Sungbo Eo e030d162f7 ramips: use nand_do_upgrade for netis WF-2881
WF-2881 sysupgrade image uses UBI rootfs, but still relies on
default_do_upgrade. Because of this, config backup is not restored after
sysupgrade. It can be fixed by switching to nand_do_upgrade and
sysupgrade-tar image. default_do_upgrade does not handle sysupgrade-tar
properly, so one should use factory image to upgrade from older version.

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
4 years ago
INAGAKI Hiroshi 867db0a283 ramips: add support for I-O DATA WN-AX1167GR2
I-O DATA WN-AX1167GR2 is a 2.4/5 GHz band 11ac router, based on MediaTek
MT7621A.

Specification:

- SoC		: MediaTek MT7621A
- RAM		: DDR3 128 MiB
- Flash		: NAND 128 MiB
- WLAN		: MediaTek MT7615D (2.4/5 GHz, 2T2R)
- Ethernet	: 5x 10/100/1000 Mbps
  - Switch	: MediaTek MT7621A (MT7530)
- LEDs/Input	: 2x/3x (2x buttons, 1x slide-switch)
- UART		: through-hole on PCB
  - J5: Vcc, TX, RX, NC, GND
  - 57600 bps

Flash instruction using initramfs image:

1. Boot WN-AX1167GR2 normally
2. Access to "http://192.168.0.1/" and open firmware update page
("ファームウェア")
3. Select the OpenWrt initramfs image and click update ("更新")
button to perform firmware update
4. On the initramfs image, perform sysupgrade with squashfs-sysupgrade
image
5. Wait ~120 seconds to complete flashing

Notes:

- configuration in DeviceTree of DBDC (Dual-Band-Dual-Concurrent) mode
for MT7615D chip is not supported in mt76 driver
- last 0x80000 (512 KiB) in NAND flash is not used on stock firmware
- stock firmware requires "customized uImage header" by MSTC
(MitraStar Technology Corp.), but U-Boot doesn't
  - uImage magic (0x0 - 0x3) : 0x434F4D42 (COMB)
  - header crc32 (0x4 - 0x7) : with data length and data crc32
  - image name (0x20 - 0x37) : model ID and firmware versions
  - data length (0x38 - 0x3b): kernel + rootfs
  - data crc32 (0x3c - 0x3f) : kernel + rootfs

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
Reviewed-by: Sungbo Eo <mans0n@gorani.run>
4 years ago
INAGAKI Hiroshi 3c0e2aa63e ramips: add support for I-O DATA WN-DX1167R
I-O DATA WN-DX1167R is a 2.4/5 GHz band 11ac rotuer, based on MediaTek
MT7621A.

Specification:

- SoC		: MediaTek MT7621A
- RAM		: DDR3 128 MiB
- Flash		: NAND 128 MiB
- WLAN		: MediaTek MT7615D (2.4/5 GHz, 2T2R)
- Ethernet	: 5x 10/100/1000 Mbps
  - Switch	: MediaTek MT7621A (MT7530)
- LEDs/Input	: 2x/3x (2x buttons, 1x slide-switch)
- UART		: through-hole on PCB
  - J5: Vcc, TX, RX, NC, GND
  - 57600 bps

Flash instruction using initramfs image:

1. Boot WN-DX1167R normally
2. Access to "http://192.168.0.1/" and open firmware update page
("ファームウェア")
3. Select the OpenWrt initramfs image and click update ("更新")
button to perform firmware update
4. On the initramfs image, perform sysupgrade with squashfs-sysupgrade
image
5. Wait ~120 seconds to complete flashing

Notes:

- configuration in DeviceTree of DBDC (Dual-Band-Dual-Concurrent) mode
for MT7615D chip is not supported in mt76 driver
- last 0x80000 (512 KiB) in NAND flash is not used on stock firmware
- stock firmware requires "customized uImage header" by MSTC
(MitraStar Technology Corp.), but U-Boot doesn't
  - uImage magic (0x0 - 0x3) : 0x434F4D43 (COMC)
  - header crc32 (0x4 - 0x7) : with data length and data crc32
  - image name (0x20 - 0x37) : model ID and firmware versions
  - data length (0x38 - 0x3b): kernel + rootfs
  - data crc32 (0x3c - 0x3f) : kernel + rootfs

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
Reviewed-by: Sungbo Eo <mans0n@gorani.run>
4 years ago
INAGAKI Hiroshi be4d53bf69 ramips: extend and rename wr1201-factory-header
This commit adds the ability to set custom uImage magic to
Build/wr1201-factory-header and renames it to
"Build/custom-initramfs-uimage".

Custom uImage header in initramfs image is required on following
devices:

- I-O DATA WN-AX1167GR2
- I-O DATA WN-AX2033GR
- I-O DATA WN-AX2033GR2
- I-O DATA WN-DX1167R

While at it, fix typo in comment.

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
Reviewed-by: Sungbo Eo <mans0n@gorani.run>
[shorten commit title, minor commit message adjustments]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler 3227afbbab ramips: collect and harmonize TP-Link image variants in common file
This moves the various variants of common device definitions for
TP-Link devices to a common Makefile common-tp-link.mk. This
provides the opportunity to reorganize and move parameters between
individual device definitions and the common ones.

While at it, also use the common definitions for previously
independent definitions where appropriate.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler dc862be301 ramips: define SOC only once for uniform targets
In ramips, all devices in mt7621, mt76x8 and rt288x subtarget have
the same value set to the SOC variable for each device individually.

This patch introduces a non-device-dependent variable DEFAULT_SOC,
which is used if no specific SOC is set for a device, and thus reduces
the number of redundant definitions drastically.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Petr Štetiar 28080d54d2 ramips: mt7621: disable images for gehua_ghl-r-001
This device OOPs during the boot due to broken flash. It can be probably
fixed with `broken-flash-reset` once ramips is on 4.19 kernel.

So disable images for this device until its fixed.

Ref: FS#2695, PR#2483
Signed-off-by: Petr Štetiar <ynezz@true.cz>
4 years ago
David Bauer 8f0effc462 ramips: disable image build for HiWiFi HC5962
Image builds for the ramips-mt7621 target currently fail with:
> WARNING: Image file ./hiwifi_hc5962-kernel.bin is too big
Disable this board for now. It can still be built using the SDK.

Signed-off-by: David Bauer <mail@david-bauer.net>
4 years ago
Yong-hyu Ban 99dd2709b8 ramips: add support for ipTIME A8004T
ipTIME A8004T is a 2.4/5GHz band AC2600 router, based on Mediatek
MT7621A.

Specifications:
- SoC: MT7621A
- RAM: DDR3 256M
- Flash: SPI NOR 16MB
- WiFi:
  - 2.4GHz: MT7615E
  - 5GHz: MT7615E
- Ethernet: 5x 10/100/1000Mbps
  - Switch: SoC internal
- USB: 1 * USB3.0 port
- UART:
  - J4: 3.3V, TX, RX, GND (3.3V is the square pad) / 57600 8N1
- Other info:
  - J9: Unknown unpopulated header.

Installation via web interface:
1.  Flash **initramfs** image through the stock web interface.
2.  Boot into OpenWrt and perform sysupgrade with sysupgrade image.

Revert to stock firmware:
1.  Perform sysupgrade with stock image.

Signed-off-by: Yong-hyu Ban <perillamint@quendi.moe>
[do not enable xhci node in DTS which is already enabled in DTSI]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Maksym Medvedev 663b1a14e5 ramips: add support for Edimax RA21S
Edimax RA21S is a dual band 11ac router,
based on MediaTek MT7621A and MT7615N chips.

Specification:
- SoC: MediaTek MT7621A dual-core @ 880MHz
- RAM: 256M (Nanya NT5CC128M16IP)
- FLASH: 16MB (Macronix MX25L12835F)
- WiFi: 2.4/5 GHz 4T4R
  - 2.4GHz MediaTek MT7615N bgn
  - 5GHz MediaTek MT7615N nac
- Switch: SoC integrated Gigabit Switch (4 x LAN, 1 x WAN)
- USB: No
- BTN: Reset, WPS
- LED: 4 red LEDs, indistinguishable when case closed
- UART:  through-hole on PCB.
   J1: 3.3V - RX - GND - TX / 57600-8N1.  3.3V is the square pad

Installation:
Update the factory image via the OEM web-interface
(by default: http://192.168.2.1/)
User: admin
Password: 1234

The sysupgrade image can be installed via TFTP
from the U-Boot bootloader. Connect via ethernet port 2.

Tested on device by @UAb5eSMn

Signed-off-by: Maksym Medvedev <redrathnure@gmail.com>
[split DTS and take over improvements from RG21S, extend commit
message]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler 58e71e322b ramips: rename MTK_SOC to SOC
This replaces MTK_SOC by the newly introduced common SOC device
variable.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler e417ff88f1 ramips: harmonize line breaks in image Makefiles
This harmonizes the line wrapping in image Makefile device
definitions, as those are frequently copy-pasted and are a common
subject of review comments. Having the treatment unifying should
reduce the cases where adjustment is necessary afterwards.

Harmonization is achieved by consistently (read "strictly")
applying certain rules:
- Never put more than 80 characters into one line
- Fill lines up (do not break after 40 chars because of ...)
- Use one tab for indent after wrapping by "\"
- Only break after pipe "|" for IMAGE variables

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
DENG Qingfang 1b7199c90c ramips: add support for JCG JHR-AC876M
JCG JHR-AC876M is an AC2600M router

Hardware specs:
  SoC: MT7621AT
  2.4GHz: MT7615N 4x4 @ PCIe0
  5GHz: MT7615N 4x4 @ PCIe1
  Flash: Winbond W25Q128JVSQ 16MiB
  RAM: Nanya NT5CB128M16 256MiB
  USB 2.0 and 3.0 ports
  6 LEDs, 3 of which are connected to SoC GPIO
  Reset and WPS buttons

Flash instructions:
Stock to OpenWrt:
  Upload factory.bin in stock firmware's upgrade page,
  do not preserve settings

OpenWrt to stock:
  Push and hold the reset button for 5s while power cycling to
  enter recovery mode;
  Visit 192.168.1.1 and upload stock firmware

MAC addresses map:
  0x0004  *:1c  wlan2g/wan/label
  0x8004  *:20  wlan5g
  0xe000  *:1b  lan
  0xe006  *:1a  not used in stock fw

Signed-off-by: DENG Qingfang <dengqf6@mail2.sysu.edu.cn>
4 years ago
Sungbo Eo a972b1fb5f ramips: add support for ipTIME A6ns-M
ipTIME A6ns-M is a 2.4/5GHz band AC1900 router, based on MediaTek MT7621A.

Specifications:
- SoC: MT7621AT
- RAM: DDR3 128MB
- Flash: SPI NOR 16MB
- WiFi:
  - 2.4GHz: MT7615
  - 5GHz: MT7615
- Ethernet: 5x 10/100/1000Mbps
  - Switch: SoC internal
- UART:
  - J4: 3.3V, TX, RX, GND (3.3V is the square pad) / 57600 8N1

Installation via web interface:
1.  Flash **initramfs** image through the stock web interface.
2.  Boot into OpenWrt and perform sysupgrade with sysupgrade image.

Revert to stock firmware:
1.  Perform sysupgrade with stock image.

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
4 years ago
Sungbo Eo 0375c076b6 ramips: add support for ZIO FREEZIO
ZIO FREEZIO is a 2.4/5GHz band AC1200 router, based on MediaTek MT7621A.

Specifications:
- SoC: MT7621AT
- RAM: DDR3 128MB
- Flash: SPI NOR 16MB
- WiFi:
  - 2.4GHz: MT7603EN
  - 5GHz: MT7612EN
- Ethernet: 5x 10/100/1000Mbps
  - Switch: SoC internal
- USB: 1x 3.0
- UART:
  - J4: 3.3V, RX, TX, GND (3.3V is the square pad) / 57600 8N1

Notes:
- FREEZIO has almost the same board as WeVO W2914NS v2.
- Stock firmware is based on OpenWrt BB.

MAC addresses in factory partition:
0x0004: WiFi 2.4GHz (label_mac-8)
0x002e: WAN (label_mac)
0x8004: WiFi 5GHz (label_mac-4)
0xe000: LAN (label_mac+1)

Installation via web interface:
1.  Access web admin page and turn on "OpenWrt UI mode".
2.  Flash sysupgrade image through LuCI, with the "Keep settings" option
    OFF.

Revert to stock firmware:
1.  Perform sysupgrade with stock image.
    Make sure to NOT preserve settings.

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
[rebase, use mt7621_wevo_w2914ns-v2.dtsi]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Sungbo Eo 19800ac095 ramips: set uImage name of WeVO 11AC NAS and W2914NS v2
The stock firmware and bootloader only accept uImage with names that
match certain patterns. This patch enables OpenWrt installation from
stock firmware without having to reflash the bootloader or access the
UART console.

Installation via web interface:
1.  Flash **initramfs** image through the stock web interface.
2.  Boot into OpenWrt and perform sysupgrade with sysupgrade image.

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
5 years ago
Piotr Dymacz e68539aca4 ramips: add support for ALFA Network Quad-E4G
ALFA Network Quad-E4G is a universal Wi-Fi/4G platform, which offers
three miniPCIe (PCIe, USB 2.0, SIM) and a single M.2 B-key (dual-SIM,
USB 3.0) slots, RTC and five Gigabit Ethernet ports with PoE support.

Specification:

- MT7621A (880 MHz)
- 256/512 MB of RAM (DDR3)
- 16/32+ MB of FLASH (SPI NOR)
- optional second SPI flash (8-pin WSON/SOIC)
- 1x microSD (SDXC) flash card reader
- 5x 10/100/100 Mbps Ethernet, with passive PoE support (24 V) in LAN1
- optional 802.3at/af PoE module for WAN
- 3x miniPCIe slot (with PCIe and USB 2.0 buses, micro SIM and 5 V)
- 1x M.2/NGFF B-key 3042 (USB 3.0/2.0, mini + micro SIM)
- RTC (TI BQ32002, I2C bus) with backup battery (CR2032)
- external hardware watchdog (EM Microelectronic EM6324)
- 1x USB 2.0 Type-A
- 1x micro USB Type-B for system serial console (Holtek HT42B534)
- 11x LED (5 for Ethernet, 5 driven by GPIO, 1x power indicator)
- 3x button (reset, user1, user2)
- 1x I2C (4-pin, 2.54 mm pitch) header on PCB
- 4x SIM (6-pin, 2.00 mm pitch) headers on PCB
- 2x UART2/3 (4-pin, 2.54 mm pitch) headers on PCB
- 1x mechanical power switch
- 1x DC jack with lock (24 V)

Other:

- U-Boot selects default SIM slot, based on value of 'default_sim' env
  variable: '1' or unset -> SIM1 (mini), '2' -> SIM2 (micro). This board
  has additional logic circuit for M.2 SIM switching. The 'sim-select'
  will work only if both SIM slots are occupied. Otherwise, always slot
  with SIM inside is selected, no matter 'sim-select' value.
- U-Boot enables power in all three miniPCIe and M.2 slots before
  loading the kernel
- this board supports 'dual image' feature (controlled by 'dual_image'
  U-Boot environment variable)
- all three miniPCIe slots have additional 5 V supply on pins 47 and 49
- the board allows to install up to two oversized miniPCIe cards (vendor
  has dedicated MediaTek MT7615N/D cards for this board)
- this board has additional logic circuit controlling PERSTn pins inside
  miniPCIe slots. By default, PERSTn (GPIO19) is routed to all miniPCIe
  slots but setting GPIO22 to high allows PERSTn control per slot, using
  GPIO23-25 (value is inverted)

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>
5 years ago
Adrian Schmutzler 65d76175a5 ramips: improve common definition for Netgear R6xxx in mt7621.mk
This patch renames and reassembles the common definition for
Netgear R6xxx devices in mt7621.mk. The following goals should be
achieved:
- Give the node a more generic name instead of adding devices to it
- Use the common definition in the (less) similar R6220 node
- Include/exclude settings into the common definition so the common
  node contains the common definitions
- Prepare for support of R6700 v2

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Paul Fertser 522d5ff428 ramips: add support for Xiaomi Mi Wi-Fi Router 3G v2
- CMIIT ID: 2019AP2581
- SoC:      MediaTek MT7621
- Flash:    16MiB NOR SPI (GigaDevice GD25Q128B)
- RAM:      128MiB DDR3 (ESMT M15T1G1664A)
- Serial:   As marked on PCB, 3V3 logic, baudrate is 115200, 8n1
- Ethernet: 3x 10/100/1000 Mbps (switched, 2xLAN + WAN)
- WIFI0:    MT7603E 2.4GHz 802.11b/g/n
- WIFI1:    MT7612E 5GHz 802.11ac
- Antennas: 4x external (2 per radio), non-detachable
- LEDs:     Programmable "power" LED (two-coloured, yellow/blue)
            Non-programmable "internet" LED (shows WAN activity)
- Buttons:  Reset

INSTALLATION:

Bootloader won't accept any serial input unless "boot_wait" u-boot
environment variable is changed to "on". Vendor firmware (looks like
an illegal OpenWrt fork) won't accept any serial input unless
"uart_en" is set to "1". Tricks to force u-boot to use default
environment do not help as it's restricted in the same way.

With bootloader unlocked the easiest way would be to TFTP the
sysupgrade image or to sysupgrade after loading an initramfs one.

For porting the flash contents were changed externally with an SPI
programmer (after lifting Vcc flash IC pin away from the PCB).

Forum thread [0] indicates that this device is identical to "Xiaomi Mi
Router 4A Gigabit Edition".

[0] https://forum.openwrt.org/t/xiaomi-mi-router-4a-gigabit-edition-r4ag-r4a-gigabit-fully-supported-but-requires-overwriting-spi-flash-with-programmer/36685

Signed-off-by: Paul Fertser <fercerpav@gmail.com>
5 years ago
Gabor Varga 7c5f712e4f ramips: add support for Asus RT-AC65P
The Asus RT-AC65P router is identical with the RT-AC85P, but better to make separate images for it.

On both routers the installation can be done also via SSH:

Note: The user/password for SSH is identical with the one used in the
Web-interface.

1. Complete the initial setup wizard.
2. Activate SSH under "Administration" -> "System".
3. Transfer the OpenWrt factory image via scp:
 > scp openwrt-ramips-mt7621-asus_rt-ac65p-squashfs-factory.bin admin@192.168.50.1:/tmp
4. Connect via SSH to the router.
 > ssh admin@192.168.50.1
5. Write the OpenWrt image to flash.
 > mtd-write -i
/tmp/openwrt-ramips-mt7621-asus_rt-ac65p-squashfs-factory.bin -d linux
6. Reboot the router
 > reboot

Changelog:

v3: removed [] from filename, rebased to latest master
v2: Rebased to latest master
v1: Initial release

Signed-off-by: Gabor Varga <vargagab@gmail.com>
5 years ago
Adrian Schmutzler e4155bcc45 ramips: fix TARGET_DEVICES after UniElec rename
Device node names were updated, but updating TARGET_DEVICES
was overlooked.

Fixes: 4408723d42 ("ramips: remove RAM size from device name
for UniElec devices")

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Adrian Schmutzler 4408723d42 ramips: remove RAM size from device name for UniElec devices
UniElec devices are the last ones in ramips target still having
the RAM size in device name although RAM size is auto-detected.

Remove this from device name, compatible, etc., as it's not
required and might be misleading to users and developers adding
device support copying those devices.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Roger Pueyo Centelles ac36cca012 ramips: mt7621: Alternative name KE 2P for Phicomm K2P
The Phicomm KE 2P is identical to the already supported Phicomm K2P,
renamed for the European market. Use the ALT0 buildroot tags to show
both devices.

Signed-off-by: Roger Pueyo Centelles <roger.pueyo@guifi.net>
5 years ago
Adrian Schmutzler b376818f97 ramips: harmonize device vendor Zbtlink
Spelling of Zbtlink varies across image definitions and DTS files.

This patch uses Zbtlink consistently and also updates the model
in DTS files to contain the vendor in all cases.

This patch is cosmetical, as there should be no dependencies on
device model name in ramips anymore.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
INAGAKI Hiroshi 12ab6ef5c3 ramips: add support for I-O DATA WNPR2600G
I-O DATA WNPR2600G is a 2.4/5 GHz band 11ac router, based on MediaTek
MT7621A.

Specification:

- SoC           : MediaTek MT7621A
- RAM           : DDR3 128 MiB
- Flash         : SPI-NOR 16 MiB
- WLAN          : 2.4/5 GHz 4T4R
  - 2.4 GHz     : MediaTek MT7615
  - 5 GHz       : MediaTek MT7615
- Ethernet      : 10/100/1000 Mbps
  - Switch      : MT7530 (SoC)
- LED/keys      : 4x/3x (2x buttons, 1x slide-switch)
- UART          : through-hole on PCB
  - J1: Vcc, RX, GND, TX from SoC side
  - 57600n8

Flash instruction using factory image:

1. Boot WNPR2600G 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
INAGAKI Hiroshi c1394dabf6 ramips: move "elx-header" to Makefile from mt7620.mk and mt7621.mk
I-O DATA WNPR2600G has an "elx-header", so move this definition to
generic makefile to use it from mt7621 subtarget.
This definition is also added to mt7621.mk in
f285e8634c, so remove it from mt7621.mk.

And added a line to cleanup used header file.

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
5 years ago
Qi Jiang 93b6cc97ca ramips: add support for XiaoYu XY-C5
Hardware:
SoC:      MT7621A
Flash:    32 MiB
RAM:      512 MiB
Ethernet: built-in switch
USB:      1x USB3.0
SATA:     ASM1060, 1 SATA port

Flash instruction (TFTP):
1. Set PC to fixed ip address 192.168.173.22
2. Download *-sysupgrade.bin image and rename it to firmware.img
3. Start a tftp server with the image file in its root directory
4. Turn off the router
5. Turn on router,press the reset button and wait ~15 seconds
6. Release the reset button and after a short time
   the firmware should be transferred from the tftp server
7. Wait ~3 minutes to complete recovery.

Signed-off-by: Qi Jiang <rushx@live.cn>
[squash commits, add label-mac-device, fix sign-off style]
Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
5 years ago
Daniel Danzberger 10c5d3dd5f ramips: mt7621: Add new device AsiaRF AP7621-NV1
SoC:    Mediatek MT7621A
CPU:    4x 880Mhz
Cache:  32 KB I-Cache and 32 KB D-Cach
        256 KB L2 Cache (shared by Dual-Core)
RAM:    DDR3 512MB 16bits BUS
FLASH:  16MB
Switch: Mediatek Gigabit Switch (2 x LAN, 1 x WAN)
POE:    (1x PD, 2x PSE)
USB:    1x 3.0
PCI:    3x Mini PCIe (3 USB2.0 + 2 x UIM interface)
GPS:    Quectel L70B
SIM:    2 Slots
BTN:    Reset
LED:    - Power
        - Ethernet
        - Wifi
        - USB
UART:  UART is present as Pads with throughholes on the PCB.
       They are located on left side.
       3.3V - RX - GND - TX / 57600-8N1
       3.3V is the square pad

Installation
------------
The stock image is a modified openwrt and can be overflashed via sysupgrade -F

Signed-off-by: Daniel Danzberger <daniel@dd-wrt.com>
[merge conflict in mt7621.mk]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
5 years ago
Birger Koblitz fde8e2e035 ramips: add support for Asus RT-AC85P
SoC:	MediaTek MT7621AT dual-core @ 880MHz
RAM:	256M (Winbond W632GG6KB-1)
FLASH:	128MB (Macronix MX30LF1G18AC-TI)
WiFi:	- 2.4GHz MediaTek MT7615N bgn
	- 5GHz MediaTek MT7615N nac
Switch: SoC integrated Gigabit Switch (4 x LAN, 1 x WAN)
USB:	1 x USB 3.1 (Gen 1)
BTN:	Reset, WPS
LED:	- Power (blue)
	- 5Ghz (blue)
	- 2.4GHz (blue)
	- Internet (blue)
	- 4x LAN (blue)
	(LAN/WAN leds are not controllable by GPIOs)
UART: 	UART is present as Pads marked J4 on the PCB.
	3.3V - TX - RX - GND / 57600-8N1
	3.3V is the square pad
MAC:	The MAC address on the router-label matches the MAC of
	the 2.4 GHz WiFi.
	LAN and WAN MAC are identical: MAC_LABEL+4
	5 GHz WiFi MAC: also MAC_LABEL+4

Installation
------------
Via U-Boot tftpd:
Switch on device, within 2s press reset button and keep pressed
until power LED starts blinking slowly.
Upload factory image via tftp put, the router's ip is 192.168.1.1
and expects the client on 192.168.1.75.

The images also work on the Asus RT-AC65P models as tested by Gabor.

Signed-off-by: Birger Koblitz <mail@birger-koblitz.de>
Tested-by: Gabor Varga <vargagab@gmail.com>
[fixed Asus -> ASUS in DTS]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
5 years ago
Birger Koblitz f285e8634c ramips: add support for Edimax RG21S
SoC:	MediaTek MT7621AT dual-core @ 880MHz
RAM:	256M (Nanya NT5CC128M)
FLASH:	16MB (Macronix MX25L12835F)
WiFi:	- 2.4GHz MediaTek MT7615N bgn
	- 5GHz MediaTek MT7615N nac
Switch: SoC integrated Gigabit Switch (4 x LAN, 1 x WAN)
USB:	No
BTN:	Reset, WPS
LED:	4 red LEDs, indistinguishable when casing closed
UART: 	UART is present as Pads marked J1 on the PCB.
	3.3V - RX - GND - TX / 57600-8N1
	3.3V is the square pad

Installation
------------
Update the factory image via the OEM web-interface
(by default:http://192.168.1.1)
The sysupgrade image can be installed via TFTP from
the U-Boot bootloader. Connect ethernet port 2.

Signed-off-by: Birger Koblitz <mail@birger-koblitz.de>
[flash node rename, EDIMAX -> Edimax, complete device model name]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
5 years ago
Christoph Krapp 6cea9688af ramips: add support for Netgear R6260 and R6850
As Netgear uses the same image for R6260, R6350 & R6850
we can merge device tree files and generate separate
images for each device.

Signed-off-by: Christoph Krapp <achterin@googlemail.com>
[add missing WiFi compatible string, fix network
configuration]
Signed-off-by: David Bauer <mail@david-bauer.net>
5 years ago
Christoph Krapp 3c8df280a9 ramips: add factory image for Netgear R6350
This adds factory image generation for all three
devices. These images can be flashed via WebUI
for easy installation.

Thanks to David Bauer for the inspiration.

Signed-off-by: Christoph Krapp <achterin@googlemail.com>
[altered commit to only include the R6350]
Signed-off-by: David Bauer <mail@david-bauer.net>
5 years ago
Christoph Krapp 9861fa7aba ramips: add mt7615e support to Netgear R6350
Signed-off-by: Christoph Krapp <achterin@googlemail.com>
5 years ago
David Bauer 607dfdf211 ramips: add factory image for NETGEAR R6220
This adds an easy-installation factory image for the NETGEAR R6220
router. The factory image can either be flashed via the vendor Web-UI or
the bootloader using nmrpflash.

Tested with NETGEAR V1.1.0.86 firmware.

Signed-off-by: David Bauer <mail@david-bauer.net>
5 years ago
Zhenjian Zhang fb3574f123 ramips: add support for ADSLR G7
SoC: MT7621AT
RAM: 256MB
Flash: 16M SPI
Ethernet: 5x GE ports
WiFi: 2.4G: MT7615N
5G: MT7615N

Flash instruction:
1.Modify the file to linux.bin
2.Set up FTP service
3.Computer settings fixed IP: 192.168.179.50 255.255.255.0
4.Turn on the power and press and hold the reset button until the indicator light is on for about 5 seconds.

Signed-off-by: Zhenjian Zhang <itdesk.zhang@gmail.com>
[fix mac location]
Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
5 years ago
Felix Fietkau 7ec092e641 Revert faulty tree push
Revert "mac80211: add new minstrel_ht patches to improve probing on mt76x2" (9861050b85)
Revert "kernel: use bulk free in kfree_skb_list to improve performance" (98b654de2e)
Revert "ramips: add preliminary support for WIO ONE" (085141dc5b)
Revert "ramips: add preliminary support for SGE AP-MTKH7-0006 developer board" (b1db6d0539)
Revert "build: use config.site generated by autoconf-lean, drop hardcoded sitefiles" (363ce4329d)
Revert "toolchain: add autoconf-lean" (fdb30eed03)
Revert "build: allow overriding the filename on the remote server when downloading" (6fa0e07758)

Signed-off-by: Felix Fietkau <nbd@nbd.name>
5 years ago
Felix Fietkau 085141dc5b ramips: add preliminary support for WIO ONE
Signed-off-by: Felix Fietkau <nbd@nbd.name>
5 years ago
Felix Fietkau b1db6d0539 ramips: add preliminary support for SGE AP-MTKH7-0006 developer board
Signed-off-by: Felix Fietkau <nbd@nbd.name>
5 years ago
Ozgur Can Leonard d7c082ba4f ramips: add kmod-mt7615e to Xiaomi Mi Router 3 Pro images
Now that the mt76/mt7615e driver is in Openwrt, might as well use it.

Signed-off-by: Ozgur Can Leonard <ozgurcan@gmail.com>
5 years ago
Adrian Schmutzler f14a5c3f2f ramips: use kiB instead of B for IMAGE_SIZE
This cosmetical patch is just meant to make comparing/checking
IMAGE_SIZE values easier.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Adrian Schmutzler 9d87a58d34 ramips: remove ralink_default_fw_size_xxx variables
There are frequent examples of the ralink_default_fw_size_xxx
variables being used to "roughly" set flash size without caring
about the actual size of the firmware partition.

To discourage this behavior, this patch removes the variables and
just sets IMAGE_SIZE by its numeric value for each target.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Adrian Schmutzler 363197311b ramips: remove default IMAGE_SIZE for ramips target
Currently, ramips target defines 0x7b0000 as default IMAGE_SIZE
for all devices in ramips target, i.e. this will be set if a
device does not specify IMAGE_SIZE itself.

From 92 devices using that default due to a "missing" IMAGE_SIZE,
14 were incorrect by a small amount (i.e. still "8M" flash) and
12 were completely off ("16M", "4M", ...).

This patch thus removes the _default_ IMAGE_SIZE and defines
IMAGE_SIZE for each device individually. This should indicate to
people supporting new devices that this parameter has to be cared
about.

For the present code, this patch is cosmetical.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Adrian Schmutzler 7263838e69 ramips/mt7621: fix IMAGE_SIZE for all devices
This fixes IMAGE_SIZE for all devices based on the partition size
given in DTS:

DEVICE                     *.MK     *.DTS     VERDICT
afoundry_ew1200            (16M)    0xfb0000
asiarf_ap7621-001          (16M)    0xfa0000  wrong
buffalo_wsr-1166dhp        (16M)    0xf90000  wrong
buffalo_wsr-600dhp         (16M)    0xfb0000
dlink_dir-860l-b1          (16M)    0xfb0000
d-team_newifi-d2           (32M)    0x1fb0000
d-team_pbr-m1              (16M)    0xfb0000
elecom_wrc-1167ghbk2-s     15488k   0xf20000
elecom_wrc-1900gst         11264k   0xb00000
elecom_wrc-2533gst         11264k   0xb00000
firefly_firewrt            (16M)    0xfb0000
gehua_ghl-r-001            (32M)    0x1fb0000
gnubee_gb-pc1              (32M)    0x1fb0000
gnubee_gb-pc2              (32M)    0x1fb0000
hiwifi_hc5962              (32M)    0x2000000 wrong (kernel + ubi)
iodata_wn-ax1167gr         15552k   0xf30000
iodata_wn-gx300gr          7798784  0x770000
lenovo_newifi-d1           (32M)    0x1fb0000
linksys_re6500             -        0x7b0000  default
mediatek_ap-mt7621a-v60    (8M)     0x7b0000
mediatek_mt7621-eval-board (4M)     0xec0000  wrong (rootfs)
mikrotik_rb750gr3          [16128k] 0xfc0000
mikrotik_rbm11g            [16128k] 0xFC0000
mikrotik_rbm33g            [16128k] 0xFC0000
mqmaker_witi-256m          (16M)    0xfb0000
mqmaker_witi-512m          (16M)    0xfb0000
mtc_wr1201                 16000k   0xfa0000
netgear_ex6150             14848k   0xe80000
netgear_r6220              28672k   0x1c00000
netgear_r6350              40960k   0x2800000
netgear_wndr3700-v5        15232k   0xee0000
netis_wf-2881              129280k  0x7E40000
phicomm_k2p                15744k   0xf60000
planex_vr500               66453504 0x3fb0000 wrong
samknows_whitebox-v8       (16M)    0xfb0000
storylink_sap-g3200u3      -        0x7b0000  default
telco-electronics_x1       16064k   0xfb0000
thunder_timecloud          -        0xfb0000  wrong
totolink_a7000r            16064k   0xfb0000
tplink_re350-v1            6016k    0x5e0000
ubiquiti_edgerouterx       -        0xfa00000 wrong (kernel1 + ubi)
ubiquiti_edgerouterx-sfp   -        0xfa00000 wrong (kernel1 + ubi)
unielec_u7621-06-256m-16m  16064k   0xfb0000
unielec_u7621-06-512m-64m  65216k   0x3fb0000
wevo_11acnas               (16M)    0xfb0000
wevo_w2914ns-v2            (16M)    0xfb0000
xiaomi_mir3g               32768k   0x7980000 wrong (kernel + ubi)
xiaomi_mir3p               (32M)    0xf980000 wrong (kernel + ubi)
xzwifi_creativebox-v1      (32M)    0x1fb0000
youhua_wr1200js            16064k   0xfb0000
youku_yk-l2                (16M)    0xfb0000
zbtlink_zbt-we1326         (16M)    0xfb0000
zbtlink_zbt-we3526         (16M)    0xfb0000
zbtlink_zbt-wg2626         (16M)    0xfb0000
zbtlink_zbt-wg3526-16m     (16M)    0xfb0000
zbtlink_zbt-wg3526-32m     (32M)    0x1fb0000

No verdict means that the device is correctly set.

Legend:
( ): Value is set via ralink_default_fw_size_xxM
[ ]: Value is derived from parent definition
 - : Value is not set and derived from default definition

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Adrian Schmutzler 7392af7520 ramips: fix ralink_default_fw_size_16M
In ramips, there are the following predefined values for IMAGE_SIZE
ralink_default_fw_size_4M    3866624   3776k   0x3B0000
ralink_default_fw_size_8M    8060928   7872k   0x7B0000
ralink_default_fw_size_16M  16121856  15744k   0xF60000
ralink_default_fw_size_32M  33226752  32448k  0x1FB0000

Out of those, the "16M" value is obviously odd, as it provides more
room for the remaining partitions than the tree others.
Of the devices in all subtargets, there are actually > 50 that have
a firmware partition with 0xFB0000 size, while only 5 (!) have
0xF60000. From the former, many are set to
ralink_default_fw_size_16M anyway, although it is wrong at the
present point.

Consequently, it makes sense to change ralink_default_fw_size_16M
to 0xFB0000, and to update IMAGE_SIZE for the 5 devices with
0xF60000.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Roger Pueyo Centelles 7d684b7673 ramips: add kmod-mt7615e to Phicomm K2P images
Now that the mt76 driver supports the MT7615D chip found on these
devices, use it.

Also add the wpad-basic package.

Note: the driver supports operation on both the 2.4 GHz and the
      5 GHz bands, but not yet concurrently.

Signed-off-by: Roger Pueyo Centelles <roger.pueyo@guifi.net>
5 years ago
DENG Qingfang 0e6d97f961 ramips: enable Newifi D1 SD slot
Newifi D1 is shipped with an 8GB microSD card in its SD slot
Without SD driver users would not be able to use it unless manually installed

Signed-off-by: DENG Qingfang <dengqf6@mail2.sysu.edu.cn>
5 years ago
Georgi Vlaev 8c51ddeff0 ramips: add support for TP-Link RE650 v1
TP-Link RE650 v1 is a dual-band AC2600 range extender,
based on MediaTek MT7621A and MT7615E. According to the
wikidevi entry for RE650 this device is identical with
TP-Link RE500 as hardware. This patch supports only RE650.

Hardware specification:

- SoC 880 MHz - MediaTek MT7621AT
- 128 MB of DDR3 RAM
- 16 MB - Winbond 25Q128FVSG
- 4T4R 2.4 GHz - MediaTek MT7615E
- 4T4R 5 GHz - MediaTek MT7615E
- 1x 1 Gbps Ethernet - MT7621AT integrated
- 7x LEDs (Power, 2G, 5G, WPS(x2), Lan(x2))
- 4x buttons (Reset, Power, WPS, LED)
- UART header (J1) - 2:GND, 3:RX, 4:TX
  Serial console @ 57600,8n1

Flash instructions:

Upload
openwrt-ramips-mt7621-tplink_re650-v1-squashfs-factory.bin
from the RE650 web interface.

TFTP recovery to stock firmware:

Unfortunately, I can't find an easy way to recover the RE
without opening the device and using modified binaries. The
TFTP upload will only work if selected from u-boot, which
means you have to open the device and attach to the serial
console. The TFTP update procedure does *not* accept the
published vendor firmware binaries. However, it allows to
flash kernel + rootfs binaries, and this works if you have
a backup of the original contents of the flash. It's probably
possible to create special image out of the vendor binaries
and use that as recovery image.

Signed-off-by: Georgi Vlaev <georgi.vlaev@gmail.com>
[re-added variables for kernel header]
Signed-off-by: David Bauer <mail@david-bauer.net>
5 years ago
INAGAKI Hiroshi cda123fe69 ramips: add MT7615 wireless support for ELECOM WRC-1167GHBK2-S
ELECOM WRC-1167GHBK2-S has a MediaTek MT7615D chip for 2.4/5 GHz
wireless.

A driver package for MT7615 chip is added to OpenWrt in
a0e5ca4f35,
so add preliminary MT7615 chip support for WRC-1167GHBK2-S.

Note: Currently, DBDC mode for MT7615 is not supported in mt76 driver.

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
5 years ago
David Bauer 14e0e4f138 ramips: add support for ASUS RT-AC57U
SoC:   MediaTek MT7621AT
RAM:   128M (Winbond W631GG6KB-15)
FLASH: 16MB (Spansion S25FL128SA)
WiFi:  MediaTek MT7603EN bgn 2SS
WiFi:  MediaTek MT7612EN nac 2SS
BTN:   Reset - WPS
LED:    - Power
        - LAN {1-4}
        - WAN
        - WiFi 2.4 GHz
        - WiFi 5 GHz
        - USB
UART:  UART is present next to the Power LED.
       TX - RX - GND - 3V3 / 57600-8N1
       3V3 is the nearest one to the Power LED.

Installation
------------
Via TFTP:
1. Set your computers IP-Address to 192.168.1.75.
2. Power up the Router with the Reset button pressed.
3. Release the Reset button after 5 seconds.
4. Upload OpenWRT sysupgrade image via TFTP:
 > tftp -4 -v -m binary 192.168.1.1 -c put <IMAGE>

Via SSH:
Note: User/password for SSH is identical with the one used in the
Web-interface.
1. Complete the initial setup wizard.
2. Activate SSH under "Administration" -> "System".
3. Transfer the OpenWrt sysupgrade image via scp:
 > scp owrt.bin admin@192.168.1.1:/tmp
4. Connect via SSH to the router.
 > ssh admin@192.168.1.1
5. Write the OpenWrt image to flash.
 > mtd-write -i /tmp/owrt.bin -d linux
6. Reboot the router
 > reboot

Signed-off-by: David Bauer <mail@david-bauer.net>
5 years ago
Chuanhong Guo 087e14ab59 ramips: mt7621: merge two variants of MQmaker WiTi together
Since we can auto-detect memory now, we don't need 2 dts for two
memory variants.

Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
5 years ago
Adrian Schmutzler 447deed52a ramips: Sort all subtarget Makefiles
This patch applies sorting to the definitions as whole blocks.

Sorting has been performed fully automatic, line count differences
originate from double empty lines removed.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Adrian Schmutzler 7196ca1d49 ramips/mt7621: Name DTS files based on scheme
As introduced with ath79, DTS files for ramips will now be labelled
soc_vendor_device.dts(i). With this change, DTS files can be
selected automatically without further manual links.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Adrian Schmutzler 2f2a319f82 ramips/mt7621: Synchronize Makefiles with DTS compatible
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Chuanhong Guo 7a8d3432c7 ramips: use upstream RAW_APPENDED_DTB instead of our OWRTDTB
Upstream kernel added support for RAW_APPENDED_DTB on ralink arch
in the following commit:
02564fc89d3d ("ralink: Introduce fw_passed_dtb to arch/mips/ralink")

Use upstream solution and get rid of our OWRTDTB hack.
This commit set DEVICE_DTS to $$(DTS) instead of replacing DTS with
DEVICE_DTS in device profile because DTS variable will be dropped
in later commits.

Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
[Tested on mt7621/mt76x8]
Tested-by: Chuanhong Guo <gch981213@gmail.com>
[Tested on rt305x/mt7620]
Tested-by: INAGAKI Hiroshi <musashino.open@gmail.com>
5 years ago
Daniel Golle ee66fe4ea9 ramips: convert DEVICE_TITLE to new variables
Also unify naming and add details where they were missing.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
5 years ago
Chuanhong Guo 3f68cffd27 ramips: add support for TOTOLINK A7000R
Specifications:
- SoC: MT7621AT
- RAM: 128MB
- Flash: 16M SPI NOR
- Ethernet: 5x GE ports
- WiFi: 2.4G: MT7615N
        5G: MT7615N

Flash instruction:
Upload generated sysupgrade firmware through factory web interface.

Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
5 years ago
Daniel Danzberger 029c970464 ramips: mt7621: Add new device AsiaRF AP7621-001
Hardware specs:
SoC:	Mediatek MT7621A
CPU:	4x 880Mhz
Cache:	32 KB I-Cache and 32 KB D-Cach
	256 KB L2 Cache (shared by Dual-Core)
RAM:	DDR3 512MB 16bits BUS
FLASH:	16MB
Switch:	Mediatek Gigabit Switch (1 x LAN, 1 x WAN)
USB:	1x 3.0
PCI:	3x Mini PCIe
GPS:	Quectel L70B
BTN:	Reset
LED:	- Power
	- Ethernet
	- Wifi
	- USB
UART:	UART is present as Pads with throughholes on the PCB.
	They are located on left side.
	3.3V - RX - GND - TX / 57600-8N1
	3.3V is the square pad

Installation:
The stock image is a modified openwrt and can be overflashed via
 # sysupgrade -F image.bin

Signed-off-by: Daniel Danzberger <daniel@dd-wrt.com>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
[removed unused label, formatting]
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
Nicholas Smith 73e0f52b6e ramips: add support for Telco Electronics X1
Hardware:
SoC:   MT7621
DRAM:  256MB DDR3
Flash: 16MB SPI-NOR
WiFi:  2.4GHz: MT7603 @ PCIe0
WiFi:  5.8GHz: MT7612 @ PCIe1
Modem: Sierra Wireless MC74xx

Interfaces:
GBE RJ45 x5
mPCIe    x2
UART     x1
I2C      x1
JTAG     x1
UIM      x1
LEDs     x6

Flash instructions:
Flash from within the factory bootloader, firmware web interface or CLI using
sysupgrade -F -n

Signed-off-by: Nicholas Smith <mips171@icloud.com>
5 years ago
Jan Hoffmann 2fdd02cc7c ramips: add factory image for WNDR3700v5
This uses the existing rules for Sercomm factory images and moves them
to the ramips image Makefile, so they can be used in all subtargets.

The new factory image for WNDR3700v5 can be flashed using nmrpflash.

Signed-off-by: Jan Hoffmann <jan@3e8.eu>
5 years ago
Zhao Yu 32689e93c4 ramips: add support for Youku YK-L2
Hardware spec:

CPU: MTK MT7621A
RAM: 256MB
ROM: 16MB SPI Flash
WiFi: MT7603EN + MT7612EN
Button: 2 buttons (reset, wps)
LED: 8 LEDs (Power 2G 5G WPS Internet LAN1 LAN2 USB)
Ethernet: 3 ports, 2 LAN + 1 WAN
Other: USB3.0

Flashing instructions:

Visit the openwrt forum topic for this router:
https://forum.openwrt.org/t/add-openwrt-support-for-youku-yk-l2/34692

to get the bootloader and unlock firmware.

0. upgrade your router with the telnet firmware via the
   firmware upgrade page on the webui.

1. telnet 192.168.11.1 from your PC

2. Download the pb-boot-youku_l2-20190317-61b6d33.bin and transfer
   it to the /tmp directory of the router.

3. mtd write /tmp/pb-boot-youku_l2-20190317-61b6d33.bin Bootloader

4. turn off the power

5. Push the reset button while turning on the router and
   wait until LED start blinking (~10sec.)

6. Connect Ethernet port and goto http://192.168.1.1.

7. Upload the firmware to firmware restore page in webui.

Signed-off-by: Zhao Yu <574249312@qq.com>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com> [rewrote the
flashing instructions, fixed author]
5 years ago
David Bauer 3f019bf96c ramips: add Netgear EX6150
SoC:   MediaTek MT7621
RAM:   64M (Winbond W9751G6KB-25)
FLASH: 16MB (Macronix MX25L12835F)
WiFi:  MediaTek MT7662E bgn 2SS
WiFi:  MediaTek MT7662E nac 2SS
BTN:   ON/OFF - Reset - WPS - AP/Extender toggle
LED:    - Arrow Right (blue)
        - Arrow Left (blue)
        - WiFi 1 (red/green)
        - WiFi 2 (red/green)
        - Power (green/amber)
        - WPS (Green)
UART:  UART is present as Pads on the backside of the PCB. They are
       located on the other side of the Ethernet port.
       3.3V - GND - TX - RX / 57600-8N1
       3.3V is the nearest one to the antenna connectors

Installation
------------
Update the factory image via the Netgear web-interfaces (by default:
192.168.1.250/24).

You can also use the factory image with the nmrpflash tool.
For more information see https://github.com/jclehner/nmrpflash

Signed-off-by: David Bauer <mail@david-bauer.net>
[merge conflict in 02_network, flash@0 node rename, wlan DTS triggers]
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
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
Ju Se Hoon 9f90074db7 ramips: add kmod-mt76x2 to WeVo 11AC NAS
The WeVo 11AC NAS has a MT7612E 802.11ac chip on the PCB.

Signed-off-by: Ju Se Hoon <joosahoon@gmail.com>
[renamed author from Albis-dev to real name, editted commit message]
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
5 years ago
Anton Arapov 6ba58b7b02 ramips: cleanup the RB750Gr3 support
Always enable the pwr led and use the usr led for boot status indication.

Rename nodes in the dts, to match what is recommend in the devicetree
specification.

Increase the maximum spi frequency to 20MHz and drop the m25p,chunked-io
which isn't required on mt7621.

Use the BTN_0 keycode for the mode button. This board doesn't have any
wireless.

Use a more descriptive label for the reset button and the GPIO enabling
the usb vcc supply.

Use the beeper kernel module for the buzzer.

Fix the pinmux to switch only pins used as GPIOs to the GPIO function.
Add support for the PoE enable GPIO to the userspace. The PoE power
status can be read via GPIO7. Since OpenWrt doesn't have support for
reading inputs from userspace, prepare only the pinmux for the GPIO.

Signed-off-by: Anton Arapov <arapov@gmail.com>
Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
Signed-off-by: Mathias Kresin <dev@kresin.me>
5 years ago
Anton Arapov 52f2d7d2a9 ramips: add RB750Gr3 native support
This patch adds support of MikroTik RouterBOARD 750Gr3, without the need
to reflashing the bootloader.

Installation through RouterBoot follows the usual MikroTik method
https://openwrt.org/toh/mikrotik/common

Since the image isn't compatible with RouterBOARD 750Gr3 installations
which have replaced the bootloader, the former used userspace boardname
is not added to the SUPPORTED_DEVICES, to prevent a brick while trying
to upgrade to the image with native support.

Signed-off-by: Anton Arapov <arapov@gmail.com>
Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
Signed-off-by: Mathias Kresin <dev@kresin.me>
5 years ago
Mathias Kresin 7c1332d95f ramips: consolidate seama image build code
Create a common template which has the required image build code
defined. Add some new variables to pass individual parts to the seama
recipes.

Signed-off-by: Mathias Kresin <dev@kresin.me>
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
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>
5 years ago
Mathias Kresin 78ca6a5578 ramips: merge relocate compile into build recipe
Compile the loader if the relocate-kernel image recipe is used and get
rid of the legacy build code to do so.

Signed-off-by: Mathias Kresin <dev@kresin.me>
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
Mathias Kresin 1977be8bd0 ramips: unifiy sysupgrade file extensions
Use .bin as file extension where possible. The user doesn't need to that
sysupgrade images for NAND boards are tarballs.

Signed-off-by: Mathias Kresin <dev@kresin.me>
6 years ago
Mathias Kresin 7f00123d63 ramips: remove duplicate image build variables
Remove image build variables which are set to the same value as the
default image build recipe.

Signed-off-by: Mathias Kresin <dev@kresin.me>
6 years ago
Nishant Sharma df3e0b5806 ramips: add support for UniElec U7621-06-512M-64M variant
Add support for UniElec U7621-06 variant with 512MB RAM and 64MB flash.

Additional specs are below:

CPU: MT7621 (880Mhz)
Bootloader: Ralink U-Boot
Flash: 64MB
 - U-Boot identifies as Macronix MX66L51235F
 - kernel identifies as MX66L51235l (65536 Kbytes)
RAM: 512MB

Rest of the details as per commit 46ab81e405 ("ramips add support for
UniElec U7621-06")

Signed-off-by: Nishant Sharma <nishant@unmukti.in>
[use generic board detection, add firmware partition compatible, extend
firmware partition to use all of the remaining flash space, add a
maximum image size matching the firmware partition size]
Signed-off-by: Mathias Kresin <dev@kresin.me>
6 years ago
Mathias Kresin 509d02a3d1 ramips: use generic board detection for Unielec u7621-06
Use the generic board detection for the board instead of the target
specific one. Mark the sysupgrade image compatible with the former used
userspace boardname to allow an upgrade from earlier versions.

Signed-off-by: Mathias Kresin <dev@kresin.me>
6 years ago
Mathias Kresin 80c61c161a treewide: use wpad-basic for not small flash targets
Add out of the box support for 802.11r and 802.11w to all targets not
suffering from small flash.

Signed-off-by: Mathias Kresin <dev@kresin.me>

Mathias did all the heavy lifting on this, but I'm the one who should
get shouted at for committing.

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
6 years ago
Jo-Philipp Wich 77e2bccde8 ramips: only limit lzma dictionary size on mt7621
The changed dictionary size leads to a different LZMA header which breaks
sysupgrade image magic checkibng on at least some RT288x boards.

Since the commit message only mentions testing on MT7621 and since the
change appears to break at least one other ramips subtarget, do not take
any chances and restrict the size limitation to only MT7621.

Fixes FS#1797
Fixes 09b6755946 ("ramips: limit dictionary size for lzma compression")
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
6 years ago
NOGUCHI Hiroshi ad10e71bec ramips: add support for ELECOM WRC-1900GST
ELECOM WRC-1900GST is a wireless router, based on Mediatek MT7621A.
This is almost same as WRC-2533GST except wireless specs.

Specifications:

  - SoC : MT7621A (four logical CPU cores)
  - RAM : 128MiB
  - ROM : 16MiB of SPI NOR-FLASH
  - wireless :
          5GHz : 3T3R up to 1300Mbps/11ac with MT7615
          2.4GHz : 3T3R up to 600Mbps/11n with MT7615
  - Ethernet : 5 ports, all ports is capable of 1000base-T
  - Ether switch : MT7530 (MT7621A built-in)
  - LEDs : 4 LEDs
  - buttons : 2 buttons and 1 slide-switch
  - UART : header is on PCB, 57600bps

Flash instruction using factory image:

 1. Connect the computer to the LAN port of WRC-1900GST
 2. Connect power cable to WRC-1900GST and turn on it
 3. Access to "https://192.168.2.1/" and open firmware update
    page ("ファームウェア更新")
 4. Select the OpenWrt factory image and click apply ("適用")
    button
 5. Wait ~150 seconds to complete flashing

Signed-off-by: NOGUCHI Hiroshi <drvlabo@gmail.com>
6 years ago
INAGAKI Hiroshi ce93445cd6 ramips: add support for ELECOM WRC-2533GST
ELECOM WRC-2533GST is a 2.4/5 GHz band 11ac rotuer, based on
MediaTek MT7621A.

Specification:

- MT7621A (2-Core, 4-Threads)
- 128 MB of RAM (DDR3)
- 16 MB of Flash (SPI)
- 4T4R 2.4/5 GHz wifi
  - MediaTek MT7615
- 5x 10/100/1000 Mbps Ethernet
- 4x LEDs, 6 keys (2x buttons, 1x slide switch)
- UART header on PCB
  - Vcc, GND, TX, RX from ethernet port side
  - baudrate: 57600 bps

Flash instruction using factory image:

1. Connect the computer to the LAN port of WRC-2533GST
2. Connect power cable to WRC-2533GST and turn on it
3. Access to "https://192.168.2.1/" and open firmware update
page ("ファームウェア更新")
4. Select the OpenWrt factory image and click apply ("適用")
button
5. Wait ~150 seconds to complete flashing

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
6 years ago
Thibaut VARÈNE c4f09fc9f8 ramips: define common MikroTik RouterBOARD image recipe
All these devices share the exact same image format.

The usb3 kmod is added for the rbm11g, as the rbm11g has a mini-pcie
slot like its bigger sibling. The usb kmod is necessary for
usb-over-pcie support, which is mandatory for a lot of LTE modules.

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
6 years ago
INAGAKI Hiroshi 0b83a23560 ramips: add support for I-O DATA WN-AX1167GR
I-O DATA WN-AX1167GR is a 2.4/5 GHz band 11ac router, based on
MediaTek MT7621A.

Specification:

- MT7621A (2-Cores, 4-Threads)
- 64 MB of RAM (DDR2)
- 16 MB of Flash (SPI)
- 2T2R 2.4/5 GHz
- 5x 10/100/1000 Mbps Ethernet
- 2x LEDs, 4x keys (2x buttons, 1x slide switch)
- UART header on PCB
  - Vcc, GND, TX, RX from ethernet port side
  - baudrate: 115200 bps (U-Boot, OpenWrt)

Stock firmware:

In the stock firmware, WN-AX1167GR has two os images each composed of
Linux kernel and rootfs.
These images are stored in "Kernel" and "app" partition of the
following partitions, respectively.

(excerpt from dmesg):

MX25L12805D(c2 2018c220) (16384 Kbytes)
mtd .name = raspi, .size = 0x01000000 (16M) .erasesize = 0x00010000 (64K) .numeraseregions = 0
Creating 10 MTD partitions on "raspi":
0x000000000000-0x000001000000 : "ALL"
0x000000000000-0x000000030000 : "Bootloader"
0x000000030000-0x000000040000 : "Config "
0x000000040000-0x000000050000 : "Factory"
0x000000050000-0x000000060000 : "iNIC_rf"
0x000000060000-0x0000007e0000 : "Kernel"
0x000000800000-0x000000f80000 : "app"
0x000000f90000-0x000000fa0000 : "Key"
0x000000fa0000-0x000000fb0000 : "backup"
0x000000fb0000-0x000001000000 : "storage"

The flag for boot partition is stored in "Key" partition, and U-Boot
reads this and determines the partition to boot.

If the image that U-Boot first reads according to the flag is
"Bad Magic Number", U-Boot then tries to boot from the other image.
If the second image is correct, change the flag to the number
corresponding to that image and boot from that image.

(example):

## Booting image at bc800000 ...
Bad Magic Number,FFFFFFFF
Boot from KERNEL 1  !!
## Booting image at bc060000 ...
   Image Name:   MIPS OpenWrt Linux-4.14.50
   Image Type:   MIPS Linux kernel Image (lzma compressed)
   Data Size:    1865917 Bytes = 1.8 MB
   Load Address: 80001000
   Entry Point:  80001000
   Verifying Checksum ... OK
   Uncompressing Kernel Image ... OK
raspi_erase_write: offs:f90000, count:34
.
.
Done!

Starting kernel ...

Flash instruction using factory image:

1. Connect the computer to the LAN port of WN-AX1167GR
2. Connect power cable to WN-AX1167GR and turn on it
3. Access to "192.168.0.1" on the web browser and open firmware
update page ("ファームウェア")
4. Select the OpenWrt factory image and perform firmware update
5. On the initramfs image, execute "mtd erase firmware" to erase stock
firmware and execute sysupgrade with sysupgrade image for WN-AX1167GR
6. Wait ~180 seconds to complete flasing

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
6 years ago
Tobias Schramm faf64056dd ramips: add support for MikroTik RouterBOARD RBM11g
This commit adds support for the MikroTik RouterBOARD RBM11g.

=Hardware=

The RBM11g is a mt7621 based device featuring one GbE port and one
miniPCIe slot with a sim card socket and USB 2.0.

==Switch==

The single onboard Ethernet port is connected the CPU directly.
The internal switch of the mt7621 SoC is disabled.

==Flash==

The device has one spi nor flash chip. It is a 128 Mbit winbond 25Q128FVS
connected to CS0.

==PCIe==

The board features a single miniPCIe slot. It has a dedicated mini SIM
socket and a USB 2.0 port. Power to the miniPCIe slot is controlled via
GPIO9.

==USB==

There are no external USB ports.

==Power==

The board can accept both, passive PoE and external power via a 2.1 mm
barrel jack (center-positive). The input voltage range is 11-32 V.

==Serial port==

The device does have an onboard UART on an unpopulated header next to the
flash chip:

GND: pin 2
 TX: pin 7
 RX: pin 6

Settings: 115200, 8N1

See below illustration for positioning of the header.

0 = screw hole
* = some pin
T = TX  pin
R = RX  pin
G = GND pin

Pinout:
+---------------
|O
|             __
|            /  \
|            \__/
|
|
|
|               +---+
|               |RAM|
| +--+          |   |
| |**|  <- unpopulated header with UART
| |*T|          +---+
| |R*|        +--------+
| |**|        |        |
| |G*|        |  CPU   |
| +--+        |        |
|    +--+     |        |
|    |  |     +--------+
|    +--+  <- flash chip
|O
|       +-----+
|       |     |
|+--+   |     |
||  |   |     |
+---------------------

=Installation=

To install an OpenWRT image to the device two components must be built:

1. A openwrt initramfs image
2. A openwrt sysupgrade image

===initramfs & sysupgrade image===

Select target devices "Mikrotik RBM11G" in
openwrt menuconfig and build the images. This will create the images
"openwrt-ramips-mt7621-mikrotik_rbm11g-initramfs-kernel.bin" and
"openwrt-ramips-mt7621-mikrotik_rbm11g-squashfs-sysupgrade.bin" in the
output directory.

==Installing==

**Make sure to back up your RouterOS license in case you do ever want to
go back to RouterOS using "/system license output" and back up the
created license file.**

When rebooted the board will try booting via ethernet first. If your
board does not boot via ethernet automatically you will have to attach
to the serial port and set ethernet as boot device within RouterBOOT.

1. Set up a dhcp server that points the bootfile to tftp server serving
   the "openwrt-ramips-mt7621-mikrotik_rbm11g-initramfs-kernel.bin"
   initramfs image
2. Connect to ethernet port on board
3. Power on the board
4. Wait for OpenWrt to boot

Right now OpenWrt will be running with a SSH server listening. Now
OpenWrt must be flashed to the devices flash:

1. Copy "openwrt-ramips-mt7621-mikrotik_rbm11g-squashfs-sysupgrade.bin"
   to the device using scp.
2. Write openwrt to flash using "sysupgrade
   openwrt-ramips-mt7621-mikrotik_rbm11g-squashfs-sysupgrade.bin"

Once the flashing completes the board will reboot. Disconnect from the
devices ethernet port or stop the DHCP/TFTP server to prevent the device
from booting via ethernet again.
The device should now boot straight to OpenWrt.

Signed-off-by: Tobias Schramm <tobleminer@gmail.com>
6 years ago
Alex Maclean 2f23a0583a ramips: RE350: add rootfs offset to header
Have mktplinkfw fill in the rootfs offset so the firmware splitter can
find it without aligning to erase blocks.

Signed-off-by: Alex Maclean <monkeh@monkeh.net>
6 years ago
Tobias Schramm 5684d08741 ramips: Add support for Mikrotik RouterBOARD RBM33g
This commit adds support for the Mikrotik RouterBOARD RBM33g.

=Hardware=

The RBM33g is a mt7621 based device featuring three gigabit ports, 2
miniPCIe slots with sim card sockets, 1 M.2 slot, 1 USB 3.0 port and a male
onboard RS-232 serial port. Additionally there are a lot of accessible
GPIO ports and additional buses like i2c, mdio, spi and uart.

==Switch==

The three Ethernet ports are all connected to the internal switch of the
mt7621 SoC:

port 0: Ethernet Port next to barrel jack with PoE printed on it
port 1: Innermost Ethernet Port on opposite side of RS-232 port
port 2: Outermost Ethernet Port on opposite side of RS-232 port
port 6: CPU

==Flash==

The device has two spi flash chips. The first flash chips is rather small
(512 kB), connected to CS0 by default and contains only the RouterBOOT
bootloader and some factory information (e.g. mac address).
The second chip has a size of 16 MB, is by default connected to CS1 and
contains the firmware image.

==PCIe==

The board features three PCIe-enabled slots. Two of them are miniPCIe
slots (PCIe0, PCIe1) and one is a M.2 (Key M) slot (PCIe2).
Each of the miniPCIe slots is connected to a dedicated mini SIM socket
on the back of the board.

Power to all three PCIe-enabled slots is controlled via GPIOs on the
mt7621 SoC:

PCIe0: GPIO9
PCIe1: GPIO10
PCIe2: GPIO11

==USB==

The board has one external USB 3.0 port at the rear. Additionally PCIe
port 0 has a permanently enabled USB interface. PCIe slot 1 shares its
USB interface with the rear USB port. Thus only either the rear USB port
or the USB interface of PCIe slot 1 can be active at the same time. The
jumper next to the rear USB port controls which one is active:

open: USB on PCIe 1 is active
closed: USB on rear USB port is active

==Power==

The board can accept both, passive PoE and external power via a 2.1 mm
barrel jack. The input voltage range is 11-32 V.

=Installation=

==Prerequisites==

A USB -> RS-232 Adapter and a null modem cable are required for
installation.

To install an OpenWRT image to the device two components must be built:

1. A openwrt initramfs image
2. A openwrt sysupgrade image

===initramfs & sysupgrade image===

Select target devices "Mikrotik RBM33G" in
openwrt menuconfig and build the images. This will create the images
"openwrt-ramips-mt7621-mikrotik_rbm33g-initramfs-kernel.bin" and
"openwrt-ramips-mt7621-mikrotik_rbm33g-squashfs-sysupgrade.bin" in the output
directory.

==Installing==

**Make sure to back up your RouterOS license in case you do ever want to
go back to RouterOS using "/system license output" and back up the created
license file.**

Serial settings: 115200 8N1

The installation is a two-step process. First the
"openwrt-ramips-mt7621-mikrotik_rbm33g-initramfs-kernel.bin" must be booted
via tftp:

1. Set up a dhcp server that points the bootfile to tftp server serving
   the "openwrt-ramips-mt7621-mikrotik_rbm33g-initramfs-kernel.bin"
   initramfs image
2. Connect to WAN port (left side, next to sys-LED and power indicator)
3. Connect to serial port of board
4. Power on board and enter RouterBOOT setup menu
5. Set boot device to "boot over ethernet"
6. Set boot protocol to "dhcp protocol" (can be omitted if DHCP server
   allows dynamic bootp)
6. Save config
7. Wait for board to boot via Ethernet

On the serial port you should now be presented with the OpenWRT boot log.
The next steps will install OpenWRT persistently.

1. Copy "openwrt-ramips-mt7621-mikrotik_rbm33g-squashfs-sysupgrade.bin" to the device
   using scp.
2. Write openwrt to flash using "sysupgrade
   openwrt-ramips-mt7621-mikrotik_rbm33g-squashfs-sysupgrade.bin"

Once the flashing completes reboot the router and let it boot from flash.
It should boot straight to OpenWRT.

Signed-off-by: Tobias Schramm <tobleminer@gmail.com>
6 years ago
INAGAKI Hiroshi 189815462c ramips: add support for ELECOM WRC-1167GHBK2-S
ELECOM WRC-1167GHBK2-S is a 2.4/5 GHz band 11ac router, based on
MediaTek MT7621A.

Specification:

- MT7621A (2-Cores, 4-Threads)
- 128 MB of RAM (DDR3)
- 16 MB of Flash (SPI)
- 2T2R 2.4/5 GHz
  - MediaTek MT7615D
- 5x 10/100/1000 Mbps Ethernet
- 6x LEDs, 2x keys
- UART header on PCB
  - Vcc, GND, TX, RX from ethernet port side
  - baudrate: 57600 bps

Flash instruction using factory image:

1. Rename the factory image to "wrc-1167ghbk2-s_v0.00.bin"
2. Connect the computer to the LAN port of WRC-1167GHBK2-S
3. Connect power cable to WRC-1167GHBK2-S and turn on it
4. Access to "http://192.168.2.1/details.html" and open firmware
update page ("手動更新(アップデート)")
5. Select the factory image and click apply ("適用") button
6. Wait ~150 seconds to complete flashing

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
6 years ago
Mathias Kresin 4bb6ee465e ramips: mt7621: fix wireless package selection
Add wpad-mini if wireless drivers are included. Drop the mt76 package if
both of the provided drivers are included with their own packages.

Signed-off-by: Mathias Kresin <dev@kresin.me>
6 years ago
INAGAKI Hiroshi a32c06f44d ramips: add support for I-O DATA WN-GX300GR
I-O DATA WN-GX300GR is a 2.4 GHz band 11n router, based on MediaTek
MT7621S.

Specification:

- MT7621S (1-Core, 2-Threads)
- 64 MB of RAM
- 8 MB of Flash (SPI)
- 2T2R 2.4 GHz
- 5x 10/100/1000 Mbps Ethernet
- 2x LEDs, 4x keys (2x buttons, 1x slide switch)
- UART header on PCB
  - Vcc, GND, TX, RX from ethernet port side
  - baudrate: 115200 bps (U-Boot, OpenWrt)

Flash instruction using initramfs image:

1. Connect serial cable to UART header
2. Rename OpenWrt initramfs image for WN-GX300GR to "uImageWN-GX300GR"
and place it in the TFTP directory
3. Set the IP address of the computer to 192.168.99.8, connect to the
LAN port of WN-GX300GR, and start the TFTP server on the computer
4. Connect power cable to WN-GX300GR and turn on the router
5. Press "1" key on the serial console to interrupt boot process on
U-Boot, press Enter key 3 times and start firmware download via TFTP
6. WN-GX300GR downloads initramfs image and boot with it
7. On the initramfs image, execute "mtd erase firmware" to erase stock
firmware and execute sysupgrade with sysupgrade image for WN-GX300GR
8. Wait ~150 seconds to complete flasing

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
6 years ago
Rosen Penev 9685f39787 ramips: Use generic board detect for GnuBee devices
This is a port of an old commit from mkresin's tree:

09260cdf3e9332978c2a474a58e93a6f2b55f4a8

This has the potential to break sysupgrade but it should be fine as
there is no stable release of LEDE or OpenWrt that support these devices.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
6 years ago
Davide Ammirata 004cc22e4e ramips: add support for mqmaker witi 512mb version
Splitted out the dts file and create the new dts for the 256 MByte RAM and
the 512 MB RAM version.

Migrate both versions to the common board detection.

The install the 512 MByte Version on a board running the 256 MByte image,
a forceful sysupgrade with the -F flag is required.

Signed-off-by: Davide Ammirata <list@davidea.it>
6 years ago
Zheng Qian 80a94aacaf ramips: add support for the YouHua WR1200JS
YouHua tech WR1200JS is an AC1200 router with 5 1Gb ports (4 Lan, 1 Wan)
and 1 USB 2.0 port.

Devices is base on MediaTek MT7621AT + MT7603E + MT7612E.

Specification:

- MT7612AT (880 MHz)
- 128 MB of RAM
- 16 MB of FLASH (SPI NOR)
- 5x 10/100/1000 Mbps Ethernet
- 2T2R 2.4 GHz (MT7603E)
- 2T2R 5 GHz (MT7612E)
- 1x USB 2.0
- 10x LED (Power 2G 5G WPS Internet LAN4-1 USB)
- 3x button (reset wifi wps)
- DC jack for main power input (12V)

Installation:

1.) Press reset key 5 sec and restore the factory default
2.) Login webUI and change username to root and set a
    new password
3.) Visit http://192.168.2.254/adm/telnetd.shtml and
    turn on the telnet service
4.) Copy openwrt-ramips-mt7621-youhua_wr1200js-initramfs-kernel.bin
    to a usb pan
5.) Plug the usb pan to the router, telnet to the router
    and login by root
6.) cd /media/sda1 and check the initramfs file is there
7.) exec command:
    mtd_write write openwrt-ramips-mt7621-youhua_wr1200js-initramfs-kernel.bin Kernel
8.) reboot and visit 192.168.1.1

Signed-off-by: Zheng Qian <sotux82@gmail.com>
6 years ago
Roman Yeryomin f5984e0a0c ramips: mt7621: add Mediatek AP-MT7621A-V60 EVB support
This board has:
- mt7621 SoC
- 8MB SPI flash
- 128MB RAM
- 5x ethernet ports from internal (SoC) switch
- 1x ethernet port sitting on gmac2 and IC+ phy (not yet supported)
- 3x PCIe slots
- 1x USB 2.0 and 1x USB 3.0
- sound based on wm8960
- SDXC card slot (full size)

First fw write from interactive u-boot menu, interrupt with 2.
After that sysupgrade.

Tested both with 4.9 and 4.14

Signed-off-by: Roman Yeryomin <roman@advem.lv>
6 years ago
Mathias Kresin cb741654e5 ramips: improve GnuBee Personal Cloud Two support
Use the generic board detection for the GnuBee Personal Cloud Two
instead of the target specific one as all recent additions are doing.

Fixup the pinmux to set all pins used as GPIO to the function GPIO.
Request pins where used.

Drop the i2c from the dts. There is nothing connected. While at it fix an
indentation issue and use references instead of duplicating the whole
node path.

Use the same switch config as for the GB-PC1 and drop the led trigger for
the not supported IP1001 phy connected to second rgmii.

Fixes: c60a21532b ("ramips: Add support for the GnuBee Personal Cloud Two")
Signed-off-by: Mathias Kresin <dev@kresin.me>
6 years ago