openwrt/staging/jow.git
9 months agodnsmasq: rework network interface ignore master
Yegor Yefremov [Thu, 15 Feb 2024 08:43:09 +0000 (09:43 +0100)]
dnsmasq: rework network interface ignore

In some situations (slow protocol or interfaces with auto 0), the
interfaces are not available during the dnsmasq initialization and
hence, the ignore setting will be skipped.

Install an interface trigger for ignored interfaces in case their
ifname cannot be resolved.

Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
[bump PKG_RELEASE]
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
9 months agoucode: update to Git HEAD (2024-02-21)
Jo-Philipp Wich [Wed, 21 Feb 2024 21:33:00 +0000 (22:33 +0100)]
ucode: update to Git HEAD (2024-02-21)

ee4af9b55cb4 vm: rework object iteration
a275399dd8e2 uci: refactor uci.changes() to match documentation
ba3855ae3775 lib: fix documentation typo for `pop()` function

Fixes: https://github.com/jow-/ucode/issues/188
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
9 months agoipq40xx: add PCIe magic hack to improve VRX518 compatibility
Jan Hoffmann [Mon, 30 Jan 2023 22:40:20 +0000 (23:40 +0100)]
ipq40xx: add PCIe magic hack to improve VRX518 compatibility

Some VRX518 modems fail to initialize properly with the error message
"dc_ep_clk_on failed". As a result, the DSL data path doesn't work.

This hack, which is based on code from the FRITZ!Box 7530 GPL archive,
fixes the issue. It changes the PCIe vendor/device ID to values matching
a Lantiq SoC. It also appears to emulate a Lantiq CPU ID register for
connected PCIe devices, by remapping the matching address area to a
specially crafted buffer using the address translation unit.

The hack is only active if the "avm,host_magic" property is specified in
the device tree, so this shouldn't affect any devices other than
FRITZ!Box 7530/7520.

Signed-off-by: Jan Hoffmann <jan@3e8.eu>
9 months agouhttpd: add default LuCI ucode prefix
Jo-Philipp Wich [Mon, 19 Sep 2022 12:36:51 +0000 (14:36 +0200)]
uhttpd: add default LuCI ucode prefix

Similar to the existing LuCI Lua plugin prefix, add an ucode plugin prefix
which becomes effective once uhttpd-mod-ucode is installed.

This will speedup executing ucode based LuCI since sources are held in
memory in precompiled form, reducing the per-request startup overhead.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
9 months agodnsmasq: add a new "dnsfilter" configuration option
Rui Salvaterra [Mon, 13 Dec 2021 15:00:17 +0000 (15:00 +0000)]
dnsmasq: add a new "dnsfilter" configuration option

Add UCI support for record filtering in dnsmasq replies. The new "dnsfilter"
option can take either "A" or "AAAA" as possible values, enabling filtering of
IPv4 or IPv6 addresses, respectively.

Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
9 months agodnsmasq: add a new "bind" configuration option
Rui Salvaterra [Thu, 8 Jul 2021 10:33:07 +0000 (11:33 +0100)]
dnsmasq: add a new "bind" configuration option

The nonwildcard option only allows to choose between the default behaviour (bind
to the wildcard address only, which unfeasible when running multiple instances
of dnsmasq) and --bind-dynamic (bind to any existing/new interfaces which aren't
explicitly configured otherwise). Add a new "bind" option, which can take the
value of "dynamic" or "interfaces", allowing the user to additionally choose the
--bind-interfaces behaviour (bind only to explicitly configured interfaces).

The dnsmasq man page [1] contains more detailed information about these
arguments. Finally, the nonwildcard option is kept for backwards compatibility.

[1] https://thekelleys.org.uk/dnsmasq/docs/dnsmasq-man.html

Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
9 months agodnsmasq: enable dnsmasq's new nftables support
Kevin Darbyshire-Bryant [Mon, 29 Nov 2021 17:16:39 +0000 (17:16 +0000)]
dnsmasq: enable dnsmasq's new nftables support

Add build option for nftables sets.

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
[Fix typos]
Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
9 months agodnsmasq: source RFC6761 file first
Kevin Darbyshire-Bryant [Mon, 5 Jul 2021 09:34:15 +0000 (10:34 +0100)]
dnsmasq: source RFC6761 file first

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
9 months agodnsmasq: use hostsdir instead of addn-hosts
Kevin Darbyshire-Bryant [Fri, 10 May 2019 19:14:59 +0000 (20:14 +0100)]
dnsmasq: use hostsdir instead of addn-hosts

dnsmasq will dynamically scan changes/additions to hosts in hostsdir whereas
addn-hosts needs a SIGHUP.

Take advantage of this automatic updating in preparation for a dhcpd
update take only signals
addn-hosts

-       xappend "--addn-hosts=$(dirname $HOSTFILE)"
+       xappend "--hostsdir=$(dirname $HOSTFILE)"

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
9 months agodnsmasq: remove check for existing dhcp server
Kevin Darbyshire-Bryant [Wed, 1 Feb 2017 11:49:31 +0000 (11:49 +0000)]
dnsmasq: remove check for existing dhcp server

Remove check for existing dhcp server on interface.  This check could
already be overridden by using 'force' parameter so this change
forces 'force'.

Signed-off-by: Kevin Darbyshire-Bryant <kevin@darbyshire-bryant.me.uk>
9 months agotreewide: drop librt and libpthread packages
Jo-Philipp Wich [Fri, 18 Dec 2020 16:31:28 +0000 (17:31 +0100)]
treewide: drop librt and libpthread packages

Since OpenWrt's main libc library, musl, does not provide separate shared
object files for libpthread and librt, the existing binary packages for
them are empty placeholders which provide no runtime functionality and
frequently cause confusion among users who attempt to build software
linking -lrt or -lpthread on target.

To clean this situation up somewhat and to simplify binary package
dependecies for all of the potential musl, glibc and uclibc cases, drop
those packages and move libpthread.so as well as librt.so into the main
libc package for those libc implementations that happen ship them as
extra shared libraries.

Also let the abstract libc package provide virtual libpthread and librt
packages in order to ease migration for packages that still explicitly
depend on them.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
9 months agoscripts: download.pl: ensure to ignore any existing .curlrc
Jo-Philipp Wich [Sun, 15 Nov 2020 16:48:36 +0000 (17:48 +0100)]
scripts: download.pl: ensure to ignore any existing .curlrc

Pass `-q` to the invoked curl command to ensure that any existing .curlrc
is ignored.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
9 months agodownload.pl: add jsDelivr mirror for GitHub
DENG Qingfang [Sat, 2 Nov 2019 15:10:40 +0000 (23:10 +0800)]
download.pl: add jsDelivr mirror for GitHub

jsDelivr has CDN servers in Mainland China (as well as rest of the world)
so it can be used to accelerate downloading.

