Commit graph

33400 commits

Author SHA1 Message Date
Markus Stockhausen
0ff617f1f6 realtek: pcs: revive dead ports after RTL8382M start
SerDes attached ports that are connected during switch
boot might not be able to transmit any data after SerDes
setup. Especially ports that passed traffic before (e.g.
for tftp initramfs boot) seem to be affected. Ports that
are connected later do not show this issue.

It turns out that the old SerDes setup never really worked
on RTL8382 and the pcs refactoring (with dynamic SerDes
start and stop) totally changed the order of network bringup
in contrast to Realtek SDK.

Fix this by restaring the switch queue whenever a SerDes
goes up for the first time.

Fixes: e956adf ("realtek: rtl838x: setup SDS in PCS driver")
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/21956
Signed-off-by: Robert Marko <robimarko@gmail.com>
(cherry picked from commit 0839c5c9f2)
Manually resolved merge conflicts.
Signed-off-by: Goetz Goerisch <ggoerisch@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/22087
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-03-01 02:02:29 +01:00
Markus Stockhausen
c6e3984e05 realtek: central unlock for RTL838x write protection
The write protection register (0x1b000058) is opened up in prom init
but closed later in rtl838x_pie_init(). From that moment no more
special register writes are possible.

Only unlock the write protection register once during prom init.
Remove all other references. The error has been active since ages
but was not visible until pcs refactoring. For reference blame the
refactoring commit.

Fixes: e956adf ("realtek: rtl838x: setup SDS entirely in PCS driver")
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/21956
Signed-off-by: Robert Marko <robimarko@gmail.com>
(cherry picked from commit 8bf37836d6)
Manually resolved merge conflicts of prom.c
Signed-off-by: Goetz Goerisch <ggoerisch@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/22087
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-03-01 02:02:29 +01:00
Markus Stockhausen
cbb365a77b realtek: pcs: fix PLL_CML_CTRL for serdes 0/1
Setup of register PLL_CML_CTRL has two issues.

- It clears out bits 4-31 due to a wrong mask
- Setup of bits 0-3 is not generic but depends on the mode of
  serdes 0/1

Fix that by relocating the code and adapting the mask. The error
exists for longer but it has survived the pcs refactoring. Thus
blame the corresponding refactoring commit.

Fixes: b670d48 ("realtek: pcs: rtl838x: refactor imported code")
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/21956
Signed-off-by: Robert Marko <robimarko@gmail.com>
(cherry picked from commit fdc3776068)
Link: https://github.com/openwrt/openwrt/pull/22087
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-03-01 02:02:29 +01:00
Rafał Miłecki
ebd1c54443 bcm53xx: fix switch standalone ports (like "wan")
Fixes: https://github.com/openwrt/openwrt/issues/21187
Fixes: https://github.com/openwrt/openwrt/issues/21349
Fixes: 499a59c234 ("kernel: bump 6.12 to 6.12.30")
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit 73bfb34284)
2026-03-01 01:54:19 +01:00
Hauke Mehrtens
5b66b10095 lantiq: dm200: Fix loading PHY firmware
Some checks failed
Build Kernel / Build all affected Kernels (push) Has been cancelled
The device has 1 100MBit/s port. By default the PHY firmware is running
in 1GBit/s mode. The driver will try to load the 1GBit/s firmware and
fail if it is not there. Set the GPHY0 also to 100MBit/s mode.

The driver uses all nodes independent of the status attribute.

Do the same fix for AVM FRITZ!Box 7412 too.

Reported-by: Achelon in OpenWrt forum
Fixes: https://github.com/openwrt/openwrt/issues/21836
Link: https://github.com/openwrt/openwrt/pull/22188
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit 296b286a67)
2026-02-28 14:37:55 +01:00
Mieczyslaw Nalewaj
7d5d366404 mt7620: workaround jal imm26 and redundant PAGE_ALIGN
Some checks are pending
Build Kernel / Build all affected Kernels (push) Waiting to run
On MT7620-class platforms (CONFIG_NET_RALINK_MT7620) we observe sporadic
wrong-jump-targets, kernel oopses, hanging, corrupted backtraces or even
"half-written" instructions when the compiler emits a direct 'jal imm26'
call.
This is triggered in:
  - the small random helpers inside get_random_u32_below(), and
  - the blkcg_maybe_throttle_current() call in resume_user_mode_work().

This patch forces those two call sites to use an indirect call via
a volatile function pointer (load into register + jalr) when building
for MT7620, avoiding embedding a 26-bit immediate jump target.

Additionally, on MT7620 builds the exec path in fs/exec.c is modified:
  - skip arch_align_stack() + PAGE_ALIGN() in setup_arg_pages()
    because the micro-randomization (< PAGE_SIZE) implemented by many
    ports (including MT7620) is negated immediately by PAGE_ALIGN().
    Skipping the redundant PAGE_ALIGN() reduces exposure to the
    problematic code pattern.

These changes are targeted workarounds for MT7620; behavioral logic is unchanged.

Signed-off-by: Mieczyslaw Nalewaj <namiltd@yahoo.com>
Link: https://github.com/openwrt/openwrt/pull/20553
Signed-off-by: Robert Marko <robimarko@gmail.com>
(cherry picked from commit 22ccb445e6)
2026-02-28 10:28:04 +01:00
Rosen Penev
0f46eefc66 Revert "lantiq: arv7525pw: use nvmem for eeprom"
Some checks are pending
Build Kernel / Build all affected Kernels (push) Waiting to run
This reverts commit 9dbd45c187.

Compared to ralink,mtd-eeprom , the nvmewm binding ends up byteswapping
the data on big endian hosts. Meaning on big endian, the nvmwem binding
is equivalent to:

ralink,mtd-eeprom +
ralink,eeprom-wrap

Revert as a result since there's no eeprom-swap here.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/22192
Signed-off-by: Robert Marko <robimarko@gmail.com>
(cherry picked from commit d4845bf618)
2026-02-27 16:34:16 +01:00
Tim Harvey
087504e7bd imx: cortexa53: enable DMA contiguous memory allocator
Some checks are pending
Build Kernel / Build all affected Kernels (push) Waiting to run
Enable and configure DMA contiguous memory allocator. Without this
CMA itself will be disabled.

