69423 Commits

Author SHA1 Message Date
Markus Stockhausen d6f5c2685f realtek: rt-loader increase gcc optimization level
Switch from -O2 to -O3. This increases the loader code size by
5KB and brings down the decompression time on RTL838x from
~6.5 seconds to ~3.5 seconds.

Link: https://github.com/openwrt/openwrt/pull/23811
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
2026-06-16 20:36:39 +02:00
Zoltan HERPAI 3aeaeb563f zynq: enable NAND support
Enable NAND support.

Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu>
2026-06-16 20:19:24 +02:00
Zoltan HERPAI e050bb7946 zynq: add Bitmain Antminer S9 control board support
This board is the control board for the Antminer S9 miners.

SoC:     Xilinx XC7Z010 - dual-core Cortex-A9 with FPGA stack
Memory:  512Mb DDR3
NIC:     1Gbit ethernet (BCM B50612E PHY)
Flash:   256Mb NAND (Micron MT29F2G08ABAEAWP)
Storage: SD-card slot
Other:   control pins available via FPGA stack

Admittedly, there is a limited number of use cases available
for these boards outside of the miners and the lack of FPGA
tooling in OpenWrt. However, for one, they are easily and cheaply
available, for two, the reason for adding this is to provide an
easy addition to the boardfarm for continuous testing of this target.

Notes: For u-boot, an additional patch is required to support
  booting from SD-cards. This is because EXTRA_ENV_SETTINGS is
  already defined in the board's u-boot config, which is the same
  place where the zynq-common.dtsi defines the required envvars.

Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu>
2026-06-16 20:19:24 +02:00
Zoltan HERPAI fa55634872 uboot-zynq: fix boot process on MMC
A regression was introduced when upgrading to 2019.07, whereas
the bootloader did not proceed to load the FIT image. A fix
was reported but not upstreamed here [1]. Patch the uEnv file
to bring back these boards to an operational state.

[1] https://forum.openwrt.org/t/bugreport-regression-in-zynq-cpu-platform-not-bootiing-any-more-zedboard-zybo/182609/7

Fixes: https://git.openwrt.org/?p=openwrt/openwrt.git;a=commit;h=5ca243153b110ceddffecb70ba8a8cd0e33c8f0b
Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu>
2026-06-16 20:19:24 +02:00
Jonas Jelonek 4a0e6aa95c generic: mips: replace pending patch with backport
The pending patch fixing reboot behavior on Realtek MIPS (and possibly
other MIPS targets) has been accepted upstream. Replace with a proper
backport.

Link: https://github.com/openwrt/openwrt/pull/23831
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-06-16 18:31:42 +02:00
Jonas Jelonek 24ec5ff687 realtek: replace pending SFP patches with backport
The SFP SMBus patches to access SFP modules with more than just byte
access have finally been accepted upstream. Replace them with the
upstreamed version, reorder them before our still downstream SMBus MDIO
patches and refresh all.

Link: https://github.com/openwrt/openwrt/pull/23825
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-06-16 18:30:58 +02:00
Lukas Stockner 68ef94cb25 ipq806x: add apboot package for AP-32x
This is unfortunately needed to disable the signature verification
in the stock bootloader.

Co-authored-by: Paul Spooren <mail@aparcar.org>
Signed-off-by: Lukas Stockner <lukas@lukasstockner.de>
Link: https://github.com/openwrt/openwrt/pull/20738
Signed-off-by: Paul Spooren <mail@aparcar.org>
2026-06-16 16:08:11 +02:00
Lukas Stockner d2a75029a5 ipq806x: add support for Aruba AP-32x
This is a dual-radio 802.11a/b/g/n/ac access point with
dual Gigabit Ethernet.

There are two closely related models: The AP-324, which has external
antenna connectors, and the AP-325, which has internal antennas.
The board appears to be identical, and the same image works on both.
Additionally, the Siemens Scalance W1750D is an OEM variant using
the same board, so the image also works on that.

Unfortunately the factory APBoot bootloader enforces cryptographic
signatures on the firmware before booting, so a modified version
must be flashed via the serial port. See [^1] for details.

Specifications
==============
* Device:       Aruba AP-325 / AP-324
* SoC:          Qualcomm IPQ8068 2x1.4GHz ARMv7-A
* RAM:          512MiB (2x Winbond W632GU6MB-12)
* SPI flash:    4MiB Macronix MX25U3235F
* NAND flash:   128MiB Winbond W29N01HZBINF
* WiFi:         2x Qualcomm QCA9990 (one 2.4G, one 5G)
* Ethernet:     2x 1000BASE-T (Marvell 88E1514 PHY), both PoE-capable
* Power:        PoE 802.3at or 12V DC jack
* LEDs:         Red/Amber/Green status LED, Amber/Green WiFi LED
* Buttons:      1x, behind hole next to DC jack
* Console:      RJ45 connector, Cisco pinout
* USB:          1x USB 2.0 Type A, 1x internal to BLE, SoC has USB 3.0
                host but board is only wired for 2.0
