openwrt/staging/wigyori.git
4 months agokernel: mtd: ubi: avoid attaching "linux,ubi" mtd again main
Shiji Yang [Fri, 21 Jun 2024 13:56:23 +0000 (13:56 +0000)]
kernel: mtd: ubi: avoid attaching "linux,ubi" mtd again

"linux,ubi" compatible MTD device can be automatically attached early
since commit fc153aa8d94f. Therefore, there is no need to attach MTD
devices named "ubi" or "data" again.

Signed-off-by: Shiji Yang <yangshiji66@qq.com>
4 months agoe2fsprogs: remove HostBuild
Rosen Penev [Wed, 26 Jun 2024 21:41:28 +0000 (14:41 -0700)]
e2fsprogs: remove HostBuild

These things already get built and installed by tools/e2fsprogs. No need
to duplicate.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/15822
Signed-off-by: Robert Marko <robimarko@gmail.com>
4 months agobmips: backport upstreamed RAC patches
Christian Marangi [Tue, 25 Jun 2024 09:19:41 +0000 (11:19 +0200)]
bmips: backport upstreamed RAC patches

Replace downstream bmips RAC fixes with upstream patches.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
[backport upstream patches]
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
4 months agoipq806x: 6.6: enable at803x driver
Bryan Berg [Wed, 22 May 2024 02:45:45 +0000 (19:45 -0700)]
ipq806x: 6.6: enable at803x driver

Used by ethernet interfaces on AP3935i.

Signed-off-by: Bryan Berg <bdb@north-eastham.org>
Link: https://github.com/openwrt/openwrt/pull/13629
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
4 months agoipq806x: ap3935: Use rgmii-id mode for LAN1
Bryan Berg [Sat, 18 May 2024 23:29:28 +0000 (16:29 -0700)]
ipq806x: ap3935: Use rgmii-id mode for LAN1

Fix issue with LAN1 interface on ap3935 devices, where the LAN
1interface won't come up after boot unless the bootloader has
initialized the network stack. Use of `fixed-link` in the prior code
kept the driver from clobbering PHY settings, but now that the driver
supports rgmii-id phy-mode, we can just use that.

Signed-off-by: Bryan Berg <bdb@north-eastham.org>
Link: https://github.com/openwrt/openwrt/pull/13629
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
4 months agoipq806x: ap3935: Use gmac0 mdio controller
Bryan Berg [Sat, 18 May 2024 23:27:19 +0000 (16:27 -0700)]
ipq806x: ap3935: Use gmac0 mdio controller

Updates ap3935 target to use the mdio controller built-in to gmac0,
rather than having the SoC bit-bang mdio from gpio pins

Signed-off-by: Bryan Berg <bdb@north-eastham.org>
Link: https://github.com/openwrt/openwrt/pull/13629
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
4 months agotools: util-linux: mark hexdump patch as backport
Robert Marko [Thu, 27 Jun 2024 10:22:01 +0000 (12:22 +0200)]
tools: util-linux: mark hexdump patch as backport

The hexdump fix for --disable-all-programs has been merged upstream, so
mark it so.

Signed-off-by: Robert Marko <robimarko@gmail.com>
4 months agotools/coreutils: remove 64-bit time disable flag
Michael Pratt [Tue, 25 Jun 2024 06:30:22 +0000 (02:30 -0400)]
tools/coreutils: remove 64-bit time disable flag

This was added to support building coreutils on host systems
that still only have 32-bit time support.

Because other tools now also require the flag for building
with 32-bit time when support for 64-bit time is not present,
this flag is now added to all host builds
on a variable basis using the same test before building,
so it can now be removed from specific tools.

Signed-off-by: Michael Pratt <mcpratt@pm.me>
Link: https://github.com/openwrt/openwrt/pull/15799
Signed-off-by: Robert Marko <robimarko@gmail.com>
4 months agobuild: add test for 64-bit time support
Michael Pratt [Tue, 25 Jun 2024 05:48:45 +0000 (01:48 -0400)]
build: add test for 64-bit time support

Several GNU tools such as tar, coreutils, and findutils
now build with support for 64-bit time by default
and otherwise require reconfiguring with a flag
--disable-year2038 in order to build without 64-bit time.

Some standard C libraries, for example,
certain older versions of glibc such as 2.31
have large file support but not long time bits support:

  checking for ... option to enable large file support... -D_FILE_OFFSET_BITS=64
  checking for ... option for timestamps after 2038... support not detected

This test using C code taken from largefile.m4 in gnulib
uses math and casting to check for overflow
with a macro and array pair that can only be defined
when 64-bit time support is present, and otherwise errors.
It is the exact same code used to test for 64-bit time
during the configure stage of building these tools,
so the results of this test before configure takes place
will always be in concordance with the results of
the test that takes place during the configure script.

Based on the test, the configure flag --disable-year2038
is added to every host tool build depending on the host system.

When the year 2038 problem finally comes around,
the effect of the test can be converted
from the toggling of a configure option into a build prerequisite,
requiring it to pass in order to continue building.

Signed-off-by: Michael Pratt <mcpratt@pm.me>
Link: https://github.com/openwrt/openwrt/pull/15799
Signed-off-by: Robert Marko <robimarko@gmail.com>
4 months agobmips: add support for Sagem F@ST3864OP
Hang Zhou [Wed, 20 Mar 2024 15:23:46 +0000 (02:23 +1100)]
bmips: add support for Sagem F@ST3864OP

Specifications:
* SoC: BCM63168
* RAM: NT5CC64M16GP-DI, DDR3 128MiB
* NAND: W29N01HVSINA, 128MiB
* Ethernet: 4x1000M LAN, 1x 1000M WAN
* Serial interface: on board but not populated, 3.3V, 115200, 8N1

Notes:
* Use DSA for VLAN and switches
* Ethernet ports and USB works
* gpio-leds are not working
* WLAN, xDSL, and FXS are not going to work

Signed-off-by: Hang Zhou <929513338@qq.com>
[refactor, reorder, drop unneeded or not working stuff]
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
4 months agobcm63xx-cfe: update to latest version
Álvaro Fernández Rojas [Tue, 25 Jun 2024 13:47:11 +0000 (15:47 +0200)]
bcm63xx-cfe: update to latest version

sagem: fast-3864-op:add cferam.000 file
tp-link: archer vr400 v1: add cfe file

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
4 months agotools: mtd-utils: use libuuid provided by util-linux
Robert Marko [Tue, 25 Jun 2024 15:53:11 +0000 (17:53 +0200)]
tools: mtd-utils: use libuuid provided by util-linux

Now that util-linux is building libuuid we can simply use that instead
of manually pointing to e2fsprogs libuuid so we can disable building
libuuid in e2fsprogs.

Link: https://github.com/openwrt/openwrt/pull/15806
Signed-off-by: Robert Marko <robimarko@gmail.com>
4 months agotools: e2fsprogs: use standard make uninstall
Robert Marko [Tue, 25 Jun 2024 17:45:12 +0000 (19:45 +0200)]
tools: e2fsprogs: use standard make uninstall

There is no need to manually only remove 2 binaries during cleanup and
leave rest of the e2fsprogs installed stuff untouched, so instead use
make uninstall to do the cleanup.

Link: https://github.com/openwrt/openwrt/pull/15806
Signed-off-by: Robert Marko <robimarko@gmail.com>
4 months agotools: e2fsprogs: use libuuid provided by util-linux
Robert Marko [Tue, 25 Jun 2024 17:43:30 +0000 (19:43 +0200)]
tools: e2fsprogs: use libuuid provided by util-linux

We are now using util-linux to provide libuuid so disable building it
in e2fsprogs and simply use the util-linux provided one.

Disabling libuuid removes the need for custom install recipe.

Link: https://github.com/openwrt/openwrt/pull/15806
Signed-off-by: Robert Marko <robimarko@gmail.com>
4 months agotools: util-linux: build libuuid
Robert Marko [Tue, 25 Jun 2024 15:51:24 +0000 (17:51 +0200)]
tools: util-linux: build libuuid

util-linux usually provides libuuid, and is preffered by mtd-utils so lets
enable building libuuid so we can disable it later in e2fsprogs.

Only the static version of library is intentionally built.

Link: https://github.com/openwrt/openwrt/pull/15806
Signed-off-by: Robert Marko <robimarko@gmail.com>
4 months agotools: util-linux: use standard make install/uninstall
Robert Marko [Tue, 25 Jun 2024 15:49:43 +0000 (17:49 +0200)]
tools: util-linux: use standard make install/uninstall

Instead of manually installing the binaries and removing them, we can now
simply rely on standard make install/uninstall as we are only building
tools we want to use.

This will be especially important when we start building libraries in
util-linux.

Link: https://github.com/openwrt/openwrt/pull/15806
Signed-off-by: Robert Marko <robimarko@gmail.com>
4 months agotools: util-linux: use --disable-all-programs
Robert Marko [Tue, 25 Jun 2024 15:45:57 +0000 (17:45 +0200)]
tools: util-linux: use --disable-all-programs

