openwrt/openwrt.git
17 months agofirmware-utils: ptgen: add SiFive-related GUID types
Zoltan HERPAI [Sat, 23 Apr 2022 17:06:28 +0000 (19:06 +0200)]
firmware-utils: ptgen: add SiFive-related GUID types

Add patch until it gets accepted in firmware-utils upstream.

The SiFive RISC-V SoCs use two special partition types in the boot process.
As a first step, the ZSBL (zero-stage bootloader) in the CPU looks for a
partition with a GUID of 5B193300-FC78-40CD-8002-E86C45580B47 to load the
first-stage bootloader - which in OpenWrt's case is an SPL image. The FSBL
(SPL) then looks for a partition with a GUID of
2E54B353-1271-4842-806F-E436D6AF6985 to load the SSBL which is usually an
u-boot.

With ptgen already supporting GPT partition creation, add the required GUID
types and name them accordingly to be invoked with the '-T <GPT partition
type>' parameter.

Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu>
(cherry picked from commit 18238c442866a6ae93533e2421a6f44bc9e57ac6)

17 months agoopenssl: add linux-riscv64 into the targets list
Zoltan HERPAI [Wed, 15 May 2019 15:21:45 +0000 (17:21 +0200)]
openssl: add linux-riscv64 into the targets list

Add "linux-riscv64-openwrt" into openssl configurations to enable building
on riscv64.

Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu>
(cherry picked from commit a0840ecd5309921b62fcf5f563180ef8f955509e)

17 months agoopensbi: add package for RISC-V
Zoltan HERPAI [Sun, 26 Jan 2020 22:45:48 +0000 (23:45 +0100)]
opensbi: add package for RISC-V

OpenSBI is a form of a first-stage bootloader, which initializes
certain parts of an SoC and then passes on control to the second
stage bootloader i.e. an u-boot image.

We're introducing the package with release v1.2, which provides
SBI v0.3 and the SBI SRST extensions which helps to gracefully
reboot/shutdown various HiFive-U SoCs.

Tested on SiFive Unleashed and Unmatched boards.

Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu>
(cherry picked from commit 944b13b3ee1d89e11a0121fbeeaa465ab1e25c3c)

17 months agogeneric: groundwork for RISC-V
Zoltan HERPAI [Sun, 16 Dec 2018 09:45:53 +0000 (10:45 +0100)]
generic: groundwork for RISC-V

Add build infrastructure for RISC-V.

Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu>
(cherry picked from commit 50c05f6cd721130701cbbc77a75d2e090259c4e5)

17 months agouboot-armsr: add support for QEMU armv7/armv8
Petr Štetiar [Fri, 2 Jun 2023 11:48:38 +0000 (13:48 +0200)]
uboot-armsr: add support for QEMU armv7/armv8

Add new package so we can use self-compiled bootloader during QEMU based
testing and development.

Backported fix[1] is needed for EFI boot from virtio devices.

1. https://patchwork.ozlabs.org/project/uboot/patch/20230424134946.v10.7.Ia5f5e39c882ac22b5f71c4d576941b34e868eeba@changeid/

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

17 months agou-boot.mk: add support for config customization
Petr Štetiar [Fri, 2 Jun 2023 11:54:20 +0000 (13:54 +0200)]
u-boot.mk: add support for config customization

Make it possible to easily customize U-Boot config options via new
`UBOOT_CUSTOMIZE_CONFIG` variable, so we don't need to patch config
files or override config step with shell hackery.

This generic approach uses `config` CLI to tweak the .config as needed,
for example:

 UBOOT_CUSTOMIZE_CONFIG := \
--enable CMD_EFIDEBUG \
--enable CMD_BOOTMENU \
--enable AUTOBOOT \
--enable AUTOBOOT_MENU_SHOW \
--disable AUTOBOOT_KEYED \
--disable AUTOBOOT_USE_MENUKEY \
--disable BOOTMENU_DISABLE_UBOOT_CONSOLE \
--set-val BOOTDELAY 2

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

17 months agoCI: change armvirt reference to armsr
Mathew McBride [Fri, 9 Jun 2023 03:57:52 +0000 (03:57 +0000)]
CI: change armvirt reference to armsr

The armvirt target has been renamed to armsr.

Signed-off-by: Mathew McBride <matt@traverse.com.au>
(cherry picked from commit 3df01b1aa40a8e783dbbebdbe6088a49aed186f8)

17 months agoscripts: qemustart: change armvirt references to armsr
Mathew McBride [Fri, 9 Jun 2023 02:19:40 +0000 (02:19 +0000)]
scripts: qemustart: change armvirt references to armsr

The armvirt target has been renamed to 'armsr' (Arm SystemReady)
after inclusion of EFI support.
Change references (including subtargets) accordingly.

Signed-off-by: Mathew McBride <matt@traverse.com.au>
(cherry picked from commit 36bf9d861082d30fdb1cf1d00f819e60b8bb84a7)

17 months agowolfssl: change armvirt reference to armsr
Mathew McBride [Tue, 6 Jun 2023 23:24:18 +0000 (23:24 +0000)]
wolfssl: change armvirt reference to armsr

armvirt target has been renamed to armsr (Arm SystemReady).

Signed-off-by: Mathew McBride <matt@traverse.com.au>
(cherry picked from commit 203deef82cdcb2c4deb01e2a4cee62a600723320)

17 months agokernel: netdevices: change armvirt references to armsr
Mathew McBride [Tue, 6 Jun 2023 23:23:33 +0000 (23:23 +0000)]
kernel: netdevices: change armvirt references to armsr

armvirt target has been renamed to armsr (Arm SystemReady)

Signed-off-by: Mathew McBride <matt@traverse.com.au>
(cherry picked from commit c0bcfde58e751d674adfac51944df9e20ab978e4)

17 months agogrub2: change armvirt reference to armsr
Mathew McBride [Tue, 6 Jun 2023 23:22:36 +0000 (23:22 +0000)]
grub2: change armvirt reference to armsr

The armvirt target has been renamed to armsr (Arm SystemReady),
so the GRUB configuration also needs to change.

Signed-off-by: Mathew McBride <matt@traverse.com.au>
(cherry picked from commit 4ce7d6c8885a0e1873011f8f48b67e2ecd18e43d)

17 months agoconfig: change references from armvirt to armsr
Mathew McBride [Tue, 6 Jun 2023 23:22:01 +0000 (23:22 +0000)]
config: change references from armvirt to armsr

armvirt target has been renamed to armsr (Arm SystemReady),
so the config defaults need to be changed as well.

Signed-off-by: Mathew McBride <matt@traverse.com.au>
(cherry picked from commit 40ce6a7920a8f56d07228795a526576a8762aead)

17 months agoarmsr: rename from armvirt
Mathew McBride [Fri, 9 Jun 2023 00:43:33 +0000 (00:43 +0000)]
armsr: rename from armvirt

Now that the armvirt target supports real hardware, not just
VMs, thanks to the addition of EFI, rename it to something
more appropriate.

'armsr' (Arm SystemReady) was chosen after the name of
the Arm standards program.

The 32 and 64 bit targets have also been renamed
armv7 and armv8 respectively, to allow future profiles
where required (such as armv9).

See https://developer.arm.com/documentation/102858/0100/Introduction
for more information.

Signed-off-by: Mathew McBride <matt@traverse.com.au>
(23.05 version of commit 40b02a230167626def69389452f19b7109aaeac1)

17 months agokernel: kmod-amazon-ena: move to top level netdevices
Mathew McBride [Wed, 5 Oct 2022 01:40:22 +0000 (12:40 +1100)]
kernel: kmod-amazon-ena: move to top level netdevices

The Amazon ENA network devices are also used on the
AWS Arm (Graviton) instance types, so move it from
the x86-only module file to the top level netdevices.

Signed-off-by: Mathew McBride <matt@traverse.com.au>
(cherry picked from commit 3a7c8fd15e89237c8c9db62393d057f3a47429d2)

