openwrt/staging/blocktrron.git
3 months agomt76 mt7915: lock TXQ when altering block-ack settings ieee80211-skip-ba
David Bauer [Thu, 8 Feb 2024 19:27:46 +0000 (20:27 +0100)]
mt76 mt7915: lock TXQ when altering block-ack settings

When there is a low of traffic fed to the HW from the kernel,
de-establishing a BlockAck session will lead to the HW output corrupted
frames where TA and RA contain the same client MAC-address.

Stopping TX from the OS seems to mitigate this issue.

[Patch contains commented out TX drainage, as tested first]

Signed-off-by: David Bauer <mail@david-bauer.net>
3 months agoipq40xx: fix PHY subsystem compilation (phy_interface_num_ports())
Rafał Miłecki [Wed, 7 Feb 2024 08:17:50 +0000 (09:17 +0100)]
ipq40xx: fix PHY subsystem compilation (phy_interface_num_ports())

Fixes:
drivers/net/phy/phy-core.c: In function 'phy_interface_num_ports':
drivers/net/phy/phy-core.c:107:9: error: enumeration value 'PHY_INTERFACE_MODE_PSGMII' not handled in switch [-Werror=switch]
  107 |         switch (interface) {
      |         ^~~~~~

Fixes: 8a7f667fb53e ("kernel: 5.15: backport v6.1 PHY changes required for Aquantia")
Fixes: https://github.com/openwrt/openwrt/issues/14560
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
3 months agowireless-regdb: update to 2024.01.23
Yuu Toriyama [Sat, 3 Feb 2024 19:09:14 +0000 (04:09 +0900)]
wireless-regdb: update to 2024.01.23

The maintainer and repository of wireless-regdb has changed.
    https://lore.kernel.org/all/CAGb2v657baNMPKU3QADijx7hZa=GUcSv2LEDdn6N=QQaFX8r-g@mail.gmail.com/

Changes:
    37dcea0 wireless-regdb: Update keys and maintainer information
    9e0aee6 wireless-regdb: Makefile: Reproducible signatures
    8c784a1 wireless-regdb: Update regulatory rules for China (CN)
    149c709 wireless-regdb: Update regulatory rules for Japan (JP) for December 2023
    bd69898 wireless-regdb: Update regulatory rules for Singapore (SG) for September 2023
    d695bf2 wireless-regdb: Update and disable 5470-5730MHz band according to TPC requirement for Singapore (SG)
    4541300 wireless-regdb: update regulatory database based on preceding changes

Signed-off-by: Yuu Toriyama <PascalCoffeeLake@gmail.com>
(cherry picked from commit b463737826eaa6c519eba93e13757a0cd3e09d47)

3 months agoopenssl: update to 3.0.13
Ivan Pavlov [Fri, 2 Feb 2024 05:46:52 +0000 (08:46 +0300)]
openssl: update to 3.0.13

Major changes between OpenSSL 3.0.12 and OpenSSL 3.0.13 [30 Jan 2024]

  * Fixed PKCS12 Decoding crashes
    ([CVE-2024-0727])
  * Fixed Excessive time spent checking invalid RSA public keys
    ([CVE-2023-6237])
  * Fixed POLY1305 MAC implementation corrupting vector registers on PowerPC
    CPUs which support PowerISA 2.07
    ([CVE-2023-6129])
  * Fix excessive time spent in DH check / generation with large Q parameter
    value ([CVE-2023-5678])

Signed-off-by: Ivan Pavlov <AuthorReflex@gmail.com>
(cherry picked from commit 44cd90c49a7457345c0fba186d5d762d3a04d854)

3 months agoucode: add libjson-c/host dependency
Chad Monroe [Tue, 16 Jan 2024 23:44:33 +0000 (15:44 -0800)]
ucode: add libjson-c/host dependency

ensure host libjson-c is built prior to ucode

Signed-off-by: Chad Monroe <chad@monroe.io>
(cherry picked from commit 5a3f6c50ef29c8b11fe6967e65277b8331be0ff0)

3 months agorealtek: fix zyxel-vers usage for XGS1250-12
Stijn Segers [Sun, 4 Feb 2024 12:20:32 +0000 (13:20 +0100)]
realtek: fix zyxel-vers usage for XGS1250-12

Commit daefc646e6d4 ("realtek: fix ZyXEL initramfs image generation")
fixed a shell expansion issue with zyxel-vers usage. Commit 045baca10b15
("realtek: deduplicate GS1900 recipes") took care of this for the
rtl838x and rtl839x subtargets, but the single device officially
supported in rtl930x - the XGS1250-12 - was overlooked. This commit
updates the XGS1250-12 build recipe as well.

Signed-off-by: Stijn Segers <foss@volatilesystems.org>
(cherry picked from commit 557db5106ce7809a5b2f1ec6d2407c1f32d10ef7)

3 months agobcm27xx: base-files: fix platform_copy_config
Álvaro Fernández Rojas [Wed, 31 Jan 2024 11:36:49 +0000 (12:36 +0100)]
bcm27xx: base-files: fix platform_copy_config

Only bcm2708 and bcm2709 use "kernel.img" file name.
bcm2710 and bcm2711 use "kernel8.img" and bcm2712 uses "kernel_2712.img".

(cherry picked from commit 1a5e51ab0011796fae5b08d03de3994c767517c1)
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
3 months agobcm27xx: improve image generation script
Álvaro Fernández Rojas [Tue, 30 Jan 2024 19:12:25 +0000 (20:12 +0100)]
bcm27xx: improve image generation script

- Exit immediately on a non-zero status.
- Remove empty lines.
- Remove unused variables.
- Add missing ptgen variables for readability.
- Refactor SYNTAX if block.

(cherry picked from commit 96b03ff2476edb4d08fb4b91fdf80be7aa95ddd8)
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
3 months agobcm27xx: base-files: properly detect boot partition
Álvaro Fernández Rojas [Tue, 30 Jan 2024 20:41:26 +0000 (21:41 +0100)]
bcm27xx: base-files: properly detect boot partition

Automatically detect boot partition instead of forcing /dev/mmcblk0p1.
This way users can still get /boot mounted when booting from USB.

(cherry picked from commit a39176010299f3ad7d325b03d892fbf65e6dd23b)
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
3 months agokernel: 5.15: backport v6.1 PHY changes required for Aquantia
Rafał Miłecki [Fri, 26 Jan 2024 05:35:27 +0000 (06:35 +0100)]
kernel: 5.15: backport v6.1 PHY changes required for Aquantia

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit 2df8a0ccb0b0461836e3ab88c7d4dc848664def4)

3 months agokernel: backport ethtool_puts
Rosen Penev [Sun, 17 Dec 2023 01:12:33 +0000 (17:12 -0800)]
kernel: backport ethtool_puts

Will be used for conversions in later commits and is a requirement for
PHY backports.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
[rmilecki: update commit message for 23.05]
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit 511c7ff03231752ea2adbdf7cc1af4be962c9b65)

3 months agofirmware-utils: bump to latest openwrt-23.05
Sander Vanheule [Wed, 31 Jan 2024 08:18:01 +0000 (09:18 +0100)]
firmware-utils: bump to latest openwrt-23.05

This version bump contains two patches improving compatibility with
recent vendor firmware versions:
    - c46b4b4ad7e7 tplink-safeloader: bump EAP225-V3 compat_level
    - b6a7e813b61c tplink-safeloader: bump EAP225-Outdoor v1 compat

Signed-off-by: Sander Vanheule <sander@svanheule.net>
3 months agoath79: add Ubiquiti Rocket M XW as alternate name to Bullet M XW
Lech Perczak [Sun, 21 Jan 2024 23:34:34 +0000 (00:34 +0100)]
ath79: add Ubiquiti Rocket M XW as alternate name to Bullet M XW

Ubiquiti Rocket M XW is a single-band, 2x2:2 external Wi-Fi AP, with optional
GPS receiver, with two external RP-SMA antenna connections, based on
AR9342 SoC. Two band variants exists, for 2.4GHz and 5GHz band, usable
with the same image.

Specs:
- CPU: Atheros AR9342 MIPS SoC at 535MHz
- RAM: 64MB DDR400
- ROM: 8MB SPI-NOR in SO16W package, MX25L6408E
- Wi-Fi Atheros AR9342 built-in 2x2:2 radio
- Ethernet: Atheros AR8035 PHY, limited to 100Mbps speeds due to
  magnetics
- Power: 24V passive PoE input.

Installation: please refer to Ubiquiti Bullet M2HP for documentation.

The device runs with exactly same image as the Bullet, and after fixes
in preceding commit, is fully functional again. Add the alternative name
to the build system.

Signed-off-by: Lech Perczak <lech.perczak@gmail.com>
(cherry picked from commit 54387fddead1094774187cedfe07cc8a47f5fe2c)

3 months agoath79: ubnt-bullet-m-xw: fix Ethernet PHY traffic
Lech Perczak [Sun, 21 Jan 2024 23:14:16 +0000 (00:14 +0100)]
ath79: ubnt-bullet-m-xw: fix Ethernet PHY traffic

Since commit 6f2e1b7485f0 ("ath79: disable delays on AT803X config init")
Ubiquiti XW boards equipped with AR8035 PHY suffered from lack of
outbound traffic on the Ethernet port. This was caused by the fact, the
U-boot has set this during boot and it wasn't reset by the PHY driver,
and the corresponding setting in device tree was wrong.

Set the 'phy-mode = "rgmii-txid"' at the &eth0, and drop this property
from PHY node, as it is not parsed there. This causes the device to
connect using Ethernet once again.

Fixes: db4b6535f837 ("ath79: Add support for Ubiquity Bullet M (XW)")
Fixes: 6f2e1b7485f0 ("ath79: disable delays on AT803X config init")
Signed-off-by: Lech Perczak <lech.perczak@gmail.com>
(cherry picked from commit a9b2ba4d7ba06e1ac4ff7da3eb9b4038b94d9fbb)

3 months agoath79: ubnt,bullet-m-xw: set PHY max-speed to 100Mbps
Lech Perczak [Thu, 4 Jan 2024 00:22:26 +0000 (01:22 +0100)]
ath79: ubnt,bullet-m-xw: set PHY max-speed to 100Mbps

Onboard AR8035 PHY supports 1000Base-T operation, but onboard
Ethernet magnetics do not. Reduce advertised link speeds to 100Mbps and
lower.

Signed-off-by: Lech Perczak <lech.perczak@gmail.com>
(cherry picked from commit d406777fb14c84e82f51bab059631af70cf6d5c9)

3 months agombedtls: security bump to version 2.28.7
orangepizza [Mon, 29 Jan 2024 02:37:43 +0000 (11:37 +0900)]
mbedtls: security bump to version 2.28.7

This release of Mbed TLS provides bug fixes and minor enhancements. This
release includes fixes for following security issues:

* Timing side channel in private key RSA operations (CVE-2024-23170)

  Mbed TLS is vulnerable to a timing side channel in private key RSA
  operations. This side channel could be sufficient for an attacker to
  recover the plaintext. A local attacker or a remote attacker who is
  close to the victim on the network might have precise enough timing
  measurements to exploit this. It requires the attacker to send a large
  number of messages for decryption.

* Buffer overflow in mbedtls_x509_set_extension() (CVE-2024-23775)

  When writing x509 extensions we failed to validate inputs passed in to
  mbedtls_x509_set_extension(), which could result in an integer overflow,
  causing a zero-length buffer to be allocated to hold the extension. The
  extension would then be copied into the buffer, causing a heap buffer
  overflow.

Fixes: CVE-2024-23170, CVE-2024-23775
References: https://mbed-tls.readthedocs.io/en/latest/security-advisories/mbedtls-security-advisory-2024-01-1/
References: https://mbed-tls.readthedocs.io/en/latest/security-advisories/mbedtls-security-advisory-2024-01-2/
Signed-off-by: orangepizza <tjtncks@gmail.com>
Signed-off-by: Petr Štetiar <ynezz@true.cz> [formal fixes]
(cherry picked from commit 920414ca8848fe1b430e436207b4f8c927819368)