Fixes: ae8bf1a26e ("imx: add imx8m support")
Signed-off-by: Tim Harvey <tharvey@gateworks.com>
Link: https://github.com/openwrt/openwrt/pull/21950
Signed-off-by: Robert Marko <robimarko@gmail.com>
(cherry picked from commit eef354ff34)
2026-02-27 11:02:39 +01:00
Hauke Mehrtens
be5b8605ab ramips: mt7621: fix network configuration
The configuration for the dlink,dir-1360-a1 also changed the settings
for the devices defined on top of it. "lan1 lan2 lan3 lan4" "wan" is
the default configuration, no need to add it here.

Fixes: 7a8e2efed5 ("ramips: add support for D-Link DIR-1360 A1")
Reported-by: schmars in IRC
Link: https://github.com/openwrt/openwrt/pull/22179
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit 758c8a26e9)
2026-02-26 20:23:53 +01:00
Chester A. Unal
8b50f6c215 ramips: mt7621: enable kmod-usb3 for Mikrotik RBM33G
Mikrotik RBM33G has got a USB-A port and mPCIe slots with USB 3.0 and USB
2.0 interfaces in use. The MediaTek MT7621 SoC has got an xHCI to provide
these interfaces. Therefore, enable kmod-usb3 to support them.

Fixes: 5684d08741 ("ramips: Add support for Mikrotik RouterBOARD RBM33g")
Signed-off-by: Chester A. Unal <chester.a.unal@arinc9.com>
(cherry picked from commit 61c9337d80)
2026-02-26 13:47:13 +00:00
Sander Vanheule
cdc92ce560 realtek: hog the GS1900-24E external IC reset line
Some checks are pending
Build Kernel / Build all affected Kernels (push) Waiting to run
The GPIO line connecting to the reset signals of the GS1900-24E(A1)'s
external ICs (RTL8218B phys and RTL8231 expander) cannot be asserted by
the MDIO subsystem, as the reset is shared between busses.

To prevent users from accidentally asserting the reset line, a GPIO hog
is created to permanently de-assert the signal, reliably keeping the
phys and GPIO expanders on.

Tested-by: Simon Fischer <simi.fischa@gmail.com>
Signed-off-by: Sander Vanheule <sander@svanheule.net>
(cherry picked from commit ba57225066)
2026-02-25 20:22:49 +01:00
Sander Vanheule
82dbd32e13 realtek: rtl838x: drop GS1900 MDIO reset GPIO
The reset line wired to the RTL8231 on the GS1900 series may also
connect to other external ICs on the board. On the GS1900-24E, the
reset line is wired (via buffers) to the board's RTL8231 expanders and
the RTL8218 phys. As these external devices (phys) are on different
busses, the reset line shouldn't be specified on one bus or the other.

Drop the reset specification from the generic GPIO description, so it
can be added back on a per-device basis after confirming the behavior.

Link: https://github.com/openwrt/openwrt/issues/18620
Fixes: fd978c2e80 ("realtek: Enable Zyxel GS1900's RTL8231 reset line")
Signed-off-by: Sander Vanheule <sander@svanheule.net>
(cherry picked from commit cdbd9eb448)
2026-02-25 20:22:49 +01:00
Tim Harvey
99c0c36027 imx: cortexa53: remove KSZ9477 static driver
Some checks failed
Build Kernel / Build all affected Kernels (push) Waiting to run
Build all core packages / Build all core packages for selected target (push) Has been cancelled
The KSZ9477 driver was added to the cortexa53 kernel to support the
Gateworks Venice product family which has a board with this switch. Now
that the kmod-dsa-ksz9477 driver is available as a package remove the
static configuration ad add the package.

This resolves an issue caused by having the switch driver static and the
PHY driver as a module such that the PHY driver was not registered early
enough to be used causing some errata to not be worked around.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
Link: https://github.com/openwrt/openwrt/pull/22120
Signed-off-by: Robert Marko <robimarko@gmail.com>
(cherry picked from commit 231553b280)
2026-02-24 20:39:09 +01:00
Shiji Yang
ffd38ddffe kernel: net: fix deadlock caused by phy led trigger
Some checks are pending
Build Kernel / Build all affected Kernels (push) Waiting to run
Build all core packages / Build all core packages for selected target (push) Waiting to run
Register phy led_triggers earlier to avoid AB-BA deadlock.

Fixes: https://github.com/openwrt/openwrt/issues/18472
Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
Link: https://github.com/openwrt/openwrt/pull/22136
Signed-off-by: Robert Marko <robimarko@gmail.com>
(cherry picked from commit 0bfcb0a36c)
2026-02-23 21:57:58 +01:00
Stijn Tintel
dbb6f0b547 mediatek: TP-Link EAP683-UR support
Some checks failed
Build Kernel / Build all affected Kernels (push) Has been cancelled
The TP-Link EAP683-UR is identical to the EAP683-LR. Add it as ALT0
variant.

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
(cherry picked from commit 708dcca80a)
2026-02-22 23:23:09 +02:00
Stijn Tintel
07a8ae37c2 mediatek: TP-Link EAP683-LR support
Add support for the TP-Link EAP683-LR, an AX6000 Ceiling Mount WiFi 6
AP.

Hardware:
* SoC: MediaTek MT7896AV
* RAM: 1GiB DDR4 (Samsung K4A8G165WC-BCTD)
* Flash: 128MiB SPI-NAND (ESMT F50L1G41LB)
* Ethernet: 1x 10/100/1000/2500 Mbps PoE-PD (MaxLinear GPY211C)
* WiFi: MT7976AN/MT7976GN 2.4/5GHz 4T4R
* LEDS: 3x blue connected to a single GPIO line
* Buttons: 1x reset
* BLE/Thread/Zigbee: CC2652

Stock firmware uses a random MAC address for ethernet, label MAC for
2.4 and label MAC + for 5GHz.

