openwrt/staging/hauke.git
2 years agokernel: split up mtk_bmt driver code
Felix Fietkau [Wed, 9 Mar 2022 10:30:58 +0000 (11:30 +0100)]
kernel: split up mtk_bmt driver code

Keep a separate source file per variant

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

2 years agoOpenWrt v22.03.1: revert to branch defaults
Hauke Mehrtens [Sun, 9 Oct 2022 17:32:23 +0000 (19:32 +0200)]
OpenWrt v22.03.1: revert to branch defaults

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2 years agoOpenWrt v22.03.1: adjust config defaults v22.03.1
Hauke Mehrtens [Sun, 9 Oct 2022 17:32:19 +0000 (19:32 +0200)]
OpenWrt v22.03.1: adjust config defaults

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2 years agoath79: fix model name of Extreme Networks WS-AP3805i
Tom Herbers [Fri, 7 Oct 2022 22:08:52 +0000 (00:08 +0200)]
ath79: fix model name of Extreme Networks WS-AP3805i

Everywhere else the device is referred to as WS-AP3805i,
only the model name wrongly only said AP3805i.

Signed-off-by: Tom Herbers <mail@tomherbers.de>
(cherry picked from commit 7d6032f310058d7e9b96d7e1dc4d49c8232beff7)

2 years agoath79: add low_mem to tiny image
Nick Hainke [Fri, 19 Aug 2022 16:59:36 +0000 (18:59 +0200)]
ath79: add low_mem to tiny image

Devices with SMALL_FLASH enabled have "SQUASHFS_BLOCK_SIZE=1024" in
their config. This significantly increases the cache memory required by
squashfs [0]. This commit enables low_mem leading to a much better
performance because the SQUASHFS_BLOCK_SIZE is reduced to 256.

Example Nanostation M5 (XM):
The image size increases by 128 KiB. However, the memory statisitcs look
much better:

Default tiny build:
------
MemTotal:          26020 kB
MemFree:            5648 kB
MemAvailable:       6112 kB
Buffers:               0 kB
Cached:             3044 kB

low_mem enabled:
-----
MemTotal:          26976 kB
MemFree:            6748 kB
MemAvailable:      11504 kB
Buffers:               0 kB
Cached:             7204 kB

[0] - https://github.com/freifunk-gluon/gluon/commit/7e8af99cf504ca1dc389f282a0c94f4a911571be

Signed-off-by: Nick Hainke <vincent@systemli.org>
(cherry picked from commit f54ac98f8cec676761e5144ae06640b8007b4b04)

2 years agoath79: move ubnt-xm to tiny
Nick Hainke [Sat, 25 Dec 2021 08:19:52 +0000 (09:19 +0100)]
ath79: move ubnt-xm to tiny

ath79 has was bumped to 5.10. With this, as with every kernel change,
the kernel has become larger. However, although the kernel gets bigger,
there are still enough flash resources. But the RAM reaches its capacity
limits. The tiny image comes with fewer kernel flags enabled and
fewer daemons.

Improves: 15aa53d7ee65 ("ath79: switch to Kernel 5.10")

Tested-by: Robert Foss <me@robertfoss.se>
Signed-off-by: Nick Hainke <vincent@systemli.org>
(cherry picked from commit f4415f7635164ec07ddc22f56df93555804b5767)

2 years agokernel: fix possible mtd NULL pointer dereference
Rafał Miłecki [Tue, 4 Oct 2022 10:04:37 +0000 (12:04 +0200)]
kernel: fix possible mtd NULL pointer dereference

Fixes: cae4d089bc1d3 ("kernel: backport mtd dynamic partition patch")
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit a5265497a4f6da158e95d6a450cb2cb6dc085cab)

2 years agotreewide: fix security issues by bumping all packages using libwolfssl
Petr Štetiar [Thu, 29 Sep 2022 16:45:40 +0000 (18:45 +0200)]
treewide: fix security issues by bumping all packages using libwolfssl

As wolfSSL is having hard time maintaining ABI compatibility between
releases, we need to manually force rebuild of packages depending on
libwolfssl and thus force their upgrade. Otherwise due to the ABI
handling we would endup with possibly two libwolfssl libraries in the
system, including the patched libwolfssl-5.5.1, but still have
vulnerable services running using the vulnerable libwolfssl-5.4.0.

