Commit Graph

147 Commits (411a666df279eb44488be4c3a6d59228b87e3957)

Author SHA1 Message Date
Andreas Böhler 411a666df2 ramips: fix sysupgrade image for TP-Link RE200v1
Images generated for the TP-Link RE200v1 cannot be updated using
sysupgrade, because a necessary call to append-metadata was missing.

Signed-off-by: Andreas Böhler <dev@aboehler.at>
4 years ago
Andreas Böhler a3010a7f8d ramips: add support for TP-Link RE200 v1
TP-Link RE200 v1 is a wireless range extender with Ethernet and 2.4G and 5G
WiFi with internal antennas. It's based on MediaTek MT7620A+MT7610EN.

Specifications
--------------

- MediaTek MT7620A (580 Mhz)
- 64 MB of RAM
- 8 MB of FLASH
- 2T2R 2.4 GHz and 1T1R 5 GHz
- 1x 10/100 Mbps Ethernet
- UART header on PCB (57600 8n1)
- 8x LED (GPIO-controlled; only 6 supported), 2x button

There are 2.4G and 5G LEDs in red and green which are controlled
separately. The 5G LED is currently not supported, since the GPIOs couldn't
be determined.

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

Web Interface
-------------

It is possible to upgrade to OpenWrt via the web interface. However, the
OEM firmware upgrade file is required and a tool to fix the MD5 sum of
the header. This procedure overwrites U-Boot and there is not failsafe /
recovery mode present! To prepare an image, you need to take the header
and U-Boot (i.e. 0x200 + 0x20000 bytes) from an OEM firmware file and
attach the factory image to it. Then fix the header MD5Sum1.

Serial console
--------------

Opening the case is quite hard, since it is welded together. Rename the
OpenWrt factory image to "test.bin", then plug in the device and quickly
press "2" to enter flash mode (no line feed). Follow the prompts until
OpenWrt is installed.

Unfortunately, this devices does not offer a recovery mode or a tftp
installation method. If the web interface upgrade fails, you have to open
your device and attach serial console. Since the web upgrade overwrites
the boot loader, you might also brick your device.

Additional notes
----------------

MAC address assignment is based on stock-firmware. For me, the device
assigns the MAC on the label to Ethernet and the 2.4G WiFi, while the 5G
WiFi has a separate MAC with +2.

*:88    Ethernet/2.4G    label, uboot 0x1fc00, userconfig 0x0158
*:89    unused           userconfig 0x0160
*:8A    5G               not present in flash

This seems to be the first ramips device with a TP-Link v1 header. The
original firmware has the string "EU" embedded, there might be some region-
checking going on during the firmware upgrade process. The original
firmware also contains U-Boot and thus overwrites the boot loader during
upgrade.
In order to flash back to stock, the first header and U-Boot need to be
stripped from the original firmware.

Signed-off-by: Andreas Böhler <dev@aboehler.at>
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>
5 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>
5 years ago
Sungbo Eo 38bdfcdb87 ramips: add support for ipTIME A104ns
ipTIME A104ns is a 2.4/5GHz band AC750 router, based on MediaTek MT7620A.

Specifications:
- SoC: MT7620A
- RAM: DDR2 64MB
- Flash: SPI NOR 8MB
- WiFi:
  - 2.4GHz: SoC internal
  - 5GHz: MT7610EN
- Ethernet: 5x 10/100Mbps
  - Switch: SoC internal
- USB: 1x 2.0
- UART:
  - J2: 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.

In contrast to to-be-supported A1004ns, the A104ns has no usable
value in 0x1fc40 (uboot), so wan_mac needs to be calculated.
Also note that GPIOs for the LEDs really are inverted compared to
the A1004ns.

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
[moved state_default to device DTS, reordered properties in wmac,
added comment about wan_mac and LED GPIOs]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Piotr Dymacz dfecf94c20 ramips: add support for ALFA Network R36M-E4G
ALFA Network R36M-E4G is a dual-SIM, N300 Wi-Fi, compact size platform
based on MediaTek MT7620A WiSoC. This product is designed for operation
with 4G modem (can be bought in bundle with Quectel EC25, EG25 or EP06)
but supports also Wi-Fi modules (miniPCIe slot has USB and PCIe buses).