Installation via bootloader:
* Solder JST??? connector on J255, alternatively solder wires on the
  TP13-TP15 pads. Pinout: TP13: TX, TP14: RX, TP15: GND, TP16: VCC.
  The pins for J255 are in the same order.
* Interrupt boot process by repeatedly pressing Ctrl+b during boot
* In the boot menu, select U-Boot console
* Ensure the U-Boot environment variable "tp_boot_idx" is not set:
  # setenv tp_boot_idx
  # saveenv
* Boot the OpenWrt initramfs:
  # tftpboot openwrt-mediatek-filogic-tplink_eap683-lr-initramfs-kernel.bin
  # bootm
* copy openwrt-mediatek-filogic-tplink_eap683-lr-squashfs-sysupgrade.bin
  to /tmp and install it using sysupgrade

Flashing via OEM firmware is currently not supported. The
tplink-safeloader utility does not recognize the OEM firmware:

  DEBUG: can not find fwuphdr
  Firmware image partitions:
  base     size     name
  Segmentation fault (core dumped)

To revert to the OEM firmware, you can set the U-Boot environment
variable "tp_boot_idx" to 1 via bootloader, or using fw_setenv via
OpenWrt. This should result in booting from the ubi1 partition, which
OpenWrt should not touch. Then use the web interface to upgrade
firmware: System > Firmware Update.

The OEM firmware uses 0x800000 for the runtime_backup partition size.
This causes the following warning:

  mtd: partition "runtime_backup" extends beyond the end of device "nmbm_spim_nand" -- size truncated to 0x600000

This is due to the NMBM reserved blocks. Use 0x600000 in our DTS.

Thanks to init Lab's user890104, who soldered jumper wires on the TTL
pads for me so I could have serial console. My soldering skills just
aren't good enough to pull that off without risk damaging things.

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
(cherry picked from commit f1749142ca)
2026-02-22 23:23:09 +02:00
Rosen Penev
c0dd42dcc4 Revert "bmips: huawei-hg556a-c: use nvmem for wifi eeprom"
Some checks failed
Build Kernel / Build all affected Kernels (push) Has been cancelled
This reverts commit 72f43ac220.

The NVMEM codepath does not perform automatic byte conversion. It can be
fixed but the upstream version is quite different from the local
mac80211 patch. Revert until mac80211 gets updated and the whole mess
can get squared away.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/22091
Signed-off-by: Robert Marko <robimarko@gmail.com>
(cherry picked from commit b270580dea)
2026-02-21 14:02:55 +01:00
Mieczyslaw Nalewaj
17d625c858 ramips: remove obsolete SPI flash nodes after kernel fix
Some checks failed
Build Kernel / Build all affected Kernels (push) Has been cancelled
Build all core packages / Build all core packages for selected target (push) Has been cancelled
Remove incomplete SPI flash definitions from affected device tree files.
These fragments only defined address-cells and size-cells without any
actual flash configuration (partitions, compatible string, etc.).

After applying openwrt/openwrt#20942 ("kernel: of: fix bad cell count error
for SPI flash node"), the kernel properly handles SPI flash nodes without
requiring these incomplete definitions in device-specific DTS files.

This cleanup eliminates unnecessary code that was likely a workaround for
the previous kernel issue.

Signed-off-by: Mieczyslaw Nalewaj <namiltd@yahoo.com>
Link: https://github.com/openwrt/openwrt/pull/22036
Signed-off-by: Robert Marko <robimarko@gmail.com>
(cherry picked from commit 313d563664)
2026-02-20 10:19:00 +01:00
Edward Chow
42ad77a4a6 bcm53xx: fix target name of meraki_mx64-a0
Some checks failed
Build all core packages / Build all core packages for selected target (push) Waiting to run
Build and Push prebuilt tools container / Build and Push all prebuilt containers (push) Waiting to run
Build host tools / Build host tools for linux and macos based systems (push) Waiting to run
Build Kernel / Build all affected Kernels (push) Has been cancelled
Build Toolchains / Build Toolchains for each target (push) Has been cancelled
The target name of meraki_mx64-a0 in
target/linux/bcm53xx/image/Makefile used not to be consistent with the
one defined in target/linux/bcm53xx/base-files/lib/upgrade/platform.sh
and generates warning for "Image check failed" during sysupgrade.

This commit would also make the target name for meraki_mx64-a0 to
conform to the openwrt standard.

Signed-off-by: Edward Chow <equu@openmail.cc>
Link: https://github.com/openwrt/openwrt/pull/22034
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit 625f01cd80)
2026-02-17 01:47:55 +01:00
Hauke Mehrtens
576aa04151 ath79: add env-size for Sitecom WLR-7100 / WLR-8100 u-boot-env
The Linux kernel assumes that the u-boot environment covers the full
partition, but it only covers 0x1000 bytes. Linux checks the CRC and
does this over the full partition. This fails like this:
```
u-boot-env-layout 1f000000.spi:flash@0:partitions:partition@30000:nvmem-layout: Invalid calculated CRC32: 0xfcac8c41 (expected: 0x14e6335a)
u-boot-env-layout 1f000000.spi:flash@0:partitions:partition@30000:nvmem-layout: probe with driver u-boot-env-layout failed with error -22
```

Define the u-boot environment with a length of 0x1000 bytes to calculate
the CRC only over this area.

When replicating the u-boot environment with these parameters it
generates the same CRC:
```
mkenvimage -p 0 -b -s 0x1000 -o output.bin input.txt
```

Fixes: https://github.com/openwrt/openwrt/issues/21696
Fixes: 5e3a602def ("ath79: sitecom,wlrx100: use nvmem")
Link: https://github.com/openwrt/openwrt/pull/22030
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit 68a466b698)
2026-02-17 01:47:48 +01:00
Rosen Penev
d66fc6e86f lantiq: handle EPROBE_DEFER for MAC
If nvmem is used for ethernet mac address, we need to defer loading to
get the proper mac.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21955
Signed-off-by: Robert Marko <robimarko@gmail.com>
(cherry picked from commit fb71774232)
2026-02-17 01:47:14 +01:00
Tomáš Macholda
42b10de18d mvebu: add support for RIPE Atlas Probe v5
RIPE Atlas Probe v5 is a network measurement device based on Turris MOX.

