Commit Graph

3126 Commits

Author SHA1 Message Date
Amish Vishwakarma d22fb7f4fd ramips: add support for TP-Link Archer C6 v3
The patch adds support for the TP-Link Archer C6 v3 (FCC ID TE7A6V3)
The patch adds identification changes to the existing TP-Link Archer A6,
by Vinay Patil <post2vinay@gmail.com>, which has identical hardware.

Specification
-------------
MediaTek MT7621 SOC
RAM:         128MB DDR3
SPI Flash:   W25Q128 (16MB)
Ethernet:    MT7530 5x 1000Base-T
WiFi 5GHz:   Mediatek MT7613BE
WiFi 2.4GHz: Mediatek MT7603E
UART/Serial: 115200 8n1

Device Configuration & Serial Port Pins
---------------------------------------
ETH Ports:    LAN4 LAN3 LAN2 LAN1 WAN
             _______________________
             |                     |
Serial Pins: |   VCC GND TXD RXD   |
             |_____________________|

LEDs:         Power Wifi2G Wifi5G LAN WAN

Build Output
------------
The build will generate following set of files
[1] openwrt-ramips-mt7621-tplink_archer-c6-v3-initramfs-kernel.bin
[2] openwrt-ramips-mt7621-tplink_archer-c6-v3-squashfs-factory.bin
[3] openwrt-ramips-mt7621-tplink_archer-c6-v3-squashfs-sysupgrade.bin

How to Use - Flashing from TP-Link Web Interface
------------------------------------------------
* Go to "Advanced/System Tools/Firmware Update".
* Click "Browse" and upload the OpenWrt factory image: factory.bin[2]
* Click the "Upgrade" button, and select "Yes" when prompted.

TFTP Booting
------------
Setup a TFTP boot server with address 192.168.0.5.
While starting U-boot press '4' key to stop autoboot.
Copy the initramfs-kernel.bin[1] to TFTP server folder, rename as test.bin
From u-boot command prompt run tftpboot followed by bootm.

Recovery
--------
Archer A6 V3 has recovery page activated if SPI booting from flash fails.
Recovery page can be activated by powercycling the router four times
before the boot process is complete.
Note: TFTP boot can be activated only from u-boot serial console.
Device recovery address: 192.168.0.1

Signed-off-by: Amish Vishwakarma <vishwakarma.amish@gmail.com>
[fix indent]
Signed-off-by: David Bauer <mail@david-bauer.net>
2021-06-13 11:32:31 +02:00
Adam Elyas edaf432bf4 ramips: fix LAN LED trigger assignment for Xiaomi Router 3 Pro
The default trigger for the amber lights on lan1 and lan3 were
mistakenly swapped after the device's migration to DSA. This
caused activity on one port to trigger the amber light on the
other port. Swapping their default trigger in the DTS file
fixes that.

Signed-off-by: Adam Elyas <adamelyas@outlook.com>
[minor commit title adjustment, wrap commit message]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-06-09 22:44:00 +02:00
Pawel Dembicki 2c97a02fef ramips: mt7620: disable Jboot devices build
At this moment kernel size in mt7620 snapshot builds is bigger than 2048k.
It should be disabled by default.

Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
2021-06-09 22:18:37 +02:00
Pawel Dembicki e1d8a14cd0 ramips: mt7620: add kernel size for Jboot devices
Since few months multiple users reported problems with various JBoot
devices. [0][1][2][3] All of them was bricked.

On my Lava LR-25G001 it freezes with current snapshot:

CDW57CAM_003 Jboot B695
Giga Switch AR8327 init
AR8327/AR8337 id   ==> 0x1302
JRecovery Version R1.2 2014/04/01 18:25
SPI FLASH: MX25l12805d 16M
.
.
(freeze)

The kernel size is >2048k.

I built current master with minimal config and it boots well:

CDW57CAM_003 Jboot B695
Giga Switch AR8327 init
AR8327/AR8337 id   ==> 0x1302
JRecovery Version R1.2 2014/04/01 18:25
SPI FLASH: MX25l12805d 16M
.
...........................
Starting kernel @80000000...
[    0.000000] Linux version 5.4.124

Kernel size is <2048k.

Jboot bootloader isn't open source, so it's impossible to find
solution in code. It looks, that some buffer for kernel have 2MB size.

To avoid bricked devices, this commit introduces 2048k limit kernel
size for all jboot routers.

[0] https://bugs.openwrt.org/index.php?do=details&task_id=3539
[1] https://eko.one.pl/forum/viewtopic.php?pid=254344
[2] https://eko.one.pl/forum/viewtopic.php?id=20930
[3] https://eko.one.pl/forum/viewtopic.php?pid=241376#p241376

Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
[remove Fixes:]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-06-09 22:18:37 +02:00
Liu Yu ae9c5cd37b ramips: fix Ethernet random MAC address for HILINK HLK-7628N
Set the ethernet address from flash.

MAC addresses as verified by OEM firmware:

  use   interface  source
  2g    wlan0      factory 0x04 (label)
  LAN   eth0.1     factory 0x28 (label+1)
  WAN   eth0.2     factory 0x2e (label+2)

Fixes: 671c9d16e3 ("ramips: add support for HILINK HLK-7628N")

Signed-off-by: Liu Yu <f78fk@live.com>
[drop old MAC address setup from 02_network, cut out state_default
changes, face-lift commit message, add Fixes:]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-06-09 22:18:37 +02:00
David Bauer 902d7e497c ramips: fix patch location
The patch for adding the config_aneg function for the Atheros
AR8031/AR8033 PHY was formatted in a way it moved to different PHY
models while refreshing patches on kernel updates.

Move the diff directly below the PHY name so this won't happen in the
future.

Signed-off-by: David Bauer <mail@david-bauer.net>
2021-06-08 00:39:28 +02:00
Gaspare Bruno 0056ffb468 ramips: mt7620: enable autonegotiation for all ports
This enables autonegotiation for all ephy ports on probe.
Some devices do not configure the ports, particularly port 4.

Signed-off-by: Gaspare Bruno <gaspare@anlix.io>
[replace magic values ; reword commit message]
Signed-off-by: David Bauer <mail@david-bauer.net>
2021-06-08 00:39:18 +02:00
David Bauer 6a15abbc75 ramips: make PHY initialization more descriptive
The basic mode control register of the ESW PHYs is modified in this
codeblock. Use the respective macros to make this code more readable.

Signed-off-by: David Bauer <mail@david-bauer.net>
2021-06-08 00:39:07 +02:00
David Bauer 15167671b0 generic: backport at803x fixes
As patches for the AR8031/AR8033 copper page selection were merged
upstream, we can backport these patches.

This also fixes a PHY capabilities detection issue on the Ubiquiti
ER-X-SFP.

Signed-off-by: David Bauer <mail@david-bauer.net>
2021-06-08 00:38:28 +02:00
Andreas Böhler a3d8c1295e ramips: Add support for SERCOMM NA502
The SERCOMM NA502 is a smart home gateway manufactured by SERCOMM and sold
under different brands (among others, A1 Telekom Austria SmartHome
Gateway). It has multi-protocol radio support in addition to LAN and WiFi.