* BLE:          TI CC2540 SoC, connected to USB and UART, unpopulated
                debug header on PCB
* TPM:          Atmel AT97SC3205T

How to install
==============
The stock bootloader APBoot appears to be vendor fork of U-Boot, which
disables much of the usual functionality and comes with its own booting
and firmware upgrade logic.

Unfortunately, this logic enforces RSA signatures on images,
even for the default boot from NAND.

Therefore, a patched bootloader is needed, which is built as a package.
In addition to the signature check removal, this also changes
the serial baudrate to 115200.

Luckily, the stock firmware does not disable the `sf` command
(it just hides it until you run `diag`), so the patched bootloader
can be fetched via TFTP and then flashed via console.

Flashing patched APBoot
-----------------------
* Build OpenWrt, or download `openwrt-ipq806x-generic-aruba_ap-32x-apboot.mbn`
* Connect serial cable and wired ethernet
* Access stock APBoot console at Baud 9600
* Flash patched bootloader:
```
setenv serverip <your TFTP server IP>
setenv autostart n
netget 44000000 openwrt-ipq806x-generic-aruba_ap-32x-apboot.mbn
sf probe 0
sf erase 220000 100000
sf write 44000000 220000 100000
reset
```

Booting OpenWrt
---------------
* Connect serial cable and wired ethernet
* Access patched APBoot console at Baud 115200
* Run `setenv serverip <your TFTP server IP>`
* Run `tftpboot openwrt-ipq806x-generic-aruba_ap-32x-initramfs.ari`

Installing OpenWrt
------------------
* Connect serial cable and wired ethernet
* Access patched APBoot console at Baud 115200
* Consider backing up stock firmware(s) (UBI volumes `aos0` and/or `aos1`)
  by booting into OpenWrt via initramfs (see above) and dumping them
* Wipe and repartition NAND flash (see below for explanation):
```
nand device 0
nand erase.chip
reset
ubi part ubifs
ubi remove ubifs
ubi create ubifs 1
ubi create rootfs_data
```
* Follow steps above to boot OpenWrt via initramfs
* From OpenWrt, persist installation via sysupgrade

Reverting to stock FW
---------------------

The patched bootloader remains compatible with the original firmware,
so you can just wipe the NAND, let APBoot recreate the partitions,
and flash back the `aos0`/`aos1` backup from above.

Current status
==============

Tested and working
------------------

* Console
* Wired GbE (both ports)
* WiFi (both 2.4G and 5G)
* LEDs
* Restart Button
* USB port
* External watchdog
* TPM
* BLE SoC

Future work
-----------

* GPIOs for:
  * power source (8 indicates DC jack, 59 indicates 802.3at)
  * reset source (64 for warm reset, 65 for watchdog)
  * USB overcurrent (63)
* BLE SoC reflashing
  * CC2540 comes with Aruba-specific FW out of the box
  * Debug header is exposed on PCB (pinout GND-VCC-Clock-Data-Reset),
    but that requires disassembly
  * Stock BLE FW appears to support reflashing via UART, but protocol
    would need to be reverse-engineered
* ramoops/pstore
  * It appears that APBoot clears the RAM on boot, might be something
    we can patch out as well
* Porting a modern U-Boot

Flash layout
============

SPI flash
---------

```
0x000000-0x020000 sbl1
0x020000-0x040000 mibib
0x040000-0x080000 sbl2
0x080000-0x100000 sbl3
0x100000-0x110000 ddrconfig
0x110000-0x120000 ssd
0x120000-0x1a0000 tz
0x1a0000-0x220000 rpm
0x220000-0x320000 appsbl
0x320000-0x330000 appsblenv
0x330000-0x370000 art
0x370000-0x380000 panicdump
0x380000-0x390000 certificate
0x390000-0x3a0000 mfginfo
0x3a0000-0x3b0000 flashcache
0x3b0000-0x400000 aosspare
```

Factory NAND flash
------------------
* 32MiB MTD partition `aos0`, formatted as UBI
  * 32MiB UBI volume `aos0`
    * contains kernel+initrd of the primary firmware,
      initrd contains the entire root FS
* 32MiB MTD partition `aos1`, formatted as UBI
  * 32MiB UBI volume `aos1`
    * contains kernel+initrd of the secondary firmware,
      initrd contains the entire root FS
* 64MiB MTD partition `ubifs`, formatted as UBI
  * 64MiB UBI volume `ubifs`
    * Contains UBIFS, overlay-mounted on top of the initrd,
      shared between firmware slots