util-linux supports passing --disable-all-programs configure flag to
disable building anything that isnt then manually enabled.

So, lets switch to using that instead of manually having to disable all
tools we dont need.

However, current drawback is that there is no upstream support for enabling
building hexdump so I included a patch that is pending upstream[0].

[0] https://github.com/util-linux/util-linux/pull/3101

Link: https://github.com/openwrt/openwrt/pull/15806
Signed-off-by: Robert Marko <robimarko@gmail.com>
4 months agoutils: mtd-utils: update to 2.2.0
Robert Marko [Tue, 25 Jun 2024 12:14:43 +0000 (14:14 +0200)]
utils: mtd-utils: update to 2.2.0

Release notes:
https://lists.infradead.org/pipermail/linux-mtd/2024-March/104058.html

mtd-utils are currently depending on zlib, however it is not expressed
as a dependency and it is somehow being only pulled-in by lincurses-devel
so mtd-utils were able to compile.

Since 2.2.0 zlib is optional so lets disable support for it like for other
compressors since we dont package the mkfs.ubifs or mkfs.jffs2 that
are only users of compressors anyway.

Link: https://github.com/openwrt/openwrt/pull/15802
Signed-off-by: Robert Marko <robimarko@gmail.com>
4 months agoutils: mtd-utils: drop autoreconf
Robert Marko [Tue, 25 Jun 2024 12:30:51 +0000 (14:30 +0200)]
utils: mtd-utils: drop autoreconf

Now that we are not patching mtd-utils with JFFS2 LZMA support there
is no need for autoreconf to be run.

Link: https://github.com/openwrt/openwrt/pull/15802
Signed-off-by: Robert Marko <robimarko@gmail.com>
4 months agoramips: yuncore_g720: fix buttons
Daniel Golle [Tue, 25 Jun 2024 19:40:59 +0000 (20:40 +0100)]
ramips: yuncore_g720: fix buttons

Turns out the device got two buttons, while the currently listed on is
actually WPS, and the other (will hidden) button is intended as RESET.
Update DT accordingly.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
4 months agotools: mtd-utils: fix disabling tests
Robert Marko [Sun, 23 Jun 2024 21:52:45 +0000 (23:52 +0200)]
tools: mtd-utils: fix disabling tests

Passing --disable-tests does not do anything since upstream commit [0]
("Fix test binary installation") as that commit removed it since there is
already and existing --without-tests compile option to not compile
the tests at all as --disable-tests was just disabling their installation.

So, lets just pass --without-tests instead to disable test compilation.

[0] https://git.infraroot.at/mtd-utils.git/commit/?id=7170a28d46d5db1e7a9da24a5555a194a233ef0b

Fixes: 67efb6a66146 ("tools: mtd-utils: Update to version 2.1.4")
Link: https://github.com/openwrt/openwrt/pull/15791
Signed-off-by: Robert Marko <robimarko@gmail.com>
4 months agotools: mtd-utils: update to 2.2.0
Robert Marko [Sun, 23 Jun 2024 21:47:17 +0000 (23:47 +0200)]
tools: mtd-utils: update to 2.2.0

Release notes:
https://lists.infradead.org/pipermail/linux-mtd/2024-March/104058.html

Manually refresh the portability and JFFS2 LZMA patches.

Since mtd-utils have converted most of the JFFS2 compressors to be compile
time configurable and manual refreshing of JFFS2 LZMA was needed I also
converted it to a compile time option and enabled the new --with-lzma
option.

Link: https://github.com/openwrt/openwrt/pull/15791
Signed-off-by: Robert Marko <robimarko@gmail.com>
4 months agobmips: sercomm,ad1018: remove unneeded LED default-state
Álvaro Fernández Rojas [Tue, 25 Jun 2024 15:26:29 +0000 (17:26 +0200)]
bmips: sercomm,ad1018: remove unneeded LED default-state

Remove unneeded default-state from led_power_green (led@8) to be in line with
other bmips devices.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
4 months agobmips: innacomm,w3400v6: remove unneeded LED default-state
Álvaro Fernández Rojas [Tue, 25 Jun 2024 15:24:53 +0000 (17:24 +0200)]
bmips: innacomm,w3400v6: remove unneeded LED default-state

Remove unneeded default-state from led_power_green (led@4) to be in line with
other bmips devices.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
4 months agogeneric: 6.6: replace Aquantia pending LEDs patch with upstream version
Christian Marangi [Mon, 24 Jun 2024 21:22:41 +0000 (23:22 +0200)]
generic: 6.6: replace Aquantia pending LEDs patch with upstream version

Replace Aquantia pending LEDs patch with upstream version.
Sadly net maintainers didn't like integrated solution hence we still
need to handle LED restore on reset with custom solution.

Link: https://github.com/openwrt/openwrt/pull/15797
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
4 months agoutils: mtd-utils: drop patches
Robert Marko [Sun, 23 Jun 2024 21:26:45 +0000 (23:26 +0200)]
utils: mtd-utils: drop patches

We have been carrying the 100-fix_includes.patch and 130-lzma_jffs2.patch
for a long time but the reason is lost to history.

We dont need to carry the JFFS2 LZMA support patch as mkfs.jffs2 is not
even being packaged so its not even being used.

As for the 100-fix_includes.patch that also seems like a relic of history
as mtd-utils compiles fine without it.

So, lets drop both patches.

Link: https://github.com/openwrt/openwrt/pull/15790
Signed-off-by: Robert Marko <robimarko@gmail.com>
4 months agoqualcommax: fix RAX120v2 PWM Fan controller wrong definition
Christian Marangi [Sat, 25 May 2024 10:54:31 +0000 (12:54 +0200)]
qualcommax: fix RAX120v2 PWM Fan controller wrong definition

Fix RAX120v2 PWM Fan controller wrong definition by using a non-existant
kmod and using the wrong compatible for it enabling an external clock
while actually the device use an internal one.

Link: https://github.com/openwrt/openwrt/pull/15796
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
4 months agogeneric: 6.6: backport patch for G671 PWM Fan controller support
Christian Marangi [Sat, 25 May 2024 10:52:44 +0000 (12:52 +0200)]
generic: 6.6: backport patch for G671 PWM Fan controller support

Backport patch for G761 PWM Fan controller support. This is used by
an ipq807x RAX120v2 and have an internal clock that was currently
unconfigured making the device not working.

Link: https://github.com/openwrt/openwrt/pull/15796
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
4 months agoipq806x: fix broken line break with Linksys e8350-v1
Christian Marangi [Tue, 25 Jun 2024 10:20:14 +0000 (12:20 +0200)]
ipq806x: fix broken line break with Linksys e8350-v1

Fix broken line break for Linksys e8350-v1 pushed with CRLF instead of
LF.

Fixes: 45b3c620e597 ("ipq806x: add support for Linksys e8350-v1")
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
4 months agoipq806x: add support for Linksys e8350-v1
Sergey Filippov [Sat, 15 Jun 2024 19:36:43 +0000 (21:36 +0200)]
ipq806x: add support for Linksys e8350-v1

AC2400 Dual-Band Gigabit Wi-Fi Router base on ipq8064.
https://www.linksys.com/support-product?sku=E8350

Specification:
 - Qualcomm dual-core IPQ8064 @ 1.4 GHz
 - 512 MB of RAM
 - 4 MB of SPI NOR MX25U3235F
 - 128 MB of NAND S34MS01G2
 - Qualcomm QCA9880 2.4GHz 802.11bgn
 - Quantenna QSR1000 5GHz 802.11ac (no support)
 - 4 x 10/100/1000 Mbit/s w/ vlan support Ethernet
 - Qualcomm Atheros QCA8337 switch
 - 1 x 3.0 + 1 x 2.0 (combo with eSata port)
 - 115200, 8N1 internal serial console
 - Power, Reset, WPS and WLAN buttons
 - Power, WPS and WLAN leds
 - 12 VDC, 3 A power

Installation:
The installation must be done using web interface of the router.
To achive this new firmware-utils tool was added to set correct
magic headers for the factory images.

Installation from vendor firmware:
 1. Flash over the native Linksys WEB interface using factory image.

Installation using recovery mode:
 1. Power off the device and disconnect the WAN port.
    (Only LAN port to be connected)
 2. Press & hold the "Reset" button
 3. Power on the device & wait 10 seconds with pressed "Reset" button
 4. Set IP Internet Protocol on your PC from
    192.168.1.0/24 network (Router is on IP 192.168.1.1)
 5. Open the Firmware Recovery page in your browser:
    http://192.168.1.1/index.shtml
    Firmware Recovery -> File Name -> Recovery & Reboot

The device page in inbox:
https://openwrt.org/inbox/toh/linksys/linksys_ea8350_1

