Commit Graph

3242 Commits

Author SHA1 Message Date
Sergey Ryazanov 7e89421a7c ramips: add support for Zbtlink ZBT-WG1602
Zbtlink ZBT-WG1602 is a Wi-Fi router intendent to use with WWAN
(UMTS/LTE/3G/4G) modems. The router board offsers a couple of miniPCIe
slots with USB and SIM only and another one pure miniPCIe slot as well
as five Gigabit Ethernet ports (4xLAN + WAN).

Specification:

* SoC: MT7621A
* RAM: 256/512 MiB
* Flash: 16/32 MiB (SPI NOR)
* external watchdog (looks like Torexsemi XC6131B)
* Eth: 10/100/1000 Mbps Ethernet x5 ports (4xLAN + WAN)
* WLAN 2GHz: MT7603EN (.11n, MIMO 2x2)
* WLAN 5GHz: MT7612EN (.11ac, MIMO 2x2)
* WLAN Ants: detachable x2, shared by 2GHz & 5GHz radios
* miniPCIe: 2x slots with USB&SIM + 1x slot with regular PCIe bus
* WWAN Ants: detachable x4
* External storage: microSD (SDXC) slot
* USB: 2.0 Type-A port
* LED: 11 (5 per Eth phy, 3 SoC controlled, 2 WLAN 2/5 controlled, 1
       power indicator)
* Button: 1 (reset)
* UART: console (115200 baud)
* Power: DC jack (12 V / 2.5 A)

Additional HW information:

* SoC USB port #1 is shared by internal miniPCIe slot and external
  Type-A USB port, USB D+/D- lines are toggled between ports using a
  GPIO controlled DPDT switch.
* Power of the USB enabled miniPCIe slots can be individually controlled
  using dedicated GPIO lines.
* Vendor firmware feeds the external watchdog with 1s pulses. GPIO
  watchdog driver is able to either generate a 1us pulses or toggle the
  output line. 1us is not enough for the external watchod timer, so
  the line toggling driver mode is utilized.

Installation:

Vendor's firmware is OpenWrt (LEDE) based, so the sysupgrade image can
be directly used to install OpenWrt. Firmware must be upgraded using the
'force' and 'do not save configuration' command line options (or
correspondig web interface checkboxes) since the vendor firmware is from
the pre-DSA era.

Signed-off-by: Sergey Ryazanov <ryazanov.s.a@gmail.com>
2021-12-05 18:49:14 +01:00
Yuchan Seo c33eb0372e ramips: add support for ipTIME A3004NS-dual
ipTIME A3004NS-dual is a 2.4/5GHz band router, based on Mediatek MT7621.

Specifications:
- SoC: MT7621 (880MHz)
- RAM: DDR3 256M
- Flash: SPI NOR 16MB
- WiFi:
 - 2.4GHz: MT7602E
 - 5GHz : MT7612E
- Ethernet:
 - 4x LAN
 - 1x WAN
- USB: 1 * USB3.0 port
- UART:
  - 3.3V, TX, RX, GND / 57600 8N1

Installation via web interface:
- 1. Flash Initramfs image using OEM Firmware's web GUI
- 2. Boot into OpenWrt and perform Sysupgrade with sysupgrade image.

Revert to stock firmware:
- 1. Boot into OpenWrt and perform Sysupgrade with OEM Stock Firmware image.

Signed-off-by: Yuchan Seo <hexagonwin@disroot.org>
Reviewed-by: Sungbo Eo <mans0n@gorani.run>
2021-12-04 09:39:11 +09:00
Sergey V. Lobanov e22c91e144 ramips: fix tl-mr3020-v3 switch topology to configure vlans via luci
Currently it is not possible to configure VLANs via LUCI on
tplink tl-mr3020-v3. This patch fixes switch topology for the
LUCI interface.

Signed-off-by: Sergey V. Lobanov <sergey@lobanov.in>
[copied commit message from github PR]
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2021-12-04 00:36:47 +01:00
Pawel Dembicki a82fa5bcd4 ramips: mt7620: Enable PHY aneg of Lava LR-25G001
In 20b09a2125 Lava LR-25G001 router have problem with two inactive
ethernet ports. JBOOT bootloader didn't configure ethernet devices by default.
The same situation was there. It is required to enable all phy ports.
This is fragment of stock bootlog:

switch reg write_athr offset=90, value=2b0
switch reg write_athr offset=8c, value=2b0
switch reg write_athr offset=88, value=2b0
switch reg write_athr offset=84, value=2b0
switch reg write_athr offset=80, value=2b0