jsDelivr uses the following URL for GitHub files:
https://cdn.jsdelivr.net/gh/{username}/{repo}@{revision}/path/to/file

For compatibility, the script will replace the 2nd '/' with '@' when
pushing the jsDelivr URL to mirrors.

Signed-off-by: DENG Qingfang <dengqf6@mail2.sysu.edu.cn>
9 months agonetifd: mbim.sh: only check pin1 for failure
James Christopher Adduono [Tue, 18 Jun 2019 21:52:29 +0000 (17:52 -0400)]
netifd: mbim.sh: only check pin1 for failure

Sierra MC7xxx and EM7xxx series cards will always respond
with 3 - pin2 required on pinstate check. We have to ignore
required pins other than pin1 and proceed in order to connect.

Signed-off-by: James Christopher Adduono <jc@adduono.com>
9 months agonetifd: mbim.sh: drop deprecated uci_x_state usage
James Christopher Adduono [Tue, 18 Jun 2019 21:41:00 +0000 (17:41 -0400)]
netifd: mbim.sh: drop deprecated uci_x_state usage

Signed-off-by: James Christopher Adduono <jc@adduono.com>
9 months agoInclude new extensions in uhttpd self-signed certs
Pat Fruth [Sun, 20 Oct 2019 20:51:34 +0000 (14:51 -0600)]
Include new extensions in uhttpd self-signed certs

The introduction of MacOS Catalina includes new requirements for self-signed certificates.
See: https://support.apple.com/en-us/HT210176
These new requirements include the addition of two TLS server certificate extensions.
- extendedKeyUsage
- subjectAltName
The extendedKeyUsage must be set to serverAuth.
The subjectAltName must be set to the DNS name of the server.
In the absense of these new extensions, when the LUCI web interface is configured to use HTTPS and
self-signed certs, MacOS user running Google Chrome browsers will not be able to access the LUCI web enterface.
If you are generating self-signed certs which do not include that extension, Chrome will
report "NET::ERR_CERT_INVALID" instead of "NET::ERR_CERT_AUTHORITY_INVALID".  You can click through to
ignore the latter, but not the former.

This change updates the uhttpd init script to generate self-signed cert that meets the new requirements.
Signed-off-by: Pat Fruth <pat@patfruth.com>
9 months agoprocd: procd.sh: make no assumptions about init script path
Jo-Philipp Wich [Thu, 20 Aug 2020 14:17:34 +0000 (16:17 +0200)]
procd: procd.sh: make no assumptions about init script path

Init scripts in /etc/init.d/ may be symlinks pointing elsewhere, so it
is not safe to assume that the basename of the real path is existing.

Instead of trying to reassemble the target path from the basename when
setting up triggers, trust the result of readlink and fall back to
`$initscript` which corresponds to `argv[0]` when readlink failed.

This fixes reload trigger setup for init script symlinks that point
to files with different base names.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
9 months agomac80211: add a fix for racy drv_sta_rc_update calls
Felix Fietkau [Wed, 21 Feb 2024 14:28:31 +0000 (15:28 +0100)]
mac80211: add a fix for racy drv_sta_rc_update calls

Fixes potential crash issues in mt76 and other drivers

Signed-off-by: Felix Fietkau <nbd@nbd.name>
9 months agoramips: clean up useless dts partition labels
Shiji Yang [Sat, 17 Feb 2024 14:10:10 +0000 (22:10 +0800)]
ramips: clean up useless dts partition labels

The previous NVMEM eeprom conversions[1][2] left a lot of partition
labels that were no longer used. They can be removed now.

[1] https://github.com/openwrt/openwrt/pull/13584
[2] https://github.com/openwrt/openwrt/pull/13587

Signed-off-by: Shiji Yang <yangshiji66@qq.com>
9 months agorockchip: add Radxa CM3 IO board support
Marius Durbaca [Tue, 20 Feb 2024 14:34:43 +0000 (14:34 +0000)]
rockchip: add Radxa CM3 IO board support

Hardware
--------
RockChip RK3566 ARM64 (4 cores)
- up to 8GB LPDDR4X
- 1x HDMI,
- 2x MIPI DSI
- 2x MIPI CSI2
- 1x eDP
- 1x PCIe card
- 2x SATA
- 2x USB 2.0 Host
- 1x USB 3.0
- 1x USB 2.0 OTG
- 10/100/1000 Base-T
- microSD slot
- 40-pin GPIO expansion header
- 12V DC

Radxa CM3 needs to mount on top of this IO board in order to create
complete Radxa CM3 IO board platform.

Installation
------------
Uncompress the OpenWrt sysupgrade and write it to a micro SD card or
internal eMMC using dd.

Reviewed-by: Tianling Shen <cnsztl@immortalwrt.org>
Signed-off-by: Marius Durbaca <mariusd84@gmail.com>
9 months agouboot-rockchip: add Radxa CM3 IO board support
Marius Durbaca [Tue, 20 Feb 2024 14:33:11 +0000 (14:33 +0000)]
uboot-rockchip: add Radxa CM3 IO board support

Add support for the Radxa CM3 IO board.

Reviewed-by: Tianling Shen <cnsztl@immortalwrt.org>
Signed-off-by: Marius Durbaca <mariusd84@gmail.com>
9 months agorkbin: add rk3566 atf/tpl blobs
Marius Durbaca [Mon, 19 Feb 2024 18:33:24 +0000 (18:33 +0000)]
rkbin: add rk3566 atf/tpl blobs

Currently there are no atf/tpl blobs for rk3566 SoCs
so this commit adds the prebuilt firmware from the vendor.

Signed-off-by: Marius Durbaca <mariusd84@gmail.com>
9 months agomac80211: add AQL support for broadcast/multicast packets
Felix Fietkau [Fri, 9 Feb 2024 19:47:39 +0000 (20:47 +0100)]
mac80211: add AQL support for broadcast/multicast packets

Should improve performance/reliability with lots of mcast packets

Signed-off-by: Felix Fietkau <nbd@nbd.name>
9 months agomac80211: update to 6.6.15
Robert Marko [Sun, 4 Feb 2024 12:24:29 +0000 (13:24 +0100)]
mac80211: update to 6.6.15

Update backports to the latest 6.6 point release.

Signed-off-by: Robert Marko <robimarko@gmail.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
9 months agogeneric: replace simple AQR hack patch with upstream version
Christian Marangi [Thu, 15 Feb 2024 20:23:38 +0000 (21:23 +0100)]
generic: replace simple AQR hack patch with upstream version

Simple AQR hack patch has been merged upstream, hence we can drop it from
hack directory and move it to backport.

The patch for 5.15 are correctly reworked to align to outdated API.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
9 months agobuild: don't drop 'user' flag when using the ImageBuilder
Daniel Golle [Tue, 20 Feb 2024 21:14:03 +0000 (21:14 +0000)]
build: don't drop 'user' flag when using the ImageBuilder

