openwrt/staging/dangole.git
2 months agoWIP: mediatek: add bpi-r3-mini main
Daniel Golle [Fri, 26 Jan 2024 17:28:01 +0000 (17:28 +0000)]
WIP: mediatek: add bpi-r3-mini

What works:
 * Ethernet with Airoha EN8811H PHYs
 * WiFi
 * USB
 * booting from SPI-NAND
 * booting from eMMC
 * PWM fan
 * CPU thermal sensor
 * LEDs
 * reset button

Untested:
 * M.2 NVMe (PCIe)
 * M.2 LTE modem (USB 3)

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

2 months agokernel: add driver for Airoha EN8811H PHY as module
Daniel Golle [Fri, 26 Jan 2024 17:27:08 +0000 (17:27 +0000)]
kernel: add driver for Airoha EN8811H PHY as module

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

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

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

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

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

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

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

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

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

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2 months agoDO NOT COMMIT
Daniel Golle [Wed, 24 Jan 2024 19:38:21 +0000 (19:38 +0000)]
DO NOT COMMIT

mt76: add patch fixing firmware timeout on MT7996

This should be committed to mt76.git rather than a patch here.

2 months agomediatek: update driver for MT7988 built-in 2.5G Ethernet PHY
Daniel Golle [Wed, 24 Jan 2024 19:10:36 +0000 (19:10 +0000)]
mediatek: update driver for MT7988 built-in 2.5G Ethernet PHY

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

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

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

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

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

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

tl;dr: DON'T USE YET!

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

No bootloader changes needed in this case, smooth transition.

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

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

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

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

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

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

Remove BROKEN mark now that all needed changes are done.

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

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

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

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

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

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

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

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

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

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2 months agouboot-envtools: filogic: add support for BananaPi R4
Daniel Golle [Mon, 27 Nov 2023 04:01:33 +0000 (04:01 +0000)]
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>
2 months agouboot-envtools: filogic: de-duplicate UBI env settings
Daniel Golle [Mon, 27 Nov 2023 03:59:32 +0000 (03:59 +0000)]
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>
2 months agomediatek: add support for BananaPi BPI-R4 board
Daniel Golle [Sun, 23 Jul 2023 11:38:15 +0000 (12:38 +0100)]
mediatek: add support for BananaPi BPI-R4 board

Hardware
--------
SOC:    MediaTek MT7988A (4x Cortex-A73)
RAM:    4 GiB DDR4
Flash:  128 MiB Winbond SPI-NAND
MMC:    8 GiB eMMC *or* microSD (cannot be used both)
ETH:    4x 1GE (1x WAN, 3x LAN)
        2x SFP+ (10G, 5G, 2.5G, 1G)
USB:    on-board USB 3.2 4-port hub
        1x USB 3.2 port (type A connector)
        1x M.2 for 4G/5G modem
        2x mPCIe for additional modems
WiFi:   optional MediaTek MT7996 Wi-Fi 7 module
        (using 2x PCIe gen3 x2 on the mPCIe slots and 12V power)

Installation
------------
1. Decompress and write the sdcard image to a micro SD card and use that
to boot the R4 (both dip switches in upper position).

2. Use the bootloader menu accessible via the serial console to install
to SPI-NAND.

3. Switch to boot from SPI-NAND and install to eMMC.

Known issues
------------
 - The RST button is hard-wired to the SoC reset and can't be read
   from software. This can be changed by modifying the board (ie.
   moving a 0-ohm resistor). However, in order to maintain compatibility
   with the board as it comes from factory the button isn't used by
   OpenWrt and the WPS button is used as factory/reset button instead.

 - various small things still need to be fixed in DT

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2 months agouboot-mediatek: update to U-Boot 2024.01 release
Daniel Golle [Wed, 13 Dec 2023 05:37:20 +0000 (05:37 +0000)]
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>
2 months agouboot-mediatek: add build for BPi-R4
Daniel Golle [Tue, 25 Jul 2023 01:56:01 +0000 (02:56 +0100)]
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>
2 months agouboot-mediatek: mt7988: set rootdisk according to boot device
Daniel Golle [Tue, 5 Dec 2023 04:10:31 +0000 (04:10 +0000)]
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>
2 months agouboot-mediatek: fix MMC erase timeout
Daniel Golle [Tue, 5 Dec 2023 04:08:13 +0000 (04:08 +0000)]
uboot-mediatek: fix MMC erase timeout

When erasing large amounts of blocks at once this can take a long
time on slow cards. Instead of a fixed timeout, wait longer if more
blocks are being erased.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2 months agomediatek: add patch for xsphy driver to support pcie2 on MT7988
Daniel Golle [Fri, 8 Dec 2023 01:04:39 +0000 (01:04 +0000)]
mediatek: add patch for xsphy driver to support pcie2 on MT7988

Import patch from MediaTek SDK which allows using the third
PCIe host controller of the MT7988 SoC.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2 months agomediatek: mt7988: add pinconf map
Daniel Golle [Thu, 25 Jan 2024 01:22:10 +0000 (01:22 +0000)]
mediatek: mt7988: add pinconf map

Add pull-up/pull-down configuration for pins of MT7988.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2 months agomediatek: switch to pending XFI 10G Ethernet drivers
Daniel Golle [Sun, 28 Jan 2024 03:55:15 +0000 (03:55 +0000)]
mediatek: switch to pending XFI 10G Ethernet drivers

Replace previous patch adding paths and SerDes modes with patch series
pending upstream adding dedicated drivers for XFI T-PHY and USXGMII PCS,
extends LynxI PCS to be a standalone platform driver and as a consequence
makes much less changes to the actual Ethernet driver mtk_eth_soc.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2 months agomediatek: backport a hell of thermal commits
Daniel Golle [Sun, 28 Jan 2024 03:46:58 +0000 (03:46 +0000)]
mediatek: backport a hell of thermal commits

Backport almost 50 commits from upstream Linux to improve thermal
drivers for MediaTek SoCs and add new LVTS driver for MT7988.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2 months agomediatek: replace mt7988 clk files with accepted patches
Daniel Golle [Sun, 28 Jan 2024 03:45:53 +0000 (03:45 +0000)]
mediatek: replace mt7988 clk files with accepted patches