APBoot understands UBI, and will read the kernel from the
`aos0` or `aos1` volume (depending on `os_partition`)
with fallback to the other one in case a check fails.

Kernels are expected to have a vendor-specific header, the included
script will add that header with the correct checksum but no signature.

OpenWrt NAND flash
------------------

OpenWrt assumes separate UBI volumes for kernel and rootfs,
as well as a volume that must be named `rootfs_data` for the UBIFS.

Unfortunately, APBoot actively checks the UBI volumes at boot, and will
repartition if it doesn't find the volumes that it expects (listed above).

Luckily, it doesn't check their size, only their existence. Therefore,
we can use the following layout:

* 32MiB MTD partition `aos0`, formatted as UBI
  * 32MiB UBI volume `aos0`
    * contains OpenWrt kernel+initrd
* 32MiB MTD partition `aos1`, formatted as UBI
  * 32MiB UBI volume `aos1`
    * contains OpenWrt root squashfs
* 64MiB MTD partition `ubifs`, formatted as UBI
  * small (single-LEB) UBI volume `ubifs`
    * Dummy volume, only there to satisfy APBoot
  * almost 64MiB UBI volume `rootfs_data`
    * contains UBIFS, overlay-mounted on top of the rootfs

[^1]: https://github.com/lukasstockner/ap325-apboot-openwrt

Signed-off-by: Lukas Stockner <lukas@lukasstockner.de>
Link: https://github.com/openwrt/openwrt/pull/20738
Signed-off-by: Paul Spooren <mail@aparcar.org>
2026-06-16 16:08:08 +02:00
Lukas Stockner 58015a1c2a ipq806x: add CONFIG_GPIO_WATCHDOG
The AP-325 (and variants) has an external watchdog, so this is needed to
regularly toggle the GPIO and keep the watchdog happy.

Signed-off-by: Lukas Stockner <lukas@lukasstockner.de>
Link: https://github.com/openwrt/openwrt/pull/20738
Signed-off-by: Paul Spooren <mail@aparcar.org>
2026-06-16 16:08:03 +02:00
Lukas Stockner 5497d5ba23 base-files: handle name collision between kernel UBI volume and MTD partition
On the AP-325 (and variants), the bootloader enforces a particular UBI volume
layout and naming, so unfortunately the kernel's UBI volume and MTD partition
end up with the name, which confuses the current logic.

Therefore, add an option to ignore the MTD partition.

Signed-off-by: Lukas Stockner <lukas@lukasstockner.de>
Link: https://github.com/openwrt/openwrt/pull/20738
Signed-off-by: Paul Spooren <mail@aparcar.org>
2026-06-16 16:07:58 +02:00
Lukas Stockner bf770bc4e3 base-files: support rootfs_data on its own partition
The current code assumes that the rootfs_data UBI volume is on the same MTD
partition as the rootfs.
Unfortunately, this does not work on the Aruba AP-325 (and variants), since
the bootloader enforces a particular UBI volume layout.

Therefore, this adds a separate variable to set the rootfs_data partition,
and updates all existing devices with a non-default rootfs partition to also
specify the new variable.

Signed-off-by: Lukas Stockner <lukas@lukasstockner.de>
Link: https://github.com/openwrt/openwrt/pull/20738
Signed-off-by: Paul Spooren <mail@aparcar.org>
2026-06-16 16:07:48 +02:00
Paul Spooren 3ee64a736c Revert "base-files: support rootfs_data on its own partition"
This reverts commit 13fc688f03.
Wrong Signed-off-by line was used, reverting and re-applying.

Signed-off-by: Paul Spooren <mail@aparcar.org>
2026-06-16 16:05:25 +02:00
Paul Spooren 7ef7a3581a Revert "base-files: handle name collision between kernel UBI volume and MTD partition"
This reverts commit eef8c718b4.
Wrong Signed-off-by line was used, reverting and re-applying.

Signed-off-by: Paul Spooren <mail@aparcar.org>
2026-06-16 16:05:23 +02:00
Paul Spooren 6c8aeb9bb7 Revert "ipq806x: add CONFIG_GPIO_WATCHDOG"
This reverts commit 69a2b3b318.
Wrong Signed-off-by line was used, reverting and re-applying.

Signed-off-by: Paul Spooren <mail@aparcar.org>
2026-06-16 16:05:18 +02:00
Paul Spooren b85b7fd14c Revert "ipq806x: add support for Aruba AP-32x"
This reverts commit e912d6aeb4.
Wrong Signed-off-by line was used, reverting and re-applying.

Signed-off-by: Paul Spooren <mail@aparcar.org>
2026-06-16 16:05:13 +02:00
Paul Spooren eccf49c9f8 Revert "ipq806x: add apboot package for AP-32x"
This reverts commit 0823ad47ff.
Wrong Signed-off-by line was used, reverting and re-applying.