Specification:

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

Other:

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

Flash instruction:

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

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

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
5 years ago
Frederik Noe-Sdun 0cbd2c74d0 ramips: add support for Netgear EX6130
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.

The device seems to use base PCB as EX3700/EX3800,
but supporting AC1200 using MT7612E.

MAC adresses:
5.0 GHz  0x8004  *:9a
2.4 GHz  0x4     *:9b
lan      0x28    *:9b
wan      0x2e    *:9c

Since this is a one-port device, although wan MAC address is
set in flash, it is not used in OpenWrt setup.

Signed-off-by: Frederik Noe-Sdun <Frederik.Sdun@googlemail.com>
[rebased, extended commit message, tiny DTS style fixes]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Paul Spooren 9fa061a7d3 ramips, mt7620: reproducible elecom-header uid/gid
The elecom-header renames the firmware image to v_0.0.0.bin, stores its
MD5 sum as v_0.0.0.md5 and tars both files again.

Both v_0.0.0 files are created as the build user making it harder to
reproduce.

This commit sets the owner/group of both files to root by adding extra
options to the final tar command.

Before:
0 buildbot   (101) buildbot   (102)  3932164 2019-11-05 14:43:22.000000 v_0.0.0.bin
0 buildbot   (101) buildbot   (102)       33 2019-11-05 14:43:22.000000 v_0.0.0.md5

After:
0 root         (0) root         (0)  3932164 2019-11-05 23:43:08.000000 v_0.0.0.bin
0 root         (0) root         (0)       33 2019-11-05 23:43:08.000000 v_0.0.0.md5

Signed-off-by: Paul Spooren <mail@aparcar.org>
5 years ago
Kristian Evensen 5f108bbc58 ramips: add support for ZBT WE1026-H
This commit adds support for the ZBT WE1026-H, an outdoor AP with
support for adding an internal LTE modem. The detailed specs are:

* CPU: MT7620A
* 2x 10/100Mbps Ethernet (LAN port has passive PoE support).
* 16/32 MB Flash.
* 128/256 MB RAM.
* 1x USB 2.0 port.
* 1x mini-PCIe slot (only USB2.0 bus).
* 1x SIM slot (standard size).
* 1x 2.4Ghz WIFI (rt2800).
* 1x button.
* 6x LEDS (4 GPIO-controlled).
* 1x micro-SD reader.

The following have been tested and working:
- Ethernet switch
- Wifi
- Mini-PCIe slot + SIM slot
- USB port
- microSD slot
- sysupgrade
- reset button

Installation and recovery:

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

Notes:

* When binding the USB LED to a usbport, the LED is switched on all the
time due to the presence of an internal hub. Thus, it does not really
signal any USB-information.

* I only have the 32MB version and have only added support for this
device. However, the files are structured so that adding support for the
16MB version should be easy.

* Only the LAN port is accessible from the outside of the casing and LEDs
are not visible.

Signed-off-by: Kristian Evensen <kristian.evensen@gmail.com>
[rebased onto base-files split, minor style fixes, removed use of
USB led as power LED]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Adrian Schmutzler 794d4b6652 treewide: remove kmod-usb-core from DEVICE_PACKAGES
This removes _all_ occurrences of kmod-usb-core from
DEVICE_PACKAGES and similar variables.

This package is pulled as dependency by one of the following
packages in any case:
- kmod-usb-chipidea
- kmod-usb-dwc2
- kmod-usb-ledtrig-usbport
- kmod-usb-ohci
- kmod-usb2
- kmod-usb2-pci
- kmod-usb3

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
[remove kmod-usb-core from EnGenius ESR600]
Signed-off-by: David Bauer <mail@david-bauer.net>
5 years ago
Adrian Schmutzler 400e56d22c ramips: apply consistent device name/compatible to ZBT-WE1026-5G
All Zbtlink ramips devices except the ZBT-WE1026-5G include the
zbt-/ZBT- prefix in their model name.