So in order to propagate update of libwolfssl to latest stable release
done in commit ec8fb542ec3e4 ("wolfssl: fix TLSv1.3 RCE in uhttpd by
using 5.5.1-stable (CVE-2022-39173)") which fixes several remotely
exploitable vulnerabilities, we need to bump PKG_RELEASE of all
packages using wolfSSL library.

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

2 years agowolfssl: fix TLSv1.3 RCE in uhttpd by using 5.5.1-stable (CVE-2022-39173)
Petr Štetiar [Wed, 28 Sep 2022 09:28:06 +0000 (11:28 +0200)]
wolfssl: fix TLSv1.3 RCE in uhttpd by using 5.5.1-stable (CVE-2022-39173)

Fixes denial of service attack and buffer overflow against TLS 1.3
servers using session ticket resumption. When built with
--enable-session-ticket and making use of TLS 1.3 server code in
wolfSSL, there is the possibility of a malicious client to craft a
malformed second ClientHello packet that causes the server to crash.

This issue is limited to when using both --enable-session-ticket and TLS
1.3 on the server side. Users with TLS 1.3 servers, and having
--enable-session-ticket, should update to the latest version of wolfSSL.

Thanks to Max at Trail of Bits for the report and "LORIA, INRIA, France"
for research on tlspuffin.

Complete release notes https://github.com/wolfSSL/wolfssl/releases/tag/v5.5.1-stable

Fixes: CVE-2022-39173
Fixes: https://github.com/openwrt/luci/issues/5962
References: https://github.com/wolfSSL/wolfssl/issues/5629
Tested-by: Kien Truong <duckientruong@gmail.com>
Reported-by: Kien Truong <duckientruong@gmail.com>
Signed-off-by: Petr Štetiar <ynezz@true.cz>
(cherry picked from commit ec8fb542ec3e4f584444a97de5ac05dbc2a9cde5)

2 years agowolfssl: refresh patches
Petr Štetiar [Wed, 28 Sep 2022 09:58:22 +0000 (11:58 +0200)]
wolfssl: refresh patches

So they're tidy and apply cleanly.

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

2 years agowolfssl: bump to 5.5.0
Ivan Pavlov [Wed, 31 Aug 2022 05:04:42 +0000 (08:04 +0300)]
wolfssl: bump to 5.5.0

Remove upstreamed: 101-update-sp_rand_prime-s-preprocessor-gating-to-match.patch

Some low severity vulnerabilities fixed
OpenVPN compatibility fixed (broken in 5.4.0)
Other fixes && improvements

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

2 years agokernel: bump 5.10 to 5.10.146
John Audia [Wed, 28 Sep 2022 20:05:00 +0000 (16:05 -0400)]
kernel: bump 5.10 to 5.10.146

All patches automatically rebased.

Signed-off-by: John Audia <therealgraysky@proton.me>
(cherry picked from commit eed0a31b90e4feeb65f3b54853bd4db1f5bcd524)

2 years agokernel: bump 5.10 to 5.10.145
John Audia [Fri, 23 Sep 2022 20:58:05 +0000 (16:58 -0400)]
kernel: bump 5.10 to 5.10.145

Manually rebased:
  hack-5.10/780-usb-net-MeigLink_modem_support.patch

Removed upstreamed:
  patches-5.10/110-gpio-mpc8xxx-Fix-support-for-IRQ_TYPE_LEVEL_LOW-flow.patch[1]

All other patches automatically rebased.

1. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.10.145&id=24196210b198e8e39296e277bb93b362aa207775

Signed-off-by: John Audia <therealgraysky@proton.me>
(cherry picked from commit 8fe67fae1d619467b2b3300178d4309f17cfdb54)

2 years agokernel: bump 5.10 to 5.10.144
John Audia [Wed, 21 Sep 2022 11:52:34 +0000 (07:52 -0400)]
kernel: bump 5.10 to 5.10.144

All patches automatically rebased.

Signed-off-by: John Audia <therealgraysky@proton.me>
(cherry picked from commit eff4f8b2f0a2900c945c21c8183d1faa0ac35ec1)

2 years agoramips: fix switch setup for ASUS RT-AX53U
Matthias Schiffer [Mon, 3 Oct 2022 11:23:41 +0000 (13:23 +0200)]
ramips: fix switch setup for ASUS RT-AX53U

The device has only 1 WAN + 3 LAN ports. Remove "lan4" interface
corresponding to the non-existing port.

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
(cherry picked from commit 149fc3a269b435483b31df03d6fd9679286cf9e7)

2 years agouboot-mvebu: backport LibreSSL patches for older version of LibreSSL
Josef Schlehofer [Wed, 14 Sep 2022 13:23:45 +0000 (15:23 +0200)]
uboot-mvebu: backport LibreSSL patches for older version of LibreSSL

If you would like to compile the newest version of U-boot together with the stable
OpenWrt version, which does not have LibreSSL >= 3.5, which was updated
in the master branch by commit 5451b03b7ceb2315445c683fe174e28bbdd49c2f
("tools/libressl: bump to v3.5.3"), then you need these two patches to
fix it. They are backported from U-boot repository.

This should be backported to stable OpenWrt versions.

Reported-by: Michal Vasilek <michal.vasilek@nic.cz>
Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
(cherry picked from commit 185541f50ff59c0a5e0663ad612f0f5eb31926cf)

2 years agouboot-mvebu: backport patch to fix compilation on non glibc system
Josef Schlehofer [Wed, 14 Sep 2022 13:19:56 +0000 (15:19 +0200)]
uboot-mvebu: backport patch to fix compilation on non glibc system

This issue was reported by @paper42, who is using Void Linux with musl
to compile OpenWrt and its packages and found out it is not possible to
compile U-boot for Turris Omnia (neither any other).

It fixes following output:
```
  HOSTCC  tools/kwboot
tools/kwboot.c: In function 'kwboot_tty_change_baudrate':
tools/kwboot.c:662:6: error: 'struct termios' has no member named 'c_ospeed'
  662 |   tio.c_ospeed = tio.c_ispeed = baudrate;
      |      ^
tools/kwboot.c:662:21: error: 'struct termios' has no member named 'c_ispeed'
  662 |   tio.c_ospeed = tio.c_ispeed = baudrate;
      |                     ^
tools/kwboot.c:690:31: error: 'struct termios' has no member named 'c_ospeed'
  690 |  if (!_is_within_tolerance(tio.c_ospeed, baudrate, 3))
      |                               ^
tools/kwboot.c:693:31: error: 'struct termios' has no member named 'c_ispeed'
  693 |  if (!_is_within_tolerance(tio.c_ispeed, baudrate, 3))
      |
```

Tested-by: Michal Vasilek <michal.vasilek@nic.cz>
Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
(cherry picked from commit 9c7472950b01c5b3a461f4e29b3b62bac9e35b46)

2 years agoramips: enable LZMA loader to fix Linksys RE6500 boot
Mark King [Sun, 25 Sep 2022 20:53:52 +0000 (21:53 +0100)]
ramips: enable LZMA loader to fix Linksys RE6500 boot

At some point after 21.02.3 and before 22.03.0, the size limits of the
Linksys RE6500 were reached and prevent booting from the 22.03.0 release
or builds of current SNAPSHOT. This patch allows builds of master to boot
again and has been tested on my device.

Fixes: #8577
Signed-off-by: Mark King <mark@vemek.co>
(cherry picked from commit bf5b1a53d4ff3f1d742f9ece1ab16555280417ec)

2 years agotools/meson: backport WSL2 fix
Rosen Penev [Thu, 22 Sep 2022 22:41:28 +0000 (15:41 -0700)]
tools/meson: backport WSL2 fix

For some reason, Microsoft's Plan9 driver returns IOError on missing
file.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
(cherry picked from commit 875e17774bafb132a93d66f1d7b2c6a2deec2030)

2 years agofirmware: intel-microcode: update to 20220809
Christian Lamparter [Mon, 22 Aug 2022 08:35:28 +0000 (10:35 +0200)]
firmware: intel-microcode: update to 20220809

Debian's changelog by Henrique de Moraes Holschuh <hmh@debian.org>:

  * New upstream microcode datafile 20220809
    * Fixes INTEL-SA-00657, CVE-2022-21233
      Stale data from APIC leaks SGX memory (AEPIC leak)
    * Fixes unspecified errata (functional issues) on Xeon Scalable
    * Updated Microcodes:
      sig 0x00050653, pf_mask 0x97, 2022-03-14, rev 0x100015e, size 34816
      sig 0x00050654, pf_mask 0xb7, 2022-03-08, rev 0x2006e05, size 44032
      sig 0x000606a6, pf_mask 0x87, 2022-04-07, rev 0xd000375, size 293888
      sig 0x000706a1, pf_mask 0x01, 2022-03-23, rev 0x003c, size 75776
      sig 0x000706a8, pf_mask 0x01, 2022-03-23, rev 0x0020, size 75776
      sig 0x000706e5, pf_mask 0x80, 2022-03-17, rev 0x00b2, size 112640
      sig 0x000806c2, pf_mask 0xc2, 2022-03-19, rev 0x0028, size 97280
      sig 0x000806d1, pf_mask 0xc2, 2022-03-28, rev 0x0040, size 102400
      sig 0x00090672, pf_mask 0x03, 2022-06-07, rev 0x0022, size 216064
      sig 0x00090675, pf_mask 0x03, 2022-06-07, rev 0x0022, size 216064
      sig 0x000906a3, pf_mask 0x80, 2022-06-15, rev 0x0421, size 216064
      sig 0x000906a4, pf_mask 0x80, 2022-06-15, rev 0x0421, size 216064
      sig 0x000a0671, pf_mask 0x02, 2022-03-17, rev 0x0054, size 103424
      sig 0x000b06f2, pf_mask 0x03, 2022-06-07, rev 0x0022, size 216064
      sig 0x000b06f5, pf_mask 0x03, 2022-06-07, rev 0x0022, size 216064

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
(cherry picked from commit bb73828b89def128f26ae1cdff0d08569d261f1b)

2 years agotoolchain: Include ./include/fortify for external musl toolchain
Hauke Mehrtens [Sun, 11 Sep 2022 22:31:43 +0000 (00:31 +0200)]
toolchain: Include ./include/fortify for external musl toolchain

When building with an external toolcahin with musl also include
./include/fortify by default. This is also done when we build with the
internal toolchain using musl libc.

Without this extra include the fortify source feature is not working
when using an external musl toolchain. All binaries were compiled
without fortify source when an external musl toolchain was used. All
binaries release done by the OpenWrt project use the internal toolcahin
where fortify source is working.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit b21ddbfa18cd1e437e31dc0fa29408721a186c2a)