3 months agoipq807x: prpl-haze: fix sysupgrade flashing from bootloader
Petr Štetiar [Thu, 29 Jun 2023 12:29:02 +0000 (14:29 +0200)]
ipq807x: prpl-haze: fix sysupgrade flashing from bootloader

While flashing sysupgrade image from U-Boot, then the rootfs_data
overlay filesystem formatting is left for the fstools during firstboot,
but that wont work as mkfs.f2fs is missing in the sysupgrade image:

 mount_root: overlay filesystem in /dev/loop0 has not been formatted yet
 mount_root: no usable overlay filesystem found, using tmpfs overlay
 sh: mkfs.f2fs: not found

 Filesystem                Size      Used Available Use% Mounted on
 /dev/loop0              139.6M     46.9M     92.6M  34% /overlay

 Number  Start (sector)    End (sector)  Size       Code  Name
  20           98850          406349   150.1 MiB   FFFF  rootfs

So lets fix it by adding f2fs support to the sysupgrade image.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
(cherry picked from commit ba415af5706f0369e4d299e4dfe50541a4a8056b)

3 months agouhttpd: handle reload after uhttpd-mod-ubus installation using postinst
Rafał Miłecki [Wed, 27 Dec 2023 15:20:45 +0000 (16:20 +0100)]
uhttpd: handle reload after uhttpd-mod-ubus installation using postinst

Use postinst script to reload service instead of uci-defaults hack. It's
possible thanks to recent base-files change that executes postinst after
uci-defaults.

This fixes support for uhttpd customizations. It's possible (again) to
adjust uhttpd config with custom uci-defaults before it gets started.

Cc: Hauke Mehrtens <hauke@hauke-m.de>
Fixes: d25d281fd668 ("uhttpd: Reload config after uhttpd-mod-ubus was added")
Ref: b799dd3c705d ("base-files: execute package's "postinst" after executing uci-defaults")
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit 1f11a4e28336c07aca61dd3b4fef01ef872a362d)

3 months agobase-files: execute package's "postinst" after executing uci-defaults
Rafał Miłecki [Sun, 26 Nov 2023 20:24:28 +0000 (21:24 +0100)]
base-files: execute package's "postinst" after executing uci-defaults

Allow "postinst" scripts to perform extra actions after applying all
kind of fixups implemented using uci-defaults.

This is needed e.g. by uhttpd-mod-ubus which after installation in a
running systems needs to:
1. Update uhttpd config using its uci-defaults script
2. Reload uhttpd

While this approach makes sense there is a risk it'll blow up some
corner case postinst usages. There is only 1 way to find out.

Cc: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit b799dd3c705dfd95745cdd94b13d1cd2ad2367a6)

3 months agobcm27xx-gpu-fw: update to latest version
Álvaro Fernández Rojas [Tue, 16 Jan 2024 10:58:01 +0000 (11:58 +0100)]
bcm27xx-gpu-fw: update to latest version

raspberrypi/firmware is about 40G, so getting the full history log isn't an
option.
There have been multiple improvements and also support for the RPi 5 has been
added.

(cherry picked from commit e8f55817015112608155a6463ca2d8f5b4ca37b2)
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
3 months agobcm27xx-userland: update to latest version
Marty Jones [Mon, 25 Dec 2023 00:03:31 +0000 (19:03 -0500)]
bcm27xx-userland: update to latest version

This is the last update for bcm27xx-userland as it has been
deprecated but funcional up to raspberry pi 5.

96a7334 README: Update to make it clear that most code in this repo is deprecated
3c97f76 userland: dtoverlay: /boot/firmware is a valid path
153a235 Assorted clang static analysis fixes
eca070c bcm_host: Update kms/fkms check for pi5
06a7618 dtoverlay: Support bcm2712 as a platform
0489c07 dtoverlay: Add dtoverlay_first/next_subnode
a1c7f81 dtoverlay: Support literal assignments of path strings
44a3953 raspivid: Also flush PTS file if flush is enabled
cc1ca18 userland: dtoverlay: Use os_prefix if set
9d5250f libfdt: Add null-ptr check for prop-data to resolve clang --analyzer warning
50527c6 mmal: Only include Videocore components if not running on Videocore
df245ea tvservice: Update unsupported message to recommend kmsprint
de0cfe8 dtoverlay: Fix clang warnings
0182f05 dtoverlay: Fix various compiler warnings
2a6306b dtoverlay: Fix path rebasing and exports
d1e92d7 dtoverlay: Add support for string escape sequences
b1ee39e gencmd: Add a fallback to mailbox interface if vchiq is not available
54fd97a hello_pi: Fix some build issues

Signed-off-by: Marty Jones <mj8263788@gmail.com>
(cherry picked from commit 3df664101a18cf835c97ce5f0fbcc6357a16c101)
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
3 months agobcm27xx: 5.15: turn on cpu erratum for A72 and disable A53
Yangyu Chen [Mon, 18 Dec 2023 19:21:53 +0000 (03:21 +0800)]
bcm27xx: 5.15: turn on cpu erratum for A72 and disable A53

The original configuration might be copied from bcm2710 which uses
cortex A53 rather than A72 in BCM2711, without errata might be harmful
to system stability and security.

Signed-off-by: Yangyu Chen <cyy@cyyself.name>
(cherry picked from commit d549809c05997116823c1a1486d79cb8bda689b9)
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
3 months agobcm27xx: config: update documentation links
Álvaro Fernández Rojas [Wed, 17 Jan 2024 09:39:37 +0000 (10:39 +0100)]
bcm27xx: config: update documentation links

The documentation links have changed and are no longer valid.

(cherry picked from commit 189838517e88dc5b519433949c945959d17b89f7)
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
3 months agoath79: generic: disable SPI-NOR write protect unconditionally
Lech Perczak [Sun, 17 Dec 2023 17:25:55 +0000 (18:25 +0100)]
ath79: generic: disable SPI-NOR write protect unconditionally

Kernel 5.15 introduced a significant change to spi-nor subsystem [1],
which would the SPI-NOR core to no longer unprotect the Flash chips if
their protection bits are non-volatile, which is the case for MX25L6405D
and MX25L12805D, used in Ubiquiti XW and WA lines of devices [2].

However, their bootloader forcibly enables this protection before
continuing to boot, making the kernel not unprotect the flash upon boot,
causing JFFS2 to be unable write to the filesystem. Because sysupgrade
seems to unlock the flash explicitly, the upgrade will work, but the
system will be unable to save configrationm showing the following symptom
in the kernel log:

[   86.168016] jffs2_scan_eraseblock(): End of filesystem marker found at 0x0
[   86.192344] jffs2_build_filesystem(): unlocking the mtd device...
[   86.192443] done.
[   86.200669] jffs2_build_filesystem(): erasing all blocks after the end marker...
[   86.220646] jffs2: Newly-erased block contained word 0x19852003 at offset 0x001e0000
[   86.292388] jffs2: Newly-erased block contained word 0x19852003 at offset 0x001d0000
[   86.324867] jffs2: Newly-erased block contained word 0x19852003 at offset 0x001c0000
[   86.355316] jffs2: Newly-erased block contained word 0x19852003 at offset 0x001b0000
[   86.402855] jffs2: Newly-erased block contained word 0x19852003 at offset 0x001a0000

Disable the write protection unconditionally for ath79/generic subtarget,
so the XW and WA devices can function again. However, this is only a
stopgap solution - it probably should be investigated if there is a way
to selectively unlock the area used by rootfs_data - but given the lock
granularity, this seems unlikely.

With this patch in place, rootfs_data partition on my Nanostation Loco
M5 XW is writable again.

Fixes: #12882
Fixes: #13750
Fixes: 579703f38c14 ("ath79: switch to 5.15 as default kernel")
Link: http://www.infradead.org/pipermail/linux-mtd/2020-October/082805.html
Link: https://forum.openwrt.org/t/powerbeam-m5-xw-configuration-loss-after-reboot/141925
Signed-off-by: Lech Perczak <lech.perczak@gmail.com>
(cherry picked from commit f024f4b1b0380b3b2e18115bd8e4f35393fccc70)
Signed-off-by: Lech Perczak <lech.perczak@gmail.com>
3 months agorealtek: d-link dgs-1210-10p improve sfp support
Michel Thill [Tue, 23 Jan 2024 19:16:48 +0000 (20:16 +0100)]
realtek: d-link dgs-1210-10p improve sfp support

The current dts file of dgs-1210-10p doesn't support link states
for the sfp ports (they are always up).
This patch tries to give better support for this and was run tested
on dgs-1210-10p.
It was already commited to the main branch.

Signed-off-by: Michel Thill <jmthill@gmail.com>
(cherry picked from commit 135e10762077d96a976c0b00311ce95e77082a5d)

3 months agojsonfilter: update to Git HEAD (2024-01-23)
Jo-Philipp Wich [Tue, 23 Jan 2024 08:07:16 +0000 (09:07 +0100)]
jsonfilter: update to Git HEAD (2024-01-23)

013b75ab0598 jsonfilter: drop legacy json-c support
594cfa86469c main: fix spurious premature parse aborts in array mode

Fixes: https://bugs.openwrt.org/?task_id=3683
Fixes: https://github.com/openwrt/openwrt/issues/8703
Fixes: https://github.com/openwrt/openwrt/issues/11649
Fixes: https://github.com/openwrt/openwrt/issues/12344
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 33f15dd6d41873b02eb8895b8886763659f1390c)

3 months agokernel: bump 5.15 to 5.15.147
John Audia [Mon, 15 Jan 2024 20:25:53 +0000 (15:25 -0500)]
kernel: bump 5.15 to 5.15.147

Changelog: https://cdn.kernel.org/pub/linux/kernel/v5.x/ChangeLog-5.15.147

Manually rebased:
generic/backport-5.15/005-v5.17-01-Kbuild-use-Wdeclaration-after-statement.patch

All other patches automatically rebased.

Build system: x86_64
Build-tested: ramips/tplink_archer-a6-v3
Run-tested: ramips/tplink_archer-a6-v3

Signed-off-by: John Audia <therealgraysky@proton.me>
(cherry picked from commit 389135501565a6544775e0c75828a11e536e64a2)
[Refresh on top of OpenWrt 23.05]
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
3 months agomediatek: filogic: add support ASUS RT-AX59U
Xavier Franquet [Mon, 20 Nov 2023 07:18:00 +0000 (08:18 +0100)]
mediatek: filogic: add support ASUS RT-AX59U

(based on support for ASUS RT-AX59U by liushiyou006)

SOC: MediaTek MT7986
RAM: 512MB DDR4
FLASH: 128MB SPI-NAND (Winbond W25N01GV)
WIFI: Mediatek MT7986 DBDC 802.11ax 2.4/5 GHz
ETH: MediaTek MT7531 Switch
UART: 3V3 115200 8N1 (Pinout silkscreened / Do not connect VCC)

Upgrade from AsusWRT to OpenWRT using UART

    Download the OpenWrt initramfs image.
    Copy the image to a TFTP server reachable at 192.168.1.70/24. Rename the image to rtax59u.bin.

    Connect the PC with TFTP server to the RT-AX59U.
    Set a static ip on the ethernet interface of your PC.
    (ip address: 192.168.1.70, subnet mask:255.255.255.0)
    Conect to the serial console, interrupt the autoboot process by pressing '4' when prompted.

    Download & Boot the OpenWrt initramfs image.

    $ setenv ipaddr 192.168.1.1
    $ setenv serverip 192.168.1.70
    $ tftpboot 0x46000000 rtax59u.bin
    $ bootm 0x46000000

    Wait for OpenWrt to boot. Transfer the sysupgrade image to the device using scp and install using sysupgrade.

    $ sysupgrade -n <path-to-sysupgrade.bin>

Upgrade from AsusWRT to OpenWRT using WebUI

    Download transit TRX file from https://drive.google.com/drive/folders/1A20QdjK7Udagu31FSszpWAk8-cGlCwsq

    Upgrade firmware from WebUI (192.168.50.1) using downloaded TRX file

    Wait for OpenWRT to boot (192.168.1.1).

    Upgrade system with sysupgrade image using luci or uploading it through scp and executing sysupgrade command