u-boot bootscript supports booting both from the original Turris BTRFS
layout and default OpenWrt ext4 boot + root partition layout.

Specifications:
* SoC: Marvell ARMADA 3720
* RAM: 512 MiB, DDR3
* eMMC: 4G
* Ethernet: 1x 1GbE

MAC:
LAN MAC: label on board

Flash instructions:
* For using the default ext4 layout, boot into a live system using
tftpboot in u-boot and flash an OpenWrt SD image onto /dev/mmcblk0.
* For the Turris layout, put the new rootfs into subvolume '@', not
forgetting to add Image, device tree, and boot.scr to /boot.

Misc:
* USB connection is only for power. For UART access use the pin header:
  1: GND
  2: +1.8V
  5: TX
  6: RX
* Flashing the image onto Turris Shield won't work. Use Turris MOX image
  instead.

Signed-off-by: Tomáš Macholda <tomas.macholda@nic.cz>
Link: https://github.com/openwrt/openwrt/pull/20031
(cherry picked from commit 0271f2ee36)
Signed-off-by: Trix Taiclet <git@trix.moe>
Link: https://github.com/openwrt/openwrt/pull/22048
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-02-17 01:40:00 +01:00
Goetz Goerisch
f27d38666c Revert "kernel: revert ip6_tunnel use skb_vlan_inet_prepare() in __ip6_tnl_rcv()"
Some checks failed
Build all core packages / Build all core packages for selected target (push) Waiting to run
Build Kernel / Build all affected Kernels (push) Has been cancelled
This reverts commit ee0b160acc.

A backport commit was missing which was backported upstream with
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.12.71&id=4ce768ac429ec1c2d4ba63a408fed454ed12b248

Link: https://lore.kernel.org/all/CANn89iL5ksZZCJr7SK9=4Sw6EejdOzr5_m6pBMM8RVtbLy_ACA@mail.gmail.com/

Signed-off-by: Goetz Goerisch <ggoerisch@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/22025
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit 385b02614e)
2026-02-15 13:23:34 +01:00
John Audia
29bfcadbc3 kernel: bump 6.12 to 6.12.71
Some checks are pending
Build Kernel / Build all affected Kernels (push) Waiting to run
Build all core packages / Build all core packages for selected target (push) Waiting to run
Changelog: https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.12.71

All patches automatically rebased.

Build system: x86/64
Build-tested: flogic/glinet_gl-mt6000
Run-tested: flogic/glinet_gl-mt6000

Signed-off-by: John Audia <therealgraysky@proton.me>
Link: https://github.com/openwrt/openwrt/pull/21985
(cherry picked from commit baa433ffe9)
Link: https://github.com/openwrt/openwrt/pull/22017
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-02-15 02:07:04 +01:00
John Audia
47f0c12080 kernel: bump 6.12 to 6.12.70
Changelog: https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.12.70

Removed upstreamed:
 backport-6.12/605-01-v6.17-net-phy-add-phy_interface_weight.patch[1]

All patches automatically rebased.

1. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.12.70&id=4dc7b69bca8ef6b932a7c6bea63450796b1146ce

Build system: x86/64
Build-tested: flogic/glinet_gl-mt6000
Run-tested: flogic/glinet_gl-mt6000

Signed-off-by: John Audia <therealgraysky@proton.me>
Link: https://github.com/openwrt/openwrt/pull/21985
(cherry picked from commit 2c4a719d26)
Link: https://github.com/openwrt/openwrt/pull/22017
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-02-15 02:07:04 +01:00
John Audia
228a89a013 kernel: bump 6.12 to 6.12.69
Changelog: https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.12.69

All patches automatically rebased.

Build system: x86/64
Build-tested: flogic/glinet_gl-mt6000
Run-tested: flogic/glinet_gl-mt6000

Signed-off-by: John Audia <therealgraysky@proton.me>
Link: https://github.com/openwrt/openwrt/pull/21904
(cherry picked from commit b4759469c9)
[Refreshed on top of 25.12]
Link: https://github.com/openwrt/openwrt/pull/22017
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-02-15 02:07:04 +01:00
Fil Dunsky
b8fe7b5c65 mediatek: add support for netis NX32U
Some checks are pending
Build Kernel / Build all affected Kernels (push) Waiting to run
Build all core packages / Build all core packages for selected target (push) Waiting to run
This PR adds support for netis NX32U router.

Specification
-------------
- SoC       : MediaTek MT7981BA dual-core ARM Cortex-A53 1.3 GHz
- RAM       : 256 MiB DDR3
- Flash     : SPI-NAND 128 MiB (ESMT)
- WLAN      : MediaTek MT7976CN dual-band WiFi 6
  - 2.4 GHz : b/g/n/ax, MIMO 2x2
  - 5 GHz   : a/n/ac/ax, MIMO 2x2
- Ethernet  : 10/100/1000 Mbps x3 (LAN, MediaTek MT7531AE)
              10/100/1000 Mbps x1 (WAN, SoC internal phy)
- USB       : 3.0
- Buttons   : Mesh, Reset
- LEDs      : 1x Power (green), unmanaged
              1x Internet (green), gpio-controlled
              1x WPS (green), gpio-controlled
              1x WiFi 2.4 GHz (green), gpio-controlled
              1x WiFi 5 GHz (green), gpio-controlled
              1x LAN activity (green), switch-controlled
              1x WAN activity (green), switch-controlled
              1x USB (green), gpio-controlled
- Power     : 12 VDC, 1 A

Installation
------------
1. Connect to the router using ssh (user: admin, pass: web interface
   password)