Note: BLE is currently unsupported.

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

  - MT7621ST 880MHz, Single-Core, Dual-Thread
  - MT7603EN 2.4GHz WiFi
  - MT7662EN 5GHz WiFi + BLE
  - 128MiB NAND
  - 256MiB DDR3 RAM
  - SD3503 ZWave Controller
  - EM357 Zigbee Coordinator

MAC address assignment
----------------------

LAN MAC is read from the config partition, WiFi 2.4GHz is LAN+2 and matches
the OEM firmware. WiFi 5GHz with LAN+1 is an educated guess since the
OEM firmware does not enable 5GHz WiFi.

Installation
------------
Attach serial console, then boot the initramfs image via TFTP.
Once inside OpenWrt, run sysupgrade -n with the sysupgrade file.

Attention: The device has a dual-firmware design. We overwrite kernel2,
since kernel1 contains an automatic recovery image.

If you get NAND ECC errors and are stuck with bad eraseblocks, try to
erase the mtd partition first with

mtd unlock ubi
mtd erase ubi

This should only be needed once.

Signed-off-by: Andreas Böhler <dev@aboehler.at>
[use kiB for IMAGE_SIZE]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-06-06 21:00:09 +02:00
Ben Gainey a509b80065 ramips: add support for the Wavlink WL-WN579X3
About the device
----------------

SoC: MediaTek MT7620a @ 580MHz
RAM: 64M
FLASH: 8MB
WiFi: SoC-integrated: MediaTek MT7620a bgn
WiFi: MediaTek MT7612EN nac
GbE: 2x (RTL8211F)
BTN: - WPS
- Reset
- Router/Repeater/AP (3-way slide-switch)
LED: - WPS (blue)
- 3-segment Wifi signal representation (blue)
- WiFi (blue)
- WAN (blue)
- LAN (blue)
- Power (blue)
UART: UART is present as Pads with through-holes on the PCB. They are
located next to the reset button and are labelled Vcc/TX/RX/GND as
appropriate. Use 3.3V, 57600-8N1.

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

Using the webcmd interface
--------------------------

Warning: Do not update to the latest Wavlink firmware (version
20201201) as this removes the webcmd console and you will need to
use the serial port instead.

You will need to have built uboot/sqauashfs image for this device,
and you will need to provide an HTTP service where the image can
be downloaded from that is accessible by the device.
You cannot use the device manufacturers firmware upgrade interface
as it rejects the OpenWrt image.

1. Log into the device's admin portal. This is necessary to
   authenticate you as a user in order to be able to access the
   webcmd interface.
2. Navigate to http://<device-ip>/webcmd.shtml - you can access
   the console directly through this page, or you may wish to
   launch the installed `telnetd` and use telnet instead.
   * Using telnet is recommended since it provides a more
     convenient shell interface that the web form.
   * Launch telnetd from the form with the command `telnetd`.
   * Check the port that telnetd is running on using
     `netstat -antp|grep telnetd`, it is likely to be 2323.
   * Connect to the target using `telnet`. The username should
     be `admin2860`, and the password is your admin password.
3. On the target use `curl` to download the image.
   e.g.  `curl -L -O http://<some-other-lan-ip>/openwrt-ramips-mt7620-\
          wavlink_wl-wn579x3-squashfs-sysupgrade.bin`.
   Check the hash using `md5sum`.
4. Use the mtd_write command to flash the image.
   * The flash partition should be mtd4, but check
     /sys/class/mtd/mtd4/name first. The partition should be
     called 'Kernel'.
   * To flash use the following command:
     `mtd_write -r -e /dev/mtd<n> write <image-file> /dev/mtd<n>`
     Where mtd<n> is the Kernel partition, and <image-file> is
     the OpenWrt image previously downloaded.
   * The command above will erase, flash and then reboot the
     device. Once it reboots it will be running OpenWrt.

Connect via ssh to the device at 192.168.1.1 on the LAN port.
The WAN port will be configured via DHCP.

Using the serial port
---------------------

The device uses uboot like many other MT7260a based boards. To
use this interface, you will need to connect to the serial
interface, and provide a TFTP server. At boot follow the
bootloader menu and select option 2 to erase/flash the image.
Provide the address and filename details for the tftp server.
The bootloader will do the rest.

Once the image is flashed, the board will boot into OpenWrt. The
console is available over the serial port.

Signed-off-by: Ben Gainey <ba.gainey@googlemail.com>
2021-06-06 18:56:45 +02:00
John Audia 752cd29904 kernel: bump 5.4 to 5.4.124
Manually rebased:
  generic/hack-5.4/662-remove_pfifo_fast.patch

All other patches automatically rebased.

Build system: x86_64
Build-tested: ipq806x/R7800
Run-tested: ipq806x/R7800

No dmesg regressions, everything functional

Signed-off-by: John Audia <graysky@archlinux.us>
[manual changes to ramips/patches-5.10/835-asoc-add-mt7620-support.patch]
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2021-06-06 00:25:25 +02:00
Rui Salvaterra da77b9c2f1 kernel: bump 5.10 to 5.10.42
Deleted (reverse-appliable):
generic/pending-5.10/110-perf-jevents-fix-getting-maximum-number-of-fds.patch

Manually refreshed:
ramips/patches-5.10/835-asoc-add-mt7620-support.patch

Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
2021-06-06 00:24:07 +02:00
Shiji Yang 4a9f389ed2 ramips: split Youku YK1 to YK-L1 and YK-L1c
Device specifications:
* Model: Youku YK-L1/L1c
* CPU: MT7620A
* RAM: 128 MiB
* Flash: 32 MiB (YK-L1)/ 16 MiB (YK-L1c)
* LAN: 2* 10M/100M Ports
* WAN: 1* 10M/100M Port
* USB: 1* USB2.0
* SD: 1* MicroSD socket
* UART: 1* TTL, Baudrate 57600

Descriptions:
  Previous supported device YOUKU yk1 is actually Youku YK-L1. Though they look
  really different, the only hardware difference between the two models is flash
  size, YK-L1 has 32 MiB flash but YK-L1c has 16MiB. It seems that YK-L1c can
  compatible with YK-L1's firmware but it's better to split it to different models.

  It is easy to identify the models by looking at the label on the bottom of the
  device. The label has the model number "YK-L1" or "YK-L1c". Due to different flash
  sizes, YK-L1c that using previous YK-L1's firmware needs to apply "force update"
  to install compatible firmware, so please backup config file before system upgrade.

Signed-off-by: Shiji Yang <yangshiji66@qq.com>
[use more specific name for DTSI]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-06-05 23:39:14 +02:00
Tee Hao Wei b232680f84 ramips: add support for Linksys EA8100 v1
Specifications:
- SoC: MT7621AT
- RAM: 256MB
- Flash: 128MB NAND
- Ethernet: 5 Gigabit ports
- WiFi: 2.4G/5G MT7615N
- USB: 1 USB 3.0, 1 USB 2.0

This device is very similar to the EA7300 v1/v2 and EA7500 v2.

Installation:

Upload the generated factory image through the factory web interface.

(following part taken from EA7300 v2 commit message:)

This might fail due to the A/B nature of this device. When flashing, OEM
firmware writes over the non-booted partition. If booted from 'A',
flashing over 'B' won't work. To get around this, you should flash the
OEM image over itself. This will then boot the router from 'B' and
allow you to flash OpenWRT without problems.

Reverting to factory firmware:

Hard-reset the router three times to force it to boot from 'B.' This is
where the stock firmware resides. To remove any traces of OpenWRT from
your router simply flash the OEM image at this point.

With thanks to Leon Poon (@LeonPoon) for the initial bringup.

Signed-off-by: Tee Hao Wei <angelsl@in04.sg>
[add missing entry in 10_fix_wifi_mac]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-06-05 23:39:14 +02:00
Jonathan Sturges 6d23e474ad ramips: add support for Amped Wireless ALLY router and extender
Amped Wireless ALLY is a whole-home WiFi kit, with a router (model
ALLY-R1900K) and an Extender (model ALLY-00X19K).  Both are devices are
11ac and based on MediaTek MT7621AT and MT7615N chips.  The units are
nearly identical, except the Extender lacks a USB port and has a single
Ethernet port.

Specification:
- SoC: MediaTek MT7621AT (2C/4T) @ 880MHz
- RAM: 128MB DDR3 (Nanya NT5CC64M16GP-DI)
- FLASH: 128MB NAND (Winbond W29N01GVSIAA)
- WiFi: 2.4/5 GHz 4T4R
  - 2.4GHz MediaTek MT7615N bgn
  - 5GHz MediaTek MT7615N nac
- Switch: SoC integrated Gigabit Switch
- USB: 1x USB3 (Router only)
- BTN: Reset, WPS
- LED: single RGB
- UART:  through-hole on PCB.
   J1: pin1 (square pad, towards rear)=3.3V, pin2=RX,
   pin3=GND, pin4=TX.  Settings: 57600/8N1.

Note regarding dual system partitions
-------------------------------------

The vendor firmware and boot loader use a dual partition scheme.  The boot
partition is decided by the bootImage U-boot environment variable: 0 for
the 1st partition, 1 for the 2nd.

OpenWrt does not support this scheme and will always use the first OS
partition.  It will set bootImage to 0 during installation, making sure
the first partition is selected by the boot loader.

Also, because we can't be sure which partition is active to begin with, a
2-step flash process is used.  We first flash an initramfs image, then
follow with a regular sysupgrade.

Installation:

Router (ALLY-R1900K)
1) Install the flashable initramfs image via the OEM web-interface.
  (Alternatively, you can use the TFTP recovery method below.)
  You can use WiFi or Ethernet.
  The direct URL is:  http://192.168.3.1/07_06_00_firmware.html
  a. No login is needed, and you'll be in their setup wizard.
  b. You might get a warning about not being connected to the Internet.
  c. Towards the bottom of the page will be a section entitled "Or
  Manually Upgrade Firmware from a File:" where you can manually choose
  and upload a firmware file.
  d: Click "Choose File", select the OpenWRT "initramfs" image and click
  "Upload."
2) The Router will flash the OpenWrt initramfs image and reboot.  After
  booting, LuCI will be available on 192.168.1.1.
3) Log into LuCI as root; there is no password.
4) Optional (but recommended) is to backup the OEM firmware before
  continuing; see process below.
5) Complete the Installation by flashing a full OpenWRT image.  Note:
  you may use the sysupgrade command line tool in lieu of the UI if
  you prefer.
  a.  Choose System -> Backup/Flash Firmware.
  b.  Click "Flash Image..." under "Flash new firmware image"
  c.  Click "Browse..." and then select the sysupgrade file.
  d.  Click Upload to upload the sysupgrade file.
  e.  Important:  uncheck "Keep settings and retain the current
      configuration" for this initial installation.
  f.  Click "Continue" to flash the firmware.
  g.  The device will reboot and OpenWRT is installed.

Extender (ALLY-00X19K)
1) This device requires a TFTP recovery procedure to do an initial load
  of OpenWRT.  Start by configuring a computer as a TFTP client:
  a. Install a TFTP client (server not necessary)
  b. Configure an Ethernet interface to 192.168.1.x/24; don't use .1 or .6
  c. Connect the Ethernet to the sole Ethernet port on the X19K.
2) Put the ALLY Extender in TFTP recovery mode.
  a. Do this by pressing and holding the reset button on the bottom while
  connecting the power.
  b. As soon as the LED lights up green (roughly 2-3 seconds), release
  the button.
3) Start the TFTP transfer of the Initramfs image from your setup machine.
For example, from Linux:
tftp -v -m binary 192.168.1.6 69 -c put initramfs.bin
4) The Extender will flash the OpenWrt initramfs image and reboot.  After
booting, LuCI will be available on 192.168.1.1.
5) Log into LuCI as root; there is no password.
6) Optional (but recommended) is to backup the OEM firmware before
  continuing; see process below.
7) Complete the Installation by flashing a full OpenWRT image.  Note: you
may use the sysupgrade command line tool in lieu of the UI if you prefer.
  a.  Choose System -> Backup/Flash Firmware.
  b.  Click "Flash Image..." under "Flash new firmware image"
  c.  Click "Browse..." and then select the sysupgrade file.
  d.  Click Upload to upload the sysupgrade file.
  e.  Important:  uncheck "Keep settings and retain the current
      configuration" for this initial installation.
  f.  Click "Continue" to flash the firmware.
  g.  The device will reboot and OpenWRT is installed.

Backup the OEM Firmware:
-----------------------

There isn't any downloadable firmware for the ALLY devices on the Amped
Wireless web site. Reverting back to the OEM firmware is not possible
unless we have a backup of the original OEM firmware.

The OEM firmware may be stored on either /dev/mtd3 ("firmware") or
/dev/mtd6 ("oem").  We can't be sure which was overwritten with the
initramfs image, so backup both partitions to be safe.

  1) Once logged into LuCI, navigate to System -> Backup/Flash Firmware.
  2) Under "Save mtdblock contents," first select "firmware" and click
  "Save mtdblock" to download the image.
  3) Repeat the process, but select "oem" from the pull-down menu.

Revert to the OEM Firmware:
--------------------------
* U-boot TFTP:
  Follow the TFTP recovery steps for the Extender, and use the
  backup image.

* OpenWrt "Flash Firmware" interface:
  Upload the backup image and select "Force update"
  before continuing.

Signed-off-by: Jonathan Sturges <jsturges@redhat.com>
2021-06-05 23:39:14 +02:00
Aashish Kulkarni 251c995cbb ramips: add support for Linksys E5600
This submission relied heavily on the work of Linksys EA7300 v1/ v2.

Specifications:

* SoC: MediaTek MT7621A (880 MHz 2c/4t)
* RAM: 128M DDR3-1600
* Flash: 128M NAND
* Eth: MediaTek MT7621A (10/100/1000 Mbps x5)
* Radio: MT7603E/MT7613BE (2.4 GHz & 5 GHz)
* Antennae: 2 internal fixed in the casing and 2 on the PCB
* LEDs: Blue (x4 Ethernet)
  Blue+Orange (x2 Power + WPS and Internet)
* Buttons: Reset (x1)
  WPS (x1)

Installation:

Flash factory image through GUI.

This device has 2 partitions for the firmware called firmware and
alt_firmware. To successfully flash and boot the device, the device
should have been running from alt_firmware partition. To get the device
booted through alt_firmware partition, download the OEM firmware from
Linksys website and upgrade the firmware from web GUI. Once this is done,
flash the OpenWrt Factory firmware from web GUI.

Reverting to factory firmware:

1. Boot to 'alt_firmware'(where stock firmware resides) by doing one of
   the following:
   Press the "wps" button as soon as power LED turns on when booting.
   (OR) Hard-reset the router consecutively three times to force it to
   boot from 'alt_firmware'.
2. To remove any traces of OpenWRT from your router simply flash the OEM
   image at this point.

Signed-off-by: Aashish Kulkarni <aashishkul@gmail.com>

[fix hanging indents and wrap to 74 characters per line,
 add kmod-mt7663-firmware-sta package for 5GHz STA mode to work,
 remove sysupgrade.bin and concatenate IMAGES instead in mt7621.mk,
 set default-state "on" for power LED]
Signed-off-by: Sannihith Kinnera <digislayer@protonmail.com>

[move check-size before append-metadata, remove trailing whitespace]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-06-05 23:39:14 +02:00
Philipp Borgers fbc2feadd4 ramips: enable additional UART on MikroTik RouterBOARD M33G
The RouterBOARD M33G has an additional UART that should be enabled
by default.

Signed-off-by: Philipp Borgers <borgers@mi.fu-berlin.de>
2021-06-05 01:17:11 +02:00
Thomas Aldrian f755d81999 ramips: add support for Wavlink WL-WN578A2
This commit adds support for the Wavlink WL-WN578A2 dual-band wall-plug
wireless router. This device is also sold under the name SilverCrest
SWV 733 A2.

Device Specifications:

- CPU: MediaTek MT7628AN (580MHz)
- Flash: 8MB
- RAM: 64MB
- Bootloader: U-Boot
- Ethernet: 2x 10/100 Mbps
- 2.4 GHz: 802.11b/g/n SoC
- 5 GHz: 802.11a/n/ac MT7610E
- Antennas: internal
- 4 green LEDs: WPS/Power, LAN, WAN, wifi-low, wifi-med, wifi-high
- Buttons: Reset, WPS
- Sliding mode switch: AP, repeater, client
- Small sliding power switch

Flashing instructions:

U-Boot launches TFTP client if WPS button is pressed during power-on.
Configure as follows:

- Server IP: 192.168.10.100
- Filename (rename sysupgrade file to this): firmware.bin

Flashing should not take more than a minute, device will reboot
automatically.

Signed-off-by: Thomas Aldrian <dev.aldrian@gmail.com>
2021-05-28 01:12:21 +02:00
Chukun Pan 57cb387cfe ramips: add support for JCG Q20
JCG Q20 is an AX 1800M router.

Hardware specs:
  SoC: MediaTek MT7621AT
  Flash: Winbond W29N01HV 128 MiB
  RAM: Winbond W632GU6NB-11 256 MiB
  WiFi: MT7915 2.4/5 GHz 2T2R
  Ethernet: 10/100/1000 Mbps x3
  LED: Status (red / blue)
  Button: Reset, WPS
  Power: DC 12V,1A

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

MAC addresses map:
  0x00004 *:3e wlan2g/wlan5g
  0x3fff4 *:3c lan/label
  0x3fffa *:3c wan

Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
2021-05-26 23:10:45 +02:00
Leon M. George 3501db9b9b ramips: add support for cudy WR2100
Specifications

  SoC:       MT7621
  CPU:       880 MHz
  Flash:     16 MiB
  RAM:       128 MiB
  WLAN:      2.4 GHz b/g/n, 5 GHz a/n/ac
             MT7603E / MT7615E
  Ethernet:  5x Gbit ports

Installation

There are two known options:
1) The Luci-based UI.
2) Press and hold the reset button during power up.
   The router will request 'recovery.bin' from a TFTP server at
   192.168.1.88.

Both options require a signed firmware binary.
The openwrt image supplied by cudy is signed and can be used to
install unsigned images.

R4 & R5 need to be shorted (0-100Ω) for the UART to work.

Signed-off-by: Leon M. George <leon@georgemail.eu>
[remove non-required switch-port node - remove trgmii phy-mode]
Signed-off-by: David Bauer <mail@david-bauer.net>
2021-05-26 23:10:37 +02:00
Georgi Vlaev a46ad596a3 ramips: add support for TP-Link Archer C6U v1 (EU)
This patch adds support for TP-Link Archer C6U v1 (EU).
The device is also known in some market as Archer C6 v3.
This patch supports only Archer C6U v1 (EU).

Specifications:
--------------

* SoC: Mediatek MT7621AT 2C2T, 880MHz
* RAM: 128MB DDR3
* Flash: 16MB SPI NOR flash (Winbond 25Q128)
* WiFi 5GHz: Mediatek MT7613BEN (2x2:2)
* WiFi 2.4GHz: Mediatek MT7603EN (2x2:2)
* Ethernet: MT7630, 5x 1000Base-T.
* LED: Power, WAN, LAN, WiFi 2GHz and 5GHz, USB
* Buttons: Reset, WPS.
* UART: Serial console (115200 8n1), J1(GND:3)
* USB: One USB2 port.

Installation:
------------

Install the OpenWrt factory image for C6U is from the
TP-Link web interface.

1) Go to "Advanced/System Tools/Firmware Update".
2) Click "Browse" and upload the OpenWrt factory image:
openwrt-ramips-mt7621-tplink_archer-c6u-v1-squashfs-factory.bin.
3) Click the "Upgrade" button, and select "Yes" when prompted.

Recovery to stock firmware:
--------------------------

The C6U bootloader has a failsafe mode that provides a web
interface (running at 192.168.0.1) for reverting back to the
stock TP-Link firmware. The failsafe interface is triggered
from the serial console or on failed kernel boot. Unfortunately,
there's no key combination that enables the failsafe mode. This
gives us two options for recovery:

1) Recover using the serial console (J1 header).
The recovery interface can be selected by hitting 'x' when
prompted on boot.

2) Trigger the bootloader failsafe mode.
A more dangerous option is force the bootloader into
recovery mode by erasing the OpenWrt partition from the
OpenWrt's shell - e.g "mtd erase firmware". Please be
careful, since erasing the wrong partition can brick
your device.

MAC addresses:
-------------

OEM firmware configuration:
D8:07:B6:xx:xx:83 : 5G
D8:07:B6:xx:xx:84 : LAN (label)
D8:07:B6:xx:xx:84 : 2.4G
D8:07:B6:xx:xx:85 : WAN

Signed-off-by: Georgi Vlaev <georgi.vlaev@konsulko.com>
2021-05-26 23:10:25 +02:00
Vinay Patil f8f8935adb ramips: add support for TP-Link Archer A6 v3
The patch adds support for the TP-Link Archer A6 v3
The router is sold in US and India with FCC ID TE7A6V3

Specification
-------------
MediaTek MT7621 SOC
RAM:         128MB DDR3
SPI Flash:   W25Q128 (16MB)
Ethernet:    MT7530 5x 1000Base-T
WiFi 5GHz:   Mediatek MT7613BE
WiFi 2.4GHz: Mediatek MT7603E
UART/Serial: 115200 8n1

Device Configuration & Serial Port Pins
---------------------------------------
ETH Ports:    LAN4 LAN3 LAN2 LAN1 WAN
             _______________________
             |                     |
Serial Pins: |   VCC GND TXD RXD   |
             |_____________________|

LEDs:         Power Wifi2G Wifi5G LAN WAN