Signed-off-by: Paul Spooren <mail@aparcar.org>
2026-06-16 16:05:08 +02:00
Lukas Stockner 0823ad47ff ipq806x: add apboot package for AP-32x
This is unfortunately needed to disable the signature verification
in the stock bootloader.

Co-authored-by: Paul Spooren <mail@aparcar.org>
Signed-off-by: Lukas Stockner <lukas@lukasstockner.de>
Link: https://github.com/openwrt/openwrt/pull/20738
Signed-off-by: Test Dev <dev@example.org>
2026-06-16 13:45:45 +02:00
Lukas Stockner e912d6aeb4 ipq806x: add support for Aruba AP-32x
This is a dual-radio 802.11a/b/g/n/ac access point with
dual Gigabit Ethernet.

There are two closely related models: The AP-324, which has external
antenna connectors, and the AP-325, which has internal antennas.
The board appears to be identical, and the same image works on both.
Additionally, the Siemens Scalance W1750D is an OEM variant using
the same board, so the image also works on that.

Unfortunately the factory APBoot bootloader enforces cryptographic
signatures on the firmware before booting, so a modified version
must be flashed via the serial port. See [^1] for details.

Specifications
==============
* Device:       Aruba AP-325 / AP-324
* SoC:          Qualcomm IPQ8068 2x1.4GHz ARMv7-A
* RAM:          512MiB (2x Winbond W632GU6MB-12)
* SPI flash:    4MiB Macronix MX25U3235F
* NAND flash:   128MiB Winbond W29N01HZBINF
* WiFi:         2x Qualcomm QCA9990 (one 2.4G, one 5G)
* Ethernet:     2x 1000BASE-T (Marvell 88E1514 PHY), both PoE-capable
* Power:        PoE 802.3at or 12V DC jack
* LEDs:         Red/Amber/Green status LED, Amber/Green WiFi LED
* Buttons:      1x, behind hole next to DC jack
* Console:      RJ45 connector, Cisco pinout
* USB:          1x USB 2.0 Type A, 1x internal to BLE, SoC has USB 3.0
                host but board is only wired for 2.0
* BLE:          TI CC2540 SoC, connected to USB and UART, unpopulated
                debug header on PCB
* TPM:          Atmel AT97SC3205T

How to install
==============
The stock bootloader APBoot appears to be vendor fork of U-Boot, which
disables much of the usual functionality and comes with its own booting
and firmware upgrade logic.

Unfortunately, this logic enforces RSA signatures on images,
even for the default boot from NAND.

Therefore, a patched bootloader is needed, which is built as a package.
In addition to the signature check removal, this also changes
the serial baudrate to 115200.

Luckily, the stock firmware does not disable the `sf` command
(it just hides it until you run `diag`), so the patched bootloader
can be fetched via TFTP and then flashed via console.

Flashing patched APBoot
-----------------------
* Build OpenWrt, or download `openwrt-ipq806x-generic-aruba_ap-32x-apboot.mbn`
* Connect serial cable and wired ethernet
* Access stock APBoot console at Baud 9600
* Flash patched bootloader:
```
setenv serverip <your TFTP server IP>
setenv autostart n
netget 44000000 openwrt-ipq806x-generic-aruba_ap-32x-apboot.mbn
sf probe 0
sf erase 220000 100000
sf write 44000000 220000 100000
reset
```

Booting OpenWrt
---------------
* Connect serial cable and wired ethernet
* Access patched APBoot console at Baud 115200
* Run `setenv serverip <your TFTP server IP>`
* Run `tftpboot openwrt-ipq806x-generic-aruba_ap-32x-initramfs.ari`

Installing OpenWrt
------------------
* Connect serial cable and wired ethernet
* Access patched APBoot console at Baud 115200
* Consider backing up stock firmware(s) (UBI volumes `aos0` and/or `aos1`)
  by booting into OpenWrt via initramfs (see above) and dumping them
* Wipe and repartition NAND flash (see below for explanation):
```
nand device 0
nand erase.chip
reset
ubi part ubifs
ubi remove ubifs
ubi create ubifs 1
ubi create rootfs_data
```
* Follow steps above to boot OpenWrt via initramfs
* From OpenWrt, persist installation via sysupgrade

Reverting to stock FW
---------------------

The patched bootloader remains compatible with the original firmware,
so you can just wipe the NAND, let APBoot recreate the partitions,
and flash back the `aos0`/`aos1` backup from above.

Current status
==============

Tested and working
------------------

* Console
* Wired GbE (both ports)
* WiFi (both 2.4G and 5G)
* LEDs
* Restart Button
* USB port
* External watchdog
* TPM
* BLE SoC