2. Backup:
```
cat /dev/mtd0 | gzip -1 -c > /tmp/mtd0_spi0.0.bin.gz
cat /dev/mtd1 | gzip -1 -c > /tmp/mtd1_BL2.bin.gz
cat /dev/mtd2 | gzip -1 -c > /tmp/mtd2_u-boot-env.bin.gz
cat /dev/mtd3 | gzip -1 -c > /tmp/mtd3_Factory.bin.gz
cat /dev/mtd4 | gzip -1 -c > /tmp/mtd4_FIP.bin.gz
cat /dev/mtd5 | gzip -1 -c > /tmp/mtd5_ubi.bin.gz
```
3. Download mtd backup from the /tmp dir of the router to your PC using
   scp protocol
4. Upload OpenWrt 'bl31-uboot.fip', 'preloader.bin' images to the /tmp
   dir of the router using scp protocol
5. Write FIP and BL2 (replace bootloader):
```
mtd write /tmp/openwrt-mediatek-filogic-netis_nx32u-bl31-uboot.fip FIP
mtd write /tmp/openwrt-mediatek-filogic-netis_nx32u-preloader.bin BL2
```
6. Place OpenWrt
   'openwrt-mediatek-filogic-netis_nx32u-initramfs-recovery.itb' image on
   the tftp server (IP: 192.168.1.254)
7. Erase 'ubi' partition and reboot the router:
   mtd erase ubi
   reboot
8. U-Boot automatically boot OpenWrt recovery image from tftp server to
   the RAM
9. Upload OpenWrt 'sysupgrade.itb' image to the /tmp dir of the router
   (IP: 192.168.1.1) using scp protocol
10. Connect to the router using ssh and run:
```
ubidetach -p /dev/mtd4; ubiformat /dev/mtd4 -y; ubiattach -p /dev/mtd4
ubimkvol /dev/ubi0 -n 0 -N ubootenv -s 128KiB
ubimkvol /dev/ubi0 -n 1 -N ubootenv2 -s 128KiB
sysupgrade -n openwrt-mediatek-filogic-netis_nx32u-squashfs-sysupgrade.itb
```

Recovery
--------
1. Place OpenWrt
   'openwrt-mediatek-filogic-netis_nx32u-initramfs-recovery.itb' image on
   the tftp server (IP: 192.168.1.254)
2. Press “Reset” button and power on the router. After ~10 sec release
   the button.
3. Use OpenWrt initramfs system for recovery

+---------+-------------------+-----------+
|         | MAC               | Algorithm |
+---------+-------------------+-----------+
| LAN     | dc:xx:xx:d1:xx:18 | label     |
| WAN     | dc:xx:xx:d1:xx:1a | label+2   |
| WLAN 2g | de:xx:xx:11:xx:19 |           |
| WLAN 5g | de:xx:xx:71:xx:19 |           |
+---------+-------------------+-----------+
The LAN MAC was found in 'Factory', 0x1fef20
The WAN MAC was found in 'Factory', 0x1fef26
The WLAN 2g/5g MAC prototype was found in 'Factory', 0x4

Signed-off-by: Fil Dunsky <filipp.dunsky@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21368
(cherry picked from commit 0f713d5d11)
Link: https://github.com/openwrt/openwrt/pull/22004
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-02-14 01:21:24 +01:00
Fil Dunsky
317f893891 mediatek: filogic: add support for Bazis AX3000WM
- SoC: MediaTek MT7981B
 - CPU: 2x 1.3 GHz Cortex-A53
 - Flash: 128 MiB SPI NAND (Winbond W25N01GV)
 - RAM: 256 MiB (Nanya NT5CC128M16JR-EK)
 - WLAN: 2.4 GHz, 5 GHz (MediaTek MT7976CN, 802.11ax)
 - Ethernet: 1x 10/100/1000/2500 Mbps MaxLinear GPY211C WAN, 1x10/100/1000 Mbps MT7981 LAN
 - USB 3.0 port
 - 2x buttons: Reset, Mesh
 - 3x LEDs on top panel (red, green, blue)
 - 3x PHY port LEDs (1 amber, 2 green)
 - Board version: WD830M V2.0
 - Power: 5 VDC, 3 A

UART: internal test points, 3V3 115200 8N1 (RX, TX, GND)

Interface	MAC			Algorithm
LAN (label)	1c:bf:ce:xx:xx:x1	0x4
WAN		1c:bf:ce:xx:xx:x2	0xa
WLAN 2.4G	1c:bf:ce:xx:xx:x3	0x2a
WLAN 5G		1c:bf:ce:xx:xx:x4	0x24

At the moment installation is possible via UART only since SSH root
is password protected.

Set a static ip on the ethernet interface of your PC:
(ip address: 192.168.1.2, subnet mask:255.255.255.0).
Boot into initramfs via TFTP:
```
setenv serverip 192.168.1.2
tftpboot 0x46000000 openwrt-mediatek-filogic-bazis_ax3000wm-initramfs-recovery.itb
bootm 0x46000000
```

Install kmod-mtd-rw and activate it:
```
apk update && apk add kmod-mtd-rw
insmod mtd-rw i_want_a_brick=1
```
Upload to the router and write OpenWrt BL2 and FIP bootloader:
```
mtd write openwrt-mediatek-filogic-bazis_ax3000wm-preloader.bin BL2
mtd write openwrt-mediatek-filogic-bazis_ax3000wm-bl31-uboot.fip FIP
```
Prepare ubi partition:
```
ubidetach -p /dev/mtd4
ubiformat /dev/mtd4 -y
ubiattach -p /dev/mtd4
```

Upgrade via luci web interface with sysupgrade file or by issuing a command:
```
sysupgrade -n openwrt-mediatek-filogic-bazis_ax3000wm-squashfs-sysupgrade.itb
```
Signed-off-by: Fil Dunsky <filipp.dunsky@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21813
(cherry picked from commit 658e4adca4)
Link: https://github.com/openwrt/openwrt/pull/21924
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-02-14 01:18:26 +01:00
Pawel Dembicki
7f9363a715 package: uboot-qoriq: fix T4240RDB u-boot selection
Mark T4240RDB u-boot variants as device-built and avoid installing them into rootfs.

Without this buildbot crashes during package install with:

ERROR: unable to select packages:

  u-boot-fsl_T4240RDB-nor (no such package):

    required by: world[u-boot-fsl_T4240RDB-nor]

  u-boot-fsl_T4240RDB-sdboot (no such package):

    required by: world[u-boot-fsl_T4240RDB-sdboot]

Fixes: c5d3d5fe28 ("package: u-boot: initial support for qoriq arch")
Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21514
Signed-off-by: Robert Marko <robimarko@gmail.com>
(cherry picked from commit 20727f89d5)
Link: https://github.com/openwrt/openwrt/pull/21477
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-02-14 01:15:12 +01:00
Pawel Dembicki
2723b32ef3 qoriq: kernel: refresh config
Done by 'make kernel_oldconfig'.

Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/10941
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
(cherry picked from commit ffda7e6748)
Link: https://github.com/openwrt/openwrt/pull/21477
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-02-14 01:15:12 +01:00
Pawel Dembicki
43784b1c56 qoriq: add support for NXP T4240RDB board
Hardware specs:
  - NXP T4240, 12C/24T @ 1.67 GHz
  - 3 × 2 GB DDR3 SO-DIMM
  - 128 MB NOR flash
  - 2 GB SLC NAND
  - SD card interface
  - PCIe: x4 and x8
  - SATA 3 Gbps
  - 8 × 1 GbE
  - 4 × 10 GbE SFP
  - RTC

This commit adds the sysupgrade and factory images for T4240RDB board in
both variants:
  - nor: for booting and read whole system from NOR memory
  - sdboot: for booting and read whole system from SD card

SD Card images install:

  - Burn image to sdcard. E.g:
      gunzip -c gunzip -c openwrt-qoriq-generic-fsl_T4240RDB-squashfs-sdcard.img.gz | \
      sudo dd of=/dev/mmcblk0 conv=fsync,notrunc status=progress bs=4M && sync
  - Download lastest Cortina PHY firmware from NXP github [1], if you accept their
    EULA [2].
  - Install Cortina PHY on image, E.g:
      dd if=cs4315-cs4340-PHY-ucode.txt of=/dev/mmcblk0 bs=1 seek=2M
  - Insert SD-Card to SD slot
  - Switch SW3.4 to OFF
  - Configre mac addresses from sticker in u-boot. E.g:
      setenv ethaddr 00:10:f3:3a:a8:66
      setenv eth1addr 00:10:f3:3a:a8:67
      setenv eth2addr 00:10:f3:3a:a8:68
      setenv eth3addr 00:10:f3:3a:a8:69
      setenv eth4addr 00:10:f3:3a:a8:6a
      setenv eth5addr 00:10:f3:3a:a8:6b
      setenv eth6addr 00:10:f3:3a:a8:6c
      setenv eth7addr 00:10:f3:3a:a8:6d
      setenv eth8addr 00:10:f3:3a:a8:6e
      setenv eth9addr 00:10:f3:3a:a8:6f
      setenv eth10addr 00:10:f3:3a:a8:70
      setenv eth11addr 00:10:f3:3a:a8:71
      saveenv
  - reset and boot

NOR images install:

  - download and extract factory image on tftp server root
  - boot device and stop in u-boot (from nor or sd card u-boot)
  - configure server and ip address. E.g:
      setenv ipaddr 192.168.1.2
      setenv serverip 192.168.1.1
  - Download image and run flashing:
      tftpboot $loadaddr openwrt-qoriq-generic-fsl_T4240RDB-squashfs-factory-nor.bin
      protect off all
      erase $fwaddr +$filesize
      cp.b $loadaddr $fwaddr $filesize
  - Switch SW3.4 to ON
  - Switch SW3.1-3 to OFF
  - reboot
  - Do postprocessing (see bellow)

NOR images post processing:

  - Configre mac addresses from sticker in u-boot. E.g:
      setenv ethaddr 00:10:f3:3a:a8:66
      setenv eth1addr 00:10:f3:3a:a8:67
      setenv eth2addr 00:10:f3:3a:a8:68
      setenv eth3addr 00:10:f3:3a:a8:69
      setenv eth4addr 00:10:f3:3a:a8:6a
      setenv eth5addr 00:10:f3:3a:a8:6b
      setenv eth6addr 00:10:f3:3a:a8:6c
      setenv eth7addr 00:10:f3:3a:a8:6d
      setenv eth8addr 00:10:f3:3a:a8:6e
      setenv eth9addr 00:10:f3:3a:a8:6f
      setenv eth10addr 00:10:f3:3a:a8:70
      setenv eth11addr 00:10:f3:3a:a8:71
      saveenv
  - boot
  - Download and refresh RCW stored in eeprom:
      tr '\0' '\377' < /dev/zero | dd bs=256 of=/sys/bus/i2c/devices/0-0050/eeprom
      cat /tmp/openwrt-qoriq-generic-fsl_T4240RDB-squashfs-rcw.bin > /sys/bus/i2c/devices/0-0050/eeprom
  - Download lastest Cortina PHY firmware from NXP github [1], if you accept their
    EULA [2].
  - Install Cortina PHY on image, E.g:
      mtd write cs4315-cs4340-PHY-ucode.txt /dev/mtd4
  - reset and boot

[1] https://raw.githubusercontent.com/nxp-qoriq/qoriq-firmware-cortina/refs/tags/lf-6.12.34-2.1.0/cs4315-cs4340-PHY-ucode.txt
[2] https://github.com/nxp-qoriq/qoriq-firmware-cortina/blob/lf-6.12.34-2.1.0/EULA.txt

Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/10941
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
(cherry picked from commit 0a2b3b66db)
Link: https://github.com/openwrt/openwrt/pull/21477
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-02-14 01:15:12 +01:00
Pawel Dembicki
2dd34796d8 kernel: move patch from mpc85xx to pending
The patch "Revert "powerpc: dts: mpc85xx: remove "simple-bus" compatible
from ifc node" has been sent upstream [0].

It is also required for qoriq target and in this commit it is moved to
the generic/pending folder.