MAC Address for WLAN 5g is not following the same algorithm as in AsusWRT.
We have increased by one the WLAN 5g to avoid collisions with other networks from WLAN 2g
when bit 28 is already set.

              : Stock             : OpenWrt
  WLAN 2g (1) : C8:xx:xx:0D:xx:D4 : C8:xx:xx:0D:xx:D4
  WLAN 2g (2) :                   : CA:xx:xx:0D:xx:D4
  WLAN 2g (3) :                   : CE:xx:xx:0D:xx:D4
  WLAN 5g (1) : CA:xx:xx:1D:xx:D4 : CA:xx:xx:1D:xx:D5
  WLAN 5g (2) :                   : CE:xx:xx:1D:xx:D5
  WLAN 5g (3) :                   : C2:xx:xx:1D:xx:D5

  WLAN 2g (1) : 08:xx:xx:76:xx:BE : 08:xx:xx:76:xx:BE
  WLAN 2g (2) :                   : 0A:xx:xx:76:xx:BE
  WLAN 2g (3) :                   : 0E:xx:xx:76:xx:BE
  WLAN 5g (1) : 0A:xx:xx:76:xx:BE : 0A:xx:xx:76:xx:BF
  WLAN 5g (2) :                   : 0E:xx:xx:76:xx:BF
  WLAN 5g (3) :                   : 02:xx:xx:76:xx:BF

Signed-off-by: Xavier Franquet <xavier@franquet.es>
(cherry picked from commit 782eb050082acac93c2f9b3eb22348234bc93e99)

3 months agohostapd: ACS: Fix typo in bw_40 frequency array
David Bauer [Thu, 18 Jan 2024 21:47:17 +0000 (22:47 +0100)]
hostapd: ACS: Fix typo in bw_40 frequency array

[Upstream Backport]

The range for the 5 GHz channel 118 was encoded with an incorrect
channel number.

Fixes: ed8e13decc71 (ACS: Extract bw40/80/160 freqs out of acs_usable_bwXXX_chan())
Signed-off-by: Michael Lee <michael-cy.lee@mediatek.com>
Signed-off-by: David Bauer <mail@david-bauer.net>
(cherry picked from commit 56d7887917102877ed2f03414f7ed812a29d6b39)

4 months agomediatek: fix ethernet rx hang issue on MT7981/MT7986
Felix Fietkau [Tue, 16 Jan 2024 18:29:52 +0000 (19:29 +0100)]
mediatek: fix ethernet rx hang issue on MT7981/MT7986

Add patches by Lorenzo/Daniel to use QDMA instead of ADMAv2

Signed-off-by: Felix Fietkau <nbd@nbd.name>
(cherry picked from commit ede34465de2176229590028fba622d54841ab40c)

4 months agoRevert "lantiq: xway: kernel: enable SMP support"
Aleksander Jan Bajkowski [Thu, 11 Jan 2024 22:05:39 +0000 (23:05 +0100)]
Revert "lantiq: xway: kernel: enable SMP support"

Enabling SMP on the xway target results in two issues:

* some danube chipset-based devices fail on boot,
* on devices based on the arx100 chipset, enabling smp
results in a degradation of NAT performance.

After these two issues are fixed, SMP can be re-enabled.

This reverts commit 084c20f6c54180f2dc6b3efc1c5ba9b62afbaf26.

Fixes: #13934
Fixes: #14283
Signed-off-by: Aleksander Jan Bajkowski <olek2@wp.pl>
4 months agomediatek: GL-MT6000: Change LED colors
Thomas Schröder [Wed, 10 Jan 2024 10:12:10 +0000 (11:12 +0100)]
mediatek: GL-MT6000: Change LED colors

Fine tuning PR: openwrt/openwrt#14355 Ref: 5a82bb909bf1
("mediatek: GL-MT6000: Add missing LED state definitions")

As the only LED is using white in the stock firmware when the device is
running and blue for the bootloader I suggest following changes:
 - Using blue for the BL and preinit+failsafe
 - White for normal operation (like the original FW) and sysupgrade

With this changes it's clear by looking to the LED in which operation
mode the device is and a possible BL stuck can be seen easily.