Build Output
------------
The build will generate following set of files
[1] openwrt-ramips-mt7621-tplink_archer-a6-v3-initramfs-kernel.bin
[2] openwrt-ramips-mt7621-tplink_archer-a6-v3-squashfs-factory.bin
[3] openwrt-ramips-mt7621-tplink_archer-a6-v3-squashfs-sysupgrade.bin

How to Use - Flashing from TP-Link Web Interface
------------------------------------------------
* Go to "Advanced/System Tools/Firmware Update".
* Click "Browse" and upload the OpenWrt factory image: factory.bin[2]
* Click the "Upgrade" button, and select "Yes" when prompted.

TFTP Booting
------------
Setup a TFTP boot server with address 192.168.0.5.
While starting U-boot press '4' key to stop autoboot.
Copy the initramfs-kernel.bin[1] to TFTP server folder, rename as test.bin
From u-boot command prompt run tftpboot followed by bootm.

Recovery
--------
Archer A6 V3 has recovery page activated if SPI booting from flash fails.
Recovery page can be activated from serial console only.
Press 'x' while u-boot is starting
Note: TFTP boot can be activated only from u-boot serial console.
Device recovery address: 192.168.0.1

Thanks to: Frankis for Randmon MAC address fix.

Signed-off-by: Vinay Patil <post2vinay@gmail.com>
[remove superfluous factory image definition, whitespacing]
Signed-off-by: David Bauer <mail@david-bauer.net>
2021-05-26 23:10:14 +02:00
John Audia 08593db128 kernel: bump 5.4 to 5.4.119
Removed upstreamed:
  generic/backport-5.4/050-gro-fix-napi_gro_frags-Fast-GRO-breakage-due-to-IP-a.patch
  bcm63xx/patches-5.4/434-nand-brcmnand-fix-OOB-R-W-with-Hamming-ECC.patch*

Removed/code was included upstream and therefore redundant:
  ramips/patches-5.4/999-fix-pci-init-mt7620.patch

All other patches automatically rebased.

* update_kernel.sh did not flag this yet it was included in 5.4.119[1], as a
  result of the rebase, I removed my testing lines since I did not go back to
  test built or to run test 5.4.119 with the removed patch present.

1. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.4.119&id=e5b3e69eb36ac1178a7a2392616fd29afd288c4e

Signed-off-by: John Audia <graysky@archlinux.us>
2021-05-23 15:09:06 +02:00
Piotr Dymacz cf3f1f82ea ramips: fix SUPPORTED_DEVICES for ALFA Network devices
Vendor firmware expects model name without manufacturer name inside
'supported_devices' part of metadata. This allows direct upgrade to
OpenWrt from vendor's GUI.

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
2021-05-16 23:59:13 +02:00
Rui Salvaterra d337731f85 kernel: bump 5.10 to 5.10.37
Automatically refreshed:
ath79/patches-5.10/0032-MIPS-ath79-sanitize-symbols.patch
bcm63xx/patches-5.10/322-MIPS-BCM63XX-switch-to-IRQ_DOMAIN.patch
bcm63xx/patches-5.10/434-nand-brcmnand-fix-OOB-R-W-with-Hamming-ECC.patch
bmips/patches-5.10/001-v5.11-mips-bmips-select-ARCH_HAS_RESET_CONTROLLER.patch
bmips/patches-5.10/041-v5.13-mtd-rawnand-brcmnand-fix-OOB-R-W-with-Hamming-ECC.patch
bmips/patches-5.10/202-mips-bmips-disable-ARCH_HAS_SYNC_DMA_FOR_CPU_ALL.patch
bmips/patches-5.10/600-mips-bmips-add-pci-support.patch
generic/backport-5.10/103-v5.13-MIPS-select-CPU_MIPS64-for-remaining-MIPS64-CPUs.patch
generic/hack-5.10/301-mips_image_cmdline_hack.patch
generic/hack-5.10/402-mtd-blktrans-call-add-disks-after-mtd-device.patch
generic/hack-5.10/902-debloat_proc.patch
generic/pending-5.10/300-mips_expose_boot_raw.patch
generic/pending-5.10/495-mtd-core-add-get_mtd_device_by_node.patch
generic/pending-5.10/630-packet_socket_type.patch
ipq806x/patches-5.10/0072-add-ipq806x-with-no-clocks.patch
ipq806x/patches-5.10/099-1-mtd-nand-raw-qcom_nandc-add-boot_layout_mode-support.patch
lantiq/patches-5.10/0001-MIPS-lantiq-add-pcie-driver.patch
lantiq/patches-5.10/0023-NET-PHY-add-led-support-for-intel-xway.patch
lantiq/patches-5.10/0152-lantiq-VPE.patch

Deleted (reverse-appliable):
bmips/patches-5.10/052-v5.13-gpio-guard-gpiochip_irqchip_add_domain-with-GPIOLIB_.patch
generic/backport-5.10/499-v5.13-mtd-don-t-lock-when-recursively-deleting-partitions.patch

Deleted (alternative upstream fix):
ramips/patches-5.10/330-fix-pci-init-mt7620.patch

Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
2021-05-14 14:50:03 +01:00
Leonardo Mörlein b993b68b6c build: introduce $(MKHASH)
Before this commit, it was assumed that mkhash is in the PATH. While
this was fine for the normal build workflow, this led to some issues if

    make TOPDIR="$(pwd)" -C "$pkgdir" compile

was called manually. In most of the cases, I just saw warnings like this:

    make: Entering directory '/home/.../package/gluon-status-page'
    bash: line 1: mkhash: command not found
    bash: line 1: mkhash: command not found
    bash: line 1: mkhash: command not found
    bash: line 1: mkhash: command not found
    bash: line 1: mkhash: command not found
    bash: line 1: mkhash: command not found
    bash: line 1: mkhash: command not found
    bash: line 1: mkhash: command not found
    [...]

While these were only warnings and the package still compiled sucessfully,
I also observed that some package even fail to build because of this.

After applying this commit, the variable $(MKHASH) is introduced. This
variable points to $(STAGING_DIR_HOST)/bin/mkhash, which is always the
correct path.

Signed-off-by: Leonardo Mörlein <me@irrelefant.net>
2021-05-13 15:13:15 +02:00
Shiji Yang e57e460dc7 ramips: fix mac addresses of Youku YK1
MAC addresses read from official firmware

        value       location
Wlan    xx 71 de    factory@0x04
Lan     xx 71 dd    factory@0x28
Wan     xx 71 df    factory@0x2e
Label   xx 71 dd    factory@0x28

Signed-off-by: Shiji Yang <yangshiji66@qq.com>
[fix sorting in 02_network, redact commit message]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-05-10 14:41:06 +02:00
Adrian Schmutzler f4940d2229 ramips: use standard naming scheme for Zyxel NR7101 LED nodes
Make naming and DT label consistent with other devices at this
target.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-05-10 14:41:06 +02:00
Bjørn Mork 2449a63208 ramips: mt7621: Add support for ZyXEL NR7101
The ZyXEL NR7101 is an 802.3at PoE powered 5G outdoor (IP68) CPE
with integrated directional 5G/LTE antennas.

Specifications:

 - SoC: MediaTek MT7621AT
 - RAM: 256 MB
 - Flash: 128 MB MB NAND (MX30LF1G18AC)
 - WiFi: MediaTek MT7603E
 - Switch: 1 LAN port (Gigabiti)
 - 5G/LTE: Quectel RG502Q-EA connected by USB3 to SoC
 - SIM: 2 micro-SIM slots under transparent cover
 - Buttons: Reset, WLAN under same cover
 - LEDs: Multicolour green/red/yellow under same cover (visible)
 - Power: 802.3at PoE via LAN port