[0] https://patchwork.ozlabs.org/project/linuxppc-dev/patch/20251105205524.17362-1-rosenp@gmail.com/

Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/10941
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
(cherry picked from commit 5ed0f5a6dd)
Link: https://github.com/openwrt/openwrt/pull/21477
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-02-14 01:15:12 +01:00
Raylynn Knight
ca13153d10 x86: base-files add support for Sophos 210r3 and 230r2
Some checks are pending
Build Kernel / Build all affected Kernels (push) Waiting to run
Build all core packages / Build all core packages for selected target (push) Waiting to run
This fixes a previous commit for Sophos XG 210r3 which was missing
board_name mapping and adds support for the SG related version and the
XG/SG 230r2 which is the same hardware with a faster processor.

Sophos board_name mapping was modified to support all Sophos
SG/XG devices.

Sophos SG/XG 210r3 and SG/XG 230r2 are rackmounted x86 based firewall
with 6 RJ-45 gigabit ethernet ports (eth0-5) and 2 SFP gigabit ethernet
ports (eth6, eth7) all running Intel NICs supported by igb driver. The 210r3
and 230r2 only differ in the processor used.  This board update maps
eth1 (marked as WAN) as wan and eth0 and eth2-5 as lan.  Leaving the
two SFP ports unmapped.

Fixes: 4880e8e338 ("x86: add board mapping for Sophos XG 210r3")
Signed-off-by: Raylynn Knight <rayknight@me.com>
Link: https://github.com/openwrt/openwrt/pull/21959
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit d0c82dbb17)
2026-02-13 00:18:14 +01:00
Tomáš Macholda
72f5912448 mvebu: add depends for Turris MOX boards
Add dependencies for Turris MOX board modules directly as
DEVICE_PACKAGES. (So that users don't have to add them manually.)

The device uses an SD card for primary storage so space shouldn't be an
issue.

Signed-off-by: Tomáš Macholda <tomas.macholda@nic.cz>
Link: https://github.com/openwrt/openwrt/pull/21151
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit bbfee76d1d)
2026-02-13 00:18:14 +01:00
Robert Marko
ac7c25ee92 mvebu: cortex-a53: respect DEVICE_packages for Methode devices
Some checks failed
Build Kernel / Build all affected Kernels (push) Waiting to run
Build all core packages / Build all core packages for selected target (push) Waiting to run
Build host tools / Build host tools for linux and macos based systems (push) Has been cancelled
Use the added support for generating per device targz rootfs so that images
generated for Methode devices when CONFIG_TARGET_MULTI_PROFILE and
CONFIG_TARGET_PER_DEVICE_ROOTFS are set, we actually get the targz rootfs
that respects DEVICE_PACKAGES.

Currently, buildbot generated images have no networking, LM75 nor I2C
working, as the generated images do not include required kmods that are
listed in DEVICE_PACKAGES.

While at it, there is no need for tar to run in verbose mode.

Fixes: 7dff6a8c89 ("mvebu: uDPU: add sysupgrade support")
Signed-off-by: Robert Marko <robert.marko@sartura.hr>
(cherry picked from commit ef92265772)
2026-02-12 16:59:52 +01:00
Hauke Mehrtens
8d1601b837 kernel: refresh patches
Some checks are pending
Build Kernel / Build all affected Kernels (push) Waiting to run
Build all core packages / Build all core packages for selected target (push) Waiting to run
Refresh the patches to make them apply cleanly again.

Fixes: 105eb9ca95 ("kernel: add cake-mq support")
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit 30ac12f4b4)
2026-02-12 01:00:22 +01:00
Zhi-Jun You
8bafa45f35 mediatek: filogic: add 6G precal to Acer Vero W6m
Bootlog has the following line:
mt7915e 0000:01:00.0: missing precal data, size=403472

It is because precal was not included in the previous NVMEM conversion.

Fix this by adding it to the dts.

Fixes: dbc2923cbe ("mediatek: filogic: convert Acer Predator W6 to use NVMEM framework")
Signed-off-by: Zhi-Jun You <hujy652@protonmail.com>
Link: https://github.com/openwrt/openwrt/pull/21894
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit c62bab29d5)
2026-02-12 00:49:01 +01:00
Zhi-Jun You
661ffcbf7d mediatek: filogic: add 6G precal to Acer Predator W6
Bootlog has the following line:
mt7915e 0000:01:00.0: missing precal data, size=403472

It is because precal was not included in the previous NVMEM conversion.

Fix this by adding it to the common dts.

Fixes: dbc2923cbe ("mediatek: filogic: convert Acer Predator W6 to use NVMEM framework")
Signed-off-by: Zhi-Jun You <hujy652@protonmail.com>
Link: https://github.com/openwrt/openwrt/pull/21894
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit eb369b267d)
2026-02-12 00:48:59 +01:00
Zhi-Jun You
a47290c869 mediatek: filogic: add precal to W6 common dtsi
Bootlog has the following line:
mt798x-wmac 18000000.wifi: missing precal data, size=403472

It is because precal was not included in the previous NVMEM conversion.

Fix this by adding it to the common dtsi.

Fixes: dbc2923cbe ("mediatek: filogic: convert Acer Predator W6 to use NVMEM framework")
Signed-off-by: Zhi-Jun You <hujy652@protonmail.com>
Link: https://github.com/openwrt/openwrt/pull/21894
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit 3f430451b1)
2026-02-12 00:48:58 +01:00
Qingfang Deng
74bf3689ea
kernel: backport pppoe improvements
Some checks are pending
Build Kernel / Build all affected Kernels (push) Waiting to run
Build all core packages / Build all core packages for selected target (push) Waiting to run
Backport PPP patches accepted upstream.

Manually rebased:
- target/linux/ipq40xx/patches-6.12/999-atm-mpoa-intel-dsl-phy-support.patch

Signed-off-by: Qingfang Deng <dqfext@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21892
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit 316492b809)
2026-02-11 14:32:46 +01:00
Linus Walleij
b82ef842c5 gemini: select the right GPIO input package
Some checks are pending
Build Kernel / Build all affected Kernels (push) Waiting to run
Build all core packages / Build all core packages for selected target (push) Waiting to run
We don't want kmod-gpio-button-hotplug, we want the more
normal kmod-input-gpio-keys.