Signed-off-by: Sergey Filippov <sergey.filippov@outlook.com>
Link: https://github.com/openwrt/openwrt/pull/15798
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
4 months agobmips: drop kernel 6.1 support
Álvaro Fernández Rojas [Tue, 25 Jun 2024 07:43:07 +0000 (09:43 +0200)]
bmips: drop kernel 6.1 support

kernel 6.1 can be dropped since 6.6 is the default kernel.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
4 months agobmips: switch default kernel to 6.6
Álvaro Fernández Rojas [Tue, 25 Jun 2024 07:40:49 +0000 (09:40 +0200)]
bmips: switch default kernel to 6.6

Update default kernel version to 6.6 for the bmips devices.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
4 months agobmips: add 6.6 kernel as testing
Goetz Goerisch [Mon, 24 Jun 2024 20:11:13 +0000 (22:11 +0200)]
bmips: add 6.6 kernel as testing

enable testing kernel version 6.6 for bmips

Signed-off-by: Goetz Goerisch <ggoerisch@gmail.com>
4 months agobmips: refresh 6.6 kernel config files
Álvaro Fernández Rojas [Mon, 24 Jun 2024 20:11:13 +0000 (22:11 +0200)]
bmips: refresh 6.6 kernel config files

Refresh config for kernel 6.6.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
4 months agobmips: 6.6: refresh kernel patches
Goetz Goerisch [Mon, 24 Jun 2024 20:11:13 +0000 (22:11 +0200)]
bmips: 6.6: refresh kernel patches

refresh 6.6. kernel patches via 'make target/linux/refresh'

Signed-off-by: Goetz Goerisch <ggoerisch@gmail.com>
[refresh patches]
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
4 months agobmips: 6.6: copy patches, config from 6.1
Goetz Goerisch [Mon, 24 Jun 2024 20:11:13 +0000 (22:11 +0200)]
bmips: 6.6: copy patches, config from 6.1

copy the 6.1 config to 6.6

Signed-off-by: Goetz Goerisch <ggoerisch@gmail.com>
4 months agogeneric: 6.6: backport mips kexec dependency fix
Álvaro Fernández Rojas [Mon, 24 Jun 2024 17:37:37 +0000 (19:37 +0200)]
generic: 6.6: backport mips kexec dependency fix

Backport upstream fix for incorrect ifdeffery and dependency of CONFIG_KEXEC,
which causes compilation errors with the following symbols:
CONFIG_CRASH_CORE=y
CONFIG_KEXEC_CORE=y
CONFIG_CRASH_DUMP=y

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
4 months agotools/llvm: update to 18.1.7
Konstantin Demin [Wed, 19 Jun 2024 16:43:51 +0000 (19:43 +0300)]
tools/llvm: update to 18.1.7

- release notes:
  - https://discourse.llvm.org/t/llvm-16-0-0-release/69326
  - https://discourse.llvm.org/t/llvm-17-0-1-released/73549
  - https://discourse.llvm.org/t/llvm-18-1-0-released/77448
  - https://discourse.llvm.org/t/llvm-18-1-1-released/77540
  - https://discourse.llvm.org/t/18-1-2-released/77821
  - https://discourse.llvm.org/t/18-1-3-released/78136
  - https://discourse.llvm.org/t/18-1-4-released/78430
  - https://discourse.llvm.org/t/18-1-5-released/78740
  - https://discourse.llvm.org/t/18-1-6-released/79068
  - https://discourse.llvm.org/t/18-1-7-released/79433
- remove PKG_RELEASE (irrelevant to tools)
- set default target/triplet to "bpf"
- rearrange configuration options
- better control feature support and improve build reproducibility:
  disable auxiliary features that are enabled implicitly - their
  support is detected at build-time

Signed-off-by: Konstantin Demin <rockdrilla@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/15704
Signed-off-by: Robert Marko <robimarko@gmail.com>
4 months agomvebu: add support for RB5009UG+S+IN
Robert Marko [Wed, 9 Feb 2022 07:45:47 +0000 (09:45 +0200)]
mvebu: add support for RB5009UG+S+IN

This patch adds support for Mikrotik RB5009UG+S+IN.

Specifications:
  - SoC: Marvell Armada 7040 (88F7040) - 4 cores, ARMv8 Cortex-A72, 1.4GHz, 64bit
  - RAM: 1024MB DDR4
  - Flash: 16MB SPI NOR flash, 1024MB NAND
  - Ethernet:
   * Marvell 88E6393X - Amethyst:
   * one 2.5G RJ45 port via Qualcomm QCA8081 PHY
   * seven 1G RJ45 ports via built-in PHY-s
   * one 10G SFP+ cage
   * All ports share the same 10G switch uplink to the CPU
  - LED: User, SFP, Hdr1, Hdr2
  - Buttons: Reset
  - UART: 115200 8n1 on the MikroTik 16 pin header
  - USB: One USB3 port
  - Power: 24-57 V via
   * DC jack
   * 802.3af/at PoE on Ethernet 1
   * 2-pin terminal on the side

16 Pin header pinout:
1   GND Vcc  RX  ?  GND
   #--------------------#
   |.-. .-. .-. .-. .-. |
   |'-' '-' '-' '-' '-' |
   |.-. .-. .-. .-. .-. |
   |'-' '-' '-' '-' '-' |
   #--------------------#
2   CLK  DO /CS  TX  DI

Do note that the default RouterBoot has disabled UART even when the
required hard-config bit is set to indicate UART support.
Patched RouterBoot must be used if UART is desired.

Also, since ARM64 Linux support does not support in any way appending the
DTB to the kernel image we use mainline U-Boot with added RB5009 support
in order to boot OpenWrt.
MikroTik uses YAFFS to store the boot kernel and we use YAFUT to put U-Boot
as the kernel which RouterBoot then simply boots as an ELF.

Install instructions:

NOTE: In case you are using an existing out of tree version of OpenWrt make
sure to reinstall RouterOS via Netinstall to return the expected partition
layout.

1. Prepare FAT or EXT4 formatted USB drive with OpenWrt initramfs:
* Copy bin/targets/mvebu/cortexa72/openwrt-mvebu-cortexa72-mikrotik_rb5009-initramfs-uImage.itb
to the root of FAT or EXT4 formatted USB drive.
* Plug in the drive to the RB5009 USB port

2. Boot the modified OpenWrt built U-Boot ELF:
u-boot.elf from bin/targets/mvebu/cortexa72/u-boot-rb5009/u-boot.elf

Consult OpenWrt wiki for common instructions on switching to boot from
Ethernet once as well as serving the file:
https://openwrt.org/toh/mikrotik/common

Once U-Boot is booted it will attempt to boot in the following order:
1. NAND
2. USB
3. Network

NAND is expected to fail but USB or Networking need to serve the OpenWrt
initramfs image and after booting it will be accessible from LAN ports
on the default 192.168.1.1 IP with default credentials.

3. Flash modified RouterBoot that enables UART (Optional but recommended):
https://public.robimarko.eu/RB5009/70x0-7.15-uart.fwf

* Copy the file over to the booted OpenWrt initramfs to /tmp
* Run: mtd erase RouterBOOT-primary
* Run: mtd write /tmp/70x0-7.15-uart.fwf RouterBOOT-primary

4. Install U-Boot to boot OpenWrt:
* Copy the u-boot.elf from bin/targets/mvebu/cortexa72/u-boot-rb5009/u-boot.elf
to OpenWrt initramfs to /tmp.
* Run: . /lib/functions.sh
* Run: yafut -d /dev/mtd$(find_mtd_index "YAFFS") -w -i /tmp/u-boot.elf -o kernel -T
This will use yafut to copy the U-Boot as kernel in YAFFS so that RouterBoot boots it.

5. Wipe the NAND UBI partition:
* Run: ubiformat /dev/mtd$(find_mtd_index "ubi") -y
This will prepare the existing RouterOS rootfs partition for OpenWrt.

6. Flash OpenWrt:
* Copy the bin/targets/mvebu/cortexa72/openwrt-mvebu-cortexa72-mikrotik_rb5009-squashfs-sysupgrade.bin
to OpenWrt initramfs to /tmp.
* Run: sysupgrade /tmp/openwrt-mvebu-cortexa72-mikrotik_rb5009-squashfs-sysupgrade.bin

Device will reboot, boot U-Boot and then OpenWrt.

Recovery:

In case you need to reinstall OpenWrt if it crashes after U-Boot, there is
a recovery mechanism in OpenWrt to boot the OpenWrt initramfs.
You need to hold the reset button while U-Boot is booting and then it will
boot the OpenWrt initramfs from:
1. USB
2. Networking

In recovery mode U-Boot will light all of the LED-s except for the switch
ones.

In case you want to return to RouterOS, you can simply do that via
Netinstall like on any other MikroTik board.

Credits also go to Serhii Serhieiev <adron@mstnt.com> who origininally
figured out the RouterBoot modification for UART, the missing 10G MVPP2
support in U-Boot as well as the custom aux loader to boot directly via
RouterBoot.

