Commit Graph

21289 Commits

Author SHA1 Message Date
Sergey Ponomarev
9da90971ab ubox: make logread as an alternative
The logread can be replaced with syslog-ng.
To support this it should be an alternative itself.

Signed-off-by: Sergey Ponomarev <stokito@gmail.com>
2024-03-08 15:38:37 +08:00
Hauke Mehrtens
662e052588 linux-firmware: Update to version 20240220
This updates the following firmware files:
airoha-en8811h-firmware/lib/firmware/airoha/EthMD32.DSP.bin
airoha-en8811h-firmware/lib/firmware/airoha/EthMD32.dm.bin
amdgpu-firmware (Many files)
ar3k-firmware/lib/firmware/qca/hpnv21.bin
ar3k-firmware/lib/firmware/qca/hpnv21g.bin
ath10k-board-qca4019/lib/firmware/ath10k/QCA4019/hw1.0/board-2.bin
ath10k-board-qca9888/lib/firmware/ath10k/QCA9888/hw2.0/board-2.bin
ath10k-firmware-qca6174/lib/firmware/ath10k/QCA6174/hw3.0/firmware-6.bin
ath11k-firmware-wcn6750/lib/firmware/ath11k/WCN6750/hw1.0/board-2.bin
ath11k-firmware-wcn6855/lib/firmware/ath11k/WCN6855/hw2.0/amss.bin
ath11k-firmware-wcn6855/lib/firmware/ath11k/WCN6855/hw2.0/board-2.bin
ath11k-firmware-wcn6855/lib/firmware/ath11k/WCN6855/hw2.1/amss.bin
ath11k-firmware-wcn6855/lib/firmware/ath11k/WCN6855/hw2.1/board-2.bin
ibt-firmware/lib/firmware/intel/ibt-0040-0041.ddc
ibt-firmware/lib/firmware/intel/ibt-0040-0041.sfi
ibt-firmware/lib/firmware/intel/ibt-0040-1050.sfi
ibt-firmware/lib/firmware/intel/ibt-0040-4150.sfi
ibt-firmware/lib/firmware/intel/ibt-0041-0041.sfi
ibt-firmware/lib/firmware/intel/ibt-0180-0041.sfi
ibt-firmware/lib/firmware/intel/ibt-0180-1050.sfi
ibt-firmware/lib/firmware/intel/ibt-0180-4150.sfi
ibt-firmware/lib/firmware/intel/ibt-1040-0041.sfi
ibt-firmware/lib/firmware/intel/ibt-1040-4150.sfi
iwlwifi-firmware-be200/lib/firmware/iwlwifi-gl-c0-fm-c0-83.ucode
iwlwifi-firmware-be200/lib/firmware/iwlwifi-gl-c0-fm-c0.pnvm

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-03-07 19:37:36 +01:00
Robert Marko
e247763617 ath25: drop target
ath25 has been on life support for the last couple of releases, eventually
leading to marking it as source-only in 2023.

It has been basically only touched to do a kernel bump so that we can make
the new OpenWrt release which was a challenge due to small RAM amount.

However, with the attempt of kernel 6.1 update it turns out that kernel
cannot even finish booting due to RAM constraints, so its time to let this
target go.

Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-03-07 12:15:51 +01:00
Sven Eckelmann
71411cb8b8 ath11k-firmware: Move from kvalo to new upstream repository
It was announced [1] that the original staging repositories are no longer
used for staging of new firmware binaries. And that the old repository will
be removed [2] in June 2024.

The ath11k-firmware package must therefore point to the new repository
before the old one is no longer accessible.

[1] https://lore.kernel.org/r/bac97f31-4a70-4c4c-8179-4ede0b32f869@quicinc.com
[2] 8d2cc160f3

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2024-03-07 09:37:42 +01:00
Robert Marko
5b1d6d4607 kernel: crypto: add SHA512 ARM64 ASM optimized module
Kernel has an ASM optimized version of SHA512 that was ported from
OpenSSL, so lets package it as it provides significant perfomance
improvement compared to the generic implementation.

There is a Cryptographic Extension based version as well, but that relies
on ARMv8.2 ISA which I am not aware any of the OpenWrt supported SoC-s use.

Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-03-06 22:00:58 +01:00
Robert Marko
4443470a57 kernel: crypto: add SHA2(224 and 256) ARM64 CE optimized module
Kernel has optimized version of SHA2(224 and 256) using the ARMv8 Crypto
Extensions, so lets package it.

Use it by default for qualcommax as it uses Cortex-A53 core and has ARMv8
CE extensions present.

Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-03-06 18:38:28 +01:00
Robert Marko
09207c0348 kernel: crypto: add SHA256 ARM64 ASM optimized module
Kernel has an ASM optimized version of SHA256 that was ported from
OpenSSL, so lets package it as it provides significant perfomance
improvement compared to the generic implementation.

Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-03-06 18:30:21 +01:00
Robert Marko
9425064bdb kernel: crypto: add SHA1 ARM64 CE optimized module
Kernel has optimized version of SHA1 using the ARMv8 Crypto Extensions,
so lets package it.