Replace clock drivers for MT7988 with backported upstream commits.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2 months agokernel: backport phylink changes from mainline Linux
Daniel Golle [Sun, 28 Jan 2024 03:36:40 +0000 (03:36 +0000)]
kernel: backport phylink changes from mainline Linux

Let's pick a bunch of useful phylink changes which allow us to keep
drivers in sync with mainline Linux.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2 months agomediatek: switch to Linux version 6.1
Daniel Golle [Mon, 4 Dec 2023 23:41:39 +0000 (23:41 +0000)]
mediatek: switch to Linux version 6.1

Drop support for Linux 5.15 and switch to Linux 6.1.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2 months agopackage: add fitblk util to release /dev/fit* devices
Daniel Golle [Tue, 13 Jun 2023 14:32:15 +0000 (15:32 +0100)]
package: add fitblk util to release /dev/fit* devices

Add minimalistic tool to allow releasing /dev/fit* devices which is
needed on sysupgrade when using the fitblk driver.
The package is hidden in menuconfig, it should only be selected by
adding it to the default package selection of boards using it.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2 months agokernel: add pending fitblk uImage.FIT sub-image block driver
Daniel Golle [Tue, 5 Dec 2023 00:20:42 +0000 (00:20 +0000)]
kernel: add pending fitblk uImage.FIT sub-image block driver

Add 'fitblk' driver to replace the rejected/deprecated uImage.FIT
partition parser.
To use the new driver, add phandle /chosen/rootdisk and point it to
the MTD partition, UBI volume or block device holding the uImage.FIT.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2 months agokernel: import pending patches adding support for NVMEM on UBI and MMC
Daniel Golle [Mon, 4 Dec 2023 23:48:40 +0000 (23:48 +0000)]
kernel: import pending patches adding support for NVMEM on UBI and MMC

Similar to supporting nvmem-layouts on MTD devices, also allow referencing
UBI and MMC devices in DT.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2 months agokernel: allow skipping deprecated uImage.FIT partition parser
Daniel Golle [Fri, 24 Nov 2023 12:22:27 +0000 (12:22 +0000)]
kernel: allow skipping deprecated uImage.FIT partition parser

In order to allow gradually migrating the boards currently using the
uImage.FIT partition (deprecated/rejected) parser to the new fitblk
driver, skip the partition parser code in case the new fitblk driver
(which serves the same purpose) is used.

As an indicator for the use of the new fitblk driver, check if the
/chosen/rootdisk property is present in the Device Tree.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2 months agokernel: move uImage.FIT partition parser to mediatek target
Daniel Golle [Mon, 4 Dec 2023 23:25:12 +0000 (23:25 +0000)]
kernel: move uImage.FIT partition parser to mediatek target

The partition parser approach has been rejected upstream, it will be
replaced by a small block driver which is the solution suggestion by
upstream maintainers.
As the partition parser has only been used by the mediatek target, as
a first step, move it there.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2 months agokernel: 6.1: backport UBI device model improvements
Daniel Golle [Tue, 5 Dec 2023 03:44:05 +0000 (03:44 +0000)]
kernel: 6.1: backport UBI device model improvements

Backport two commits from Linux 6.3 wiring up device node parents of
ubi devices (pointing to their MTD parent) as well as ubiblock devices
(poiting to their parent UBI volume).

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2 months agoarm-trusted-firmware-mediatek: use UBI on new NAND targets
Daniel Golle [Fri, 12 Jan 2024 02:36:59 +0000 (02:36 +0000)]
arm-trusted-firmware-mediatek: use UBI on new NAND targets

Make use of recently added UBI support in MediaTek's ARM
TrustedFirmware-A on new MT7988 SoC.

Load fip from static UBI volume instead of fixed offset on SPIM-NAND
and SNFI.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2 months agoarm-trusted-firmware-mediatek: set HIDDEN=y
Daniel Golle [Fri, 12 Jan 2024 02:40:20 +0000 (02:40 +0000)]
arm-trusted-firmware-mediatek: set HIDDEN=y

Hide arm-trusted-firmware-mediatek packages from interactive config.
Exposing them only causes confusion and needed variants are anyway
selected as dependencies by uboot-mediatek packages.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2 months agodropbear: backport strict KEX mode
Daniel Golle [Wed, 24 Jan 2024 22:52:22 +0000 (22:52 +0000)]
dropbear: backport strict KEX mode

Backport strict KEX mode as specified by OpenSSH with
kex-strict-c-v00@openssh.com and kex-strict-s-v00@openssh.com.

Fixes: CVE-2023-48795 ("Terrapin")
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2 months agokernel: bump 5.15 to 5.15.148
John Audia [Fri, 26 Jan 2024 21:55:30 +0000 (16:55 -0500)]
kernel: bump 5.15 to 5.15.148

Changelog: https://cdn.kernel.org/pub/linux/kernel/v5.x/ChangeLog-5.15.148

Removed upstreamed:
generic/hack-5.15/321-powerpc_crtsavres_prereq.patch[1]

Manually rebased:
target/linux/octeontx/patches-5.15/0004-PCI-add-quirk-for-Gateworks-PLX-PEX860x-switch-with-.patch[2]

All other patches automatically rebased.

1. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.15.148&id=0b11a145eb00d51f7ef18cfcae587b93f9adb1e9
2. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit?h=v5.15.148&id=b67064bd372300a75293efbbc70624996dccffd4

Build system: x86_64
Build-tested: ramips/tplink_archer-a6-v3
Run-tested: ramips/tplink_archer-a6-v3

Signed-off-by: John Audia <therealgraysky@proton.me>
2 months agokernel: bump 6.1 to 6.1.75
John Audia [Fri, 26 Jan 2024 21:09:33 +0000 (16:09 -0500)]
kernel: bump 6.1 to 6.1.75

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