2 years agotoolchain: Select USE_SSTRIP with external musl toolchain
Hauke Mehrtens [Sun, 11 Sep 2022 22:29:00 +0000 (00:29 +0200)]
toolchain: Select USE_SSTRIP with external musl toolchain

When we use the internal toolchain USE_SSTRIP will be selected by
default for musl libc and USE_STRIP when glibc is used. Do the same when
an external toolchain is used. USE_GLIBC will also be set for external
toolchain builds based on the EXTERNAL_TOOLCHAIN_LIBC_USE_GLIBC setting.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit 9403810c020cca136149973a3929bf77a1f501aa)

2 years agoscripts: ext-toolchain: add support for musl
Christian Marangi [Sun, 17 Jul 2022 15:56:59 +0000 (17:56 +0200)]
scripts: ext-toolchain: add support for musl

Openwrt now supports only glibc and musl. Add support for musl and
rework the libc check to handle the new config flags and correctly
compile package basend on that.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
(cherry picked from commit 7be01fe13b4517e5edb8a4818f437d60144cdcb4)

2 years agoscripts: ext-toolchain: add support for info.mk in probe_cc
Christian Marangi [Sun, 17 Jul 2022 15:56:36 +0000 (17:56 +0200)]
scripts: ext-toolchain: add support for info.mk in probe_cc

Openwrt generate info.mk that contains the libc type. For probe_cc check
if the file exist and parse directly it for LIBC type.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
(cherry picked from commit 75311977f5ff64b491cb57ac713d75e0e410d786)

2 years agoscripts: ext-toolchain: actually probe libc type on config generation
Christian Marangi [Sun, 17 Jul 2022 15:53:58 +0000 (17:53 +0200)]
scripts: ext-toolchain: actually probe libc type on config generation

Currently we never call probe_cc before config generation, this cause
the script to never actually detect the correct libc type.
Call probe_cc before config generation to correctl set the .config file.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
(cherry picked from commit ddeabc75ebe3151ff7da302cb1aae702b3ad7eba)

2 years agoscripts: ext-toolchain: add option to overwrite config
Christian Marangi [Mon, 4 Jul 2022 16:22:18 +0000 (18:22 +0200)]
scripts: ext-toolchain: add option to overwrite config

It can be useful to overwrite an already generated config.
Option are simply added at the end of the config and make defconfig
will overwrite the relevant option with the new one.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
(cherry picked from commit f4dd18ca39c42a324e34633c8ee553717531bc3b)

2 years agoscripts: ext-toolchain: fix wrong prefix in print_config generation
Christian Marangi [Sun, 3 Jul 2022 00:20:11 +0000 (02:20 +0200)]
scripts: ext-toolchain: fix wrong prefix in print_config generation

The parsed prefix in print_config is wrong and this produce broken
generated .config that won't work with any external toolchain.

Currently the prefix from a CC of

'arm-openwrt-linux-muslgnueabi-gcc-12.1.0'

produce a prefix

'arm-openwrt-linux-muslgnueabi-gcc-'

This is wrong as the real prefix should be

'arm-openwrt-linux-muslgnueabi-'

This is probably caused by a change in how the toolchain is now handled
that now append also the gcc version. Probably in ancient days the
version wasn't part of the name and the prefix generation stripped the
'-gcc' instead of the gcc version.

Fix this and correctly strip the gcc version and the gcc suffix to
correctly call toolchain bins.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
(cherry picked from commit 53c293262fce844c8291ab82e6726a8489d3c57b)

2 years agorules_mk: don't include wrapped bin with external toolchains
Christian Marangi [Sun, 3 Jul 2022 00:06:21 +0000 (02:06 +0200)]
rules_mk: don't include wrapped bin with external toolchains

Don't add wrapped bin to the TARGET_PATH as it does cause compilation
error.

cmake.mk will use the "command -v" and will use the wrapped bin instead
of the external toolchain bin as they have the same name and command
will select the first result.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
(cherry picked from commit a90eabf60255773231ed0259e5da5eb6a36fe9ce)

2 years agorules_mk: use gcc versions for external toolchain
Vincent Wiemann [Mon, 28 Dec 2020 15:00:13 +0000 (16:00 +0100)]
rules_mk: use gcc versions for external toolchain

When using the OpenWrt toolchain as an external toolchain the build
failed due to missing LTO support. By choosing the GCC wrappers of
the tools this commit makes sure that the LTO-enabled executables
are being used.

Signed-off-by: Vincent Wiemann <vincent.wiemann@ironai.com>
[ wrap the commit description to 72 char ]
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
(cherry picked from commit 2555ffb4536e2727465e9a0d426ad3c4f1ef003a)

2 years agobcm53xx: backport clk driver fix for DT nodes names
Rafał Miłecki [Thu, 29 Sep 2022 03:51:25 +0000 (05:51 +0200)]
bcm53xx: backport clk driver fix for DT nodes names

It allows dropping downstream patch renaming DT nodes.

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

2 years agoath79: fix LibreRouter-v1 watchdog and poe_pass
Santiago Piccinini [Fri, 30 Sep 2022 13:44:04 +0000 (10:44 -0300)]
ath79: fix LibreRouter-v1 watchdog and poe_pass

Watchdog and poe_passthrough gpios require the jtag disabled.

Signed-off-by: Santiago Piccinini <spiccinini@altermundi.net>
(cherry picked from commit 2ad949b11dbaa4c634868d55a4452d5a558776bd)

2 years agobuild: fix warnings from grep
Chris Osgood [Thu, 15 Sep 2022 12:09:38 +0000 (08:09 -0400)]
build: fix warnings from grep

Fixes build warnings when using newer versions of grep.

Signed-off-by: Chris Osgood <chris_github@functionalfuture.com>
Tested-by: Georgi Valkov <gvalkov@gmail.com>
(cherry picked from commit c5e167e0d6075c46ca92c30b425c4dcb05fec5ed)
[ fix conflict error ]
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2 years agoMakefile: fix stray \ warnings with grep-3.8
Nick Hainke [Sun, 11 Sep 2022 06:15:52 +0000 (08:15 +0200)]
Makefile: fix stray \ warnings with grep-3.8

We simply grep for "/usr". So no need for "-E" or "\/". Furthermore, in
the new grep versions this creates warnings.

As written in the grep-3.8 announcement:
  Regular expressions with stray backslashes now cause warnings, as
  their unspecified behavior can lead to unexpected results.
  For example, '\a' and 'a' are not always equivalent
  <https://bugs.gnu.org/39678>.

Fixes warnings in the form of:
  grep: warning: stray \ before /

Signed-off-by: Nick Hainke <vincent@systemli.org>
(cherry picked from commit a29d3bc48c40c6a2a93ae1806bea2ac26455cdbb)
[ fix conflict error ]
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2 years agobuild: fix issues with targets installed via feeds
Felix Fietkau [Tue, 27 Sep 2022 11:39:12 +0000 (13:39 +0200)]
build: fix issues with targets installed via feeds