This changes ZBT-WE1026-5G to also follow that scheme.

The patch moves some block to keep alphatical order.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
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
Nick Briggs 3df3bb0dae ramips: add support for EnGenius ESR600
The EnGenius ESR600 is a dual band wireless router with a 4-port gigabit
Ethernet switch, a gigabit Ethernet WAN port and a USB port.

Specification:

- Bootloader:	U-Boot
- SoC:		MediaTek MT7620A (600 MHz)
- Flash:	16MB, Macronix MX25L12845E
- RAM:		64MB, Nanya NT5TU32M16DG-AC
- Serial:	115200 baud, no header, 3.3V
  		J2: Vcc (arrow), Gnd, Tx, Rx
- USB:		USB 2, 5V
- Ethernet:	5 x 1 Gb/s 4 LAN 1 WAN, Atheros AR8327
- WiFi0:	5 GHz 802.11 b/g/n Ralink RT5592N
  		300 Mb/s, 2T2R
- WiFi1:	2.4 GHz 802.11 b/g/n integrated
  		300 Mb/s, 2T2R
- Antennas:	2 per radio, internal
- LEDs:		1 programmable power (amber)
  		2 programable radio (blue)
		1 programable WPS-5G (blue)
		1 non-programable WAN activity (blue)
		1 unconfigured WPS-2.4G (amber)
- Buttons:	GPIO: Reset, WPS

Installation:

Use the OEM web interface to install the ...-factory.dlf image.
Use the OpenWRT ...-sysupgrade.bin image for future upgrades.

The J2 serial port can be accessed either by soldering in a header,
standard 0.1" spacing, or by using pogo-pins against the back side.

As configured by the OEM, the U-Boot boot delay is short, however quickly
typing "1" leads to the U-Boot "System load Linux to SDRAM via TFTP"
prompt.  The TFTP client is configured by default with
     client:   192.168.99.9
     server:   192.168.99.8
     filename: uImageESR600
It will load an OpenWRT initramfs kernel with this method.

Known issues:

1) Only the ports externally labeled WAN, LAN3 and LAN4 are operational.
LAN1 and LAN2 do not appear to power up. This issue is also present
in the Lava LR25G001.

2) The amber WPS-2.4G LED, in the same lightguide as the blue WPS-5G LED,
is not configured in the Device Tree specification.

3) The blue WAN activity LED is not configured in the Device Tree
specification as this causes the AR8327 switch to fail to initialize.

Signed-off-by: Nick Briggs <nicholas.h.briggs@gmail.com>
[merge conflict in 02_network]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
5 years ago
Christian Lamparter 3dc5716b07 ramips: add NAS goodies on U25AWF-H1 + U35[N|W]F
These devices are sold as a "NAS HDD Enclousure"
and have a "NAS Media Streaming & File Server & AP" on
the box. That's why I think they should have some support
for the HDD right out-of-the-box.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
5 years ago
NOGUCHI Hiroshi a1c6a316d2 ramips: add support for Fon FON2601
FON2601 is a wireless router.

Specification:
- SoC: Mediatek MT7620A (580MHz)
- RAM: 128 MiB
- ROM: 16 MiB SPI Flash
- Wireless:
   for 11b/g/n (upto 300 Mbps):  MT7620A built-in WMAC
   for 11a/n/ac (upto 867 Mbps): MT7662E