Link: https://github.com/openwrt/openwrt/pull/15765
Signed-off-by: Robert Marko <robimarko@gmail.com>
4 months agouboot-mvebu: add support for MikroTik RB5009
Robert Marko [Sat, 8 Jun 2024 08:25:29 +0000 (10:25 +0200)]
uboot-mvebu: add support for MikroTik RB5009

MikroTik RB5009 uses RouterBoot as its bootloader like all MikroTik devices
running RouterOS, meaning that its not FIT compatible and can only boot
ELF images.

Now this is not so much of an issue on ARM or MIPS since kernel supports
appending DTB-s to it (Or we patch the kernel to embed it), but on ARM64
there is intentionally no such support.

RouterBoot will pass a DTB, but its the broken MikroTik one which is a
modified reference DTB and incorrect in more places than its valid so we
cannot use it to boot our kernel.

Thus, the solution is to use an intermediary loader and luckily for us
Armada 7040 is well supported in U-Boot which makes it a great option since
it supports anything that we will ever need to boot.

Upstream U-Boot currently requires the Armada boards to be converted to
OF_UPSTREAM before adding anything new and this requires updating all of
the drivers to accomodate the Linux DTS, while I plan to do this eventually
we will need to keep this board downstream for now.

Most stuff is supported in U-Boot, including networking since the switch
is preconfigured by RouterBoot.

A custom environment is used to try and boot from the following devices:
1. NAND (UBI)
2. USB
3. Networking

If NAND boot fails then U-Boot will attempt to boot OpenWrt initramfs from
USB or via networking.

There is a manual recovery mechanism implemented where if the reset button
is held when U-Boot is booting it will try to boot OpenWrt initramfs from:
1. USB
2. Networking

When U-Boot is in recovery mode it will light all of the LED-s except the
switch ones.

Link: https://github.com/openwrt/openwrt/pull/15765
Signed-off-by: Robert Marko <robimarko@gmail.com>
4 months agomvebu: cortex-a72: enable MikroTik NVMEM layout driver
Robert Marko [Sun, 9 Jun 2024 10:18:54 +0000 (12:18 +0200)]
mvebu: cortex-a72: enable MikroTik NVMEM layout driver

RB5009 will take advantage of the driver to get MAC adress.

Link: https://github.com/openwrt/openwrt/pull/15765
Signed-off-by: Robert Marko <robimarko@gmail.com>
4 months agomvebu: cortex-a72: enable U-Boot NVMEM driver
Robert Marko [Fri, 7 Jun 2024 17:43:14 +0000 (19:43 +0200)]
mvebu: cortex-a72: enable U-Boot NVMEM driver

In order to not have to ship envtools configuration per board, we can
instead rely on the kernel U-Boot environment NVMEM driver through which
envtools can read/write the environement.

Since size difference is negligeble and this subtarget has rather large
storage regardless, enable it by default.

Link: https://github.com/openwrt/openwrt/pull/15765
Signed-off-by: Robert Marko <robimarko@gmail.com>
4 months agomvebu: cortex-a72: enable MikroTik platform drivers and NOR variable erase
Robert Marko [Sun, 17 Sep 2023 20:17:56 +0000 (22:17 +0200)]
mvebu: cortex-a72: enable MikroTik platform drivers and NOR variable erase

MikroTik RB5009 will be using advantage of the MikroTik platform drivers,
RouterBoot partition parser and SPI NOR variable erase support.

Link: https://github.com/openwrt/openwrt/pull/15765
Signed-off-by: Robert Marko <robimarko@gmail.com>
4 months agomvebu: cortex-a72: enable ARM SBSA Generic Watchdog
Robert Marko [Fri, 7 Jun 2024 13:05:30 +0000 (15:05 +0200)]
mvebu: cortex-a72: enable ARM SBSA Generic Watchdog

Marvell 70x0 and 80x0 both have ARM SBSA Generic Watchdog built-in,
so lets enable the required driver for them.

Link: https://github.com/openwrt/openwrt/pull/15765
Signed-off-by: Robert Marko <robimarko@gmail.com>
4 months agomvebu: cortex-a72: enable QCA8081 PHY support
Robert Marko [Mon, 18 Sep 2023 08:51:19 +0000 (10:51 +0200)]
mvebu: cortex-a72: enable QCA8081 PHY support

MikroTik RB5009 uses Qualcomm QCA8081 PHY for the 2.5G RJ45 port,
so we need to enable the driver for it.

Link: https://github.com/openwrt/openwrt/pull/15765
Signed-off-by: Robert Marko <robimarko@gmail.com>
4 months agotreewide: refresh patches
Robert Marko [Sat, 22 Jun 2024 10:41:28 +0000 (12:41 +0200)]
treewide: refresh patches

These need to be refreshed, probably the generic backports affected them.

Link: https://github.com/openwrt/openwrt/pull/15765
Signed-off-by: Robert Marko <robimarko@gmail.com>
4 months agogeneric: backport QCA808x possible interfaces fix
Robert Marko [Tue, 27 Feb 2024 18:07:42 +0000 (19:07 +0100)]
generic: backport QCA808x possible interfaces fix

QCA808x does not currently fill in the possible_interfaces.

This leads to Phylink not being aware that it supports 2500Base-X as well
so in cases where it is connected to a DSA switch like MV88E6393 it will
limit that port to phy-mode set in the DTS.

That means that if SGMII is used you are limited to 1G only while if
2500Base-X was set you are limited to 2.5G only.

Populating the possible_interfaces fixes this, so lets backport the patches
from kernel 6.9.

This also includes a backport of the Phylink PHY validation series from
kernel 6.8 that allows the use of possible_interfaces.

Link: https://github.com/openwrt/openwrt/pull/15765
Signed-off-by: Robert Marko <robimarko@gmail.com>
4 months agogeneric: 6.6: backport Marvell Amethyst SMI GPIO setup
Robert Marko [Sun, 17 Sep 2023 20:43:48 +0000 (22:43 +0200)]
generic: 6.6: backport Marvell Amethyst SMI GPIO setup

Marvell Amethyst switches use a different SMI GPIO pin setup than other
switches, and since RB5009 uses Amethyst switch and its SMI bus to talk
to QCA8081 lets backport the required fix from kernel 6.9.

Link: https://github.com/openwrt/openwrt/pull/15765
Signed-off-by: Robert Marko <robimarko@gmail.com>
4 months agobcm27xx: drop upstream patch that breaks rpi5 wifi
Álvaro Fernández Rojas [Mon, 24 Jun 2024 03:48:44 +0000 (05:48 +0200)]
bcm27xx: drop upstream patch that breaks rpi5 wifi

As reported in the following issue, this patch breaks wifi on the RPi 5.
https://github.com/raspberrypi/linux/issues/6237

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
4 months agogeneric: 6.6: backport upstream r8169 patches
Álvaro Fernández Rojas [Sun, 23 Jun 2024 17:19:47 +0000 (19:19 +0200)]
generic: 6.6: backport upstream r8169 patches

Backport a bunch of upstream r8169 patches:
- RTL8168/RTL8101 LEDs support.
- RTL8126A support.
- RTL8125/RTL8126 LEDs support.
- RTL8168M support.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
4 months agoqualcommax: get rid of custom socinfo.h header
Robert Marko [Sun, 23 Jun 2024 16:02:09 +0000 (18:02 +0200)]
qualcommax: get rid of custom socinfo.h header

Now that SSDK has been updated to use in-kernel SMEM ID-s to identify
the SoC its running on instead of relying on the downstream socinfo.h
header we can move the read_ipq_soc_version_major() function directly to
cpr3-util.c as its the only user of anything from the header and drop it.

Link: https://github.com/openwrt/openwrt/pull/15786
Signed-off-by: Robert Marko <robimarko@gmail.com>
4 months agolinux-firmware: add RTL8126 firmware
Álvaro Fernández Rojas [Sun, 23 Jun 2024 16:40:34 +0000 (18:40 +0200)]
linux-firmware: add RTL8126 firmware

This commit adds RTL8126 firmwares to r8169-firmware package.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
4 months agoath79: remove SPI driver link order hack
Shiji Yang [Sat, 22 Jun 2024 14:58:56 +0000 (14:58 +0000)]
ath79: remove SPI driver link order hack

This hack is used to make sure that the mfd device starts before the
mtd driver[1]. Now the linux driver framework "struct spi_driver {}"
can always ensure this.

[1] 47f8fd1dde5d ("ar71xx: rewrite SPI drivers for the RB4xx boards")

Signed-off-by: Shiji Yang <yangshiji66@qq.com>
4 months agoath79: remove GPIO driver earlier registration hack
Shiji Yang [Sat, 22 Jun 2024 14:58:16 +0000 (14:58 +0000)]
ath79: remove GPIO driver earlier registration hack