- fix including modules.mk when a target is being replaced
- fix calling make targets from target/linux

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

2 years agobuild: fix including modules.mk for targets pulled in from feeds
Felix Fietkau [Sun, 18 Sep 2022 04:27:09 +0000 (06:27 +0200)]
build: fix including modules.mk for targets pulled in from feeds

Fixes: ebc36ebb2349 ("scripts/feeds: install targets to target/linux/feeds and support overriding")
Signed-off-by: Felix Fietkau <nbd@nbd.name>
(cherry-picked from commit 00094efec33f07c9dc16cce23be492430c40b3cc)

2 years agompc85xx: add patch to fix gpio mpc8xxx
Josef Schlehofer [Tue, 6 Sep 2022 11:17:02 +0000 (13:17 +0200)]
mpc85xx: add patch to fix gpio mpc8xxx

Backports Linux kernel patch [1] for kernel 5.10 where it applies cleanly.
This was tested on CZ.NIC Turris 1.1 router running OpenWrt 22.03
release.

Before:

- In /var/log/messages:
```
[   16.392988] lm90 0-004c: cannot request IRQ 48
[   16.398280] lm90: probe of 0-004c failed with error -22
```

- Sensors does not work:
```
root@turris:~# sensors
No sensors found!
Make sure you loaded all the kernel drivers you need.
Try sensors-detect to find out which these are.
```

After:

```
root@turris:/# sensors
sa56004-i2c-0-4c
Adapter: MPC adapter (i2c@3000)
temp1:        +44.0°C  (low  =  +0.0°C, high = +70.0°C)
                       (crit = +85.0°C, hyst = +75.0°C)
temp2:        +73.8°C  (low  =  +0.0°C, high = +70.0°C)  ALARM (HIGH)
                       (crit = +85.0°C, hyst = +75.0°C)
```

[1] https://lore.kernel.org/linux-gpio/20220906105431.30911-1-pali@kernel.org/

Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
(cherry picked from commit 2f496c34b6dfbedbfbff8d2ade5d629f096e40bd)
(c&p commit ID from openwrt's master)
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2 years agoramips: fix fw_setsys
Wenli Looi [Mon, 1 Aug 2022 03:23:22 +0000 (03:23 +0000)]
ramips: fix fw_setsys

This change was included in the original pull request but later omitted
for some reason:

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

Signed-off-by: Wenli Looi <wlooi@ucalgary.ca>
(cherry picked from commit 4cccea02a60aee0dd77c4db35672c92e2fe384a1)

2 years agokernel: add missing symbol
Stijn Tintel [Sat, 2 Apr 2022 20:41:27 +0000 (23:41 +0300)]
kernel: add missing symbol

Enabling KERNEL_KPROBES exposes KERNEL_BPF_KPROBE_OVERRIDE. Add a build
option for it to fix build failures with KERNEL_KPROBES enabled.

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
(cherry picked from commit 500c37c56ff60b46c30bb0ea7c92676bea23331a)

2 years agobcm4908: fix -EPROBE_DEFER support in bcm4908_enet
Rafał Miłecki [Wed, 21 Sep 2022 07:24:47 +0000 (09:24 +0200)]
bcm4908: fix -EPROBE_DEFER support in bcm4908_enet

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

2 years agokernel: update U-Boot NVMEM driver
Rafał Miłecki [Wed, 21 Sep 2022 07:24:45 +0000 (09:24 +0200)]
kernel: update U-Boot NVMEM driver

1. Fix casting
2. Support DT-defined variables

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

2 years agobcm4908: backport mtd parser for Broadcom's U-Boot partition
Rafał Miłecki [Wed, 21 Sep 2022 07:24:41 +0000 (09:24 +0200)]
bcm4908: backport mtd parser for Broadcom's U-Boot partition

Broadcom's U-Boot contains environment data blocks. They need to be
found (offsets aren't predefined) to access env variables.

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

2 years agomediatek: fix Unifi 6LR network config
Stijn Tintel [Tue, 20 Sep 2022 16:27:34 +0000 (19:27 +0300)]
mediatek: fix Unifi 6LR network config

When the v1 and v2 variants of the U6LR were introduced, the board
network config was not adapted to the new device names. Due to this, the
wrong network config is applied during initial boot. The resulting
config has lan, wan and a switch, while this device only has a single
ethernet interface without a switch.

Fix this by using a wildcard that matches all the variants.

Fixes: 15a02471bb85 ("mediatek: new target mt7622-ubnt-unifi-6-lr-v1")
Fixes: 5c8d3893a78f ("mediatek: new target ubnt_unifi-6-lr-v1-ubootmod")
Fixes: 31d86a1a1192 ("mediatek: add Ubiquiti UniFi 6 LR v2 targets")
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
Acked-by: Daniel Golle <daniel@makrotopia.org>
(cherry picked from commit 117f41ee95ec445dce5ab9332bc27a6311747c0d)

2 years agompc85xx: fix unset kernel symbols
David Bauer [Tue, 20 Sep 2022 19:08:23 +0000 (21:08 +0200)]
mpc85xx: fix unset kernel symbols

Signed-off-by: David Bauer <mail@david-bauer.net>
2 years agomac80211: rt2x00: experimental improvements for MT7620 wifi
Daniel Golle [Thu, 28 Jul 2022 11:40:12 +0000 (13:40 +0200)]
mac80211: rt2x00: experimental improvements for MT7620 wifi

Serge Vasilugin reports:

To improve mt7620 built-in wifi performance some changes:
1. Correct BW20/BW40 switching (see comments with mark (1))
2. Correct TX_SW_CFG1 MAC reg from v3 of vendor driver see
https://gitlab.com/dm38/padavan-ng/-/blob/master/trunk/proprietary/rt_wifi/rtpci/3.0.X.X/mt76x2/chips/rt6352.c#L531
3. Set bbp66 for all chains.
4. US_CYC_CNT init based on Programming guide, default value was 33 (pci),
   set chipset bus clock with fallback to cpu clock/3.
5. Don't overwrite default values for mt7620.
6. Correct some typos.
7. Add support for external LNA:
    a) RF and BBP regs never be corrected for this mode
    b) eLNA is driven the same way as ePA with mt7620's pin PA
but vendor driver explicitly pin PA to gpio mode (for forrect calibration?)
so I'm not sure that request for pa_pin in dts-file will be enough

First 5 changes (really 2) improve performance for boards w/o eLNA/ePA.
Changes 7 add support for eLNA

Configuration w/o eLAN/ePA and with eLNA show results
tx/rx (from router point of view) for each stream:
 35-40/30-35 Mbps for HT20
 65-70/60-65 Mbps for HT40

Yes. Max results for 2T2R client is 140-145/135-140
with peaks 160/150, It correspond to mediatek driver results.
Boards with ePA untested.

Reported-by: Serge Vasilugin <vasilugin@yandex.ru>
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
[directly include v3 of the patchset submitted upstream]
(cherry picked from commit 31a6605de04218e1c04bd5c2436c24d7d1c07506)
(cherry picked from commit e785ca05e9f0502894772f5df92192b816ba5d7c)
(cherry picked from commit 412fcf3d4400f84551f3ead0514834c62d94a251)

2 years agomac80211: rt2x00: fix typo
Sungbo Eo [Mon, 31 Jan 2022 17:53:59 +0000 (02:53 +0900)]
mac80211: rt2x00: fix typo