This patch adds proper registers configuration ar8337 initvals.
0x2b0 value causes force flow control configuration, 0x1200 was used
instead (flow control config auto-neg with phy). [1]

When switch is now ok, let's fix port numeration too.

Fixes: 20b09a2125 ("ramips: add support for Lava LR-25G001")

[1] https://github.com/openwrt/openwrt/pull/4806#issuecomment-982019858

Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
2021-12-04 00:36:47 +01:00
John Audia 81995a5e77 kernel: bump 5.4 to 5.4.162
All patches automatically rebased.

Build system: x86_64
Build-tested: ramips/mt7621*

*I am hit with the binutils 2.37 bug so I had to revert 7f1edbd412
in order to downgrade to 2.35.1

Signed-off-by: John Audia <graysky@archlinux.us>
2021-11-28 16:32:45 +01:00
John Audia bbdc13b15b kernel: bump 5.4 to 5.4.161
Removed upstreamed:
    ath79/patches-5.4/921-serial-core-add-support-for-boot-console-with-arbitr.patch[1]

Manually rebased:
    layerscape/patches-5.4/804-crypto-0016-MLKU-114-1-crypto-caam-reduce-page-0-regs-access-to-.patch
    octeontx/patches-5.4/0004-PCI-add-quirk-for-Gateworks-PLX-PEX860x-switch-with-.patch

All other patches automatically rebased.

1. Private email exchange with patch author, Hauke Mehrtens

Signed-off-by: John Audia <graysky@archlinux.us>
2021-11-28 16:32:45 +01:00
Eneas U de Queiroz 617fcd4879 ramips: fix ralink_i2s_debugfs_remove declaration
Correct ralink_i2s_debugfs_remove declaration in ralink patches when
CONFIG_DEBUG_FS is not selected.

Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
2021-11-20 21:08:25 +01:00
Mirko Parthey a4c3b6373c ramips: use lzma-loader on D-Link DIR-615 H1
Fixes the boot loader LZMA decompression issue:
LZMA ERROR 1 - must RESET board to recover

Signed-off-by: Mirko Parthey <mirko.parthey@web.de>
2021-11-20 21:08:25 +01:00
Thomas Aldrian b28443f82e ramips: add support for Wavlink WL-WN576A2
This commit adds support for the Wavlink WL-WN576A2 wall-plug wireles
repeater / router. It is also sold under the name SilverCrest SWV 733 B1.

Device specs:

- CPU: MediaTek MT7628AN
- Flash: 8MB
- RAM: 64MB
- Bootloader: U-Boot
- Ethernet: 1x 10/100 Mbps
- 2.4 GHz: b/g/n SoC
- 5 GHz: a/n/ac MT7610EN
- Buttons: WPS, reset, sliding switch (ap/repeater)
- LEDs: 5x wifi status, 1x LAN/WAN, 1x WPS

Flashing:

U-Boot launches a TFTP client if WPS button is held during boot.

- Server IP: 192.168.10.100
- Firmware file name: firmware.bin

Device will reboot automatically. First boot takes about 90s.

Coelner (waenger@gmail.com) is the original author, but I have made some
fixes. He does not wish to sign off using his real name.

Signed-off-by: Thomas Aldrian <dev.aldrian@gmail.com>
2021-11-20 21:08:25 +01:00
Rui Salvaterra 3ae5da5adc kernel: bump 5.10 to 5.10.80
Deleted (upstreamed):
ath79/patches-5.10/921-serial-core-add-support-for-boot-console-with-arbitr.patch [1]
bcm53xx/patches-5.10/033-v5.15-0012-ARM-dts-BCM5301X-Fix-memory-nodes-names.patch [2]
lantiq/patches-5.10/0016-mtd-rawnand-xway-Keep-the-driver-compatible-with-on-.patch [3]
lantiq/patches-5.10/0110-MIPS-lantiq-dma-add-small-delay-after-reset.patch [4]
lantiq/patches-5.10/0111-MIPS-lantiq-dma-reset-correct-number-of-channel.patch [5]
lantiq/patches-5.10/0112-MIPS-lantiq-dma-fix-burst-length-for-DEU.patch [6]

Manually rebased:
ipq806x/patches-5.10/0065-arm-override-compiler-flags.patch