After porting the ar71xx target to the new ath79 target, we are now
using the device tree instead of the device mach file. And the
platform drivers already support deferred probe. So there is no need
to keep it.

Signed-off-by: Shiji Yang <yangshiji66@qq.com>
4 months agoqca-ssdk: fix compiling for ipq60xx
Robert Marko [Sun, 23 Jun 2024 15:24:57 +0000 (17:24 +0200)]
qca-ssdk: fix compiling for ipq60xx

Trying to compile for ipq60xx will fail with:
ERROR: modpost: "qca808x_phy_reset" [build_dir/target-aarch64_cortex-a53_musl/linux-qualcommax_ipq60xx/qca-ssdk-2024.06.13~c451136b/qca-ssdk.ko] undefined!

So, lets fix this by disabling Manhattan switch and PHY support as this is
the new 2.5G quad port switch that is not present on ipq60xx boards.

Fixes: 87a45ea43207 ("kernel: qca-ssdk: update 12.5 to 2024-06-13")
Signed-off-by: Robert Marko <robimarko@gmail.com>
4 months agokernel: qca-ssdk: update 12.5 to 2024-06-13
Kristian Skramstad [Fri, 21 Jun 2024 22:00:15 +0000 (00:00 +0200)]
kernel: qca-ssdk: update 12.5 to 2024-06-13

There are some new commits, so refresh and update patches.
Some build warnings have been fixed upstream too.

Add backport target/linux/generic/backport-6.6/722-v6.10-dt-bindings-arm-qcom-ids-Add-SoC-ID-for-IPQ5321.patch.

Removed upstream:
[-] qca-ssdk/patches/101-hsl_phy-add-support-for-detection-PSGMII-PHY-mode.patch
[-] qca-ssdk/patches/201-fix-compile-warnings.patch

List of changes:
2024-04-16  -c451136b-  qca-ssdk: strip MRPPE code
2024-06-05  -f455a820-  [qca-ssdk]: fix enum-int-mismatch warnings
2024-05-31  -bbfc0fa9-  Merge "[qca-ssdk]: update eee status of phydev"
2024-05-31  -adbe9dc5-  Merge "[qca-ssdk]: support psgmii and uqsxgmii mode of kernel"
2024-05-31  -d06ca777-  Merge "[qca-ssdk]: fix 5G issue with the AQR FW that use 5gbaser for 5G speed"
2024-05-31  -c6f539a5-  Merge "qca-ssdk: support mrppe pktedit padding functions"
2024-04-29  -c321e2a9-  qca-ssdk: support mrppe pktedit padding functions
2024-05-24  -ee6e201e-  qca-ssdk: Fix the big endian compile error
2024-05-15  -8c116bb9-  [qca-ssdk]: update eee status of phydev
2024-05-20  -f0341a2c-  Merge "qca-ssdk: Enable igmp for PPE MINI profile"
2024-05-16  -44a0ce93-  qca-ssdk: Enable igmp for PPE MINI profile
2024-05-15  -8b91bbf6-  [qca-ssdk]: support psgmii and uqsxgmii mode of kernel
2024-05-14  -7eec1658-  [qca-ssdk]: fix 5G issue with the AQR FW that use 5gbaser for 5G speed
2024-05-12  -b9f5ea0e-  [qca-ssdk]: ethtool support, do not change wake-up timer when the requested timer is 0
2024-05-09  -5e2c15ed-  Merge "[qca-ssdk]: remove check when mht clock enable"
2024-05-09  -a1563b90-  Merge "[qca-ssdk] support new sku IPQ5321"
2024-04-23  -f04b7680-  [qca-ssdk]: show unknown status when link down
2024-03-22  -33b91b30-  [qca-ssdk]: remove check when mht clock enable
2024-04-29  -b6362f2b-  Merge "qca-ssdk:fix bug in marina nptv6 iid cal"
2024-04-29  -097033ae-  Merge "[qca-ssdk] support cypress uniphy0 connecting MHT switch port0"
2024-04-24  -d45560fd-  qca-ssdk:fix bug in marina nptv6 iid cal
2024-04-24  -7d7a42af-  qca-ssdk: enable policer counter on low memory profile
2024-04-18  -e36cf6ea-  Merge "[qca-ssdk]: change portvlan egress mode initial value as untouched"
2024-04-18  -27817881-  Merge "[qca-ssdk]: update the aqr phy supported ability"
2024-04-18  -5a3a693c-  Merge "qca-ssdk:support marina nptv6"
2024-04-16  -129fe9b3-  Merge "qca-ssdk: support tunnel fields and innner fields inverse"
2024-01-09  -fc8f6abd-  qca-ssdk:support marina nptv6

Signed-off-by: Kristian Skramstad <kristian+github@83.no>
Link: https://github.com/openwrt/openwrt/pull/15771
Signed-off-by: Robert Marko <robimarko@gmail.com>
4 months agokernel: bump 6.1 to 6.1.95
Zxl hhyccc [Sat, 22 Jun 2024 05:50:31 +0000 (13:50 +0800)]
kernel: bump 6.1 to 6.1.95

https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.1.95

Removed upstreamed:
generic/pending-6.1/779-net-vxlan-don-t-learn-non-unicast-L2-destinations.patch
reference:
This patch can be removed. It will never return false. And the upstream commit should fix the same issue:
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.1.95&id=a31d0e5deb1abe7c57c6457ae2502f278063126e

All other patches automatically rebased.

Build system: Kirkwood bcm53xx

Signed-off-by: Zxl hhyccc <zxlhhy@gmail.com>
4 months agoarmsr: add realtek and smsc ethernet phy drivers to the default image
Mathew McBride [Tue, 28 May 2024 23:09:17 +0000 (09:09 +1000)]
armsr: add realtek and smsc ethernet phy drivers to the default image

This adds two more common PHY brands to the image.
Realtek is used on the Google Coral "Phanbell" board (i.MX8MQ).
SMSC has been used on various Raspberry Pi boards.

Signed-off-by: Mathew McBride <matt@traverse.com.au>
4 months agoarmsr: armv8: enable NXP i.MX8MQ/P USB phy
Mathew McBride [Tue, 28 May 2024 23:04:13 +0000 (09:04 +1000)]
armsr: armv8: enable NXP i.MX8MQ/P USB phy

Support for 'fsl,imx8mq-usb-phy' is needed for USB to work
on NXP i.MX8MQ and i.MX8MP platforms.

Tested with a Google Coral "Phanbell" board.

Signed-off-by: Mathew McBride <matt@traverse.com.au>
4 months agoarmsr: enable framebuffer emulation for virtio-gpu/drm displays
Mathew McBride [Sun, 26 May 2024 04:12:58 +0000 (14:12 +1000)]
armsr: enable framebuffer emulation for virtio-gpu/drm displays

This was discovered when trying to run OpenWrt on Hetzner Cloud's
Arm-based instances.

Hetzner uses QEMU/KVM with virtio-gpu as the main display device,
together with an ACPI firmware. This was not displaying a console
previously.

This setup can be emulated by qemu using options below:
qemu-system-aarch64 \
    -machine virt \
    -bios QEMU_EFI.fd \
    -device virtio-gpu \
    -usb \
    -device qemu-xhci,id=xhci \
    -device usb-tablet,bus=xhci.0 \
    -device usb-kbd,bus=xhci.0 \
    -vnc :0

Signed-off-by: Mathew McBride <matt@traverse.com.au>
4 months agokernel/armsr: disable NXP i.MX9 PMU related option
Mathew McBride [Sun, 17 Mar 2024 23:51:21 +0000 (10:51 +1100)]
kernel/armsr: disable NXP i.MX9 PMU related option

This PMU (performance management unit) related kernel option
can appear under certain kernel configurations (such as
KVM being enabled).

Disable them, as we do with other PMU-related options.

Signed-off-by: Mathew McBride <matt@traverse.com.au>
4 months agokernel: crypto: remove FCRYPT from miscellany
Nathaniel Wesley Filardo [Thu, 20 Jun 2024 14:15:50 +0000 (15:15 +0100)]
kernel: crypto: remove FCRYPT from miscellany

It has its own dedicated knob

Signed-off-by: Nathaniel Wesley Filardo <nwfilardo@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/15761
Signed-off-by: Robert Marko <robimarko@gmail.com>
4 months agokernel: catch up rxrpc
Nathaniel Wesley Filardo [Thu, 20 Jun 2024 14:15:41 +0000 (15:15 +0100)]
kernel: catch up rxrpc

New dependencies required for the module to be useful, and correct IPv6 support

Signed-off-by: Nathaniel Wesley Filardo <nwfilardo@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/15761
Signed-off-by: Robert Marko <robimarko@gmail.com>
4 months agouml: fix glibc-static check with GCC14
Robert Marko [Sat, 22 Jun 2024 19:57:23 +0000 (21:57 +0200)]
uml: fix glibc-static check with GCC14