The device is built as an outdoor ethernet to 5G/LTE bridge or
router. The Wifi interface is intended for installation and/or
temporary management purposes only.

UART Serial:

57600N1
Located on populated 5 pin header J5:

 [o] GND
 [ ] key - no pin
 [o] RX
 [o] TX
 [o] 3.3V Vcc

Remove the SIM/button/LED cover, the WLAN button and 12 screws
holding the back plate and antenna cover together. The GPS antenna
is fixed to the cover, so be careful with the cable.  Remove 4
screws fixing the antenna board to the main board, again being
careful with the cables.

A bluetooth TTL adapter is recommended for permanent console
access, to keep the router water and dustproof. The 3.3V pin is
able to power such an adapter.

MAC addresses:

OpenWrt OEM   Address          Found as
lan     eth2  08:26:97:*:*:BC  Factory 0xe000 (hex), label
wlan0   ra0   08:26:97:*:*:BD  Factory 0x4 (hex)
wwan0   usb0  random

WARNING!!

ISP managed firmware might at any time update itself to a version
where all known workarounds have been disabled.  Never boot an ISP
managed firmware with a SIM in any of the slots if you intend to use
the router with OpenWrt. The bootloader lock can only be disabled with
root access to running firmware. The flash chip is physically
inaccessible without soldering.

Installation from OEM web GUI:

- Log in as "supervisor" on https://172.17.1.1/
- Upload OpenWrt initramfs-recovery.bin image on the
  Maintenance -> Firmware page
- Wait for OpenWrt to boot and ssh to root@192.168.1.1
- (optional) Copy OpenWrt to the recovery partition. See below
- Sysupgrade to the OpenWrt sysupgrade image and reboot

Installation from OEM ssh:

- Log in as "root" on 172.17.1.1 port 22022
- scp OpenWrt initramfs-recovery.bin image to 172.17.1.1:/tmp
- Prepare bootloader config by running:
    nvram setro uboot DebugFlag 0x1
    nvram setro uboot CheckBypass 0
    nvram commit
- Run "mtd_write -w write initramfs-recovery.bin Kernel" and reboot
- Wait for OpenWrt to boot and ssh to root@192.168.1.1
- (optional) Copy OpenWrt to the recovery partition. See below
- Sysupgrade to the OpenWrt sysupgrade image and reboot

Copying OpenWrt to the recovery partition:

- Verify that you are running a working OpenWrt recovery image
  from flash
- ssh to root@192.168.1.1 and run:
    fw_setenv CheckBypass 0
    mtd -r erase Kernel2
- Wait while the bootloader mirrors Image1 to Image2

NOTE: This should only be done after successfully booting the OpenWrt
  recovery image from the primary partition during installation.  Do
  not do this after having sysupgraded OpenWrt!  Reinstalling the
  recovery image on normal upgrades is not required or recommended.

Installation from Z-Loader:

- Halt boot by pressing Escape on console
- Set up a tftp server to serve the OpenWrt initramfs-recovery.bin
  image at 10.10.10.3
- Type "ATNR 1,initramfs-recovery.bin" at the "ZLB>" prompt
- Wait for OpenWrt to boot and ssh to root@192.168.1.1
- Sysupgrade to the OpenWrt sysupgrade image

NOTE: ATNR will write the recovery image to both primary and recovery
  partitions in one go.

Booting from RAM:

- Halt boot by pressing Escape on console
- Type "ATGU" at the "ZLB>" prompt to enter the U-Boot menu
- Press "4" to select "4: Entr boot command line interface."
- Set up a tftp server to serve the OpenWrt initramfs-recovery.bin
  image at 10.10.10.3
- Load it using "tftpboot 0x88000000 initramfs-recovery.bin"
- Boot with "bootm  0x8800017C" to skip the 380 (0x17C) bytes ZyXEL
  header

This method can also be used to RAM boot OEM firmware. The warning
regarding OEM applies!  Never boot an unknown OEM firmware, or any OEM
firmware with a SIM in any slot.

NOTE: U-Boot configuration is incomplete (on some devices?). You may
  have to configure a working mac address before running tftp using
   "setenv eth0addr <mac>"

Unlocking the bootloader:

If you are unebale to halt boot, then the bootloader is locked.

The OEM firmware locks the bootloader on every boot by setting
DebugFlag to 0.  Setting it to 1 is therefore only temporary
when OEM firmware is installed.

- Run "nvram setro uboot DebugFlag 0x1; nvram commit" in OEM firmware
- Run "fw_setenv DebugFlag 0x1" in OpenWrt

  NOTE:
    OpenWrt does this automatically on first boot if necessary

  NOTE2:
    Setting the flag to 0x1 avoids the reset to 0 in known OEM
    versions, but this might change.

  WARNING:
    Writing anything to flash while the bootloader is locked is
    considered extremely risky. Errors might cause a permanent
    brick!

Enabling management access from LAN:

Temporary workaround to allow installing OpenWrt if OEM firmware
has disabled LAN management:

- Connect to console
- Log in as "root"
- Run "iptables -I INPUT -i br0 -j ACCEPT"

Notes on the OEM/bootloader dual partition scheme

The dual partition scheme on this device uses Image2 as a recovery
image only. The device will always boot from Image1, but the
bootloader might copy Image2 to Image1 under specific conditions. This
scheme prevents repurposing of the space occupied by Image2 in any
useful way.

Validation of primary and recovery images is controlled by the
variables CheckBypass, Image1Stable, and Image1Try.

The bootloader sets CheckBypass to 0 and reboots if Image1 fails
validation.

If CheckBypass is 0 and Image1 is invalid then Image2 is copied to
Image1.

If CheckBypass is 0 and Image2 is invalid, then Image1 is copied to
Image2.

If CheckBypass is 1 then all tests are skipped and Image1 is booted
unconditionally.  CheckBypass is set to 1 after each successful
validation of Image1.

Image1Try is incremented if Image1Stable is 0, and Image2 is copied to
Image1 if Image1Try is 3 or larger.  But the bootloader only tests
Image1Try if CheckBypass is 0, which is impossible unless the booted
image sets it to 0 before failing.

The system is therefore not resilient against runtime errors like
failure to mount the rootfs, unless the kernel image sets CheckBypass
to 0 before failing. This is not yet implemented in OpenWrt.

Setting Image1Stable to 1 prevents the bootloader from updating
Image1Try on every boot, saving unnecessary writes to the environment
partition.

Keeping an OpenWrt initramfs recovery as Image2 is recommended
primarily to avoid unwanted OEM firmware boots on failure. Ref the
warning above. It enables console-less recovery in case of some
failures to boot from Image1.

Signed-off-by: Bjørn Mork <bjorn@mork.no>
2021-05-09 09:15:44 +02:00
Ilya Lipnitskiy 89b99e9c1a treewide: consolidate named GPIO patch into hack-5.10
ath79, lantiq, ipq40xx, ramips all use the OpenWrt-specific gpio-export
functionality. Consolidate the patch that adds it under hack-5.10 since
this logic is obviously not target-specific. For those who want to
disable it, unsetting CONFIG_GPIO_SYSFS symbol will disable this code.