Future work
-----------

* GPIOs for:
  * power source (8 indicates DC jack, 59 indicates 802.3at)
  * reset source (64 for warm reset, 65 for watchdog)
  * USB overcurrent (63)
* BLE SoC reflashing
  * CC2540 comes with Aruba-specific FW out of the box
  * Debug header is exposed on PCB (pinout GND-VCC-Clock-Data-Reset),
    but that requires disassembly
  * Stock BLE FW appears to support reflashing via UART, but protocol
    would need to be reverse-engineered
* ramoops/pstore
  * It appears that APBoot clears the RAM on boot, might be something
    we can patch out as well
* Porting a modern U-Boot

Flash layout
============

SPI flash
---------

```
0x000000-0x020000 sbl1
0x020000-0x040000 mibib
0x040000-0x080000 sbl2
0x080000-0x100000 sbl3
0x100000-0x110000 ddrconfig
0x110000-0x120000 ssd
0x120000-0x1a0000 tz
0x1a0000-0x220000 rpm
0x220000-0x320000 appsbl
0x320000-0x330000 appsblenv
0x330000-0x370000 art
0x370000-0x380000 panicdump
0x380000-0x390000 certificate
0x390000-0x3a0000 mfginfo
0x3a0000-0x3b0000 flashcache
0x3b0000-0x400000 aosspare
```

Factory NAND flash
------------------
* 32MiB MTD partition `aos0`, formatted as UBI
  * 32MiB UBI volume `aos0`
    * contains kernel+initrd of the primary firmware,
      initrd contains the entire root FS
* 32MiB MTD partition `aos1`, formatted as UBI
  * 32MiB UBI volume `aos1`
    * contains kernel+initrd of the secondary firmware,
      initrd contains the entire root FS
* 64MiB MTD partition `ubifs`, formatted as UBI
  * 64MiB UBI volume `ubifs`
    * Contains UBIFS, overlay-mounted on top of the initrd,
      shared between firmware slots

APBoot understands UBI, and will read the kernel from the
`aos0` or `aos1` volume (depending on `os_partition`)
with fallback to the other one in case a check fails.

Kernels are expected to have a vendor-specific header, the included
script will add that header with the correct checksum but no signature.

OpenWrt NAND flash
------------------

OpenWrt assumes separate UBI volumes for kernel and rootfs,
as well as a volume that must be named `rootfs_data` for the UBIFS.

Unfortunately, APBoot actively checks the UBI volumes at boot, and will
repartition if it doesn't find the volumes that it expects (listed above).

Luckily, it doesn't check their size, only their existence. Therefore,
we can use the following layout:

* 32MiB MTD partition `aos0`, formatted as UBI
  * 32MiB UBI volume `aos0`
    * contains OpenWrt kernel+initrd
* 32MiB MTD partition `aos1`, formatted as UBI
  * 32MiB UBI volume `aos1`
    * contains OpenWrt root squashfs
* 64MiB MTD partition `ubifs`, formatted as UBI
  * small (single-LEB) UBI volume `ubifs`
    * Dummy volume, only there to satisfy APBoot
  * almost 64MiB UBI volume `rootfs_data`
    * contains UBIFS, overlay-mounted on top of the rootfs

[^1]: https://github.com/lukasstockner/ap325-apboot-openwrt

Signed-off-by: Lukas Stockner <lukas@lukasstockner.de>
Link: https://github.com/openwrt/openwrt/pull/20738
Signed-off-by: Test Dev <dev@example.org>
2026-06-16 13:45:44 +02:00
Lukas Stockner 69a2b3b318 ipq806x: add CONFIG_GPIO_WATCHDOG
The AP-325 (and variants) has an external watchdog, so this is needed to
regularly toggle the GPIO and keep the watchdog happy.

Signed-off-by: Lukas Stockner <lukas@lukasstockner.de>
Link: https://github.com/openwrt/openwrt/pull/20738
Signed-off-by: Test Dev <dev@example.org>
2026-06-16 13:45:44 +02:00
Lukas Stockner eef8c718b4 base-files: handle name collision between kernel UBI volume and MTD partition
On the AP-325 (and variants), the bootloader enforces a particular UBI volume
layout and naming, so unfortunately the kernel's UBI volume and MTD partition
end up with the name, which confuses the current logic.

Therefore, add an option to ignore the MTD partition.

Signed-off-by: Lukas Stockner <lukas@lukasstockner.de>
Link: https://github.com/openwrt/openwrt/pull/20738
Signed-off-by: Test Dev <dev@example.org>
2026-06-16 13:45:44 +02:00
Lukas Stockner 13fc688f03 base-files: support rootfs_data on its own partition
The current code assumes that the rootfs_data UBI volume is on the same MTD
partition as the rootfs.
Unfortunately, this does not work on the Aruba AP-325 (and variants), since
the bootloader enforces a particular UBI volume layout.