Add missing semicolon and refresh patches.

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
(cherry picked from commit d826c91704d2baa5e389c225791740e4c61d62c4)

2 years agomac80211: add patch descriptions to rt2x00 patches
Daniel Golle [Mon, 12 Sep 2022 20:21:05 +0000 (21:21 +0100)]
mac80211: add patch descriptions to rt2x00 patches

Prepare patches for sending upstream by adding patch descriptions
generated from the original OpenWrt commits adding each patch.

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

2 years agomediatek: fix ledbar of UniFi 6 LR when running custom U-Boot
Daniel Golle [Sun, 11 Sep 2022 19:24:05 +0000 (20:24 +0100)]
mediatek: fix ledbar of UniFi 6 LR when running custom U-Boot

The RGB LED of the UniFi 6 LR v1 doesn't work when using the Openwrt-
built U-Boot. This is because the vendor loader resets the ledbar
controller while our U-Boot doesn't care.
Add reset-gpio so the ledbar driver in Linux will always reset the
ledbar controller.

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

2 years agoramips: add support for Ubiquiti UniFi FlexHD
Sven Wegener [Sat, 1 May 2021 11:51:51 +0000 (13:51 +0200)]
ramips: add support for Ubiquiti UniFi FlexHD

Hardware
--------

- SoC: MediaTek MT7621AT with 128 MiB RAM and 32 MiB Flash
- Wi-Fi: MediaTek MT7603 (b/g/n, 2x2) and MediaTek MT7615 (ac, 4x4)
- Bluetooth: CSR8811 (internal USB, install kmod-bluetooth)

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

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

2. Update the bootloader environment.

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

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

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

   $ cat /proc/mtd

5. Set the bootselect flag to boot from kernel0

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

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

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

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

Signed-off-by: Sven Wegener <sven.wegener@stealer.net>
(cherry picked from commit 820f0c07c544652c1c53a45262a481ac5dbe139b)

2 years agoath79: Make patches apply again
Daniel Golle [Sun, 18 Sep 2022 14:38:47 +0000 (15:38 +0100)]
ath79: Make patches apply again

The patch adding support for LEDs connected to a reset controller did
not apply any more, refresh it on top of current master.

Fixes: 53fc987b2552 ("generic: move ledbar driver from mediatek target")
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
(cherry picked from commit 76fc277917fc847892dbbf525aea9f90a035d296)

2 years agogeneric: move ledbar driver from mediatek target
Sven Wegener [Mon, 2 May 2022 20:13:14 +0000 (22:13 +0200)]
generic: move ledbar driver from mediatek target

This moves the ledbar driver to generic, to be also used by the ramips target.

Signed-off-by: Sven Wegener <sven.wegener@stealer.net>
(cherry picked from commit 53fc987b25524c28525313347f0e2e5653dce43c)

2 years agomediatek: add led count
Sven Wegener [Sat, 12 Jun 2021 19:56:22 +0000 (21:56 +0200)]
mediatek: add led count

The LEDs connected to the MCU are so-called smart LEDs and their signal is
daisy-chained. Because of this, the MCU needs to be told how many LEDs are
connected. It also means the LEDs could be individually controlled, if the MCU
has a command for this.

Signed-off-by: Sven Wegener <sven.wegener@stealer.net>
(cherry picked from commit 76198e8f09a607c6aca2621f59d7a4cd7f6653e3)

2 years agomediatek: add initialization after reset
Sven Wegener [Sat, 12 Jun 2021 19:56:22 +0000 (21:56 +0200)]
mediatek: add initialization after reset

During GPIO initialization the pin state flips and triggers a reset of
the ledbar MCU. It needs to be moved through an initialization sequence
before working correctly.

Signed-off-by: Sven Wegener <sven.wegener@stealer.net>
(cherry picked from commit 013a956f086dc5d88f6e9cbd852ed4d900d436e0)

2 years agomediatek: add support for reset gpio
Sven Wegener [Sat, 12 Jun 2021 19:56:22 +0000 (21:56 +0200)]
mediatek: add support for reset gpio

Some versions of the ledbar MCU have a reset pin. It needs to be
correctly initialized or we might keep the MCU in reset state.

Signed-off-by: Sven Wegener <sven.wegener@stealer.net>
(cherry picked from commit 84e4bbf5f049cdb862eb25c446bd6973ed4238aa)

2 years agomediatek: support reading more than one byte of response
Sven Wegener [Sat, 12 Jun 2021 19:56:21 +0000 (21:56 +0200)]
mediatek: support reading more than one byte of response

There are commands that return more than one byte of response.

Signed-off-by: Sven Wegener <sven.wegener@stealer.net>
(cherry picked from commit 7c852e7df50e370b26b060c96c3cc4491cee88eb)

2 years agomediatek: cast literal value to char
Sven Wegener [Sat, 12 Jun 2021 19:56:21 +0000 (21:56 +0200)]
mediatek: cast literal value to char

Or the comparison against a signed char is always true, because the
literal 0xaa is treated as an unsigned int, to which the signed char is
casted during comparison. 0xaa is above the positive values of a signed
char and negative signed char values result in values larger than 0xaa
when casted to unsigned int.

Signed-off-by: Sven Wegener <sven.wegener@stealer.net>
(cherry picked from commit e9a22ce2535c4a0faf83d5595304fe0e2c7bd1b2)

2 years agomediatek: correctly log i2c response
Sven Wegener [Sat, 12 Jun 2021 19:56:21 +0000 (21:56 +0200)]
mediatek: correctly log i2c response

The read response is in the i2c_response variable. Also use %hhx format,
because we're dealing with a single char.

Signed-off-by: Sven Wegener <sven.wegener@stealer.net>
(cherry picked from commit c4f9f9b44c82ffeacd9d3c00ba07171c35831337)

2 years agomediatek: remove gpiod_direction_output()
Sven Wegener [Sat, 12 Jun 2021 19:56:21 +0000 (21:56 +0200)]
mediatek: remove gpiod_direction_output()

It's already set to output with GPIOD_OUT_LOW.

Signed-off-by: Sven Wegener <sven.wegener@stealer.net>
(cherry picked from commit a188356484f434c72ea536d91d7f93f59c562eb5)

2 years agomediatek: do not use gpiod_set_raw_value()
Sven Wegener [Sat, 12 Jun 2021 19:56:21 +0000 (21:56 +0200)]
mediatek: do not use gpiod_set_raw_value()

The polarity of the signal is set in the device dts.

Signed-off-by: Sven Wegener <sven.wegener@stealer.net>
(cherry picked from commit 56c2d15587dfe5285f1cf3bfb236c827bc446465)

2 years agokernel: modules: package kmod-crypto-essiv
Daniel Golle [Sun, 11 Sep 2022 13:26:25 +0000 (14:26 +0100)]
kernel: modules: package kmod-crypto-essiv

Package kernel module providing ESSIV support for block encryption.

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

2 years agomediatek: fix typo in bpi-r64 image recipe
Daniel Golle [Thu, 8 Sep 2022 18:29:44 +0000 (19:29 +0100)]
mediatek: fix typo in bpi-r64 image recipe

Janusz Dziedzic reported a typo introduced by a recent commit. Fix it.

Fixes: 50c892d67b ("mediatek: bpi-r64: make initramfs/recovery optional")
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
(cherry picked from commit 007c8809c1e888748af70c1b878f4d0105fe7531)