Signed-off-by: Ilya Lipnitskiy <ilya.lipnitskiy@gmail.com>
2021-05-09 09:15:44 +02:00
Hauke Mehrtens 9ffa2f8193 kernel: Activate FORTIFY_SOURCE for MIPS kernel 5.4
CONFIG_FORTIFY_SOURCE=y is already set in the generic kernel
configuration, but it is not working for MIPS on kernel 5.4, support for
MIPS was only added with kernel 5.5, other architectures like aarch64
support FORTIFY_SOURCE already since some time.

This patch adds support for FORTIFY_SOURCE to MIPS with kernel 5.4,
kernel 5.10 already supports this and needs no changes.

This backports one patch from kernel 5.5 and one fix from 5.8 to make
fortify source also work on our kernel 5.4.

The changes are not compatible with the
306-mips_mem_functions_performance.patch patch which was also removed
with kernel 5.10, probably because of the same problems. I think it is
not needed anyway as the compiler should automatically optimize the
calls to memset(), memcpy() and memmove() even when not explicitly
telling the compiler to use the build in variant.

This increases the size of an uncompressed kernel by less than 1 KB.

Acked-by: Rosen Penev <rosenp@gmail.com>
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2021-04-30 23:51:19 +02:00
Ilya Lipnitskiy 0d6f207230 kernel: backport mtk_soc_eth fixes from v5.13
Fixes logic that leads to this error when booting mt7621 and other
devices that use the mediatek ethernet driver:
  [   23.144378] mtk_soc_eth 1e100000.ethernet: PPE table busy

The rest are mostly moved from pending-5.10 to backport-5.10 with a
couple of cleanups and improvements from upstream.

Refresh patches.

Links:
    https://git.kernel.org/netdev/net-next/c/c5d66587b890
    https://git.kernel.org/netdev/net-next/c/3f57d8c40fea
    https://git.kernel.org/netdev/net-next/c/5196c4178549
    https://git.kernel.org/netdev/net-next/c/787082ab9f7b
    https://git.kernel.org/netdev/net-next/c/c30c4a827390
    https://git.kernel.org/netdev/net-next/c/3630d519d7c3
    https://git.kernel.org/netdev/net-next/c/16ef670789b2
    https://git.kernel.org/netdev/net-next/c/59555a8d0dd3
    https://git.kernel.org/netdev/net-next/c/6b4423b258b9
    https://git.kernel.org/netdev/net-next/c/e9229ffd550b
    https://git.kernel.org/netdev/net-next/c/4e6bf609569c
    https://git.kernel.org/netdev/net-next/c/816ac3e6e67b
    https://git.kernel.org/netdev/net-next/c/16769a8923fa
    https://git.kernel.org/netdev/net-next/c/db2c7b353db3
    https://git.kernel.org/netdev/net-next/c/fa817272c37e
    https://git.kernel.org/netdev/net-next/c/3bc8e0aff23b

Fixes: f07fe36f22 ("kernel: update flow offload patches to upstream version")
Cc: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Ilya Lipnitskiy <ilya.lipnitskiy@gmail.com>
2021-04-30 23:48:37 +02:00
John Audia 0d2873df15 kernel: bump 5.4 to 5.4.114
Manually rebased*
  generic/backport-5.4/700-v5.5-net-core-allow-fast-GRO-for-skbs-with-Ethernet-heade.patch

Added new backport*
  generic/backport-5.4/050-gro-fix-napi_gro_frags-Fast-GRO-breakage-due-to-IP-a.patch

All others updated automatically.

The new backport was included based on this[1] upstream commit that will be
mainlined soon.  This change is needed because Eric Dumazet's check for
NET_IP_ALIGN (landed in 5.4.114) causes huge slowdowns on drivers which use
napi_gro_frags().

Build system: x86_64
Build-tested: ipq806x/R7800
Run-tested: ipq806x/R7800

No dmesg regressions, everything functional

*Credit to Alexander Lobakin
1. https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git/commit/?id=7ad18ff6449cbd6beb26b53128ddf56d2685aa93

Signed-off-by: John Audia <graysky@archlinux.us>
2021-04-30 23:48:37 +02:00
Rui Salvaterra 182eaa4916 kernel: bump 5.10 to 5.10.32
Deleted (reverse-appliable):
mediatek/patches-5.10/360-mtd-rawnand-mtk-Fix-WAITRDY-break-condition-and-time.patch

Automatically refreshed:
ath79/patches-5.10/0036-GPIO-add-named-gpio-exports.patch
generic/backport-5.10/600-v5.12-net-extract-napi-poll-functionality-to-__napi_poll.patch
generic/backport-5.10/601-v5.12-net-implement-threaded-able-napi-poll-loop-support.patch
generic/backport-5.10/602-v5.12-net-add-sysfs-attribute-to-control-napi-threaded-mod.patch
generic/backport-5.10/603-v5.12-net-fix-race-between-napi-kthread-mode-and-busy-poll.patch
generic/pending-5.10/600-netfilter_conntrack_flush.patch
generic/pending-5.10/613-netfilter_optional_tcp_window_check.patch
generic/pending-5.10/680-NET-skip-GRO-for-foreign-MAC-addresses.patch
generic/pending-5.10/768-net-dsa-mv88e6xxx-Request-assisted-learning-on-CPU-port.patch
lantiq/patches-5.10/0030-GPIO-add-named-gpio-exports.patch
ramips/patches-5.10/800-GPIO-add-named-gpio-exports.patch

Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
2021-04-22 15:13:56 +01:00
Rui Salvaterra 3326b5e75c treewide: switch the timer frequency to 100 Hz
Some targets select HZ=100, others HZ=250. There's no reason to select a higher
timer frequency (and 100 Hz are available in every architecture), so change all
targets to 100 Hz.

Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
2021-04-21 10:31:10 +01:00
Rui Salvaterra 27b5bae2ec treewide: remove redundant ubifs kconfig symbols
For the targets which enable ubifs, these symbols are already part of the
generic kconfigs. Drop them from the target kconfigs.

Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
2021-04-21 10:31:07 +01:00
David Bauer 75c01ee2b9 ramips: fix at803x patch
This patch broke while refreshing on a kernel bump. It adds the
config_aneg function twice to the AR8035 PHY now.

Restore the old behavior to restore the patches original intent.

Fixes commit 57e32650ef ("kernel: bump 5.10 to 5.10.31")
Signed-off-by: David Bauer <mail@david-bauer.net>
2021-04-18 14:42:06 +02:00
Ilya Lipnitskiy fa6f57f66c ramips: replace mt7621s hack with upstream patch
Refresh patches.

Tested on a dual-core MT7621 device (Ubiquiti ER-X) and a single-core
MT7621 device (Netgear R6220).

This change will make future kernel upgrades easier (avoids conflicts
with upstream).

Link: https://lore.kernel.org/lkml/20210407200738.149207-1-ilya.lipnitskiy@gmail.com/
Signed-off-by: Ilya Lipnitskiy <ilya.lipnitskiy@gmail.com>
Cc: Chuanhong Guo <gch981213@gmail.com>
2021-04-17 21:56:05 +02:00
David Bentham 17e690017d ramips: reduce spi-max-frequency for Xiaomi MI Router 4AG
Reduce spi-max-frequency for Xiaomi MI Router 4AG model