- Ethernet LAN: 1 port, upto 100 Mbps
- Ethernet WAN: 1 port, upto 1000 Mbps
- USB: 1 port (USB 2.0 host)
- LEDs: 4 (all can be controlled by SoC's GPIO)
- buttons: 1 (Displayed as "WPS" on enclosure)
- serial port: 57600n8
 pins: Vcc(3.3V), Rx, Tx, GND
(left to right, viewed from outside of board)

Installation (only available via UART):
  1. download sysupgrade binary image by wget command
  2. write sysupgrade binary image to Flash
     command is:
       mtd write sysupgrade.bin firmware
  3. reboot

Important Notice:
  Only one button is displayed as "WPS" on enclosure.
  However, it is configured as "reset" (factory resetting feature).

Signed-off-by: NOGUCHI Hiroshi <drvlabo@gmail.com>
[removed unrelated openwrt-keyring revert, missing -Wall for uimage_padhdr]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
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 7009f407f1 ramips/mt7620: 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
aigale_ai-br100            7936k    0x7c0000
alfa-network_ac1200rm      16064k   0xfb0000
alfa-network_tube-e4g      16064k   0xfb0000
asus_rp-n53                -        0x7b0000   default
asus_rt-ac51u              (16M)    0xfb0000
asus_rt-n12p               -        0xfb0000   wrong
asus_rt-n14u               -        0xfb0000   wrong
bdcom_wap2100-sk           15808k   0xf70000
buffalo_whr-1166d          15040k   0xfb0000   wrong
buffalo_whr-300hp2         6848k    0x7b0000   wrong
buffalo_whr-600d           6848k    0x7b0000   wrong
buffalo_wmr-300            -        0x7b0000   default
comfast_cf-wr800n          -        0x7b0000   default
dlink_dch-m225             6848k    0x6b0000
dlink_dir-510l             -        0xde0000   wrong
dlink_dir-810l             6720k    0x690000
dlink_dwr-116-a1           -        0x7e0000   wrong
dlink_dwr-118-a1           -        0xfe0000   wrong
dlink_dwr-118-a2           -        0xfe0000   wrong
dlink_dwr-921-c1           (16M)    0xfe0000   wrong
dlink_dwr-921-c3           [(16M)]  0xfe0000   wrong
dlink_dwr-922-e2           (16M)    0xfe0000   wrong
dovado_tiny-ac             -        0x7b0000   default
edimax_br-6478ac-v2        7616k    0x00790000 wrong
edimax_ew-7476rpc          7744k    0x00790000
edimax_ew-7478ac           7744k    0x00790000
edimax_ew-7478apc          7744k    0x00790000
elecom_wrh-300cr           (16M)    0xdf0000   wrong
glinet_gl-mt300a           (16M)    0xf80000   wrong
glinet_gl-mt300n           (16M)    0xf80000   wrong
glinet_gl-mt750            (16M)    0xf80000   wrong
head-weblink_hdrm200       16064k   0xfb0000
hiwifi_hc5661              15872k   0xf80000
hiwifi_hc5761              15872k   0xf80000
hiwifi_hc5861              15872k   0xf80000
hnet_c108                  16777216 0xfb0000   wrong
iodata_wn-ac1167gr         6864k    0x6b4000
iodata_wn-ac733gr3         6992k    0x6d4000
kimax_u25awf-h1            16064k   0xfb0000
kimax_u35wf                16064k   0xfb0000
kingston_mlw221            15744k   0xf60000
kingston_mlwg2             15744k   0xf60000
lava_lr-25g001             -        0xfe0000   wrong
lenovo_newifi-y1           (16M)    0xfb0000
lenovo_newifi-y1s          (16M)    0xfb0000
linksys_e1700              -        0x7b0000   default
microduino_microwrt        16128k   0xfc0000
netgear_ex2700             (4M)     0x3b0000
netgear_ex3700             7744k    0x790000
netgear_wn3000rp-v3        -        0x7b0000   default
nexx_wt3020-4m             (4M)     0x3b0000
nexx_wt3020-8m             -        0x7b0000   default
ohyeah_oy-0001             (16M)    0xfb0000
phicomm_k2g                7552k    0x760000
phicomm_psg1208            -        0x7b0000   default
phicomm_psg1218a           -        0x7b0000   default
phicomm_psg1218b           -        0x7b0000   default
planex_cs-qr10             -        0x7b0000   default
planex_db-wrt01            -        0x7b0000   default
planex_mzk-750dhp          -        0x7b0000   default
planex_mzk-ex300np         -        0x730000   wrong
planex_mzk-ex750np         -        0x730000   wrong
ralink_mt7620a-evb         -        0x7b0000   default
ralink_mt7620a-mt7530-evb  -        0x7b0000   default
ralink_mt7620a-mt7610e-evb -        0x7b0000   default
ralink_mt7620a-v22sg-evb   -        0x7f80000  wrong
ravpower_wd03              (8M)     0x7b0000
sanlinking_d240            (16M)    0xfb0000
sercomm_na930              20m      0x1400000
tplink_archer-c20i         -        0x7a0000   wrong
tplink_archer-c20-v1       -        0x7a0000   wrong
tplink_archer-c2-v1        -        0x7a0000   wrong
tplink_archer-c50-v1       -        0x7a0000   wrong
tplink_archer-mr200        -        0x7b0000   default
vonets_var11n-300          (4M)     0x3b0000
wrtnode_wrtnode            (16M)    0xfb0000
xiaomi_miwifi-mini         (16M)    0xf80000   wrong
youku_yk1                  (32M)    0x1fb0000
yukai_bocco                -        0x7b0000   default
zbtlink_we1026-5g-16m      16777216 0xfb0000   wrong
zbtlink_zbt-ape522ii       -        0xf80000   wrong
zbtlink_zbt-cpe102         -        0x760000   wrong
zbtlink_zbt-wa05           -        0x760000   wrong
zbtlink_zbt-we2026         -        0x760000   wrong
zbtlink_zbt-we826-16m      (16M)    0xfb0000
zbtlink_zbt-we826-32m      (32M)    0x1fb0000
zbtlink_zbt-we826-e        32448k   0x1fb0000
zbtlink_zbt-wr8305rt       -        0x7b0000   default
zte_q7                     -        0x7b0000   default
zyxel_keenetic-omni        -        0x7b0000   default
zyxel_keenetic-omni-ii     -        0x7b0000   default
zyxel_keenetic-viva        16064k   0xfb0000

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
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 48047b3a5c ramips/mt7620: 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 9f99000165 ramips/mt7620: Synchronize Makefiles with DTS compatible
This will "rename" devices in Makefiles to the pattern used in
DTS compatible. This will systematize naming of devices
enormously.

As device names are used to for default SUPPORTED_DEVICES entries,
we need to adjust the source for /tmp/sysinfo/board_name, too.
So remove relevant entries from base-files/lib/ramips.sh and
use device compatible for that.

Despite that, base-files are updated, too.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Adrian Schmutzler d93969a13a ramips: Improve compatible for TP-Link Archer devices
Include "Archer" in compatible as it is part of the device name.

Update Makefile device names where necessary to match compatible.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Daniel Golle c2b1baf767 ramips: add missing DEVICE_VENDOR
Fixes commit ee66fe4ea9
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
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
Birger Koblitz ab7f8146fd ramips: add support for Edimax EW-7478APC
SoC:	MediaTek MT7620a @ 580MHz
RAM:	64M (Winbond W9751G6KB-25)
FLASH:	8MB (Macronix)
WiFi:	SoC-integrated: MediaTek MT7620a bgn
WiFi:	MediaTek MT7612EN nac
Switch: Mediatek MT7530W Gigabit Switch (4 x LAN, 1 x WAN)
USB:	Yes 1 x 2.0 (+ 1 x 2.0 unpopulated header)
BTN:	Reset/WPS
LED:    - Power (white)
	- Internet (blue)
	- Wifi (blue)
	- USB (blue)
UART:  UART is present as Pads with throughholes on the PCB. They are
       located in the lower right corner (GbE ports facing up)
       3.3V - RX - GND - TX / 57600-8N1
       3.3V is the square pad

Installation
------------
Update the factory image via the web-interfaces (by default:
http://edimax.setup)

Signed-off-by: Birger Koblitz <mail@birger-koblitz.de>
[merge conflicts in 01_leds and mt7620.mk, dts whitespace issues]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
5 years ago
Birger Koblitz 88f7a29f99 ramips: add support for Edimax EW-7476RPC / EW-7478AC
SoC:	MediaTek MT7620a @ 580MHz
RAM:	64M (Winbond W9751G6KB-25)
FLASH:	8MB (Macronix)
WiFi:	SoC-integrated: MediaTek MT7620a bgn
WiFi:	MediaTek MT7612EN nac
GbE:	1x (RTL8211E)
BTN:	WPS - RFKILL/RF 50%/RF 100% toggle
LED:	- Wifi 5g (blue)
	- Wifi 2g (blue)
	- Crossband (green)
	- Power (green)
	- WPS (green)
	- LAN (Green)
UART:	UART is present as Pads with throughholes on the PCB. They are
	located next to the switch for the wifi configuration
	3.3V - RX - GND - TX / 57600-8N1
	3.3V is the square pad

Installation
------------
Update the factory image via the web-interfaces (by default:
192.168.9.2/24).
http://192.168.9.2/index.asp

ramips: add Edimax EW-7478AC

SoC:	MediaTek MT7620a @ 580MHz
RAM:	64M (Winbond W9751G6KB-25)
FLASH:	8MB (Macronix)
WiFi:	SoC-integrated: MediaTek MT7620a bgn
WiFi:	MediaTek MT7612EN nac
GbE:	1x (RTL8211E)
BTN:	WPS - RFKILL/RF 50%/RF 100% toggle
LED:	- Wifi 5g (blue)
	- Wifi 2g (blue)
	- Crossband (green)
	- Power (green)
	- WPS (green)
	- LAN (Green)
UART:	UART is present as Pads with throughholes on the PCB. They are
	located next to the switch for the wifi configuration
	3.3V - RX - GND - TX / 57600-8N1
	3.3V is the square pad

Installation
------------
Update the factory image via the web-interfaces (by default:
http://edimaxext.setup)
Or push wpa button on power on and send firmware via tftp to 192.168.1.6

The EW-7478AC is identical to the EW-7476RPC, except instead of 2 internal
antennas it has 2 external ones.

Signed-off-by: Birger Koblitz <mail@birger-koblitz.de>
[merge conflict in 01_leds]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
5 years ago
Deng Qingfang b47cf6d539 ramips: mt7620: select kmod-rt2800-pci driver for RT5592
ASUS RP-N53 and Buffalo WHR-600D use RT5592 for 5GHz wireless
After commit 367813b9b1 the driver for RT5592 (rt2800pci)
is not selected by default anymore, which broke their 5GHz wireless
Add it back to device packages

Fixes: 367813b9b1 ("ramips: mt7620: fix dependencies")

Signed-off-by: Deng Qingfang <dengqf6@mail2.sysu.edu.cn>
5 years ago
Kristian Evensen 869376710d ramips: Add support for ZBT WE826-E
ZBT WE826-E is a dual-SIM version of the ZBT WE826. The router has the
following specifications:

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

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

Installation and recovery:

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

How to swap SIMs:

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

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

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

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

Installation instructions:

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

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

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

Notes:

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

Signed-off-by: Kristian Evensen <kristian.evensen@gmail.com>
[fixed whitespace issue and merge conflict in target.mk]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
5 years ago
Pawel Dembicki 67fced9ba3 ramips: add support for DLINK DIR-510L
The DIR-510L Wireless Router are based on the MT7620A SoC.

Specification:

-MediaTek MT7620A (580 Mhz)
-128 MB of RAM
-16 MB of FLASH
-802.11bgn radio
-1x 10/100 Mbps Ethernet
-2x internal, non-detachable antennas
-UART (J3) header on PCB (57600 8n1)
-1x bi-color LED (GPIO-controlled), 2x button
-JBOOT bootloader

Known issues:
-Ethernet port is used as LAN
-No communication with charger IC. (uart bitbang needed)

Installation:
Apply factory image via d-link http web-gui.

How to revert to OEM firmware:
1.) Push the reset button and turn on the power. Wait until LED start blinking (~10sec.)
2.) Upload original factory image via JBOOT http (IP: 192.168.123.254)
3.) If http doesn't work, it can be done with curl command:
    curl -F FN=@XXXXX.bin http://192.168.123.254/upg
    where XXXXX.bin is name of firmware file.

Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
[fixed whitespace issue in 10-rt2x00-eeprom]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
5 years ago
Pawel Dembicki 1f149fcad3 firmware-utils: mkdlinkfw: add kernel image offset
Some boards with JBOOT have partiton between bootloader
and kernel image. This patch add possibility to change kernel
partition start address.

Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
5 years ago
INAGAKI Hiroshi 5c11258297 ramips: add support for I-O DATA WN-AC733GR3
I-O DATA WN-AC733GR3 is a 2.4/5 GHz band 11ac router, based on
MediaTek MT7620A.