Removed upstreamed:
generic/hack-6.1/321-powerpc_crtsavres_prereq.patch[1]
generic/pending-6.1/540-ksmbd-only-v2-leases-handle-the-directory.patch[2]

Rebased:
bcm27xx/patches-6.1/950-0670-fbdev-Don-t-cancel-deferred-work-if-pagelist-empty.patch[3]

All other patches automatically rebased.

1. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.1.75&id=16b88e68b85d5520c28498bb847358ff6300cb90
2. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/fs/smb?h=v6.1.75&id=c866866c795296d3637ab0d48a3d8a3ef5d6f4a3
3. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.1.75&id=81f444f22816a82ada2cc787a2845cffc8c584a6

Build system: x86/64
Build-tested: x86/64/AMD Cezanne
Run-tested: x86/64/AMD Cezanne

Signed-off-by: John Audia <therealgraysky@proton.me>
2 months agogeneric: 6.1: backport PHY package MMD patch
Christian Marangi [Thu, 1 Feb 2024 15:26:32 +0000 (16:26 +0100)]
generic: 6.1: backport PHY package MMD patch

Backport PHY package MMD patch merged upstream that add support for
writing MMD regs for the PHY package and support for writing to PHY
package at an offset.

All affected patches automatically refreshed.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2 months agoath79: convert ath10k calibration data to NVMEM (ASCII MAC)
Shiji Yang [Thu, 1 Feb 2024 11:39:51 +0000 (19:39 +0800)]
ath79: convert ath10k calibration data to NVMEM (ASCII MAC)

This patch converts ath10k calibration data to NVMEM format for
wave 1 devices with mtd ASCII MAC address. The "calibration"
NVMEM cell size is 0x844. All unportable MAC address settings
have been moved to '10_fix_wifi_mac' scripts.

Signed-off-by: Shiji Yang <yangshiji66@qq.com>
2 months agoath79: convert ath10k calibration data to NVMEM (binary MAC)
Shiji Yang [Thu, 1 Feb 2024 11:39:51 +0000 (19:39 +0800)]
ath79: convert ath10k calibration data to NVMEM (binary MAC)

This patch converts ath10k calibration data to NVMEM format for
wave 1 devices with mtd binary MAC address. The "calibration"
NVMEM cell size is 0x844. The MAC addresses are assigned via dts.

Signed-off-by: Shiji Yang <yangshiji66@qq.com>
2 months agoath79: convert ath10k calibration data to NVMEM (built-in MAC)
Shiji Yang [Thu, 1 Feb 2024 11:39:51 +0000 (19:39 +0800)]
ath79: convert ath10k calibration data to NVMEM (built-in MAC)

This patch converts ath10k calibration data to NVMEM format for
wave 1 devices with built-in MAC address. The "calibration"
NVMEM cell size is 0x844.

Signed-off-by: Shiji Yang <yangshiji66@qq.com>
2 months agoath79: convert ath10k pre-calibration data to NVMEM (ASCII MAC)
Shiji Yang [Thu, 1 Feb 2024 11:39:51 +0000 (19:39 +0800)]
ath79: convert ath10k pre-calibration data to NVMEM (ASCII MAC)

This patch converts ath10k pre-calibration data to NVMEM format for
wave 2 devices with mtd ASCII MAC address. The "pre-calibration"
NVMEM cell size is 0x2f20. All unportable MAC address settings have
been moved to '10_fix_wifi_mac' scripts.

Signed-off-by: Shiji Yang <yangshiji66@qq.com>
2 months agoath79: convert ath10k pre-calibration data to NVMEM (binary MAC)
Shiji Yang [Thu, 1 Feb 2024 11:39:51 +0000 (19:39 +0800)]
ath79: convert ath10k pre-calibration data to NVMEM (binary MAC)

This patch converts ath10k pre-calibration data to NVMEM format for
wave 2 devices with mtd binary MAC address. The "pre-calibration"
NVMEM cell size is 0x2f20. The MAC addresses are assigned via dts.

Signed-off-by: Shiji Yang <yangshiji66@qq.com>
2 months agoath79: convert ath10k pre-calibration data to NVMEM (built-in MAC)
Shiji Yang [Thu, 1 Feb 2024 11:39:51 +0000 (19:39 +0800)]
ath79: convert ath10k pre-calibration data to NVMEM (built-in MAC)

This patch converts ath10k pre-calibration data to NVMEM format for
wave 2 devices with built-in MAC address. The "pre-calibration"
NVMEM cell size is 0x2f20.

Signed-off-by: Shiji Yang <yangshiji66@qq.com>
2 months agoath79: add back board-2.bin to COMFAST devices
Shiji Yang [Thu, 1 Feb 2024 11:39:51 +0000 (19:39 +0800)]
ath79: add back board-2.bin to COMFAST devices

The ath10k driver will load both pre-calibration data and board-2.bin
if board-2.bin exists. So it's not necessary to remove it. And this
change won't increase jffs2 image size.

Signed-off-by: Shiji Yang <yangshiji66@qq.com>
2 months agokernel: move gpio packages to gpio menu
Chukun Pan [Mon, 20 Nov 2023 15:16:16 +0000 (23:16 +0800)]
kernel: move gpio packages to gpio menu

Move gpio packages to the 'GPIO support' menu.

Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
2 months agokernel: modules: move gpio modules to gpio menu
Chukun Pan [Sun, 19 Nov 2023 15:16:26 +0000 (23:16 +0800)]
kernel: modules: move gpio modules to gpio menu

Since we have the 'GPIO support' menu, it is strange to look up
gpio related modules in 'Other modules' menu. So move these
modules and put them in the gpio menu.

Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
2 months agokernel: modules: gpio.mk: renamed from gpio-cascade.mk
Chukun Pan [Fri, 10 Nov 2023 15:16:21 +0000 (23:16 +0800)]
kernel: modules: gpio.mk: renamed from gpio-cascade.mk

This can be used to place the gpio module, so rename it.

Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
2 months agoucode: add libjson-c/host dependency
Chad Monroe [Tue, 16 Jan 2024 23:44:33 +0000 (15:44 -0800)]
ucode: add libjson-c/host dependency