Commit be9023ed43 ("build: fix opkg flags in rootfs") introduced a
call to 'awk' which removes the 'user' flag from all installed
packages in the opkg status file. While is is somehow desireable when
building images directly within the buildroot, when using the
ImageBuilder dropping the 'user' flag means loosing information about
a package being deliberately selected or just implicitely pulled as a
dependency. And that then break tools like 'auc' which request only
packages having the 'user' flag from the asu server, resulting in
broken images being delivered to users.

Restore the original behavior in case of an image being created using
the ImageBuilder.

Fixes: be9023ed43 ("build: fix opkg flags in rootfs")
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
9 months agobuild: add explicit --no-show-signature for git
Oto Šťáva [Fri, 16 Feb 2024 15:28:10 +0000 (16:28 +0100)]
build: add explicit --no-show-signature for git

When `log.showSignature` is set, it causes the `SOURCE_DATE_EPOCH` to
include a textual signature description on OpenPGP-signed commits,
because Git prints the description into stdout. This then causes some
scripts to fail because they cannot parse the date from the variable.

Adding an explicit `--no-show-signature` prevents the signatures from
being displayed even when one has Git configured to show them by
default, fixing the scripts.

Signed-off-by: Oto Šťáva <oto.stava@gmail.com>
9 months agomediatek: filogic: fix mt7981 DT nodenames
Rafał Miłecki [Tue, 20 Feb 2024 11:00:34 +0000 (12:00 +0100)]
mediatek: filogic: fix mt7981 DT nodenames

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
9 months agomediatek: filogic: improve mt7981 DT coding style
Rafał Miłecki [Tue, 20 Feb 2024 10:49:26 +0000 (11:49 +0100)]
mediatek: filogic: improve mt7981 DT coding style

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
9 months agomediatek: filogic: reorder mt7981 DT properties
Rafał Miłecki [Tue, 20 Feb 2024 10:44:24 +0000 (11:44 +0100)]
mediatek: filogic: reorder mt7981 DT properties

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
9 months agomediatek: filogic: reorder mt7981 DT SoC reg-based nodes
Rafał Miłecki [Tue, 20 Feb 2024 10:21:42 +0000 (11:21 +0100)]
mediatek: filogic: reorder mt7981 DT SoC reg-based nodes

Follow upstream Linux kernel guidelines:
https://www.kernel.org/doc/html/next/devicetree/bindings/dts-coding-style.html#order-of-nodes

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
9 months agomediatek: filogic: reorder mt7981 DT name-based nodes
Rafał Miłecki [Tue, 20 Feb 2024 09:42:40 +0000 (10:42 +0100)]
mediatek: filogic: reorder mt7981 DT name-based nodes

Follow upstream Linux kernel guidelines:
https://www.kernel.org/doc/html/next/devicetree/bindings/dts-coding-style.html#order-of-nodes

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
9 months agogeneric: 6.1: add missing symbol for EN8811H PHY driver
Robert Marko [Mon, 19 Feb 2024 20:38:40 +0000 (21:38 +0100)]
generic: 6.1: add missing symbol for EN8811H PHY driver

Disable Airoha EN8811H PHY driver by default to avoid individual targets having to
disable it.

Signed-off-by: Robert Marko <robimarko@gmail.com>
9 months agorockchip: add NanoPi R4S Enterprise Edition build
Tianling Shen [Sat, 17 Feb 2024 05:54:36 +0000 (13:54 +0800)]
rockchip: add NanoPi R4S Enterprise Edition build

FriendlyElec renamed the NanoPi R4S board with EEPROM (mac address)
to "enterprise" edition, and it was added as a "new" board in upstream
kernel.

This patch switched to use that upstreamed dts and removed local
EEPROM patch.

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
9 months agoath79: update WA/XC devices UBNT_VERSION to 8.7.4
Martin Garbe [Tue, 13 Feb 2024 06:49:05 +0000 (07:49 +0100)]
ath79: update WA/XC devices UBNT_VERSION to 8.7.4

Ubiquiti WA devices with newer hw version (sold 2023)
require UBNT_VERSION to be at least 8.7.4, otherwise
the image is rejected.

For consistency, also increase version number for XC devices.

Signed-off-by: Martin Garbe <monomartin@opennet-initiative.de>
9 months agorockchip: add NanoPi R2C Plus support
Tianling Shen [Fri, 16 Feb 2024 06:34:40 +0000 (14:34 +0800)]
rockchip: add NanoPi R2C Plus support

The NanoPi R2C Plus is a small variant of NanoPi R2C with a on-board
eMMC flash (8G) included.

Installation
------------
Uncompress the OpenWrt sysupgrade and write it to a micro SD card or
internal eMMC using dd.

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
9 months agouboot-rockchip: add NanoPi R2C Plus support
Tianling Shen [Fri, 16 Feb 2024 06:33:49 +0000 (14:33 +0800)]
uboot-rockchip: add NanoPi R2C Plus support

Add support for the FriendlyARM NanoPi R2C Plus.

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
9 months agoqualcommax: backport more changes for ipq6018 and ipq8074
Chukun Pan [Mon, 15 Jan 2024 15:28:13 +0000 (23:28 +0800)]
qualcommax: backport more changes for ipq6018 and ipq8074

 - Mark patches as upstream
 - Backport more upstream changes
 - Handle conflicts and refresh patches

Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
9 months agobase-files: sysupgrade: include uci-defaults script disabling services
Rafał Miłecki [Wed, 14 Feb 2024 15:05:19 +0000 (16:05 +0100)]
base-files: sysupgrade: include uci-defaults script disabling services

Disabled services should be kept disabled after sysupgrade. This can be
easily handled using a proper uci-defaults script.

Extend sysupgrade to check for disabled services, generate uci-defaults
script disabling them and include it in backup.

Cc: Christian Marangi <ansuelsmth@gmail.com>
Cc: Jo-Philipp Wich <jo@mein.io>
Cc: Jonas Gorski <jonas.gorski@gmail.com>
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Acked-by: Jo-Philipp Wich <jo@mein.io>
9 months agobase-files: sysupgrade: always setup overlay when creating backup
Rafał Miłecki [Tue, 13 Feb 2024 21:10:37 +0000 (22:10 +0100)]
base-files: sysupgrade: always setup overlay when creating backup

Setting overlay while creating backup allows including extra files in
archive without actually writing them to flash. Right now this feature
is limited to /etc/backup/ directory and is used only for including
installed_packages.txt.

Extend this solution to make it more generic:
1. Always mount overlay while creating backup
2. Overlay whole / to don't limit it to /etc/backup/

This allows including any additional files in backups and adding more
sysupgrade features.