Tested with [GL-MT6000](https://openwrt.org/toh/gl.inet/gl-mt6000).

Signed-off-by: Thomas Schröder <tschroeder_github@outlook.com>
Tested-by: Hannu Nyman <hannu.nyman@iki.fi>
(cherry picked from commit 4d7bac1dcaae019fb4992bfb74348ef12c02daa4)

4 months agoath79: read back reset register
David Bauer [Tue, 9 Jan 2024 19:52:56 +0000 (20:52 +0100)]
ath79: read back reset register

Read back the reset register in order to flush the cache. This fixes
spurious reboot hangs on TP-Link TL-WDR3600 and TL-WDR4300 with Zentel
DRAM chips.

This issue was fixed in the past, but switching to the reset-driver
specific implementation removed the cache barrier which was previously
implicitly added by reading back the register in question.

Link: https://github.com/freifunk-gluon/gluon/issues/2904
Link: https://github.com/openwrt/openwrt/issues/13043
Link: https://dev.archive.openwrt.org/ticket/17839
Link: f8a7bfe1cb2c ("MIPS: ath79: fix system restart")

Signed-off-by: David Bauer <mail@david-bauer.net>
(cherry picked from commit 2fe8ecd880396b5ae25fe9583aaa1d71be0b8468)

4 months agoath79: add support for UniFi UK-Ultra
David Bauer [Fri, 5 Jan 2024 16:18:09 +0000 (17:18 +0100)]
ath79: add support for UniFi UK-Ultra

Hardware
--------
CPU:   Qualcomm Atheros QCA9563
RAM:   128M DDR2
FLASH: 16MB SPI-NOR
WiFi:  Qualcomm Atheros QCA9563 2x2:2 802.11n 2.4GHz
       Qualcomm Atheros QCA9880 2x2:2 802.11ac 5GHz

Antennas
--------
The device features internal antennas as well as external antenna
connectors. By default, the internal antennas are used.

Two GPIOs are exported by name, which can be used to control the
antenna-path mux. Writing a logical 0 enables the external antenna
connectors.

Installation
------------
1. Download the OpenWrt sysupgrade image to the device. You can use scp
   for this task. The default username and password are "ubnt" and the
   device is reachable at 192.168.1.20.

   $ scp -O openwrt-sysupgrade.bin ubnt@192.168.1.20:/tmp/firmware.bin

2. Connect to the device using SSH.

   $ ssh ubnt@192.168.1.20

3. Disable the write-protect

   $ echo "5edfacbf" > /proc/ubnthal/.uf

4. Verify kernel0 and kernel1 match mtd2 and mtd3

   $ cat /proc/mtd

5. Write the sysupgrade image to kernel0 and kernel1

   $ dd if=/tmp/firmware.bin of=/dev/mtdblock2
   $ dd if=/tmp/firmware.bin of=/dev/mtdblock3

6. Write the bootselect flag to boot from kernel0

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

7. Reboot the device

   $ reboot

Signed-off-by: David Bauer <mail@david-bauer.net>
(cherry picked from commit bf94e0a38389b2ce5d33be9c97d104d36dd5ebd6)

4 months agoath79: move UniFi AC template into common
David Bauer [Fri, 5 Jan 2024 16:02:01 +0000 (17:02 +0100)]
ath79: move UniFi AC template into common

This allows us to embrace alphabetical sorting for the UK-Ultra.

Signed-off-by: David Bauer <mail@david-bauer.net>
(cherry picked from commit c9e58f85f6e5d96711291f079413d2f34c36fdc3)

4 months agomediatek: fix BPI-R3 wifi mac address
Felix Fietkau [Tue, 9 Jan 2024 14:15:08 +0000 (15:15 +0100)]
mediatek: fix BPI-R3 wifi mac address

Setting/clearing bits on the first byte of the mac address causes collisions
when using multiple SSIDs on both PHYs. Change the allocation to alter the
last byte instead.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
(cherry picked from commit 38bec08e87b69212daf34eac7b26d643a92d9353)

4 months agomac80211: do not emit VHT160 capabilities if channel width is less than 160 MHz
Felix Fietkau [Tue, 9 Jan 2024 13:36:42 +0000 (14:36 +0100)]
mac80211: do not emit VHT160 capabilities if channel width is less than 160 MHz

Fixes compatibility issues with VHT160 capable clients

Signed-off-by: Felix Fietkau <nbd@nbd.name>
(cherry picked from commit 80e4e2285fdf4a7b19c84532deafe2d1e690ed30)

4 months agohostapd: add missing NULL pointer check on radar notification
Felix Fietkau [Tue, 9 Jan 2024 10:05:45 +0000 (11:05 +0100)]
hostapd: add missing NULL pointer check on radar notification

Fixes a race condition that can lead to a hostapd crash

Signed-off-by: Felix Fietkau <nbd@nbd.name>
(cherry picked from commit d864f68232e910f2c8ab06a66347fc08c257dfcc)

4 months agomac80211: avoid crashing on invalid band info
David Bauer [Thu, 30 Nov 2023 06:32:52 +0000 (07:32 +0100)]
mac80211: avoid crashing on invalid band info

Frequent crashes have been observed on MT7916 based platforms. While the
root of these crashes are currently unknown, they happen when decoding
rate information of connected STAs in AP mode. The rate-information is
associated with a band which is not available on the PHY.

Check for this condition in order to avoid crashing the whole system.
This patch should be removed once the roout cause has been found and
fixed.

Link: https://github.com/freifunk-gluon/gluon/issues/2980
Signed-off-by: David Bauer <mail@david-bauer.net>
(cherry picked from commit 1278d47beaabaa963b2956e81936269b7fea4003)

4 months agomediatek: GL-MT6000: Add missing LED state definitions
Hannu Nyman [Sat, 6 Jan 2024 17:59:13 +0000 (19:59 +0200)]
mediatek: GL-MT6000: Add missing LED state definitions

Adjust LED names and provide the OpenWrt status indicator aliases
to actually use LEDs by the OpenWrt boot & sysupgrade processes.

* Name both LEDs clearly by the color
* Add the missing OpenWrt LED status indicator aliases and
  remove the now unnecessary default status from blue LED

After this commit, the LEDs are used as:

* bootloader, really early Linux boot: blue LED is on
* preinit/failsafe: white LED blinks rapidly
* late boot: white LED blinks slowly
* boot completed, running normally: blue LED is on

* sysupgrade: white LED blinks

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
(cherry picked from commit 5a82bb909bf16786b85508d2e974ddf0a14bb10c)

4 months agolinux/modules: remove deprecated module
John Audia [Wed, 27 Dec 2023 09:49:23 +0000 (04:49 -0500)]
linux/modules: remove deprecated module

Remove upstream deprecated module from our build, see[1]

1. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit?h=v5.15.145&id=6cd90c01b032f335d18966b2d979eef43eb2cfc1

Suggested-by: Shiji Yang <yangshiji66@qq.com>
Signed-off-by: John Audia <therealgraysky@proton.me>
(cherry picked from commit 5067863d67e4585f166133e1b9d6e482fde4c80f)

4 months agokernel: bump 5.15 to 5.15.146
John Audia [Fri, 5 Jan 2024 20:40:08 +0000 (15:40 -0500)]
kernel: bump 5.15 to 5.15.146

Changelog: https://cdn.kernel.org/pub/linux/kernel/v5.x/ChangeLog-5.15.146

All patches automatically rebased.

Build system: x86_64
Build-tested: ramips/tplink_archer-a6-v3
Run-tested: ramips/tplink_archer-a6-v3

Signed-off-by: John Audia <therealgraysky@proton.me>
(cherry picked from commit 37bb3893929fc3277e7d26ff0012d86526c98b77)
[Refresh on top of OpenWrt 23.05]
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
4 months agoramips: add support for D-Link COVR-X1860 A1
Roland Reinl [Fri, 3 Nov 2023 10:22:02 +0000 (11:22 +0100)]
ramips: add support for D-Link COVR-X1860 A1

The COVR-X1860 are MT7621-based AX1800 devices (similar to DAP-X1860, but
with two Ethernet ports and external power supply) that are sold in sets
of two (COVR-X1862) and three (COVR-X1863).

Specification:
 - MT7621
 - MT7915 + MT7975 2x2 802.11ax (DBDC)
 - 256MB RAM
 - 128 MB flash
 - 3 LEDs (red, orange, white), routed to one indicator in the top of the device
 - 2 buttons (WPS in the back and Reset at the bottom of the device)

MAC addresses:
 - LAN MAC (printed on the device) is stored in config2 partition as ASCII (entry factory_mac=xx:xx:xx:xx:xx:xx)
 - WAN MAC: LAN MAC + 3
 - 2.4G MAC: LAN MAC + 1
 - 5G MAC: LAN MAC + 2

The pins for the serial console are already labeled on the board (VCC, TX, RX, GND). Serial settings: 3.3V, 115200,8n1

Flashing via OEM Web Interface:
 - Download openwrt-ramips-mt7621-dlink_covr-x1860-a1-squashfs-factory.bin via the OEM web interface firmware update
 - The configuration wizard can be skipped by directly going to http://192.168.0.1/UpdateFirmware_Simple.html

Flashing via Recovery Web Interface:
 - Set your IP address to 192.168.0.10, subnetmask 255.255.255.0
 - Press the reset button while powering on the deivce
 - Keep the reset button pressed until the status LED blinks red
 - Open a Chromium based browser and goto http://192.168.0.1
 - Download openwrt-ramips-mt7621-dlink_covr-x1860-a1-squashfs-recovery.bin

Revert back to stock using the Recovery Web Interface:
 - Set your IP address to 192.168.0.10, subnetmask 255.255.255.25
 - Press the reset button while powering on the deivce
 - Keep the reset button pressed until the status LED blinks red
 - Open a Chromium based browser and goto http://192.168.0.1
 - Flash a decrypted firmware image from D-Link. Decrypting an firmware image is described below.

Decrypting a D-Link firmware image:
 - Download https://github.com/openwrt/firmware-utils/blob/master/src/dlink-sge-image.c and https://raw.githubusercontent.com/openwrt/firmware-utils/master/src/dlink-sge-image.h
 - Compile a binary from the downloaded file, e.g. gcc dlink-sge-image.c -lcrypto -o dlink-sge-image
 - Run ./dlink-sge-image COVR-X1860 <OriginalFirmware> <OutputFile> -d
 - Example for firmware 102b01: ./dlink-sge-image COVR-X1860 COVR-X1860_RevA_Firmware_102b01.bin COVR-X1860_RevA_Firmware_102b01_Decrypted.bin -d

The pull request is based on the discussion in https://forum.openwrt.org/t/add-support-for-d-link-covr-x1860

Signed-off-by: Sebastian Schaper <openwrt@sebastianschaper.net>
Signed-off-by: Roland Reinl <reinlroland+github@gmail.com>
(cherry picked from commit 0a18259e4aa361cd9e5848c038be4b9f4e3bfcc6)
Signed-off-by: Florian Maurer <f.maurer@outlook.de>
4 months agoramips: add encrypted SGE factory image for D-Link devices
Alan Luck [Tue, 7 Nov 2023 22:10:35 +0000 (09:10 +1100)]
ramips: add encrypted SGE factory image for D-Link devices

creates SGE encrypted factory images
to use via the D-Link web interface
rename the old factory unencrypted images to recovery
for use in the recovery console when recovery is needed

adjusted to not touch unrelated devices

Signed-off-by: Alan Luck <luckyhome2008@gmail.com>
(cherry picked and adjusted from commit 4c0dc68f466588bb2ef60b29a4d8052b34112ca6)
Signed-off-by: Florian Maurer <f.maurer@outlook.de>
4 months agokernel: bump 5.15 to 5.15.145
John Audia [Sat, 23 Dec 2023 11:52:06 +0000 (06:52 -0500)]
kernel: bump 5.15 to 5.15.145

Changelog: https://cdn.kernel.org/pub/linux/kernel/v5.x/ChangeLog-5.15.145

No patches needed a rebase.

 23.05 backport:

    Rebased patch mediatek/100-dts-update-mt7622-rfb1.patch due to
    changes introduced in commit e37aa926447f ("arm64: dts: mediatek:
    mt7622: fix memory node warning check") in version v5.15.143 and we
    jumped over from v5.15.139 directly to v5.15.145.

Build system: x86_64
Build-tested: ramips/tplink_archer-a6-v3
Run-tested: ramips/tplink_archer-a6-v3

 23.05 backport:

  Stijn:
   Compile-tested: ath79/generic, ipq40xx/generic, mvebu/cortexa72, ramips/mt{7621,7620,76x8}, realtek/rtl{838x,930x}, 86/64.
   Run-tested: cortexa72 (RB5009UG+S+IN), mt7621 (EAP615-Wall v1), rtl838x (GS1900-10HP, GS1900-8HP, GS108T v3).

  Petr:
   Compile-tested: ipq807x, mvebu/cortexa9
   Run-tested: turris-omnia, prpl-haze

Tested-by: Stijn Segers <foss@volatilesystems.org> [23.05 testing]
Signed-off-by: John Audia <therealgraysky@proton.me>
Signed-off-by: Petr Štetiar <ynezz@true.cz> [23.05 refresh]
(cherry picked from commit 8de4cc77a6d5c25e48566d0203f159287ac7f3fe)

4 months agofirmware-utils: move patch to maintaince branch
Sander Vanheule [Sun, 7 Jan 2024 11:54:06 +0000 (12:54 +0100)]
firmware-utils: move patch to maintaince branch

Patch "firmware-utils: ptgen: add SiFive GPT partition support" was
included as a separate change in 23.05. Now that we have a maintenance
branch for firmware-utils, the patch can be backported there and
included with other changes.

Signed-off-by: Sander Vanheule <sander@svanheule.net>
4 months agofirmware-utils: bump to latest openwrt-23.05
Sander Vanheule [Sun, 7 Jan 2024 11:12:05 +0000 (12:12 +0100)]
firmware-utils: bump to latest openwrt-23.05

Contains two backported device suppport updates:
    - 9afd8f42bd23 "tplink-safeloader: bump EAP615-Wall compat_level"
    - 8cad449bdb5c "add dlink-sge-image for D-Link devices by SGE"

Signed-off-by: Sander Vanheule <sander@svanheule.net>
4 months agoramips: correct the PCIe port number for Unielec u7621-01
David Bentham [Sat, 6 Jan 2024 11:58:08 +0000 (11:58 +0000)]
ramips: correct the PCIe port number for Unielec u7621-01

MT7621 gets a new PCIe driver in the 5.15+ kernel. Allocating wrong PCIe
port will cause the PCIe NIC to not work properly. This commit fixes
the wrong port numbers on Unielec u7621-01.

According to the bootlog, MT7612E (5 GHz) is connected to pcie2, and
MT7603E (2 GHz) is connected to pcie1:

[    1.294844] mt7621-pci 1e140000.pcie: pcie0 no card, disable it (RST & CLK)
[    1.308635] mt7621-pci 1e140000.pcie: PCIE1 enabled
[    1.318277] mt7621-pci 1e140000.pcie: PCIE2 enabled

Also correct the led activity for the MT7603e - not used on the MT7612e

Signed-off-by: David Bentham <db260179@gmail.com>
(cherry picked from commit 39e55bdbe27a09579658178796a9b732e126e703)
Signed-off-by: David Bentham <db260179@gmail.com>
4 months agorockchip: configure eth pad driver strength for orangepi r1 plus lts
Tianling Shen [Mon, 25 Dec 2023 03:23:58 +0000 (11:23 +0800)]
rockchip: configure eth pad driver strength for orangepi r1 plus lts

The default strength is not enough to provide stable connection
under 3.3v LDO voltage.

Fixes: 3f3586a06d27 ("rockchip: add Orange Pi R1 Plus LTS support")
Fixes: #13117
Fixes: #13759
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
(cherry picked from commit 3645ac8a10d9abb1451343beaf7d65b53eeecffd)
[rebased onto openwrt-23.05 branch]
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
4 months agoramips: lzma-loader: use default uart for rt305x
Michael Pratt [Wed, 6 Dec 2023 19:29:26 +0000 (14:29 -0500)]
ramips: lzma-loader: use default uart for rt305x

The rt305x series SOC have two UART devices,
and the one at bus address 0x500 is disabled by default.
Some boards do not even have a pinout for the first one,
so use the same one that the kernel uses at 0xc00 instead.

This allows the lzma-loader printing to be visible
alongside the kernel log in the same console.

Tested-by: Lech Perczak <lech.perczak@gmail.com> # zte,mf283plus
Signed-off-by: Michael Pratt <mcpratt@pm.me>
(cherry picked from commit bc00c78b4338779ca1b7cd08411f76218d1f3205)
Signed-off-by: Lech Perczak <lech.perczak@gmail.com>
4 months agoramips: lzma-loader: use proper register names
Michael Pratt [Wed, 6 Dec 2023 19:12:03 +0000 (14:12 -0500)]
ramips: lzma-loader: use proper register names

Before this was reworked, in the file for mt7621 subtarget
(target/linux/ramips/image/lzma-loader/src/board-mt7621.c)
the "Transmitter shift register empty" bit TEMT was used instead of
the "Transmitter holding register empty" bit THRE,
but after the rework, this value was labeled as the THRE bit instead.

Functionally there is no difference, but this is confusing to read,
as it suggests that the subtargets have different bits for the same
register in UART when in reality they are exactly the same.

One can use either bit, or both, at user's descretion
in order to determine whether the UART TX buffer is ready.
The generic kernel early-printk uses both,
(arch/mips/kernel/early_printk_8250.c)
while the ralink-specific early-printk uses only THRE,
(arch/mips/ralink/early_printk.c).

Define both bits and rewrite macros for readability,
keep the same values, as changing which to use should be tested first.

Ref: c31319b66 ("ramips: lzma-loader: Refactor loader")
Signed-off-by: Michael Pratt <mcpratt@pm.me>
(cherry picked from commit 2e47913c644c59aa25fbac2bc6c4297956406b82)
Signed-off-by: Lech Perczak <lech.perczak@gmail.com>
4 months agoramips: lzma-loader: use virtual memory segments for uart base address
Michael Pratt [Tue, 5 Dec 2023 23:36:42 +0000 (18:36 -0500)]
ramips: lzma-loader: use virtual memory segments for uart base address

The native bus address for UART was entered for rt305x UART_BASE,
but the bootloaders have memory space remapped with the same
virtual memory map the kernel uses for program addressing at boot time.

In UBoot, the remapped address is often defined as TEXT_BASE.
In the kernel, for rt305x this remapped address is RT305X_SYSC_BASE.
(arch/mips/include/asm/mach-ralink/rt305x.h)

Because the ralink I/O busses begin at a low address of 0x10000000,
they are remapped using KSEG0 or KSEG1, which for all 32-bit MIPS SOCs
(arch/mips/include/asm/addrspace.h)
are offsets of 0x80000000 and 0xa0000000 respectively.
This is consistent with the other UART_BASE macros here
and with MIPS memory map documentation.

Before the recent rework of the lzma-loader for ramips,
the original board-$(PLATFORM).c files also did not
use KSEG1ADDR for UART_BASE despite being defined,
which made this mistake easier to occur.

Fix this by defining KSEG1ADDR again and actually use it.
Copy and paste from the kernel's macros for consistency.

Link: https://training.mips.com/basic_mips/PDF/Memory_Map.pdf
Fixes: c31319b66 ("ramips: lzma-loader: Refactor loader")
Reported-by: Lech Perczak <lech.perczak@gmail.com>
Signed-off-by: Michael Pratt <mcpratt@pm.me>
(cherry picked from commit 4c1e9bd8581e01793b26f3bc964975311450ece0)
Signed-off-by: Lech Perczak <lech.perczak@gmail.com>
4 months agoraimps: mtk_eth_soc: drop rst_esw from ESW driver
Lech Perczak [Fri, 15 Dec 2023 16:25:05 +0000 (17:25 +0100)]
raimps: mtk_eth_soc: drop rst_esw from ESW driver

The ESW core needs to be reset together with FE core, so after the
relevant reset controller lines are moved under FE, drop rst_esw and all
related code, which would not execute anyway, because rst_esw would be
NULL. While at that, ensure that if reset line for EPHY cannot be
claimed, a proper error message is reported.

Fixes: 60fadae62b64 ("ramips: ethernet: ralink: move reset of the esw into the esw instead of fe")
Co-developed-by: Maxim Anisimov <maxim.anisimov.ua@gmail.com>
Signed-off-by: Maxim Anisimov <maxim.anisimov.ua@gmail.com>
[Split out of the bigger commit, provide commit mesage, refactor error
handling]
Signed-off-by: Lech Perczak <lech.perczak@gmail.com>
(cherry picked from commit f393ffcac163926bf9dbbda47c25cc7809952609)
Signed-off-by: Lech Perczak <lech.perczak@gmail.com>
4 months agoramips: dts: mt7628an: reset FE and ESW cores together
Maxim Anisimov [Sun, 10 Dec 2023 15:40:39 +0000 (16:40 +0100)]
ramips: dts: mt7628an: reset FE and ESW cores together

Failing to do so will cause the DMA engine to not initialize properly
and fail to forward packets between them, and in some cases will cause
spurious transmission with size exceeding allowed packet size, causing a
kernel panic.

Fixes: 60fadae62b64 ("ramips: ethernet: ralink: move reset of the esw into the esw instead of fe")
Signed-off-by: Maxim Anisimov <maxim.anisimov.ua@gmail.com>
[Provide commit description, split into logical changes]
Signed-off-by: Lech Perczak <lech.perczak@gmail.com>
(cherry picked from commit f87b66507e9245e6e02dbc76e2e7b27c9e0bf364)
Signed-off-by: Lech Perczak <lech.perczak@gmail.com>
4 months agoramips: dts: rt5350: reset FE and ESW cores together
Lech Perczak [Mon, 11 Dec 2023 23:25:02 +0000 (00:25 +0100)]
ramips: dts: rt5350: reset FE and ESW cores together

Failing to do so will cause the DMA engine to not initialize properly
and fail to forward packets between them, and in some cases will cause
spurious transmission with size exceeding allowed packet size, causing a
kernel panic.

This is behaviour of downstream driver as well, however I
haven't observed bug reports about this SoC in the wild, so this
commit's purpose is to align this chip with all other SoC's - MT7620
were already using this arrangement.

Fixes: #9284
Fixes: 60fadae62b64 ("ramips: ethernet: ralink: move reset of the esw into the esw instead of fe")
Signed-off-by: Lech Perczak <lech.perczak@gmail.com>
(cherry picked from commit fc92fecfc7ddf19bbfd7d1305a29c666f00543af)
Signed-off-by: Lech Perczak <lech.perczak@gmail.com>
4 months agoramips: dts: rt3050: reset FE and ESW cores together
Lech Perczak [Mon, 11 Dec 2023 23:22:04 +0000 (00:22 +0100)]
ramips: dts: rt3050: reset FE and ESW cores together

Failing to do so will cause the DMA engine to not initialize properly
and fail to forward packets between them, and in some cases will cause
spurious transmission with size exceeding allowed packet size, causing a
kernel panic.

This is behaviour of downstream driver as well, however I
haven't observed bug reports about this SoC in the wild, so this
commit's purpose is to align this chip with all other SoC's - MT7620
were already using this arrangement.

Fixes: 60fadae62b64 ("ramips: ethernet: ralink: move reset of the esw into the esw instead of fe")
Signed-off-by: Lech Perczak <lech.perczak@gmail.com>
(cherry picked from commit c5a399f372535886582f89f3da624ae7465c8ff4)
Signed-off-by: Lech Perczak <lech.perczak@gmail.com>
4 months agoramips: dts: rt3352: reset FE and ESW cores together
Maxim Anisimov [Fri, 8 Dec 2023 05:34:30 +0000 (08:34 +0300)]
ramips: dts: rt3352: reset FE and ESW cores together

Failing to do so will cause the DMA engine to not initialize properly
and fail to forward packets between them, and in some cases will cause
spurious transmission with size exceeding allowed packet size, causing a
kernel panic.

Fixes: 60fadae62b64 ("ramips: ethernet: ralink: move reset of the esw into the esw instead of fe")
Signed-off-by: Maxim Anisimov <maxim.anisimov.ua@gmail.com>
[Provide commit description, split into logical changes]
Signed-off-by: Lech Perczak <lech.perczak@gmail.com>
(cherry picked from commit 8d75b1de0ff7b9e9e0138f822a5475bb8ad7fedf)
Signed-off-by: Lech Perczak <lech.perczak@gmail.com>
4 months agoramips: mtk_eth_soc: wait longer after FE core reset to settle
Maxim Anisimov [Sun, 10 Dec 2023 15:27:32 +0000 (16:27 +0100)]
ramips: mtk_eth_soc: wait longer after FE core reset to settle

Enabling the FE core too early causes the system to hang during boot
uncondtionally, after the reset is released. Increate it to 1-1.2ms
range.

Fixes: 60fadae62b64 ("ramips: ethernet: ralink: move reset of the esw into the esw instead of fe")
Signed-off-by: Maxim Anisimov <maxim.anisimov.ua@gmail.com>
[Split previous commit, provide rationale]
Signed-off-by: Lech Perczak <lech.perczak@gmail.com>
(cherry picked from commit 7eb0458c1f7e4f681b16d2721cfc3fcb69774c95)
Signed-off-by: Lech Perczak <lech.perczak@gmail.com>
4 months agoramips: mtk_eth_soc: allow multiple resets
Lech Perczak [Fri, 15 Dec 2023 16:15:47 +0000 (17:15 +0100)]
ramips: mtk_eth_soc: allow multiple resets

Use devm_reset_control_array_get_exclusive to register multiple
reset lines in FE driver. This is required to reattach ESW reset to FE
driver again, based on device tree bindings.

While at that, remove unused fe_priv.rst_ppe field, and add error
message if getting the reset fails.

Fixes: 60fadae62b64 ("ramips: ethernet: ralink: move reset of the esw into the esw instead of fe")
Co-developed-by: Maxim Anisimov <maxim.anisimov.ua@gmail.com>
Signed-off-by: Maxim Anisimov <maxim.anisimov.ua@gmail.com>
[Split out of the bigger commit, provide commit mesage, refactor error
handling]
Signed-off-by: Lech Perczak <lech.perczak@gmail.com>
(cherry picked from commit 3f1be8edee29fe79fc33c88cbd9d647a490410e5)
Signed-off-by: Lech Perczak <lech.perczak@gmail.com>
4 months agomac80211: add missing newline for "min_tx_power"
Rany Hany [Wed, 3 Jan 2024 16:43:33 +0000 (18:43 +0200)]
mac80211: add missing newline for "min_tx_power"

This prevents min_tx_power from functioning properly in some circumstances.
Add the missing newline.

Signed-off-by: Rany Hany <rany_hany@riseup.net>
(cherry picked from commit 6ca8752a9cadac810f8541ec1be67d02265175aa)

4 months agokernel: delete stray linux 6.1 patch
Felix Fietkau [Fri, 5 Jan 2024 11:55:17 +0000 (12:55 +0100)]
kernel: delete stray linux 6.1 patch

Fixes: cc285dc2b6f7 ("generic: net: phy: realtek: add interrupt support for RTL8221B")
Signed-off-by: Felix Fietkau <nbd@nbd.name>
4 months agokernel: fix bridge proxyarp issue with some broken DHCP clients
Felix Fietkau [Fri, 5 Jan 2024 10:58:15 +0000 (11:58 +0100)]
kernel: fix bridge proxyarp issue with some broken DHCP clients

There are broken devices in the wild that handle duplicate IP address
detection by sending out ARP requests for the IP that they received from a
DHCP server and refuse the address if they get a reply.
When proxyarp is enabled, they would go into a loop of requesting an address
and then NAKing it again.

Fixes: https://github.com/openwrt/openwrt/issues/14309
Signed-off-by: Felix Fietkau <nbd@nbd.name>
(cherry picked from commit c1ad78318c3e6421e60dd187477f38ca5f9a5752)

4 months agomediatek: add support for Routerich AX3000
Mikhail Zhilkin [Sat, 9 Dec 2023 17:17:02 +0000 (17:17 +0000)]
mediatek: add support for Routerich AX3000

This PR is continuation of work under "mediatek: add support for Routerich
AX3000" #13703 by the agreement with PR #13703 original author (Maximilian
Weinmann <x1@disroot.org>). All reviews from the previous PR were taken
into into account.

Routerich AX3000 is a wireless WiFi 6 router.

Specification
-------------
- SoC       : MediaTek MT7981BA dual-core ARM Cortex-A53 1.3 GHz
- RAM       : DDR3 256 MiB (ESMT M15T2G16128A)
- Flash     : SPI-NAND 128 MiB (ESMT F50L1G41LB)
- WLAN      : MediaTek MT7976CN dual-band WiFi 6
  - 2.4 GHz : b/g/n/ax, MIMO 2x2
  - 5 GHz   : a/n/ac/ax, MIMO 2x2
- Ethernet  : 10/100/1000 Mbps x4 (MediaTek MT7531AE)
- USB       : 1x 2.0
- UART      : through-hole on PCB
  - [J500] GND, TX, RX, 3.3V (115200n8)
- Buttons   : Mesh, Reset
- LEDs      : 1x Power (Blue)
              1x WiFi 2.4 GHz (Blue)
              1x WiFi 5 GHz (Red)
              1x Mesh (Blue)
              3x LAN activity (Blue)
              1x WAN activity (Blue)
              2x WAN no-internet (Red)
- Power     : 12 VDC, 1.5 A

Installation
------------
Flash OpenWrt 'sysupgrade.bin' image using stock firmware web-interface
(without keeping settings).

Return to stock
---------------
Install stock firmware image (without keeping settings) using OpenWrt
sysupgrade method.

Recovery
--------
Connect uart, use u-boot menu to flash stock firmware image or boot
OpenWrt initramfs image.

MAC addresses
-------------
+---------+-------------------+-----------+
|         | MAC               | Algorithm |
+---------+-------------------+-----------+
| WAN     | 24:0f:5e:xx:xx:b4 | label     |
| LAN     | 24:0f:5e:xx:xx:b5 | label+1   |
| WLAN 2g | 24:0f:5e:xx:xx:b6 | label+2   |
| WLAN 5g | 24:0f:5e:xx:xx:b7 | label+3   |
+---------+-------------------+-----------+
The WLAN 2g MAC was found in 'Factory', 0x4

Co-authored-by: Maximilian Weinmann <x1@disroot.org>
Signed-off-by: Mikhail Zhilkin <csharper2005@gmail.com>
(cherry picked from commit 485adc9d3c436d31f9713a7d8d84adf266754e26)
[Fix merge conflict in uboot-envtools]
Signed-off-by: Mikhail Zhilkin <csharper2005@gmail.com>
4 months agoramips: add support for Rostelecom RT-FE-1A
Mikhail Zhilkin [Sat, 25 Nov 2023 12:14:57 +0000 (12:14 +0000)]
ramips: add support for Rostelecom RT-FE-1A

Rostelecom RT-FE-1A is a wireless WiFi 5 router manufactured by Sercomm
company.

Device specification
--------------------
SoC Type: MediaTek MT7621AT
RAM: 256 MiB
Flash: 128 MiB
Wireless 2.4 GHz (MT7603EN): b/g/n, 2x2
Wireless 5 GHz (MT7615E): a/n/ac, 4x4
Ethernet: 5x GbE (WAN, LAN1, LAN2, LAN3, LAN4)
USB ports: No
Button: 2 buttons (Reset & WPS)
LEDs:
   - 1x Power (green, unmanaged)
   - 1x Status (green, gpio)
   - 1x 2.4G (green, hardware, mt76-phy0)
   - 1x 2.4G (blue, gpio)
   - 1x 5G (green, hardware, mt76-phy1)
   - 1x 5G (blue, gpio)
   - 5x Ethernet (green, hardware, 4x LAN & WAN)
Power: 12 VDC, 1.5 A
Connector type: barrel
Bootloader: U-Boot

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

1.  Login to the router web interface (default http://192.168.0.1/)
    under "admin" account

2.  Navigate to Settings -> Configuration -> Save to Computer

3.  Decode the configuration. For example, using cfgtool.py tool (see
    related section):
    cfgtool.py -u configurationBackup.cfg

4.  Open configurationBackup.xml and find the following block:

<OBJECT name="User." type="object" writable="1" encryption="0" >
<OBJECT name="1." type="object" writable="1" encryption="0" >
<PARAMETER name="Password" type="string" value="<some value>" writable="1" encryption="1" password="1" />
</OBJECT>

5.  Replace <some value> by a new superadmin password and add a line
    which enabling superadmin login after. For example, the block after
    the changes:

<OBJECT name="User." type="object" writable="1" encryption="0" >
<OBJECT name="1." type="object" writable="1" encryption="0" >
<PARAMETER name="Password" type="string" value="s0meP@ss" writable="1" encryption="1" password="1" />
<PARAMETER name="Enable" type="boolean" value="1" writable="1" encryption="0"/>
</OBJECT>

6.  Encode the configuration. For example, using cfgtool.py tool:
       cfgtool.py -p configurationBackup.xml

7.  Upload the changed configuration (configurationBackup_changed.cfg) to
    the router

8.  Login to the router web interface (superadmin:xxxxxxxxxx, where
    xxxxxxxxxx is a new password from the p.5)

9.  Enable SSH access to the router (Settings -> Access control -> SSH)

10. Connect to the router using SSH shell using superadmin account

11. Run in SSH shell:
    sh

12. Make a mtd backup (optional, see related section)

13. Change bootflag to Sercomm1 and reboot:
    printf 1 | dd bs=1 seek=7 count=1 of=/dev/mtdblock3
    reboot

14. Login to the router web interface under admin account

15. Remove dots from the OpenWrt factory image filename

16. Update firmware via web using OpenWrt factory image

Revert to stock
---------------
Change bootflag to Sercomm1 in OpenWrt CLI and then reboot:
   printf 1 | dd bs=1 seek=7 count=1 of=/dev/mtdblock3

mtd backup
----------
1. Set up a tftp server (e.g. tftpd64 for windows)
2. Connect to a router using SSH shell and run the following commands:
   cd /tmp
   for i in 0 1 2 3 4 5 6 7 8 9; do nanddump -f mtd$i /dev/mtd$i; \
   tftp -l mtd$i -p 192.168.0.2; md5sum mtd$i >> mtd.md5; rm mtd$i; done
   tftp -l mtd.md5 -p 192.168.0.2

MAC Addresses
-------------
+-----+------------+---------+
| use | address    | example |
+-----+------------+---------+
| LAN | label      | f4:*:66 |
| WAN | label + 11 | f4:*:71 |
| 2g  | label + 2  | f4:*:68 |
| 5g  | label + 3  | f4:*:69 |
+-----+------------+---------+
The label MAC address was found in Factory, 0x21000

cfgtool.py
----------
A tool for decoding and encoding Sercomm configs.
Link: https://github.com/r3d5ky/sercomm_cfg_unpacker
Signed-off-by: Mikhail Zhilkin <csharper2005@gmail.com>
(cherry picked from commit f3cdc9f9881796794c06f784a2e4790f5ed75d1f)

4 months agoramips: mt7621: use lzma-loader for Sercomm NA502
Szabolcs Hubai [Wed, 8 Nov 2023 12:50:55 +0000 (13:50 +0100)]
ramips: mt7621: use lzma-loader for Sercomm NA502

This fixes a well known "LZMA ERROR 1" error on Sercomm NA502,
reported on the OpenWrt forum. [1]

[1]: https://forum.openwrt.org/t/176942

Signed-off-by: Szabolcs Hubai <szab.hu@gmail.com>
(cherry picked from commit d41b8a570f209c352571f209c2c8f2b52b8d27af)

4 months agomediatek: enable mt7981-wo-firmware package by default
Robert Senderek [Sun, 10 Dec 2023 12:49:10 +0000 (13:49 +0100)]
mediatek: enable mt7981-wo-firmware package by default

Add support for wireless offload package in default configuration for
-Cudy WR3000
-Confiabits MT7981
For some reason those ware missing. I confirm this work for my Cudy WR3000

Signed-off-by: Robert Senderek <robert.senderek@10g.pl>
(cherry picked from commit b42eea0c2f68ea4903e952287a08511dd0a03072)

4 months agomac80211: fix a race condition related to enabling fast-xmit
Felix Fietkau [Wed, 3 Jan 2024 14:13:32 +0000 (15:13 +0100)]
mac80211: fix a race condition related to enabling fast-xmit

fast-xmit must only be enabled after the sta has been uploaded to the driver,
otherwise it could end up passing the not-yet-uploaded sta via drv_tx calls
to the driver, leading to potential crashes because of uninitialized drv_priv
data.
Add a missing sta->uploaded check and re-check fast xmit after inserting a sta.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
(cherry picked from commit 438a97fab69b41387e25cbec45271e7fe159a330)

4 months agonetifd: update to Git openwrt-23.05 (2024-01-04)
Felix Fietkau [Thu, 4 Jan 2024 12:46:34 +0000 (13:46 +0100)]
netifd: update to Git openwrt-23.05 (2024-01-04)

c739dee0a37b system-linux: refresh MAC address on DSA port conduit change
8587c074f1eb interface-ip: fix IPv4 route target masking
33d6c261aacb system-linux: fix bogus debug error messages on adding bridge members
0832e8f04778 wireless: add bridge_isolate option
5ca7a9058e98 bridge: fix reload on bridge vlan changes
be4ffb3b78bc bridge: rework config change pvid handling
923c4370a1d4 system-linux: set master early on apply settings
b9442415c785 system-linux: skip refreshing MAC on master change if custom MAC
b635a09cdadf system-linux: set pending to 0 on ifindex found or error for if_get_master
2bbe49c36224 device: Log error message if device initialization failed
2703f740a23e Revert "system-linux: set pending to 0 on ifindex found or error for if_get_master"
9cb0cb418303 system-linux: fix race condition in netlink socket error handing
c18cc79d5000 device: restore cleared flags on device down

Signed-off-by: Felix Fietkau <nbd@nbd.name>
4 months agodropbear: increase default receive window size
David Bauer [Thu, 28 Dec 2023 22:16:02 +0000 (23:16 +0100)]
dropbear: increase default receive window size

Increasing the receive window size improves throughout on higher-latency
links such as WAN connections. The current default of 24KB caps out at
around 500 KB/s.

Increasing the receive buffer to 256KB increases the throughput to at
least 11 MB/s.

Signed-off-by: David Bauer <mail@david-bauer.net>
(cherry picked from commit f95eecfb21ff08662e022accd30e8254028ff63b)

4 months agoramips: fix label-mac for Xiaomi RA75
David Bauer [Tue, 26 Dec 2023 00:17:18 +0000 (01:17 +0100)]
ramips: fix label-mac for Xiaomi RA75

The label-mac of the repeater is the address used on the 2.4 GHz radio,
not the ethernet MAC.

Signed-off-by: David Bauer <mail@david-bauer.net>
(cherry picked from commit 47818fbc012d7b8ef4129bf702da2d6aae07266e)

4 months agomvebu: fix RTC of IEI-World Puzzle M90x devices
Daniel Golle [Mon, 18 Dec 2023 21:22:12 +0000 (21:22 +0000)]
mvebu: fix RTC of IEI-World Puzzle M90x devices

The Puzzle devices come with an I2C-connected Epson RX8130 RTC.
Disable the (dysfunctional) RTC units of the SoC and add driver
kmod-rtc-ds1307 to support the Epson RX8130 instead.

Tested-by: Thomas Huehn <thomas.huehn@hs-nordhausen.de>
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
(cherry picked from commit 6d546b3b4cdae3ffcdad71fb6cc414f3a39bc09e)

4 months agomediatek: add SPDX header for Confiabits MT7981 DTS
Luis Mita [Wed, 6 Dec 2023 13:30:10 +0000 (09:30 -0400)]
mediatek: add SPDX header for Confiabits MT7981 DTS

Fixing ambiguous licensing.

Signed-off-by: Luis Mita <luis@luismita.com>
(cherry picked from commit b1fd4b35bf784a9b5619e17c07389e79af113953)

4 months agomediatek: add support for Confiabits MT7981
Luis Mita [Wed, 22 Nov 2023 19:13:04 +0000 (15:13 -0400)]
mediatek: add support for Confiabits MT7981

Confiabits MT7981 is a Wi-Fi 6 router based on MediaTek MT7981.

Specification:
 - SoC: MediaTek MT7981B
 - CPU: 2x 1.3 GHz Cortex-A53
 - Flash: 128 MiB SPI NAND
 - RAM: 256 MiB
 - WLAN: 2.4 GHz, 5 GHz (MediaTek MT7976CN, 802.11ax)
 - Ethernet: 4x 10/100/1000 Mbps MT7531AE (3xLAN, 1xWAN)
 - USB 2.0 port
 - Buttons: 1 Reset button, 1 Mesh button.
 - LEDs: 7x light-blue, 2x warm-white
 - Serial console: internal 4-pin header, 115200 8n1
 - Power: 12 VDC, 1.5 A

MAC addresses in stock firmware and in this commit:
+---------+-------------------+-----------+
|         | MAC               | Algorithm |
+---------+-------------------+-----------+
| WAN     | 00:0c:43:xx:xx:e1 | label+1   |
| LAN     | 00:0c:43:xx:xx:e0 | label     |
| WLAN 2g | 00:0c:43:xx:xx:e0 | label     |
| WLAN 5g | 02:0c:43:xx:xx:e0 |           |
+---------+-------------------+-----------+
The label MAC was found in 'Factory', 0x4

Installation:
The stock firmware is OpenWrt-based. If you can reach LuCI or SSH, just use the sysupgrade image
with the 'Keep settings' option turned off.

Signed-off-by: Luis Mita <luis@luismita.com>
(cherry picked from commit 2af07eb85393689a74d32d6211663a0e5ec02a01)

5 months agomwlwifi: update to version 10.4.10-20231120
Michael Trinidad [Wed, 22 Nov 2023 02:46:27 +0000 (21:46 -0500)]
mwlwifi: update to version 10.4.10-20231120

Upstream PR 416 improvements:
 -AMPDU Optimization of priority calculation. (8864/8897)
 -8864/8897 fix wpa3
 -Add cypher suite to driver capabilities (all chip)
 -Alignment of pcie_tx_ctrl* (all chip)
 -"feature" normalization for all chips (all chip)
 -Add modprobe parameters (all chip)
 -fix monitoring (all chip)
 -Code separation by chipset (8864/8897 <=> 8997)
 -dump_prob decommissioning (8864/8897/8997)
 -fix amsdu high ping latency (8864/8897/8997)
 -drop debug info in hostcmd_get_hw_spec() (8864/8897)
 -Add wcb_base in debug info (8864)
 -Rewrite AMSDU packets (8864/8897/8997)
 -debug rewrite output mwl_debugfs_sta_read (all chip)
 -Improved encryption interoperability (8864/8897/8997)
 -factorization encrypted packet test (8864/8897/8997)
 -Change 88W8864 firmware to 7.2.9.27 (8864/8897)
 -Fix the AMPDU session lifecycle (8864/8897/8997)
 -Remove the tx done packets mechanism (8864/8897)

Signed-off-by: Michael Trinidad <trinidude4@hotmail.com>
5 months agomt76: Add firmware package for MT7922
Daniel Danzberger [Fri, 13 Oct 2023 11:50:49 +0000 (13:50 +0200)]
mt76: Add firmware package for MT7922

Adds the 2 required firmware files for MT7922 chips.

Signed-off-by: Daniel Danzberger <dd@embedd.com>
(cherry picked from commit 9eecf4905375777e2048177dbe4d83fee5da9ee1)
Signed-off-by: Anya Lin <hukk1996@gmail.com>
5 months agokirkwood: fix Ctera C200 V1 ubi part name
Pawel Dembicki [Fri, 8 Dec 2023 08:32:41 +0000 (09:32 +0100)]
kirkwood: fix Ctera C200 V1 ubi part name

In 749237967a12 downstream dts was replaced with upstream accepted
patch. But in upstream version last partition was called "rootfs"
instead "ubi". OpenWrt require "ubi" label for ubi rootfs.
This patch restore proper label.

Fixes: 749237967a12 ("kirkwood: Replace dtses with upstream accepted")
Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
(cherry picked from commit 9075cfd609e905bc7162574a24a7fb457e65a374)

5 months agoath79: make boot-leds service executable
Eric J. Anderson [Mon, 4 Dec 2023 21:41:47 +0000 (22:41 +0100)]
ath79: make boot-leds service executable

This service was unfunctional due to not having its executable bit
set.

Fixes #13500.

Signed-off-by: Eric J. Anderson <eric.j.ason256@gmail.com>
(cherry picked from commit 807acbce66c34596ac80cad8ea2a3f170f58429c)

5 months agoipq807x: fix edgecore EAP102 lan/wan
Dirk Buchwalder [Fri, 24 Nov 2023 14:56:39 +0000 (15:56 +0100)]
ipq807x: fix edgecore EAP102 lan/wan

We have a report in the forum, that lan/wan is non-functional
on the EAP102 (https://forum.openwrt.org/t/edgecore-eap102/178449)

Fixing that by swapping label and phy-handle of the dp-nodes and
updating the lan/wan bmp.

Note: the original commiter of the device support seems absent for a
long time in the forum and on the OpenWrt github group.

Tested-by: Antonio Della Selva <antonio.dellaselva@uniurb.it>
Signed-off-by: Dirk Buchwalder <buchwalder@posteo.de>
Reviewed-by: Robert Marko <robimarko@gmail.com>
(cherry picked from commit 9b598ec8d5585ca81cd472ca1d1b4f93d18dc3d5)
[ fix conflicts errors ]
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
5 months agomediatek: filogic: add Acelink EW-7886CAX support
Rafał Miłecki [Mon, 20 Nov 2023 10:46:26 +0000 (11:46 +0100)]
mediatek: filogic: add Acelink EW-7886CAX support

Acelink EW-7886CAX is an MT7986A (AKA Filogic 830) based access point.
It has 512 MiB of RAM, one 2.5 Gbps PoE (802.3at) Ethernet port and
on-SoC Wi-Fi. There is no printed MAC label (on my unit).

My unit came with Mediatek's firmware (based on OpenWrt 21.02)
installed. It was possible to simply upgrade using OpenWrt's sysupgrade
tool.

Another verified upgrade method is using U-Boot (requires UART). During
every boot there is "U-Boot Boot Menu". Selecting option "2. Upgrade
firmware" allows using U-Boot's tftp client to load and flash factory
image.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit 07765f28b7911ca8207b6e7ec94508a5740c4697)

5 months agomediatek: filogic: reorder alphabetically
Chukun Pan [Mon, 6 Nov 2023 15:06:05 +0000 (23:06 +0800)]
mediatek: filogic: reorder alphabetically

Reorder scripts and image recipes to keep alphabetical order.

Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
(cherry picked from commit 07482d15af5dd79fc38dd0eb23319934fe4d7a7a)

5 months agomediatek: fiilogic: device tree `switch@1f` fix
Rani Hod [Wed, 22 Nov 2023 17:38:06 +0000 (19:38 +0200)]
mediatek: fiilogic: device tree `switch@1f` fix

Quite a few `fiilogic` devices use the `mt7531` switch.
Some of them have a DT node that looks like:
```
switch: switch@0 {
compatible = "mediatek,mt7531";
reg = <31>;
...
};
```
This commit changes the DT node name to `switch@1f`.

Signed-off-by: Rani Hod <rani.hod@gmail.com>
(cherry picked from commit aaeb379023daf9720303884f61748fe362b0a237)

5 months agomediatek: fix the name of buswidth to bus-width
Chen Minqiang [Fri, 25 Aug 2023 22:38:18 +0000 (06:38 +0800)]
mediatek: fix the name of buswidth to bus-width

Fix the issue of dts buswidth cannot be applied properly with spi driver.
Fix the name of buswidth to bus-width in dts in order to fit the format
in linux spi kernel[1] so that spi-tx-bus-width & spi-rx-bus-width can be
parsed properly.

[1] Documentation/devicetree/bindings/spi/spi-controller.yaml

Signed-off-by: Chen Minqiang <ptpt52@gmail.com>
(cherry picked from commit 36746893ac690796bf7aad00a793ff4bf739d066)

5 months agomediatek: filogic: Fix GPIOs for Zbtlink ZBT-Z8102AX
Hauke Mehrtens [Sat, 25 Nov 2023 17:06:41 +0000 (18:06 +0100)]
mediatek: filogic: Fix GPIOs for Zbtlink ZBT-Z8102AX

The PGIO configuration should be added for the ZBT-Z8102AX and not the ZBT-Z8103AX

Fixes: c8c2f522625c ("mediatek: add support for Zbtlink ZBT-Z8102AX")
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit d99aed31a0e54f68cb26d2dfe814f51a3df31cc4)

5 months agolua5.3: fix typo calling lua53 instead of lua5.3 for Package Default
Christian Marangi [Sun, 10 Dec 2023 10:43:45 +0000 (11:43 +0100)]
lua5.3: fix typo calling lua53 instead of lua5.3 for Package Default

Fix typo calling lua53 instead of lua5.3 for Package Default definition.

This cause only missing description of the package and doesn't cause
any build regression.

Fixes: c52ca08d4008 ("lua5.3: build shared library")
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
(cherry picked from commit 25e215c14ee6c9f3d54cd1da46a48d9ffe6b254e)

5 months agomediatek: add support for Zbtlink ZBT-Z8102AX
Daniel Golle [Sat, 9 Dec 2023 12:39:53 +0000 (13:39 +0100)]
mediatek: add support for Zbtlink ZBT-Z8102AX

Specifications:
SoC: MediaTek MT7981B
RAM: 1024MiB
Flash: SPI-NAND 128 MiB
Switch: 1 WAN, 4 LAN (Gigabit)
USB: two M.2 slots for 5G modems via USB 3.0 hub, external USB 3.0 port
Buttons: Reset, Mesh
Power: DC 12V 1A
WiFi: MT7976CN
UART: 115200n8
UART Layout:
VCC-RX-TX-GND

Installation:
A. Through OpenWrt Dashboard:
If your router comes with OpenWrt preinstalled (modified by the seller),
you can easily upgrade by going to the dashboard (192.168.1.1) and then
navigate to System -> Backup/Flash firmware, then flash the firmware

B. Through TFTP
Standard installation via UART:

1. Connect USB Serial Adapter to the UART, (NOTE: Don't connect the VCC pin).
2. Power on the router. Make sure that you can access your router via UART.
3. Restart the router then repeatedly press ctrl + c to skip default boot.
4. Type > bootmenu
5. Press '2' to select upgrade firmware
6. Press 'Y' on 'Run image after upgrading?'
7. Press '0' and hit 'enter' to select TFTP client (default)
8. Fill the U-Boot's IP address and TFTP server's IP address.
9. Finally, enter the 'firmware' filename.

Based on patch adding support for similar Zbtlink ZBT-Z8103AX device by
Ian Ishmael C. Oderon.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
(cherry picked from commit c8c2f522625c8d9eb5acad317e3de7a6b156decf)

5 months agomediatek: filogic: add JCG Q30 PRO support
Chukun Pan [Fri, 16 Jun 2023 15:16:30 +0000 (23:16 +0800)]
mediatek: filogic: add JCG Q30 PRO support

Hardware specification:
  SoC: MediaTek MT7981B 2x A53
  Flash: Winbond 128MB
  RAM: DDR3 256MB
  Ethernet: 4x 10/100/1000 Mbps
  Switch: MediaTek MT7531AE
  WiFi: MediaTek MT7976C
  Button: Reset
  Power: DC 12V 1A

Flash instructions:
  1. Connect to your PC via the Gigabit port of the router,
     set a static ip on the ethernet interface of your PC.
     (ip 192.168.1.254, gateway 192.168.1.1)
  2. Attach UART, pause at u-boot menu.
  3. Select "Upgrade ATF BL2", then use preloader.bin
  4. Select "Upgrade ATF FIP", then use bl31-uboot.fip
  5. Download the initramfs image, and type "reset",
     waiting for tftp recovery to complete.
  6. After openwrt boots up, perform sysupgrade.

Note:
  1. Since NMBM is disabled, we must back up all partitions.
  2. Although we can upgrade new firmware in the stock firmware,
     we need the special fit image signature of MediaTek and
     dual boot (hack kernel) to make u-boot boot it. So just
     abandon these hacks and flash it via the serial port.

Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
(cherry picked from commit 626344c9926dcf2db2e10681c19aab0328fee160)

5 months agouboot-mediatek: add JCG Q30 PRO support
Chukun Pan [Thu, 15 Jun 2023 15:21:40 +0000 (23:21 +0800)]
uboot-mediatek: add JCG Q30 PRO support

The vendor uboot will verify firmware at boot.
So add a custom uboot build for this device.

Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
(cherry picked from commit b42c5272286ee248c698cc2cfac88df1bf51cbe3)

5 months agofilogic: add support for ASUS TUF AX6000
Patryk Kowalczyk [Sat, 16 Sep 2023 01:02:35 +0000 (03:02 +0200)]
filogic: add support for ASUS TUF AX6000

Hardware
========
SOC: MediaTek MT7986
RAM: 512MB DDR3
FLASH: 256MB SPI-NAND
WIFI: Mediatek MT7986 DBDC 802.11ax 2.4/5 GHz 4T4R
ETH: MediaTek MT7530 Switch (LAN)
MaxLinear GPY211C 2.5 N-Base-T PHY (WAN)
MaxLinear GPY211C 2.5 N-Base-T PHY (LAN)
UART: 3V3 115200 8N1 (Do not connect VCC)
USB 3.1

Installation
============

Download the OpenWrt initramfs image. Copy the image to a TFTP server
reachable at 192.168.1.70/24. Rename the image to TUF-AX6000.bin.

Connect to the serial console, interrupt the auto boot process by
pressing '4' when prompted or press '1' and set client IP, server
IP and name of the image.

yOU don't need to open the case or even soldering anything.
use three goldpin wires, remove their plastic cover and connect
them to the console pinout via the case holes.

You can see three holes
From Bottom: RX, TX, Ground - partially covered

Download & Boot the OpenWrt initramfs image.

In case of option '4'
$ setenv ipaddr 192.168.1.1
$ setenv serverip 192.168.1.70
$ tftpboot 0x46000000 TUF-AX6000.bin
$ bootm 0x46000000

In case of option '1'
1: Load System code to SDRAM via TFTP.
Please Input new ones /or Ctrl-C to discard
Input device IP (192.168.1.1) ==:
Input server IP (192.168.1.70) ==:
Input Linux Kernel filename (TUF-AX6000.trx) ==:

Wait for OpenWrt to boot. Transfer the sysupgrade
image to the device using scp and install using sysupgrade.

$ sysupgrade -n <path-to-sysupgrade.bin>

Missing features
================

2.5Gb LAN port LED is ON during boot or when the LAN cable is disconnected

The cover yellow light is not supported. (only blue one)

Signed-off-by: Patryk Kowalczyk <patryk@kowalczyk.ws>
(cherry picked from commit d522ccecb28f941aadcaf7a50cd6daa861f468a7)

5 months agoucode: adjust module dependencies
Jo-Philipp Wich [Thu, 7 Dec 2023 22:12:00 +0000 (23:12 +0100)]
ucode: adjust module dependencies

Let ucode-mod-* packages select the ucode interpreter instead of depending
on it to avoid recursive dependency chains in unrelated packages.

Fixes: https://github.com/openwrt/packages/issues/22837
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 01d1c1ad296cc71f87ea02b01b16a09fe5d933a1)

5 months agomediatek: fix eeprom loading (Mercusys MR90X v1)
Mikhail Zhilkin [Sat, 30 Sep 2023 14:07:15 +0000 (14:07 +0000)]
mediatek: fix eeprom loading (Mercusys MR90X v1)

Commit mt76: drop default eeprom file for mt7986-firmware
(e3aa645b267ca4f08773b5366583e9b0020fc3e9) breaks eeprom loading for
Mercusys MR90X v1. As a result WiFi is not working at all.

This commit adds Mercusus MR90x to the caldata script (it works after the
commit mentioned above). And we can safely drop "81_fix_eeprom" script
as it's no longer required.

Fixes: 5a0bdab24c0f ("mt76: drop default eeprom file for mt7986-firmware")
Signed-off-by: Mikhail Zhilkin <csharper2005@gmail.com>
(cherry picked from commit 85b0d7592c454f2e4e02be043a1e433c67df4e41)
[rmilecki: fix commit hash in Fixes]
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
5 months agomt76: drop default eeprom file for mt7986-firmware
Chukun Pan [Thu, 4 May 2023 15:10:03 +0000 (23:10 +0800)]
mt76: drop default eeprom file for mt7986-firmware

The mt76 driver usually reads the eeprom on the mtd partition at dts.
For emmc device we need to use caldata_extract script to read the
eeprom. However, the default eeprom file breaks the caldata script
execution, so remove it.

Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
(cherry picked from commit e3aa645b267ca4f08773b5366583e9b0020fc3e9)

5 months agogeneric: net: phy: realtek: add interrupt support for RTL8221B
Jianhui Zhao [Sun, 24 Sep 2023 14:15:00 +0000 (22:15 +0800)]
generic: net: phy: realtek: add interrupt support for RTL8221B

This commit introduces interrupt support for RTL8221B.

Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
(cherry picked from commit 1db949a632607aa1df2987b7701da0be3e473260)

5 months agouboot-mediatek: fix typo in bootmenu for GL-MT6000
Jianhui Zhao [Tue, 10 Oct 2023 06:09:38 +0000 (14:09 +0800)]
uboot-mediatek: fix typo in bootmenu for GL-MT6000

Fixes: b530d492a9d9 ("filogic: add support for GL.iNet GL-MT6000")
Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
(cherry picked from commit 4536fb4c5c7b3564dae301529bb0ac4a3ce914b8)
[rmilecki: fix commit hash in Fixes]
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
5 months agomediatek: filogic: remove kmod-usb2 for GL-MT6000
Chukun Pan [Fri, 17 Nov 2023 15:27:03 +0000 (23:27 +0800)]
mediatek: filogic: remove kmod-usb2 for GL-MT6000

The usb driver requires kmod-usb3, not kmod-usb2.
Remove the useless kmod-usb2 from default package.

Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
(cherry picked from commit b74ae695967942849b9f68c68d05217e1420dc1d)

5 months agofilogic: add support for GL.iNet GL-MT6000
Jianhui Zhao [Sun, 24 Sep 2023 14:34:12 +0000 (22:34 +0800)]
filogic: add support for GL.iNet GL-MT6000

Hardware specification:
* SoC: MediaTek MT7986A 4x A53
* Flash: 8GB EMMC
* RAM: 1GB DDR4
* Ethernet:
  * 2x2.5G RJ45 port (RTL8221B)
  * 4x1G RJ45 ports (MT7531AE)
* WLAN:
  * 2.4GHz: MT7976GN 4T4R
  * 5GHz: MT7976AN 4T4R
* Button: Reset
* LED: 1 x dual color LED
* USB: 1 x USB 3.0
* Power: DC 12V 4A
* UART: 3V3 115200 8N1 (Pinout: GND TX RX VCC)
* JTAG: 9 PIN

If you want to use u-boot from OpenWrt, you can upgrade it safely.
* bl2: openwrt-mediatek-filogic-glinet_gl-mt6000-preloader.bin
* fip: openwrt-mediatek-filogic-glinet_gl-mt6000-bl31-uboot.fip

`openwrt-mediatek-filogic-glinet_gl-mt6000-squashfs-factory.bin` is used in OpenWrt's u-boot.

Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
(cherry picked from commit fe10f9743935d6986e80e7cb082469e6bc5a03f0)

5 months agomediatek: filogic: add support for Ubiquiti UniFi 6 Plus (U6+)
Elbert Mai [Sun, 17 Sep 2023 14:59:48 +0000 (07:59 -0700)]
mediatek: filogic: add support for Ubiquiti UniFi 6 Plus (U6+)

Ubiquiti U6+ is a dual-band WiFi 6 PoE access point.
It is a drop-in upgrade of the U6 lite.

Specifications
---

- SoC: MediaTek MT7981A dual-core ARM Cortex-A53 1.3 GHz
- RAM: 256 MB DDR3-2133 RAM
- Flash: 16 MB SPI NOR and 4 GB eMMC
- LAN: 1x Gigabit Ethernet with 802.3af/at support
- WLAN: MediaTek MT7976C 2x2 MIMO dual-band WiFi 6
- LEDs: 1x blue and 1x white
- Buttons: 1x reset button

Installation
---

1. Power device using a PoE injector or switch
2. Connect via Ethernet to the device with static IP 192.168.1.2
3. SSH into the device with password: ubnt

        $ ssh ubnt@192.168.1.20

4. Unlock kernel partitions for writing

        $ echo 5edfacbf > /proc/ubnthal/.uf

5. Confirm correct partitions

        $ grep PARTNAME /sys/block/mmcblk0/mmcblk0p6/uevent
        PARTNAME=kernel0
        $ grep PARTNAME /sys/block/mmcblk0/mmcblk0p7/uevent
        PARTNAME=kernel1
        $ grep PARTNAME /sys/block/mmcblk0/mmcblk0p8/uevent
        PARTNAME=bs

6. Set and confirm bootloader environment

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

7. Copy sysupgrade image to /tmp/openwrt.bin via scp
8. Copy kernel and rootfs to mmcblk0p6 and mmcblk0p7, respectively

        $ tar xf /tmp/openwrt.bin sysupgrade-ubnt_unifi-6-plus/kernel -O | dd of=/dev/mmcblk0p6
        $ tar xf /tmp/openwrt.bin sysupgrade-ubnt_unifi-6-plus/root -O | dd of=/dev/mmcblk0p7

9. Ensure device boots from mmcblk0p6

        $ echo -ne "\x00\x00\x00\x00\x2b\xe8\x4d\xa3" > /dev/mmcblk0p8

10. Reboot the device

        $ reboot

Signed-off-by: Elbert Mai <code@elbertmai.com>
Signed-off-by: Bjørn Mork <bjorn@mork.no>
(cherry picked from commit 75ee5546e9b7cfa5bbfd6f844ab8c5fffd5bb594)

5 months agomediatek: add support for Cetron CT3003
Patricia Lee [Wed, 30 Aug 2023 11:50:54 +0000 (19:50 +0800)]
mediatek: add support for Cetron CT3003

**Hardware specification:**

- SoC: MediaTek MT7981B 2x A53
- Flash: ESMT F50L1G41LB 128MB
- RAM: Nanya NT5CC128M16JR-EK 256MB
- Ethernet: 4 x 10/100/1000 Mbps
- Switch: MediaTek MT7531AE
- WiFi: MediaTek MT7976C
- Button: Reset, Mesh
- Power: DC 12V 1A
- UART: 3.3v, 115200n8
  | Layout:   |
  | :-------- |
  | <Antenna> |
  | VCC       |
  | GND       |
  | Tx        |
  | Rx        |

**Flash instructions:**

1. Rename `openwrt-mediatek-filogic-cetron_ct3003-squashfs-factory.bin` to `factory.bin`.
2. Upload the `factory.bin` using the device's Web interface.
3. Click the upgrade button and wait for the process to finish.
4. Access the OpenWrt interface using the same password.
5. Use the 'Restore' function to reset the firmware to its initial state.

**Notes:**

If you plan to recovery the stock firmware in the future, it's advisable
to connect the device via the serial port and enter failsafe mode to
back up all the MTD partitions before proceeding the steps above.

Signed-off-by: Patricia Lee <patricialee320@gmail.com>
(cherry picked from commit 907e9e0bd3df456b32921893cf6ef1b54117d983)

5 months agofilogic: support Telenor branded ZyXEL EX5700
Bjørn Mork [Tue, 28 Mar 2023 13:04:21 +0000 (15:04 +0200)]
filogic: support Telenor branded ZyXEL EX5700

Telenor quirks
--------------
The operator specific firmware running on the Telenor branded
ZyXEL EX5700 includes U-Boot modifications affecting the OpenWrt
installation.

Notable changes to U-Boot include
- environment is stored in RAM and reset to defaults when power
  cycled
- dual partition scheme with "nomimal" or "rescue" systems, falling
  back to "rescue" unless the OS signals success in 3 attempts
- several runtime additions to the device-tree

Some of these modifications have side effects requiring workarounds
- U-Boot modifies /chosen/bootargs in an unsafe manner, and will crash
  unless this node exists
- U-Boot verifies that the selected rootfs UBI volume exists, and
  refuses to boot if it doesn't. The chosen "rootfs" volume must contain
  a squashfs signature even for tftp or initramfs booting.
- U-Boot parses the "factoryparams" UBI volume, setting the "ethaddr"
  variable to the label mac.  But "factoryparams" does not always
  exist.  Instead there is a "RIP" volume containing all the factory
  data.  Copying the "RIP" volume to  "factoryparams" will fix this

Hardware
--------
SOC:   MediaTek MT7986
RAM:   1GB DDR4
FLASH: 512MB SPI-NAND (Mikron xxx)
WIFI:  Mediatek MT7986 802.11ax 5 GHz
       Mediatek MT7916 DBDC 802.11ax 2.4 + 6 GHz
ETH:   MediaTek MT7531 Switch + SoC
       3 x builtin 1G phy (lan1, lan2, lan3)
       2 x MaxLinear GPY211C 2.5 N-Base-T phy (lan4, wan)
USB:   1 x USB 3.2 Enhanced SuperSpeed port
UART:  3V3 115200 8N1 (Pinout: GND KEY RX TX VCC)

Installation
------------
1. Download the OpenWrt initramfs image. Copy the image to a TFTP server
   reachable at 192.168.1.2/24. Rename the image to C0A80101.img.

2. Connect the TFTP server to lan1, lan2 or lan3. Connect to the serial
   console, Interrupt the autoboot process by pressing ESC when prompted.

3. Download and boot the OpenWrt initramfs image.

   $ env set uboot_bootcount 0
   $ env set firmware nominal
   $ tftpboot
   $ bootm

4. Wait for OpenWrt to boot. Transfer the sysupgrade image to the device
   using scp and install using sysupgrade.

   $ sysupgrade -n <path-to-sysupgrade.bin>

Missing features
----------------

- The "lan1", "lan2" and "lan3" port LEDs are driven by the switch but
  OpenWrt does not correctly configure the output.
- The "lan4" and "wan" port LEDs are driven by the GPH211C phys and
  not configured by OpenWrt.

Signed-off-by: Bjørn Mork <bjorn@mork.no>
(cherry picked from commit 6cc14bf66aa924962b926ea9702b6153ae418a7d)

5 months agobase-files: support parse DT LED color and function
Shiji Yang [Tue, 31 Oct 2023 10:47:49 +0000 (18:47 +0800)]
base-files: support parse DT LED color and function

The 'label' property in led node has been deprecated and we'd better
to avoid using it. This patch allows us to extract DT OF LED name
from the newly introduced LED properties "color", "function" and
"function-enumerator".

Signed-off-by: Shiji Yang <yangshiji66@qq.com>
(cherry picked from commit e814acc59948943c776ac319a348f72c0d19f33c)

5 months agompc85xx: allow mapping of cpu1 spin-table page
David Bauer [Mon, 4 Dec 2023 12:54:56 +0000 (13:54 +0100)]
mpc85xx: allow mapping of cpu1 spin-table page

The no-map property was incorrectly added, which kept the system-memory
available on the WS-AP3825 limited to 190MB. We are allowed to map the
page containing the CPU1 spin-table, we are just not allowed to write to
it.

Fixes: 57d7382cb159 ("mpc85xx: increase available RAM on Extreme Networks WS-AP3825i")
Signed-off-by: David Bauer <mail@david-bauer.net>
(cherry picked from commit d9271aa5b7ddcef20ebe64d1d80c8ddcd6cd7fb7)