17 months agoarmvirt: 64: disable CONFIG_SMC91X
Mathew McBride [Mon, 13 Feb 2023 06:51:26 +0000 (06:51 +0000)]
armvirt: 64: disable CONFIG_SMC91X

The SMC91X family is a ISA-age Ethernet controller.
I'm not particularly sure what it's doing in armvirt/64,
as it's unlikely there is a QEMU or real hardware configuration
that exists with it.

Signed-off-by: Mathew McBride <matt@traverse.com.au>
(23.05/5.15 version of commit 214e94cddf1bfd4e6141f79a70f532267fe1bea0)

17 months agoarmvirt: base-files: add tty0 to inittab
Mathew McBride [Mon, 5 Sep 2022 06:56:49 +0000 (16:56 +1000)]
armvirt: base-files: add tty0 to inittab

tty0 is the default console for devices with screens/framebuffers.

Signed-off-by: Mathew McBride <matt@traverse.com.au>
(cherry picked from commit e41b82f619ca02f427f34ae439d4584ab441e245)

17 months agoarmvirt: config changes required for framebuffer console
Mathew McBride [Mon, 5 Sep 2022 06:55:02 +0000 (16:55 +1000)]
armvirt: config changes required for framebuffer console

These Kconfig options are required to get a screen console
working with the VMware Fusion ARM (Apple Silicon) preview.
They are likely to be the same for other Arm standard
"desktop" hardware that may emerge.

Signed-off-by: Mathew McBride <matt@traverse.com.au>
(23.05/5.15 version of 83f564f7464c34c7713b20b61007b24b217f0b88)

17 months agoarmvirt: package and select Rockchip DWMAC Ethernet driver
Mathew McBride [Tue, 18 Apr 2023 03:34:23 +0000 (03:34 +0000)]
armvirt: package and select Rockchip DWMAC Ethernet driver

For devices that implement the "rockchip,*-gmac" compatible controller,
including:
- RK3328
- RK3399
- RK3568
- RK3588
- PX30

Signed-off-by: Mathew McBride <matt@traverse.com.au>
(cherry picked from commit abbffe55ddded36d2a4d0eee6e96c742eaffbbd2)

17 months agoarmvirt: 64: add Allwinner A3/A83T/A64 (sun8i family) Ethernet
Mathew McBride [Mon, 20 Mar 2023 02:53:31 +0000 (02:53 +0000)]
armvirt: 64: add Allwinner A3/A83T/A64 (sun8i family) Ethernet

Add support for the dwmac (stmmac) variant used by Allwinner
Arm64 boards.

Signed-off-by: Mathew McBride <matt@traverse.com.au>
(cherry picked from commit 847467a5729995a98aa34329f6fa0ed4cb79d210)

17 months agokernel: modules: fix mdio-bus-mux description
Luiz Angelo Daros de Luca [Fri, 9 Jun 2023 02:41:54 +0000 (23:41 -0300)]
kernel: modules: fix mdio-bus-mux description

Simple error during copy/paste

Fixes: 2dbeb607251b ("kernel: add mdio-bus-mux support")
Signed-off-by: Luiz Angelo Daros de Luca <luizluca@gmail.com>
(cherry picked from commit 1e4bc13eaa3fdba897ca1721b2bfe9f2dbb30770)

17 months agoarmvirt: 64: add Marvell (formerly Cavium) ThunderX series network driver
Mathew McBride [Sat, 11 Feb 2023 03:58:09 +0000 (03:58 +0000)]
armvirt: 64: add Marvell (formerly Cavium) ThunderX series network driver

Based on working configuration supplied by Anton Antonov.

Signed-off-by: Mathew McBride <matt@traverse.com.au>
(cherry picked from commit 5d2a5f739840caa6e72b5c907d355f6aaca227d4)

17 months agoarmvirt: 64: Add storage support for qemu-sbsa platform
Anton Antonov [Thu, 22 Dec 2022 12:01:59 +0000 (12:01 +0000)]
armvirt: 64: Add storage support for qemu-sbsa platform

Enable SATA support, which is used by the Server Base
System Architecture reference board[1].

Signed-off-by: Anton Antonov <Anton.Antonov@arm.com>
Signed-off-by: Mathew McBride <matt@traverse.com.au>
[1] - https://qemu.readthedocs.io/en/latest/system/arm/sbsa.html
(23.05/5.15 version of 26905c96124af10a795167509116252e9357baea)

17 months agoarmvirt: 64: Add NXP i.MX 8M Mini/Nano/Quad/Plus EVK support
Anton Antonov [Thu, 22 Dec 2022 12:00:12 +0000 (12:00 +0000)]
armvirt: 64: Add NXP i.MX 8M Mini/Nano/Quad/Plus EVK support

Also includes Advantech RSB-3720 (iMX8 Plus) support.

Signed-off-by: Anton Antonov <Anton.Antonov@arm.com>
Signed-off-by: Mathew McBride <matt@traverse.com.au>
[Re-sort into kernel config, move network into modules]
(23.05/5.15 version of commit 3efb3b801bb1393897ff58b9af3753157f28f441)

17 months agoarmvirt: 64: add support for other SystemReady-compatible vendors
Mathew McBride [Fri, 15 Jul 2022 02:38:02 +0000 (02:38 +0000)]
armvirt: 64: add support for other SystemReady-compatible vendors