[1] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.10.80&id=47462c5e600fbaffd755cd13dedd80d04e41ff83
[2] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.10.80&id=2fde76df1885a6bec04317e457121326070450eb
[3] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.10.80&id=9b366f5221d8aa64b22f35be137a5749326444ce
[4] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.10.80&id=5af57ce8a6155fe3e4270d28d171abf8903bebc0
[5] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.10.80&id=b92a5df2c7adc79a57481445f67de0c1c716581f
[6] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.10.80&id=6b72caabc47011d03f44064452b2c65e8ed18326

Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
2021-11-19 09:40:29 +00:00
John Audia a50565157e kernel: bump 5.4 to 5.4.158
All patches automatically rebased.

Signed-off-by: John Audia <graysky@archlinux.us>
2021-11-07 19:58:08 +01:00
Wout Bertrums 9a7e3d170c ramips: add broken-flash-reset for HLK-7621A EvB
This is needed because the HLK-7621 EvB has 32MB of flash,
so it will have to use 4B addressing and the
broken-flash-reset hack has to be used to be able to reboot.

Signed-off-by: Wout Bertrums <wout@wbnet.eu>
[copied github message into commit message]
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2021-11-06 23:36:32 +01:00
Sergio Paracuellos 8bc6654244 ramips: mt7621-dts: properly organize pcie node
Device tree pcie node for this SoC is using different
styles in its different properties. Hence properly
unify them to be able to write a a proper yaml schema
documentation.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Link: https://lore.kernel.org/r/20210505121736.6459-11-sergio.paracuellos@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-11-06 23:36:32 +01:00
Sergio Paracuellos 2bc659ee07 ramips: mt7621-dts: add missing device_type in pcie root ports
According to the YAML schema 'pci-bus.yaml' the 'device_type'
property is mandatory for all pcie root ports. Hence add it.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Link: https://lore.kernel.org/r/20210506170742.28196-3-sergio.paracuellos@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-11-06 23:36:32 +01:00
Sergio Paracuellos 82f9d5ad0b ramips: mt7621-dts: remove 'bug-range' property
Property 'bus-range' when values are the default are
not necessary to be defined. Hence, remove all of them.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Link: https://lore.kernel.org/r/20210506170742.28196-2-sergio.paracuellos@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-11-06 23:36:32 +01:00
Sergio Paracuellos e04130fc17 ramips: mt7621-dts: use standard 'syscon' string
Both 'memc' and 'sysc' nodes are not using 'syscon'
as a node string which is the standard one to be used.
Update both of them.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Link: https://lore.kernel.org/r/20210505132154.8263-3-sergio.paracuellos@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-11-06 23:36:32 +01:00
Sergio Paracuellos f1d154ec6c ramips: mt7621-dts: remove ethsys node
DT 'ethsys' node is being configured as a syscon
to get access to reset and other registers in the
'mediateķ,mt7621-eth' driver. Since the 'sysc' is also
a syscon, provides the clock and also is virtually
mapped from the same physical address 0x1e000000 we
can just use 'sysc' as the phandle for the syscon in
the ethernet node. Compatible string 'mediatek,mt7621-ethsys'
of the node is not being used anywhere inside the kernel
so, this node can be safely removed.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Link: https://lore.kernel.org/r/20210505132154.8263-2-sergio.paracuellos@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-11-06 23:36:32 +01:00
DENG Qingfang 93da227798 ramips: mt7621-dts: remove obsolete switch node
This was for OpenWrt's swconfig driver, which never made it upstream,
and was also superseded by MT7530 DSA driver.

Reviewed-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: DENG Qingfang <dqfext@gmail.com>
Link: https://lore.kernel.org/r/20210108025155.31556-1-dqfext@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-11-06 23:36:32 +01:00
Sergio Paracuellos 6e30692e99 ramips: mt7621-dts: properly define 'cpc' and 'mc' nodes
'cpc' and 'mc' nodes correspond with the MIPS 'Cluster Power Controller'
and 'MIPS Common Device Memory Map' which are present in some MIPS related
boards. There is already bindings documentation for these two located in:
- Documentation/devicetree/bindings/power/mti,mips-cpc.yaml
- Documentation/devicetree/bindings/bus/mti,mips-cdmm.yaml