Specification

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

Flash instruction using factory image:

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

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
5 years ago
Piotr Dymacz 9b6413982c ramips: add support for ALFA Network Tube-E4G
ALFA Network Tube-E4G is an outdoor, dual-SIM LTE Cat. 4 CPE, based on
MediaTek MT7620A, equipped with Quectel EC25 miniPCIe modem.

Specification:

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

Other:

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

Flash instruction:

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

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

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
5 years ago
INAGAKI Hiroshi f305ce5c35 ramips: add support for I-O DATA WN-AC1167GR
I-O DATA WN-AC1167GR is a 2.4/5 GHz band 11ac router, based on
MediaTek MT7620A.

Specification:

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

Flash instruction using factory image:

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

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
5 years ago
Deng Qingfang 6621da55b7 ramips: enable MT7610E 5GHz radio of MT7620a_MT7610e EVB
This enables MT7610E of the EVB

Signed-off-by: Deng Qingfang <dengqf6@mail2.sysu.edu.cn>
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
Simon Quigley 9f0e233576 ramips: add support for DLINK DWR-922-E2
Very similar to the DWR-921-C1, except has a telephony/RJ11 port (not
sure if supported, I didn't try), wireless router with QMI LTE embedded
modem is based on the MT7620N SoC.

Specification:

  * MediaTek MT7620N (580 Mhz)
  * 64 MB of RAM
  * 16 MB of FLASH
  * 802.11bgn radio
  * 5x 10/100 Mbps Ethernet (1 WAN and 4 LAN)
  * 2x external, detachable (LTE) antennas
  * UART header on PCB (57600 8n1)
  * 6x LED (GPIO-controlled)
  * 1x bi-color Signal Strength LED (GPIO-controlled)
  * 2x button
  * JBOOT bootloader

The status led has been assigned to the dwr-922-e2:green:signalstrength
(lte signal strength) led. At the end of the boot it is switched off and
is available for lte operation. Works correctly also during sysupgrade
operation.

Installation:
Apply factory image via d-link http web-gui, or via recovery interface:

How to recover/revert to OEM firmware:
1.) Push and hold the reset button and turn on the power. Wait until all
    LEDs start rapidly blinking (~10sec.)