Running the glibc-static check with GCC14 as the host compiler will fail:
Please install a static glibc package. (Missing libutil.a, librt.a or libpthread.a)

However, this error will get printed even with the required static
libraries installed when GCC14 is used.

Manually running the check exposes the real error:
<stdin>: In function ‘main’:
<stdin>:1:45: error: implicit declaration of function ‘timer_gettime’ [-Wimplicit-function-declaration]

GCC14 now errors on implicit declarations by default, so lets add the
required time.h header to fix compilation and thus the check.

Link: https://github.com/openwrt/openwrt/pull/15778
Signed-off-by: Robert Marko <robimarko@gmail.com>
4 months agotools/fakeroot: fix check for whether to wrap time64 functions
Michael Pratt [Sat, 22 Jun 2024 04:58:39 +0000 (00:58 -0400)]
tools/fakeroot: fix check for whether to wrap time64 functions

Fakeroot uses an egrep configure check to look for the string "time64"
within a preprocessed include of the sys/stat.h header
in order to decide whether or not to create declarations
and internal functions used for wrapping the native functions
stat64_time64 fstat64_time64 lstat64_time64 and fstatat64_time64.

On specific older versions of glibc these functions are not included,
but there are some references to "time64" unrelated to functions,
like aliasing the time64_t typedef to the standard time_t typedef
when the size of a word is 64 bits or defining it if not.

In this case, a grep for "stat64"
of the preprocessed sys/stat.h header matches nothing,
however, the grep for "time64" in the configure check
of the preprocessed sys/stat.h header matches a line
that has nothing to do with the functions
that will be wrapped as a result of successful matching.

  __extension__ typedef __int64_t __time64_t;

This causes the attempt to wrap the functions to occur,
which fails due to some of the corresponding macros being empty
since the native declarations they are based on do not exist,
causing a common error claiming that a part of the syntax is missing.

  error: expected '=', ',', ';', 'asm' or '__attribute__' before ...

Fix this by making the testing regular expression more complex
in order to match actual function names ending in "_time64"
with or without a set of preceding underscores, but none after.

Signed-off-by: Michael Pratt <mcpratt@pm.me>
Link: https://github.com/openwrt/openwrt/pull/15773
Signed-off-by: Robert Marko <robimarko@gmail.com>
4 months agokernel: bump 6.6 to 6.6.35
John Audia [Fri, 21 Jun 2024 14:02:58 +0000 (10:02 -0400)]
kernel: bump 6.6 to 6.6.35

Changelog: https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.6.35

Removed upstreamed:
bcm27xx/patches-6.6/950-1135-ax25-Fix-refcount-imbalance-on-inbound-connections.patch[1]

Removed no longer needed:
generic/pending-6.6/779-net-vxlan-don-t-learn-non-unicast-L2-destinations.patch[2]

All other patches automatically rebased.

Build system: x86/64
Build-tested: x86/64/AMD Cezanne, flogic/glinet_gl-mt6000, flogic/xiaomi_redmi-router-ax6000-ubootmod, ramips/tplink_archer-a6-v3
Run-tested: x86/64/AMD Cezanne, flogic/glinet_gl-mt6000, flogic/xiaomi_redmi-router-ax6000-ubootmod, ramips/tplink_archer-a6-v3

1. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.6.35&id=52100fd74ad07b53a4666feafff1cd11436362d3
2. As suggested by @DragonBluep, "This patch can be removed. It will never return false. And the upstream commit should fix the same issue: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit?h=v6.6.35&id=924f7bbfc5cfd029e417c56357ca01eae681fba6"

Signed-off-by: John Audia <therealgraysky@proton.me>
4 months agoopenssl: conditionally disable engine section
Sean Khan [Sun, 9 Jun 2024 01:02:30 +0000 (21:02 -0400)]
openssl: conditionally disable engine section

Currently, the build option to enable/disable engine support isn't
reflected in the final '/etc/ssl/openssl.cnf' config. It assumes `engines`
is always enabled, producing an error whenever running any
commands in openssl util or programs that explicitly use settings
from '/etc/ssl/openssl.cnf'.

```
➤ openssl version
FATAL: Startup failure (dev note: apps_startup()) for openssl
307D1EA97F000000:error:12800067:lib(37):dlfcn_load:reason(103):crypto/dso/dso_dlfcn.c:118:filename(libengines.so):
Error loading shared library libengines.so: No such file or directory
307D1EA97F000000:error:12800067:lib(37):DSO_load:reason(103):crypto/dso/dso_lib.c:152:
307D1EA97F000000:error:0700006E:lib(14):module_load_dso:reason(110):crypto/conf/conf_mod.c:321:module=engines, path=engines
307D1EA97F000000:error:07000071:lib(14):module_run:reason(113):crypto/conf/conf_mod.c:266:module=engines
```

Build should check for the `CONFIG_OPENSSL_ENGINE` option, and comment out `engines`
if not explicitly enabled.

Example:
```
[openssl_init]
providers = provider_sect
```

After this change, openssl util works correctly.

```
➤ openssl version
OpenSSL 3.0.14 4 Jun 2024 (Library: OpenSSL 3.0.14 4 Jun 2024)
```

Signed-off-by: Sean Khan <datapronix@protonmail.com>
Link: https://github.com/openwrt/openwrt/pull/15661
Signed-off-by: Robert Marko <robimarko@gmail.com>
4 months agoimx: 6.6: add upstream patches for imx8m{m,n,p} venice
Tim Harvey [Tue, 21 May 2024 19:18:50 +0000 (12:18 -0700)]
imx: 6.6: add upstream patches for imx8m{m,n,p} venice

Add a set of upstream patches for the imx8m{m,n,p} based Venice
boards.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
Link: https://github.com/openwrt/openwrt/pull/15736
Signed-off-by: Robert Marko <robimarko@gmail.com>
4 months agoimx: coretexa53: fix network configuration for GW74xx
Tim Harvey [Tue, 21 May 2024 18:44:34 +0000 (11:44 -0700)]
imx: coretexa53: fix network configuration for GW74xx

The GW74xx's first RJ45 is eth0 which should be the WAN adapter, not
eth1 which is the CPU uplink port to the switch.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
Link: https://github.com/openwrt/openwrt/pull/15736
Signed-off-by: Robert Marko <robimarko@gmail.com>
4 months agowifi-scripts: ensure get_freq returns int (iw-6.9)
Sean Khan [Sat, 22 Jun 2024 00:01:22 +0000 (20:01 -0400)]
wifi-scripts: ensure get_freq returns int (iw-6.9)

With `iw` version 6.9 frequencies are now being reported as float,
which is incompatible with wpa_supplicant's config option 'frequency'
which expects an integer.

iwinfo phy0 info output:

Version: 5.19
```
Frequencies:
  * 5180 MHz [36] (30.0 dBm)
  * 5200 MHz [40] (30.0 dBm)
  * 5220 MHz [44] (30.0 dBm)
  * 5240 MHz [48] (30.0 dBm)
  * 5260 MHz [52] (24.0 dBm)
  * 5280 MHz [56] (24.0 dBm)
  * 5300 MHz [60] (24.0 dBm)
  * 5320 MHz [64] (24.0 dBm)
  * 5500 MHz [100] (24.0 dBm)
  * 5520 MHz [104] (24.0 dBm)
  * 5540 MHz [108] (24.0 dBm)
  * 5560 MHz [112] (24.0 dBm)
  * 5580 MHz [116] (24.0 dBm)
  * 5600 MHz [120] (24.0 dBm)
  * 5620 MHz [124] (24.0 dBm)
  * 5640 MHz [128] (24.0 dBm)
  * 5660 MHz [132] (24.0 dBm)
  * 5680 MHz [136] (24.0 dBm)
  * 5700 MHz [140] (24.0 dBm)
  * 5720 MHz [144] (24.0 dBm)
  * 5745 MHz [149] (30.0 dBm)
  * 5765 MHz [153] (30.0 dBm)
  * 5785 MHz [157] (30.0 dBm)
  * 5805 MHz [161] (30.0 dBm)
  * 5825 MHz [165] (30.0 dBm)
  * 5845 MHz [169] (disabled)
  * 5865 MHz [173] (disabled)
  * 5885 MHz [177] (disabled)
```