Therefore, this adds a separate variable to set the rootfs_data partition,
and updates all existing devices with a non-default rootfs partition to also
specify the new variable.

Signed-off-by: Lukas Stockner <lukas@lukasstockner.de>
Link: https://github.com/openwrt/openwrt/pull/20738
Signed-off-by: Test Dev <dev@example.org>
2026-06-16 13:45:44 +02:00
Etienne Champetier 0a9fcdf571 prereq-build/u-boot: add Python 3.14 support
Python 3.14 is the default version on Fedora 43/44.

Signed-off-by: Etienne Champetier <champetier.etienne@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/23243
Signed-off-by: Test Dev <dev@example.org>
2026-06-16 12:51:01 +02:00
Rosen Penev faf8f3760d irq-ath79-intc: add missing \n
Needed to make the dmesg output normal.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/22981
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-06-16 11:50:34 +02:00
Rosen Penev 00841615f1 irq-ath79-intc: avoid negative values
of_count_phandle_with_args can return negative. We don't want that.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/22981
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-06-16 11:50:33 +02:00
Rosen Penev dbb4ac9342 irq-ath79-intc: add irq_dispose_mapping
Avoids a resource leak on failure.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/22981
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-06-16 11:50:33 +02:00
Rosen Penev 4ae9c7bdc1 irq-ath79-intc: statically allocate irq_chip
No need for dynamic allocation. static is fine.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/22981
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-06-16 11:50:33 +02:00
Rosen Penev 3c2e7b3eee irq-ath79-intc: add chained_irq_enter/exit
Original review said:

Missing chained_irq_enter/exit calls.

Also rework slightly to reduce indentation.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/22981
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-06-16 11:50:32 +02:00
Rosen Penev 5ed10923f9 irq-ath79-intc: rename pending_mask to enable_mask
Original review said:

Isn't this "pending_mask" more of an "enabled"?

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/22981
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-06-16 11:50:32 +02:00
Rosen Penev 10d7a164ad irq-ath79-intc: don't use hwirq_max
Original review said:

Don't. This is an implementation detail of the irq domain, and you're
not supposed to access that field.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/22981
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-06-16 11:50:32 +02:00
Rosen Penev 20275da9cd irq-ath79-intc: use generic_handle_domain_irq
Combines irq_find_mapping and generic_handle_irq.

Matches upstream commit
046a6ee2343bb26d85a9973a39ccdb9764236fa4

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/22981
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-06-16 11:50:32 +02:00
Rosen Penev e46cc54e9d irq-ath79-intc: add SPDX license
License boilerplate was deprecated by upstream in
d2912cb15bdda8ba4a5dd73396ad62641af2f520

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/22981
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-06-16 11:50:31 +02:00
Rosen Penev 122ea336de irq-ath79-intc: switch from add to create
Upstream Linux wants to remove the add APIs.

Get ahead of this and make the switch as was done upstream in
affdc0d1bdfa544fed26ae07c4e136af86465507

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/22981
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-06-16 11:50:31 +02:00
Rosen Penev 0354345493 irq-ath79-intc: remove panic and add kfree
Panic like this was recommended against in the original review of the
upstream submission. Remove it and add missing kfree calls.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/22981
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-06-16 11:50:31 +02:00
Rosen Penev 86cc4d84bb ath79: move intc driver out of patch
This driver has been attempted to be upstreamed once and never again.
Keep it local to make modification easier.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/22981
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-06-16 11:50:30 +02:00
Paul Spooren 4315c52a9f button-hotplug: bump package release
This commit fixes "286f377389a button-hotplug: add KEY_SETUP and KEY_VENDOR
handling" which changed the code without bumping the PKG_RELEASE, resulting in
different binaries under the same version.

Signed-off-by: Paul Spooren <mail@aparcar.org>
Link: https://github.com/openwrt/openwrt/pull/23826
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2026-06-16 11:33:24 +02:00
Paul Spooren 45b8cb0ce4 mtd: bump package release
This commit fixes "a5107ad58c6 mtd: fix buffer leak and fd leak in mtd_dump()"
which changed the code but did not increase the release. This causes two
packages with the same version to have different content and thereby hashes.

Signed-off-by: Paul Spooren <mail@aparcar.org>
Link: https://github.com/openwrt/openwrt/pull/23827
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2026-06-16 11:32:52 +02:00
Ahmed Naseef 7ed3c81248 econet: enable 6.18 testing kernel
Add building the 6.18 kernel for econet as testing.

Signed-off-by: Ahmed Naseef <naseefkm@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/23755
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-06-16 11:19:35 +02:00
Ahmed Naseef 16d10338cc econet: update config for 6.18
Regenerated with `make kernel_oldconfig` for all subtargets.