Use it by default for qualcommax as it uses Cortex-A53 core and has ARMv8
CE extensions present.

Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-03-06 12:16:11 +01:00
Weijie Gao
d40d64fc62 cryptodev-linux: update to 1.13
Update to 1.13 with upstream backports.

Signed-off-by: Weijie Gao <hackpascal@gmail.com>
2024-03-06 10:17:45 +01:00
Robert Marko
fdb563c1a5 kernel: qca-ssdk: refresh PCS patch
Recently added PCS patch requires a refresh, so lets do it.

Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-03-05 21:43:54 +01:00
Robert Marko
3e6f64d443 kernel: crypto: package SHA3
SHA3 is now required by jitterentropy_rng in kernel 6.6, so lets start
preparing by packaging SHA3 support as its supported in 5.15 and 6.1
kernels as well.

AFAIK, only ARMv8.2 has a crypto extension for SHA3, however I am not aware
of any SoC we support that uses ARMv8.2 ISA so its not enabled currently.

Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-03-05 20:23:46 +01:00
Rafał Miłecki
4efbfcd996 base-files: sysupgrade: handle errors when generating backup
1. Return error if any step of generating tar file fails
2. Use pipefail to avoid calling "gzip" if tar failed

Fixes: e36cc53092 ("base-files: sysupgrade: use tar helper to include installed_packages.txt")
Reported-by: Luiz Angelo Daros de Luca <luizluca@gmail.com>
Cc: Luiz Angelo Daros de Luca <luizluca@gmail.com>
Cc: Jo-Philipp Wich <jo@mein.io>
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2024-03-05 11:54:55 +01:00
Dirk Buchwalder
93610492b6 qualcommax: ipq60xx: add support for netgear wax214
Netgear WAX214 is a 802.11 ax dual-band AP
    with PoE. (similar to Engenius EWS357APV3)

    Specifications:

        •     CPU: Qualcomm IPQ6010 Quad core Cortex-A53
        •     RAM: 512MB of DDR3
        •     Storage: 128MB NAND (Macronix MX30UF1G18AC)
        •     Ethernet: 1x 1G RJ45 port (QCA8072) PoE
        •     WIFI:
              2.4GHz: Qualcomm QCN5022 2x2 802.11b/g/n/ax 574 Mbps PHY rate
              5GHz: Qualcomm QCN5052 2x2 802.11a/b/g/n/ac/ax 1201 PHY rate

        •     LEDs:
              4 x GPIO-controlled LEDs
                - 1 Power LED (orange)
                - 1 LAN LED (blue)
                - 1 WIFI 5g LED (blue)
                - 1 WIFI 2g LED (blue)
                black_small_square  Buttons: 1x soft reset
                black_small_square  Power: 12V DC jack or PoE (802.3af )

            An populated serial header is onboard, format is
             1.25mm 4p (DF13A-4P-1.25H)
            RX/TX is working, bootwait is active, secure boot is not
            enabled.

            The root password of the stock firmware is unknown,
            but failsafe mode can be entered to reset the password.

            Installation Instructions:

                - obtain serial access
                - stop auto boot (press "4", Entr boot command line
		  interface)
                - setenv active_fw 0 (to boot from the primary rootfs,
                  or set to 1 to boot from the secondary rootfs
                  partition)
                - saveenv

                - tftpboot the initramfs image
                - bootm

                - copy
		  openwrt-qualcommax-ipq60xx-netgear_wax214-squashfs-factory.ubi
                  to the device
                - write the image to the NAND:
                   - cat /proc/mtd and look for rootfs partition (should
		     be mtd11,
                     or mtd12 if you choose active_fw 1)
                   - ubiformat /dev/mtd11 -f -y
		     openwrt-qualcommax-ipq60xx-netgear_wax214-squashfs-factory.ubi
                - reboot

            Note: the firmware is senao-based. But I was unable to build
                  a valid senao-header into the image.
                  Maybe they changed the header format and senaoFW isn't
                  working any more.

Signed-off-by: Dirk Buchwalder <buchwalder@posteo.de>
2024-03-05 06:34:35 +01:00
Dirk Buchwalder
e8a2fd241d ipq-wifi: update to version 2024-03-04
The new version adds support for the Netgear WAX214.

Signed-off-by: Dirk Buchwalder <buchwalder@posteo.de>
2024-03-05 06:34:35 +01:00
John Audia
bd6b37f463 kernel: Remove dsmark support
dsmark support was removed in kernel 5.15.150 and 6.1.80. Remove it from
the kmod package as well

Signed-off-by: John Audia <therealgraysky@proton.me>
2024-03-05 00:23:59 +01:00
Matthias Schiffer
2b46cbef81
build: do not depend on $(STAGING_DIR)/.prepared when in SDK
The dependency can't be satisfied when building using the SDK, breaking
package builds. As the staging and bin dirs are distributed with the SDK
archive, ignoring the dependency is fine when SDK is set.

Fixes: fbb924abff ("build: add $(STAGING_DIR) and $(BIN_DIR) ...")
Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
2024-03-04 23:45:15 +01:00
Álvaro Fernández Rojas
4b3c1251a4 base-files: sysupgrade: allow overriding config restore
Some platforms like Raspberry Pi require patching some backup files like
cmdline.txt in order to set the correct root PARTUUID.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2024-03-04 16:27:39 +01:00
Jo-Philipp Wich
6f6406a132 base-files: sysupgrade: fix streaming backup archives to stdout
Due to previous refactoring in sysupgrade, writing backup archives to
stdout became impossible since the hardcoded gzip output redirection
did not account for the `-` special case filename.