Xiaomi MI Router 4AG MTD uses two flash chips (no specific on router versions when produced from factory) - GD25Q128C and W25Q128BV.

These flash chips are capable of high frequency, but due to poor board design or manufacture process.

We are seeing the following errors in the linux kernel bootup:

`spi-nor spi0.0: unrecognized JEDEC id bytes: cc 60 1c cc 60 1c
 spi-nor: probe of spi0.0 failed with error -2`

This causes the partitions not to be detected

`VFS: Cannot open root device "(null)" or unknown-block(0,0): error -6`

Then creates a bootloop and a bricked router.

The solution to limit this race condition is to reduce the frequency from 80 mhz to 50 mhz.

Signed-off-by: David Bentham <db260179@gmail.com>
2021-04-17 21:56:05 +02:00
John Audia 6d4ef67926 kernel: bump 5.4 to 5.4.113
Ran update_kernel.sh in a fresh clone without any existing toolchains.  No
manual intervention needed.

Build system: x86_64
Build-tested: ipq806x/R7800
Run-tested: ipq806x/R7800

No dmesg regressions, everything functional

Signed-off-by: John Audia <graysky@archlinux.us>
2021-04-17 21:50:08 +02:00
Rui Salvaterra 57e32650ef kernel: bump 5.10 to 5.10.31
Automatically refreshed:
ramips/patches-5.10/710-at803x.patch

Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
2021-04-17 21:50:08 +02:00
Rui Salvaterra a3d431ccf7 kernel: bump 5.10 to 5.10.30
Deleted (reverse-applicable):
mvebu/patches-5.10/101-ARM-dts-turris-omnia-configure-LED-2--INTn-pin-as-interrupt-pin.patch

Automatically refreshed:
bcm63xx/patches-5.10/143-gpio-fix-device-tree-gpio-hogs-on-dual-role-gpio-pin.patch
generic/backport-5.10/610-v5.13-02-netfilter-Fix-fall-through-warnings-for-Clang.patch
generic/backport-5.10/610-v5.13-10-netfilter-nftables-update-table-flags-from-the-commi.patch
generic/hack-5.10/204-module_strip.patch
generic/hack-5.10/902-debloat_proc.patch
generic/pending-5.10/203-kallsyms_uncompressed.patch
generic/pending-5.10/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch
generic/pending-5.10/920-mangle_bootargs.patch
mediatek/patches-5.10/115-dts-bpi64-add-snand-support.patch
mediatek/patches-5.10/602-arm64-dts-mediatek-Split-PCIe-node-for-MT2712-MT7622.patch
mediatek/patches-5.10/900-dts-mt7622-bpi-r64-aliases-for-dtoverlay.patch
ramips/patches-5.10/323-mt7621-memory-detect.patch

Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
2021-04-16 12:58:53 +01:00
Ilya Lipnitskiy 85ca6923bc ramips: gpio-ralink: use ngpios, not ralink,num-gpios
DTS properties that match *-gpios are treated specially.

Use ngpios instead, as most GPIO drivers upstream do.

Fixes 5.10 DTS errors such as:
  OF: /palmbus@300000/gpio@600: could not find phandle

Fixes DTC warnings such as:
  Warning (gpios_property): /palmbus@300000/gpio@600:ralink,num-gpios:
  Could not get phandle node for (cell 0)

Signed-off-by: Ilya Lipnitskiy <ilya.lipnitskiy@gmail.com>
Cc: Daniel Golle <daniel@makrotopia.org>
2021-04-15 00:00:54 +08:00
Ilya Lipnitskiy 5f07c579f8 ramips: rt288x: replace hack with a kconfig change
Use an existing kernel config symbol to fix devices whose ramstart is
not zero. See upstream patch message for more details.

Signed-off-by: Ilya Lipnitskiy <ilya.lipnitskiy@gmail.com>
Cc: Tobias Wolf <dev-NTEO@vplace.de>
Cc: Daniel Golle <daniel@makrotopia.org>
2021-04-15 00:00:54 +08:00
DENG Qingfang f99c9cd9c4 ramips: mt7530 swconfig: fix race condition in register access
The mt7530_{r,w}32 operation over MDIO uses 3 mdiobus operations and
does not hold a lock, which causes a race condition when multiple
threads try to access a register, they may get unexpected results.

To avoid this, handle the MDIO lock manually, and use the unlocked
__mdiobus_{read,write} in the critical section.

This fixes the "Ghost VLAN" artifact[1] in MT7530/7621 when the VLAN
operation and the swconfig LED link status poll race between each other.

[1] https://forum.openwrt.org/t/mysterious-vlan-ids-on-mt7621-device/64495

Signed-off-by: DENG Qingfang <dqfext@gmail.com>
2021-04-15 00:00:54 +08:00
Ilya Lipnitskiy 679c557e91 ramips: drop obsolete arcs_cmdline override patch
CONFIG_MIPS_CMDLINE_FROM_DTB is set to 'y' for all ramips targets
already, which will ensure that the value of 'bootargs' will take
precedence over whatever is in arcs_cmdline.

Signed-off-by: Ilya Lipnitskiy <ilya.lipnitskiy@gmail.com>
2021-04-15 00:00:54 +08:00
Shiji Yang 882a6116d3 ramips: improve pinctrl for Youku YK-L1
1. rename led pin "air" to a more common name "wlan" and use "phy0tpt" to trigger it.
2. led "wan" can be triggered by ethernet pinctrl by default so just drop it.

Signed-off-by: Shiji Yang <yangshiji66@qq.com>
2021-04-10 20:48:26 +02:00
Szabolcs Hubai dd3c1ad8ee ramips: rt305x: use lzma-loader for ZyXEL Keenetic Lite rev.B
Fixes boot loader LZMA decompression issue,
reported by GitHub user KOLANICH at [0].

The reported LZMA ERROR has date of 2020-07-20, soon after
the device support landed:

Ralink UBoot Version: 3.5.2.4_ZyXEL

....

3: System Boot system code via Flash.
   Image Name:   MIPS OpenWrt Linux-4.14.187
   Created:      2020-07-20   3:39:11 UTC
   Image Type:   MIPS Linux Kernel Image (lzma compressed)
   Data Size:    1472250 Bytes =  1.4 MB
   Load Address: 80000000
   Entry Point:  80000000
   Verifying Checksum ... OK
   Uncompressing Kernel Image ... LZMA ERROR 1 - must RESET board to recover

[0] fea232ae8f (commitcomment-45016560)

Fixes: 4dc9ad4af8 ("ramips: add support for ZyXEL Keenetic Lite Rev.B")
Signed-off-by: Szabolcs Hubai <szab.hu@gmail.com>
2021-04-08 09:20:59 +02:00
Kevin Darbyshire-Bryant 438e88e672 kernel: bump 5.10 to 5.10.27
Use update_kernel to refresh all patches, required manual updates to:

610-netfilter_match_bypass_default_checks.patch
611-netfilter_match_bypass_default_table.patch
762-net-bridge-switchdev-Refactor-br_switchdev_fdb_notif.patch
764-net-bridge-switchdev-Send-FDB-notifications-for-host.patch

Run-tested: x86_64

Nothing screamed out but any funny business with linux bridging should
suspect this update first.

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
2021-04-03 21:07:22 +01:00