Hence, properly update compatible strings and align nodes with already
mainlined bindings documentation. Also, move their definition to a proper
place since both of them are not related with the palmbus at all.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Link: https://lore.kernel.org/r/20211002060706.30511-1-sergio.paracuellos@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-11-06 23:36:32 +01:00
Sergio Paracuellos 9b52b4e53f ramips: mt7621-dts: change some node hex addresses to lower case
Hexadecimal addresses in device tree must be defined using lower case.
There are some of them that are still in upper case. Change them all.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Link: https://lore.kernel.org/r/20211017070656.12654-2-sergio.paracuellos@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-11-06 23:36:32 +01:00
Sergio Paracuellos e17f238f1d ramips: mt7621-dts: make use of 'IRQ_TYPE_LEVEL_HIGH' instead of magic numbers
Nodes 'gdma' and 'hsdma' are using magic number '4' in interrupts property.
Use 'IRQ_TYPE_LEVEL_HIGH' instead to align with the rest of the nodes in
the file.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Link: https://lore.kernel.org/r/20211019102915.15409-2-sergio.paracuellos@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-11-06 23:36:32 +01:00
Rui Salvaterra 4b26ba4155 kernel: bump 5.10 to 5.10.77
Deleted (upstreamed):
bcm53xx/patches-5.10/081-v5.15-Revert-pinctrl-bcm-ns-support-updated-DT-binding-as-.patch [1]

[1] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=linux-5.10.y&id=01c2881bb0e0a71b87ca425e1b763ac13855aa7e

Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
2021-11-06 14:24:07 +01:00
Mathias Kresin 1470009bf8 kernel: 5.10: packet mangling code only for ar8216 driver
Only the ar8216 switch driver uses the packet mangling code.

Update the kernel configs accordingly.

Signed-off-by: Mathias Kresin <dev@kresin.me>
2021-11-02 22:36:41 +01:00
Sergio Paracuellos eb00fb8f71 ramips: add support for HiLink HLK-7621A evaluation board
Specifications:
- SoC: MediaTek MT7621AT
- RAM: 256 MB (DDR3)
- Flash: 32 MB SPI NOR 44MHz
- Switch: 1 WAN, 4 LAN (Gigabit)
- LEDs: 1 WAN, 4 LAN (controlled by PHY)
- USB Ports: 1 x USB2, 1 x USB3
- WLAN: 1 x 2.4, 5 GHz 866Mbps (MT7612E)
- Button: 1 button (reset)
- UART Serial: UART1 as console : 57600 baud
- Power: 12VDC, 1A

Installation:
Update openWRT firmware using internal GNUBEE uboot:
https://github.com/gnubee-git/GnuBee-MT7621-uboot

By HTTP: Initial uboot address is http://10.10.10.123, your address
needs to be 10.10.10.x, and mask 255.255.255.0.
By TFTP: Uboot is in client mode, the address of the firmware must
be tftp://10.10.10.3/uboot.bin

Recovery:
Manufacturer provides MTK OpenWrt 14.07 source code, compile then
flash it by uboot.
HLK-7621A is a stamp hole package module for embedded development,
users have to design IO boards to use it.

MAC addresses:
- u-boot-env contains a placeholder address:
  > mtd_get_mac_ascii u-boot-env ethaddr
  03:17:73🆎cd:ef
- phy0 gets a valid-looking address:
  > cat /sys/class/ieee80211/phy0/macaddress
  f8:62:aa:**:**:a8
- Calibration data for &pcie2 contains a valid address, however the
  zeros in the right half look like it's not real:
  8c:88:2b:00:00:1b
- Since it's an evaluation board and there is no solid information
  about the MAC address assignment, the ethernet MAC address is left random.

Signed-off-by: Chen Yijun <cyjason@bupt.edu.cn>
[add keys and pcie nodes to properly support evaluation board]
Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
[remove ethernet address, wrap lines properly]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-10-31 21:24:47 +01:00
Eduardo Santos 3c97fb4346 ramips: add support for Xiaomi MiWifi 3C
This commit adds support for Xiaomi MiWiFi 3C device.

Xiaomi MiWifi 3C has almost the same system architecture
as the Xiaomi Mi WiFi Nano, which is already officially
supported by OpenWrt.

The differences are:

 - Numbers of antennas (4 instead of 2). The antenna management
   is done via the µC. There is no configuration needed in the
   software code.
 - LAN port assignments are different. LAN1 and WAN are
   interchanged.

OpenWrt Wiki: https://openwrt.org/toh/xiaomi/mir3c

OpenWrt developers forum page:
https://forum.openwrt.org/t/support-for-xiaomi-mi-3c

Specifications:

 - CPU: MediaTek MT7628AN (575MHz)
 - Flash: 16MB
 - RAM: 64MB DDR2
 - 2.4 GHz: IEEE 802.11b/g/n with Integrated LNA and PA
 - Antennas: 4x external single band antennas
 - WAN: 1x 10/100M
 - LAN: 2x 10/100M
 - LED: 1x amber/blue/red. Programmable
 - Button: Reset

MAC addresses as verified by OEM firmware:

use address source
LAN *:92 factory 0x28
WAN *:92 factory 0x28
2g *:93 factory 0x4