ensure host libjson-c is built prior to ucode

Signed-off-by: Chad Monroe <chad@monroe.io>
2 months agogeneric: 6.1: backport at803x split patches
Christian Marangi [Thu, 1 Feb 2024 13:13:23 +0000 (14:13 +0100)]
generic: 6.1: backport at803x split patches

Backport at803x split patches merged upstream to tidy things up for the
at803x PHY driver.

New Kernel config are introduced hence any user needs to be updated.

Downstream ipq40xx patch require rework to correctly move them to the
qcom specific PHY directory.

All affected patch automatically refreshed.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2 months agobcm27xx: bcm2712: remove boot-2711 image files
Álvaro Fernández Rojas [Thu, 1 Feb 2024 10:54:22 +0000 (11:54 +0100)]
bcm27xx: bcm2712: remove boot-2711 image files

According to Raspberry Pi documentation, the RPi 5 First Stage Bootloader
loads the linux kernel instead of loading the Second Stage Bootloader
(start.elf):
https://www.raspberrypi.com/documentation/computers/raspberry-pi.html#differences-on-raspberry-pi-5

Fixes: 8b63d9a ("bcm27xx: add new bcm2712 subtarget")
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2 months agobcm27xx: base-files: fix platform_copy_config
Álvaro Fernández Rojas [Wed, 31 Jan 2024 11:36:49 +0000 (12:36 +0100)]
bcm27xx: base-files: fix platform_copy_config

Only bcm2708 and bcm2709 use "kernel.img" file name.
bcm2710 and bcm2711 use "kernel8.img" and bcm2712 uses "kernel_2712.img".

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2 months agobcm27xx: improve image generation script
Álvaro Fernández Rojas [Tue, 30 Jan 2024 19:12:25 +0000 (20:12 +0100)]
bcm27xx: improve image generation script

- Exit immediately on a non-zero status.
- Remove empty lines.
- Remove unused variables.
- Add missing ptgen variables for readability.
- Refactor SYNTAX if block.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2 months agobcm27xx: base-files: properly detect boot partition
Álvaro Fernández Rojas [Tue, 30 Jan 2024 20:41:26 +0000 (21:41 +0100)]
bcm27xx: base-files: properly detect boot partition

Automatically detect boot partition instead of forcing /dev/mmcblk0p1.
This way users can still get /boot mounted when booting from USB.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2 months agobcm27xx: base-files: set_preinit_iface: add RPi 5
Álvaro Fernández Rojas [Thu, 1 Feb 2024 08:42:04 +0000 (09:42 +0100)]
bcm27xx: base-files: set_preinit_iface: add RPi 5

Add missing Rasoberry Pi 5 board_name to set_preinit_iface in order to get
ethernet working on failsafe mode.

Fixes: 8b63d9a ("bcm27xx: add new bcm2712 subtarget")
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2 months agomediatek: fixes for Ethernet on MT7988 SoC
Daniel Golle [Wed, 24 Jan 2024 05:01:43 +0000 (05:01 +0000)]
mediatek: fixes for Ethernet on MT7988 SoC

 * fix switch ports with modes other than 1000M/Full
 * set 32-bit dma_coherent_mask to get PPE to work with 4 GiB of RAM
 * sync driver for built-in 1GE PHY with MediaTek SDK sources

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2 months agobase-files: upgrade: nand.sh: mute umount error
Daniel Golle [Thu, 25 Jan 2024 03:06:45 +0000 (03:06 +0000)]
base-files: upgrade: nand.sh: mute umount error

Send error output of umount to /dev/null to mute error in case
ubiblock device has already been unmounted (which is usually the
case).
Gets rid of bogus error message:
umount: can't unmount /dev/ubiblock0_4: Invalid argument

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2 months agouhttpd: restart when interface to listen becomes available
Daniel Golle [Thu, 2 Nov 2023 15:39:49 +0000 (15:39 +0000)]
uhttpd: restart when interface to listen becomes available

Currently uhttpd won't start with a listening interface configured if
the interface isn't already up at the time uhttpd starts. Make sure we
attempt to start uhttpd when it comes up.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2 months agotools/cmake: update to 3.28.2
Nick Hainke [Tue, 30 Jan 2024 14:27:37 +0000 (15:27 +0100)]
tools/cmake: update to 3.28.2

Release Notes:
https://www.kitware.com/cmake-3-28-2-available-for-download/

Signed-off-by: Nick Hainke <vincent@systemli.org>
2 months agoqualcommax: dts: add reset delay to qca8081 phy
Chukun Pan [Sun, 28 Jan 2024 15:10:36 +0000 (23:10 +0800)]
qualcommax: dts: add reset delay to qca8081 phy

The qca8081 phy needs to set the reset delay time,
otherwise it will not be detected by the mdio bus.

Fixes: 75ad5c2 ("qualcommax: switch to qca8081 upstream PHY driver")
Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
2 months agolibbsd: update to 0.11.8
Nick Hainke [Mon, 29 Jan 2024 19:04:27 +0000 (20:04 +0100)]
libbsd: update to 0.11.8