2.) DHCP should give you an IP in the 192.168.123.0/24 subnet, or set
    one manually
3.) Upload original factory image via JBOOT http interface at IP
    192.168.123.254
4.) If http doesn't work, it can be done with curl command:
      curl -F FN=@XXXXX.bin http://192.168.123.254/upg
    where XXXXX.bin is name of firmware file.
5.) You can optionally telnet to 192.168.123.254 before or during the
    upload and it will report the flashing status, memory address etc.
6.) Once web UI and/or telnet says "Success", power cycle the router, or
    type "reboot" into the telnet session.

Signed-off-by: Simon Quigley <squigley@squigley.net>
[squashed commits, word wrap commit message, rename signal strenght led
name to match what is used for the DWR-921-C1 since they share the led
configuration, add label referenced in the aliases node]
Signed-off-by: Mathias Kresin <dev@kresin.me>
6 years ago
Mathias Kresin dd5e7d6c50 ramips: mt7620: add usb packages
Add the usb drivers for all boards with enabled ochi/ehci node in the
dts file.

Fixes: FS#1987

Signed-off-by: Mathias Kresin <dev@kresin.me>
6 years ago
Mathias Kresin 30c07a5675 ramips: mt7620: remove unnecessary usb packages
These are either installed as dependency or not required at all.

