This site no longer provide GNOME mirror services.
Signed-off-by: Zhi You <yuzhii0718@outlook.com>
Link: https://github.com/openwrt/openwrt/pull/24498
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Hardware:
- SoC: MediaTek MT7981B
- CPU: 2x 1.3 GHz Cortex-A53
- Flash: 256 MiB ESMT F50L2G41XA
- RAM: DDR3, 512 MiB
- WLAN: 2.4 GHz, 5 GHz (MediaTek MT7976CN, 802.11ax)
- 1x WAN MT7531 (JXD 2531Z) 10/100/1000 Mbps
- 4x LAN 2x MT7530 (JXD 2529S) 10/100/1000 Mbps
- USB 3.0 port
- Buttons: Reset, WPS
- 8x LEDs: 2x Red, 6x Blue
- Serial console: no need to solder. 115200 8n1
- Power: 12 VDC, 1.5 A
The DTS inherits WBR3000UAX because WR3000U is almost the same.
The only difference is size of NAND and factory UBI length.
+---------+-------------------+-----------+
| | MAC | Algorithm |
+---------+-------------------+-----------+
| WAN | D4:0D:AB:xx:xx:x1 | label+1 |
| LAN | D4:0D:AB:xx:xx:x0 | label |
| WLAN 2g | D4:0D:AB:xx:xx:x0 | label |
| WLAN 5g | D6:0D:AB:xx:xx:x1 | label+1 |
+---------+-------------------+-----------+
There are 2 ways to install OpenWrt:
- via an intermediate RSA-signed vendor's image or
- via UART && TFTPd
Migration to OpenWrt via OEM firmware:
- Download the migration image from
https://drive.google.com/drive/folders/1BKVarlwlNxf7uJUtRhuMGUqeCa5KpMnj
(The folder is Cudy's official "Cudy Intermediary OpenWrt Firmware" resource)
- Upload the migration image via OEM web interface
- After flashing, OpenWrt is accessible via http://192.168.1.1
- Flash the official OpenWrt image
Install using UART & TFTP:
- Connect to UART.
- Connect to LAN and set your IP to 192.168.1.88/24.
- Configure a TFTP server to serve
openwrt-mediatek-filogic-cudy_wr3000u-v1-initramfs-kernel.bin file
and run the TFTP server.
- Press reset and power-on the router. Hold the reset button for 5 seconds
- TFTP error: 'File not found' appears and MTK console becomes available
- Enter the following commands in the console:
setenv bootfile openwrt-mediatek-filogic-cudy_wr3000u-v1-initramfs-kernel.bin
tftpboot
bootm
- After booting to initramfs, via http://192.168.1.1 flash
openwrt-mediatek-filogic-cudy_wr3000u-v1-squashfs-sysupgrade.bin
- After flashing, OpenWrt is accessible via http://192.168.1.1
If you fail to flash the device,
you can use TFTP to flash back to the original firmware:
- Download the original firmware from
https://www.cudy.com/pages/download-center/wr3000u-256mb-1-0
- Connect to LAN and set your IP to 192.168.1.88/24.
Configure a TFTP server and an recovery.bin firmware file
- With the router off, press the RESET button.
While the router is turning on,
the button should continue to be pressed for at least 5 seconds
- After 1-2 minutes the original firmware is available on http://192.168.10.1
Signed-off-by: Dmitry Mostovoy <stavultras@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/24447
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Downgrade rtldsa_931x_print_matrix from pr_info to pr_debug to reduce
the massive amount printed during boot (64 lines). There doesn't seem
any benefit right now for keeping this at info level. And RTL931X is
the only variant that uses info-level print right now, all others
already use pr_debug.
Debug output can be activated individually for people who need this for
testing/debugging.
Link: https://github.com/openwrt/openwrt/pull/24507
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
edma_probe() assigns a random address unconditionally, so the conduit
changes its MAC on every boot, and with it every DSA user port that has
no address of its own and therefore inherits the conduit's.
The conduit is a DMA engine behind the switch and has no address of its
own, which is why no board describes one for it. Take the address from
the switch this conduit serves instead: its ports carry the board's
addresses, either from DT or patched in by the bootloader, so this needs
nothing added per board. Keep the random address for the case where the
switch describes no address either.
Assisted-by: Claude:claude-opus-5
Signed-off-by: Julius Bairaktaris <julius@bairaktaris.de>
Link: https://github.com/openwrt/openwrt/pull/24512
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
nf_flow_table.ko now links in the flowtable path discovery code
(nft_flow_route() and friends), which was moved out of
nft_flow_offload.c and references nf_tables symbols directly. This
makes nf_flow_table.ko depend on nf_tables.ko at load time, so
kmod-nf-flow needs kmod-nft-core.
Upstream: 93d7a7ed0734 ("netfilter: flowtable: move path discovery infrastructure to its own file")
Signed-off-by: John Audia <therealgraysky@proton.me>
Link: https://github.com/openwrt/openwrt/pull/24419
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
The IXP4xx firmware is now in linux-firmware so use these images
instead and drop the special microcode builder package.
Apply a change to the github labeler at the same time as the special
ixp4xx microcode package no longer exists after this.
Link: https://github.com/openwrt/openwrt/pull/24422
Signed-off-by: Linus Walleij <linusw@kernel.org>
Check out the TESTING_KERNEL option to build OpenWrt UML with v6.18.
Be aware that the old UML networking is now gone! Please checkout:
https://docs.kernel.org/virt/uml/user_mode_linux_howto_v2.html#setting-up-uml-networking
Note: v6.12 already supported vector transports.
The README.md has been updated to reflect this change.
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
One interesting piece of information that has come up:
UML has come a long way with VFIO_PCI. But this functionality is
unused/disabled because the target doesn't set the PCI feature.
I think this feature could be added and the related CONFIG_VFIO
options could be selected by the kmod-vfio package.
That said, CONFIG_NO_IOMEM=y and friends will have to go.
So this can involve more work than one would expect.
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
Two patches are skipped:
- 000-v6.13-asm-generic-io.h-rework-split-ioread64-iowrite64-hel.patch
It's included. This was backported from upstream.
- 102-pseudo-random-mac.patch
The deprecated um_net driver has been removed.
You need to convert to the vector-based network driver.
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
This was changed in upstream linux kernel with:
|commit db4bfcba7bb8 um: Fix hostaudio build errors
|Author: Randy Dunlap <rdunlap@infradead.org>
|Date: Tue Aug 1 22:15:00 2023 -0700
|
| um: Fix hostaudio build errors
|
| Use "select" to ensure that the required kconfig symbols are set
| as expected.
| Drop HOSTAUDIO since it is now equivalent to UML_SOUND.
|
| Set CONFIG_SOUND=m in ARCH=um defconfig files to maintain the
| status quo of the default configs.
|
| Allow SOUND with UML regardless of HAS_IOMEM. Otherwise there is a
| kconfig warning for unmet dependencies. (This was not an issue when
| SOUND was defined in arch/um/drivers/Kconfig. I have done 50 randconfig
| builds and didn't find any issues.)
| [...]
The reason why this was not spotted is because of IOMEM. We would need
to have a device that requires IOMEM first and the obvious choice would
be VFIO_PCI. But none of the pci features are set for the UML target.
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
The upgrade to 2.5.0 accidentally dropped the CPP defines, so the
precompiled-active-filter option has been missing and the demand dialing
option in uci has been broken since then. Add the missing defines.
Fixes: 9cecf2b16e ("ppp: update to 2.5.0")
Closes: https://github.com/openwrt/openwrt/issues/24454
Signed-off-by: Qingfang Deng <dqfext@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/24467
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
A station MLD is configured across every radio it may use, which marks all
of those radios as channel following. Only the radios the station actually
holds a link on have a channel to follow; the rest waited for one that never
arrived, so they ignored their configured channel and kept whatever ACS had
picked at start up. Later channel changes were dropped as well, because the
pending follow was treated as authoritative.
Track the frequency reported through apsta_state per radio and let a radio
without one apply its own configuration. The supplicant marks the radios
holding no link when the station completes an association, and repeats the
notification on link reconfiguration, so radios are handed back and forth as
the station adds or drops links rather than staying stuck on the first
association.
Signed-off-by: Felix Fietkau <nbd@nbd.name>
wpad decides whether to keep or tear down an MLD interface by comparing the
whole configuration object, which embedded the full device configuration of
every participating radio. Any radio level change, such as a channel or
txpower update, therefore destroyed and recreated the station MLD and
dropped the backhaul link. Neither hostapd nor wpa_supplicant reads
radio_config; it is only used locally to resolve the phy.
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Carrying all six USXGMII submodes as distinct rtpcs_sds_mode values
forced every switch/case over hw_mode to enumerate them individually,
even though almost none of that code actually cares which submode is
active; a couple of places on 930X do, but only to tell SXGMII/QXGMII
apart from the rest.
Collapse them into a single RTPCS_SDS_MODE_USXGMII and introduce
rtpcs_sds_usxgmii_submode for the cases that still need the
distinction, threading it explicitly through hw-mode selection and
set_hw_mode instead of overloading the mode enum for it.
Link: https://github.com/openwrt/openwrt/pull/24494
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Both call sites always pass the same constants; there's no actual
variation to justify exposing opcode/am_period/an_table/sync_bit as
parameters. Inline them and keep their names as comments so the
meaning of each write isn't lost. Also clarify the QHSG naming in the
function's leading comment.
Link: https://github.com/openwrt/openwrt/pull/24494
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
The USXGMII config took a parameter to set for all USXGMII alignment
markers. However, we and the SDK always set all markers to zero except
for some special cases. Since this doesn't require a parameter, just
break it down to clearing the alignment markers.
To reduce the number of calls and writes, the pattern writing the two
halves of a register separately is reduced to a write of the full
register.
Link: https://github.com/openwrt/openwrt/pull/24494
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
reg and bit position for the autoneg control fields are identical
across all variants; only the page differs, and only for 931x. Since
that's the only axis that actually varies, replace the per-field
struct-of-structs with a single phy_page in rtpcs_config denoting the
page mirroring standard PHY registers for that variant.
Given that, there is now justification left to keep this abstraction.
Drop it for now. If needed in the future, it can be added back with a
proper user then.
Link: https://github.com/openwrt/openwrt/pull/24494
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Drop a useless debug print that 838x_probe still has.
Also move the pcs_config print informing about the configuration to the
end of the configuration, now just showing up after the SerDes has been
configured successfully, not upfront.
Link: https://github.com/openwrt/openwrt/pull/24494
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
There are still several pr_* prints in the driver, however using dev_*
equivalents are preferred. They add information about the attached
device. Switch all remaining pr_* calls to dev_*, adjusting the log
level of some of them to something more accurate (e.g. info -> debug,
info -> error).
Link: https://github.com/openwrt/openwrt/pull/24494
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Some comments have some unneeded information included, especially those
naming register fields often carrying CFG_ or REGX_ prefixes. They add
nothing useful to the purpose of a field. Drop them to slim down those
comments a bit.
Also adjust and drop some comments not needed anymore, mostly since the
information is already preserved elsewhere.
Link: https://github.com/openwrt/openwrt/pull/24494
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
kmod-usb-hid, kmod-sound-core, and kmod-sound-arm-bcm2835 are
currently forced onto every bcm27xx image regardless of use case.
Move them into two new opt-in meta-packages, kmod-bcm27xx-hid and
kmod-bcm27xx-sound, filed under the input and sound submenus
respectively, following the same pattern as kmod-bcm27xx-i2c/-spi.
Still available via apk or menuconfig, just no longer default.
Signed-off-by: Joshua Covington <joshuacov@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/24244
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Several Device/* stanzas in image/Makefile repeat the same WiFi
firmware, WiFi driver, and LAN package lists verbatim --
Device/rpi-2 and Device/rpi-3 have byte-for-byte identical
DEVICE_PACKAGES blocks, and Device/rpi-4/Device/rpi-5 share the
same additional Ethernet trio.
Factor these into shared variables (WIFI_43430_FW, WIFI_43455_FW,
BRCM_WIFI_DRIVER, LAN_DRIVERS) so each device's actual package
list is defined once and reused, rather than copy-pasted across
five stanzas. No functional change: every device's final resolved
DEVICE_PACKAGES list is identical to before this patch.
Signed-off-by: Joshua Covington <joshuacov@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/24244
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Each bcm27xx generation needs a different combination of I2C/SPI
kernel modules -- bcm2708/2709/2710 use only the classic BCM2835
controllers, bcm2711 adds i2c-brcmstb, and bcm2712 additionally
needs the RP1-attached DesignWare controllers (i2c-designware-platform,
spi-dw-mmio) while lacking the classic Aux SPI block entirely.
Rather than requiring users to know which specific driver
combination their board needs, or baking that combination into
every device's default image regardless of whether I2C/SPI is
actually used, add two small meta-packages that resolve the
correct set automatically based on the selected subtarget:
- kmod-bcm27xx-i2c, added to target/linux/bcm27xx/modules/i2c.mk
- kmod-bcm27xx-spi, added to target/linux/bcm27xx/modules/spi.mk
Installing either pulls in exactly the right underlying kmods for
whichever bcm27xx board is being built.
Remove the now-redundant hardcoded i2c/spi kmod-* entries from
Device/rpi, Device/rpi-2, Device/rpi-3, Device/rpi-4 and Device/rpi-5
in image/Makefile.
Signed-off-by: Joshua Covington <joshuacov@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/24244
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Further trim leftover hardware support inherited from other SoCs
and reference designs that don't apply to bcm2712: Broadcom
set-top-box (BRCMSTB/BCMA) support, and unrelated third-party
silicon (Microchip PHY/PCIe host, SMSC PHY, PLDA PCIe host,
Cadence MACB's PCI wrapper).
Keep CONFIG_ARCH_BRCMSTB and CONFIG_RTC_DRV_RPI enabled: the CM5's
firmware-backed RTC depends on this switch despite being unrelated
to actual set-top-box hardware. CONFIG_SOC_BRCMSTB/SOC_BUS/GLOB
also remain, pulled in via PHY_BRCM_USB's dependency chain.
Signed-off-by: Joshua Covington <joshuacov@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/24244
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Follow-up changes to the bcm2712 kernel config:
- Drop CONFIG_COMMON_CLK_XGENE and CONFIG_DMA_BCM2708, not
applicable to this SoC
- Enable CONFIG_MISC_RP1, which loads RP1's device-tree overlay.
Also enable CONFIG_PCI_DYNAMIC_OF_NODES (listed for clarity).
Signed-off-by: Joshua Covington <joshuacov@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/24244
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Enable a set of standard kernel hardening options on both the
bcm2711 and bcm2712 targets to reduce attack surface:
- Enable KASLR (CONFIG_RANDOMIZE_BASE) and module ASLR
(CONFIG_RANDOMIZE_MODULE_REGION_FULL)
- Enable Seccomp sandboxing support
- Disable Magic SysRq (CONFIG_MAGIC_SYSRQ /
CONFIG_MAGIC_SYSRQ_DEFAULT_ENABLE)
- Enable ARM64 Branch Target Identification (CONFIG_ARM64_BTI) on
bcm2712, restricting indirect branches to valid function-entry
landing pads to harden against ROP/JOP-style control-flow attacks
- Clean up related fault-injection config leftovers
- Drop CONFIG_PADATA, orphaned once its only selector
(CONFIG_DEFERRED_STRUCT_PAGE_INIT) was found unset in this config
Signed-off-by: Joshua Covington <joshuacov@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/24244
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
The EN7528 integrates an MT7530 Gigabit switch, memory-mapped in the SoC
register space like the built-in switches of the MediaTek MT7988 and
Airoha EN7581/AN7583 SoCs. Its chip revision register reads 0x7530, so
unlike those three it is a genuine MT7530 core rather than an MT7531
derivative.
Until now the out-of-tree econet-eth driver programmed it as a flat
"dumb switch" that simply bridged the four LAN ports together and
exposed them as a single eth0. Hand it to the upstream mt7530 DSA
driver instead, so the ports come up as managed user ports lan1-lan4.
- Add an ID_EN7528 variant to the mt7530 driver, bound through the MMIO
glue with the "econet,en7528-switch" compatible. It reuses
mt7988_setup() and the indirect PHY accessors, but selects the CPU
port through the MT7530-style MFC register rather than the MT7531 CFC
one, and describes the CPU port as a fixed 1000FDX link to the SoC
MAC. The LAN GPHYs advertise EEE, but negotiating it drops frames
with some link partners, so the LPI capabilities are left empty and
phylink keeps EEE off.
- The frame engine and the switch are adjacent but separate blocks. The
ethernet node used to describe a single 64K window covering both,
which overlaps the switch node and makes the two drivers fight over
the region. Size it to the frame engine alone (0x8000) and give the
switch its own node, so both keep an exclusive claim:
1fb50000-1fb57fff : 1fb50000.ethernet
1fb58000-1fb5ffff : 1fb58000.switch
The GSW reset moves to the switch node with it.
- econet-eth acts as the DSA conduit. It derives from the size of its
own register resource whether the window still covers the switch, and
when it does not, skips the dumb-switch setup and the switch
source-MAC write. The econet-eth driver now carries this support, so
bump PKG_SOURCE_VERSION to pull it in. EN751221 and EN751627 keep
the full window and are unaffected.
- Enable the switch on the DASAN H660GM-A. The two variants share a
board, but their sockets are not numbered the same way: LAN1 is
switch port 1 on the Airtel unit and port 4 on the generic one, so
the port labels are assigned per board .dts.
Signed-off-by: Ahmed Naseef <naseefkm@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/24199
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
This commit introduces OpenWrt U-Boot UBI layout support
for the COMFAST CF-WR632AX, enabling:
- Prolonged device lifetime by allocating most of the flash
to UBI (which takes care of wear-leveling)
- Maximum available storage space for OpenWrt
- Fully-featured U-Boot
- Effective recovery mechanisms
OpenWrt U-Boot UBI flash instructions
-------------------------------------
A device running stock firmware should be upgraded to the
latest standard OpenWrt firmware
(https://firmware-selector.openwrt.org/?target=mediatek%2Ffilogic&id=comfast_cf-wr632ax).
Back up critical data
---------------------
Console:
1. While the device is running OpenWrt with stock MTD partitions:
mtd dump BL2 > /tmp/BL2.bin
mtd dump u-boot-env > /tmp/u-boot-env.bin
mtd dump Factory > /tmp/Factory.bin
mtd dump FIP > /tmp/FIP.bin
2. Copy the backup files to your PC via SCP.
LuCI Web-UI:
"System" -> "Backup / Flash Firmware" -> "Save mtdblock contents"
Save mtdblock:
BL2
u-boot-env
Factory
FIP
Make sure the files were successfully downloaded to your downloads directory,
especially the Factory file.
Using the installer image
-------------------------
To simplify the installation process, this method uses a fork
of Daniel Golle's (@dangowrt) UBI Installer
https://github.com/dangowrt/owrt-ubi-installer
1. Ensure your router is running the latest generic OpenWrt firmware.
Upgrade it if necessary.
2. Obtain the installer image:
Build the installer from source
https://github.com/andros-ua/owrt-ubi-installer/tree/cf-wr632ax
or download a prebuilt image from the
https://github.com/andros-ua/owrt-ubi-installer/releases
3. Flash the openwrt*-ubi-initramfs-recovery-installer.itb
image using sysupgrade.
4. Wait for installation: the green status LED will blink rapidly,
indicating that the all-in-UBI installer is running.
5. Once the installation finishes,
the status LED will turn solid amber for 5 seconds.
6. After the device reboots, perform a final sysupgrade using the
openwrt*-ubi-squashfs-sysupgrade.itb image.
Return to stock MTD
-------------------
1. Flash openwrt*comfast_cf-wr632ax-initramfs-kernel.bin
via sysupgrade
2. Copy files to /tmp on the device via SCP:
BL2.bin
u-boot-env.bin
Factory.bin
FIP.bin
openwrt*-squashfs-sysupgrade.bin
3. Restore stock MTD partitions:
apk add kmod-mtd-rw
insmod mtd-rw i_want_a_brick=1
mtd write /tmp/BL2.bin BL2
mtd write /tmp/u-boot-env.bin u-boot-env
mtd write /tmp/Factory.bin Factory
mtd write /tmp/FIP.bin FIP
4. Install the system:
sysupgrade /tmp/*sysupgrade.bin
BL2 and FIP Recovery
--------------------
Use mtk_uartboot to recover corrupted BL2 or FIP via UART:
https://github.com/981213/mtk_uartboot
Stock layout
----------------------------------------
| dev: size erasesize name |
| mtd0: 00100000 00020000 "BL2" |
| mtd1: 00080000 00020000 "u-boot-env" |
| mtd2: 00200000 00020000 "Factory" |
| mtd3: 00200000 00020000 "FIP" |
| mtd4: 07000000 00020000 "ubi" |
----------------------------------------
OpenWrt U-Boot UBI layout
----------------------------------
| dev: size erasesize name |
| mtd0: 00100000 00020000 "bl2" |
| mtd1: 07f00000 00020000 "ubi" |
----------------------------------
Signed-off-by: Andrii Kuiukoff <andros.ua@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/23981
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Add an OpenWrt U-Boot ("UBI") layout variant for the TP-Link Archer
BE450. It replaces the vendor bootloader and the stock dual-image
layout with a single large UBI partition, extending the usable flash
to around 95 MiB, and ships a current U-Boot with TFTP recovery.
Hardware
--------
SoC: MediaTek MT7988D (Filogic 880)
Wi-Fi: MediaTek MT7992AV (BE7200, 2.4/5 GHz)
Flash: 128 MiB SPI-NAND
RAM: 512 MiB DDR4
Serial: 115200 8N1, header located next to the heatsink:
heatsink
| |
| |
| | +----+-----+------+-------+ +-----------------+
| | | TX | RX | GND | +3.3V | | power connector |
+---+ +----+-----+------+-------+ +-----------------+
|
Don't connect ----+
MAC addresses
-------------
The label MAC (base) is stored in tp_data/default-mac and is written
into the factory partition at offset 0x4 during installation:
eth0 (LAN): base (factory 0x4)
eth1 (WAN): base + 1
eth2 (LAN): base + 2
Wi-Fi: derived by mt76 from the factory EEPROM (2.4 GHz = base,
5 GHz = base with bit 0x10 set), matching the stock
layout behaviour.
Installation
------------
Requires a serial connection and a TFTP server. The device must be
running the stock-layout OpenWrt (tplink_be450) build.
1. From the running stock-layout OpenWrt, back up the vendor
bootloader and the calibration/MAC data. These cannot be
recovered otherwise:
cat /dev/mtd0 > /tmp/boot.bin
cat /dev/mtd5 > /tmp/tp_data.bin
scp /tmp/boot.bin /tmp/tp_data.bin user@pc:backup/
scp -r /tmp/tp_data user@pc:backup/
Store boot.bin, tp_data.bin and the tp_data file contents
(MT7992_EEPROM.bin, default-mac) somewhere safe.
2. Boot the UBI-layout initramfs. Connect the PC to one of the LAN ports
(LAN1-3) and serve the recovery image from a TFTP server on the PC at
192.168.1.2. Interrupt the vendor U-Boot on the serial console
(Ctrl+C), then:
setenv serverip 192.168.1.2
tftpboot 0x50000000 openwrt-mediatek-filogic-tplink_be450-ubi-initramfs-recovery.itb
bootm 0x50000000
3. Copy the required files to the booted initramfs (192.168.1.1):
scp -O MT7992_EEPROM.bin default-mac \
openwrt-mediatek-filogic-tplink_be450-ubi-bl31-uboot.fip \
openwrt-mediatek-filogic-tplink_be450-ubi-preloader.bin \
openwrt-mediatek-filogic-tplink_be450-ubi-squashfs-sysupgrade.itb \
root@192.168.1.1:/tmp
4. Build the factory image from the EEPROM and MAC data:
cd /tmp
dd if=/dev/zero bs=$((0x100000)) count=1 | tr '\000' '\377' > factory.bin
dd if=MT7992_EEPROM.bin of=factory.bin bs=1 count=$((0x1e00)) conv=notrunc
dd if=default-mac of=factory.bin bs=1 seek=4 conv=notrunc
5. Create the UBI volumes. Warning: this permanently erases the
remaining vendor data, including tp_data - only proceed with the
backups from step 1 stored safely:
ubidetach -p /dev/mtd2
ubiformat /dev/mtd2 -y
ubiattach -p /dev/mtd2
ubimkvol /dev/ubi0 -N fip -t static -s 2MiB
ubiupdatevol /dev/ubi0_0 /tmp/openwrt-mediatek-filogic-tplink_be450-ubi-bl31-uboot.fip
ubimkvol /dev/ubi0 -N ubootenv -s 0x1f000
ubimkvol /dev/ubi0 -N ubootenv2 -s 0x1f000
6. Write the factory data and the BL2 preloader. kmod-mtd-rw is
required to lift the read-only protection of the bl2 partition;
set up internet access first or upload the package manually:
apk update && apk add kmod-mtd-rw
insmod mtd-rw i_want_a_brick=1
mtd erase factory
mtd write /tmp/factory.bin factory
mtd erase bl2
mtd write /tmp/openwrt-mediatek-filogic-tplink_be450-ubi-preloader.bin bl2
7. Flash the system:
sysupgrade -n /tmp/openwrt-mediatek-filogic-tplink_be450-ubi-squashfs-sysupgrade.itb
Revert to stock firmware
------------------------
1. From the UBI-layout OpenWrt, force-flash the stock-layout OpenWrt
(tplink_be450) initramfs image; the board name differs, so
sysupgrade must be forced:
sysupgrade -F -n openwrt-mediatek-filogic-tplink_be450-initramfs-kernel.bin
2. After booting into that initramfs, set up network access, copy
boot.bin and tp_data.bin from the backup to /tmp and restore the
vendor bootloader and data:
apk update && apk add kmod-mtd-rw
insmod mtd-rw i_want_a_brick=1
mtd erase boot
mtd write /tmp/boot.bin boot
mtd erase ubi0
mtd erase ubi1
mtd erase userconfig
mtd erase tp_data
mtd write /tmp/tp_data.bin tp_data
3. Verify the tp_data restore before rebooting - without it the
device has no ethernet:
md5sum /tmp/tp_data.bin
md5sum /dev/mtd5
If the checksums match, reboot. The vendor U-Boot web recovery
comes up on 192.168.1.1; flash the TP-Link stock firmware from
there.
Signed-off-by: Emre Yavuzalp <emreyavuzalp2@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/23211
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Add a U-Boot replacement loader for the TP-Link Archer BE450
(MT7988D, 128 MiB SPI-NAND). BL2 boots from spim-nand-ubi with DDR4;
the FIP and the redundant environment are stored in UBI volumes.
This replaces the vendor bootloader and the stock dual-image layout
with a single large UBI partition, freeing around 95 MiB of flash for
OpenWrt. The vendor layout keeps BL2 at flash offset 0x0, which is
where snand_write_bl2 places the first of its four redundant copies.
Signed-off-by: Emre Yavuzalp <emreyavuzalp2@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/23211
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Specifications
--------------
- SoC : Qualcomm IPQ4019 (4x ARMv7 Cortex-A7 @ 716 MHz, NEON/VFPv4)
- RAM : 256 MiB DDR3
- SPI-NOR : Macronix MX25L1606E (2 MiB) - bootloader + ART calibration
- SPI-NAND : Winbond W25M02GV (256 MiB, dual-die) - kernel + rootfs (UBI)
- WLAN : IPQ4019 on-chip, 2 radios
- 2.4 GHz : 2x2 802.11b/g/n (wifi0)
- 5 GHz : 2x2 802.11n/ac (wifi1)
- Ethernet : 1x RJ45 via QCA8075 PHY, jack wired to switch port 5
- TPM : Atmel AT97SC3204T on i2c @ 0x29
- Buttons : 1x Reset (gpio2, active low)
- LEDs : green (gpio3, power), red (gpio4, status / panic)
- UART : 115200 8N1 3.3V (gpio60 TX / gpio61 RX)
- Power : DC 12V
MAC addresses
-------------
Read from the ART partition on SPI-NOR flash at offset 0x0,
encoded as a nvmem cell in the DTS.
Flash layout
------------
SPI-NOR (2 MiB) carries the QCA bootloader chain and ART:
SBL1 0x000000 256 KiB (bootloader stage 1)
MIBIB 0x040000 128 KiB (flash partition table)
QSEE 0x060000 384 KiB (TrustZone / secure env)
CDT 0x0c0000 64 KiB (configuration data tbl)
DDRPARAMS 0x0d0000 64 KiB (DDR training parameters)
APPSBLENV 0x0e0000 64 KiB (U-Boot environment)
APPSBL 0x0f0000 512 KiB (U-Boot)
ART 0x170000 64 KiB (WiFi calibration + MAC)
The W25M02GV SPI-NAND is split at the die boundary
(die 0 = rootfs, die 1 = data) to work around a stock U-Boot bug:
the die-select is broken, causing reads from die 1 to return
0xFF. If UBI wear-leveling relocated the layout volume to
die 1, U-Boot would fail to attach UBI, bricking boot.
Splitting the chip keeps all UBI metadata U-Boot reads from
die 0.
Stock U-Boot hardcodes the UBI attach window to 64 MiB;
the bootcmd replacement expands it to 128 MiB to use the
full die 0.
rootfs 0x00000000 128 MiB
data 0x08000000 128 MiB
Installation
------------
1. Build image for sophos_apx120 target
2. Start TFTP server in folder with
openwrt-ipq40xx-generic-sophos_apx120-initramfs-
uImage.itb
3. Plug in Serial TTL Adapter (115200 baud):
| APX 120 | VCC | RX | GND | TX |
|--------|------|-----|-----|-----|
| USB | X | TX | GND | RX |
|--------|------|-----|-----|-----|
3. Short U26 pin 8 (first pin on left, top row on NAND
Chip, with ethernet port facing you) to ground for a
fraction of a second during power-on. Expected output shows
NAND detection and CRC warning, then U-Boot prompt.
4. In U-Boot run:
$ setenv bootdelay 5
$ setenv verify no
$ saveenv
$ tftpboot 0x84000000
openwrt-ipq40xx-generic-sophos_apx120-initramfs-uImage.itb
$ bootm 0x84000000
5. Setup Networking Transfer the sysupgrade image using a
HTTP server or scp
6. In OpenWrt run:
$ fw_setenv bootcmd 'set fdt_high 0x87000000 && \
set bootargs ubi.mtd=rootfs root=mtd:ubi_rootfs \
rootfstype=squashfs rootwait && nand device 1 && \
set mtdids nand1=nand1 && set mtdparts \
mtdparts=nand1:0x8000000@0x0(fs) && \
ubi part fs && ubi read 0x84000000 kernel && \
bootm 0x84000000#config@ap.dk01.1-c2'
$ ubiformat /dev/mtd9 -y
$ sysupgrade -n
openwrt-ipq40xx-generic-sophos_apx120-squashfs-sysupgrade.bin
7. Device should reboot into OpenWrt
Notes
-----
- With firmware version 1.0.019, the image drops directly
into a shell, so NAND glitching may be skipped.
- The platform sysupgrade script reflashes the entire
die-0 UBI partition via `ubiformat` — live volume
manipulation would leave the UBI layout in a state the
stock U-Boot rejects, which bricks the device.
Known Issues
------------
- Some device revisions have an TPM chip that
is not detected/supported or is broken
Signed-off-by: Morice Olbert <synapse7062@spnkr.de>
Link: https://github.com/openwrt/openwrt/pull/24328
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Rename all 942-* backport patches for the Realtek rtl8365mb DSA driver
to prefix the kernel version with "v" (e.g. v7.2 instead of 7.2),
matching the naming convention used elsewhere for backport patches.
Affected patches:
- 942-01: use ERR_PTR
- 942-02: reject unsupported topology
- 942-03: use dsa helpers for port isolation
- 942-04: prepare for multiple sources
- 942-05: add table lookup interface
- 942-06: add VLAN support
- 942-07: add FDB support
- 942-08: add port_bridge_join/leave
- 942-09: add bridge port flags
No functional changes.
Signed-off-by: Mieczyslaw Nalewaj <namiltd@yahoo.com>
Link: https://github.com/openwrt/openwrt/pull/24483
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Update to a newer bugfix release of gettext.
This version includes a commit to make adjustments
according to changes in gnulib in early 2025.
Add DEPENDS variable to package definition
in order to enforce the correct build order,
which should have been done when libunistring
and libxml2 packages were moved to openwrt core.
No patch requires refresh.
Signed-off-by: Michael Pratt <mcpratt@pm.me>
Link: https://github.com/openwrt/openwrt/pull/24247
Signed-off-by: Robert Marko <robimarko@gmail.com>
Backport a patch that covers a build problem with latest glibc
being used as the host standard C library during tools build.
The C23 standard changes some functions that used to drop qualifiers
like "const" or "volatile" and are now forced to preserve them
in the return type based on the input type at all times.
Developers of glibc have responded by making these functions
into macros after they are declared with prototypes.
This is not compatible with the way gnulib is written,
so when the functions are redeclared in gnulib,
the preprocessor expands the _function name_ itself
as if it is a macro name, but not fully,
which results in unusual looking build errors,
e.g. the failed processing of keywords that were never written
and have no business being in a prototype, or,
as a keyword that is expected to be there and nearly guarenteed
to work but mysteriously is not working, displayed as:
"error: expected identifier or '(' before _____".
The backport patch introduces and implements a new macro
in order to prevent function names from being interpreted as macros,
by wrapping it in parentheses for C, or simply placing it back for C++
in the first stage of macro expansion which satisfies the goal
of no further expansion taking place during preprocessing.
Add an additional patch for the functions declared
in the fts header, as this bug also applies to them,
however, this was overlooked by upstream gnulib,
likely because the bug is not presenting as an error.
Yet another patch corrects the order between
specifiers and attributes in GCC syntax for header
lib/fts.in.h which can be blamed on an upstream commit.
Specifically, the throw() or noexcept() keywords
must be before attributes at the end of a declaration.
There are two headers, lib/cdefs.h and lib/getopt-ext.h
that already demonstrate the correct order which is very
strictly necessary in the latest version of GCC
when compiling C++ code, and acceptable for C code,
as the "__THROW" macro is simply another attribute in that case.
Added backport patch:
- 400-c23-qualifier-generic.patch
Added pending patch:
- 410-unmacro-fts-functions.patch
- 450-attribute-specifier-order.patch
Ref: 80e5de158316 ("fts: Improve GCC 11 allocation-deallocation checking.") # gnulib.git
Reported-by: Aditya Nugraha <vortexilation@gmail.com>
Signed-off-by: Michael Pratt <mcpratt@pm.me>
Link: https://github.com/openwrt/openwrt/pull/24247
Signed-off-by: Robert Marko <robimarko@gmail.com>
Move to the July 2026 update of the last 2025 stable branch.
This branch includes many new modules and changes to modules
that were previously patched, so many patches are dropped.
Newer gnulib now also has a proper fts header
in the form of a template file for variable definitions
that are set during configuration,
however, it still ends up named with an underscore,
so the patch 120-unmangle-darwin-fts-h.patch
in order to resolve differences between macOS and standard
fts headers is rewritten to patch the new header include guard
and the fts module file in order to name it without an underscore.
Manually Adjusted Patch:
- 120-unmangle-darwin-fts-h.patch
All other patches are automatically refreshed.
Signed-off-by: Michael Pratt <mcpratt@pm.me>
Link: https://github.com/openwrt/openwrt/pull/24247
Signed-off-by: Robert Marko <robimarko@gmail.com>
Now that cond.m4 is not being overwritten and is actively used,
make it less aggressive on encountering an undefined conditional
not set by a macro which is itself conditionally called,
where the condition is set to intentionally not trigger the macro.
This prevents the need to further patch a configure.ac file
to edit the improper usage of or remove a disabled macro
which triggers the error "conditional ___ is not defined..."
in the cases where autoreconf is still necessary for another reason,
or, if this is the only build issue,
autoreconf can now be used to avoid this.
Instead of erroring, align the behavior of AM_CONDITIONAL
closer to the gnulib variant gl_CONDITIONAL
which ignores and disables the conditional in this case.
Signed-off-by: Michael Pratt <mcpratt@pm.me>
Link: https://github.com/openwrt/openwrt/pull/24362
Signed-off-by: Robert Marko <robimarko@gmail.com>
Linus Torvalds released the next kernel after 6.19 as version 7.0
instead of 6.20. Rename the backported patch files accordingly so
their names correctly reflect the upstream release they originate
from. This is a pure rename (100% similarity), no functional changes.
Affected targets:
- microchipsw (patches-6.18)
- qualcommax (patches-6.12, patches-6.18)
Signed-off-by: Mieczyslaw Nalewaj <namiltd@yahoo.com>
Link: https://github.com/openwrt/openwrt/pull/24491
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
After switching to the 6.18 kernel, they are no longer built due
to 3 MiB kernel size limitation.
Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
Link: https://github.com/openwrt/openwrt/pull/24455
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
hostapd changed the configuration of basic and supported rates to a
per-bss setting. This left the current phy global settings unapplied.
Apply the rate settings in uci on each VAP of a PHY.
In the future, this setting can theoretically also be set per-bss
in uci. However it is not part of this patch.
Link: https://git.w1.fi/cgit/hostap/commit/?id=f7be1b53852a069f0d15eb471a6f9158467ab117
Signed-off-by: David Bauer <mail@david-bauer.net>
Fix and improve support for AN7583. Muxing of SPI, MDIO and I2C is
now fully supported and working.
Fix I2C1 in master mode on AN7581. (this allows to replace the i2c-gpio
driver on Nokia Valyrian with the proper i2c-mt7621 driver).
Fix non-working switching of GPIO direction if GPIO control register were
already modified by bootloader and pinctrl would create a reserved
state. All GPIO control registers have two bits per GPIO but the driver
only set one which is now fixed.
Fix problem were a pinmux config or GPIO mode cannot be applied if pin
control register were already modified by bootloader. The driver expects
all pin control registers to have their reset default value. Now the
driver forces that reset default value during probe.
Worth to mention that on AN7583 the GPIO mode and alternate pin modes
are reversed in the reset default value. To achieve same behaviour as on
AN7581 (GPIO mode by default, board DTS applies pinmux), the default
value enforced during probe enables all GPIO mode bits. As consequence
all AN7583 board DTS need to explicitely activate mdio0 or spi pin
groups.
Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/24267
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Backport missing pinctrl patches that has been accepted in Linux
v6.19 and v7.2.
This includes moving the Airoha pinctrl driver from
drivers/pinctrl/mediatek to drivers/pinctrl/airoha. Due to this,
all existing pinctrl patches needed a refresh.
Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/24267
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>