2 years agomediatek: bpi-r64: make initramfs/recovery optional
Daniel Golle [Thu, 8 Sep 2022 01:44:30 +0000 (02:44 +0100)]
mediatek: bpi-r64: make initramfs/recovery optional

Only include recovery image in SD card image generated for the
BananaPi BPi-R64 if building with CONFIG_TARGET_ROOTFS_INITRAMFS
This allows to build images larger than 32 MB (the limit for
initramfs/recovery image) by deselecting initramfs.

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

2 years agoramips: fix GB-PC1 and GB-PC2 LEDs
Arınç ÜNAL [Wed, 14 Sep 2022 18:30:59 +0000 (21:30 +0300)]
ramips: fix GB-PC1 and GB-PC2 LEDs

Add the missing LEDs for GB-PC2. Some of these LEDs don't exist on the
device schematics. Tests on a GB-PC2 by me and Petr proved otherwise.

Remove ethblack-green and ethblue-green LEDs for GB-PC1. They are not wired
to GPIO 3 or 4 and the wiring is currently unknown.

Set ethyellow-orange to display link state and activity of the ethyellow
interface for GB-PC2.

Link: https://github.com/ngiger/GnuBee_Docs/blob/master/GB-PCx/Documents/GB-PC2_V1.1_schematic.pdf
Tested-by: Petr Louda <petr.louda@outlook.cz>
Signed-off-by: Arınç ÜNAL <arinc.unal@arinc9.com>
(cherry picked from commit 2a6ef7f53d7b96e4ee0200196c28ed6b0a7c8465)

2 years agowireless-regdb: update to 2022-08-12
Nick Hainke [Sat, 17 Sep 2022 06:05:47 +0000 (08:05 +0200)]
wireless-regdb: update to 2022-08-12

Changes:
9dc9c89 wireless-regdb: update regulatory database based on preceding changes
442bc25 wireless-regdb: update 5 GHz rules for PK and add 60 GHz rule
daee7f3 wireless-regdb: add 5 GHz rules for GY

Signed-off-by: Nick Hainke <vincent@systemli.org>
(cherry picked from commit 1d2d69c810261308652a577fc136e7327e0e1358)

2 years agokernel: bump 5.10 to 5.10.143
John Audia [Thu, 15 Sep 2022 13:56:36 +0000 (09:56 -0400)]
kernel: bump 5.10 to 5.10.143

All patches automatically rebased.

Signed-off-by: John Audia <therealgraysky@proton.me>
(cherry picked from commit b77217d916ba48accbdb46589e6e5e3a9972c44e)

2 years agokernel: bump 5.10 to 5.10.142
John Audia [Thu, 8 Sep 2022 10:19:20 +0000 (06:19 -0400)]
kernel: bump 5.10 to 5.10.142

All patches automatically rebased.

Signed-off-by: John Audia <therealgraysky@proton.me>
(cherry picked from commit 837fd23c80b22c566b40181a28630ac29af8f96e)

2 years agokernel: bump 5.10 to 5.10.141
John Audia [Mon, 5 Sep 2022 10:47:34 +0000 (06:47 -0400)]
kernel: bump 5.10 to 5.10.141

All patches automatically rebased.

Signed-off-by: John Audia <therealgraysky@proton.me>
(cherry picked from commit e8a62a1e6040de71bdcb1be1a1c30c064acbc059)

2 years agokernel: bump 5.10 to 5.10.139
John Audia [Mon, 29 Aug 2022 15:30:27 +0000 (11:30 -0400)]
kernel: bump 5.10 to 5.10.139

All patches automatically rebased.

Signed-off-by: John Audia <therealgraysky@proton.me>
(cherry picked from commit e0753c5d5cef5b03c60601364188afb262ccd02e)

2 years agokernel: build crypto md5/sha1/sha256 modules for powerpc
Josef Schlehofer [Tue, 30 Aug 2022 07:02:32 +0000 (09:02 +0200)]
kernel: build crypto md5/sha1/sha256 modules for powerpc

This builds and enables kernel optimized modules for mpc85xx target:
- CONFIG_CRYPTO_MD5_PPC [1]
- CONFIG_CRYPTO_SHA1_PPC_SPE [2]
- CONFIG_CRYPTO_SHA256_PPC_SPE [3]

Where it was possible, then use Signal Processing Engine, because
CONFIG_SPE is already enabled in mpc85xx config.

[1] https://cateee.net/lkddb/web-lkddb/CRYPTO_MD5_PPC.html
[2] https://cateee.net/lkddb/web-lkddb/CRYPTO_SHA1_PPC.html
[3] https://cateee.net/lkddb/web-lkddb/CRYPTO_SHA256_PPC_SPE.html

Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
(cherry picked from commit 3a702f8733ff371f30e9e3ba1e1aed5f4686b6b4)

2 years agoscripts/download.pl: fix downloads with wget
Petr Štetiar [Tue, 13 Sep 2022 05:40:37 +0000 (07:40 +0200)]
scripts/download.pl: fix downloads with wget

Several users of wget for downloads (curl is not available in the
system) have reported broken download functionality:

 wget --tries=5 --timeout=20 --output-document=-  https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.10.142.tar.xz
 http://: Invalid host name.

Thats all happening due to '' was passed as an argument, which got later
expanded to http://.

In the context of a list constructor '' is not nothing, it is an empty
string element.  So fix it by using () as it will yield "nothing" and
thus not introduce an empty string element.

Fixes: #10692
Fixes: 90c6e3aedf16 ("scripts: always check certificates")
Signed-off-by: Jo-Philipp Wich <jo@mein.io> [shellwords() -> ()]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
(cherry picked from commit 50a48faa1b8424e6b4b436b7118fffa2cba14b18)

2 years agoscripts/download.pl: silence can't exec curl warning
Petr Štetiar [Tue, 13 Sep 2022 05:38:10 +0000 (07:38 +0200)]
scripts/download.pl: silence can't exec curl warning

When running build in verbose mode `make V=s` we can see a lot of
following warnings when curl is not available in the system:

 Can't exec "curl": No such file or directory at scripts/download.pl line 77.

So lets fix it by redirecting of the stderr to null hole.

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

2 years agoscripts: always check certificates
Josh Roys [Sat, 23 Jul 2022 15:23:16 +0000 (11:23 -0400)]
scripts: always check certificates

Remove flags from wget and curl instructing them to ignore bad server
certificates. Although other mechanisms can protect against malicious
modifications of downloads, other vectors of attack may be available
to an adversary.

TLS certificate verification can be disabled by turning oof the
"Enable TLS certificate verification during package download" option
enabled by default in the "Global build settings" in "make menuconfig"

Signed-off-by: Josh Roys <roysjosh@gmail.com>
[ add additional info on how to disable this option ]
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
(cherry picked from commit 90c6e3aedf167b0ae1baf376e7800a631681e69a)

2 years agotools: remove xxd package
Petr Štetiar [Tue, 30 Aug 2022 06:41:07 +0000 (08:41 +0200)]
tools: remove xxd package

It shouldn't be needed anymore as we've now `scripts/xxdi.pl`, which
should be self contained and fully compatible `xxd -i` replacement.

Fixes: #10555
Signed-off-by: Petr Štetiar <ynezz@true.cz>
(cherry picked from commit 88c9056a70901577489ecdc7a25207a9b7576d6e)