OEM firmware uses VLAN's to create the network interface for WAN and LAN.

Bootloader info:
The stock bootloader uses a "Dual ROM Partition System".
OS1 is a deep copy of OS2.
The bootloader start OS2 by default.
To force start OS1 it is needed to set "flag_try_sys2_failed=1".

How to install:
1- Use OpenWRTInvasion to gain telnet, ssh and ftp access.
   https://github.com/acecilia/OpenWRTInvasion
   (IP: 192.168.31.1 - Username: root - Password: root)
2- Connect to router using telnet or ssh.
3- Backup all partitions. Use command  "dd if=/dev/mtd0 of=/tmp/mtd0".
   Copy /tmp/mtd0 to computer using ftp.
4- Copy openwrt-ramips-mt76x8-xiaomi_miwifi-3c-squashfs-sysupgrade.bin
   to /tmp in router using ftp.
5- Enable UART access and change start image for OS1.
```
nvram set uart_en=1
nvram set flag_last_success=1
nvram set boot_wait=on
nvram set flag_try_sys2_failed=1
nvram commit
```
6- Installing Openwrt on OS1 and free OS2.
```
mtd erase OS1
mtd erase OS2
mtd -r write /tmp/openwrt-ramips-mt76x8-xiaomi_miwifi-3c-squashfs-sysupgrade.bin OS1
```

Limitations: For the first install the image size needs to be less
than 7733248 bits.

Thanks for all community and especially for this device:
minax007, earth08, S.Farid

Signed-off-by: Eduardo Santos <edu.2000.kill@gmail.com>
[wrap lines, remove whitespace errors, add mediatek,mtd-eeprom to
 &wmac, convert to nvmem]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-10-31 21:24:47 +01:00
Jani Partanen e06aaba4e3 ramips: fix LAVA LR-25G001 broken wifi led triggers
LED labels for this device are different in 01_leds file and in device
DTS. Switch to DT triggers, which works on Telewell TW-4 (LTE) clone
device.

This has not been tested on the LR-25G001 itself, just on the clone
mentioned above.

Fixes: 20b09a2125 ("ramips: add support for Lava LR-25G001")

Signed-off-by: Jani Partanen <rtfm@iki.fi>
[rephrase commit title/message]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-10-30 22:11:23 +02:00
Michal Kozuch c12ef2f760 ramips: add support for TP-Link RE305 v3
Specs (same as in v1):
- MT7628AN (575 MHz)
- 64MB RAM
- 8MB of flash (SPI NOR)
- 1x 10/100Mbps Ethernet (MT7628AN built-in switch with vlan)
- 1x 2.4GHz wifi (MT7628AN)
- 1x 5Ghz wifi (MT7612E)
- 4x LEDs (5 GPIO-controlled)
- 1x reset button
- 1x WPS button

The only and important difference between v1 & v3 is in flash memory
layout, so pls don't interchange these 2 builds!

Installation through web-ui (on OEM factory firmware):
1. Visit http://tplinkrepeater.net or the configured IP address of
   your RE305 v3 (default 192.168.0.254).
2. Log in with the password you've set during initial setup of the
   RE305 (there is no default password).
3. Go to Settings -> System Tools -> Firmware upgrade
4. Click Browse and select the OpenWRT image with factory.bin suffix
   (not sysupgrade.bin)
5. A window with a progress bar will appear. Wait until it completes.
6. The RE305 will reboot into OpenWRT and serve DHCP requests on the
   ethernet port.
7. Connect an RJ45 cable from the RE305 to your computer and access
   LuCI at http://192.168.1.1/ to configure (or use ssh).

Disassembly:
Just unscrew 4 screws in the corners & take off the back cover.
Serial is exposed to the right side of the main board (in the middle)
and marked with TX/RX/3V3/GND, but the holes are filled with solder.

Installation through serial:
1. connect trough serial (1n8, baudrate=57600)
2. setup the TFTP server and connect it via ethernet
   (ipaddr=192.168.0.254 of device, serverip=192.168.0.184 - your pc)
3. boot from a initramfs image first (choose 1 in the bootloader
   options)
4. test it a bit with that, then proceed to run sysupgrade build

MAC addresses as verified by OEM firmware:

  use  OpenWrt  address  reference
  LAN  eth0     *:d2     label
  2g   wlan0    *:d1     label - 1
  5g   wlan1    *:d0     label - 2

  The label MAC address can be found in config 0x2008.

Signed-off-by: Michal Kozuch <servitkar@gmail.com>
[redistribute WLAN node properties between DTS/DTSI, remove
 compatible on DTSI, fix indent/wrapping, split out firmware-utils
 change]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-10-30 22:05:25 +02:00