Cc: Luiz Angelo Daros de Luca <luizluca@gmail.com>
Cc: Christian Marangi <ansuelsmth@gmail.com>
Cc: Jo-Philipp Wich <jo@mein.io>
Cc: Jonas Gorski <jonas.gorski@gmail.com>
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
9 months agobase-files: sysupgrade: always cleanup after backups
Luiz Angelo Daros de Luca [Thu, 20 Oct 2022 02:27:52 +0000 (23:27 -0300)]
base-files: sysupgrade: always cleanup after backups

When tar was failing, it was exiting immediately. Some files and the
tmpfs mount (-k) would remain breaking the next backup attempt.

Also remove redundant $? from exit builtin call as exit already returns
the last command exit code when called.

Signed-off-by: Luiz Angelo Daros de Luca <luizluca@gmail.com>
9 months agobase-files: sysupgrade: do not hide tar errors
Luiz Angelo Daros de Luca [Thu, 20 Oct 2022 02:12:49 +0000 (23:12 -0300)]
base-files: sysupgrade: do not hide tar errors

tar stderr was probably discarded only to remove this message:

  tar: removing leading '/' from member names

However, together with that, any other error would also be discarded.
It is easier to fix that allowing the error message to be printed.

In sysupgrade, the backup file list only uses absolute paths. That way,
the solution is to remove the leading '/' from all files (sed) and chdir
to / (option -C /)

Signed-off-by: Luiz Angelo Daros de Luca <luizluca@gmail.com>
9 months agomediatek: filogic: move mt7981 on-SoC blocks to "soc" node in DT
Rafał Miłecki [Mon, 19 Feb 2024 05:36:37 +0000 (06:36 +0100)]
mediatek: filogic: move mt7981 on-SoC blocks to "soc" node in DT

It's a standard way of grouping on-SoC hardware blocks and this matches
upstream DTS.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
9 months agomediatek: filogic: fix nvmem cell names of the GL.iNet MT-2500
Daniel Golle [Sun, 18 Feb 2024 05:02:38 +0000 (05:02 +0000)]
mediatek: filogic: fix nvmem cell names of the GL.iNet MT-2500

Fix style of nvmem cell names in the device tree of the GL.iNet MT-2500.