Link: https://github.com/openwrt/openwrt/pull/21750
(cherry picked from commit 37b13b6ea6)
Link: https://github.com/openwrt/openwrt/pull/21973
Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-02-11 08:47:45 +01:00
Linus Walleij
f034005f95 gemini: set disk activity on orange LED
Set the disk activity LED to the intended trigger.

Link: https://github.com/openwrt/openwrt/pull/21750
(cherry picked from commit f52f1a85d1)
Link: https://github.com/openwrt/openwrt/pull/21973
Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-02-11 08:47:45 +01:00
Linus Walleij
b7cee916ed gemini: sl93512r: override SL93512R partitions for firmware
This is patch is identical in form and purpose as the IB-4220-B
patch. We switch over to a single "firmware" partition.

All reference design-based machines are now converted and we can
drop the legacy set-up code.

It turns out that the reference design also uses the flash layout
with a 3072KB kernel so augment the sysupgrade to do the right
thing also here.

Link: https://github.com/openwrt/openwrt/pull/21820
(cherry picked from commit c579e1d04c)
Link: https://github.com/openwrt/openwrt/pull/21973
Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-02-11 08:47:45 +01:00
Linus Walleij
1ed4f59e13 gemini: sq201: override SQ201 partitions for firmware
This is patch is identical in form and purpose as the IB-4220-B
patch. We switch over to a single "firmware" partition.

Link: https://github.com/openwrt/openwrt/pull/21820
(cherry picked from commit 81215f55e2)
Link: https://github.com/openwrt/openwrt/pull/21973
Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-02-11 08:47:45 +01:00
Linus Walleij
dd4423f298 gemini: override IB-4220-B partitions for firmware
To optimize the flash usage and to make firmware upgrades
simpler, catenate the three firmware partitions "Kern",
"Ramdisk" and "Application" into one, and use all of this
for the combined MTD-splitted kernel+rootfs.

This works fine as long as the kernel is placed in the
beginning of this firmware partition and we leave the
RedBoot partition as is, so the boot loader still can load
the kernel from the first two RedBoot partitions.

Using the RedBoot partitions "as is" can be considered
harmful, because when you flash to a RedBoot partition the
file size is used for downsizing of the partition and make
firmware upgrades fail if they are larger than the RedBoot
partition size after flashing, despite there is actually
flash there. So overriding with fixed partitions is just
generally a good idea.

Link: https://github.com/openwrt/openwrt/pull/21820
(cherry picked from commit 387752dc76)
Link: https://github.com/openwrt/openwrt/pull/21973
Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-02-11 08:47:45 +01:00
Linus Walleij
980c3ddac8 kernel: Add necessary CONFIG_MTD_SPLIT config option
Buils break without this new config, mea culpa.

Link: https://github.com/openwrt/openwrt/pull/21855
(cherry picked from commit eb0a1a3a89)
Link: https://github.com/openwrt/openwrt/pull/21973
Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-02-11 08:47:45 +01:00
Linus Walleij
c9ab6ffada kernel: mtdsplit: create executable prolog splitter
The problem is the following: we have three fixed partitions
in a RedBoot partition for kernel, initrd and rootfs. On the
surface this looks good.

But we have little flash and want to use it efficiently. We want
to use the OpenWrt "firmware" partition scheme where the kernel,
initramfs and sqashfs+jffs2 rootfs is appended, leaving maximum
space for a writeable rootfs.

To do this we will override the existing RedBoot partition table
with one that merges the three separate partitions into one
"firmware" partition.

RedBoot is still booting the system. It still needs to read the
first two parts "as if" these were the kernel and initrd. This
works fine, because the kernel still comes first.

We already have hacks in place to merge the two kernel and initrd
into one binary image and execute it. This is done by prepending
a "prolog" to the kernel that does the necessary copying in
memory and then jumps to execute the kernel.

Since this "prolog" copying routine is just 92 bytes but has 512
bytes allocated, we can trivially create a firmware format that
can be used for splitting the image into kernel and rootfs
using a tagging scheme that can be done directly by scripting
so we don't need any special binary programs.

This splitter implements that idea.

This will be used on the Gemini platform and was tested on the
Raidsonic IB-4220-B.

Link: https://github.com/openwrt/openwrt/pull/21820
(cherry picked from commit 5ac8f14ccb)
Link: https://github.com/openwrt/openwrt/pull/21973
Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-02-11 08:47:45 +01:00
Linus Walleij
40b5a83fdb gemini: use tar stream to write firmware
The firmware update file can get big, so instead of extracting
the whole file into the tmp folder potentially running out of space
and make the upgrade fail, stream from tar xvf -O directly to the
mtd write command.

Refactor the checking of partitions and the actual upgrade into
two steps when we are at it.

Link: https://github.com/openwrt/openwrt/pull/21782
(cherry picked from commit 1977301b5f)
Link: https://github.com/openwrt/openwrt/pull/21973
Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-02-11 08:47:45 +01:00
Linus Walleij
43547e9314 gemini: pad storlink reference firmware to 128kb
The redboot partition parser gets upset if a partition
doesn't end on an even erase block and marks the partition
read-only.

Fix this by always padding the three firmware items to
128kb.

It is no longer required for the filesystem to be padded
to 6144kb, so we pad this to just 128kb like the kernel
images.

Link: https://github.com/openwrt/openwrt/pull/21750
(cherry picked from commit db7a2fb217)
Link: https://github.com/openwrt/openwrt/pull/21973
Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-02-11 08:47:45 +01:00
Linus Walleij
26f776335a gemini: Fix up sysupgrade platform.sh script
The Storlink reference designs sometimes fail upgrade because
not the entire partition is used, so the size isn't equal to
the actual flash space available for the partition.

Fix this by calculating the actual partition sizes by measuring
across the partition offsets instead.

Link: https://github.com/openwrt/openwrt/pull/21750
(cherry picked from commit 04bc0b6d3f)
Link: https://github.com/openwrt/openwrt/pull/21973
Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-02-11 08:47:45 +01:00