INAGAKI Hiroshi 1b814974e1 build: move elecom-wrc-gs-factory to image-commands.mk
ELECOM WRC-X3200GST3 uses the same header/footer as WRC-GS/GST devices
in ramips/mt7621 subtarget, so move "Build/elecom-wrc-gs-factory" to
image-commands.mk to use from mediatek/mt7622 subtarget.

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
2021-10-30 22:05:25 +02:00
Rui Salvaterra 02026d0a6f kernel: bump 5.10 to 5.10.76
Deleted (upstreamed):
bcm27xx/patches-5.10/950-0145-xhci-add-quirk-for-host-controllers-that-don-t-updat.patch [1]

Manually rebased:
bcm27xx/patches-5.10/950-0355-xhci-quirks-add-link-TRB-quirk-for-VL805.patch
bcm53xx/patches-5.10/180-usb-xhci-add-support-for-performing-fake-doorbell.patch

Note: although automatically rebaseable, the last patch has been edited to avoid
conflicting bit definitions.

[1] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=linux-5.10.y&id=b6f32897af190d4716412e156ee0abcc16e4f1e5

Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
2021-10-30 21:17:20 +02:00
Bruno Randolf 2c3e8bed3f
ramips: minew g1-c: Allow dynamic RAM sizes
Allow RAM size to be passed thru U-Boot. There are 128MB and 64MB
versions of Minew G1-C. This is also in line with the behaviour of
most other RAMIPS boards.

Signed-off-by: Bruno Randolf <br1@einfach.org>
2021-10-26 13:59:30 +02:00
Rui Salvaterra d4f0e45f90 kernel: bump 5.10 to 5.10.75
Deleted (upstreamed):
bcm27xx/patches-5.10/950-0735-xhci-guard-accesses-to-ep_state-in-xhci_endpoint_res.patch [1]

[1] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=linux-5.10.y&id=dc3e0a20dbb9dbaa22f4a33dea34230f8c663c40

Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
2021-10-21 00:17:36 +02:00
John Audia 0ea33e5363 kernel: bump 5.4 to 5.4.155
All patches automatically rebased.

Signed-off-by: John Audia <graysky@archlinux.us>
2021-10-21 00:17:36 +02:00
Felix Fietkau a1ac8728f8 ramips: remove kmod-mt7663-firmware-sta from device packages
This firmware should only be used for mobile devices (e.g. laptops), where
AP mode functionality is typically not used. This firmware supports a lot
of power saving offload functionality at the expense of AP mode support.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-10-17 16:07:03 +02:00
Rosen Penev 5b3d62247c ramips: fix dtc warnings for telco-electronics_x1
In all other dts files, the entire block is not edited like this.
They're edited separately.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-10-17 15:21:37 +02:00
Felix Fietkau f2e1e156c0 kernel: backport a rewrite of the mips eBPF JIT implementation
This adds support for eBPF JIT for 32 bit targets and significantly improves
correctness.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-10-14 20:29:51 +02:00
David Bauer f82c93b93c ramips: fix USW-Flex reversed switch-port order
Switch port order was reversed due to reading the internal labling
(which mismatches the one on the case).

Signed-off-by: David Bauer <mail@david-bauer.net>
2021-10-04 23:24:32 +02:00
Dale Hui 830c2e5378 ramips: add support for Netgear R7450
Netgear R7450 is a clone of Netgear R6700v2

Specifications
==============
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)

Flash Instructions
==================
Login to netgear webinterface and flash factory.img

Signed-off-by: Dale Hui <strokes-races0b@icloud.com>
[fix model/compatible in DTS]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-09-26 15:38:01 +02:00
Dale Hui 16fc409e7a ramips: add support for Netgear R6900v2
Netgear R6900v2 is a clone of Netgear R6700v2

Specifications
==============
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)

Flash Instructions
==================
Login to netgear webinterface and flash factory.img

Signed-off-by: Dale Hui <strokes-races0b@icloud.com>
2021-09-26 15:15:36 +02:00
Dale Hui 95807f89ff ramips: add Nighthawk AC2100 as name for Netgear R6700v2
Netgear Nighthawk AC2100 is another name of the Netgear R6700v2.

Signed-off-by: Dale Hui <strokes-races0b@icloud.com>
[adjust commit message/title]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-09-26 15:15:36 +02:00
Dale Hui af3104d25b ramips: make Netgear R7200 a separate device from R6700v2
With the various variants of Netgear R**** devices, make it more
obvious which image should be used for the R7200.