Fixes: 49ed52b862 ("mediatek: filogic: convert GL.iNet MT-2500 to use NVMEM-on-MMC)"
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
9 months agolinux-firmware: intel: add BE200 wifi firmware
Janusz Dziedzic [Thu, 1 Feb 2024 08:37:54 +0000 (09:37 +0100)]
linux-firmware: intel: add BE200 wifi firmware

Add option to install Intel BE200 firmware
required by iwlwifi driver and Wifi7 hardware.

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@gmail.com>
9 months agoimx: remove 5.15 support
Koen Vandeputte [Tue, 13 Feb 2024 10:18:16 +0000 (11:18 +0100)]
imx: remove 5.15 support

Drop all 5.15 files as 6.1 is the default now

Signed-off-by: Koen Vandeputte <koen.vandeputte@citymesh.com>
9 months agoimx: switch to kernel 6.1
Koen Vandeputte [Tue, 13 Feb 2024 10:18:03 +0000 (11:18 +0100)]
imx: switch to kernel 6.1

I have this kernel running for weeks some
on a lot of boards in multiple scenarios

Signed-off-by: Koen Vandeputte <koen.vandeputte@citymesh.com>
9 months agokernel: bump 6.1 to 6.1.78
John Audia [Fri, 16 Feb 2024 21:57:53 +0000 (16:57 -0500)]
kernel: bump 6.1 to 6.1.78

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

Manually rebased:
bcm27xx/patches-6.1/950-0865-usb-dwc3-Set-DMA-and-coherent-masks-early.patch
bcm27xx/patches-6.1/950-0124-Add-support-for-all-the-downstream-rpi-sound-card-dr.patch

All other patches automatically rebased.

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

Signed-off-by: John Audia <therealgraysky@proton.me>
9 months agomvebu: drop kernel 5.15 config and patches
Stefan Kalscheuer [Sat, 17 Feb 2024 16:59:08 +0000 (17:59 +0100)]
mvebu: drop kernel 5.15 config and patches

With default now being at 6.1 we can remove all 5.15 components.

Signed-off-by: Stefan Kalscheuer <stefan@stklcode.de>
9 months agomvebu: switch to kernel 6.1
Stefan Kalscheuer [Sat, 17 Feb 2024 16:55:43 +0000 (17:55 +0100)]
mvebu: switch to kernel 6.1

After a few months of testing it's time to move to 6.1 by default.

Signed-off-by: Stefan Kalscheuer <stefan@stklcode.de>
9 months agoca-certificates: update to version 20240203
Seo Suchan [Sat, 17 Feb 2024 23:58:54 +0000 (08:58 +0900)]
ca-certificates: update to version 20240203

Update Mozilla certificate authority bundle to version 2.64

Signed-off-by: Seo Suchan <tjtncks@gmail.com>
9 months agorealtek: fix Netgear GS110TPP OEM install
Bjørn Mork [Sat, 17 Feb 2024 14:03:40 +0000 (15:03 +0100)]
realtek: fix Netgear GS110TPP OEM install

Recent OEM firmware versions test the version number embedded in the uimage
"name" header field. The exact restricton is unknown, but "7.0.8.4" seems
to be the lowest number accepted on a GS110TPPv1 which already has that
version or higher.

A "9.9.9.9" version is accepted as valid by the GS110TPPv1 OEM firmware,
and considered both unique enough to identify an OpenWrt image and
moderately future proof against OEM version bumps.

This change is also boot tested on a GS108Tv3 with

 "BOOT Loader Version 1.0.0.2 (2018-08-31 17:05:26 UTC)"

to verify that it doesn't break boot on older hardware.

Link: https://forum.openwrt.org/t/72510/58
Signed-off-by: Bjørn Mork <bjorn@mork.no>
9 months agomediatek: filogic: convert GL.iNet MT-2500 to use NVMEM-on-MMC
Daniel Golle [Sat, 17 Feb 2024 22:22:28 +0000 (22:22 +0000)]
mediatek: filogic: convert GL.iNet MT-2500 to use NVMEM-on-MMC

Use nvmem-layout in device tree instead of extracting MAC addresses
in userspace.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
9 months agomediatek: mt7981: remove inaccurate compatible strings
Daniel Golle [Sun, 18 Feb 2024 03:13:23 +0000 (03:13 +0000)]
mediatek: mt7981: remove inaccurate compatible strings

Remove more inaccurate compatible strings from various clock controllers
of the MT7981 SoC.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
9 months agomediatek: mt7981: prevent system freezes on boot
Daniel Golle [Sun, 18 Feb 2024 03:12:01 +0000 (03:12 +0000)]
mediatek: mt7981: prevent system freezes on boot

Import patch to make sure SGM_REG_SEL clock is always enabled as it
seems that more registers than just SGMIISYS0 and SGMIISYS1 are
depending on that clock being enabled.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
9 months agomediatek: filogic: convert GL.iNet MT-6000 to NVMEM-on-MMC
Daniel Golle [Sat, 17 Feb 2024 22:14:01 +0000 (22:14 +0000)]
mediatek: filogic: convert GL.iNet MT-6000 to NVMEM-on-MMC

Now that we can reference MMC partitions in device tree, use that
to get rid of Wi-Fi EEPROM and MAC address setup in userspace.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
9 months agokernel: nvmem: correctly assign fwnode to MMC block device
Daniel Golle [Sun, 18 Feb 2024 01:02:46 +0000 (01:02 +0000)]
kernel: nvmem: correctly assign fwnode to MMC block device

Use device_set_node to make sure OF node gets assigned on block
devices to be used as NVMEM providers. While block partitions were
already working fine as NVMEM providers, bare block devices such as
mmcblk0boot1 will not work without this change.

Fixes: fc153aa8d9 ("kernel: import pending patches adding support for NVMEM on UBI and MMC")
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
9 months agoqualcommax: ipq807x: wax630: correct UNIPHY2 MAC mode
Robert Marko [Sat, 17 Feb 2024 16:44:20 +0000 (17:44 +0100)]
qualcommax: ipq807x: wax630: correct UNIPHY2 MAC mode

UNIPHY2 on the WAX630 is connected to a QCA8081 PHY which is only 2.5G and
it does not support using USXGMII at all but rather only SGMII or SGMII+.

Tested-by: Kristian Skramstad <kristian+github@83.no>
Signed-off-by: Robert Marko <robimarko@gmail.com>
9 months agomediatek: dts: mt7981: fix ethsys clock compatible
Daniel Golle [Sat, 17 Feb 2024 17:54:05 +0000 (17:54 +0000)]
mediatek: dts: mt7981: fix ethsys clock compatible

Remove inaccurate compatible string 'mediatek,mt7986-ethsys' which
results in the wrong clock driver probing on MT7981 with Linux 6.1 and
ends up freezing the system once WED is used.

Fixes: da970d63fb ("mediatek: switch to Linux version 6.1")
Reported-by: Chen Minqiang <ptpt52@gmail.com>
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
9 months agomediatek: filogic: replace built-in Aquantia driver with module
Rafał Miłecki [Wed, 17 Jan 2024 21:20:15 +0000 (22:20 +0100)]
mediatek: filogic: replace built-in Aquantia driver with module

Some Aquantia PHYs (e.g. AQR113C) require firmware to be uploaded by
host system. With built-in drivers this doesn't work in OpenWrt /
embeddded as filesystem isn't available during PHY probe. That results
in delays like:
[    1.588068] Aquantia AQR113C mdio-bus:00: Falling back to sysfs fallback for: Rhe-05.06-Candidate9-AQR_Mediatek_23B_P5_ID45824_LCLVER1.cld
[   64.526387] Aquantia AQR113C mdio-bus:00: failed to find FW file Rhe-05.06-Candidate9-AQR_Mediatek_23B_P5_ID45824_LCLVER1.cld (-110)

Switch to module to postpone PHY probe to init state.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
9 months agoqualcommax: ipq807x: correct PHY mode for AQR
Robert Marko [Sat, 17 Feb 2024 16:39:22 +0000 (17:39 +0100)]
qualcommax: ipq807x: correct PHY mode for AQR

Interfaces that have AQR-s attached to them are using USXGMII and not just
the default SGMII.
This was fine until SSDK added some sanity checking and now on Qnap 301W it
would fail with:
[   24.740197] nss-dp 3a001800.dp5 10g-1 (uninitialized): failed to connect to phy device
[   24.740264] nss-dp: probe of 3a001800.dp5 failed with error -14

Since this is not Qnap 301W specific lets fix it subtarget wide by
declaring the correct PHY mode for 10G AQR-s.

Signed-off-by: Robert Marko <robimarko@gmail.com>
9 months agoqualcommax: ipq807x: 301w: correct PHY mode for AQR
Robert Marko [Sat, 17 Feb 2024 12:41:36 +0000 (13:41 +0100)]
qualcommax: ipq807x: 301w: correct PHY mode for AQR

Interfaces that have AQR-s attached to them are using USXGMII and not just
the default SGMII.
This was fine until SSDK added some sanity checking and now on Qnap 301W it
would fail with:
[   24.740197] nss-dp 3a001800.dp5 10g-1 (uninitialized): failed to connect to phy device
[   24.740264] nss-dp: probe of 3a001800.dp5 failed with error -14

So, lets fix 10G AQR ports by declaring the correct PHY mode.

Signed-off-by: Robert Marko <robimarko@gmail.com>
9 months agomediatek: mt7622: skip build also for Xiaomi AX6S
Daniel Golle [Sat, 17 Feb 2024 14:22:31 +0000 (14:22 +0000)]
mediatek: mt7622: skip build also for Xiaomi AX6S

Also here build fails due to increased kernel size.

Fixes: da970d63fb ("mediatek: switch to Linux version 6.1")
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
9 months agobuild: align SOURCE path for build system and SDK
Paul Spooren [Mon, 12 Feb 2024 15:59:50 +0000 (16:59 +0100)]
build: align SOURCE path for build system and SDK

Building a package in the build system or the SDK results in different
values for the `SOURCE` property, it's either `packages/<package name>`
or `feeds/base/<package name>`. The reason is that the SDK handles
`openwrt.git` as an external feed called while the build system contains
the *base* packages directly.

Since packages created with either method are (ideally) the same (bit
for bit), align the content of SOURCE. To do so this commit creates a
symlink from `feeds/base` to `$(TOPDIR)/package` and adopts the SOURCE
when building from inside the build system.

Signed-off-by: Paul Spooren <mail@aparcar.org>
9 months agowifi-scripts: fix FILS AKM selection with EAP-192
Eneas U de Queiroz [Sat, 3 Feb 2024 19:33:14 +0000 (16:33 -0300)]
wifi-scripts: fix FILS AKM selection with EAP-192

Fix netifd hostapd.sh selection of FILS-SHA384 algorithm with eap-192.

Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
9 months agomediatek: mt7622: skip build for MT7622 rfb1 (UBI)
Daniel Golle [Sat, 17 Feb 2024 04:26:00 +0000 (04:26 +0000)]
mediatek: mt7622: skip build for MT7622 rfb1 (UBI)

Due to increased kernel size the build currently fails if including
the MT7622 rfb1 (UBI). Skip it for now until there is a better
solution (such as replacing the bootloader and changing the flash
layout).

Fixes: da970d63fb ("mediatek: switch to Linux version 6.1")
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
10 months agomediatek: filogic: bpi-r3-mini: include kmod-phy-airoha-en8811h
Daniel Golle [Sat, 17 Feb 2024 01:23:34 +0000 (01:23 +0000)]
mediatek: filogic: bpi-r3-mini: include kmod-phy-airoha-en8811h

Include the needed Ethernet PHY driver module for the BananaPi R3 mini.

Fixes: b03d3644cf ("mediatek: filogic: add BananaPi BPi-R3 mini")
Reported-by: BPI forum user nezar_taima
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
10 months agolua5.3: backport CVE fix
Rosen Penev [Sun, 11 Feb 2024 02:13:10 +0000 (18:13 -0800)]
lua5.3: backport CVE fix

Also refreshed some patches

Signed-off-by: Rosen Penev <rosenp@gmail.com>
10 months agolua: fix CVE-2014-5461
Rosen Penev [Sun, 11 Feb 2024 23:06:44 +0000 (15:06 -0800)]
lua: fix CVE-2014-5461

Patch taken from Debian.

Refresh patches

Signed-off-by: Rosen Penev <rosenp@gmail.com>
10 months agoimages: append to existing image with ubinize-image build cmd
Daniel Golle [Fri, 16 Feb 2024 13:55:12 +0000 (13:55 +0000)]
images: append to existing image with ubinize-image build cmd

Let ubinize-image append the ubinized image to the existing image
instead of replacing it.

Fixes: 6c17d71973 ("scripts: ubinize-image.sh: support static volumes, make size optional")
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
10 months agomediatek: filogic: bpi-r3-mini: fix power on M.2 slot
Tianling Shen [Fri, 16 Feb 2024 05:37:17 +0000 (13:37 +0800)]
mediatek: filogic: bpi-r3-mini: fix power on M.2 slot

One of the pins requiered by M.2 slot is conflict with spi1,
however, spi1 seems unused so simply disable it for now, this
matches the factory behavior [1].

1. https://github.com/BPI-SINOVOIP/BPI-R3MINI-OPENWRT-V21.02.3/commit/9bd78779f267a21c04c5bb4d16c32e83aae8d1d3

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
10 months agomediatek: filogic: bpi-r3-mini: bind WLAN LED-s to phy*-ap0
Tianling Shen [Fri, 16 Feb 2024 05:29:44 +0000 (13:29 +0800)]
mediatek: filogic: bpi-r3-mini: bind WLAN LED-s to phy*-ap0

For showing wlan status.

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
10 months agomediatek: filogic: bpi-r3-mini: convert to new LED color/function format
Tianling Shen [Fri, 16 Feb 2024 05:26:51 +0000 (13:26 +0800)]
mediatek: filogic: bpi-r3-mini: convert to new LED color/function format

Conversion to new LED color/function format and drop label format.

This was needed previously when the new format wasn't supported by
leds.sh functions script. Now that is supported this property can be
removed in favor of the new format.

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
10 months agouboot-mediatek: bpi-r3-mini: fix typo in bootmenu
Daniel Golle [Fri, 16 Feb 2024 05:47:53 +0000 (05:47 +0000)]
uboot-mediatek: bpi-r3-mini: fix typo in bootmenu

Fix typo in eMMC bootmenu.

Fixes: bc25519f98 ("uboot-mediatek: add builds for BananaPi BPi-R3 mini")
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
10 months agoath79: generic: fix the alphabetical order in 02_network
Foica David [Wed, 14 Feb 2024 21:32:27 +0000 (23:32 +0200)]
ath79: generic: fix the alphabetical order in 02_network

This commit fixes the alphabetical order in 02_network.
The 2 deco devices in ath79_setup_interfaces() were in the wrong place.

Signed-off-by: Foica David <superh552@gmail.com>
10 months agoqualcommax: AW1000: add qca8081 PHY LED configuration
Chukun Pan [Tue, 30 Jan 2024 15:25:27 +0000 (23:25 +0800)]
qualcommax: AW1000: add qca8081 PHY LED configuration

Since we can configure the PHY LED of the qca8081,
add a configuration for this device.

Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
Reviewed-by: Robert Marko <robimarko@gmail.com>
10 months agoqualcommax: AW1000: sync qca807x PHY dts changes
Chukun Pan [Mon, 12 Feb 2024 15:18:30 +0000 (23:18 +0800)]
qualcommax: AW1000: sync qca807x PHY dts changes

The dts of Arcadyan AW1000 forgot to convert qca807x PHY
to PHY package implementation. This commit fix it.

Fixes: 0ab4b92 ("qualcommax: convert qca807x PHY to PHY package implementation")
Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
Reviewed-by: Robert Marko <robimarko@gmail.com>
10 months agobuild: fix opkg flags in rootfs
Justin Klaassen [Thu, 18 Jan 2024 15:36:22 +0000 (15:36 +0000)]
build: fix opkg flags in rootfs

By default opkg sets the "user" flag when a package is installed,
which resulted in most packages in the rootfs having this flag
set incorrectly. This patch removes the "user" flag from all
installed packages when preparing the rootfs image.

Fixes: #14427
Signed-off-by: Justin Klaassen <justin@tidylabs.app>
10 months agomediatek: filogic: bpi-r3-mini: fix generating ubinized image
Daniel Golle [Fri, 16 Feb 2024 05:36:26 +0000 (05:36 +0000)]
mediatek: filogic: bpi-r3-mini: fix generating ubinized image

Generate ubinized image as ARTIFACT and make use of now available
generic 'ubinize-image' build step intended for that purpose.

Fixes: b03d3644cf ("mediatek: filogic: add BananaPi BPi-R3 mini")
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
10 months agomediatek: filogic: bpi-r3-mini: fix NAND flash layout
Daniel Golle [Fri, 16 Feb 2024 05:38:07 +0000 (05:38 +0000)]
mediatek: filogic: bpi-r3-mini: fix NAND flash layout

Fix NAND flash layout which was out-of-sync with the definition in
ARM TrustedFirmware-A which expects UBI to start at 0x200000.

Fixes: b03d3644cf ("mediatek: filogic: add BananaPi BPi-R3 mini")
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
10 months agoscripts: ubinize-image.sh: fix on POSIX shell, allow custom images
Daniel Golle [Fri, 16 Feb 2024 05:32:51 +0000 (05:32 +0000)]
scripts: ubinize-image.sh: fix on POSIX shell, allow custom images

Make sure ubinize-image.sh also works with more simple POSIX Shell and
allow creating complete custom images to be used as ARTIFACT/foo.img
and thereby allow including uImage.FIT, TF-A FIP and what ever else
is required on a specific board.

Fixes: 6c17d71973 ("scripts: ubinize-image.sh: support static volumes, make size optional")
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
10 months agoramips: mt76x8: fix build due to renamed U-Boot binary
Daniel Golle [Fri, 16 Feb 2024 05:18:47 +0000 (05:18 +0000)]
ramips: mt76x8: fix build due to renamed U-Boot binary

The U-Boot binary for the RAVPower RP-WD009 has been renamed.
In order to be uniform with all other U-Boot binaries generated the SoC type has been prepended.
Set that new name also in the image build recipe for that device in order to fix build.

Fixes: 927334a8f7 ("uboot-mediatek: add basic build for ZBT-WG3526 (MT7621, 16M SPI-NOR)")
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
10 months agoimx: update default network config for ventana
Tim Harvey [Wed, 15 Mar 2023 19:58:33 +0000 (12:58 -0700)]
imx: update default network config for ventana

update the default network configuration for Gateworks Ventana boards
such that the left-most front-panel NIC is WAN and any additional are in
LAN bridge

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
10 months agoimx: add gpio-button-hotplug to ventana images
Tim Harvey [Wed, 15 Mar 2023 19:56:56 +0000 (12:56 -0700)]
imx: add gpio-button-hotplug to ventana images

Add the gpio-button-hotplug to Gateworks ventana images to support
the on-board user pushbutton.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
10 months agomediatek: filogic: add BananaPi BPi-R3 mini
Daniel Golle [Fri, 26 Jan 2024 17:28:01 +0000 (17:28 +0000)]
mediatek: filogic: add BananaPi BPi-R3 mini

Hardware specification
----------------------
 SoC: MediaTek MT7986A 4x A53
 Flash: 128MB SPI-NAND, 8GB eMMC
 RAM: 2GB DDR4
 Ethernet: 2x 2.5GbE (Airoha EN8811H)
 WiFi: MediaTek MT7976C 2x2 2.4G + 3x3 5G
 Interfaces:
  * M.2 Key-M: PCIe 2.0 x2 for NVMe SSD
  * M.2 Key-B: USB 3.0 with SIM slot
  * front USB 2.0 port
 LED: Power, Status, WLAN2G, WLAN5G, LTE, SSD
 Button: Reset, internal boot switch
 Fan: PWM-controlled 5V fan
 Power: 12V Type-C PD

Installation instructions for eMMC
----------------------------------
0. Set boot switch to boot from SPI-NAND (assuming stock rom or immortalwrt
   running there).
1. Write GPT partition table to eMMC
   Move openwrt-mediatek-filogic-bananapi_bpi-r3-mini-emmc-gpt.bin to
   the device /tmp using scp and write it to /dev/mmcblk0:
    dd if=/tmp/openwrt-*-r3-mini-emmc-gpt.bin of=/dev/mmcblk0
2. Reboot (to reload partition table)
3. Write bootloader and OpenWrt images
   Move files to the device /tmp using scp:
    - openwrt-*-bananapi_bpi-r3-mini-emmc-preloader.bin
    - openwrt-*-bananapi_bpi-r3-mini-emmc-bl31-uboot.fip
    - openwrt-*-bananapi_bpi-r3-mini-initramfs-recovery.itb
    - openwrt-*-bananapi_bpi-r3-mini-squashfs-sysupgrade.itb
   Write them to the appropriate partitions:
    echo 0 > /sys/block/mmcblk0boot0/force_ro
    dd if=/tmp/openwrt-*-bananapi_bpi-r3-mini-emmc-preloader.bin of=/dev/mmcblk0boot0
    dd if=/tmp/openwrt-*-bananapi_bpi-r3-mini-emmc-bl31-uboot.fip of=/dev/mmcblk0p3
    dd if=/tmp/openwrt-*-bananapi_bpi-r3-mini-initramfs-recovery.itb of=/dev/mmcblk0p4
    dd if=/tmp/openwrt-*-bananapi_bpi-r3-mini-squashfs-sysupgrade.itb of=/dev/mmcblk0p5
    sync

4. Remove the device from power, set boot switch to eMMC and boot into
   OpenWrt. The device will come up with IP 192.168.1.1 and assume the
   Ethernet port closer to the USB-C power connector as LAN port.

5. If you like to have Ethernet support inside U-Boot (eg. to boot via
   TFTP) you also need to write the PHY firmware to /dev/mmcblk0boot1:
    echo 0 > /sys/block/mmcblk0boot1/force_ro
    dd if=/lib/firmware/airoha/EthMD32.dm.bin of=/dev/mmcblk0boot1
    dd if=/lib/firmware/airoha/EthMD32.DSP.bin bs=16384 seek=1 of=/dev/mmcblk0boot1

Installation instructions for NAND
----------------------------------
0. Set boot switch to boot from eMMC (assuming OpenWrt is installed there
   by instructions above. Using stock rom or immortalwrt does NOT work!)

1. Write things to NAND
   Move files to the device /tmp using scp:
    - openwrt-*-bananapi_bpi-r3-mini-snand-preloader.bin
    - openwrt-*-bananapi_bpi-r3-mini-snand-bl31-uboot.fip
    - openwrt-*-bananapi_bpi-r3-mini-initramfs-recovery.itb
    - openwrt-*-bananapi_bpi-r3-mini-squashfs-sysupgrade.itb
   Write them to the appropriate locations:
    mtd write /tmp/openwrt-*-bananapi_bpi-r3-mini-snand-preloader.bin /dev/mtd0
    ubidetach -m 1
    ubiformat /dev/mtd1
    ubiattach -m 1
    volsize=$(wc -c < /tmp/openwrt-*-bananapi_bpi-r3-mini-snand-bl31-uboot.fip)
    ubimkvol /dev/ubi0 -N fip -n 0 -s $volsize -t static
    ubiupdatevol /dev/ubi0_0 /tmp/openwrt-*-bananapi_bpi-r3-mini-snand-bl31-uboot.fip
    cd /lib/firmware/airoha
    cat EthMD32.dm.bin EthMD32.DSP.bin > /tmp/en8811h-fw.bin
    ubimkvol /dev/ubi0 -N en8811h-firmware -n 1 -s 147456 -t static
    ubiupdatevol /dev/ubi0_1 /tmp/en8811h-fw.bin
    ubimkvol /dev/ubi0 -n 2 -N ubootenv -s 126976
    ubimkvol /dev/ubi0 -n 3 -N ubootenv2 -s 126976
    volsize=$(wc -c < /tmp/openwrt-*-bananapi_bpi-r3-mini-initramfs-recovery.itb)
    ubimkvol /dev/ubi0 -n 4 -N recovery -s $volsize
    ubiupdatevol /dev/ubi0_4 /tmp/openwrt-*-bananapi_bpi-r3-mini-initramfs-recovery.itb
    volsize=$(wc -c < /tmp/openwrt-*-bananapi_bpi-r3-mini-squashfs-sysupgrade.itb)
    ubimkvol /dev/ubi0 -n 4 -N recovery -s $volsize
    ubiupdatevol /dev/ubi0_4 /tmp/openwrt-*-bananapi_bpi-r3-mini-squashfs-sysupgrade.itb

3. Remove the device from power, set boot switch to NAND, power up and
   boot into OpenWrt.

Partially based on immortalwrt support for the R3 mini, big thanks for
doing the ground work!

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
10 months agokernel: add driver for Airoha EN8811H PHY as module
Daniel Golle [Fri, 26 Jan 2024 17:27:08 +0000 (17:27 +0000)]
kernel: add driver for Airoha EN8811H PHY as module

Add PHY driver for Airoha EN8811H PHY and package it as kernel module.
The PHY needs to load firmware from rootfs, so there is no point in
having the driver built-into the kernel.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
10 months agouboot-mediatek: add builds for BananaPi BPi-R3 mini
Daniel Golle [Fri, 26 Jan 2024 17:26:39 +0000 (17:26 +0000)]
uboot-mediatek: add builds for BananaPi BPi-R3 mini

The R3 mini comes with two Airoha EN8811H PHYs for 2.5G Ethernet.
The driver added to U-Boot expects the firmware for the PHY to be
stored inside UBI volume en8811h-fw or MMC boot1 hardware partition.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
10 months agolinux-firmware: package firmware for Airoha EN8811H PHY
Daniel Golle [Fri, 26 Jan 2024 17:29:22 +0000 (17:29 +0000)]
linux-firmware: package firmware for Airoha EN8811H PHY

Add package with firmware for Airoha EN8811H 2.5G Ethernet PHY which
needs to be loaded via MDIO before the PHY can be used.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
10 months agoscripts: ubinize-image.sh: support static volumes, make size optional
Daniel Golle [Thu, 1 Feb 2024 05:03:56 +0000 (05:03 +0000)]
scripts: ubinize-image.sh: support static volumes, make size optional

In order to support devices having TF-A FIP image or UBI-aware U-Boot
SPL we need to include a static volume for the bootloader.

Introduce support for adding additional static volumes by prefixing
the filename with ':', eg.

UBINIZE_PARTS := fip:=$(STAGING_DIR_IMAGE)/u-boot.fip

Also add support for rootfs-in-uImage.FIT setups which don't require a
rootfs partition and make the (3rd) size parameter in UBINIZE_PARTS
optional (see example above without declared size).

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
10 months agomediatek: update driver for MT7988 built-in 2.5G Ethernet PHY
Daniel Golle [Wed, 24 Jan 2024 19:10:36 +0000 (19:10 +0000)]
mediatek: update driver for MT7988 built-in 2.5G Ethernet PHY

Sync driver for built-in 2.5G Ethernet PHY with MediaTek SDK.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
10 months agofirmware: package firmware for built-in 2.5G PHY on MT7988
Daniel Golle [Mon, 8 Jan 2024 21:08:13 +0000 (21:08 +0000)]
firmware: package firmware for built-in 2.5G PHY on MT7988

Firmware for the built-in 2.5G Ethernet PHY of the MediaTek MT7988 SoC
is now part of linux-firmware, so we can package it.
Only a single file is needed with recent driver.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
10 months agomediatek: mt7622: modernize Linksys E8450 / Belkin RT3200 UBI build
Daniel Golle [Mon, 22 Jan 2024 19:12:40 +0000 (19:12 +0000)]
mediatek: mt7622: modernize Linksys E8450 / Belkin RT3200 UBI build

Move fip and factory into UBI static volumes.
Use fitblk instead of partition parser.

 !! RUN INSTALLER FIRST !!
Existing users of previous OpenWrt releases or snapshot builds will
have to **re-run the updated installer** before upgrading to firmware
after this commit.
DO NOT flash or run even just the initramfs image unless you have
run the updated installer which moves the content of the 'factory'
partition into a UBI volume.

tl;dr: DON'T USE YET!

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
10 months agomediatek: mt7622: convert unifi6lr-v{1,2,3}-ubootmod to fitblk
Daniel Golle [Mon, 22 Jan 2024 00:56:47 +0000 (00:56 +0000)]
mediatek: mt7622: convert unifi6lr-v{1,2,3}-ubootmod to fitblk

No bootloader changes needed in this case, smooth transition.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
10 months agomediatek: mt7622: convert BPi-R64 to all-UBI layout and fitblk
Daniel Golle [Sun, 21 Jan 2024 23:50:02 +0000 (23:50 +0000)]
mediatek: mt7622: convert BPi-R64 to all-UBI layout and fitblk

Modernize bootloader and flash memory layout of the BPi-R64 similar to
how it has also been done for the BPi-R3.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
10 months agoarm-trusted-firmware-mediatek: add UBI-enabled builds for MT7622
Daniel Golle [Sat, 20 Jan 2024 16:24:59 +0000 (16:24 +0000)]
arm-trusted-firmware-mediatek: add UBI-enabled builds for MT7622

Use custom UBI start address 0x80000 on MT7622 which is more than
enough for a single bl2 (MT7622 BootROM doesn't support redundant bl2).

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
10 months agomediatek: BananaPi BPi-R3 bootloader update
Daniel Golle [Thu, 18 Jan 2024 22:15:35 +0000 (22:15 +0000)]
mediatek: BananaPi BPi-R3 bootloader update

 * Switch to all-UBI layout on SPI-NAND
 * use fitblk driver instead of uImage.FIT partition parser
 * adapt sysupgrade
 * bump COMPAT_VERSION

Remove BROKEN mark now that all needed changes are done.

Boards running images generated before this commit will require
full reflash of the bootloader, re-install from SD card is the
easiest way to achieve that.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
10 months agouboot-envtools: mediatek_filogic: update bpi-r3
Daniel Golle [Thu, 18 Jan 2024 22:18:14 +0000 (22:18 +0000)]
uboot-envtools: mediatek_filogic: update bpi-r3

Unify env configuration now that BPi-R4 and BPi-R3 both use fitblk.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
10 months agouboot-mediatek: bpi-r3: all-UBI NAND layout, use fitblk
Daniel Golle [Thu, 18 Jan 2024 22:12:08 +0000 (22:12 +0000)]
uboot-mediatek: bpi-r3: all-UBI NAND layout, use fitblk

Modernize U-Boot to provide a better reference:
 * store fip image in UBI now that TF-A supports that
 * switch from uImage.FIT partition parser to new fitblk
   virtual firmware block driver (root=/dev/fit0)
 * automatically set root device according to boot_mode register

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
10 months agoarm-trusted-firmware-mediatek: add mt7986-spim-nand-ubi-ddr4
Daniel Golle [Thu, 18 Jan 2024 22:10:42 +0000 (22:10 +0000)]
arm-trusted-firmware-mediatek: add mt7986-spim-nand-ubi-ddr4

Add UBI-enabled build for MT7986 with SPIM-NAND and DDR4 for use with
the BananaPi R3 board.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
10 months agomediatek: prepare BananaPi BPi-R3 for upcoming modernization
Daniel Golle [Thu, 18 Jan 2024 22:54:29 +0000 (22:54 +0000)]
mediatek: prepare BananaPi BPi-R3 for upcoming modernization

Mark board as broken until the complete boot stack has been updated.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>