openwrt/staging/aparcar.git
22 months agotoolchain/nasm: update to 2.16.01
Linhui Liu [Sun, 25 Dec 2022 03:57:35 +0000 (11:57 +0800)]
toolchain/nasm: update to 2.16.01

ChangeLog:

 Version 2.16.01

       _This is a documentation update release only._

       (*) Fix the creation of the table of contents in the HTML version of
           the documentation.

 Version 2.16

       (*) Support for the `rdf' format has been discontinued and all the
           RDOFF utilities has been removed.

       (*) The `--reproducible' option now leaves the filename field in the
           COFF object format blank. This was always rather useless since
           it is only 18 characters long; as such debug formats have to
           carry their own filename information anyway.

       (*) Fix handling of MASM-syntax reserved memory (e.g. `dw ?') when
           used in structure definitions.

       (*) The preprocessor now supports functions, which can be less
           verbose and more convenient than the equivalent code implemented
           using directives. See section 4.4.

       (*) Fix the handling of `%00' in the preprocessor.

       (*) Fix incorrect handling of path names affecting error messages,
           dependency generation, and debug format output.

       (*) Support for the RDOFF output format and the RDOFF tools have
           been removed. The RDOFF tools had already been broken since at
           least NASM 2.14. For flat code the ELF output format
           recommended; for segmented code the `obj' (OMF) output format.

       (*) New facility: preprocessor functions. Preprocessor functions,
           which are expanded similarly to single-line macros, can greatly
           simplify code that in the past would have required a lengthy
           list of directives and intermediate macros. See section 4.4.

       (*) Single-line macros can now declare parameters (using a `&&'
           prefix) that creates a quoted string, but does _not_ requote an
           already quoted string. See section 4.2.1.

       (*) Instruction table updated per public information available as of
           November 2022.

       (*) All warnings in the preprocessor have now been assigned warning
           classes. See appendix A.

       (*) Fix the invalid use of `RELA'-type relocations instead of `REL'-
           type relocations when generating DWARF debug information for the
           `elf32' output format.

       (*) Fix the handling `at' in `istruc' when the structure contains
           local labels. See section 5.9.2.

       (*) When assembling with `--reproducible', don't encode the filename
           in the COFF header for the `coff', `win32' or `win64' output
           formats. The COFF header only has space for an 18-character
           filename, which makes this field rather useless in the first
           place. Debug output data, if enabled, is not affected.

       (*) Fix incorrect size calculation when using MASM syntax for non-
           byte reservations (e.g. `dw ?'.)

       (*) Allow forcing an instruction in 64-bit mode to have a (possibly
           redundant) REX prefix, using the syntax `{rex}' as a prefix.

       (*) Add a `{vex}' prefix to enforce VEX (AVX) encoding of an
           instruction, either using the 2- or 3-byte VEX prefixes.

       (*) The `CPU' directive has been augmented to allow control of
           generation of VEX (AVX) versus EVEX (AVX-512) instruction
           formats, see section 7.11.

       (*) Some recent instructions that previously have been only
           available using EVEX encodings are now also encodable using VEX
           (AVX) encodings. For backwards compatibility these encodings are
           not enabled by default, but can be generated either via an
           explicit `{vex}' prefix or by specifying either `CPU LATEVEX' or
           `CPU NOEVEX'; see section 7.11.

       (*) Document the already existing `%unimacro' directive. See section
           4.5.12.

       (*) Fix a code range generation bug in the DWARF debug format
           (incorrect information in the `DW_AT_high_pc' field) for the ELF
           output formats. This bug happened to cancel out with a bug in
           older versions of the GNU binutils linker, but breaks with other
           linkers and updated or other linkers that expect the spec to be
           followed.

       (*) Fix segment symbols with addends, e.g. `jmp _TEXT+10h:0' in
           output formats that support segment relocations, e.g. the `obj'
           format.

       (*) Fix various crashes and hangs on invalid input.

Signed-off-by: Linhui Liu <liulinhui36@gmail.com>
22 months agoramips: enable Wi-Fi LED support for Afoundry EW1200
Shiji Yang [Sat, 31 Dec 2022 12:51:16 +0000 (12:51 +0000)]
ramips: enable Wi-Fi LED support for Afoundry EW1200

Add LED properties to PCIe node to enable Wi-Fi LED support.

Signed-off-by: Shiji Yang <yangshiji66@qq.com>
22 months agoramips: enable Wi-Fi LED support for Zbtlink ZBT-WE1326
Shiji Yang [Sat, 31 Dec 2022 12:50:18 +0000 (12:50 +0000)]
ramips: enable Wi-Fi LED support for Zbtlink ZBT-WE1326

Add LED properties to PCIe node to enable Wi-Fi LED support.

Signed-off-by: Shiji Yang <yangshiji66@qq.com>
22 months agoramips: add basic support for tp-link er605-v2
Nikolay Martynov [Thu, 15 Dec 2022 01:26:38 +0000 (20:26 -0500)]
ramips: add basic support for tp-link er605-v2

This is a MT7621-based device with 128MB NAND flash, 256MB RAM, and a USB port.
The board has headers to attach console. In order for them to work two solder
bridges near those pads need to be made.

The defice has the following partition table:

```
0x000000000000-0x000000080000 : "u-boot"
0x000000080000-0x000000100000 : "u-boot-env"
0x000000100000-0x000000140000 : "factory"
0x000000140000-0x000007e00000 : "firmware"
0x000007e00000-0x000008000000 : "panic-ops"
```

`firmware` partition contains UBI volumes. Unfortunately I accidentally wiped
partition and I no longer have access to it.

`firmware` partition contains 'secondary' U-Boot which is run by 'first' u-boot.
It also contains various configuration partitions that include device info and
MAC address. There also seems to be 'primary' and 'backup' set of 'main' volumes.

U-boot has `mtkupgrade` command that just overrides data on firmware partitions.
Firmware file provided by TP-Link cannot be used with that command.

U-boot also has 'recovery' http server. Unfortunately I was not able to make it
work with manufacturer's firmware.

Manufacturer's firmware essentially contains multiple UBI volumes along with
'partition table'. Unfortunately I no longer can properly run manufacturer's
firmware so I cannot at the moment try to a support for building 'factory' images.

This patch adds support for initramfs image as well as sysupgrade image.

This seems to be pretty standard MT7621 board otherwise.

Things that work:
* network
* leds
* usb
* factory MAC detection

Signed-off-by: Nikolay Martynov <mar.kolya@gmail.com>
22 months agoramips: add missing LEDs to Asus RT-AX53U
Marian Sarcinschi [Thu, 22 Dec 2022 23:56:09 +0000 (01:56 +0200)]
ramips: add missing LEDs to Asus RT-AX53U

This patch adds the missing LEDs to Asus RT-AX53U.
Based on PR #10400 and patch provided in #11068
 - enable the two LEDs controlled by mt7915e for wireless;
 - add label to power LED so it works properly and fix formatting;
 - add the USB LED;
 - switch LEDs are best left to be controlled by hardware for now.

Co-Authored-By: Ivan Rozhuk <rozhuk.im@gmail.com>
Co-Authored-By: Shiji Yang <yangshiji66@qq.com>
Co-Authored-By: Hartmut Birr <e9hack@gmail.com>
Tested-by: Felix Baumann <felix.bau@gmx.de>
Tested-by: Marian Sarcinschi <znevna@gmail.com>
Signed-off-by: Marian Sarcinschi <znevna@gmail.com>
22 months agoCI: build: fix external toolchain use with release tag tests
Christian Marangi [Wed, 4 Jan 2023 18:26:16 +0000 (19:26 +0100)]
CI: build: fix external toolchain use with release tag tests

When a new tag for a release is created, the just checkout repo from
github actions will already have such tag locally created.

This will result in git fetch --tags failing with error rejecting the
remote tag with (would clobber existing tag).

Add -f option to overwrite any local tags and always fetch them from
remote.

Fixes: e24a1e6f6d7f ("CI: build: add support for external toolchains from stable branch")
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
22 months agoipq40xx: fix wlan mac address for Aruba AP-303H
Bjoern Dobe [Thu, 29 Dec 2022 17:19:37 +0000 (18:19 +0100)]
ipq40xx: fix wlan mac address for Aruba AP-303H

Assigns the correct mac address from nvmen to the wlan interfaces.
This Mac address corresponds to the label "Wireless MAC" on the device
and the stock firmware.
Removes duplicate entry of calibration variant for both radios.

Fixes: cfc13c44595d ("ipq40xx: utilize nvmem-cells for macs & (pre-)calibration data")
Reviewed-by: Robert Marko <robimarko@gmail.com>
Signed-off-by: Bjoern Dobe <bjoern@dobecom.de>
22 months agogeneric: 5.15: backport qca8k fixup for mgmt and mdio read/write
Christian Marangi [Tue, 3 Jan 2023 21:42:45 +0000 (22:42 +0100)]
generic: 5.15: backport qca8k fixup for mgmt and mdio read/write

Backport qca8k fixup for mgmt and mdio read/write for kernel 5.15 fixup
port dropping and configuration issue.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Reviewed-by: Robert Marko <robimarko@gmail.com>
22 months agogeneric: 5.10: backport Treat IPv4 segment's lowest address as unicast
Seth David Schoen [Tue, 3 Jan 2023 04:42:50 +0000 (20:42 -0800)]
generic: 5.10: backport Treat IPv4 segment's lowest address as unicast

Backport patch from kernel 5.14.

Treat only the highest, not the lowest, IPv4 address within a local
subnet as a broadcast address, as subnets do not need two different
broadcast addresses and networking documentation consistently prefers
the highest address as broadcast.

This patch was merged in upstream net-next tree in May 2021 at

https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git/commit/?id=94c821c74bf5

This eventually frees up one address per subnet. It matches behavior
suggested in our Internet-Draft, and also the default behavior of OpenBSD
and FreeBSD.

Signed-off-by: Seth David Schoen <schoen@loyalty.org>
22 months agokernel: bump 5.15 to 5.15.86
John Audia [Sat, 31 Dec 2022 15:29:53 +0000 (10:29 -0500)]
kernel: bump 5.15 to 5.15.86

Removed upstreamed:
  pending-5.15/101-Use-stddefs.h-instead-of-compiler.h.patch[1]
  ipq806x/patches-5.15/122-01-clk-qcom-clk-krait-fix-wrong-div2-functions.patch[2]
  bcm27xx/patches-5.15/950-0198-drm-fourcc-Add-packed-10bit-YUV-4-2-0-format.patch[3]

Manually rebased:
  ramips/patches-5.15/100-PCI-mt7621-Add-MediaTek-MT7621-PCIe-host-controller-.patch[4]

Added patch/backported:
  ramips/patches-5.15/107-PCI-mt7621-Add-sentinel-to-quirks-table.patch[5]

All other patches automatically rebased.

1. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.15.86&id=c160505c9b574b346031fdf2c649d19e7939ca11
2. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.15.86&id=a051e10bfc6906d29dae7a31f0773f2702edfe1b
3. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.15.86&id=ec1727f89ecd6f2252c0c75e200058819f7ce47a
4. Quilt gave this output when I applied the patch to rebase it:
% quilt push -f
Applying patch platform/100-PCI-mt7621-Add-MediaTek-MT7621-PCIe-host-controller-.patch
patching file arch/mips/ralink/Kconfig
patching file drivers/pci/controller/Kconfig
patching file drivers/pci/controller/Makefile
patching file drivers/staging/Kconfig
patching file drivers/staging/Makefile
patching file drivers/staging/mt7621-pci/Kconfig
patching file drivers/staging/mt7621-pci/Makefile
patching file drivers/staging/mt7621-pci/TODO
patching file drivers/staging/mt7621-pci/mediatek,mt7621-pci.txt
patching file drivers/staging/mt7621-pci/pci-mt7621.c
Hunk #1 FAILED at 1.
Not deleting file drivers/staging/mt7621-pci/pci-mt7621.c as content differs from patch
1 out of 1 hunk FAILED -- saving rejects to file drivers/staging/mt7621-pci/pci-mt7621.c.rej
patching file drivers/pci/controller/pcie-mt7621.c
Applied patch platform/100-PCI-mt7621-Add-MediaTek-MT7621-PCIe-host-controller-.patch (forced; needs refresh)

Upon inspecting drivers/staging/mt7621-pci/pci-mt7621.c.rej, it seems that
the original patch wants to delete drivers/staging/mt7621-pci/pci-mt7621.c
but upstream's version was not an exact match.  I opted to delete that
file.

5. Suggestion by hauke: https://github.com/torvalds/linux/commit/19098934f910b4d47cb30251dd39ffa57bef9523
"This patch is in upstream kernel, but it was backported to the old
staging driver in kernel 5.15."

Build system: x86_64
Build-tested: bcm2711/RPi4B, filogic/xiaomi_redmi-router-ax6000-ubootmod
Run-tested: bcm2711/RPi4B, filogic/xiaomi_redmi-router-ax6000-ubootmod

Signed-off-by: John Audia <therealgraysky@proton.me>
22 months agooxnas: sata_oxnas: use ata_link_err
Robert Marko [Sun, 1 Jan 2023 13:24:06 +0000 (14:24 +0100)]
oxnas: sata_oxnas: use ata_link_err

Kernel 5.15.86 has backported ("ata: libata: move ata_{port,link,dev}_dbg
to standard pr_XXX() macros") and this is now causing compilation errors
for oxnas SATA driver due to usage of ata_link_printk().

Upstream has migrated to using the appropriate
ata_link_{err, warn, notice, info} calls a while ago so its not affected.

Lets do the same for oxnas SATA driver and use ata_link_err() instead of
ata_link_printk().

Signed-off-by: Robert Marko <robimarko@gmail.com>
22 months agoocteontx: add 5.15 testing kernel
Nick Hainke [Mon, 3 Oct 2022 15:00:19 +0000 (17:00 +0200)]
octeontx: add 5.15 testing kernel

Add 5.15 as testing.

Refreshed:
- 0004-PCI-add-quirk-for-Gateworks-PLX-PEX860x-switch-with-.patch

Acked-by: Tim Harvey <tharvey@gateworks.com>
Signed-off-by: Nick Hainke <vincent@systemli.org>
22 months agoocteontx: 5.15: copy config
Nick Hainke [Mon, 3 Oct 2022 11:31:09 +0000 (13:31 +0200)]
octeontx: 5.15: copy config

Copy config from kernel 5.10 to kernel 5.15.

Signed-off-by: Nick Hainke <vincent@systemli.org>
22 months agozynq: add 5.15 testing kernel
Nick Hainke [Mon, 3 Oct 2022 10:32:06 +0000 (12:32 +0200)]
zynq: add 5.15 testing kernel

Enable testing kernel.

Reviewed-by: Luis Araneda <luaraneda@gmail.com>
Tested-by: Luis Araneda <luaraneda@gmail.com> (Digilent Zybo Z7-20)
Signed-off-by: Nick Hainke <vincent@systemli.org>
22 months agozynq: 5.15: copy config
Nick Hainke [Mon, 3 Oct 2022 07:08:17 +0000 (09:08 +0200)]
zynq: 5.15: copy config

Copy config from kernel 5.10 to kernel 5.15.

Signed-off-by: Nick Hainke <vincent@systemli.org>
22 months agoipq40xx: delete files used for building 5.10 kernel
Nick Hainke [Fri, 16 Sep 2022 12:21:31 +0000 (14:21 +0200)]
ipq40xx: delete files used for building 5.10 kernel

The kernel 5.15 now defaults. Remove unnecessary files.

Reviewed-by: Robert Marko <robimarko@gmail.com>
Signed-off-by: Nick Hainke <vincent@systemli.org>
22 months agobridger: update to the latest version
Felix Fietkau [Tue, 3 Jan 2023 12:28:05 +0000 (13:28 +0100)]
bridger: update to the latest version

def7755c459d add missing copyright headers
f68307fd96d7 add hairpin mode support
9ee8f433ba4e nl: do not pass NDA_VLAN with vid=0
978c1f9eed07 add support for the bridge port isolated flag

Signed-off-by: Felix Fietkau <nbd@nbd.name>
22 months agorealtek: Migrate to libdeflate
Olliver Schinagl [Wed, 14 Dec 2022 14:16:33 +0000 (15:16 +0100)]
realtek: Migrate to libdeflate

Libdeflate is a more advanced gzip compressor, which allows for faster
decompression, higher compression speed (factor 3-4), while being fully
gzip compatible.

Some comparison
gzip    | libdeflate-gzip | delta  | image [openwrt-realtek-rtl839x-*]
--------+-----------------+--------+-----------------------------------------------
6589174 | 6298794         | 290380 | d-link_dgs-1210-52-initramfs-kernel.bin
6291632 | 6029488         | 262144 | d-link_dgs-1210-52-squashfs-factory_image1.bin
6292270 | 6030128         | 262142 | d-link_dgs-1210-52-squashfs-sysupgrade.bin
6589142 | 6298760         | 290382 | zyxel_gs1900-48-initramfs-kernel.bin
6292264 | 6030122         | 262142 | zyxel_gs1900-48-squashfs-sysupgrade.bin

and changing lzma to (libdeflate-)gzip on existing rtl930x target:
gzip    | libdeflate-gzip | delta  | image [openwrt-realtek-rtl930x-*]
--------+-----------------+--------+--------------------------------------
6816230 | 6510382         | 305848 | zyxel_xgs1250-12-initramfs-kernel.bin

Signed-off-by: Olliver Schinagl <oliver@schinagl.nl>
Reviewed-by: Robert Marko <robimarko@gmail.com>
Reviewed-by: Rosen Penev <rosenp@gmail.com>
Reviewed-by: Sander Vanheule <sander@svanheule.net>
22 months agotools: Add gzip-libdeflate advanced compressor
Markus Stockhausen [Tue, 26 Jul 2022 11:44:48 +0000 (13:44 +0200)]
tools: Add gzip-libdeflate advanced compressor

Several devices provide U-Boot versions with only gzip compressed kernel
support (e.g. Realtek switches). This compression method produces larger
images than lzma. To save space on flash and avoid going the hard way with
lzma-loader we can make use of enhanced gzip tool based on libdeflate
compression library from https://github.com/ebiggers/libdeflate. It
keeps 100% deflate/gzip compatibility while improving compression ratio.
The image can be unpacked by the default inflate routines inside U-Boot.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
[Switched to v1.15 and made it work with cmake]
Signed-off-by: Olliver Schinagl <oliver@schinagl.nl>
Reviewed-by: Robert Marko <robimarko@gmail.com>
Reviewed-by: Rosen Penev <rosenp@gmail.com>
Reviewed-by: Sander Vanheule <sander@svanheule.net>
22 months agorealtek: Disable boston clock
Olliver Schinagl [Tue, 13 Dec 2022 15:35:37 +0000 (16:35 +0100)]
realtek: Disable boston clock

We are not on the 'boston' platform so no point in having that clock
driver enabled.

Signed-off-by: Olliver Schinagl <oliver@schinagl.nl>
22 months agotreewide: Trigger reinstall of all wolfssl dependencies
Hauke Mehrtens [Sat, 31 Dec 2022 18:32:41 +0000 (19:32 +0100)]
treewide: Trigger reinstall of all wolfssl dependencies

The ABI of the wolfssl library changed a bit between version 5.5.3 and
5.5.4. This release update will trigger a rebuild of all packages which
are using wolfssl to make sure they are adapted to the new ABI.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
22 months agowolfssl: update to 5.5.4-stable
Nick Hainke [Thu, 29 Dec 2022 22:11:37 +0000 (23:11 +0100)]
wolfssl: update to 5.5.4-stable

Remove upstreamed:
- 001-Fix-enable-devcrypto-build-error.patch

Refresh patch:
- 100-disable-hardening-check.patch

Release notes:
https://github.com/wolfSSL/wolfssl/releases/tag/v5.5.4-stable

Signed-off-by: Nick Hainke <vincent@systemli.org>
22 months agotoolchain/binutils: switch to version 2.39 by default
Hauke Mehrtens [Sun, 18 Dec 2022 22:43:10 +0000 (23:43 +0100)]
toolchain/binutils: switch to version 2.39 by default

This was build tested with all core packages on all targets
successfully.

This was run tested on the following systems:
* lantiq/xrx200 musl
* sunxi/cortex53 musl
* x86/64 musl
* x86/64 glibc

Some trusted firmware arm builds needed some fixes to build with
binutils 2.39, this was merged before.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
22 months agotoolchain/binutils: backport stable patches
Hauke Mehrtens [Sat, 31 Dec 2022 20:11:35 +0000 (21:11 +0100)]
toolchain/binutils: backport stable patches

Add the patches with real changes from the binutils 2.39 stable branch.
I am not aware that we ran into any of these problems, but I think it is
better to take the existing stable patches.

They were exported like this:
git format-patch binutils-2_39...origin/binutils-2_39-branch
I removed the patches changing the version numbers only.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
22 months agotfa-layerscape: Use trusted-firmware-a.mk
Hauke Mehrtens [Wed, 28 Dec 2022 00:11:45 +0000 (01:11 +0100)]
tfa-layerscape: Use trusted-firmware-a.mk

This converts the trusted firmware arm build Makefile to make use of
the common trusted-firmware-a.mk file. This also fixes the build with
binutils 2.39.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
22 months agoarm-trusted-firmware-mvebu: Use host flags for cryptest compilation
Hauke Mehrtens [Mon, 26 Dec 2022 23:28:03 +0000 (00:28 +0100)]
arm-trusted-firmware-mvebu: Use host flags for cryptest compilation

Without these changes it used the system LDFLAGS for the compilation of
the cryptopp library. This does not always work when we add
"-no-warn-rwx-segments" which is done to support binutils 2.39 inside of
OpenWrt.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
22 months agoarm-trusted-firmware-sunxi: Use common trusted-firmware-a.mk
Hauke Mehrtens [Mon, 26 Dec 2022 18:58:14 +0000 (19:58 +0100)]
arm-trusted-firmware-sunxi: Use common trusted-firmware-a.mk

Make use of the definitions from trusted-firmware-a.mk to build the
Trusted firmware arm. This fixes the build with binutils 2.39.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
22 months agoipq40xx: sysupgrade: allow flashing Linksys factory firmware
Tony Ambardar [Fri, 2 Dec 2022 02:00:30 +0000 (18:00 -0800)]
ipq40xx: sysupgrade: allow flashing Linksys factory firmware

Allow forced flashing of a factory firmware image, after checking for the
correct FIT magic header and Linksys board-specific footer. Details of the
footer are already described in scripts/linksys-image.sh.

This is convenient as it avoids using a TFTP server or OEM GUI, and allows
restoring OEM firmware or installing a "breaking" OpenWrt update (e.g DSA
migration and kernel repartition) directly from the command line.

Devices supported at this time include EA6350v3, EA8300, MR8300 and WHW01.

Reviewed-by: Robert Marko <robimarko@gmail.com>
Tested-by: Wyatt Martin <wawowl@gmail.com> # WHW01
Tested-by: Tony Ambardar <itugrok@yahoo.com> # EA6350v3
Signed-off-by: Tony Ambardar <itugrok@yahoo.com>
22 months agobase-files: stage2: add 'tail' to sysupgrade environment
Tony Ambardar [Sat, 3 Dec 2022 07:13:22 +0000 (23:13 -0800)]
base-files: stage2: add 'tail' to sysupgrade environment

This is used to access footer data in firmare files, and is simpler and
less error-prone than using 'dd' with calculated offsets.

Signed-off-by: Tony Ambardar <itugrok@yahoo.com>
22 months agoipq40xx: migrate Linksys WHW01 to DSA and re-enable
Tony Ambardar [Tue, 6 Dec 2022 03:38:45 +0000 (19:38 -0800)]
ipq40xx: migrate Linksys WHW01 to DSA and re-enable

Convert Linksys WHW01 network configuration to DSA and re-enable builds.

Reviewed-by: Robert Marko <robimarko@gmail.com>
Tested-by: Wyatt Martin <wawowl@gmail.com>
Signed-off-by: Wyatt Martin <wawowl@gmail.com>
Signed-off-by: Tony Ambardar <itugrok@yahoo.com>
22 months agoipq40xx: fix up Linksys WHW01 board name, device definition
Tony Ambardar [Tue, 6 Dec 2022 03:44:32 +0000 (19:44 -0800)]
ipq40xx: fix up Linksys WHW01 board name, device definition

Update the board name defined in DTS to match online documentation and the
name encoded into factory firmware. This helps supports flashing firmware
factory images using 'sysupgrade'.

Original WHW01 device definition assumes the rootfs IMAGE_SIZE is 33 MB
instead of the correct 74 MB, and defines factory images which include
extra adjustments/padding that do not match OEM factory images and may
cause problems flashing. Update image size and build recipe to fix these.

Suggested-by: Wyatt Martin <wawowl@gmail.com>
Signed-off-by: Tony Ambardar <itugrok@yahoo.com>
22 months agoipq40xx: re-enable EA6350v3, EA8300, MR8300 builds
Tony Ambardar [Thu, 1 Dec 2022 04:10:59 +0000 (20:10 -0800)]
ipq40xx: re-enable EA6350v3, EA8300, MR8300 builds

Raise the kernel size from 3 MB to 5 MB for EA6350v3, EA8300 and MR8300,
and correspondingly reduce the rootfs size by 2 MB:
  * modify partition definitions in related .dts files
  * modify device kernel/image sizes in generic.mk

Update to compat-version 2.0 to force factory image usage on sysupgrade,
noting the current version 1.1 is an unreleased update for DSA migration.

Also update the compat-version message, explaining the need to run one of
the following console commands to update U-Boot's kernel-size variable
before flashing the OpenWrt factory image.

    fw_setenv kernsize 500000          # (OpenWrt command line)

    setenv kernsize 500000 ; saveenv   # (U-Boot serial console)

Finally, re-enable the 3 devices.

Reviewed-by: Robert Marko <robimarko@gmail.com>
Tested-by: Nicolas TORMO <badulesia.granieri@gmail.com> # MR8300
Tested-by: Tony Ambardar <itugrok@yahoo.com> # EA6350v3
Signed-off-by: Tony Ambardar <itugrok@yahoo.com>
22 months agombedtls: update to version 2.28.2
Hauke Mehrtens [Thu, 29 Dec 2022 20:26:28 +0000 (21:26 +0100)]
mbedtls: update to version 2.28.2

Changelog: https://github.com/Mbed-TLS/mbedtls/releases/tag/v2.28.2
This release of Mbed TLS provides bug fixes and minor enhancements. This
release includes fixes for security issues.

Fixes the following CVEs:
* CVE-2022-46393: Fix potential heap buffer overread and overwrite in
DTLS if MBEDTLS_SSL_DTLS_CONNECTION_ID is enabled and
MBEDTLS_SSL_CID_IN_LEN_MAX > 2 * MBEDTLS_SSL_CID_OUT_LEN_MAX.

* CVE-2022-46392: An adversary with access to precise enough information
about memory accesses (typically, an untrusted operating system
attacking a secure enclave) could recover an RSA private key after
observing the victim performing a single private-key operation if the
window size used for the exponentiation was 3 or smaller.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
22 months agomac80211: fix receiving multicast packets on multiple sta interfaces
Felix Fietkau [Fri, 30 Dec 2022 20:02:20 +0000 (21:02 +0100)]
mac80211: fix receiving multicast packets on multiple sta interfaces

Also fix MLO sta sdata link initialization

Signed-off-by: Felix Fietkau <nbd@nbd.name>
22 months agobcm47xx: replace "Devices-database-update-patch" with upstream patches
Nick Hainke [Tue, 27 Dec 2022 10:35:42 +0000 (11:35 +0100)]
bcm47xx: replace "Devices-database-update-patch" with upstream patches

Replace "320-MIPS-BCM47XX-Devices-database-update-for-4.x.patch" with
upstream patches:
- 320-v5.17-MIPS-BCM47XX-Add-board-entry-for-Linksys-WRT320N-v1.patch
- 321-v5.17-MIPS-BCM47XX-Add-support-for-Netgear-R6300-v1.patch
- 322-v5.17-MIPS-BCM47XX-Add-support-for-Netgear-WN2500RP-v1-v2.patch
- 323-v6.0-MIPS-BCM47XX-Add-support-for-Netgear-WNR3500L-v2.patch
- 324-v5.17-MIPS-BCM47XX-Add-LEDs-and-buttons-for-Asus-RTN-10U.patch
- 325-v5.17-MIPS-BCM47XX-Define-Linksys-WRT310N-V2-buttons.patch

Signed-off-by: Nick Hainke <vincent@systemli.org>
22 months agobcm47xx: add tags to upstreamed patches
Nick Hainke [Tue, 27 Dec 2022 10:22:18 +0000 (11:22 +0100)]
bcm47xx: add tags to upstreamed patches

All of the mtd patches are upstreamed to 5.18. Add tags indicating this.

Signed-off-by: Nick Hainke <vincent@systemli.org>
22 months agonetifd: update to the latest version
Felix Fietkau [Fri, 30 Dec 2022 15:42:03 +0000 (16:42 +0100)]
netifd: update to the latest version

2cffe0c44e62 treewide: correctly apply IFNAMSIZ limit
96bcbb2e4eb6 wireless: allow set_retry ubus notify command to trigger a wdev restart
a2e8cd75dbf6 wireless: add support for disabling multicast-to-unicast per virtual interface
e9f44189ade7 system: move netdev types to system-linux.c where they are used
a3fab0119ef1 utils: include utils.h last
7ce73fc16765 vlandev: propagate topology changes
81c1fbcba2f2 device: fix vlan device issues with disappearing lower devices

Signed-off-by: Felix Fietkau <nbd@nbd.name>
22 months agoCI: labeler: Add target label to target packages
Hauke Mehrtens [Thu, 29 Dec 2022 16:40:02 +0000 (17:40 +0100)]
CI: labeler: Add target label to target packages

This adds the target label also to changes in packages which are target
specific like the boot loader of a target or some drivers which are only
use on one target.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
22 months agoramips: enable BBT on NAND in I-O DATA devices
INAGAKI Hiroshi [Wed, 23 Nov 2022 08:12:29 +0000 (17:12 +0900)]
ramips: enable BBT on NAND in I-O DATA devices

This patch enables MediaTek NAND BBT on I-O DATA devices manufactured by
MSTC (MitraStar Technology Corp.).

[WN-AX2033GR]
Tested-by: Yanase Yuki <dev@zpc.sakura.ne.jp>
[WN-AX1167GR2, WN-DX1167R, WN-DX1200GR, WN-DX2033GR]
Tested-by: INAGAKI Hiroshi <musashino.open@gmail.com>
Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
22 months agomediatek: drop redmi-ax6000 variant with modified env
Chuanhong Guo [Fri, 30 Dec 2022 07:55:56 +0000 (15:55 +0800)]
mediatek: drop redmi-ax6000 variant with modified env

This variant uses xiaomi factory u-boot and modified u-boot-env &
bootcmd.
By modifying uboot-env, the xiaomi firmware recovery provided in
the vendor u-boot doesn't work anymore. It's possible to put
u-boot into a state where it refuese to take any serial input.
If the u-boot is in this state, users can't restore their
firmware without taking the flash off the board.
We now have a -stock variant where the vendor u-boot is used in
a way that xiaomi firmware recovery still works, and a -ubootmod
variant where we get rid of all xiaomi components, have more
usable space and no uart console lock. These two should cover all
use cases and we don't need this variant anymore.
Drop this redmi-ax6000 variant. Existing users of this variant
should perform a u-boot mod or restore to the -stock layout.

Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
22 months agoramips: Refresh patches
Hauke Mehrtens [Thu, 29 Dec 2022 18:01:15 +0000 (19:01 +0100)]
ramips: Refresh patches

The patch was not applying cleanly any more.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
22 months agotree-wide: Do not use package librt and libpthread
Hauke Mehrtens [Sun, 18 Dec 2022 16:32:46 +0000 (17:32 +0100)]
tree-wide: Do not use package librt and libpthread

The libraries libpthread, libdl, libutil, libanl have been integrated
into the libc library in version 2.34. it is not needed to explicitly
link them any more.

Most of the functions have been moved from the librt.so into libc.so
some time ago already.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
22 months agoipq40xx: convert Aruba AP-303H to DSA and enable target again
Nick Hainke [Wed, 21 Dec 2022 09:34:03 +0000 (10:34 +0100)]
ipq40xx: convert Aruba AP-303H to DSA and enable target again

The target was disabled since noone did the DSA conversion. Add the
conversion and enable it again.

Tested-by: John Walshaw <jjw@myself.com>
Signed-off-by: Bjoern Dobe <bjoern@dobecom.de>
Signed-off-by: Nick Hainke <vincent@systemli.org>
22 months agompc85xx: change CPU_TYPE from 8540 to 8548
Šimon Bořek [Wed, 15 Jun 2022 15:38:38 +0000 (17:38 +0200)]
mpc85xx: change CPU_TYPE from 8540 to 8548

All subtargets as p1010, p1020, p2020 uses e500v2 cores [1] [2] [3] [4],
 so let's force cpu type to 8545 for all mpc85xx target even though
there might exist device with e500v1, but there is no such router supported in OpenWrt
and because of that it does not make sense to to set CPU_TYPE for each subtarget.

All MPC85xx SoC can be found here:
https://www.nxp.com/products/processors-and-microcontrollers/legacy-mpu-mcus/powerquicc-processors:POWERQUICC_HOME#powerquicc-iii-mpc85xx

[1] https://www.nxp.com/docs/en/application-note/AN2807.pdf
[2] https://www.nxp.com/docs/en/fact-sheet/QP1010FS.pdf
[3] https://www.nxp.com/docs/en/product-brief/P1020PB.pdf
[4] https://www.nxp.com/docs/en/fact-sheet/QP20XXFS.pdf

Co-authored-by: Pali Rohár <pali@kernel.org>
Signed-off-by: Šimon Bořek <simon.borek@nic.cz>
22 months agompc85xx: add support for cpu type 8548
Šimon Bořek [Wed, 15 Jun 2022 15:31:39 +0000 (17:31 +0200)]
mpc85xx: add support for cpu type 8548

8540 cpu type corresponds to e500v1 core while
8548 cpu type corresponds to e500v2 core

See https://www.nxp.com/products/processors-and-microcontrollers/legacy-mpu-mcus/powerquicc-processors:POWERQUICC_HOME#powerquicc-iii-mpc85xx
and https://www.nxp.com/docs/en/application-note/AN2807.pdf .

Co-authored-by: Josef Schlehofer <josef.schlehofer@nic.cz>
Co-authored-by: Pali Rohár <pali@kernel.org>
Signed-off-by: Šimon Bořek <simon.borek@nic.cz>
22 months agolinux-firmware: disable stripping
Robert Marko [Wed, 28 Dec 2022 21:57:49 +0000 (22:57 +0100)]
linux-firmware: disable stripping

It has been brought to my attention that recently added WCN6855 firmware
is broken as it is getting stripped during building due to being 2 ELF
binaries.
I am sure WCN6750 and any other ELF binaries are having the same issue,
so since stripping firmware binaries is clearly unwanted disable it.

Fixes: b4d3694f81f4 ("linux-firmware: package ath11k consumer cards firmware")
Signed-off-by: Robert Marko <robimarko@gmail.com>
22 months agouboot-mediatek: add support for Xiaomi Redmi Router AX6000
Furong Xu [Thu, 22 Dec 2022 02:40:50 +0000 (10:40 +0800)]
uboot-mediatek: add support for Xiaomi Redmi Router AX6000

U-Boot flash instructions:

0. OpenWrt U-Boot does not support stock layout, it comes with recovery
boot support, automatic tftp recovery and never blocks UART.

A new flash layout is introduced, we call it OpenWrt U-Boot layout,
stock flash layout and the old OpenWrt layout are not supported.

During the whole flash procedure, please do not reboot or power off
unless requested explicitly, or you will break your device.

1. Your device should already running OpenWrt.
If not, follow the instructions to flash OpenWrt:
https://github.com/openwrt/openwrt/pull/11115

2. Backup BL2 Nvram Bdata Factory and FIP in case you break something or
in case you want to go back to stock firmware one day.

cat /dev/mtdblock0 > /tmp/BL2.bin
cat /dev/mtdblock1 > /tmp/Nvram.bin
cat /dev/mtdblock2 > /tmp/Bdata.bin
cat /dev/mtdblock3 > /tmp/Factory.bin
cat /dev/mtdblock4 > /tmp/FIP.bin

And save all whose bin files to somewhere safe.

Then backup your configurations, since ubiformat for entire mtd device is
required to create new ubootenv volume for OpenWrt U-Boot.

3. Run the following cmd to boot into an initramfs with the new OpenWrt
U-Boot layout that expand ubi partion to the end of flash:

ubiformat /dev/mtd7 -y -f /tmp/ax6000-ubootmod-initramfs-factory.ubi

4. After boot into initramfs, check mtd partion info.
The ubi partion should be mtd5

root@OpenWrt:~# cat /proc/mtd
dev:    size   erasesize  name
mtd0: 00100000 00020000 BL2
mtd1: 00040000 00020000 Nvram
mtd2: 00040000 00020000 Bdata
mtd3: 00200000 00020000 Factory
mtd4: 00200000 00020000 FIP
mtd5: 07a80000 00020000 ubi

5. Load kmod-mtd-rw to temporarily make the bootloader partions writable.
The kmod-mtd-rw is from the feeds, it is not packed in initramfs-factory
by default.

To install kmod-mtd-rw via opkg:

opkg update && opkg install kmod-mtd-rw

Or, download kmod-mtd-rw.ipk from OpenWrt server and install it manually
e.g:
https://downloads.openwrt.org/snapshots/targets/mediatek/filogic/kmods/
Select your OpenWrt release version and kernel version accordingly.

Load kmod-mtd-rw:
insmod /lib/modules/$(uname -r)/mtd-rw.ko i_want_a_brick=1

6. Run the following cmd to clean all pending crash dumps in pstore,
or OpenWrt U-Boot may boot into NAND recovery or tftp recovery.

rm -f /sys/fs/pstore/*

7. Format ubi and create new ubootenv volume:

ubidetach -p /dev/mtd5; ubiformat /dev/mtd5 -y; ubiattach -p /dev/mtd5
ubimkvol /dev/ubi0 -n 0 -N ubootenv -s 128KiB
ubimkvol /dev/ubi0 -n 1 -N ubootenv2 -s 128KiB

8. This is optional. Skip this if you do not want to have NAND recovery
boot feature offered by OpenWrt U-Boot. Don't worry, you always have
automatic tftp recovery feature enabled.

ubimkvol /dev/ubi0 -n 2 -N recovery -s 10MiB
ubiupdatevol /dev/ubi0_2 /tmp/ax6000-ubootmod-initramfs-recovery.itb

9. Now, flash new U-Boot. Bye-bye ugly stock U-Boot.

mtd write /tmp/ax6000-ubootmod-preloader.bin BL2
mtd write /tmp/ax6000-ubootmod-bl31-uboot.fip FIP

10. Flash the squashfs-sysupgrade.bin as usual:

sysupgrade -n /tmp/ax6000-ubootmod-squashfs-sysupgrade.itb

Enjoy!

Signed-off-by: Furong Xu <xfr@outlook.com>
22 months agomediatek: add new layout for Xiaomi Redmi Router AX6000 for OpenWrt U-Boot
Furong Xu [Thu, 22 Dec 2022 02:40:26 +0000 (10:40 +0800)]
mediatek: add new layout for Xiaomi Redmi Router AX6000 for OpenWrt U-Boot

This new layout is only bootable with OpenWrt U-Boot. It reuses the
two crash partions and expands the ubi partion to the end of whole flash.

Do not use this layout with stock U-Boot!

Signed-off-by: Furong Xu <xfr@outlook.com>
22 months agorealtek: deduplicate GS1900 recipes
Sander Vanheule [Wed, 28 Dec 2022 20:39:46 +0000 (21:39 +0100)]
realtek: deduplicate GS1900 recipes

ZyXEL GS1900 devices with SoCs from both the RTL838x and RTL839x
families share the same image structure and size of the firmware
partition. Additionally, the GS1900-48 recipe provided a parameter for
the zyxel-vers command, but this parameter is not used. Deduplicate the
recipes by moving it to target/linux/realtek/image/common.mk.

Signed-off-by: Sander Vanheule <sander@svanheule.net>
22 months agorealtek: fix GS1900-48 firwmare partition
Sander Vanheule [Wed, 28 Dec 2022 11:26:21 +0000 (12:26 +0100)]
realtek: fix GS1900-48 firwmare partition

The listed partition size doesn't match the original partition size, and
actually overlaps with the following partition. The partition node name
for the "firmware" partition also has an extra 'b' compared to the
partition offset.

Fixes: 47f5a0a3eed5 ("realtek: Add support for ZyXEL GS1900-48 Switch")
Signed-off-by: Sander Vanheule <sander@svanheule.net>
22 months agorealtek: fix ZYXELS_VERS for GS1900-48
Sander Vanheule [Tue, 27 Dec 2022 13:27:44 +0000 (14:27 +0100)]
realtek: fix ZYXELS_VERS for GS1900-48

The GS1900-48 firmware image is identified by the 'AAHN' ID, while the
GS1900-48HP is identified by 'AAHO' [1]. The latter was used, resulting
in the following error message when upgrading via the stock web UI:

  Device only can support firmware from V1.00(AAHN.0) and later version

Fix image generation by using the correct ID.

[1] https://download.zyxel.com/GS1900-48/firmware/GS1900-48_2.70(AAHN.3)C0_2.pdf

Link: https://forum.openwrt.org/t/146533
Fixes: 47f5a0a3eed5 ("realtek: Add support for ZyXEL GS1900-48 Switch")
Suggested-by: Stefan Lippers-Hollmann <s.l-h@gmx.de>
Signed-off-by: Sander Vanheule <sander@svanheule.net>
22 months agorealtek: fix default image generation
Sander Vanheule [Wed, 28 Dec 2022 20:46:48 +0000 (21:46 +0100)]
realtek: fix default image generation

While cleaning up the makefiles for the realtek target, the order of the
default image generating commands was accidentally changed. This caused
the image signature to end up somewhere in the middle, misaligning the
rootfs. As a result, sysupgrade couldn't verify upgrade images anymore,
and devices end up in a boot loop due to the unaligned (and not found)
rootfs.

Fixes: 94d8b4852b9f ("realtek: Cleanup Makefiles")
Signed-off-by: Sander Vanheule <sander@svanheule.net>
22 months agoath79: fix calibration-art for some boards
Nick Hainke [Tue, 20 Dec 2022 15:12:48 +0000 (16:12 +0100)]
ath79: fix calibration-art for some boards

"0x1000" looks suspicious. By looking at data provided
by @DragonBluep I was able to identify the correct size for
AR9380, AR9287 WiFis. Furthermore, PowerCloud Systems CAP324
has a AR9344 WiFi.

Signed-off-by: Nick Hainke <vincent@systemli.org>
22 months agolinux-firmware: ath11k: add symlink for WCN6855 hw2.1
Robert Marko [Wed, 28 Dec 2022 20:42:52 +0000 (21:42 +0100)]
linux-firmware: ath11k: add symlink for WCN6855 hw2.1

WCN6855 exists in 2 HW revisions, but both use the same FW so upstream
just has a symlink for hw2.1 to hw2.0 that I forgot to make.

Fixes: b4d3694f81f4 ("linux-firmware: package ath11k consumer cards firmware")
Signed-off-by: Robert Marko <robimarko@gmail.com>
22 months agolinux-firmware: update to 20221214
Nick Hainke [Sat, 24 Dec 2022 23:51:20 +0000 (00:51 +0100)]
linux-firmware: update to 20221214

Changes:
f3c283e amdgpu: updated navi10 firmware for amd-5.4
ba115d4 amdgpu: updated yellow carp firmware for amd-5.4
b8aba70 amdgpu: updated raven2 firmware for amd-5.4
2b21c5e amdgpu: updated raven firmware for amd-5.4
fc9a1c9 amdgpu: updated PSP 13.0.8 firmware for amd-5.4
7d43336 amdgpu: updated GC 10.3.7 RLC firmware for amd-5.4
c089dab amdgpu: updated vega20 firmware for amd-5.4
75e3494 amdgpu: updated PSP 13.0.5 firmware for amd-5.4
31c5734 amdgpu: add VCN 4.0.0 firmware for amd-5.4
a735158 amdgpu: add SMU 13.0.0 firmware for amd-5.4
0bef6bb amdgpu: Add SDMA 6.0.0 firmware for amd-5.4
bb56d1a amdgpu: add PSP 13.0.0 firmware for amd-5.4
e32209f amdgpu: add GC 11.0.0 firmware for amd-5.4
613db81 amdgpu: add DCN 3.2.0 firmware for amd-5.4
1fc8f6c amdgpu: updated vega10 firmware for amd-5.4
2257447 amdgpu: updated beige goby firmware for amd-5.4
6aa0023 amdgpu: updated dimgrey cavefish firmware for amd-5.4
dd1225a amdgpu: updated vangogh firmware for amd-5.4
5cb010e amdgpu: updated picasso firmware for amd-5.4
edf9699 amdgpu: updated navy flounder firmware for amd-5.4
b7e83d9 amdgpu: updated green sardine firmware for amd-5.4
f820cc3 amdgpu: updated sienna cichlid firmware for amd-5.4
b77f539 amdgpu: updated arcture firmware for amd-5.4
dccfdf1 amdgpu: updated navi14 firmware for amd-5.4
5d1af6d amdgpu: updated renoir firmware for amd-5.4
13b9c94 amdgpu: updated navi12 firmware for amd-5.4
e9b8357 amdgpu: updated aldebaran firmware for amd-5.4
b4af754 sr150 : Add NXP SR150 UWB firmware
0707b2f brcm: add/update firmware files for brcmfmac driver
16c9630 rtl_bt: Update RTL8821C BT(USB I/F) FW to 0x75b8_f098
80ed874 amdgpu: update sdma_5.2.7 firmware
32d8681 QCA: Add Bluetooth firmware for WCN785x This commit will add required Bluetooth firmware files for QCA WCN785x. The image version is 2.0.0-00515.
cdf9499 linux-firmware: update firmware for MT7916
685ea4d linux-firmware: update firmware for MT7915
7f6279b i915: Add DMC v2.08 for DG2
391fb47 amdgpu: update green sardine DMCUB firmware
de854c9 i915: Add DMC v2.10 for MTL
daff404 linux-firmware: update firmware for MT7986
70494e3 linux-firmware: update firmware for mediatek bluetooth chip (MT7921)
750c0dc linux-firmware: update firmware for MT7921 WiFi device

Signed-off-by: Nick Hainke <vincent@systemli.org>
22 months agokernel: fix ethernet regression on mt7986
Felix Fietkau [Wed, 28 Dec 2022 19:06:04 +0000 (20:06 +0100)]
kernel: fix ethernet regression on mt7986

Signed-off-by: Felix Fietkau <nbd@nbd.name>
22 months agouboot-envtools: add support for ramips Asus RX-AX53U
Felix Baumann [Mon, 26 Dec 2022 20:44:45 +0000 (21:44 +0100)]
uboot-envtools: add support for ramips Asus RX-AX53U

Adds uboot-envtools support for ramips Asus RX-AX53U now that partition
can be correctly read.

Signed-off-by: Felix Baumann <felix.bau@gmx.de>
[ improve commit title and description ]
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
22 months agoramips: add support for read/write uboot env to Asus RX-AX53U
Felix Baumann [Mon, 26 Dec 2022 20:40:43 +0000 (21:40 +0100)]
ramips: add support for read/write uboot env to Asus RX-AX53U

Add support for read/writing uboot env by renaming the second partition
to its stock label "nvram" and remove the deemed unnecessary
"read-only". Split the first partition "u-boot" in two, in order
to allow `fw_setenv` safe write-access to the uboot environment
variables.

This implements hauke's request from [1].
Based on the patch provided by Shiji Yang.

[1] https://github.com/openwrt/openwrt/pull/10400#discussion_r945153224

Co-Authored-By: Shiji Yang <yangshiji66@qq.com>
Signed-off-by: Felix Baumann <felix.bau@gmx.de>
[ improve commit title and description, fix some whitespace problem ]
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
22 months agorealtek: Fix reset register access
Birger Koblitz [Thu, 12 May 2022 18:40:45 +0000 (20:40 +0200)]
realtek: Fix reset register access

The reset register on RTL93xx not merely have bits to execute
a reset of a hardware component, but also configuration bits for
reset procedures. Keep them during executing a reset.

Signed-off-by: Birger Koblitz <git@birger-koblitz.de>
Signed-off-by: Olliver Schinagl <oliver@schinagl.nl>
[backport to 5.10 kernel]
Signed-off-by: Sander Vanheule <sander@svanheule.net>
22 months agobcm27xx: fix BCMGENET kernel config
Álvaro Fernández Rojas [Wed, 28 Dec 2022 12:40:03 +0000 (13:40 +0100)]
bcm27xx: fix BCMGENET kernel config

Revert backported upstream commits 421f8663b3a7 and 8d820bc9d12b, which have
introduced a regression in BCMGENET kconfig that disabled the network driver
for the Raspberry Pi.

Fixes: 0c405bceba11 ("kernel: bump 5.15 to 5.15.85")
Fixes: e9008223268c ("kernel: bump 5.15 to 5.15.84")
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
22 months agokernel: mediatek: fix WED offload regression on MT7622
Felix Fietkau [Tue, 27 Dec 2022 18:09:38 +0000 (19:09 +0100)]
kernel: mediatek: fix WED offload regression on MT7622

Fix dealing with DSA untagging offload

Signed-off-by: Felix Fietkau <nbd@nbd.name>
22 months agokernel: mediatek: improve ethernet fix for dealing with small fragments
Felix Fietkau [Tue, 27 Dec 2022 18:08:27 +0000 (19:08 +0100)]
kernel: mediatek: improve ethernet fix for dealing with small fragments

Replace the workaround on MT7986 with a proper fix. Software workaround is
still needed on older chips.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
22 months agohostapd: allow sharing the incoming DAS port across multiple interfaces
Felix Fietkau [Fri, 16 Dec 2022 12:32:48 +0000 (13:32 +0100)]
hostapd: allow sharing the incoming DAS port across multiple interfaces

Use the NAS identifier to find the right receiver context on incoming messages

Signed-off-by: Felix Fietkau <nbd@nbd.name>
22 months agorealtek: Reduce variable scopes
Olliver Schinagl [Thu, 22 Dec 2022 10:53:30 +0000 (11:53 +0100)]
realtek: Reduce variable scopes

Linus prefers to have loop initializers nice and tightly scoped. In
OpenWRT this has been possible since 41a1a652fbd4 ("kernel: backport
gnu11 upgrade").

This patch cleans up variable scope while trying to do the above for
'simple for loops'.

This cleans up and simplifies some functions and code, and pulls in
variables to a smaller scope.

Signed-off-by: Olliver Schinagl <oliver@schinagl.nl>
22 months agorealtek: Cleanup Makefiles
Olliver Schinagl [Wed, 21 Dec 2022 22:26:08 +0000 (23:26 +0100)]
realtek: Cleanup Makefiles

Our current Makefiles a little bit messy and can be improved somewhat,
both in whitespace and in style.

Signed-off-by: Olliver Schinagl <oliver@schinagl.nl>
22 months agorealtek: Replace C++ style comments
Olliver Schinagl [Thu, 22 Dec 2022 10:27:59 +0000 (11:27 +0100)]
realtek: Replace C++ style comments

The only exception to C++ style comments are SPDX license identifier
markers at the start of C files (even headers have C style markers).

Signed-off-by: Olliver Schinagl <oliver@schinagl.nl>
22 months agorealtek: Whitespace and codestyle cleanup
Olliver Schinagl [Tue, 30 Aug 2022 19:25:25 +0000 (21:25 +0200)]
realtek: Whitespace and codestyle cleanup

Fix some ugly whitepsaces and codestyle issues around the realtek sources.

While this is by no means perfect, it catches what it caught.

Signed-off-by: Olliver Schinagl <oliver@schinagl.nl>
22 months agorealtek: add cond_resched to loops accessing the FDB table
Jan Hoffmann [Sat, 17 Dec 2022 20:45:43 +0000 (21:45 +0100)]
realtek: add cond_resched to loops accessing the FDB table

A full loop accessing all FDB entries can take several milliseconds
(on RTL839x about 20 ms), so give other kernel tasks a chance to run.
This is especially important for rtl83xx_port_fdb_dump which is itself
called in a loop for all ports by the kernel.

Signed-off-by: Jan Hoffmann <jan@3e8.eu>
22 months agorealtek: restructure rtl_table_read/write
Jan Hoffmann [Sat, 17 Dec 2022 20:45:42 +0000 (21:45 +0100)]
realtek: restructure rtl_table_read/write

These two functions are identical apart from writing different values to
the read/write bit. Create a new function rtl_table_exec to reduce code
duplication.

Also replace the unbounded busy-waiting loop. The new implementation may
sleep, but as the hardware typically responds before the first poll, any
callers doing many table accesses still need to make sure not to block
other kernel tasks themselves.

So far, polling timeout errors are only handled by logging an error, but
a return value is added to allow proper handling in the future.

Signed-off-by: Jan Hoffmann <jan@3e8.eu>
22 months agorealtek: simplify log messages in rtl83xx_mdio_probe
Jan Hoffmann [Sat, 17 Dec 2022 20:45:41 +0000 (21:45 +0100)]
realtek: simplify log messages in rtl83xx_mdio_probe

This function currently prints three messages for every switch port at
KERN_INFO level. This takes a considerable amount of time during bootup
and can even trigger an external watchdog.

Replace these log messages by a single one at KERN_DEBUG level.

Signed-off-by: Jan Hoffmann <jan@3e8.eu>
22 months agorealtek: don't set L2LEARNING flag in rtl83xx TX header
Jan Hoffmann [Sat, 17 Dec 2022 20:39:40 +0000 (21:39 +0100)]
realtek: don't set L2LEARNING flag in rtl83xx TX header

As learning for the CPU port is now disabled globally, the bit in the
TX header doesn't have any effect anymore. Remove it to make the header
consistent with the global configuration.

Originally, this change was intended to be applied before commit
eb456aedfe24 ("realtek: use assisted learning on CPU port"), which is
why the commit message incorrectly mentions that the TX header already
disables learning.

The reason for disabling learning on the CPU port in the first place is
that it doesn't work correctly when packets are trapped to the CPU and
then forwarded by the CPU to other ports. In that case, the switch would
incorrectly learn the CPU port as source. An example that triggered this
issue are Multicast Listener Reports and IGMP membership reports.

Signed-off-by: Jan Hoffmann <jan@3e8.eu>
22 months agoiproute2: Fix build with GCC 12 and glibc 2.36
Hauke Mehrtens [Wed, 21 Dec 2022 22:32:23 +0000 (23:32 +0100)]
iproute2: Fix build with GCC 12 and glibc 2.36

This fixes the detection of name_to_handle_at() when GCC 12 and glibc
2.36 are used.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
22 months agouhttpd: update to latest Git HEAD
Hauke Mehrtens [Mon, 26 Dec 2022 12:58:47 +0000 (13:58 +0100)]
uhttpd: update to latest Git HEAD

2397755 client: fix incorrectly emitting HTTP 413 for certain content lengths

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
22 months agorules: drop -Wno-error additional flags from default TARGET_CFLAGS
Christian Marangi [Sun, 17 Jul 2022 11:26:14 +0000 (13:26 +0200)]
rules: drop -Wno-error additional flags from default TARGET_CFLAGS

We currently enable -Wno-error=unused-but-set-variable and
-Wno-error=unused-result by default on every compile package.

While this is (relatively) unharmful, we should follow other project
direction and starts enforcing good code quality. For example the linux
kernel recently started to enforce Wall by default and clean code is
mandatory for inclusion.

Drop for good these flags and and make it mandatory to correctly handle
return values at least with a warning log if they are not strictly error
condition.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
22 months agolibbsd: fix libpath to not use host path
Xuefer H [Sat, 24 Dec 2022 12:16:11 +0000 (20:16 +0800)]
libbsd: fix libpath to not use host path

libpath.so uses host path in ld script causing other packages fail to
cross compile, e.g. perl:
"ld: cannot find /usr/lib/libbsd.so.0.11.6: No such file or directory"

Fixes: openwrt/packages#19390
Signed-off-by: Xuefer H <xuefer@gmail.com>
22 months agodnsmasq: bump to v2.88
Kevin Darbyshire-Bryant [Mon, 17 Oct 2022 18:28:07 +0000 (19:28 +0100)]
dnsmasq: bump to v2.88

Most relevant feature for openwrt in this release, supports dynamically
removing hosts from 'hostsdir' supplied host files.

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
23 months agouboot-omap: build with omap generic subtarget
Kuan-Yi Li [Sat, 24 Dec 2022 20:06:38 +0000 (04:06 +0800)]
uboot-omap: build with omap generic subtarget

Fix image build fail by using the generic subtarget.

Fixes: b2bfea48 ("omap: add generic subtarget")
Ref: 40e3f660 ("uboot-fritz4040: build with ipq40xx generic subtarget")
Signed-off-by: Kuan-Yi Li <kyli@abysm.org>
[ add commit description ]
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
23 months agouboot-tegra: build with tegra generic subtarget
Kuan-Yi Li [Sat, 24 Dec 2022 20:06:26 +0000 (04:06 +0800)]
uboot-tegra: build with tegra generic subtarget

Fix image build fail by using the generic subtarget.

Fixes: c028e1b1 ("tegra: add generic subtarget")
Ref: 40e3f660 ("uboot-fritz4040: build with ipq40xx generic subtarget")
Signed-off-by: Kuan-Yi Li <kyli@abysm.org>
[ add commit description ]
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
23 months agouboot-zynq: build with zynq generic subtarget
Kuan-Yi Li [Sat, 24 Dec 2022 20:06:14 +0000 (04:06 +0800)]
uboot-zynq: build with zynq generic subtarget

Fix image build fail by using the generic subtarget.

Fixes: 6d7129ef ("zynq: add generic subtarget")
Ref: 40e3f660 ("uboot-fritz4040: build with ipq40xx generic subtarget")
Signed-off-by: Kuan-Yi Li <kyli@abysm.org>
[ add commit description ]
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
23 months agouboot-mxs: build with mxs generic subtarget
Kuan-Yi Li [Sat, 24 Dec 2022 20:06:03 +0000 (04:06 +0800)]
uboot-mxs: build with mxs generic subtarget

Fix image build fail by using the generic subtarget.

Fixes: 64ef920b ("mxs: add generic subtarget")
Ref: 40e3f660 ("uboot-fritz4040: build with ipq40xx generic subtarget")
Signed-off-by: Kuan-Yi Li <kyli@abysm.org>
[ add commit description ]
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
23 months agouboot-kirkwood: build with kirkwood generic subtarget
Kuan-Yi Li [Sat, 24 Dec 2022 20:05:03 +0000 (04:05 +0800)]
uboot-kirkwood: build with kirkwood generic subtarget

Fix image build fail by using the generic subtarget.

Fixes: cada395a ("kirkwood: add generic subtarget")
Ref: 40e3f660 ("uboot-fritz4040: build with ipq40xx generic subtarget")
Signed-off-by: Kuan-Yi Li <kyli@abysm.org>
[ add commit description ]
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
23 months agosunxi: ensure NanoPi R1 has unique MAC address
Jan-Niklas Burfeind [Fri, 23 Dec 2022 21:03:14 +0000 (22:03 +0100)]
sunxi: ensure NanoPi R1 has unique MAC address

Ensure the MAC address for all NanoPi R1 boards is assigned uniquely for
each board.

The vendor ships the device in two variants; one with and one without
eMMC; but both without static mac-addresses.
In order to assign both board types unique MAC addresses, fall back on
the same method used for the NanoPi R2S and R4S 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_R1#Hardware_Spec

Similar too and based on:

commit b5675f500daf ("rockchip: ensure NanoPi R4S has unique MAC address")

Co-authored-by: David Bauer <mail@david-bauer.net>
Signed-off-by: Jan-Niklas Burfeind <git@aiyionpri.me>
23 months agokernel: bump 5.10 to 5.10.161
John Audia [Wed, 21 Dec 2022 19:19:12 +0000 (14:19 -0500)]
kernel: bump 5.10 to 5.10.161

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>
23 months agokernel: bump 5.15 to 5.15.85
John Audia [Wed, 21 Dec 2022 19:13:53 +0000 (14:13 -0500)]
kernel: bump 5.15 to 5.15.85

All patches automatically rebased.

Build system: x86_64
Build-tested: bcm2711/RPi4B
Run-tested: bcm2711/RPi4B

Signed-off-by: John Audia <therealgraysky@proton.me>
23 months agomac80211: Do not build brcmsmac on bcm47xx_legacy
Hauke Mehrtens [Sat, 24 Dec 2022 13:39:17 +0000 (14:39 +0100)]
mac80211: Do not build brcmsmac on bcm47xx_legacy

brcmsmac needs bcma. bcma is build into the kernel for the other bcm47xx
subtargets, but not for the legacy target because it only uses ssb. We
could build bcma as a module for bcm47xx_legacy, but none of these old
devices uses a wifi card supported by brcsmac.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
23 months agompc85xx: drop empty patch as it backported to LTS kernel 5.15.70
Josef Schlehofer [Thu, 22 Dec 2022 18:37:36 +0000 (19:37 +0100)]
mpc85xx: drop empty patch as it backported to LTS kernel 5.15.70

This patch is part of Linux kernel 5.15.70, the content was removed, but
the empty file is still being carried over the repository, so remove it
once for all

Fixes: e1b009c ("kernel: bump 5.15 to 5.15.70")
Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
23 months agoCI: tools: reogranize and split workflow
Christian Marangi [Fri, 9 Dec 2022 17:09:32 +0000 (18:09 +0100)]
CI: tools: reogranize and split workflow

Generilize tools workflow for future usage in shared workflow for tools
build.

Split tools workflow to tools and push-containers:
- tools just execute build test
- push-containers build and push prebuilt containers

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
23 months agorealtek: 5.15: Fix incorrect switch patches
Olliver Schinagl [Mon, 3 Oct 2022 12:45:21 +0000 (14:45 +0200)]
realtek: 5.15: Fix incorrect switch patches

Add correct header to patche(s) to be correctly used
by git am and have better tracking of it.

See commit f1f97db627b2 ("realtek: Convert incorrect v5.10 patches").

Signed-off-by: Olliver Schinagl <oliver@schinagl.nl>
23 months agorealtek: 5.10: Fix incorrect switch patches
Olliver Schinagl [Mon, 3 Oct 2022 12:45:21 +0000 (14:45 +0200)]
realtek: 5.10: Fix incorrect switch patches

Add correct header to patche(s) to be correctly used
by git am and have better tracking of it.

See commit f1f97db627b2 ("realtek: Convert incorrect v5.10 patches").

Signed-off-by: Olliver Schinagl <oliver@schinagl.nl>
23 months agotools: Improve diffability/maintainability
Olliver Schinagl [Wed, 14 Dec 2022 10:33:01 +0000 (11:33 +0100)]
tools: Improve diffability/maintainability

There's no purpose to squish multiple tools into a single line (and
spread those out over multiple lines). It might look 'nice' in certain
conditions, but it's annoying to maintain.

For example, but not limited to:
* adding/removing tools, causes hard to read diffs
* Duplicates are harder to spot
* Sorting can not be (easily?) automated

With this proposed change, the above annoyances go away. Inserting a new
tool can be done with a single line-change-diff, sorting can be done by
any editor (in vi, select, :sort for example) and dupes are much easier
to spot.

Signed-off-by: Olliver Schinagl <oliver@schinagl.nl>
23 months agoomap: add generic subtarget
Christian Marangi [Mon, 19 Dec 2022 15:47:35 +0000 (16:47 +0100)]
omap: add generic subtarget

Same game as for 853e4dd3062df7cb5704b15d6af6730e3194b571. Add generic
to the filenames.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
23 months agopistachio: add generic subtarget
Christian Marangi [Mon, 19 Dec 2022 15:47:16 +0000 (16:47 +0100)]
pistachio: add generic subtarget

Same game as for 853e4dd3062df7cb5704b15d6af6730e3194b571. Add generic
to the filenames.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
23 months agoocteontx: add generic subtarget
Christian Marangi [Mon, 19 Dec 2022 15:46:56 +0000 (16:46 +0100)]
octeontx: add generic subtarget

Same game as for 853e4dd3062df7cb5704b15d6af6730e3194b571. Add generic
to the filenames.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
23 months agotegra: add generic subtarget
Christian Marangi [Mon, 19 Dec 2022 15:46:44 +0000 (16:46 +0100)]
tegra: add generic subtarget

Same game as for 853e4dd3062df7cb5704b15d6af6730e3194b571. Add generic
to the filenames.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
23 months agozynq: add generic subtarget
Christian Marangi [Mon, 19 Dec 2022 15:46:24 +0000 (16:46 +0100)]
zynq: add generic subtarget

Same game as for 853e4dd3062df7cb5704b15d6af6730e3194b571. Add generic
to the filenames.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
23 months agomxs: add generic subtarget
Christian Marangi [Mon, 19 Dec 2022 15:46:10 +0000 (16:46 +0100)]
mxs: add generic subtarget

Same game as for 853e4dd3062df7cb5704b15d6af6730e3194b571. Add generic
to the filenames.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
23 months agokirkwood: add generic subtarget
Christian Marangi [Mon, 19 Dec 2022 15:45:39 +0000 (16:45 +0100)]
kirkwood: add generic subtarget

Same game as for 853e4dd3062df7cb5704b15d6af6730e3194b571. Add generic
to the filenames.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
23 months agogemini: add generic subtarget
Christian Marangi [Mon, 19 Dec 2022 15:45:11 +0000 (16:45 +0100)]
gemini: add generic subtarget

Same game as for 853e4dd3062df7cb5704b15d6af6730e3194b571. Add generic
to the filenames.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
23 months agoath25: add generic subtarget
Christian Marangi [Mon, 19 Dec 2022 15:44:29 +0000 (16:44 +0100)]
ath25: add generic subtarget

Same game as for 853e4dd3062df7cb5704b15d6af6730e3194b571. Add generic
to the filenames.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
23 months agoramips: Fix drivers/pwm/pwm-mediatek-ramips.c compile
Hauke Mehrtens [Thu, 22 Dec 2022 23:33:44 +0000 (00:33 +0100)]
ramips: Fix drivers/pwm/pwm-mediatek-ramips.c compile

The pwmchip_remove() function returns void now. Fix a compile problem in
the drivers/pwm/pwm-mediatek-ramips.c driver.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>