2 years agobuild: provide xxd -i with scripts/xxdi.pl
Petr Štetiar [Tue, 30 Aug 2022 06:45:39 +0000 (08:45 +0200)]
build: provide xxd -i with scripts/xxdi.pl

Dependency on xxd was added in commit c4dd2441e787 ("tools: add xxd
(from vim)") as U-Boot requires xxd to create the default environment
from an external file.

Later in commit 2b94aac7a128 ("tools: xxd: use more convenient source
tarball"), xxd from another source was used instead, but that source is
currently unavailable, so let's fix it by using simple xxdi.pl Perl
script instead.

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

2 years agoscripts: xxdi.pl: add xxd -i compat mode
Petr Štetiar [Tue, 30 Aug 2022 06:34:26 +0000 (08:34 +0200)]
scripts: xxdi.pl: add xxd -i compat mode

So it can serve as a standalone drop in replacement for xxd utility used
currently mostly in U-Boot packages with `xxd -i` mode which outputs C
include file style, with aim for byte to byte identical output, so the
eventual difference in the generated output is easily spottable.

Fixes: #10555
Signed-off-by: Petr Štetiar <ynezz@true.cz>
Signed-off-by: Jo-Philipp Wich <jo@mein.io> [perl-fu]
(cherry picked from commit 06e01e817ec6643a35beb9e6946689e9cc7d020a)

2 years agoscripts: xxdi.pl: remove File::Slurp dependency
Jo-Philipp Wich [Tue, 30 Aug 2022 16:20:04 +0000 (18:20 +0200)]
scripts: xxdi.pl: remove File::Slurp dependency

In order to make it more portable.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Signed-off-by: Petr Štetiar <ynezz@true.cz>
(cherry picked from commit 8b278a76d90e3724815a5fde32be59f7796be1d8)

2 years agoscripts: add xxdi.pl
Petr Štetiar [Tue, 30 Aug 2022 06:31:42 +0000 (08:31 +0200)]
scripts: add xxdi.pl

xxdi.pl is a Perl script that implements vim's 'xxd -i' mode so that
packages do not have to use all of vim just to get this functionality.

References: #10555
Source: https://github.com/gregkh/xxdi/blob/97a6bd5cee05d1b15851981ec38ef5a460ddfcb1/xxdi.pl
Signed-off-by: Petr Štetiar <ynezz@true.cz>
(cherry picked from commit 2117d04a3aaad3394c0afec799d9c43f8a09c2cf)

2 years agomac80211: backport tx queueing bugfixes add a bug fix for a rare crash
Felix Fietkau [Sat, 26 Mar 2022 23:05:49 +0000 (00:05 +0100)]
mac80211: backport tx queueing bugfixes add a bug fix for a rare crash

Re-introduce the queue wake fix that was reverted due to a regression,
but this time with the follow-up fixes that take care of the regression.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
(cherry picked from commit 9a93b62f315ad4c9f021c414ed80ba337ab4a01e)
(cherry-picked from commit 8b804cae5e039142bc63896a75f15146eca3bebc)
(cherry-picked from commit 8b06e06832ebe757246582b65306ad2a2537741f)

2 years agobcm53xx: update NVMEM driver for NVRAM
Rafał Miłecki [Wed, 14 Sep 2022 12:20:38 +0000 (14:20 +0200)]
bcm53xx: update NVMEM driver for NVRAM

Include support for NVMEM cells.

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

2 years agokernel: backport mtd dynamic partition patch
Christian Marangi [Wed, 29 Jun 2022 15:34:51 +0000 (17:34 +0200)]
kernel: backport mtd dynamic partition patch

Backport upstream solution that permits to declare nvmem cells with
dynamic partition defined by special parser.

This provide an OF node for NVMEM and connect it to the defined dynamic
partition.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit 1a9ee367343edce263f82cc91a49d796c9d45ea3)

2 years agoipq40xx: add GL-AP1300 label-mac-device
David Bauer [Sun, 11 Sep 2022 14:23:03 +0000 (16:23 +0200)]
ipq40xx: add GL-AP1300 label-mac-device

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

2 years agoipq40xx: add WAN LED mapping for GL-AP1300
David Bauer [Sat, 10 Sep 2022 12:05:34 +0000 (14:05 +0200)]
ipq40xx: add WAN LED mapping for GL-AP1300

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

2 years agorockchip: add system-LED aliases specific to OpenWrt
David Bauer [Fri, 9 Sep 2022 21:35:49 +0000 (23:35 +0200)]
rockchip: add system-LED aliases specific to OpenWrt

Add the aliases sections required to detect LEDs specific to OpenWrt
boot / update indication for the NanoPi R4S.

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

2 years agorockchip: ensure NanoPi R4S has unique MAC address
David Bauer [Fri, 9 Sep 2022 23:01:57 +0000 (01:01 +0200)]
rockchip: ensure NanoPi R4S has unique MAC address

Ensure the MAC address for all NanoPi R4S boards is assigned unique for
each board.

FriendlyElec ship two versions of the R4S: The standard as well as the
enterprise edition with only the enterprise edition including the EEPROM
chip that stores the unique MAC address.

In order to assign both board types unique MAC addresses, fall back on
the same method used for the NanoPi R2S in case the EEPROM chip is not
present by generating the board MAC from the SD card CID.

[0] https://wiki.friendlyelec.com/wiki/index.php/NanoPi_R4S#Differences_Between_R4S_Standard_Version_.26_R4S_Enterprise_Version

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

2 years agorealtek: fix RTL839x receive tag decoding
Bjørn Mork [Fri, 9 Sep 2022 06:28:13 +0000 (08:28 +0200)]
realtek: fix RTL839x receive tag decoding

The previous fixup was incomplete, and the offsets for the
queue and crc_error cpu_tag bitfields were still wrong on
RTL839x.

Fixes: 545c6113c93b ("realtek: fix RTL838x receive tag decoding")
Suggested-by: Jan Hoffmann <jan@3e8.eu>
Signed-off-by: Bjørn Mork <bjorn@mork.no>
2 years agoipq40xx: add LTE packages for GL-AP1300
David Bauer [Fri, 9 Sep 2022 16:14:08 +0000 (18:14 +0200)]
ipq40xx: add LTE packages for GL-AP1300

Add LTE packages required for operating the LTE modem optionally shipped
with the GL-AP1300.

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

2 years agoath79: add support for ZTE MF281
David Bauer [Mon, 5 Sep 2022 17:23:16 +0000 (19:23 +0200)]
ath79: add support for ZTE MF281

Add support for the ZTE MF281 battery-powered WiFi router.

Hardware
--------
SoC:    Qualcomm Atheros QCA9563
RAM:    128M DDR2
FLASH:  2M SPI-NOR (GigaDevice GD25Q16)
        128M SPI-NAND (GigaDevice)
WLAN:   QCA9563 2T2R 802.11 abgn
        QCA9886 2T2R 802.11 nac
WWAN:   ASRMicro ASR1826
ETH:    Qualcomm Atheros QCA8337
UART:   115200 8n1
        Unpopulated connector next to SIM slot
        (SIM) GND - RX - TX - 3V3
        Don't connect 3V3
BUTTON: Reset - WPS
LED:    1x debug-LED (internal)
        LEDs on front of the device are controlled
        using the modem CPU and can not be controlled
        by OpenWrt

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

1. Connect to the serial console. Power up the device and interrupt
   autoboot when prompted

2. Connect a TFTP server reachable at 192.168.1.66 to the ethernet port.
   Serve the OpenWrt initramfs image as "speedbox-2.bin"

3. Boot the initramfs image using U-Boot

   $ setenv serverip 192.168.1.66
   $ setenv ipaddr 192.168.1.154
   $ tftpboot 0x84000000 speedbox-2.bin
   $ bootm

4. Copy the OpenWrt factory image to the device using scp and write to
   the NAND flash

   $ mtd write /path/to/openwrt/factory.bin firmware

WWAN
----

The WWAN card can be used with OpenWrt. Example configuration for
connection with a unauthenticated dual-stack APN:

network.lte=interface
network.lte.proto='ncm'
network.lte.device='/dev/ttyACM0'
network.lte.pdptype='IPV4V6'
network.lte.apn='internet.telekom'
network.lte.ipv6='auto'
network.lte.delay='10'

The WWAN card is running a modified version of OpenWrt and handles
power-management as well as the LED controller (AW9523). A root shell
can be acquired by installing adb using opkg and executing "adb shell".

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

2 years agorealtek: fix RTL838x receive tag decoding
Bjørn Mork [Thu, 8 Sep 2022 17:35:34 +0000 (19:35 +0200)]
realtek: fix RTL838x receive tag decoding

Commit dc9cc0d3e2a1 ("realtek: add QoS and rate control") replaced a
16 bit reserved field in the RTL83xx packet header with the initial
cpu_tag word, shifting the real cpu_tag fields by one.  Adjusting for
this new shift was partially forgotten in the new RX tag decoders.

This caused the switch to block IGMP, effectively blocking IPv4
multicast.

The bug was partially fixed by commit 9d847244d9fd ("realtek: fix
RTL839X receive tag decoding")

Fix on RTL838x too, including correct NIC_RX_REASON_SPECIAL_TRAP value.

Suggested-by: Jan Hoffmann <jan@3e8.eu>
Fixes: dc9cc0d3e2a1 ("realtek: add QoS and rate control")
Signed-off-by: Bjørn Mork <bjorn@mork.no>
(cherry picked from commit 545c6113c93bbf7de1b0e515141a4565f7e6cece)

2 years agomt76: update to the latest version
Felix Fietkau [Tue, 6 Sep 2022 20:44:43 +0000 (22:44 +0200)]
mt76: update to the latest version

d70546462b7b mt76: fix 5 GHz connection regression on mt76x0/mt76x2

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

2 years agohostapd: rename hostapd multicast_to_unicast option to multicast_to_unicast_all
Felix Fietkau [Tue, 6 Sep 2022 10:12:12 +0000 (12:12 +0200)]
hostapd: rename hostapd multicast_to_unicast option to multicast_to_unicast_all

There are two feature currently altered by the multicast_to_unicast option.
1. bridge level multicast_to_unicast via IGMP snooping
2. hostapd/mac80211 config multicast_to_unicast setting

The hostapd/mac80211 setting has the side effect of converting *all* multicast
or broadcast traffic into per-station duplicated unicast traffic, which can
in some cases break expectations of various protocols.
It also has been observed to cause ARP lookup failure between stations
connected to the same interface.

The bridge level feature is much more useful, since it only covers actual
multicast traffic managed by IGMP, and it implicitly defaults to 1 already.

Renaming the hostapd/mac80211 option to multicast_to_unicast_all should avoid
unintentionally enabling this feature

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

2 years agobcm27xx: make NVMEM driver patch apply again
Rafał Miłecki [Sun, 4 Sep 2022 14:38:11 +0000 (16:38 +0200)]
bcm27xx: make NVMEM driver patch apply again

Fixes: 4efa0b70d54f1 ("kernel: backport U-Boot environment data NVMEM driver")
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2 years agobcm4908: enable NVMEM U-Boot env data driver
Rafał Miłecki [Wed, 17 Aug 2022 20:45:11 +0000 (22:45 +0200)]
bcm4908: enable NVMEM U-Boot env data driver

It's needed for devices with U-Boot bootloader.

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

2 years agokernel: backport U-Boot environment data NVMEM driver
Rafał Miłecki [Wed, 17 Aug 2022 18:44:52 +0000 (20:44 +0200)]
kernel: backport U-Boot environment data NVMEM driver

It parses U-Boot env data into NVMEM cells.

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

2 years agokernel: backport mtd patch adding of_platform_populate() calls
Rafał Miłecki [Fri, 8 Jul 2022 05:58:20 +0000 (07:58 +0200)]
kernel: backport mtd patch adding of_platform_populate() calls

This is required for non-parser drivers handling MTD devices.

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

2 years agoOpenWrt v22.03.0: revert to branch defaults
Hauke Mehrtens [Sat, 3 Sep 2022 16:49:08 +0000 (18:49 +0200)]
OpenWrt v22.03.0: revert to branch defaults

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2 years agoOpenWrt v22.03.0: adjust config defaults v22.03.0
Hauke Mehrtens [Sat, 3 Sep 2022 16:49:01 +0000 (18:49 +0200)]
OpenWrt v22.03.0: adjust config defaults

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2 years agouboot-mediatek: mt7622: suppress unwanted pinctrl warning
Daniel Golle [Sat, 3 Sep 2022 02:53:56 +0000 (03:53 +0100)]
uboot-mediatek: mt7622: suppress unwanted pinctrl warning

Import patch which removes the default pinctrl of uart0 to suppress
the unwanted warning. Apply also to downstream boards.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2 years agomediatek: mt7622: fix DTS compatible of UniFi 6 LR variants
Daniel Golle [Sat, 3 Sep 2022 01:24:14 +0000 (02:24 +0100)]
mediatek: mt7622: fix DTS compatible of UniFi 6 LR variants

Make sure the compatible string in DTS matches the now v1/v2
differentiated board name in target/linux/mediatek/image/mt7622.mk.

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

2 years agouboot-mediatek: backport fix for unstable UART on MT7622
Daniel Golle [Sat, 3 Sep 2022 00:57:08 +0000 (01:57 +0100)]
uboot-mediatek: backport fix for unstable UART on MT7622

Import pending patch "arm: dts: mt7622: force high-speed mode for uart"
from Weijie Gao <weijie.gao@mediatek.com> fixing the UART problems on
MT7622 which made it hard to use the U-Boot menu on devices with this
SoC.

This patch is also contained in commit
 c09eb08dad ("uboot-mediatek: add support for MT798x platforms")
in the development branch.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2 years agouboot-mediatek: no compression means IH_COMP_NONE
Daniel Golle [Mon, 15 Aug 2022 11:19:15 +0000 (13:19 +0200)]
uboot-mediatek: no compression means IH_COMP_NONE

Treat missing compression node in FIT image as IH_COMP_NONE.
This is implicentely already happening in most places, but for now
was still triggering an annoying warning about initramfs compression
being obsolete despite compression note being absent.
Fix this.

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

2 years agouboot-mediatek: fix factory reset on UBI
Daniel Golle [Sun, 28 Aug 2022 19:20:31 +0000 (20:20 +0100)]
uboot-mediatek: fix factory reset on UBI

Truncating a UBI volume using `ubi write 0x0 volname 0x0` results in
segfault on newer U-Boot. Write 1MB of 0s instead.

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