Signed-off-by: Mathias Kresin <dev@kresin.me>
6 years ago
Mathias Kresin e04d352d63 ramips: mt7620: add usb ohci driver
Add the USB 1.1 driver for all boards not having a fixed USB 2.0
device attached to the USB bus.

Signed-off-by: Mathias Kresin <dev@kresin.me>
6 years ago
Deng Qingfang 47381aadd5 ramips: several fixes for HC5x61
- Mark other partitions as read-only for HC5x61

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

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

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

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

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

Signed-off-by: Deng Qingfang <dengqf6@mail2.sysu.edu.cn>
6 years ago
Mathias Kresin f381cbcb5f ramips: fix Netgear EX3700/EX3800 wireless driver selection
Fix the typo to select kmod-mt76x2.

Signed-off-by: Mathias Kresin <dev@kresin.me>
6 years ago
Pawel Dembicki e9a9b7d1ed ramips: add support for D-Link DWR-118-A1
The DWR-118-A1 Wireless Router is based on the MT7620A SoC.

Specification:

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

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

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

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

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

Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
6 years ago
Chen Minqiang 40692f0fb5 ramips: mt7620: select only the matching mt76 driver
Because every device has selected the corresponding mt76 driver, we can
now disable the mt76 metapackage by default to make sure that other
devices (those don't need mt76) avoid selecting unwanted packages.

We can find the hardware specifies and determine the dependencies on
these sites:
  https://wikidevi.com/wiki/
  https://openwrt.org/toh/hwdata/

Signed-off-by: Chen Minqiang <ptpt52@gmail.com>
6 years ago
Chen Minqiang 7a32a73e52 ramips: mt7620: drop mt76 driver for boards without mt76 wireless
These boards don't have a mt76 wireless at all and don't need any of the
mt76 family drivers.

Signed-off-by: Chen Minqiang <ptpt52@gmail.com>
6 years ago
Petr Štetiar 8ba6e95eed ramips: bdcom-wap2100: Enable mt7610e 5GHz radio
The 5GHz radio of this device uses an mt7610e PCI-E chip, which has
been recently started to be supported.

 mt76x0e 0000:01:00.0: card - bus=0x1, slot = 0x0 irq=4
 mt76x0e 0000:01:00.0: ASIC revision: 76100002
 mt76x0e 0000:01:00.0: Firmware Version: 0.1.00
 mt76x0e 0000:01:00.0: EEPROM ver:01 fae:00

Signed-off-by: Petr Štetiar <ynezz@true.cz>
6 years ago
Roger Pueyo Centelles cb6a8aa584 ramips: mt7620: add DIR-810L's mt7610e 5 GHz radio
The 5 GHz radio of this device uses an mt7610e pci-e chip, which has
been recently added support.

Tested on the actual device as AP and client, TCP throughput ~90 Mbps
U/D.

Signed-off-by: Roger Pueyo Centelles <roger.pueyo@guifi.net>
6 years ago
Mathias Kresin e4d9217fe5 ramips: improve BDCOM WAP2100-SK support
Use the generic board detection instead of the target specific one as
all recent additions are doing.

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

Use the wps led for boot status indication.

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

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

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

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