Signed-off-by: Dale Hui <strokes-races0b@icloud.com>
[provide proper commit message]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-09-26 15:15:30 +02:00
David Bauer 1edc7078d6 ramips: enable I2C_CHARDEV
Expose I2C busses with a chardev device. This is required to control the
PSE controller on the Ubiquiti UniFi Flex Switch.

Signed-off-by: David Bauer <mail@david-bauer.net>
2021-09-25 21:05:07 +02:00
David Bauer a983969789 ramips: add support for Ubiquiti USW-Flex
Hardware
--------
MediaTek MT7621AT
16M SPI-NOR Macronix MX25L12835FMI
Microchip PD69104B1 4-Channel PoE-PSE controller
TI TPS2373 PoE-PD controller

PoE-Controller
--------------

By default, the PoE outputs do not work with OpenWrt. To make them output
power, install the "poemgr" package from the packages feed.
This package can control the PD69104B1 PSE controller.

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

1. Connect to the booted device at 192.168.1.20 using username/password
   "ubnt" via SSH.

2. Add the uboot-envtools configuration file /etc/fw_env.config with the
   following content

   $ echo "/dev/mtd1 0x0 0x1000 0x10000 1" > /etc/fw_env.config

3. Update the bootloader environment.

   $ fw_setenv boot_openwrt "fdt addr \$(fdtcontroladdr);
     fdt rm /signature; bootubnt"
   $ fw_setenv bootcmd "run boot_openwrt"

4. Transfer the OpenWrt sysupgrade image to the device using SCP.

5. Check the mtd partition number for bs / kernel0 / kernel1

   $ cat /proc/mtd

6. Set the bootselect flag to boot from kernel0

   $ dd if=/dev/zero bs=1 count=1 of=/dev/mtdblock4

7. Write the OpenWrt sysupgrade image to both kernel0 as well as kernel1

   $ dd if=openwrt.bin of=/dev/mtdblock6
   $ dd if=openwrt.bin of=/dev/mtdblock7

8. Reboot the device. It should boot into OpenWrt.

Restore to UniFi
----------------

To restore the vendor firmware, follow the Ubiquiti UniFi TFTP
recovery guide for access points. The process is the same for
the Flex switch.

Signed-off-by: David Bauer <mail@david-bauer.net>
2021-09-25 21:04:53 +02:00
INAGAKI Hiroshi 7ff0efa0b0 ramips: add support for I-O DATA WN-DX2033GR
I-O DATA WN-DX2033GR is a 2.4/5 GHz band 11ac (Wi-Fi 5) router, based on
MT7621A.

Specification:

- SoC		: MediaTek MT7621A
- RAM		: DDR3 128 MiB
- Flash		: Raw NAND 128 MiB (Macronix MX30LF1G18AC-TI)
- WLAN		: 2.4/5 GHz
  - 2.4 GHz	: 2T2R, MediaTek MT7603E
  - 5 GHz	: 4T4R, MediaTek MT7615
- Ethernet	: 5x 10/100/1000 Mbps
  - Switch	: MediaTek MT7530 (SoC)
- LEDs/Keys	: 2x/3x (2x buttons, 1x slide-switch)
- UART		: through-hole on PCB
  - J5: 3.3V, TX, RX, NC, GND from triangle mark
  - 57600n8
- Power		: 12 VDC, 1 A

Flash instruction using initramfs image:

1. Boot WN-DX2033GR 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, download the sysupgrade.bin image to the
   device and perform sysupgrade with it
5. Wait ~120 seconds to complete flashing

Notes:

- The hardware of WN-DX2033GR and WN-AX2033GR are almost the same, and
  it is certified under the same radio-wave related regulations in Japan

- The last 0x80000 (512 KiB) in NAND flash is not used on stock firmware