Fix this issue by substituting `-` with `/proc/self/fd/1` in the tar
archive output path variable.

Also remove a redundant `rm -f` of the target file path that occurs
before the file could've possibly been written.

Fixes: #14773
Fixes: https://github.com/openwrt/luci/issues/6961
Fixes: e36cc53092 ("base-files: sysupgrade: use tar helper to include installed_packages.txt")
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2024-03-04 14:58:10 +01:00
Matthias Schiffer
fbb924abff
build: add $(STAGING_DIR) and $(BIN_DIR) preparation to target and package subdir compile dependencies
In a pristine build, these directories are created as dependencies of
the tools subdir compile, however this step never runs when the tools
compile stamp already exists. Since commit ed6ba2801c ("tools: keep
stamp file in $(STAGING_DIR_HOST)"), this will happen after `make clean`:
$(STAGING_DIR) has been deleted, but the tools stamp still exists, so
the next build will fail because $(STAGING_DIR) has not been set up
correctly.

Fix builds after `make clean` by adding the preparation as dependencies
for the target and package directories as well.

Fixes: ed6ba2801c ("tools: keep stamp file in $(STAGING_DIR_HOST)")
Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
2024-03-03 23:13:59 +01:00
Daniel Golle
37bbed6f95 kernel: lantiq: ltq-vmmc: introduce user group for vmmc
asterisk-chan-lantiq is by now the only user of the VMMC interface.
And asterisk runs as user 'asterisk' which doesn't give it permission
to open the /dev/vmmc* devices.
Introduce a new user group 'vmmc' and give permission to access the
/dev/vmmc* devices to that group.
Another commit for asterisk-chan-lantiq will add the 'asterisk' user
to that group.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2024-03-03 15:44:52 +00:00
Tianling Shen
4f668091bf u-boot.mk: override default PATH to avoid pick hostpkg python
hostpkg python from packages feed can be picked when do a incremental
build because hostpkg has higher priority in PATH. It may lead build
faliure as it's heavily trimmed (e.g. lacks necessary modules).

For uboot which uses binman and intree dtc, this is forced as hostpkg
python will never provide those modules by default.

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-03-02 14:17:31 +01:00
Pawel Dembicki
766e688b30 ls-mc: bump to 10.38.0
Update ls-mc to latest 10.38.0 version.

Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
2024-03-02 14:08:08 +01:00
Pawel Dembicki
16d9d91fed ls-dpl: bump to 10.38.0
Update ls-dpl to latest 10.38.0 version.

Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
2024-03-02 14:08:08 +01:00
Daniel Golle
f08e63bd83 uboot-mediatek: remove rootfs_data before attempting to replace fip
Make sure there is enough space to replace 'fip' volume and always
remove rootfs_data before.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2024-03-01 00:59:49 +00:00
Linus Walleij
ef34f8f5b5 kirkwood: Add Marvell RTC to all machines with nothing else
The Kirkwood SoCs all have an onchip RTC that can hold the time
over e.g. a reboot which will help if no NTP servers are available.

Create a kernel module package for the Marvell RTC, and add it to
all Kirkwood devices that do not have their own discrete
battery-backed RTC. Adding it to platforms with a proper RTC
is just surplus.

All Kirkwoods have at least one RTC so add RTC to the features
list for Kirkwood as well.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2024-02-29 23:01:38 +01:00
Zoltan HERPAI
55c7b2cdaf uboot-d1: cleanup Makefile
Clean up leftover PKG_HASH.

Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu>
2024-02-29 17:06:04 +01:00
Zoltan HERPAI
d41d9befb9 uboot-d1: add bootloader for upcoming d1 target
Add u-boot bootloader based on 2023.01 to support D1-based boards, currently:

 - Dongshan Nezha STU
 - LicheePi RV Dock
 - MangoPi MQ-Pro
 - Nezha D1

Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu>
2024-02-29 16:50:20 +01:00
Zoltan HERPAI
f8436018fd opensbi: allow building on upcoming d1 target
U-boot on D1 also uses OpenSBI as its payload. As the current version of
OpenSBI already supports D1 with no further patches required, allow
building it on the upcoming TARGET_d1 too.

Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu>
2024-02-29 16:50:19 +01:00
Rafał Miłecki
0ad062a21b base-files: sysupgrade: add uci-defaults script disabling services #2
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>
2024-02-29 16:12:06 +01:00
Rafał Miłecki
e36cc53092 base-files: sysupgrade: use tar helper to include installed_packages.txt
Replace mount + overlay with manually built tar archive that gets
prepended to the actual config files backup. This allows more
flexibility with including extra backup files. They can be included at
any paths and don't require writing to flash or mounting an overlay
which has its own limitations (mount points).

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Acked-by: Jo-Philipp Wich <jo@mein.io>
2024-02-29 16:12:06 +01:00
Jo-Philipp Wich
08495b7f24 base-files: sysupgrade: add tar.sh with helpers for building archives
This allows building uncompressed tar archives from shell scripts (and
compressing them later if needed)

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
[rmilecki: adapt to sysupgrade needs]
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2024-02-29 16:11:47 +01:00
Tianling Shen
d6e008ace9 uboot-mediatek: correct board name for BananaPi BPi-R3 Mini
It should be "BananaPi BPi-R3 Mini" instead of just "BananaPi BPi-R3".

Fixes: bc25519f98 ("uboot-mediatek: add builds for BananaPi BPi-R3 mini")
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-02-28 12:48:43 +08:00
Paul Donald
dd8850756d umdns: prevent a few 'uci: Entry not found'
pass '-q' switch to uci to prevent spurious output

Signed-off-by: Paul Donald <newtwen@gmail.com>
2024-02-27 20:10:08 +01:00
Julius Lehmann
1d456c5e7a dnsmasq: Fix wrong format for --dhcp-boot option
dnsmasq --dhcp-boot option uses 'tag' instead of 'net' to specify tags

Signed-off-by: Julius Lehmann <lehmanju@devpi.de>
2024-02-26 21:24:37 +01:00
Oskari Rauta
597f9cf6b3 e2fsprogs: add libe2p and development headers
this patch separates libe2p from e2fsprogs package, like all other
provided libraries are their own packages. Also some development headers
were missing so I added those along with pkg-config files.

Signed-off-by: Oskari Rauta <oskari.rauta@gmail.com>
2024-02-26 21:19:10 +01:00
Daniel Golle
0c18c5679a base-files: export whole disk of fitblk backing partition
After commit ad62247800 ("base-files: improve lib/upgrade/common.sh")
behavior of export_bootdevice has been made consistent in such way that
always the whole disk device is exported (as that was the case already
when matching via UUID) rather than the partition device.
Do the same for the device holding the fitblk backing partition.

Fixes: 5992f976b3 ("base-files: recognize bootdevice on devices using fitblk")
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2024-02-26 04:01:10 +00:00
Daniel Golle
fc865eb3ae uboot-envtools: replace use of platform_get_bootdev
Use new function fitblk_get_bootdev in /lib/upgrade/common.sh instead.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2024-02-26 01:29:22 +00:00
Daniel Golle
5992f976b3 base-files: recognize bootdevice on devices using fitblk
Boards using the fitblk driver need special treatment when it comes to
detecting the actual block device used to store the image used to boot
from. Transparently handle this in 'export_bootdevice' and provide new
'fitblk_get_bootdev' function to replace implementations in
/lib/upgrade/platform.sh.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2024-02-26 01:29:22 +00:00
Paweł Owoc
c2537f3c8f ipq-wifi: update to version 2024-02-25, remove unused ipq8174 extension
fc30aee ipq8074: remove regdomain, update regdb and rename MX4200 BDF
Remove unused ipq8174 extension

Signed-off-by: Paweł Owoc <frut3k7@gmail.com>
2024-02-25 15:04:31 +01:00
Daniel Golle
c378927ef8 procd: update to git HEAD
2f94972 hotplug-dispatch: don't filter empty env variables
 1901aba system: break infite loop resolving rootfs type

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2024-02-24 04:00:15 +00:00
Daniel Golle
6368ed1ae5 mediatek: mt7623: phase out uImage.FIT partition parser
Use the new fitblk driver on the BananaPi R2 as well as UniElec U7623.
Introduce boot device selection for fitblk's /chosen/rootdisk
handle, similar to how it is already done on MT7622, MT7986 and MT7988.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2024-02-24 03:02:35 +00:00
Daniel Golle
9b6427e908 uboot-mediatek: fix truncated patch
The default environment for the Linksys E8450 and Belkin RT3200 got
truncated by one line due to a broken patch. While the impact was
luckily only cosmetic, fix it so bootmenu title also shows U-Boot
version again.

Fixes: 6aec3c7b5b ("mediatek: mt7622: modernize Linksys E8450 / Belkin RT3200 UBI build")
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2024-02-24 03:02:35 +00:00
Marcin Gajda
07b9186e88 ipq40xx: Add support Netgear LBR20
**Netgear LBR20** is a router with two gigabit ethernets , three wifi radios and integrated LTE cat.18 modem.

SoC Type: Qualcomm IPQ4019
RAM: 512 MiB
Flash: 256 MiB , SLC NAND, 2 Gbit (Macronix MX30LF2G18AC)
Bootloader: U-Boot
Modem: LTE CAT.18 Quectel EG-18EA ,  Max. 1.2Gbps downlink / 150Mbps uplink

WiFi class AC2200:
- radio0 : 5G on QCA9888 , WiFi5- 802.11a/n/ac MU-MIMO 2x2 , 887Mbps , 80MHz - limited for low channels
- radio1: 2,4G on IPQ4019 ,WiFi4- 802.11b/g/n MIMO2x2 300Mbps 40Mhz
- radio2: 5G on IPQ4019 , WiFi5- 802.11a/n/ac MU-MIMO 2x2 , 887Mbps ,80Mhz - limited for high channels  (from 100 up to 165) . Becouse of DFS remember to set country before turning on.

Ethernet: 2x1GbE (WAN/LAN1, LAN2)
LEDs:  section power : green and red  , section on top (orbi) drived by TLC59208F: red, green ,blue and white
USB ports: No
Buttons:  2 Reset and SYNC(WPS)
Power: 12 VDC, 2,5 A
Connector type: Barrel

OpenWRT Installation
1. Simplest way is just do upgrade from webpage with *factory.img
2. You can also do it with standard tool for Netgear's debricking - NMPRFlash
3. Most advanced way is to open device , connect to UART console and :
- Prepare OpenWrt initramfs image in TFTP server root (server IP 192.168.1.10)
- Connect serial console (115200,8n1) to UART connector
- Connect TFTP server to RJ-45 port
- Stop in u-Boot and run u-Boot command:

> setenv serverip 192.168.1.10
> set fdt_high 0x85000000
> tftpboot 0x83000000 openwrt-ipq40xx-generic-netgear_lbr20-initramfs-zImage.itb
> bootm 0x83000000

- Login via ssh
- upload or download *sysupgrade.bin ( like wget ... or scp transfer)
-  Install image via "sysupgrade -n" (like “sysupgrade -n /tmp/openwrt-ipq40xx-generic-netgear_lbr20-squashfs-sysupgrade.bin”)

Back to Stock
- Download firmware from official Netgear's webpage , it will be *.img file after decompressing.
- Use NMRPFlash tool  ( detailed insructions on project page https://github.com/jclehner/nmrpflash )

Open the case
- Unscrew nuts and remove washers from antenna's conectors.
- There are two Torx T10 screws under the label next to antenna conectors. You have to unglue this label from left and right corner to get it
- Two parts of shell covers will slide out from eachother , you have to unglue two small rubber pads and namplate sticker on bottom to do that.
- PCB is screwed with 4Pcs of Torx T10 screws
- Before lifting up PCB remove pigtiles for LTE antennas and release them from PCB and radiator (black and white wires)
- On other side of PCB ,in left bottom corner there is already soldered with 4 pins UART connector for console. Counting from left it is  +3,3V , TX , RX ,GND (reffer to this picture: https://i.ibb.co/Pmrf9KB/20240116-103524.jpg )

BDF's files are in firmware_qca-wireless  https://github.com/openwrt/firmware_qca-wireless/ and in parallel sent to ath10k@lists.infradead.org.

Signed-off-by: Marcin Gajda <mgajda@o2.pl>
2024-02-23 19:46:23 +01:00
Daniel Golle
ae2dced6ce
rpcd: update to latest git HEAD
8ef4c25 sys: use "Auto-Installed" field for packagelist

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2024-02-23 15:59:05 +01:00
Robert Marko
9bd7d8b756 ipq-wifi: fix archive hash
It seems that ipq-wifi bump included and incorrect PKG_MIRROR_HASH value,
so fix it by using:
make package/firmware/ipq-wifi/check FIXUP=1

Fixes: 70fd815e57 ("qualcommax: ipq807x: add support for Linksys MX5300")
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-02-23 14:14:05 +01:00
Eneas U de Queiroz
375dd23011 mac80211: only build ath10k with smallbuffers
When both variants of ath10k drivers are selected, any driver that is
selected along is being built twice, one for each ath10k variant.

Avoid these redundant builds by introducing an optional second parameter
to config_package that lists the variants for which the package is to be
built.

If the symbol is to be set for all of the variants, $(ALL_VARIANTS) can
be used.  This is the case for the mac80211 and cfg80211 modules.  If
the parameter is empty, then the module will be selected and thus built
when the first variant is compiled.

Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
2024-02-23 14:02:53 +01:00
Eneas U de Queiroz
4390ea484d mac80211: build each variant in its own dir
Having different build directories is the default when the package
Makefile defines more than one variant.

Mac80211 overrides PKG_BUILD_DIR, not taking different variants in
consideration, which causes clobbering the directories when both
variants are built.

When compiled with AUTOREMOVE=y, the effect is that the package is
unnecessarily rebuilt when the package is compiled again.

Wihout AUTOREMOVE, the problem is worse: the second variant will not be
rebuilt, and you end up with the smallbuffers variant being a copy of
the regular one.

Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
2024-02-23 14:02:53 +01:00
Paweł Owoc
70fd815e57 qualcommax: ipq807x: add support for Linksys MX5300
Hardware specification:
========
SoC: Qualcomm IPQ8072A
Flash: 512MB (Winbond W29N04GZBIBA)
RAM: 1GB (2x Nanya DDR3L NT5CC256M16ER-EK)
Ethernet: 5x 10/100/1000Mbps (Qualcomm QCA8075)
WiFi1: 5GHz ac 4x4 (Qualcomm QCA9984 + Skyworks SKY85746-11) - channels 100-169
WiFi2: 5GHz ax 4x4 (Qualcomm QCN5054 + Skyworks SKY85755-11) - channels 36-64
WiFi3: 2.4GHz ax 4x4 (Qualcomm QCN5024 + Skyworks SKY8340-11)
IoT: Bluetooth 5, Zigbee and Thread (Qualcomm QCA4024 + Skyworks SE2433T-R)
IoT Flash: 4MB (Macronix MX25R3235F)
RTC: ST M41T00S
LED: 1x RGB status (NXP PCA9633)
USB: 1x USB 3.0
Button: WPS, Reset

Flash instructions:
========
1. Manually upgrade firmware using openwrt-qualcommax-ipq807x-linksys_mx5300-squashfs-factory.bin image.
More details can be found here: https://www.linksys.com/hk/support-article?articleNum=274497
After first boot check actual partition:
- fw_printenv -n boot_part
and install firmware on second partition using command in case of 2:
- mtd -r -e kernel -n write openwrt-qualcommax-ipq807x-linksys_mx5300-squashfs-factory.bin kernel
and in case of 1:
- mtd -r -e alt_kernel -n write openwrt-qualcommax-ipq807x-linksys_mx5300-squashfs-factory.bin alt_kernel

2. Installation using serial connection from OEM firmware (default login: root, password: admin):
- fw_printenv -n boot_part
In case of 2:
- flash_erase /dev/mtd21 0 0
  nandwrite -p /dev/mtd21 openwrt-qualcommax-ipq807x-linksys_mx5300-squashfs-factory.bin
or in case of 1:
- flash_erase /dev/mtd23 0 0
  nandwrite -p /dev/mtd23 openwrt-qualcommax-ipq807x-linksys_mx5300-squashfs-factory.bin
After first boot install firmware on second partition:
- mtd -r -e kernel -n write openwrt-qualcommax-ipq807x-linksys_mx5300-squashfs-factory.bin kernel
or:
- mtd -r -e alt_kernel -n write openwrt-qualcommax-ipq807x-linksys_mx5300-squashfs-factory.bin alt_kernel

3. Installation from initramfs image using USB FAT32 formatted drive:
Stop u-boot and run:
- usb start && fatload usb 0:1 $loadaddr openwrt-qualcommax-ipq807x-linksys_mx5300-initramfs-uImage.itb && bootm $loadaddr
Write firmware to the flash from initramfs:
- mtd -e kernel -n write openwrt-qualcommax-ipq807x-linksys_mx5300-squashfs-factory.bin kernel
and:
- mtd -r -e alt_kernel -n write openwrt-qualcommax-ipq807x-linksys_mx5300-squashfs-factory.bin alt_kernel

4. Back to the OEM firmware:
- mtd -e kernel -n write FW_MX5300_1.1.9.200251_prod.img kernel
and:
- mtd -r -e alt_kernel -n write FW_MX5300_1.1.9.200251_prod.img alt_kernel

5. USB recovery:
- fw_setenv usbimage 'openwrt-qualcommax-ipq807x-linksys_mx5300-initramfs-uImage.itb'
  fw_setenv bootusb 'usb start && fatload usb 0:1 $loadaddr $usbimage && bootm $loadaddr'
  fw_setenv bootcmd 'run bootusb; aq_load_fw && if test $auto_recovery = no; then bootipq; elif test $boot_part = 1; then run bootpart1; else run bootpart2; fi'

Notes:
========
IoT device is accesible over spi. Not yet supported.

Signed-off-by: Paweł Owoc <frut3k7@gmail.com>
Reviewed-by: Robert Marko <robimarko@gmail.com>
2024-02-23 13:34:59 +01:00
Rafał Miłecki
788122cc12 base-files: sysupgrade: rename add_*files() functions
Usage of word "add" was somehow misleading in those functions:
1. They don't really add (as in: append) anything. Result files are
   created from scratch.
2. It wasn't clear what adding files means. It could be understood as
   adding actual files somewhere (to existing archive?).

Also the word "add" was also a bit ambiguous.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2024-02-22 22:19:13 +01:00
Rafał Miłecki
4a1b94adba base-files: sysupgrade: s/do_save_conffiles/create_backup_archive/
Rename function to more accurate and self-explanatory name:
1. Use "archive" in name as this functions creates tar archive
2. Avoid "conffiles" as this function may archive more than that

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2024-02-22 22:19:01 +01:00
Rafał Miłecki
4ba5eba94c base-files: sysupgrade: exit with no error for --help
Calling "sysupgrade --help" should result in printing help and exiting
with 0 code.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2024-02-22 22:18:36 +01:00
Rafał Miłecki
73da77fd00 base-files: sysupgrade: group & cleanup global variables
Group & describe them by type, drop unneeded exports.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2024-02-22 22:18:36 +01:00
Rafał Miłecki
57be93c16d base-files: sysupgrade: replace UMOUNT_ETCBACKUP_DIR with a local variable
It was used inside do_save_conffiles() only.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2024-02-22 22:18:36 +01:00
Luiz Angelo Daros de Luca
61ac147bb6 base-files: sysupgrade: fix error message and typo
Some minor error message and comment fixes.

Signed-off-by: Luiz Angelo Daros de Luca <luizluca@gmail.com>
2024-02-22 22:14:54 +01:00
Rafał Miłecki
157d6019df Revert "base-files: sysupgrade: always setup overlay when creating backup"
This reverts commit 4fa9aaf0be.

That seemed like a good idea allowing us to include any runtime
generated file in archive. Unfortuantely it broke backups with files
from mounted directories.

When mounting overlay with / as lowerdir its mounts don't propagete in
the mountpoint. That resulted in empty directories:
/tmp/overlay.XXXXXX/backup/tmp/
/tmp/overlay.XXXXXX/backup/var/
/tmp/overlay.XXXXXX/backup/dev/
/tmp/overlay.XXXXXX/backup/proc/
etc.

As some platforms / users try to backup files like /var/dhcp.leases or
/boot/cmdline.txt it means we can't use that solution.

Link: http://lists.openwrt.org/pipermail/openwrt-devel/2024-February/042320.html
Link: https://lore.kernel.org/linux-fsdevel/67bb0571-a6e0-44ea-9ab6-91c267d0642f@gmail.com/T/#u
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2024-02-22 22:08:14 +01:00
Rafał Miłecki
7bffa8ab10 Revert "base-files: sysupgrade: include uci-defaults script disabling services"
This reverts commit bf304d10e9.

That uci-defaults script worked great but generating it required
mounting root dir as overlay lowerdir that needs to be reverted.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2024-02-22 22:08:04 +01:00
Hauke Mehrtens
5df7a78e82 wifi-scripts: Support HE Iftypes with multiple entries
With mac80211_hwsim I have seen such entries in OpenWrt 22.03:
    HE Iftypes: managed, AP
The mac80211.sh script did not detect the entry and failed. Allow
arbitrary other entries before to fix this problem.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-02-22 21:45:44 +01:00
Yegor Yefremov
62acd9a2f9 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>
2024-02-22 09:17:25 +01:00
Jo-Philipp Wich
97ad8501ad 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>
2024-02-22 09:17:25 +01:00
Mantas Pucka
44168fda78 qualcommax: ipq60xx: Add 8devices Mango DVK
8devices Mango DVK is a single board computer / devkit for 8devices Mango
system-on-module (SoM).

Specifications:
* CPU: Qualcomm IPQ6010 Quad core Cortex-A53 1.8GHz
* RAM: 512 MB
* Storage:
    * 32 MB serial NOR flash (on SoM)
    * 256 MB parallel NAND flash (on DVK)
* Ethernet:
    * 2x1G RJ45 ports(QCA8072 or QCA8075)
    * 1x2.5G RJ45 port (QCA8081)
    * 1xSFP (shares SGMII with QCA8081)
* Switch: Qualcomm Atheros IPQ6010
* WLAN:
    * 2.4GHz: QCN5121 2x2 802.11b/g/n/ax 574 Mbps PHY rate
    * 5GHz: QCN5152 2x2 802.11a/n/ac/ax 1201 Mbps PHY rate
* USB:
    * 1x USB3.0 Type-A port
    * 1x USB2.0 available at mini PCIe slot
* PCIe: 1x mini PCIe slot 1xLane Gen3 (8GT/s)
* SD/eMMC (on a single shared bus - only one can be active):
    * micro SD slot
    * eMMC module connector
* LEDs:
    * Green power led (not controllable)
    * Green 2.4GHz radio led (GPIO 67)
    * Green 5GHz radio led (GPIO 66)
* Buttons:
    * 1x (WPS GPIO79) button
* GPIOs: 2.54mm header brings out 18 GPIOs (1.8V level)
* UART: 4-pin UART header (3.3V level)
    * 115200 8N1, 3.3V-Tx-Rx-GND (3.3V is pin 1 close to boot-switch SW2)
* Power:
    * PoE IN on 2.5G port (passive 24-48V)
    * DC power terminal (12-58V)

Installation instructions:

Vendor image format is compatible with squashfs-sysupgrade image. Run:

sysupgrade -n -F openwrt-qualcommax-ipq60xx-8devices_mango-dvk-squashfs-sysupgrade.bin

Signed-off-by: Mantas Pucka <mantas@8devices.com>
2024-02-21 21:42:23 +01:00
Mantas Pucka
10ba730b7b ipq-wifi: add support for 8devices Mango board
Add support for .ipq6018 BDF suffix and add Mango board entry

Signed-off-by: Mantas Pucka <mantas@8devices.com>
2024-02-21 21:42:23 +01:00
Mantas Pucka
03935cf7de ipq-wifi: update to Git HEAD (2024-02-19)
1cc59e1 ipq6018: add 8devices Mango BDF
10279cc ipq40xx:Add support for Netgear LBR20 with two BDF's

Signed-off-by: Mantas Pucka <mantas@8devices.com>
2024-02-21 21:42:23 +01:00
Mantas Pucka
586a051d4d ath11k-firmware: add wifi firmware for ipq6018
So far only stable FW is v2.4. It exists in a different
git repo, so add custom download routine.

Signed-off-by: Mantas Pucka <mantas@8devices.com>
2024-02-21 21:42:23 +01:00
Mantas Pucka
aa6cc0a52b mac80211: ath11k: disable coldboot for ipq6018
Coldboot calibration does not work at the moment and causes failure during
wifi startup.

Signed-off-by: Mantas Pucka <mantas@8devices.com>
2024-02-21 21:42:23 +01:00
Mantas Pucka
d08d53346b qca-ssdk: support selecting PCS channel for PORT3 on IPQ6018
When QCA8072 is used in PSGMII mode with IPQ6018, PCS used for second
PHY port would overlap with one used by SGMII+ port. SoC has register
to select different PCS in such case.

Original code used PHY_ID for this decision, which also had other
issues, but is no longer viable since we moved to upstream QCA807x
driver.

Introduce DT property port3_pcs_channel to allow describing this in DT.
Default value is <2>, and for some QCA8072 designs <4> would be needed.

Signed-off-by: Mantas Pucka <mantas@8devices.com>
2024-02-21 21:42:23 +01:00
Felix Fietkau
2a752ff028 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>
2024-02-21 15:28:53 +01:00
Marius Durbaca
4821cb24ed 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>
2024-02-21 13:29:26 +01:00
Marius Durbaca
eec0bec630 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>
2024-02-21 13:29:26 +01:00
Felix Fietkau
95e633efbd 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>
2024-02-21 10:56:22 +01:00
Robert Marko
fb45887e85 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>
2024-02-21 10:56:22 +01:00
Tianling Shen
afca1236f3 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>
2024-02-19 20:52:06 +01:00
Tianling Shen
23cb2b1636 uboot-rockchip: add NanoPi R2C Plus support
Add support for the FriendlyARM NanoPi R2C Plus.

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-02-19 16:23:32 +01:00
Rafał Miłecki
bf304d10e9 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>
2024-02-19 13:53:14 +01:00
Rafał Miłecki
4fa9aaf0be 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>
2024-02-19 13:53:14 +01:00
Luiz Angelo Daros de Luca
700907bc63 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>
2024-02-19 12:41:40 +01:00
Luiz Angelo Daros de Luca
14ac91c68c 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>
2024-02-19 12:41:40 +01:00
Janusz Dziedzic
a56292d9f5 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>
2024-02-18 13:49:12 +01:00
Seo Suchan
6b904fa95b ca-certificates: update to version 20240203
Update Mozilla certificate authority bundle to version 2.64

Signed-off-by: Seo Suchan <tjtncks@gmail.com>
2024-02-18 11:49:04 +01:00
Eneas U de Queiroz
472312f83f
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>
2024-02-17 08:36:48 -03:00
Rosen Penev
24d3eb7629
lua5.3: backport CVE fix
Also refreshed some patches

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2024-02-17 01:55:49 +01:00
Rosen Penev
78b0106f7d
lua: fix CVE-2014-5461
Patch taken from Debian.

Refresh patches

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2024-02-17 01:55:21 +01:00
Daniel Golle
f96289ddff 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>
2024-02-16 13:56:01 +00:00
Daniel Golle
ae1c0f1b15 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>
2024-02-16 05:40:14 +00:00
Daniel Golle
b03d3644cf 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>
2024-02-15 19:30:08 +00:00
Daniel Golle
5a2eb8082f 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>
2024-02-15 19:30:08 +00:00
Daniel Golle
bc25519f98 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>
2024-02-15 19:30:08 +00:00
Daniel Golle
adb1e30b7e 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>
2024-02-15 19:30:08 +00:00
Daniel Golle
1e58ce7652 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>
2024-02-15 19:30:08 +00:00
Daniel Golle
6aec3c7b5b 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>
2024-02-15 19:30:08 +00:00
Daniel Golle
41c053141e 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>
2024-02-15 19:30:08 +00:00
Daniel Golle
208f6c1232 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>
2024-02-15 19:30:08 +00:00
Daniel Golle
8f9b10d917 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>
2024-02-15 19:30:08 +00:00
Daniel Golle
8afce4893b 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>
2024-02-15 19:30:08 +00:00
Daniel Golle
033db3a95d 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>
2024-02-15 19:30:08 +00:00
Daniel Golle
91b55ca4c8 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>
2024-02-15 19:30:08 +00:00
Daniel Golle
1192554d56 uboot-envtools: filogic: add support for BananaPi R4
Add environment settings for the BananaPi BPI-R4 router board which
can boot from (and store its bootloader environment on) micro SD card,
SPI-NAND and eMMC.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2024-02-15 19:30:08 +00:00
Daniel Golle
13ddc65b2c uboot-envtools: filogic: de-duplicate UBI env settings
Use function instead of duplicating the env settings on UBI for
OpenWrt-built U-Boot over and over.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2024-02-15 19:30:08 +00:00
Daniel Golle
74a8f416f4 uboot-mediatek: update to U-Boot 2024.01 release
Rebase local patches on top of quarterly timed release, allowing to
drop numerous patches which have been accepted upstream since the
release of U-Boot 2023.07.02.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2024-02-15 19:06:37 +00:00
Daniel Golle
54f99ebe5c uboot-mediatek: add build for BPi-R4
Add build for the BananaPi R4 board which can boot from micro SD,
SPI-NAND or eMMC.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2024-02-15 19:06:37 +00:00
Daniel Golle
b165d451bd uboot-mediatek: mt7988: set rootdisk according to boot device
If nodes /chosen/rootdisk-${bootdevice} exists, set /chosen/rootdisk
phandle according to boot device selected by the bootstrap pins.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2024-02-15 19:06:37 +00:00