Version: 6.9
```
Frequencies:
  * 5180.0 MHz [36] (30.0 dBm)
  * 5200.0 MHz [40] (30.0 dBm)
  * 5220.0 MHz [44] (30.0 dBm)
  * 5240.0 MHz [48] (30.0 dBm)
  * 5260.0 MHz [52] (24.0 dBm)
  * 5280.0 MHz [56] (24.0 dBm)
  * 5300.0 MHz [60] (24.0 dBm)
  * 5320.0 MHz [64] (24.0 dBm)
  * 5500.0 MHz [100] (24.0 dBm)
  * 5520.0 MHz [104] (24.0 dBm)
  * 5540.0 MHz [108] (24.0 dBm)
  * 5560.0 MHz [112] (24.0 dBm)
  * 5580.0 MHz [116] (24.0 dBm)
  * 5600.0 MHz [120] (24.0 dBm)
  * 5620.0 MHz [124] (24.0 dBm)
  * 5640.0 MHz [128] (24.0 dBm)
  * 5660.0 MHz [132] (24.0 dBm)
  * 5680.0 MHz [136] (24.0 dBm)
  * 5700.0 MHz [140] (24.0 dBm)
  * 5720.0 MHz [144] (24.0 dBm)
  * 5745.0 MHz [149] (30.0 dBm)
  * 5765.0 MHz [153] (30.0 dBm)
  * 5785.0 MHz [157] (30.0 dBm)
  * 5805.0 MHz [161] (30.0 dBm)
  * 5825.0 MHz [165] (30.0 dBm)
  * 5845.0 MHz [169] (disabled)
  * 5865.0 MHz [173] (disabled)
  * 5885.0 MHz [177] (disabled)
```

Error reported from wpa_supplicant
```console
Fri Jun 21 14:07:22 2024 daemon.err wpa_supplicant[2866]: Line 10: invalid number "5320.0"
Fri Jun 21 14:07:22 2024 daemon.err wpa_supplicant[2866]: Line 10: failed to parse frequency '5320.0'.
Fri Jun 21 14:07:22 2024 daemon.err wpa_supplicant[2866]: Line 16: failed to parse network block.
Fri Jun 21 14:07:22 2024 daemon.err wpa_supplicant[2866]: Failed to read or parse configuration '/var/run/wpa_supplicant-phy1-mesh0.conf'.
```

This affects mesh, adhoc, and client-mode WDS.

Until hostapd/wpa_supplicant is updated (or patched) to support float
frequencies, ensure `get_freq` prints out an integer.

Signed-off-by: Sean Khan <datapronix@protonmail.com>
Link: https://github.com/openwrt/openwrt/pull/15770
Signed-off-by: Robert Marko <robimarko@gmail.com>
4 months agoqoriq: use 6.1 by default and drop 5.15
Robert Marko [Fri, 21 Jun 2024 11:41:33 +0000 (13:41 +0200)]
qoriq: use 6.1 by default and drop 5.15

qoriq has had kernel 6.1 as testing for 2 months now, so lets default to
it and drop 5.15 support.

Link: https://github.com/openwrt/openwrt/pull/15767
Signed-off-by: Robert Marko <robimarko@gmail.com>
4 months agotools: firmware-utils: update to Git HEAD (2024-06-20)
Christian Marangi [Fri, 21 Jun 2024 11:34:32 +0000 (13:34 +0200)]
tools: firmware-utils: update to Git HEAD (2024-06-20)

224d497dd94f srec2bin: drop unused "dum" variable
6777b2d51961 uimage_sgehdr: use "char" type for header struct strings
81db3025aac5 uimage_sgehdr: drop unused "ltmp" variable
bd7fcc74b43e pc1crypt: make decrypt/encrypt functions take void * as argument
6ac44974185a linksys: add magic header generation tool for e8350 v1

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
4 months agowifi-scripts: rewrite wifi detect code in ucode
Felix Fietkau [Tue, 11 Jun 2024 15:29:22 +0000 (17:29 +0200)]
wifi-scripts: rewrite wifi detect code in ucode

Rely entirely on /etc/board.json instead of screen scraping iw cli output

Signed-off-by: Felix Fietkau <nbd@nbd.name>
4 months agowifi-scripts: add default channel to board.json in wifi-detect.uc
Felix Fietkau [Tue, 11 Jun 2024 09:34:27 +0000 (11:34 +0200)]
wifi-scripts: add default channel to board.json in wifi-detect.uc

Preparation for avoiding iw calls in /lib/wifi/mac80211.sh

Signed-off-by: Felix Fietkau <nbd@nbd.name>
4 months agoucode: update to Git HEAD (2024-06-18)
Felix Fietkau [Wed, 19 Jun 2024 11:50:21 +0000 (13:50 +0200)]
ucode: update to Git HEAD (2024-06-18)

8cf816d615fd socket: fix potential memory leak in connect()
8f5f231d66cd socket: optimize poll() argument handling
36f106056069 socket: remove wrong documentation fragment
525fca224012 socket: uv_to_sockaddr(): fix length calculation for AF_UNIX addresses
3938645ad9e3 socket: support IPv6 addresses in struct conversion routines
3a586dc7ddbe socket: improve uc_socket_connect() behavior
7b269f1cd3d2 socket: improve uc_socket_listen() behavior
fc6f2b89febf socket: handle further socket option value types
d6f25797dad1 socket: add IPv6 socket options
7611487b9a05 socket: implement recvmsg(), sendmsg() and cmsg support
d2e44bfa8b54 core-lib: improved documentation
e0bab40c8578 fs: add truncate() file method
5d305cfb2ab7 fs: add lock() file method
8b0318f7fabe lib: introduce zlib library

Signed-off-by: Felix Fietkau <nbd@nbd.name>
4 months agoiw: update to version 6.9
Felix Fietkau [Mon, 10 Jun 2024 18:50:38 +0000 (20:50 +0200)]
iw: update to version 6.9

Signed-off-by: Felix Fietkau <nbd@nbd.name>
4 months agohostapd: use strdup on string passed to hostapd_add_iface
Felix Fietkau [Fri, 14 Jun 2024 12:17:57 +0000 (14:17 +0200)]
hostapd: use strdup on string passed to hostapd_add_iface

The data is modified within hostapd_add_iface

Signed-off-by: Felix Fietkau <nbd@nbd.name>
4 months agohostapd: fix crash on interface setup failure
Felix Fietkau [Fri, 14 Jun 2024 12:43:39 +0000 (14:43 +0200)]
hostapd: fix crash on interface setup failure

Add a missing NULL pointer check when deleting beacons

Signed-off-by: Felix Fietkau <nbd@nbd.name>
4 months agofirmware-utils: update to Git HEAD (2024-06-20)
Christian Marangi [Thu, 20 Jun 2024 21:22:01 +0000 (23:22 +0200)]
firmware-utils: update to Git HEAD (2024-06-20)

224d497dd94f srec2bin: drop unused "dum" variable
6777b2d51961 uimage_sgehdr: use "char" type for header struct strings
81db3025aac5 uimage_sgehdr: drop unused "ltmp" variable
bd7fcc74b43e pc1crypt: make decrypt/encrypt functions take void * as argument
6ac44974185a linksys: add magic header generation tool for e8350 v1

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
4 months agogeneric: platform/mikrotik: add NVMEM layout driver
Robert Marko [Sun, 9 Jun 2024 10:14:25 +0000 (12:14 +0200)]
generic: platform/mikrotik: add NVMEM layout driver

Currently, information from MikroTik hard_config is only available via
sysfs, meaning that we have to rely on userspace to for example setup MACs.

So, lets provide a basic NVMEM layout based driver to expose the same cells
as sysfs driver exposes.

Do note that the we dont extract the WLAN caldata and BDF-s at this point.

Reviewed-by: Thibaut VARÈNE <hacks@slashdirt.org>
Link: https://github.com/openwrt/openwrt/pull/15665
Signed-off-by: Robert Marko <robimarko@gmail.com>
4 months agogeneric: platform/mikrotik: move hard config tag ID-s to a header
Robert Marko [Mon, 10 Jun 2024 10:20:11 +0000 (12:20 +0200)]
generic: platform/mikrotik: move hard config tag ID-s to a header

Move the hard config tag ID-s to a separate header so they can be reused
by the NVMEM driver as well.

Link: https://github.com/openwrt/openwrt/pull/15665
Signed-off-by: Robert Marko <robimarko@gmail.com>
4 months agotools: util-linux: update to v2.40.1
Thomas Weißschuh [Sun, 16 Jun 2024 20:59:29 +0000 (22:59 +0200)]
tools: util-linux: update to v2.40.1

Release Notes:
https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.40/v2.40-ReleaseNotes
https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.40/v2.40.1-ReleaseNotes

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
4 months agoutil-linux: update to v2.40.1
Thomas Weißschuh [Sun, 16 Jun 2024 20:55:41 +0000 (22:55 +0200)]
util-linux: update to v2.40.1

Release Notes:
https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.40/v2.40-ReleaseNotes
https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.40/v2.40.1-ReleaseNotes

Remove upstreamed:
001-meson-properly-handle-gettext-non-existence.patch

New:
0001-meson-Fix-build-python-option.patch

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
4 months agoath79: trim useless package kmod-leds-reset for some devices
Shiji Yang [Wed, 19 Jun 2024 10:53:01 +0000 (10:53 +0000)]
ath79: trim useless package kmod-leds-reset for some devices

Only NETGEAR WNDR3x00 series devices have reset controller LED.