- stock firmware requires "customized uImage header" (called as "combo
  image") 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

- There are 2x important flags in the flash:

  - bootnum   : select os partition for booting (persist, 0x4)

    - 0x01: firmware
    - 0x02: firmware_2

  - debugflag : allow interrupt kernel loader, it's named as "Z-LOADER"
    (Factory, 0xFE75)

    - 0x00: disable debug
    - 0x01: enable debug

MAC addresses:

LAN     : 50:41:B9:xx:xx:90 (Factory, 0xE000 (hex) / Ubootenv, ethaddr (text))
WAN     : 50:41:B9:xx:xx:92 (Factory, 0xE006 (hex))
2.4 GHz : 50:41:B9:xx:xx:90 (Factory, 0x4    (hex))
5 GHz   : 50:41:B9:xx:xx:91 (Factory, 0x8004 (hex))

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
2021-09-25 19:28:54 +02:00
Alan Luck 2c9a07ed28 ramips: add missing information to dlink headers
Add additional header information required for newer
bootloaders found on DIR-2660-A1 & A2.

Also remove the MTD splitter compatible from the second firmware
partition, as OpenWrt only supports handling of the first one.

Signed-off-by: Alan Luck <luckyhome2008@gmail.com>
[rephrase commit message, remove removal of read-only flags]
Signed-off-by: David Bauer <mail@david-bauer.net>
2021-09-24 12:32:28 +02:00
Andrea Poletti de0c380a5f ramips: add support for Sitecom WLR-4100 v1 002
Sitecom WLR-4100 v1 002 (marked as X4 N300) is a wireless router
Specification:
SoC: MT7620A
RAM: 64 MB DDR2
Flash: MX25L6405D SPI NOR 8 MB
WIFI: 2.4 GHz integrated
Ethernet: 5x 10/100/1000 Mbps QCA8337
USB: 1x 2.0
LEDS: 2x GPIO controlled, 5x switch
Buttons: 1x GPIO controlled
UART: row of 4 unpopulated holes near USB port, starting count from
      white triangle on PCB:

    VCC 3.3V
    GND
    TX
    RX

    baud: 115200, parity: none, flow control: none

Installation

    Connect to one of LAN (yellow) ethernet ports,
    Open router configuration interface,
    Go to Toolbox > Firmware,
    Browse for OpenWrt factory image with dlf extension and hit Apply,
    Wait few minutes, after the Power LED will stop blinking, the router is
    ready for configuration.

Known issues
Some USB 2.0 devices work at full speed mode 1.1 only

MAC addresses

factory partition only contains one (binary) MAC address in 0x4.
u-boot-env contains four (ascii) MAC addresses, of which two appear
to be valid.

  factory     0x4       **:**:**:**:b9:84  binary
  u-boot-env  ethaddr   **:**:**:**:b9:84  ascii
  u-boot-env  wanaddr   **:**:**:**:b9:85  ascii
  u-boot-env  wlanaddr  00:AA:BB:CC:DD:12  ascii
  u-boot-env  iNICaddr  00:AA:BB:CC:DD:22  ascii

The factory firmware only assigns ethaddr. Thus, we take the
binary value which we can use directly in DTS.

Additional information
OEM firmware shell password is: SitecomSenao
useful for creating backup of original firmware.
There is also another revision of this device (v1 001), based on RT3352 SoC

Signed-off-by: Andrea Poletti <polex73@yahoo.it>
[remove config DT label, convert to nvmem, remove MAC address
 setup from u-boot-env, add MAC address info to commit message]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-09-05 23:52:35 +02:00
Alexander Couzens c39be8e7a4
ramips: minew g1-c: use default static address for lan instead of dhcp
As Adrian Schmutzler suggested on github [1] the device should follow the
default behaviour on ethernet using a static address instead using dhcp.

[1] 8d497b6570

Signed-off-by: Alexander Couzens <lynxis@fe80.eu>
2021-08-31 02:42:32 +02:00
Sungbo Eo f08b76b32f ramips: w2914ns-v2: consolidate leds nodes into dtsi
w2914ns-v2, 11acnas, and freezio use almost same board and thus share a
common dtsi file. Now that LED labels do not contain "devicename" since
commit c846dd91f0 ("ramips: remove model name from LED labels"), let's
move the leds nodes to dtsi and remove them from dts.

Note that freezio has only one USB 3.0 port and adding &ehci_port2 trigger
does not incur any visible changes.

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
2021-08-30 00:37:47 +02:00
Adrian Schmutzler aec97b31ea ramips: provide default BLOCKSIZE for Device/seama
The Device/seama shared definition requires BLOCKSIZE, so it should
have a default value for this variable.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-08-30 00:37:47 +02:00
Rui Salvaterra 505b7a2d08 kernel: move two symbols to the generic kconfigs
CONFIG_RCU_{NEED_SEGCBLIST,STALL_COMMON} are set basically everywhere. Move them
to the generic kconfigs. And resort the generic kconfigs while at it.

Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
2021-08-29 17:07:19 +02:00
David Bauer 90e167abaa ramips: add label-mac for TL-MR3020 v3
The TP-Link TL-MR3020 v3 only has a single MAC address assigned for
ethernet LAN as well as WiFi. This MAC address is also printed on the
casing.

Signed-off-by: David Bauer <mail@david-bauer.net>
2021-08-28 01:35:02 +02:00