These changes are to support other vendors that have SystemReady/EFI
support, including:
* Marvell Armada
** (This is speculative as I don't have a machine of my own to test)
* Amazon Graviton (tested bare-metal and virtualized instances)
* VMware (Fusion for ARM Mac preview)
* NXP/Freescale (Layerscape series not already selected)
* HiSilicon
* Allwinner/sunxi
* Rockchip (untested, options taken from arm64 defconfig)

To give an idea of the hardware certified for SystemReady,
see
https://www.arm.com/architecture/system-architectures/systemready-certification-program/ir
and
https://www.arm.com/architecture/system-architectures/systemready-certification-program/es

Other vendors that _should_ work include Marvell Octeon 10
and Ampere. I understand these systems should work
"out of the box" in ACPI mode but may require other drivers
(e.g PCIe NICs and storage controllers).

Signed-off-by: Mathew McBride <matt@traverse.com.au>
(23.05/5.15 version of c3151b6f04579a937b7cb166bbeff0d0ee539946)

17 months agoarmvirt: add options and driver modules for NXP Layerscape DPAA2 platform
Mathew McBride [Fri, 10 Jun 2022 05:57:03 +0000 (05:57 +0000)]
armvirt: add options and driver modules for NXP Layerscape DPAA2 platform

Tested with a Traverse Technologies Ten64 (LS1088A) board.

Signed-off-by: Mathew McBride <matt@traverse.com.au>
(23.05/5.15 version of commit 54bb95f879aaa62c4253d30390e77bc8180f4ed7)

17 months agoarmvirt: add 5.15 patches for NXP DPAA2 platform
Mathew McBride [Fri, 15 Jul 2022 02:47:52 +0000 (02:47 +0000)]
armvirt: add 5.15 patches for NXP DPAA2 platform

This fixes an issue with NXP's DPAA2 platforms (LS1088/2088/LX2160)
* A deadlock issue when attempting to detach the SFP management from
  a PHY interface (e.g when trying to reboot). These issues were fixed
  in kernel 6.2[1], but it's version does not cleanly apply onto 5.15.

Signed-off-by: Mathew McBride <matt@traverse.com.au>
[1] - see patch series "Fix rtnl_mutex deadlock with DPAA2 and SFP modules",
https://patchwork.kernel.org/project/netdevbpf/cover/20221129141221.872653-1-vladimir.oltean@nxp.com/

17 months agoarmvirt: add ACPI support
Mathew McBride [Thu, 9 Jun 2022 04:51:59 +0000 (04:51 +0000)]
armvirt: add ACPI support

ACPI support is required for Arm 'SystemReady' server and workstation
systems (and as an option on embedded platforms).

These config changes allow OpenWrt to boot in a QEMU virtual machine
with a UEFI/EDKII 'BIOS', but with no other hardware enabled yet.

Signed-off-by: Mathew McBride <matt@traverse.com.au>
(23.05/5.15 version of cb3bbbf00cfb465de3333e4b84e8da9138985595)

17 months agobuild: enable vmdk/vmware images for arm64 target
Mathew McBride [Wed, 12 Jan 2022 05:53:55 +0000 (05:53 +0000)]
build: enable vmdk/vmware images for arm64 target

This is useful for VMware's ARM64 products, e.g Fusion for M1/ARM Macs.

Signed-off-by: Mathew McBride <matt@traverse.com.au>
(cherry picked from commit f899e0e024825861e129b0e8fbfb31c1d614273a)

17 months agobuild: use 128MiB as the boot/kernel partition size on armvirt target
Mathew McBride [Tue, 1 Jun 2021 01:48:25 +0000 (01:48 +0000)]
build: use 128MiB as the boot/kernel partition size on armvirt target

The nominal partition type for EFI boot partitions is FAT32,
which has a minimum size of 32MiB on a 512-byte-sector block device.

To ensure that the boot partition is created as FAT32 set a size
well above this minimum.

A useful discussion about EFI partition sizes can be found here:
https://superuser.com/questions/1310927/what-is-the-absolute-minimum-size-a-uefi-system-partition-can-be

I have found 128MiB works pretty consistently across both
tools (mkfs.fat) and firmwares (EDKII)

Signed-off-by: Mathew McBride <matt@traverse.com.au>
(cherry picked from commit 71e56b2ff1e8aeb3205784c0b5f8ca6ba0fbbf63)

17 months agoarmvirt: remove model name override
Mathew McBride [Mon, 24 Jan 2022 23:16:56 +0000 (23:16 +0000)]
armvirt: remove model name override

Now that armvirt has been expanded to boot on more generic
ARM machines, remove the board and model name override.

Signed-off-by: Mathew McBride <matt@traverse.com.au>
(cherry picked from commit 3d99314569a059a1d5e015086e534b3e04ff2097)

17 months agoarmvirt: set kernel partition as the EFI system partition
Mathew McBride [Thu, 20 Apr 2023 06:38:22 +0000 (06:38 +0000)]
armvirt: set kernel partition as the EFI system partition

U-Boot with EFI boot manager functionality will store
EFI boot order data on the ESP in the ubootefi.var file.

Signed-off-by: Mathew McBride <matt@traverse.com.au>
(cherry picked from commit 9a76b99c1bd781248c18d69abe570f35932db8a3)

17 months agoscripts: gen_image_generic: allow the partition types to be set
Mathew McBride [Thu, 20 Apr 2023 06:36:50 +0000 (06:36 +0000)]
scripts: gen_image_generic: allow the partition types to be set

The use case for this is to set the kernel partition as the
EFI system partition. Versions of U-Boot with the
EFI boot manager (eficonfig and efidebug commands) will
store their boot order data on the ESP.

Signed-off-by: Mathew McBride <matt@traverse.com.au>
(cherry picked from commit 701d774f54aef2f9fe3c584700773dcb260dd03c)

17 months agogrub2: enable EFI for armvirt
Mathew McBride [Wed, 24 Feb 2021 04:53:40 +0000 (04:53 +0000)]
grub2: enable EFI for armvirt

This adds a separate package for EFI on Arm SystemReady
compatible machines. 32-bit Arm UEFI is supported as well.

It is very similar to x86-64 EFI setup, without the
need for BIOS backward compatibility and slightly
different default modules.

Signed-off-by: Mathew McBride <matt@traverse.com.au>
(cherry picked from commit 8f29b1573ddf3b7ed7c53bee1a7d55e574806205)

17 months agoarmvirt: update README with new image names
Mathew McBride [Wed, 19 Jan 2022 03:24:45 +0000 (03:24 +0000)]
armvirt: update README with new image names

The introduction of EFI support has changed how armvirt
images are generated. The kernel and filesystem binaries
can still be used as before with QEMU directly.

Signed-off-by: Mathew McBride <matt@traverse.com.au>
(cherry picked from commit 97c5d317f59e071c9f691add5748a74a75665038)

17 months agoarmvirt: disable LD dead code elimination on ARM32
Mathew McBride [Wed, 28 Sep 2022 05:47:30 +0000 (15:47 +1000)]
armvirt: disable LD dead code elimination on ARM32

This interferes with the generation of the EFI stub section for
ARM32. As this target is not size constrained, disable the dead code
data elimination hack.

Signed-off-by: Mathew McBride <matt@traverse.com.au>
(23.05 version of eb0e61285d4da910317e082de559337a305fa1dc)

17 months agoarmvirt: add EFI support
Mathew McBride [Wed, 19 Jan 2022 02:25:23 +0000 (02:25 +0000)]
armvirt: add EFI support

EFI booting is used on newer machines compatible with the
Arm SystemReady specifications.

This commit restructures armvirt into a more 'generic'
target similar to x86.

See https://github.com/openwrt/openwrt/pull/4956
for a history of this port.

Signed-off-by: Mathew McBride <matt@traverse.com.au>
(23.05 version of e0f06ddc23b2503a1791ae7e97b02e2647e8a70d)

17 months agoipq807x: image: fix eMMC flashing/recovery from within initramfs
Petr Štetiar [Mon, 5 Jun 2023 12:10:44 +0000 (14:10 +0200)]
ipq807x: image: fix eMMC flashing/recovery from within initramfs

Having initramfs image built with same config as on buildbots:

 CONFIG_TARGET_MULTI_PROFILE=y
 CONFIG_TARGET_ALL_PROFILES=y
 CONFIG_TARGET_PER_DEVICE_ROOTFS=y

Its currently impossible to flash/recover the device using that image as
losetup is missing:

 root@OpenWrt:/# sysupgrade -v /tmp/openwrt-ipq807x-generic-prpl_haze-squashfs-sysupgrade.bin
 ...
 /lib/upgrade/do_stage2: line 38: losetup: not found
 Failed to detach all loop devices. Skip this try.

So lets fix it by including the needed utils for sysupgrade in
DEFAULT_PACKAGES set.

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

17 months agoipq807x: add initial support for prpl Foundation Haze board
Petr Štetiar [Mon, 5 Jun 2023 10:13:04 +0000 (12:13 +0200)]
ipq807x: add initial support for prpl Foundation Haze board

Haze is prpl Foundation's reference board (WNC LVRP).

Board info:

 - IPQ8072A SoC
 - 2 GiB RAM
 - 4 GiB eMMC
 - 8MiB SPI NOR (MX25U6435F)

 - 3x 1GigE ports (QCA8075)
 - 1x 10GigE port (AQR113C)
 - 1x SFP cage

 - WiFi 6GHz 160MHz (QCN9074)
 - WiFi 5GHz 80+80MHz (QCN5054)
 - WiFi 2.4G (QCN5024)

 - ARM Standard 20-pin 2.54mm/0.1" JTAG (1V8 !!!)
 - Bluetooth v5.0 + EDR with integrated Class 1 PA (CYW20704)
 - 1x M.2 B-key socket with PCIe 3.0
 - 1x USB 3.0 port
 - UART marked J6 is 4-pin 2.54mm/0.1" connector 3V3(arrow),RX,TX,GND (115200 8N1)
 - Reset and WPS buttons

Flashing instructions:

 1. From U-Boot boot OpenWrt using initramfs image:

    IPQ807x# tftpboot openwrt-ipq807x-generic-prpl_haze-initramfs-uImage.itb && bootm

 2. In OpenWrt running from initramfs execute sysupgrade:

    root@OpenWrt:/# sysupgrade -n /tmp/openwrt-ipq807x-generic-prpl_haze-squashfs-sysupgrade.bin

Work in progress/known issues:

 * SFP feature not implemented/tested
 * M.2 feature not implemented/tested
 * Bluetooth feature not implemented/tested
 * 6GHz wireless should be working, but not tested
 * MAC address assigments for LAN interfaces

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

17 months agoipq-wifi: update to version 2023-06-03
Petr Štetiar [Mon, 5 Jun 2023 10:06:41 +0000 (12:06 +0200)]
ipq-wifi: update to version 2023-06-03

Contains following updates:

 * ipq8074: update RegDB in new submitted BDF
 * Revert "ipq8074: update RegDB in new submitted BDF"
 * qcn9074: update RegDB in new submitted BDF
 * ipq8074: update RegDB in new submitted BDF
 * qca-wireless: ipq40xx: add BDFs for ZTE MF287+
 * Add BDFs for prpl Foundation Haze board

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

17 months agoipq-wifi: bump to latest git HEAD
Antti Nykänen [Thu, 25 May 2023 06:43:46 +0000 (09:43 +0300)]
ipq-wifi: bump to latest git HEAD

0f73d32 ipq8074: update RegDB in new submitted BDF
a4cd21f ipq8074: add Compex WPQ873 BDF
c888dd0 qca-wireless: ipq40xx: Add BDFs for Eero Cento
6388ba9 ipq8074: update regdb for Netgear SXK80 BDF
77775d2 ipq8074: add Netgear SXK80

Signed-off-by: Antti Nykänen <antti.nykanen@nokia.com>
(cherry picked from commit 86e7614e0deb5e97083103600b045833c6517c6b)

17 months agoipq807x: image: cleanup unused variables
Petr Štetiar [Tue, 30 May 2023 14:31:39 +0000 (16:31 +0200)]
ipq807x: image: cleanup unused variables

BLOCKSIZE and PAGESIZE seems to be unused on qnap_301w and zyxel_nbg7815
device which use eMMC storage.

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

17 months agotools/coreutils: rename list of installed programs
Michael Pratt [Tue, 30 May 2023 09:22:54 +0000 (05:22 -0400)]
tools/coreutils: rename list of installed programs

Rename the list of programs installed by coreutils
to PKG_PROGRAMS, which will create a stampfile for each
through a new feature in host-build.mk.

Also, cleanup a bit to save lines
regarding the usage of this list.

Signed-off-by: Michael Pratt <mcpratt@pm.me>
(cherry picked from commit 14a85d929b4a0a728dc4390ad34dcf8d69ac3475)

17 months agotools/findutils: define list of installed programs
Michael Pratt [Tue, 30 May 2023 09:43:00 +0000 (05:43 -0400)]
tools/findutils: define list of installed programs

Define the variable PKG_PROGRAMS for the list
of programs installed by findutils,
which will create a stampfile for each
through a new feature in host-build.mk.

Signed-off-by: Michael Pratt <mcpratt@pm.me>
(cherry picked from commit 04053e3f2050b6ea2cdb83c0956034e5fd368d10)

17 months agohost-build: add support for a stampfile per installed binary
Michael Pratt [Tue, 30 May 2023 11:20:19 +0000 (07:20 -0400)]
host-build: add support for a stampfile per installed binary

Some individual build items install a group of programs
instead of a program matching the name of the build item.

Add support for installing stampfiles for each of the
programs installed by that build item,
which will allow more control and awareness
of what is installed by the rest of the build system,
if, for example, prereq symlink checks are looking
for the same program which is built already.

Signed-off-by: Michael Pratt <mcpratt@pm.me>
(cherry picked from commit 84f7a45e9e83339d84bcc15f06259b1064cb961a)

17 months agoprereq-build: replace relative symlinks only if broken
Michael Pratt [Mon, 29 May 2023 09:38:33 +0000 (05:38 -0400)]
prereq-build: replace relative symlinks only if broken

Some programs installed to staging_dir/host/bin
also install some symlinks to itself
for an alternative name.

Some of those new symlinks are overwriting
symlinks that were installed by prereq stage.

If prereq stage were to somehow be run again,
it should not be overwriting symlinks
that point to programs that are already built.

To filter that out, catch all symlinks
after first catching all symlinks
that have an absolute target
after all other cases in the case statement,
make sure it is not broken, and if so exit successfully.

Suggested-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
Signed-off-by: Michael Pratt <mcpratt@pm.me>
(cherry picked from commit b890e2fbf9211648ad4a74f3e8b47bbf04a3cc7a)

17 months agoprereq-build: do not replace binaries with symlinks
Michael Pratt [Sat, 27 May 2023 21:11:47 +0000 (17:11 -0400)]
prereq-build: do not replace binaries with symlinks

Some programs, like bash and patch, are checked by prereq stage
and have a symlink installed, but then is later built from source.

Now that the prereq-build checks are not successful
just by finding the file alone, it is possible for
a new symlink to overwrite the installed binary.

If a normal file is found in staging_dir/host/bin,
let the check look for the associated stampfile, and if found,
skip creation of a symlink and exit successfully.

Suggested-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
Signed-off-by: Michael Pratt <mcpratt@pm.me>
(cherry picked from commit 729909c07fae4201591e51895833112cb88485e1)

17 months agoprereq-build: fix inconsistent value of $PATH
Michael Pratt [Thu, 25 May 2023 06:31:52 +0000 (02:31 -0400)]
prereq-build: fix inconsistent value of $PATH

In the recipe SetupHostCommand for checking
and creating symlinks, $PATH was only overridden
for one of several commands.

This causes the symlinks to be included
in the paths to pick a program from
when the check was repeated, because
staging_dir/host/bin was included in $PATH,
but only *sometimes*.

When the check ran again, the command succeded
with a $PATH including the symlink,
(eval "$$$$$$$$cmd")
while the path to the program was evaluated
with a $PATH NOT including the symlink,
(bin=...)
causing the symlink to be relinked incorrectly,
instead of passing as exactly the same.

Coincidentally, this was only a problem
if the symlink targeted the alternative
program with a different name.

By overriding the value of $PATH at the invocation of Make,
it will apply to the entire environment of the checks.

Signed-off-by: Michael Pratt <mcpratt@pm.me>
(cherry picked from commit 665fe2f818300f0b84c8c458fc49ae58ff8853aa)

17 months agotreewide: add ORIG_PATH variable
Michael Pratt [Thu, 25 May 2023 06:31:17 +0000 (02:31 -0400)]
treewide: add ORIG_PATH variable

Add a variable that stores the original value of $PATH
in the host system's shell, before Make alters it.

This can be useful for when it is necessary
to ignore symlinks and programs made by the build system.

Define this new variable before all instances of
'export PATH:=' or similar.

Signed-off-by: Michael Pratt <mcpratt@pm.me>
(cherry picked from commit d87a8aa148ddf93b199a759deb088fff73787025)

17 months agoipq807x: image: factor out common eMMC bits
Petr Štetiar [Tue, 30 May 2023 14:36:05 +0000 (16:36 +0200)]
ipq807x: image: factor out common eMMC bits

For better maintainability and reusability.

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

17 months agoqca-nss-dp: fix oops in nss_dp_probe
Petr Štetiar [Mon, 29 May 2023 17:27:15 +0000 (19:27 +0200)]
qca-nss-dp: fix oops in nss_dp_probe

Currently kernel crashes when of_phy_connect has issues:

 Unable to handle kernel access to user memory outside uaccess routines at virtual address 0000000000000308
 ...
 pc : phy_attached_print+0x28/0x1b0
 lr : phy_attached_info+0x14/0x20
 ...
 Call trace:
  phy_attached_print+0x28/0x1b0
  phy_attached_info+0x14/0x20
  nss_dp_adjust_link+0x544/0x6c4 [qca_nss_dp]

of_phy_connect returns either pointer or NULL, so can't be checked with
IS_ERR macro.

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

17 months agolibubox: update to the latest version
Felix Fietkau [Wed, 24 May 2023 08:21:23 +0000 (10:21 +0200)]
libubox: update to the latest version

b09b316aeaf6 blobmsg: add blobmsg_parse_attr function
eac92a4d5d82 blobmsg: add blobmsg_parse_array_attr
ef5e8e38bd38 usock: fix poll return code check
6fc29d1c4292 jshn.sh: Add pretty-printing to json_dump
5893cf78da40 blobmsg: Don't do at run-time what can be done at compile-time
362951a2d96e uloop: fix uloop_run_timeout
75a3b870cace uloop: add support for integrating with a different event loop

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

17 months agounetd: update to the latest version
Felix Fietkau [Sun, 4 Jun 2023 14:54:19 +0000 (16:54 +0200)]
unetd: update to the latest version

412d03012f13 network: prevent adding endpoint routes for addresses on the network
faaf9cee6ef4 utils: fix ipv4 checksum issue
0e1c2fad3540 pex-msg: fix memory leak on fread fail in pex_msg_update_request_init
51be0ed659d0 host: fix crash parsing gateway when no endpoint is specified
ca17601dc24e wg-linux: add support for splitting netlink messages for allowed ips
7d3986b7a5a2 wg-linux: increase default messages size

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

17 months agomac80211: ath11k: sync with ath-next
Robert Marko [Fri, 2 Jun 2023 12:12:01 +0000 (14:12 +0200)]
mac80211: ath11k: sync with ath-next

Synchronize the ath11k backports with the current ath-next tree.

This introduces support for MBSSID and EMA, adds factory test mode and
some new HTT stats.

Tested-by: Francisco G Luna <frangonlun@gmail.com>
Signed-off-by: Robert Marko <robimarko@gmail.com>
(cherry picked from commit acde5271a68835f51185aae1b11343439a9d4cab)

17 months agomac80211: backport EMA beacon support
Robert Marko [Fri, 2 Jun 2023 12:08:31 +0000 (14:08 +0200)]
mac80211: backport EMA beacon support

Backport EMA beacon support from kernel 6.4.
It is required for MBSSID/EMA suport in ath11k that will follow.

Tested-by: Francisco G Luna <frangonlun@gmail.com>
Signed-off-by: Robert Marko <robimarko@gmail.com>
(cherry picked from commit 84b5735b4c59c8fcb3db647430a4ffd574fb10a3)

17 months agorealtek: eth: Do not write directly to dev->addr
Olliver Schinagl [Wed, 24 May 2023 10:58:37 +0000 (12:58 +0200)]
realtek: eth: Do not write directly to dev->addr

One is never to write to dev->addr directly. In 6.1 it will be a const and
with the newly enabled WERROR, we get a failing grade.

Lets fix this ahead of time.

Signed-off-by: Olliver Schinagl <oliver@schinagl.nl>
(cherry picked from commit d881f65da1e6f3bc4237b39cf2373bef51c3828c)

17 months agorealtek: Add missing headers
Olliver Schinagl [Thu, 25 May 2023 11:38:47 +0000 (13:38 +0200)]
realtek: Add missing headers

We are missing a bunch of headers, which trigger errors on 6.1, probably
due to changed header-in-header dependencies. Best add them now.

Signed-off-by: Olliver Schinagl <oliver@schinagl.nl>
(cherry picked from commit 9fb1dbb1df35911b407fa0faaa2443fbc0f0ddde)

17 months agogeneric: b53: rename exported symbols to avoid upstream conflict
Robert Marko [Fri, 2 Jun 2023 10:27:19 +0000 (12:27 +0200)]
generic: b53: rename exported symbols to avoid upstream conflict

Upstream DSA driver is exporting symbols with the same name as our
downstream swconfig driver, so lets rename the downstream symbols to make
them unique and avoid the conflict on 6.1 kernel.

Without this change, building 6.1 with kmod-switch-bcm53xx would conflict
with the B53 DSA driver and CI would fail.

Signed-off-by: Robert Marko <robimarko@gmail.com>
(cherry picked from commit effccdd444a956afc5493ef8f1c79a7e7ffa8490)

17 months agokernel: add mdio-bus-mux support
Mathew McBride [Mon, 20 Mar 2023 04:16:04 +0000 (04:16 +0000)]
kernel: add mdio-bus-mux support

The MDIO bus multiplexing framework is used by some drivers
such as dwmac-sun8i.

As this is a per-driver requirement, set it to be hidden in the menu.

Signed-off-by: Mathew McBride <matt@traverse.com.au>
(cherry picked from commit 2dbeb607251b75b506dcc8f1294cd9ed0bac9694)

17 months agokernel: fix wrong detection of Linux-Testing-Version in makefile DUMP
Christian Marangi [Wed, 31 May 2023 13:19:31 +0000 (15:19 +0200)]
kernel: fix wrong detection of Linux-Testing-Version in makefile DUMP

When the split was done, the case for testing kernel version wasn't
handled and only the to-be-compiled kernel version details files was
included. This cause the kernel Linux-Testing-Version output from
makefile target DUMP to report only the kernel version without the minor
version (example 6.1 instead of 6.1.29).

This value is expected with the full kernel version and this cause the
dump-target-info.pl script to not correctly identify if a target have a
testing kernel for the kernels calls.

Fix this regression by correctly including the kernel details files if
the target declare support for a testing kernel version.

Fixes: 0765466a42f4 ("kernel: split kernel version to dedicated files")
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
(cherry picked from commit 595608eb3f05cba31da59e0d5d82504ab6731c0b)

17 months agobmips: add support for Comtrend AR-5381u
Álvaro Fernández Rojas [Sun, 11 Jun 2023 16:44:36 +0000 (18:44 +0200)]
bmips: add support for Comtrend AR-5381u

The Comtrend AR-5381u is a wifi fast ethernet router, 2.4 GHz single band with
two internal antennas.

Hardware:
 - SoC: Broadcom BCM6328
 - CPU: single core BMIPS4350 @ 320Mhz
 - RAM: 64 MB DDR
 - Flash: 16 MB SPI NOR
 - Ethernet LAN: 4x 100Mbit
 - Wifi 2.4 GHz: miniPCI Broadcom BCM43225 802.11bgn
 - USB: 1x 2.0
 - Buttons: 1x (reset)
 - LEDs: yes
 - UART: yes

Installation via CFE web UI:
  1. Power off the router.
  2. Press reset button near the power switch.
  3. Keep it pressed while powering up during ~20+ seconds.
  4. Browse to http://192.168.1.1 and upload the firmware.
  5. Wait a few minutes for it to finish.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
(cherry picked from commit bcdf861519)

17 months agorestool: update source.codeaurora.org repository link
Christian Marangi [Sun, 11 Jun 2023 13:22:49 +0000 (15:22 +0200)]
restool: update source.codeaurora.org repository link

source.codeaurora.org project has been shut down and the nxp
repositories has been moved to github. Update the repository
link to the new location.

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

17 months agols-dpl: update source.codeaurora.org repository link
Christian Marangi [Sun, 11 Jun 2023 13:20:01 +0000 (15:20 +0200)]
ls-dpl: update source.codeaurora.org repository link

source.codeaurora.org project has been shut down and the nxp
repositories has been moved to github. Update the repository
link to the new location.

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

17 months agolayerscape: 5.15: update source.codeaurora.org ppfe driver reference
Christian Marangi [Sun, 11 Jun 2023 13:12:05 +0000 (15:12 +0200)]
layerscape: 5.15: update source.codeaurora.org ppfe driver reference

source.codeaurora.org project has been shut down and the nxp
repositories has been moved to github. Update the link reference to the
new location.

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

17 months agobmips: add support for Comtrend WAP-5813n
Álvaro Fernández Rojas [Sun, 11 Jun 2023 10:30:57 +0000 (12:30 +0200)]
bmips: add support for Comtrend WAP-5813n

The Comtrend WAP-5813n is a wifi gigabit router, 2.4 GHz single band with
two external antennas.

Hardware:
 - SoC: Broadcom BCM6369
 - CPU: dual core BMIPS4350 @ 400Mhz
 - RAM: 64 MB DDR
 - Flash: 8 MB parallel NOR
 - LAN switch: Broadcom BCM53115, 5x 1Gbit
 - Wifi 2.4 GHz: miniPCI Broadcom BCM4322 802.11bgn
 - USB: 1x 2.0 (optional)
 - Buttons: 3x (reset)
 - LEDs: yes
 - UART: yes

Installation via CFE web UI:
  1. Power off the router.
  2. Press reset button near the power switch.
  3. Keep it pressed while powering up during ~20+ seconds.
  4. Browse to http://192.168.1.1 and upload the firmware.
  5. Wait a few minutes for it to finish.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
(cherry picked from commit c3b1ef2dfd)

17 months agoramips: mt7621-dts: move wan port to gmac1 YunCore FAP-640
Volodymyr Puiul [Sat, 10 Jun 2023 14:23:17 +0000 (18:23 +0400)]
ramips: mt7621-dts: move wan port to gmac1 YunCore FAP-640

move wan port to gmac1 to achieve 2Gbps CPU bandwidth between wan and
lan on YunCore FAP-640

Signed-off-by: Volodymyr Puiul <volodymyr.puiul@gmail.com>
(cherry picked from commit 47c2d50c0312412582fff7950b843d619400da9f)

17 months agobmips: add support for Comtrend VR-3025un
Álvaro Fernández Rojas [Sun, 11 Jun 2023 08:53:10 +0000 (10:53 +0200)]
bmips: add support for Comtrend VR-3025un

The Comtrend VR-3025un is a wifi gigabit router, 2.4 GHz single band with
two external antennas.

Hardware:
 - SoC: Broadcom BCM6368
 - CPU: dual core BMIPS4350 @ 400Mhz
 - RAM: 64 MB DDR
 - Flash: 8 MB parallel NOR
 - Ethernet LAN: 4x 100Mbit
 - Wifi 2.4 GHz: miniPCI Broadcom BCM43222 802.11bgn
 - USB: 1x 2.0
 - Buttons: 1x (reset)
 - LEDs: yes
 - UART: yes

Installation via CFE web UI:
  1. Power off the router.
  2. Press reset button near the antenna.
  3. Keep it pressed while powering up during ~20+ seconds.
  4. Browse to http://192.168.1.1 and upload the firmware.
  5. Wait a few minutes for it to finish.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
(cherry picked from commit 3baa45fbd8)

17 months agobmips: dgnd3700v1/dgnd3800b: add missing kmod-leds-gpio
Álvaro Fernández Rojas [Sun, 11 Jun 2023 08:25:03 +0000 (10:25 +0200)]
bmips: dgnd3700v1/dgnd3800b: add missing kmod-leds-gpio

Commit ed79519b8d89 missed adding kmod-leds-gpio to these devices.

Fixes: ed79519b8d89 ("bmips: add support for Netgear DGND3700 v1, DGND3800B")
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
17 months agobmips: image: rename Device/bcm63xx_netgear
Álvaro Fernández Rojas [Sun, 11 Jun 2023 08:17:50 +0000 (10:17 +0200)]
bmips: image: rename Device/bcm63xx_netgear

Every other Device definition in the target is using hyphens instead of
underscores.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
17 months agobmips: dts: improve and align device tree files
Álvaro Fernández Rojas [Sun, 11 Jun 2023 08:14:25 +0000 (10:14 +0200)]
bmips: dts: improve and align device tree files

Align all the device tree files and follow the same criteria before more
devices are ported from bcm63xx and this goes out of control.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
17 months agobmips: add support for Netgear EVG2000
Daniel González Cabanelas [Sat, 10 Jun 2023 19:05:33 +0000 (21:05 +0200)]
bmips: add support for Netgear EVG2000

The Netgear EVG2000 is a wifi gigabit router, 2.4 GHz single band with
two internal antennas integrated in the main PCB.

Hardware:
 - SoC: Broadcom BCM6369
 - CPU: dual core BMIPS4350 V3.1 @400Mhz
 - RAM: 64 MB DDR
 - Flash: 16 MB parallel NOR
 - LAN switch: Broadcom BCM53115, 5x 1Gbit
 - Wifi 2.4 GHz: Broadcom BCM4322 802.11bgn
 - USB: 2x 2.0
 - Buttons: 2x, 1 reset
 - LEDs: 10x
 - FXS: 2x
 - UART: yes

Installation via CFE web UI:
  1. Power off the router and make a temporal TX-RX shortcircuit on the
     serial pins.
  2. Power on the router and wait 3 or more seconds
  3. Remove the TX-RX shortcircuit
  4. Browse to http://192.168.1.1 or http://192.168.0.1 and upload the
     firmware
  5. Wait a few minutes for it to finish

Signed-off-by: Daniel González Cabanelas <dgcbueu@gmail.com>
17 months agoramips: fix button definitions for Zyxel WSM20
Thomas Schröder [Fri, 9 Jun 2023 10:03:31 +0000 (12:03 +0200)]
ramips: fix button definitions for Zyxel WSM20

Setting the events of the WPS and LED buttons to
the best matching values based from the documentation:
<https://openwrt.org/docs/guide-user/hardware/hardware.button#procd_buttons>

Signed-off-by: Thomas Schröder <tschroeder_github@outlook.com>
(cherry picked from commit b0120f7c8bb35088f298f00eb4a630f62fb4183f)

17 months agoramips: fix first boot network configuration for TOZED ZLT S12 PRO
Arınç ÜNAL [Fri, 9 Jun 2023 08:55:21 +0000 (11:55 +0300)]
ramips: fix first boot network configuration for TOZED ZLT S12 PRO

The network configuration at first boot for TOZED ZLT S12 PRO lacks setting
up the LAN and WAN network interfaces. Address this. The WAN port is
advertised as WAN/LAN on the device and is put on LAN on stock firmware so
put it on LAN here as well.

Fixes: ce1f9fa625 ("ramips: add support for TOZED ZLT S12 PRO")
Reported-by: Andre Cruz <me@1conan.com>
Signed-off-by: Arınç ÜNAL <arinc.unal@arinc9.com>
(cherry picked from commit b61253f92abb4c0d21ec7358a74438eae8d7e6b4)

17 months agokernel: use struct group to wipe psb6970 volatile priv data
Aleksander Jan Bajkowski [Thu, 25 May 2023 20:20:15 +0000 (22:20 +0200)]
kernel: use struct group to wipe psb6970 volatile priv data

Instead of reference vlan and do strange subtraction, use the handy
struct_group() to create a virtual struct of the same size of the
members. This permits to have a more secure memset and fix compilation
warning in 6.1 where additional checks are done.

Fix compilation warning:
| inlined from 'psb6970_reset_switch' at drivers/net/phy/psb6970.c:275:2:
| ./include/linux/fortify-string.h:314:25: error: call to '__write_overflow_field'
| declared with attribute warning: detected write beyond size of field
| (1st parameter); maybe use struct_group()? [-Werror=attribute-warning]
|  314 |                         __write_overflow_field(p_size_field, size);
|      |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|cc1: all warnings being treated as errors

Signed-off-by: Aleksander Jan Bajkowski <olek2@wp.pl>
(cherry picked from commit d69becd3071d560cd1c9ea655cbba26adce91f61)

17 months agoapm821xx: switch over from DTB_SIZE to DEVICE_DTC_FLAGS
Christian Lamparter [Thu, 8 Jun 2023 16:12:05 +0000 (18:12 +0200)]
apm821xx: switch over from DTB_SIZE to DEVICE_DTC_FLAGS

DEVICE_DTC_FLAGS is more flexible and can be used in
place of APM821xx own DTB_SIZE.

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

17 months agobmips: add support for Netgear DGND3700 v1, DGND3800B
Daniel González Cabanelas [Sat, 10 Jun 2023 09:54:59 +0000 (11:54 +0200)]
bmips: add support for Netgear DGND3700 v1, DGND3800B

The Netgear DGND3700 v1 and DGND3800B are the same device but with
different factory firmwares. It's an xDSL wifi router with a slim black
shiny casing and 4 PCB internal antennas connected via UFL to a miniPCI
detachable card.

Hardware:
 - SoC: Broadcom BCM6368
 - CPU: dual core BMIPS4350 V3.1 @400Mhz
 - RAM: 128 MB DDR
 - NOR Flash: 32 MB parallel (CFE and OS)
 - NAND flash: 128 MB (empty)
 - Ethernet LAN: 5x 1Gbit
 - Wifi 2.4 GHz: Broadcom BCM43222 802.11bgn
 - Wifi 5 GHz: Broadcom BCM43222 802.11abgn
 - USB: 2x 2.0
 - Buttons: 3x, 1 reset
 - LEDs: 11x
 - UART: yes

Installation via OEM web UI:
  1. Open the Netgear administration web interface, by default:
        http://192.168.0.1
user: admin
        password: password
  2. Look for "upgrade firmware" and proceed
  3. Wait some minutes until it finishes

Signed-off-by: Daniel González Cabanelas <dgcbueu@gmail.com>
17 months agobmips: add support for Observa VH4032N
Daniel González Cabanelas [Thu, 8 Jun 2023 22:09:33 +0000 (00:09 +0200)]
bmips: add support for Observa VH4032N

The Observa VH4032N is an xDSL wifi router with a vertical white casing
and two internal antennas connected via UFL.

Hardware:
 - SoC: Broadcom BCM6368
 - CPU: dual core BMIPS4350 V3.1 @400MHz
 - RAM: 128 MB DDR
 - Flash: 32 MB parallel NOR
 - Ethernet LAN: 4x 100Mbit
 - Wifi 2.4/5 GHz: onboard Broadcom BCM43222 802.11abgn
 - USB: 3x 2.0
 - Buttons: 2x, 1 reset
 - LEDs: 8x, blue and red
 - UART: 1x

Installation via OEM web UI:
  1. Use the admin credentials to login via web UI
  2. Go to Managament->Update firmware and select the OpenWrt CFE firmware
  3. Press "Update Firmware" button and wait some minutes until it finish

Signed-off-by: Daniel González Cabanelas <dgcbueu@gmail.com>
17 months agobmips: bump LZMA Loader address
Álvaro Fernández Rojas [Fri, 9 Jun 2023 17:48:42 +0000 (19:48 +0200)]
bmips: bump LZMA Loader address

This allows booting bigger ramdisk images via TFTP at the cost of breaking 32M
RAM compatibility, but those devices have been unable to boot ramdisks on this
target for some time anyway due to not having enough RAM.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
17 months agomediatek: use DEVICE_DTC_FLAGS and drop DTC_FLAGS where not needed
Daniel Golle [Tue, 6 Jun 2023 12:05:50 +0000 (13:05 +0100)]
mediatek: use DEVICE_DTC_FLAGS and drop DTC_FLAGS where not needed

The MT7986 RFB was intended to use device tree overlays and for that
reason modified DTC_FLAGS. zyxel_ex5601-t0-stock later on probably
copied it from there. Both boards do not actually use device tree
overlays, so remove setting DTC_FLAGS from both.

The BPi-R3 does use device tree overlays, use DEVICE_DTC_FLAGS to give
it an extra 4kb of padding for overlays to be applied.

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

17 months agomediatek: use DEVICE_DTC_FLAGS for BPi-R64
Daniel Golle [Tue, 6 Jun 2023 12:04:08 +0000 (13:04 +0100)]
mediatek: use DEVICE_DTC_FLAGS for BPi-R64

Make sure there is an extra 4kb of padding to apply device tree overlays
on the BPi-R64.

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

17 months agoimage: introduce DEVICE_DTC_FLAGS and DEVICE_DTCO_FLAGS
Daniel Golle [Tue, 6 Jun 2023 12:01:15 +0000 (13:01 +0100)]
image: introduce DEVICE_DTC_FLAGS and DEVICE_DTCO_FLAGS

Handle compiling device tree overlay blobs separate to allow for
overlays being compiled with different parameters, mostly to safe
space.
Allow defining DEVICE_DTC_FLAGS and DEVICE_DTCO_FLAGS as per-device
parameters to be passed to dtc. Previously some boards directly used
DTC_FLAGS in their build recipe which then also affected other boards.

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

17 months agomediatek: set new compat version if booted on R64 and R3
Daniel Golle [Tue, 6 Jun 2023 00:14:27 +0000 (01:14 +0100)]
mediatek: set new compat version if booted on R64 and R3

If the board comes up with OpenWrt that means that the bootloader is
recent enough and knows about the new device tree overlays.

Using /etc/board.d/ is not enough in this case because it doesn't
overwrite existing configuration which may exist (and is fine to exist)
if the user updated with 'sysupgrade -F *.itb' and has kept
configuration. They would still need to manually set compat_version
even though the fact that the bootloader env has been updated can be
implied by the fact that the system has started.

Hence we can always set compat_version=1.1 for those two boards using
uci-defaults.

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

17 months agomediatek: sync MT7986 device trees with upstream
Daniel Golle [Sun, 4 Jun 2023 14:56:15 +0000 (15:56 +0100)]
mediatek: sync MT7986 device trees with upstream

Sync device tree files for MT7986 boards with what landed in upstream
Linux tree to easy maintainance and also allow for a smooth update to
Linux 6.1.

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

17 months agomediatek: use updated device tree overlay mechanism for BPi-R64
Daniel Golle [Sun, 4 Jun 2023 18:55:11 +0000 (19:55 +0100)]
mediatek: use updated device tree overlay mechanism for BPi-R64

Use new device tree overlay mechanism for the BananaPi BPi-R64 board.

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

17 months agouboot-mediatek: adapt BPi-R3 and BPi-R64 to new device tree overlay
Daniel Golle [Sun, 4 Jun 2023 17:55:17 +0000 (18:55 +0100)]
uboot-mediatek: adapt BPi-R3 and BPi-R64 to new device tree overlay

Update bootloader environment for BPi-R3 and BPi-R64 to adapt to new
device tree overlay mechanism now that support for multiple device
tree overlays has been added.

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

17 months agogeneric: use only first element in bootconf for uImage.FIT
Daniel Golle [Sun, 4 Jun 2023 17:21:29 +0000 (18:21 +0100)]
generic: use only first element in bootconf for uImage.FIT

Now that it is possible to load several device tree overlays by
appending their config names to bootconf the uImage.FIT partition
parser need to discard everything after the first '#' character in
bootconf when looking up the config node to be used.

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

17 months agoimage: improve uImage.FIT device tree overlay support
Daniel Golle [Sun, 4 Jun 2023 14:57:25 +0000 (15:57 +0100)]
image: improve uImage.FIT device tree overlay support

Instead of generating full config nodes incl. kernel, generate minimal
config nodes for device tree overlays to be applied to the main config.
In this way, multiple device tree overlays can be applied more easily.
While at it change filenames to upstream style, ie. use dtso and dtbo
suffix for device tree overlays.

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

17 months agomediatek: convert mt7986a-zyxel-ex5601-t0-stock.dts to UNIX
Daniel Golle [Sun, 4 Jun 2023 15:05:29 +0000 (16:05 +0100)]
mediatek: convert mt7986a-zyxel-ex5601-t0-stock.dts to UNIX

The device tree file was in DOS format (CR-LF). Convert it to UNIX style.

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

17 months agomediatek: use existing I2C clock names
Daniel Golle [Thu, 1 Jun 2023 09:32:19 +0000 (10:32 +0100)]
mediatek: use existing I2C clock names

PCK and MCK should really be P=PMIC and M=MEM, which means that they
should effectively be CLK_PMIC and CLK_ARB.

Suggested-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
(cherry picked from commit 0580747adab2094862c18b5e762c908dd3b43236)

17 months agomediatek: use cpufreq fix suggested by MediaTek
Daniel Golle [Fri, 26 May 2023 12:31:26 +0000 (13:31 +0100)]
mediatek: use cpufreq fix suggested by MediaTek

Use suggested fix for mediatek-cpufreq, patch will also be sent
upstream.

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

17 months agoopenssl: update to 3.0.9
Ivan Pavlov [Sun, 4 Jun 2023 19:34:39 +0000 (22:34 +0300)]
openssl: update to 3.0.9

CVE-2023-2650 fix
Remove upstreamed patches

Major changes between OpenSSL 3.0.8 and OpenSSL 3.0.9 [30 May 2023]
 * Mitigate for very slow OBJ_obj2txt() performance with gigantic OBJECT IDENTIFIER sub-identities. (CVE-2023-2650)
 * Fixed buffer overread in AES-XTS decryption on ARM 64 bit platforms (CVE-2023-1255)
 * Fixed documentation of X509_VERIFY_PARAM_add0_policy() (CVE-2023-0466)
 * Fixed handling of invalid certificate policies in leaf certificates (CVE-2023-0465)
 * Limited the number of nodes created in a policy tree (CVE-2023-0464)

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

17 months agovalgrind: update to 3.21.0
Hauke Mehrtens [Wed, 31 May 2023 20:51:12 +0000 (22:51 +0200)]
valgrind: update to 3.21.0

Release Notes:
https://valgrind.org/docs/manual/dist.news.html

This improves support for the memory allocator used in musl libc 1.2.2
and later which is currently used by OpenWrt.

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

17 months agokselftests-bpf: add kernel BPF tests
Tony Ambardar [Mon, 17 May 2021 18:57:40 +0000 (11:57 -0700)]
kselftests-bpf: add kernel BPF tests

Build and package kernel self-tests used for BPF testing, program and JIT
development. This package, together with the existing 'kmod-bpf-test', was
extensively used for past upstream Linux JIT submissions [1].

Currently this includes only 'test_verifier'; building 'test_progs' will
fail due to known endian limitations with bpftool skeletons.

[1]:https://lore.kernel.org/bpf/cover.1633392335.git.Tony.Ambardar@gmail.com

Signed-off-by: Tony Ambardar <itugrok@yahoo.com>
(cherry picked from commit 3886ea9b87c416c080078603fedea95bcc144442)

17 months agokernel: backport libcap workaround for BPF selftests
Tony Ambardar [Tue, 29 Nov 2022 04:43:19 +0000 (20:43 -0800)]
kernel: backport libcap workaround for BPF selftests

Recent libcap versions (>= 2.60) cause problems with BPF kselftests, so
backport an upstream patch that replaces libcap and drops the dependency.

Signed-off-by: Tony Ambardar <itugrok@yahoo.com>
(cherry picked from commit 04981c716acab6b7a81f672f217e5c47ee42a0b6)

17 months agobase-files: enable BPF JIT kallsyms by default
Tony Ambardar [Fri, 26 May 2023 08:41:18 +0000 (01:41 -0700)]
base-files: enable BPF JIT kallsyms by default

Set net.core.bpf_jit_kallsyms=1 in /etc/sysctl.d/10-default.conf.

For privileged users, this exports addresses of JIT-compiled programs to
appear in /proc/kallsyms when present, allowing their use for debugging
and in traces.

Signed-off-by: Tony Ambardar <itugrok@yahoo.com>
(cherry picked from commit b3aaede2a7b14f2be850db8ae0c826e2782a60e8)

17 months agorockchip: add Orange Pi R1 Plus LTS support
Tianling Shen [Tue, 30 May 2023 04:59:07 +0000 (12:59 +0800)]
rockchip: add Orange Pi R1 Plus LTS support

The OrangePi R1 Plus LTS is a minor variant of OrangePi R1 Plus with
the on-board NIC chip changed from rtl8211e to yt8531c, and otherwise
identical to OrangePi R1 Plus.

Tested-by: Volkan Yetik <no3iverson@gmail.com>
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
(cherry picked from commit 32d5921b8b5508a99680ecf1626667517c2cbdb8)
[Removed patches for kernel 6.1]
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
17 months agouboot-rockchip: add Orange Pi R1 Plus LTS support
Tianling Shen [Tue, 30 May 2023 04:59:07 +0000 (12:59 +0800)]
uboot-rockchip: add Orange Pi R1 Plus LTS support

Add support for the Xunlong Orange Pi R1 Plus LTS.
Manually generated of-platdata files to avoid swig dependency.

Tested-by: Volkan Yetik <no3iverson@gmail.com>
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
(cherry picked from commit 37fed89166e6e21c20ef92b36106f7184a0476c6)

17 months agorockchip: add Orange Pi R1 Plus support
Tianling Shen [Tue, 30 May 2023 04:59:07 +0000 (12:59 +0800)]
rockchip: add Orange Pi R1 Plus support

Orange Pi R1 Plus is a Rockchip RK3328 based SBC by Xunlong.

This device is similar to the NanoPi R2S, and has a 16MB
SPI NOR (mx25l12805d). The reset button is changed to
directly reset the power supply, another detail is that
both network ports have independent MAC addresses.

Note: booting from SPI is currently unsupported, you have to install
the image on a SD card.

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
(cherry picked from commit ab641efe698f4412319fcbcfe6ffde64c929cd97)
[Removed patches for kernel 6.1]
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
17 months agouboot-rockchip: add Orange Pi R1 Plus support
Tianling Shen [Tue, 30 May 2023 04:59:07 +0000 (12:59 +0800)]
uboot-rockchip: add Orange Pi R1 Plus support

Add support for the Xunlong Orange Pi R1 Plus.
Manually generated of-platdata files to avoid swig dependency.

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
(cherry picked from commit 043f8a4f5ecf00e8a62b5a5d48baba48e620ea6a)

17 months agogeneric: drop useless binfmt patch fixing compilation warning
Christian Marangi [Thu, 8 Jun 2023 01:23:53 +0000 (03:23 +0200)]
generic: drop useless binfmt patch fixing compilation warning

The compilation warning was triggered by wrongly set FRAME_WARN to 1024
even for 64bit. This was recently fix by correctly setting the
FRAME_WARN to 2048 for 64bit systems.

The compilation warning would still be triggered on 32bit system but the
actual code is never reached as ARCH_USE_GNU_PROPERTY is only set on
arm64 arch.

Drop the patch as kmalloc cause perf regression as suggested by upstream
maintainers.

Fixes: fa79baf4a6e2 ("generic: copy backport, hack, pending patch and config from 5.15 to 6.1")
Fixes: 5913ea1ba2fa ("generic: 5.15: add pending patch fixing binfmt compilation warning")
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
(cherry picked from commit 62338f41625074640a4de9e26e5e67b010fe0ebe)

17 months agooxnas: Enable CONFIG_CRYPTO_LZ4
Jitao Lu [Sun, 4 Jun 2023 05:54:01 +0000 (13:54 +0800)]
oxnas: Enable CONFIG_CRYPTO_LZ4

Previously, CONFIG_LZ4_DECOMPRESS=y was selected by CONFIG_RD_LZ4 only.

When building kernel for initramfs, CONFIG_RD_LZ4 will be unset by
Kernel/SetInitramfs if the chosen compression method is not lz4, then
CONFIG_LZ4_DECOMPRESS will become a *module* in the newly generated
kernel config.

However, the newly added module won't be built after
38c150612cc9be488527e342db92d5c74093213f, so packaging kmod-lib-lz4
fails due to missing lz4_decompress.ko.

CONFIG_CRYPTO_LZ4=y makes CONFIG_LZ4_DECOMPRESS=y being selected w/o
CONFIG_RD_LZ4, so that the modules of the default kernel and initramfs
kernel are consistent.

Fixes: #12766
Fixes: 38c150612cc ("build: revert 54070a1 (all kernels are >= 5.10)")
Signed-off-by: Jitao Lu <dianlujitao@gmail.com>
(cherry picked from commit cc87f6629b8a120420075cd984a4e6ece6c669df)