Signed-off-by: Shiji Yang <yangshiji66@qq.com>
4 months agoath79: disable unnecessary driver CONFIG_LEDS_RESET
Shiji Yang [Wed, 19 Jun 2024 10:52:37 +0000 (10:52 +0000)]
ath79: disable unnecessary driver CONFIG_LEDS_RESET

This driver has already been packed as a software package. There is
no need to build it into the kernel.

Signed-off-by: Shiji Yang <yangshiji66@qq.com>
4 months agoath79: add back usb LED label for NETGEAR WNDR3x00 devices
Shiji Yang [Wed, 19 Jun 2024 10:52:03 +0000 (10:52 +0000)]
ath79: add back usb LED label for NETGEAR WNDR3x00 devices

The "reset-leds" driver does not support parsing color and function
properties.

Signed-off-by: Shiji Yang <yangshiji66@qq.com>
4 months agobcm27xx: fix malformed upstream arm64 DT patch
Álvaro Fernández Rojas [Wed, 19 Jun 2024 18:17:44 +0000 (20:17 +0200)]
bcm27xx: fix malformed upstream arm64 DT patch

This patch was causing buildbot issues when copying arm64 DT files since
bcm283x-rpi-csi1-2lane.dtsi and bcm283x-rpi-lan7515.dtsi were linked to
"../../../../arm/boot/dts/" instead of "../../../../arm/boot/dts/broadcom".
These files aren't needed, so let's remove them instead of fixing them.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/15762
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
4 months agoapk: limit CONFIG_IPK_FILES_CHECKSUMS config to OPKG
Christian Marangi [Thu, 20 Jun 2024 03:51:07 +0000 (05:51 +0200)]
apk: limit CONFIG_IPK_FILES_CHECKSUMS config to OPKG

Limit CONFIG_IPK_FILES_CHECKSUMS config to OPKG as APK have different
way to validate package integrity (apk audit)

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
4 months agoRevert "apk: limit CONFIG_IPK_FILES_CHECKSUMS config to OPKG"
Christian Marangi [Thu, 20 Jun 2024 03:49:21 +0000 (05:49 +0200)]
Revert "apk: limit CONFIG_IPK_FILES_CHECKSUMS config to OPKG"

This reverts commit 25bbefcdd9424ed1b6ef35a39e84420fc4cce322.

Only the Config-build.in change needed to be merged and this contains
leftover from previous revision of the feature.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
4 months agoath79: ag71xx: support probe defferal for getting MAC address
Robert Marko [Wed, 19 Jun 2024 09:26:47 +0000 (11:26 +0200)]
ath79: ag71xx: support probe defferal for getting MAC address

Currently, of_get_ethdev_address() return is checked for any return error
code which means that trying to get the MAC from NVMEM cells that is backed
by MTD will fail if it was not probed before ag71xx.

So, lets check the return error code for EPROBE_DEFER and defer the ag71xx
probe in that case until the underlying NVMEM device is live.

Link: https://github.com/openwrt/openwrt/pull/15752
Signed-off-by: Robert Marko <robimarko@gmail.com>
4 months agoipq40xx: net/ipqess: fix outbound port tag computation
Matthias Schiffer [Wed, 19 Jun 2024 23:05:51 +0000 (01:05 +0200)]
ipq40xx: net/ipqess: fix outbound port tag computation

Since the introduction of out-of-band tagging, writing the outbound tag
had been completely broken: First, in place of a port mask containing
the port number, just the port number itself was set in the register
value. Just after that, the full port mask 0x3e (all 5 external ports)
was set unconditionally.

This remained unnoticed because the switch would then use the FDB to
decide where to send unicast packets; broadcast and multicast packets
were however sent to every port.

Fix the port tag computation and only use the full port mask as a
fallback for non-DSA mode, as it was done in the older driver patches
used on Linux 5.15.

Fixes: cd9c7211241e ("ipq40xx: 6.1: use latest DSA and ethernet patches")
Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
Signed-off-by: Robert Marko <robimarko@gmail.com>
4 months agokernel: bump 6.1 to 6.1.94
Zxl hhyccc [Mon, 17 Jun 2024 16:04:43 +0000 (00:04 +0800)]
kernel: bump 6.1 to 6.1.94
https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.1.94

All other patches automatically rebased.

Build system: Kirkwood bcm53xx

Signed-off-by: Zxl hhyccc <zxlhhy@gmail.com>
4 months agolantiq: fix pci driver once again
Martin Schiller [Mon, 17 Jun 2024 06:27:59 +0000 (08:27 +0200)]
lantiq: fix pci driver once again

In my previous attempt to solve the PCI problems for the lantiq targets,
I did not pay attention to the fact that the original accesses to the
GPIO took place in RAW mode. As a result, the polarity defined in the
device trees (apart from the initial value) was irrelevant.

In addition, the expected name of the GPIO in the dts has changed due to
the upstream change and therefore no RESET is currently performed.

As discussed in [1] on the linux-mips mailing list, we will now adapt
the dts files accordingly instead of patching the driver:

- dts property will be renamed to "reset-gpios"
- Polarity is set to "GPIO_ACTIVE_LOW".

I have verified this with a TP-Link TD-W8980. The PCI device is now
recognized by the system.

[1] https://patchwork.kernel.org/project/linux-mips/patch/20240607090400.1816612-1-ms@dev.tdt.de/

Signed-off-by: Martin Schiller <ms@dev.tdt.de>
Tested-by: Aleksander Jan Bajkowski <olek2@wp.pl> # Tested on AVM 7330 (ar9)
Link: https://github.com/openwrt/openwrt/pull/15731
Signed-off-by: Robert Marko <robimarko@gmail.com>
4 months agogeneric: backport pending driver for Winchip CH348 USB serial
Daniel Golle [Mon, 17 Jun 2024 14:31:12 +0000 (15:31 +0100)]
generic: backport pending driver for Winchip CH348 USB serial

Import patch and package kernel module for Winchip CH348
USB-to-8x-UART chip.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
4 months agogeneric: 6.6: mt7530: add support for bridge port isolation
Daniel Golle [Wed, 19 Jun 2024 12:33:23 +0000 (13:33 +0100)]
generic: 6.6: mt7530: add support for bridge port isolation

Import patches accepted upstream introducing port isolation feature
on MT7530 switches:
  - [net-next,v3,1/2] net: dsa: mt7530: factor out bridge join/leave logic
    https://git.kernel.org/netdev/net-next/c/c25c961fc7f3
  - [net-next,v3,2/2] net: dsa: mt7530: add support for bridge port isolation
    https://git.kernel.org/netdev/net-next/c/3d49ee2127c2

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
4 months agokernel: bump 6.6 to 6.6.34
John Audia [Wed, 19 Jun 2024 11:56:04 +0000 (07:56 -0400)]
kernel: bump 6.6 to 6.6.34

Changelog: https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.6.34

Removed upstreamed:
backport-6.6/701-v6.8-net-sfp-bus-fix-SFP-mode-detect-from-bitrate.patch[1]

All other patches automatically rebased.

Build system: x86/64
Build-tested: x86/64/AMD Cezanne, flogic/xiaomi_redmi-router-ax6000-ubootmod, ramips/tplink_archer-a6-v3
Run-tested: x86/64/AMD Cezanne, flogic/xiaomi_redmi-router-ax6000-ubootmod, ramips/tplink_archer-a6-v3

1. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.6.34&id=9399baa02e4b7f101c39fdbc4d681d54bca4465b

Signed-off-by: John Audia <therealgraysky@proton.me>
4 months agomac80211: backport upstream patch for tim->virtual_map flex array warn
Christian Marangi [Wed, 19 Jun 2024 16:03:01 +0000 (18:03 +0200)]
mac80211: backport upstream patch for tim->virtual_map flex array warn

Backport upstream patch for tim->virtual_map flex array warning for
invalid write.

This has been notice with the bump of ath10k-ct to version 6.7.

Link: https://github.com/openwrt/openwrt/pull/15760
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
4 months agobcm27xx: base-files: diag: fix LEDs
Álvaro Fernández Rojas [Wed, 19 Jun 2024 18:03:29 +0000 (20:03 +0200)]
bcm27xx: base-files: diag: fix LEDs

At some point RPi LEDs were renamed from led0/led1 to PWR/ACT.
This patch fixes this and also automatically detects the status_led without
relying on board_name.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
4 months agobcm27xx: drop kernel 6.1 support
Álvaro Fernández Rojas [Tue, 18 Jun 2024 20:10:25 +0000 (22:10 +0200)]
bcm27xx: drop kernel 6.1 support

kernel 6.1 can be dropped since 6.6 is the default kernel.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
4 months agobcm27xx: switch default kernel to 6.6
Álvaro Fernández Rojas [Tue, 18 Jun 2024 20:04:57 +0000 (22:04 +0200)]
bcm27xx: switch default kernel to 6.6

Update default kernel version to 6.6 for the Raspberry Pi devices.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>