Changelog:
edddd80 Release libbsd 0.11.8
dd0bdb5 test: Close all descriptors before initializing them for closefrom()
0813f37 build: Check out-of-tree builds in CI
df116b5 Adjust strlcpy() and strlcat() per glibc adoption
ecb44e1 Do not add a pointer to the NULL constant
459b7f7 Do not confuse code analyzers with out-of-bounds array access look alike
a44f885 test: Fix short-lived memory leak
3f5ca0a build: Add a coverage regex to the CI job
9d3e59a man: Use VARIANTS instead of ALTERNATIVES in libbsd(7)
f02562d man: Markup function references with Xr instead of Fn
b7367c9 build: Add missing dash to macro title bar
6777eb6 pwcache: Do not declare uidtb and gidtb when not used
d4e0cdc fgetln: Include <stdio.h> after <sys/*>
f41d6c1 build: Refactor GNU .init_array support check into a new m4 function
30b48ed build: Refactor linker script detection into a new m4 function
d0d8d01 build: Do not provide prototypes for arc4random() on Solaris
cf61ebb build: Do not build the progname module if it is not needed
73b25a8 build: Sort entries alphabetically
5434ba1 build: Conditionalize wcslcpy() and wcslcat() functions on macOS
dc1bd1a build: Conditionalize only id-from-name functions not the entire pwcache
edc746e build: Conditionalize getprogname()/setprogname on macOS
8f998d1 progname: Include <procinfo.h> if available
d08163b build: Check whether we need libperfstat on AIX
1186cf8 build: Annotate droppable functions for musl on next SOVERSION bump
6385ccc build: Conditionalize bsd_getopt() on macOS
c120681 Move the version script comments before the symbols
9fa0676 Port getprogname() to AIX
92337b1 Make getprogname() porting mandatory
90b7f3a test: Do not use /dev/null as compiler output file
426bf45 build: Add generated *.sym files to .gitignore
21d12b0 build: On macOS do not build functions provided by the system
bc65806 build: Select whether to include funopen() in the build system
8b7a4d9 build: Move Windows OS detection to the OS features section
ccbfd1c build: Remove __MUSL__ definition from configure
e0976d7 build: Add a new libbsd_strong_alias() macro and switch users to it
49c7dd1 build: Only emit link warnings for ELF objects
8622767 build: Use an export symbols file if there is no version script support
8f61036 build: Add -no-undefined libtool flag
ae7942b build: Do not override the default DEPENDENCIES for libbsd
a5faf17 Only use <stdio_ext.h> if present
06e8a1b Define _NSIG if it is not defined by the system
44824ac Declare environ if the system does not do so
1fb6c3f Use lockf() when flock() is not available
fe16f38 test: Use open_memstream() only if available
7c652a9 test: Do not hardcode root:root user and group names
ed2eb31 test: Fix closefrom() test on macOS
0f8bcdf test: Fix closefrom() test to handle open file descriptor limits
07192b3 test: Disable blank_stack_side_effects() on non-Hurd systems
ca3db5e build: Do not enable ASAN for musl CI pipelines
ff46386 man: Add HISTORY section to arc4random(3bsd)
4c6da57 man: Switch arc4random(3bsd) man page from OpenBSD to NetBSD
830dd88 doc: Remove written-by attribution
257800a build: Add support for sanitizer compiler flags
536a7d4 test: Exempt blank_stack_side_effects() from sanitizer checks
7ed5de0 test: Import explicit_bzero() sanitizer support changes from OpenBSD
05a802a test: Fix memory leaks in fpurge test
5962e03 man: Fix BSD and glibc versions
59a21c7 man: Update STANDARDS and HISTORY sections
7b4ebd6 include: Adjust closefrom() per glibc adoption
0dfbe76 build: Switch to debian:latest Docker image
dec783d build: Fix version script linker support detection
fe21244 include: Use __has_builtin to detect __builtin_offsetof support
ec88b7b funopen: Replace off64_t with off_t in funopen_seek()
2337719 man: Prune unneeded <sys/types.h> include in setproctitle(3)
5dea9da build: Improve C99 compatibility of __progname configure check
b9bf42d build: Enable -Wall for automake
e57c078 build: Add missing AM_PROG_AR macro call to configure.ac
80f1927 build: Fix configure.ac indentation
b7a8bc2 build: Require automake 1.11
e508962 build: Do not require funopen() to be ported
00b538f build: Terminate lists in variables with «# EOL»
5cfa39e build: Use «yes» instead of «true» for AC_CHECK_FUNCS cache value

Signed-off-by: Nick Hainke <vincent@systemli.org>
2 months agotools/xz: update to 5.4.6
Nick Hainke [Mon, 29 Jan 2024 18:15:28 +0000 (19:15 +0100)]
tools/xz: update to 5.4.6

Changelog:
https://git.tukaani.org/?p=xz.git;a=blob;f=NEWS;h=d271dad2d3f1ec54e56ef8fa60275a88697a24aa;hb=0ef8192e8d5af4e6200d5d4aee22d1f177f7a2df

Signed-off-by: Nick Hainke <vincent@systemli.org>
2 months agotools/zlib: update to 1.3.1
Nick Hainke [Mon, 29 Jan 2024 18:09:56 +0000 (19:09 +0100)]
tools/zlib: update to 1.3.1

Release Notes:
https://github.com/madler/zlib/releases/tag/v1.3.1

Signed-off-by: Nick Hainke <vincent@systemli.org>
2 months agobcm27xx: bcm2712: enable USB symbols and drop packages
Álvaro Fernández Rojas [Mon, 29 Jan 2024 09:11:40 +0000 (10:11 +0100)]
bcm27xx: bcm2712: enable USB symbols and drop packages

This allows booting from USB.

Fixes: 8b63d9ac4ae9 ("bcm27xx: add new bcm2712 subtarget")
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2 months agolantiq: replace patch with upstream version
Aleksander Jan Bajkowski [Sun, 28 Jan 2024 19:41:31 +0000 (20:41 +0100)]
lantiq: replace patch with upstream version

Replace recently added patch with version accepted upstream.

Signed-off-by: Aleksander Jan Bajkowski <olek2@wp.pl>
2 months agombedtls: security bump to version 2.28.7
orangepizza [Mon, 29 Jan 2024 02:37:43 +0000 (11:37 +0900)]
mbedtls: security bump to version 2.28.7

This release of Mbed TLS provides bug fixes and minor enhancements. This
release includes fixes for following security issues:

* Timing side channel in private key RSA operations (CVE-2024-23170)

  Mbed TLS is vulnerable to a timing side channel in private key RSA
  operations. This side channel could be sufficient for an attacker to
  recover the plaintext. A local attacker or a remote attacker who is
  close to the victim on the network might have precise enough timing
  measurements to exploit this. It requires the attacker to send a large
  number of messages for decryption.

* Buffer overflow in mbedtls_x509_set_extension() (CVE-2024-23775)

  When writing x509 extensions we failed to validate inputs passed in to
  mbedtls_x509_set_extension(), which could result in an integer overflow,
  causing a zero-length buffer to be allocated to hold the extension. The
  extension would then be copied into the buffer, causing a heap buffer
  overflow.

Fixes: CVE-2024-23170, CVE-2024-23775
References: https://mbed-tls.readthedocs.io/en/latest/security-advisories/mbedtls-security-advisory-2024-01-1/
References: https://mbed-tls.readthedocs.io/en/latest/security-advisories/mbedtls-security-advisory-2024-01-2/
Signed-off-by: orangepizza <tjtncks@gmail.com>
Signed-off-by: Petr Štetiar <ynezz@true.cz> [formal fixes]
2 months agopackages: drop bcm27xx-userland
Álvaro Fernández Rojas [Sun, 28 Jan 2024 09:07:55 +0000 (10:07 +0100)]
packages: drop bcm27xx-userland

bcm27xx-userland is deprecated and bcm27xx-utils should be used instead.
https://github.com/raspberrypi/userland/commit/96a7334ae9d5fc9db7ac92e59852377df63f1848

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2 months agobcm27xx: refresh bcm2711 kernel config
Álvaro Fernández Rojas [Sun, 28 Jan 2024 00:08:56 +0000 (01:08 +0100)]
bcm27xx: refresh bcm2711 kernel config

Refresh outdated bcm2711 (RPi 4B) kernel config.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2 months agoqualcommax: switch to qca8081 upstream PHY driver
Christian Marangi [Sat, 9 Dec 2023 13:31:02 +0000 (14:31 +0100)]
qualcommax: switch to qca8081 upstream PHY driver

Switch to qca8081 upstream PHY. Update every device that have LEDs
attached to the qca8081 PHY to follow new way of defining the LEDs and
add original OEM configuration.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2 months agoqca-ssdk: disable compiling qca8081 PHY driver in favor of upstream
Christian Marangi [Sat, 9 Dec 2023 13:28:15 +0000 (14:28 +0100)]
qca-ssdk: disable compiling qca8081 PHY driver in favor of upstream

Disable compiling qca8081 PHY driver in favor of upstream to better
support it and add better control of attached LEDs.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2 months agogeneric: 6.1: backport patch adding more speed modes to LED netdev trigger
Christian Marangi [Sat, 27 Jan 2024 16:52:11 +0000 (17:52 +0100)]
generic: 6.1: backport patch adding more speed modes to LED netdev trigger

Backport upstream patch adding more speed modes to LED netdev trigger.

Fixes: 2c39269b6e00 ("generic: 6.1: backport qca808x LED support patch")
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2 months agogeneric: 6.1: backport qca808x LED support patch
Christian Marangi [Sat, 27 Jan 2024 15:31:18 +0000 (16:31 +0100)]
generic: 6.1: backport qca808x LED support patch

Backport qca808x LED support patch merged upstream needed to drop
handling of it from the SSDK for ipq807x target.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2 months agomac80211: brcm: fix warning on ARCH_BCM2835
Álvaro Fernández Rojas [Sat, 27 Jan 2024 09:25:08 +0000 (10:25 +0100)]
mac80211: brcm: fix warning on ARCH_BCM2835

Completely disable dump_survey code on ARCH_BCM2835 to fix defined but not
used warning.
https://github.com/openwrt/openwrt/commit/512b762ddbb602b744f0e7a443cf4ac7422155c1?w=1#commitcomment-137899352

Fixes: 512b762ddbb6 ("mac80211: brcm: disable dump_survey on Raspberry Pi")
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
3 months agolibubox: update to Git HEAD (2024-01-26)
Felix Fietkau [Fri, 26 Jan 2024 20:02:21 +0000 (21:02 +0100)]
libubox: update to Git HEAD (2024-01-26)

6339204c212b CMakeLists.txt: bump minimum cmake version
c1be505732e6 udebug: fix crash in udebug_entry_vprintf with longer strings

Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 months agoiwinfo: update to latest git HEAD
Álvaro Fernández Rojas [Fri, 26 Jan 2024 16:28:19 +0000 (17:28 +0100)]
iwinfo: update to latest git HEAD

Adds MediaTek MT7916AN and Cypress CYW43455 (Raspberry Pi 5) devices.

a34977c devices: add device id for Cypress CYW43455
3eb34df devices: add device id for MediaTek MT7916AN

There are no ABI changes.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
3 months agomac80211: brcm: disable dump_survey on Raspberry Pi
Álvaro Fernández Rojas [Fri, 26 Jan 2024 16:16:29 +0000 (17:16 +0100)]
mac80211: brcm: disable dump_survey on Raspberry Pi

Enabling this causes slow iwinfo calls on Raspberry Pi and LuCI slows down
when wireless is enabled.
Fixes: https://github.com/openwrt/openwrt/issues/14013
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
3 months agomac80211: brcm: remove alternative DT firmware names patch
Álvaro Fernández Rojas [Fri, 26 Jan 2024 16:10:31 +0000 (17:10 +0100)]
mac80211: brcm: remove alternative DT firmware names patch

This patch has been reverted in the Raspberry Pi linux repository.
Also refresh the rest of the patches.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
3 months agogeneric: 5.15: backport upstream Aquantia PHY firmware loader patches
Christian Marangi [Sun, 19 Nov 2023 11:52:55 +0000 (12:52 +0100)]
generic: 5.15: backport upstream Aquantia PHY firmware loader patches

Backport merged upstream patch that adds support for firmware loader
from NVMEM or attached filesystem for Aquantia PHYs.

Refresh all kernel patches affected by this change.

Also update the path for aquantia .ko that got moved to dedicated
directory upstream.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
[rmilecki: port to 5.15]
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
3 months agoCI: formal: use shared workflow in actions-shared-workflows
Christian Marangi [Fri, 26 Jan 2024 15:14:20 +0000 (16:14 +0100)]
CI: formal: use shared workflow in actions-shared-workflows

Use shared workflow in actions-shared-workflows instead of keeping the
workflow in openwrt main branch to make it easier to maintain and update
without bloating the main repository commit history.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
3 months agoipq806x: drop swconfig leftovers
Aleksander Jan Bajkowski [Sat, 25 Nov 2023 22:47:08 +0000 (23:47 +0100)]
ipq806x: drop swconfig leftovers

They are unnecessary since ipq806x switched to DSA in
the commit 337e36e0ef988d850105cfa5f7588e36d90aef2b.

Signed-off-by: Aleksander Jan Bajkowski <olek2@wp.pl>
Reviewed-by: Robert Marko <robimarko@gmail.com>
3 months agorealtek: 5.15: refresh HSGMII patch due to recent PHY backport
Christian Marangi [Fri, 26 Jan 2024 14:50:43 +0000 (15:50 +0100)]
realtek: 5.15: refresh HSGMII patch due to recent PHY backport

Refresh HSGMII patch due to recent PHY backport that cause
compilation warning for case not handled in phy_interface_num_ports.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
3 months agolayerscape: 5.15: refresh 2.5G-SGMII patch due to recent PHY backport
Christian Marangi [Fri, 26 Jan 2024 14:49:12 +0000 (15:49 +0100)]
layerscape: 5.15: refresh 2.5G-SGMII patch due to recent PHY backport

Refresh 2.5G-SGMII patch due to recent PHY backport that cause
compilation warning for case not handled in phy_interface_num_ports.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
3 months agoqualcommax: 301w: provide AQR FW via NVMEM cells
Robert Marko [Thu, 25 Jan 2024 21:19:58 +0000 (22:19 +0100)]
qualcommax: 301w: provide AQR FW via NVMEM cells

In order to get rid of having to modify U-boot bootcmd and having U-boot
load the Aquantia PHY-s firmware lets use some of the free space on SPI-NOR
to add a second ethphyfw partition and be able to load AQR FW via NVMEM
cells.

Signed-off-by: Robert Marko <robimarko@gmail.com>
3 months agoqualcommax: 301w: correct AQR reset GPIO-s
Robert Marko [Wed, 29 Nov 2023 18:24:18 +0000 (19:24 +0100)]
qualcommax: 301w: correct AQR reset GPIO-s

It seems that the reset GPIO-s defined for the two AQR PHY-s are actually
reversed.

Manually testing confirmed that GPIO44 is actually reset GPIO of AQR at 0,
while GPIO59 is reset of AQR at 8:
root@OpenWrt:~# mdio 9*
 DEV      PHY-ID  LINK
0x00  0x00000000  down
0x08  0x00000000  down
0x10  0x004dd0b1  down
0x11  0x004dd0b1  down
0x12  0x004dd0b1  down
0x13  0x004dd0b1  up
0x14  0x004dd0b1  down
0x15  0x04820a05  down
root@OpenWrt:~# gpioset gpiochip0 44=0
root@OpenWrt:~# mdio 9*
 DEV      PHY-ID  LINK
0x08  0x00000000  down
0x10  0x004dd0b1  down
0x11  0x004dd0b1  down
0x12  0x004dd0b1  down
0x13  0x004dd0b1  up
0x14  0x004dd0b1  down
0x15  0x04820a05  down
root@OpenWrt:~# gpioset gpiochip0 44=1
root@OpenWrt:~# mdio 9*
 DEV      PHY-ID  LINK
0x00  0x00000000  down
0x08  0x00000000  down
0x10  0x004dd0b1  down
0x11  0x004dd0b1  down
0x12  0x004dd0b1  down
0x13  0x004dd0b1  up
0x14  0x004dd0b1  down
0x15  0x04820a05  down
root@OpenWrt:~# gpioset gpiochip0 59=0
root@OpenWrt:~# mdio 9*
 DEV      PHY-ID  LINK
0x00  0x00000000  down
0x10  0x004dd0b1  down
0x11  0x004dd0b1  down
0x12  0x004dd0b1  down
0x13  0x004dd0b1  up
0x14  0x004dd0b1  down
0x15  0x04820a05  down
root@OpenWrt:~# gpioset gpiochip0 59=1
root@OpenWrt:~# mdio 9*
 DEV      PHY-ID  LINK
0x00  0x00000000  down
0x08  0x00000000  down
0x10  0x004dd0b1  down
0x11  0x004dd0b1  down
0x12  0x004dd0b1  down
0x13  0x004dd0b1  up
0x14  0x004dd0b1  down
0x15  0x04820a05  down

Signed-off-by: Robert Marko <robimarko@gmail.com>
3 months agoqualcommax: 301w: populate AQR firmware name
Robert Marko [Sun, 19 Nov 2023 15:37:07 +0000 (16:37 +0100)]
qualcommax: 301w: populate AQR firmware name

Now that we have support for firmware loading via the kernel driver, it
makes sense to populate the firmware name as well, so if its present the
driver can load it.

In later patches, loading the FW via NVMEM will be added as well.

Signed-off-by: Robert Marko <robimarko@gmail.com>
3 months agomac80211: fix typo in getting path from board.json
Felix Fietkau [Fri, 26 Jan 2024 12:13:56 +0000 (13:13 +0100)]
mac80211: fix typo in getting path from board.json

Use json_get_vars in order to avoid getting bogus values when extra properties
are present

Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 months agobcm27xx: switch to bcm27xx-utils
Álvaro Fernández Rojas [Fri, 26 Jan 2024 08:52:35 +0000 (09:52 +0100)]
bcm27xx: switch to bcm27xx-utils

bcm27xx-userland is now deprecated and utils should be used instead.
https://github.com/raspberrypi/userland/commit/96a7334ae9d5fc9db7ac92e59852377df63f1848

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
3 months agokernel: 5.15: update Aquantia PHY driver to v6.1 code
Rafał Miłecki [Fri, 26 Jan 2024 05:19:42 +0000 (06:19 +0100)]
kernel: 5.15: update Aquantia PHY driver to v6.1 code

Backport few upstream changes included between v5.15 and v6.1.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
3 months agokernel: 5.15: backport v6.1 PHY changes required for Aquantia
Rafał Miłecki [Fri, 26 Jan 2024 05:35:27 +0000 (06:35 +0100)]
kernel: 5.15: backport v6.1 PHY changes required for Aquantia

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
3 months agoqualcommax: refresh 6.1 patches
Álvaro Fernández Rojas [Fri, 26 Jan 2024 09:19:40 +0000 (10:19 +0100)]
qualcommax: refresh 6.1 patches

Refresh patches for Linux 6.1 which no longer apply cleanly after
adding ipq4019 MDIO MDC rate fix pending patches.

Fixes: 53f338be43e0 ("generic: 6.1: add pending patch for ipq4019 MDIO MDC rate fix")
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
3 months agobcm27xx: add new bcm2712 subtarget
Marty Jones [Thu, 18 Jan 2024 14:52:22 +0000 (09:52 -0500)]
bcm27xx: add new bcm2712 subtarget

This patch adds support for Raspberry Pi 5.

Instead of using 16K pages like Raspberry Pi OS, OpenWrt uses 4K pages due to
incompatibilities with F2FS and other applications.
There are multiple RPi forum posts with different cases and users are forcing
kernel8.img to workaround them, which is the 64 bit kernel of the RPi 4.
However, this isn't possible in OpenWrt because we only ship one kernel and we
would have to add RPi 5 support to bcm2711 subtarget (RPi 4) for that
workaround to work in OpenWrt.

Specification:
- Processor Broadcom BCM2712 2.4GHz quad-core 64-bit Arm Cortex-A76 CPU,
  with cryptographic extension, 512KB L2 caches per core, 2048KB L3 cache
Features:
- VideoCore VII GPU, supports OpenGL ES 3.1, Vulkan 1.2
- Dual 4Kp60 HDMI display output with HDR support 4Kp60 HEVC decoder
- LPDDR4X-4267 SDRAM 4GB and 8GB
- Dual-band 802.11ac Wi-Fi
- Bluetooth 5.0 / Bluetooth Low Energy
- microSD card slot, with support for SDR104 high-speed mode
- 2 x USB 3.0 ports
- 2 x USB 2.0 ports
- Gigabit Ethernet
- 2 x 4 lane MIPI camera/display
- PCIe 2.0 x1
- 5V/5A power via USB-C
- Raspberry Pi standard 40-pin header
- Real-time clock RTC
- Power button

Build system: x86_64
Build-tested: bcm2712
Run-tested: bcm2712/RPi5

Signed-off-by: Marty Jones <mj8263788@gmail.com>
[Remove device variant, improve description]
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
3 months agolinux-firmware: add Raspberry Pi 5 NVRAM
Marty Jones [Tue, 7 Nov 2023 03:21:44 +0000 (22:21 -0500)]
linux-firmware: add Raspberry Pi 5 NVRAM

The RPi 5 expects the same NVRAM as the one from RPi 4 on a different file.

Signed-off-by: Marty Jones <mj8263788@gmail.com>
[Reword commit description, add missing PKG_RELEASE bump]
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
3 months agobcm27xx: update 6.1 patches to latest version
Marty Jones [Thu, 18 Jan 2024 21:23:52 +0000 (16:23 -0500)]
bcm27xx: update 6.1 patches to latest version

Add support for BCM2712 (Raspberry Pi 5).
https://github.com/raspberrypi/linux/commit/3bb5880ab3dd31f75c07c3c33bf29c5d469b28f3
Patches were generated from the diff between linux kernel branch linux-6.1.y
and rpi-6.1.y from raspberry pi kernel source:
- git format-patch linux-6.1.y...rpi-6.1.y

Build system: x86_64
Build-tested: bcm2708, bcm2709, bcm2710, bcm2711
Run-tested: bcm2710/RPi3B, bcm2711/RPi4B

Signed-off-by: Marty Jones <mj8263788@gmail.com>
[Remove applied and reverted patches, squash patches and config commits]
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
3 months agoath79: add Ubiquiti Rocket M XW as alternate name to Bullet M XW
Lech Perczak [Sun, 21 Jan 2024 23:34:34 +0000 (00:34 +0100)]
ath79: add Ubiquiti Rocket M XW as alternate name to Bullet M XW

Ubiquiti Rocket M XW is a single-band, 2x2:2 external Wi-Fi AP, with optional
GPS receiver, with two external RP-SMA antenna connections, based on
AR9342 SoC. Two band variants exists, for 2.4GHz and 5GHz band, usable
with the same image.

Specs:
- CPU: Atheros AR9342 MIPS SoC at 535MHz
- RAM: 64MB DDR400
- ROM: 8MB SPI-NOR in SO16W package, MX25L6408E
- Wi-Fi Atheros AR9342 built-in 2x2:2 radio
- Ethernet: Atheros AR8035 PHY, limited to 100Mbps speeds due to
  magnetics
- Power: 24V passive PoE input.

Installation: please refer to Ubiquiti Bullet M2HP for documentation.

The device runs with exactly same image as the Bullet, and after fixes
in preceding commit, is fully functional again. Add the alternative name
to the build system.

Signed-off-by: Lech Perczak <lech.perczak@gmail.com>
3 months agoath79: ubnt-bullet-m-xw: fix Ethernet PHY traffic
Lech Perczak [Sun, 21 Jan 2024 23:14:16 +0000 (00:14 +0100)]
ath79: ubnt-bullet-m-xw: fix Ethernet PHY traffic

Since commit 6f2e1b7485f0 ("ath79: disable delays on AT803X config init")
Ubiquiti XW boards equipped with AR8035 PHY suffered from lack of
outbound traffic on the Ethernet port. This was caused by the fact, the
U-boot has set this during boot and it wasn't reset by the PHY driver,
and the corresponding setting in device tree was wrong.

Set the 'phy-mode = "rgmii-txid"' at the &eth0, and drop this property
from PHY node, as it is not parsed there. This causes the device to
connect using Ethernet once again.

Fixes: db4b6535f837 ("ath79: Add support for Ubiquity Bullet M (XW)")
Fixes: 6f2e1b7485f0 ("ath79: disable delays on AT803X config init")
Signed-off-by: Lech Perczak <lech.perczak@gmail.com>