Signed-off-by: Ahmed Naseef <naseefkm@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/23755
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-06-16 11:19:35 +02:00
Ahmed Naseef 2dde2efd22 econet: update patches for 6.18
Fix patch compatibility for kernel 6.18 on econet and refresh with
`make target/linux/refresh V=s`. The shared airoha clk/spi/uart and the
econet-local timer, nand and phy patches are rebased onto the 6.18
upstream code.

Signed-off-by: Ahmed Naseef <naseefkm@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/23755
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-06-16 11:19:35 +02:00
Ahmed Naseef 3644ab9fea econet: remove upstreamed patches for 6.18
Remove all patches that have already been upstreamed for kernel 6.18.
The remaining v6.19/v6.19rc1 backports are kept, in sync with the airoha
target these patches are shared with.

Signed-off-by: Ahmed Naseef <naseefkm@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/23755
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-06-16 11:19:34 +02:00
Ahmed Naseef 0619a10834 kernel/econet: restore files for v6.12
This is an automatically generated commit which aids following Kernel patch
history, as git will see the move and copy as a rename thus defeating the
purpose.

For the original discussion see:
https://lists.openwrt.org/pipermail/openwrt-devel/2023-October/041673.html

Signed-off-by: Ahmed Naseef <naseefkm@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/23755
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-06-16 11:19:34 +02:00
Ahmed Naseef d7c66d6241 kernel/econet: create files for v6.18 (from v6.12)
This is an automatically generated commit.

When doing `git bisect`, consider `git bisect --skip`.

Signed-off-by: Ahmed Naseef <naseefkm@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/23755
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-06-16 11:19:34 +02:00
Ryan Leung baa020f6bf uboot-mediatek: enable true RNG driver for recently added devices
Enable the hardware true random number generator driver added in
2a9dce2d9e ("uboot-mediatek: port RNG drivers and enable them")
for recently added devices.

Fixes: d2fabb974c ("mediatek: add support for Wavlink WL-WNT100X3 ubootmod")
Fixes: eb6dd61a8d ("mediatek: add cudy wr3000h-v1 ubootmod")
Fixes: cfc17e81e1 ("mediatek: add cudy wr3000e-v1 ubootmod")
Fixes: b7b4938303 ("mediatek: add cudy wr3000s-v1 ubootmod")
Fixes: 6b3b7c7dc1 ("mediatek: add cudy wr3000p-v1 ubootmod")
Signed-off-by: Ryan Leung <untilscour@protonmail.com>
Link: https://github.com/openwrt/openwrt/pull/23462
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-06-16 10:59:14 +02:00
Rosen Penev a62ffbf3ac prereq-build: add clang support
The Apple g++ check is really clang in disguise. Furthermore, testing on
Linux hosts reveals that clang can sufficiently replace gcc.

Minimum version of clang is 12 because of ccache.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/17259
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-06-16 10:56:46 +02:00
Rosen Penev fa846e7e64 mediatek: predator-w6x: set MAC in NVMEM
Userspace handling is deprecated.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/23764
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-06-16 09:47:22 +02:00
Daniel Tang bd58777845 realtek: add support for V3 variant of SG2008P
Add basic support for the TP-Link SG2008P V3 variant. The switch appears
to be identical to the V1 variant, except that it uses the MP3924
instead of the TPS23861 PoE chip.

Specifications:
---------------
 * SoC:       Realtek RTL8380M
 * Flash:     32 MiB SPI flash (Vendor varies)
 * RAM:       256 MiB (Vendor varies)
 * Ethernet:  8x 10/100/1000 Mbps with PoE on 4 ports
 * Buttons:   1x "Reset" button on front panel
 * Power:     53.5V DC barrel jack
 * UART:      1x serial header, unpopulated
 * PoE:       1x MPS MP3924 I2C PoE controller

Works:
------
  - (8) RJ-45 ethernet ports
  - Switch functions
  - System LED
  - Basic PoE support (no driver, but a startup script puts the chip
    into AUTO mode)

Not yet enabled:
----------------
  - PoE, Link/Act, PoE max and System LEDs

Install via web interface:
-------------------------

Not supported at this time.

Install via serial console/tftp:
--------------------------------

The footprints R27 (0201) and R28 (0402) are not populated. To enable
serial console, 50 ohm resistors should be soldered -- any value from
0 ohm to 50 ohm will work. R27 can be replaced by a solder bridge.

The u-boot firmware drops to a TP-Link specific "BOOTUTIL" shell at
38400 baud. There is no known way to exit out of this shell, and no
way to do anything useful.

Ideally, one would trick the bootloader into flashing the sysupgrade
image first. However, if the image exceeds 6MiB in size, it will not
work. The sysupgrade image can also be flashed. To install OpenWRT:

Prepare a tftp server with:
 1. server address: 192.168.0.146
 2. the image as: "uImage.img"

Power on device, and stop boot by pressing any key.
Once the shell is active:
 1. Ground out the CLK (pin 16) of the ROM (U7)
 2. Select option "3. Start"
 3. Bootloader notes that "The kernel has been damaged!"
 4. Release CLK as sson as bootloader thinks image is corrupted.
 5. Bootloader enters automatic recovery -- details printed on console
 6. Watch as the bootloader flashes and boots OpenWRT.

Blind install via tftp:
-----------------------

This method works when it's not feasible to install a serial header.

Prepare a tftp server with:
 1. server address: 192.168.0.146
 2. the image as: "uImage.img"
 3. Watch network traffic (tcpdump or wireshark works)
 4. Power on the device.
 5. Wait 1-2 seconds then ground out the CLK (pin 16) of the ROM (U7)
 6. When 192.168.0.30 makes tftp requests, release pin 16
 7. Wait 2-3 minutes for device to auto-flash and boot OpenWRT

Signed-off-by: Daniel Tang <tangrs@google.com>
Link: https://github.com/openwrt/openwrt/pull/20616
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-06-16 09:42:19 +02:00
Hauke Mehrtens 5b2c8f4ff9 umdns: update to Git HEAD (2026-06-16)
1b5e7bf1cec7 cache: bound cache size and clamp hostile TTLs

Link: https://github.com/openwrt/mdnsd/security/advisories/GHSA-jg8f-fhfw-jg46
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-06-16 02:20:12 +02:00
Hauke Mehrtens ecbb5f6e9f uhttpd: update to Git HEAD (2026-06-16)
ae015e099986 client: reject unhandled Transfer-Encoding values
b78f51847879 client: close connection on invalid chunk length
7b1bec45826b ubus: close connection on POST body parse error

Link: https://github.com/openwrt/uhttpd/security/advisories/GHSA-mcfg-c4r7-pjpf
Link: https://github.com/openwrt/uhttpd/security/advisories/GHSA-p55c-rmhc-qfm5
Link: https://github.com/openwrt/uhttpd/security/advisories/GHSA-wgwp-64hh-f52p
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-06-16 01:39:53 +02:00
Hauke Mehrtens 63c0767f3d ead: fix integer underflow in handle_send_a()
handle_send_a() computed the SRP "A" parameter length as

    len = ntohl(msg->len) - sizeof(struct ead_msg_number);

sizeof(struct ead_msg_number) is 1, and the subtraction is evaluated in
unsigned arithmetic. A packet with msg->len == 0 therefore wraps the
result to a huge value which, assigned to the signed int len, becomes -1.
The following bounds check is signed:

    if (len > MAXPARAMLEN + 1)
        return false;

so -1 passes, and memcpy(A.data, number->data, len) runs with len cast to
size_t (~SIZE_MAX) against the 257-byte abuf, crashing the daemon.

Neither parse_message() nor handle_packet() validate msg->len (only the
captured packet length), so an unauthenticated attacker on the local
segment can reach this path and crash ead with a single crafted packet.

Validate the claimed length in unsigned arithmetic before the subtraction
and bound it on both sides. Doing the upper-bound check unsigned as well
also closes a 32-bit-only variant where sizeof(ead_packet) + msg->len
overflows in handle_packet(), letting a large msg->len reach the same
negative-len path.

Link: https://github.com/openwrt/openwrt/security/advisories/GHSA-9558-77jp-g3fw
Reported-by: @Vasco0x4
Assisted-by: Claude:claude-opus-4-8
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-06-16 01:23:28 +02:00
Hauke Mehrtens 7e7bd602ea fritz-tools: fix out-of-bounds memset in TFFS segment expansion
When growing the segment array in find_entry(), the memset() that zeroes
the newly allocated slots computed the destination with redundant sizeof
scaling:

  memset(segments + (num_segments * sizeof(struct tffs_entry_segment)), ...)

segments is a typed pointer, so pointer arithmetic already scales by the
element size. Multiplying the offset by sizeof again advances the
destination by num_segments * sizeof^2 bytes, landing far outside the
realloc()'d buffer and zeroing unrelated heap memory whenever a TFFS
entry spans multiple segments that require array expansion.

Drop the redundant multiplication so the memset targets segments[num_segments].

This is a robustness fix for malformed/corrupt TFFS content; the parser
only reads the on-device nand-tffs MTD partition as root, so it is not
considered security relevant.

Reported-by: @Vasco0x4
Assisted-by: Claude:claude-opus-4-8
Link: https://github.com/openwrt/openwrt/pull/23763
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-06-16 00:51:53 +02:00