Refactor how OVERRIDE_UBI_START_ADDR is passed to the TF-A build system.
Instead of using hardcoded string matches against the $(PLAT) variable
inside global make flags, move the UBI start address directly into
target-specific definition blocks using a new UBI_START_ADDR variable.
This aligns the UBI partition boundary setup with how FIP_OFFSET and
FIP_SIZE are cleanly tracked across different MediaTek SoCs.
Signed-off-by: Mikhail Zhilkin <csharper2005@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/25278
Signed-off-by: Robert Marko <robimarko@gmail.com>
Define the factory pre-calibration data partition at offset 0x1010 and
pass it to the wifi node via nvmem-cells. This ensures the mt7986
wireless hardware can properly utilize factory-calibrated RF settings.
Signed-off-by: Mikhail Zhilkin <csharper2005@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/25278
Signed-off-by: Robert Marko <robimarko@gmail.com>
Increase the spi-max-frequency from 20MHz to 52MHz for the SPI-NAND flash
on the ASUS RT-AX59U. The underlying Winbond W25N01KV chip natively
supports up to 104MHz, and the MediaTek MT7986A SoC safely handles 52MHz.
It's also 52 MHz in the stock U-Boot:
...
spi-max-frequency = <0x3197500>;
...
Testing with 'dd' reading 16MB from /dev/mtd1 shows a significant
performance improvement (~48% reduction in read time):
Before (20MHz):
256+0 records in
256+0 records out
real 0m 2.86s
After (52MHz):
256+0 records in
256+0 records out
real 0m 1.50s
Signed-off-by: Mikhail Zhilkin <csharper2005@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/25278
Signed-off-by: Robert Marko <robimarko@gmail.com>
GL.iNet GL-X2000 (Spitz Plus) is a dual-SIM 4G LTE Wi-Fi 6 router.
Specifications:
SoC: Qualcomm IPQ5018, dual-core Cortex-A53 @ 1.0 GHz
RAM: 512 MiB DDR3
Flash: 128 MiB SPI NAND (Winbond W25N01GWZEIG)
WLAN: IPQ5018 2x2 2.4 GHz, QCN6122 2x2 5 GHz (802.11ax)
Ethernet: 1x GbE WAN (IPQ5018 internal GE PHY)
1x GbE LAN (Atheros AR8031, SGMII)
WWAN: Quectel EG120K-EA, LTE Cat.12, USB 3.0 SuperSpeed
USB: 1x USB 2.0 host behind an internal hub
Buttons: reset
LEDs: power, internet, 2.4G, 5G, 4x signal strength
Serial: 3v3 TTL, 115200 8N1; 4-pin header labelled GND/RX/TX/3V3 on
the mainboard, under the Quectel module in the top right
corner. The case opens after pulling the four rubber feet
Power: DC 9-35 V, shipped with a 12 V 2.5 A supply
Misc: PWM fan, dual SIM slots (muxed inside the modem)
The base MAC address is stored at offset 0x6 of the 0:art partition; the
first six bytes are erased, which is why U-Boot reports the ART address as
invalid. WAN uses the base address (this is the one on the label), LAN
base+1, the 2.4 GHz radio base+2 and the 5 GHz radio base+3. The ethernet
addresses come from nvmem cells. The board deliberately has no ethernetN
aliases: GL.iNet's U-Boot uses them to write its own mac-address
properties into both GMAC nodes (a placeholder for WAN, the base address
for LAN), which of_get_mac_address() would prefer over the nvmem cells.
The modem enumerates at SuperSpeed and therefore requires the IPQ5018 USB3
UNIPHY, so both usbphy0 and usbphy1 are enabled. uqmi cannot communicate
with this modem, so modemmanager has to be installed separately to use it.
The QCN6122 is wired to the second radio instance, so wifi@b00b040 with
userpd3 is enabled rather than wifi@b00a040: the stock device tree enables
wifi2@/userpd3 and leaves wifi1@/userpd2 disabled. That instance places
its BDF and M3 dump above the default q6 region, so the reserved region
is grown accordingly.
Board data for the two radios is submitted separately to
firmware_qca-wireless. It is taken from the stock firmware's wifi_fw
partition, which is a squashfs image: bdwlan.b24 for the IPQ5018 2.4 GHz
radio and qcn6122/bdwlan.b60 for the QCN6122 5 GHz radio, matching the
qcom,board_id values of 0x24 and 0x60 that the stock device tree assigns
to the respective radios. The two radios require distinct board data;
sharing a single BDF leaves the front-end misconfigured and the affected
radio unable to transmit or receive at usable power.
The device tree started from the initial port by Hostle, was largely
rewritten by georgem83 and further reworked by Andreas Boeckler, published
in the OpenWrt forum thread linked below. It is carried here with fixes for
the WLAN board data, the QCN6122 radio instance, the U-Boot environment
partition and the fan cooling map.
Link: https://forum.openwrt.org/t/plain-openwrt-on-gl-x2000/231554
Installation:
Interrupt the bootloader over serial (115200 8N1) by typing "gl", then
TFTP the initramfs image and boot it:
tftpboot 0x44000000 openwrt-qualcommax-ipq50xx-glinet_gl-x2000-initramfs-uImage.itb
bootm 0x44000000
Then flash the factory image with sysupgrade.
Signed-off-by: Gilberto Conde <gilbertorconde@gmail.com>
The U-Boot script embedded in the GL.iNet QSDK factory image hardcodes
the GL-B3000 flash layout. Replace the UBI offset and size with
placeholders filled in by the gl-qsdk-factory recipe, so other GL.iNet
boards with a different layout can use the same script.
The script is copied under a per-device name, which keeps the FIT
description unchanged and avoids devices overwriting each other's
substituted copy in KDIR_TMP.
Signed-off-by: Gilberto Conde <gilbertorconde@gmail.com>
The pinctrl driver leaves GPIO13's fourth function slot empty, so PWM3
cannot be routed there. The GL.iNet GL-X2000 drives its fan from PWM3 on
GPIO13, and the stock firmware muxes the pin with select value 4:
gpio13 : out low func4 8mA no pull
pin 13 (GPIO_13): 1941010.pwm function pwm3 group gpio13
Select value 4 corresponds to the empty slot, so add pwm3 there and list
gpio13 in pwm3_groups.
Accepted upstream via pinctrl-qcom/for-current, so this can be dropped
once the kernel is bumped to 7.3 or later. The backport carries the
upstream diff unchanged; 0305, which adds gpio30 to pwm3_groups
downstream, is refreshed to apply on top of it.
Link: https://patch.msgid.link/20260921093419.2870168-1-gilbertorconde@gmail.com
Signed-off-by: Gilberto Conde <gilbertorconde@gmail.com>
Two real commits since the previous pin:
mediatek: mt7622: move PMIC init before PLL/DRAM stage
Fixes a hang in DRAM calibration on reboot when cpufreq had lowered
Vcore before the reset, by moving PMIC init earlier so it no longer
depends on the Vcore level left over from the previous boot.
mediatek: mt7981, mt7986, mt7987, mt7988: add SMCCC TRNG support
Implements the standard SMCCC TRNG interface (upstream U-Boot
doesn't support the MTK-specific one, our uboot-mediatek does).
Tested on MT7981 by upstream; not yet verified on the other three
SoCs by upstream.
Mirror hash verified via an independent fresh clone of the pinned
commit.
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
The property dates back to the CAF snps_gmac driver, where it told the
MAC which MDIO bus its PHY was on, and has been carried over from device
to device since the driver was replaced by upstream stmmac in 2015.
Nothing in the tree parses it anymore.
The MDIO bus a PHY lives on is taken from the bus the phy node itself was
registered on, so the phy-handle references do not need the extra hint and
nothing changes functionally by dropping it.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/25453
Signed-off-by: Robert Marko <robimarko@gmail.com>
Several rtw88 USB and SDIO chips do not always report the TX status of a
frame within RTW_TX_PROBE_TIMEOUT (500 ms). The driver then drops the
tracking skbs and warns
rtw_8822bu 3-1:1.0: failed to get tx report from firmware
every one to three seconds on an access point serving clients that use
power save. mac80211 never learns the ACK status of those frames, which
hostapd uses to tell whether a polled station is still there.
Add the pending upstream patch that uses the 2500 ms timeout, so far
applied only to RTL8723DU, for every USB and SDIO device and keeps
500 ms for PCIe. It is adapted to backports 7.2, which does not have
the RTL8723BS condition yet.
Pending upstream, submitted to rtw-next:
https://lore.kernel.org/linux-wireless/20260924004637.9958-1-pkshih@realtek.com/
Tested with backports 6.12.96 on a TP-Link Archer T4U v3 (RTL8812BU,
handled by rtw_8822bu) as a 2.4 GHz AP with six associated clients.
Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/25303
Signed-off-by: Jonas Jelonek <jonas@jonasjelonek.de>
BlueZ creates Bluetooth Low Energy HID devices through uhid, so a
Bluetooth remote or keyboard needs it in addition to kmod-bluetooth.
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
The L2 table dump now lives in l2.c as realtek_otto_l2/fdb and reads
the whole table on every family. Remove the old rtl838x/l2_table copy,
which stopped at half the table on RTL931x and could print stack
contents as trunk data on RTL838x and RTL839x.
The other files in the rtl838x debugfs directory are unchanged.
Tested on an RTL9303 (Hasivo S1100W-8XGT-SE): rtl838x/l2_table is gone
and realtek_otto_l2/fdb lists 150 static FDB entries next to the
learned ones.
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Gennaro Cimmino <gcimmino@rayonra.net>
Link: https://github.com/openwrt/openwrt/pull/25394
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
The only debugfs dump of the L2 table is rtl838x/l2_table in
debugfs.c. It walks fib_entries rows of the hash table and 64 rows of
the CAM, which leaves half of both unread on RTL931x. On RTL838x and
RTL839x its entry is not initialised and the fill functions of those
families never set is_trunk or trunk, so a stack value can be printed
as trunk data and used as an index into the LAG arrays.
Add the dump to l2.c as realtek_otto_l2/fdb, next to realtek_otto_l3.
It takes the row counts of the hash table and the CAM from
otto_table_rows(), so on RTL931x it reads all 32768 hash rows and 128
CAM rows. The upper hash rows are ones the driver already writes: on
RTL931x the second hash block starts at row 16384. The entry is zeroed
for every row, and the walk yields the CPU every 64 rows whether or not
they are valid, where the old loop only reached cond_resched() on a
valid row. The output format is unchanged.
debugfs.c keeps its copy until the next commit.
Tested on an RTL9303 (Hasivo S1100W-8XGT-SE) at this commit, where both
files exist: with 150 static FDB entries added, rtl838x/l2_table and
realtek_otto_l2/fdb listed the same 182 entries on three back-to-back
reads, identical apart from the age of learned entries. Reading the new
file in 64-byte chunks matched a single read, ages aside, and
CONFIG_DEBUG_ATOMIC_SLEEP reported nothing. Not tested on RTL838x,
RTL839x or RTL931x hardware.
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Gennaro Cimmino <gcimmino@rayonra.net>
Link: https://github.com/openwrt/openwrt/pull/25394
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
The L2 debugfs dump walks fib_entries rows of the hash table and a
fixed 64 rows of the CAM. That covers both tables on RTL838x, RTL839x
and RTL930x, but not on RTL931x: otto_table.c maps the RTL9310 L2 table
with 32768 rows and its CAM with 128, while fib_entries stays at 16384
there (its TODO says the code cannot handle 32K). fib_entries also
sizes l2_uc_map and bounds the fdb_dump walk, so raising it is a change
of its own.
Record which otto_table ids hold the L2 hash table and the CAM of each
family, so a dump can take the row counts from otto_table_rows()
instead. Nothing reads the new fields yet, so this is a no-op on all
four families.
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Gennaro Cimmino <gcimmino@rayonra.net>
Link: https://github.com/openwrt/openwrt/pull/25394
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
rtldsa_port_fdb_dump() reuses one uninitialised entry for every row it
reads, but the fill functions do not write every field for every row
type. RTL838x and RTL839x never write is_trunk, so the test that skips
trunk entries reads a stack value for the whole walk and can drop every
hardware entry from bridge fdb show. An L2 multicast row leaves port
and is_static untouched on all families, and vid too on RTL930x and
RTL931x, so it is reported on the port of whatever row came before it.
Zero the entry for every row and report only L2_UNICAST rows, as
mv88e6xxx and b53 do. On RTL838x and RTL839x this skips IP multicast
rows as well. On RTL930x and RTL931x unicast rows are reported as
before, and the driver writes no multicast rows of its own: a static
FDB entry with a multicast MAC, which rtldsa_port_fdb_add() stores as a
unicast row there, reads back as multicast and is no longer reported.
Tested on an RTL9303 (Hasivo S1100W-8XGT-SE), with the L2 table dump of
PR #25394 as the reference and two follow-ups that change only the loop
bounds, which are the same on RTL930x. With 150 static and 16 learned
entries, bridge fdb show listed exactly the 166 unicast rows the
hardware held on user ports. A static FDB entry with a multicast MAC,
present in the table as an L2 multicast row, was not reported on any
user port. Not tested on RTL838x, RTL839x or RTL931x hardware.
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Gennaro Cimmino <gcimmino@rayonra.net>
Link: https://github.com/openwrt/openwrt/pull/25398
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
A prefix route is given its row when its gateway resolves, and until
then it carries the -1 its allocator wrote there. A route with no
gateway to resolve keeps that value for its whole life, and a connected
route is exactly that: nothing routes inside its own subnet, so nothing
ever places it.
Removing one still takes the hardware side of the removal path, because
the test there asks whether the ops can look a route up, not whether
this route was ever written. So the CAM is searched for an entry that
was never in it, and the answer is reported as a fault: on a plain
dual-stack box, "prefix route 192.168.1.0/24 was not in hardware" at
every restart of the network.
The noise is not the whole of it. That search keys on the masked
destination, so a shorter prefix covering the same address answers it,
and the row that comes back is then reported as holding another route -
which it does, and rightly, because it is not this route's row and never
was.
Ask the row the driver recorded instead. Both messages stay for the case
they were written for, a route that was placed and is no longer where
the driver put it, which is the state a half-finished row move leaves
behind.
Assisted-by: Claude:claude-opus-5
Signed-off-by: Gennaro Cimmino <gcimmino@rayonra.net>
Link: https://github.com/openwrt/openwrt/pull/25447
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Programming the routes that were waiting on a neighbour runs the whole
of otto_l3_nexthop_update() inside rcu_read_lock(), and everything it
does there ends in otto_table_acquire(), which takes a mutex.
Where this kernel is built there is no preemptible RCU, so that section
is a preempt_disable(): taking a mutex in it is fine only while the
mutex is free, and the moment it is not, the wait for it is a schedule()
with preemption off. Nothing says so at build time either, since
DEBUG_ATOMIC_SLEEP is off in the generic config and the might_sleep()
that would have complained is compiled out.
The other side of that mutex is not hypothetical. The router MAC, the
four host route tables, the four prefix route tables and the next hop
table are reached through one access register and so share one lock,
and this function writes three of them. The debugfs route dump holds
that same lock across a sweep of 8192 addresses and calls
cond_resched() every 64 rows, which is to say it sleeps with it held,
by design and legitimately. A neighbour resolving while someone reads
that file is all it takes.
Keep the section the rhashtable asks for around the lookup, which is
what needs it, and end it there. The routes the lookup would have walked
are the ones on the driver's own list with that gateway, and the list is
what the rest of this file already walks: the work queue behind every
route added, removed or programmed is single threaded, which is the
invariant the teardown path states and relies on.
Holding ctrl->lock instead was the smaller diff and would have been
wrong: it serialises this driver's insertions, not the rhashtable's own
shrink worker, which is what the RCU section is there for.
Assisted-by: Claude:claude-opus-5
Signed-off-by: Gennaro Cimmino <gcimmino@rayonra.net>
Link: https://github.com/openwrt/openwrt/pull/25447
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
The netevent handler ends by testing an err it never assigns and prints
a netdev warning with whatever the stack left there. Nothing it does can
fail at that point: the work it has just queued is what could, and that
happens somewhere else entirely.
No build says so, because the kernel turns -Wmaybe-uninitialized off for
GCC outside W=2 (scripts/Makefile.extrawarn).
Assisted-by: Claude:claude-opus-5
Signed-off-by: Gennaro Cimmino <gcimmino@rayonra.net>
Link: https://github.com/openwrt/openwrt/pull/25311
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
The current pcie phy driver results in inconsistent failures on PCIe linkup,
different from one boot to another. Doing some testing, it has became clear
that mdio operations are at fault. The mdio seem to require an additional
delay after it has completed an operation and reported status of done. The
mdio ready bit however, is unchanged and so doesn't have any connection to
this "after completion" delay.
Fix the issue by adding an additional delay after regmap polling and remove
MDIO_READY from cond variable as it is unrelated. Change the function name
to rtk_phy_poll_done_and_delay() to go along with the changes. Mostly as a
guess but 10 us is enough delay to fix the inconsistent failures. Tested by
booting an image on rtl9607c machine 4 times and no failed link ups happen.
Add the fsleep() after regmap_read() in rtk_phy_read() as it also triggers
something in phy mdio controller that require the same delay.
Fixes: bb00e9f097 ("realtek: phy: add support for rtl9607c pcie phy")
Signed-off-by: Rustam Adilov <adilov@tutamail.com>
Link: https://github.com/openwrt/openwrt/pull/25412
Signed-off-by: Jonas Jelonek <jonas@jonasjelonek.de>
Enable MACsec (Media Access Control Security) support in the Mellanox
mlx5 driver by setting CONFIG_MLX5_MACSEC=y.
Enabling this configuration allows users to utilize hardware MACsec
offload capabilities on supported Mellanox ConnectX network adapters.
This provides point-to-point Layer 2 encryption at line rate while
significantly reducing CPU overhead.
The kmod-macsec dependency is intentionally omitted to make this an
opt-in feature. The offload support only builds if kmod-macsec is
also selected, preventing driver bloat for standard users.
Signed-off-by: Til Kaiser <mail@tk154.de>
Link: https://github.com/openwrt/openwrt/pull/25400
Signed-off-by: Robert Marko <robimarko@gmail.com>
Rework 711-04-net-dsa-qca8k-no-program-unicast-host-FDB-entries.patch:
host FDB adds on CPU ports are skipped, relying on unknown-unicast
flooding to deliver host-bound frames to the CPU. That assumption
breaks when a station roams from a wired user port onto an interface
behind the CPU (wireless AP and WDS setups): a stale dynamically
learned ATU entry still points at the old user port, so downstream
frames hit it and are dropped by same-port filtering instead of being
flooded to the CPU. With CPU-port hardware learning disabled (assisted
learning), nothing ever corrects the entry - clients roaming onto the
device stay blackholed while the device itself stays reachable.
Purge any dynamically learned ATU entry for {addr, vid} when the host
add is skipped, so the address becomes unknown unicast again - exactly
the delivery mechanism the skip relies on. Static entries are left
untouched, and the companion skip in qca8k_port_fdb_del is kept so
host address removal does not purge legitimately learned entries.
Also refresh ipq40xx's 706 patch for the shifted hunk offsets.
Tested on IPQ4019 (Google WiFi APs): stale entries are purged at
association time and roaming recovers instantly.
Fixes: 9716066e80 ("kernel: add qualcommax patches to generic")
Signed-off-by: Brandon Mahdavi <brandon.mahdavi@mahcom.com>
Link: https://github.com/openwrt/openwrt/pull/24162
Signed-off-by: Jonas Jelonek <jonas@jonasjelonek.de>
Add wired support and an eMMC A/B sysupgrade path for the Linksys LN6001.
Write and verify the inactive kernel/rootfs pair before changing the boot
selectors. Confirm an installed boot by clearing the s_env boot counter
and updating its checksum.
Identify the board as IPQ9554, using the shared ipq9574.dtsi and family
fallback compatible. Disable the absent UNIPHY1 block and provide the
board clocks required by eMMC, MDIO and PWM. Let U-Boot populate memory
size, use the default GPIO-key debounce and allow 10 ms for QCA8081 reset
assertion while retaining the 150 ms deassertion delay. Use decimal 28
for the QCA8081 PHY address. The assertion delay follows the QCA8081
precedent in 904aa43865.
Return to common upgrade cleanup and reboot after safe staging failures,
while stopping on uncertain boot selector state.
Hardware specification:
- SoC: Qualcomm IPQ9554
- RAM: 1 GiB DDR4
- Flash: 8 GB Samsung 8GTF4R eMMC
- Ethernet: four 1 GbE LAN ports through QCA8075 over PSGMII
- Ethernet: one 2.5 GbE WAN port through QCA8081
- LEDs: red, green, blue and white PWM status channels
- Buttons: reset and WPS GPIO keys
- UART: 115200 8N1
- Power: 12 V, 2.5 A
- Wireless and Bluetooth: not enabled
Installation:
The initial installation uses serial access and an OpenWrt RAM boot.
Keep a bootable stock slot and start with that slot selected. The updater
accepts only the observed retail GPT geometry, matching bootconfig copies,
boot_part_ready=3, auto_recovery=yes and matching Wi-Fi firmware slots.
It does not repair an inconsistent layout or selector state.
Copy this image to the TFTP server as ln6001-initramfs.itb:
openwrt-qualcommbe-ipq95xx-linksys_ln6001-initramfs-uImage.itb
Connect Ethernet to LAN4 and configure the TFTP server as 192.168.1.254/24.
Interrupt U-Boot autoboot through the serial console and run:
setenv ipaddr 192.168.1.1
setenv serverip 192.168.1.254
setenv netmask 255.255.255.0
tftp 0x4d100000 ln6001-initramfs.itb
bootm 0x4d100000#config@1
Do not save these temporary network settings or write the initramfs FIT
to eMMC. In RAM-booted OpenWrt, transfer the following image to
/tmp/ln6001-sysupgrade.bin:
openwrt-qualcommbe-ipq95xx-linksys_ln6001-squashfs-sysupgrade.bin
Check the selected slot and validate the image, then install:
fw_printenv boot_part boot_part_ready auto_recovery
sysupgrade -T /tmp/ln6001-sysupgrade.bin
sysupgrade -n /tmp/ln6001-sysupgrade.bin
Run the last command only after validation succeeds. boot_part=1 selects
A and installation writes B; boot_part=2 selects B and installation
writes A. Do not force a failed check. The sysupgrade archive is not a
Linksys web-update image. Subsequent OpenWrt sysupgrades use the same
inactive-slot path; omit -n to request preservation of OpenWrt settings.
Recovery:
The serial TFTP/bootm procedure remains available without depending on
the installed rootfs. Before installation, resetting a RAM-only session
returns to the selected existing firmware. After installation, a normal
reboot uses the newly selected slot and does not itself return to stock.
With consistent selector copies and environment, a recovery RAM boot can
run the same checked sysupgrade path. Inconsistent selectors are rejected;
do not bypass these checks. Keep serial access and a bootable other slot.
Partition and MAC address handling:
Discover the existing GPT at runtime and require the retail partition
labels, starts and sizes before writing. Preserve the GPT, bootloader,
devinfo and both Wi-Fi firmware payloads. The upgrade writes the inactive
HLOS/rootfs pair, then updates both bootconfig selector sectors and the
boot_part environment variable. Successful installed boots clear the
boot counter and update its checksum in s_env after verifying the active
slot. A stale checksum on an already-zero counter is repaired as well.
Read hw_mac_addr from devinfo through read-only block NVMEM. Stock LAN
and WAN use the same base address; assign offset zero to all five wired
ports. Configuration persists in a per-slot F2FS overlay.
Validation:
Retail-hardware testing passed RAM boot with U-Boot supplying 1
GiB RAM, and sysupgrade -n from stock-selected A into B followed
by two successful installed boots. The boot-count record
contained a zero count and valid checksum after both boots. F2FS
remained writable and a UCI setting persisted across reboot.
Kernel/rootfs readback matched the image; full stock A hashes and
non-selector protected partition hashes were unchanged.
LAN4 linked at 1 Gbps. WAN-to-WAN testing against a stock LN6001
negotiated 2500 Mbps full duplex at both ends and recovered to
that rate after cable replug without reboot or interface reset.
Normal and full-MTU IPv6 pings passed without loss before and
after replug. Separate four-stream TCP endpoint tests measured
2.313 Gbit/s received by this image and 2.311 Gbit/s by the peer,
then 2.316 Gbit/s received after replug. These are router-local
tests, not forwarding benchmarks. One RX error at the
disconnected checkpoint did not increase during subsequent
traffic; TX and peer RX/TX error counters remained zero.
Fifteen local synthetic tests cover boot-counter checksum
validation and repair, write/readback failures, upgrade guards
and safe return versus deliberate halt. Seven temporary-file
bootcount test groups also passed on the device. Real boot
selectors were not corrupted for failure tests. Image-macro
checks confirm sysupgrade.bin only with the size guard retained.
Signed-off-by: Satoshi Ikeuchi <satosan.ikm@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/24736
Signed-off-by: Robert Marko <robimarko@gmail.com>
Map the existing 256 KiB u_env eMMC partition for the Linksys LN6001.
This lets the device upgrade path read and update the existing boot-slot
environment through fw_printenv and fw_setenv.
Increment the package release for the functional board-map addition.
Signed-off-by: Satoshi Ikeuchi <satosan.ikm@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/24736
Signed-off-by: Robert Marko <robimarko@gmail.com>
The Netcraze NC-1012 is a rebrand of the Keenetic KN-1012 with identical
hardware. The stock recovery accepts only images signed with the NC-1012
zyimage device id, taken here from the official NC-1012 recovery image.
It shares the KN-1012 device tree through the common dtsi and the copper
and SFP overlays, and the image recipe through the common device define,
following the KN-3411/NC-3411 pattern. The recovery procedure is the
KN-1012 one with the image named NC-1012_recovery.bin.
Assisted-by: LLM
Signed-off-by: Aleksei Sviridkin <f@lex.la>
Link: https://github.com/openwrt/openwrt/pull/24820
Signed-off-by: Jonas Jelonek <jonas@jonasjelonek.de>
Keenetic KN-1012 is a 2.4/5 GHz band 11ax (Wi-Fi 6) router with a
combo SFP/copper port, based on MT7981B.
The copper side of the combo port does not come up on this tree yet. It
needs the pending phylink change that defers the PHY attach for PHYs
marked needs-host-firmware until their driver has bound,
https://lore.kernel.org/r/20260914211137.2760618-1-f@lex.la/, and that
property on the PHY node, which goes in together with the change.
Everything else on the board, the SFP side of the same port included,
works without them.
Specification:
- SoC : MediaTek MT7981B
- RAM : 512 MiB
- Flash : SPI-NAND 256 MiB (chip varies by production run,
Fudan Micro FM25G02B seen)
- WLAN : 2.4/5 GHz 2T2R (MediaTek MT7981B (SoC))
- Ethernet : 4x 10/100/1000 Mbps + 1x combo port
- switch : MediaTek MT7531
- combo port : SFP cage and an Airoha EN8811H 2.5G copper PHY
share one SerDes, selected by a GPIO mux
- USB : USB 2.0 through a GL850G-OHY60 hub, two switchable
power rails
- LEDs/Keys (GPIO): 6x/4x
- UART : through-hole on PCB (J500), unconfirmed
- assignment : 5V, TX, RX, NC, GND
- settings : 115200n8
- Power : 12 VDC, 2.5 A, center positive
The vendor bootloader stays in place, so U-Boot is chainloaded from it
as the payload it accepts as a kernel. It reads the GPIO reporting
whether an SFP module is present and boots the device tree matching the
medium, so one image serves both the copper PHY and the SFP cage. The
chainloader itself is wrapped into a FIT shaped like the vendor kernel
image, kernel@1 / fdt@1 / config@1 with the "Linux 4.9" description,
because the stock loader accepted a payload generated by mkits.sh with
its default node names and descriptions but never ran it. Both vendor
firmware slots (firmware_1, storage_a, firmware_2, storage_b) are
concatenated into one virtual flash, its first 8 MiB the kernel
partition and the rest UBI, so the second slot no longer holds a vendor-
bootable image; u-state stays read-only. The factory image is bounded to
the first firmware slot, where the stock recovery writes it; whether the
recovery writes past that slot is untested.
Flash instruction using the vendor recovery mode:
1. Connect the TFTP host to one of the LAN ports, address 192.168.1.2
2. Rename the factory image to "KN-1012_recovery.bin" and put it in
the TFTP directory
3. Power off the device, hold the "Reset" button, power it on and keep
the button held for ~10 seconds
4. The bootloader downloads the image over TFTP and writes it to flash
5. Wait for the device to reboot, it comes up on 192.168.1.1
Reverting to stock image:
1. Download the official recovery package for the model and take the
.bin image out of it
2. Follow the same steps as above with that image in place of the
OpenWrt one
MAC addresses:
use source
LAN rf-eeprom 0x4
WAN rf-eeprom 0xa, also the address on the label
2g rf-eeprom 0x4, the first MAC slot of the WiFi EEPROM
5g rf-eeprom 0x4 with the locally administered bit set and bit 7
flipped
Left alone, mt76 would read the second EEPROM slot at 0xa for phy1
and collide with the WAN address, so the board joins the Keenetic
family entry in 11_fix_wifi_mac, which derives phy1 from the 0x4 slot
the way mt76 would on its own: LA bit set, bit 7 flipped.
The P and N of the SerDes lane from the switch to the EN8811H are
swapped on this board, like on the BPI-R3 mini, so the copper PHY node
sets rx-polarity to PHY_POL_INVERT, the current form of the
airoha,pnswap-rx property the BPI-R3 mini still carries. Without it the
copper side links up at any speed but transmits nothing, while receive
works.
The copper PHY's INTB is on pio 0 and the PHY node declares it; the
vendor tree hangs the same line on the switch node and calls it level
low. This uses edge falling, as the BPI-R3 mini does for its EN8811H
PHYs. On this tree the line is not used yet: phylib sets phydev->irq to
PHY_POLL when the port attaches the PHY with the generic driver still
bound at switch probe, and nothing restores it when the EN8811H driver
binds later. With the phylink change named at the top and the phylib
change that keeps the interrupt across the driver swap,
https://lore.kernel.org/r/20260919015326.499479-1-f@lex.la/, forced
renegotiations on this board delivered the link-down and link-up events
over INTB and left no interrupt unhandled.
The copper port stays down on this tree because the switch attaches the
PHY at probe, before the EN8811H driver can load its firmware from the
root filesystem, and phylink refuses 2500base-x against the generic
driver, so DSA drops the port. The copper results above were taken with
the phylink change named at the top applied; SFP, lan1 to lan3, WAN and
wifi do not depend on it. The SFP side was booted with a DAC in the
cage: the loader picked the SFP configuration, the module EEPROM read
over I2C, lan4 came up over the cage without the PHY race and the cage's
indicator LED lit; on copper that LED stays off. Link and traffic over
the SFP path stand on the earlier two-tree form of the image, 1 Gbit/s
against a 1 Gbit/s partner, with the module pulled bringing the board
back on copper.
The board support (pin map, SFP node, copper PHY description, image
recipe parameters and LED assignments) is based on the out-of-tree port
by Maxim Anisimov, branch main_keenetic_kn1012 of Linaro1985/openwrt.
The chainloader and the U-Boot side are new relative to that port, as
is the split into a shared dtsi with a device tree overlay per medium,
which the chainloader applies.
Assisted-by: LLM
Signed-off-by: Aleksei Sviridkin <f@lex.la>
Link: https://github.com/openwrt/openwrt/pull/24820
Signed-off-by: Jonas Jelonek <jonas@jonasjelonek.de>
The stock bootloader stays in place, so U-Boot is packaged as the
payload it accepts as a kernel and chainloaded from it.
It brings up NAND through NMBM, reads the kernel FIT from flash and
applies the device tree overlay matching the media present in the combo
port, so a single image serves both the copper PHY and the SFP cage. The
media is sensed on pio 23, the cage's mod-def0, which a seated module
pulls low. The environment tests it with "if gpio input 23", and that
reads as true for a low pin: gpio input returns the pin level as its
exit status.
The SPI-NAND is driven four-bit. The stock loader, shipped in the vendor
SDK as target/linux/mt7981/KN-1012/boot.bin, embeds an FDT whose
spi_nand@0 reads
spi-max-frequency = <0x3197500>;
spi-rx-bus-width = <0x04>;
spi-tx-bus-width = <0x04>;
on the same spi@1100a000 declaring support_quad, tick_dly = <2> and
sample_sel = <0>; MediaTek's own mt7981-rfb device tree carries the
identical pair at the identical 52 MHz. Without the two properties
spi-uclass defaults the slave to one lane and the SPI-NAND core silently
picks the single-bit read variant. The tx width also selects the
four-lane program op, which this build reaches only when NMBM has to
create its management table; the stock loader programs this part
four-bit already.
The same build serves the Keenetic and the Netcraze variant of the
board. The board support commits add a device profile for each brand,
and the two profiles produce differently named images, so the TFTP
recovery loop asks for each name in turn: the board has no populated
console to correct the name from. A single brand-neutral name was
rejected because it would match no built artifact, which breaks the
default tftpboot for both variants rather than for one. The U-Boot
device tree names the board Keenetic KN-1012 for both: the hardware is
the same and the build does not read the brand from flash.
The Kconfig entries the build relies on come as separate patches, and
both stay local: the NMBM symbols belong to the NMBM code this tree
carries, and a MediaTek bool that selects the kernel image header, with
the generic text offset base redeclared under it so the defconfig can
set it, was declined upstream. U-Boot wants a board there instead, and
this board cannot load its OS from upstream U-Boot without NMBM.
The kernel image header carries a text_offset of 0x80000: the stock
kernel FIT loads at 0x48080000, 0x80000 above the 2 MiB base the loader
works from, and the chainloader mirrors that placement. A zero offset,
which TEXT_BASE alone would give, has not been tried on this loader.
Assisted-by: LLM
Signed-off-by: Aleksei Sviridkin <f@lex.la>
Link: https://github.com/openwrt/openwrt/pull/24820
Signed-off-by: Jonas Jelonek <jonas@jonasjelonek.de>
The chip ships on Keenetic KN-1012 units and is not in the fmsh table,
so U-Boot finds no flash at all. Add the ID and geometry, along with the
ECC status decode its 3-bit status field needs and a read-cache list
whose quad-I/O read takes a single dummy byte.
The driver change is ported from Linux commits d5a5c9eb2ee9 ("mtd:
spinand: fmsh: add support for FM25G{01,02}B") and 8211f2d74b35 ("mtd:
spinand: fmsh: fix FM25G01B/FM25G02B Quad I/O read dummy cycles").
Only the FM25G02B entry is carried, the part in hand; the identifiers
keep upstream's FM25G01B names so that the file stays textually in step
with Linux.
Assisted-by: LLM
Signed-off-by: Aleksei Sviridkin <f@lex.la>
Link: https://github.com/openwrt/openwrt/pull/24820
Signed-off-by: Jonas Jelonek <jonas@jonasjelonek.de>
Add support for the CMCC RAX3000Q/QY platform based on Qualcomm IPQ5000.
Both hardware variants are identical and share the same device tree.
Hardware Specifications:
- SoC: Qualcomm IPQ5000
- RAM: 256 MiB, integrated in SoC
- Flash: GigaDevice GD5F1GQ5REYIG (Dosilicon variant is not supported)
- 2.4 GHz Wi-Fi: SoC integrated, with 2 FEMs
- 5 GHz Wi-Fi: QCN6102, with 2 FEMs
- Switch: QCA8337, 1 WAN + 3 LAN
- LEDs: 3 RGB LEDs
- Keys: reset and mesh pairing
- UART: 3-pin, 115200n8
The vendor flash layout is documented and the ART partition contains
calibration data, which must be preserved carefully.
Due to the limited 256 MiB RAM, ath11k is disabled in the DTS to avoid
OOM issues on this device.
The MAC address location in flash could not be identified reliably.
As a temporary workaround, the MAC addresses (WAN LAN 2.4G 5G WiFi) are derived from the ART
partition start, with vendor/default values being invalid and falling
back to random generation if left unchanged (FF).
Flash Guide
Requirements
- UART access (3-pin, 115200n8)
- Ethernet cable
- TFTP server running on your computer
- OpenWrt `.ubi` firmware image
Step 0: Backup all partitions (strongly recommended)
Step 1: Connect UART and interrupt U-Boot
Step 2: Configure PC network
Step 3: Start TFTP server
Step 4: Load firmware via U-Boot
tftpboot 192.168.10.19:<your_firmware>.ubi
Step 5: Flash firmware
flash rootfs
Step 6: Reboot device
reset
Signed-off-by: Mark Jia <mark304188@hotmail.com>
TP-Link EAP650-Outdoor is a 802.11ax AP claiming AX3000 support. It is
wall or pole mountable, and rated for outdoor use. It can only be
powered via PoE.
Specifications:
---------------
* CPU: Qualcomm IPQ5018 Dual core Cortex-A53
* RAM: 512 MB
* Storage: 128MB NAND GigaDevice F50D1G41LB-83YIG2M
* Ethernet: 1x Gigabit RJ45 port with PoE input
* 2.4GHz: IPQ5018 802.11b/g/n/ax (2x 4dBi)
* 5GHz: QCN6024 802.11n/ac/ax (2x 5dBi)
* LEDs: 1x Status LED (Green/Yellow)
* Buttons: 1x Reset
* UART: 4-pin unpopulated header
TX RX GND VCC - JP2 (3.3V, 115200/8)
MAC addresses:
LAN : B0:19:21:xx:xx:02
2.4GHz : B0:19:21:xx:xx:02
5GHz : B0:19:21:xx:xx:03
The procedures to 'backup your stock firmware' and 'stock firmware recovery'
described in the commit "qualcommax: ipq50xx: Add support for Yuncore AX850"
are equivalent for this device.
https://git.openwrt.org/openwrt/openwrt/commit/?id=5d2994a73e20ba840d3096e1ad52add6937fe86d
Installation:
=============
TFTP method
-----------
To flash via tftp, first place the initramfs image on the TFTP server.
setenv serverip <ip of tftp server>
setenv ipaddr <ip in same subnet as tftp server>
tftpboot tplink_eap650-outdoor-v1-initramfs-uImage.itb
bootm
This should boot OpenWRT. Once booted, flash the sysupgrade.bin image
using either luci or the commandline.
Signed-off-by: Samuele Longhi <agave@dracaena.it>
Link: https://github.com/openwrt/openwrt/pull/23056
Signed-off-by: Robert Marko <robimarko@gmail.com>
Backport upstream commit 1c1a342aceec ("mtd: spinand: Do not update
the QE bit on devices without one") to OpenWrt's Linux 6.18 series.
On the Winbond W25N02KV, configuration register bit 0 is H-DIS, not
a QE bit. Clearing it can enable HOLD and cause flash commands to stall.
On the JioRouter JIDU6401, this caused sysupgrade failures and a
subsequent warm reboot hang in BL2.
Upstream commit:
https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git/commit/?id=1c1a342aceec79528b3ba51f376eca2be5928fe7
Validation:
- Patch prepared and refreshed against OpenWrt Linux 6.18.52.
- `target/linux/compile` passed for mediatek/filogic.
- The upstream patch reports successful sysupgrade and warm reboot on
JioRouter JIDU6401 with W25N02KV.
Signed-off-by: Sagnik Sasmal <sagnik@sagnik.me>
Link: https://github.com/openwrt/openwrt/pull/25428
Signed-off-by: Robert Marko <robimarko@gmail.com>
Create a shared dtsi for ELECOM WRC-X3000GS2 and WRC-X3000GST2.
They have the almost identical hardware, except for memory (256M vs.
512M).
Additionally, disable "q6_region" in reserved-memory of WRC-X3000GS2.
This was disabled before, but accidentally activated by 1f879b8839
("qualcommax: ipq50xx: split firmware variants and refactor QCN6122
support").
Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/24937
Signed-off-by: Robert Marko <robimarko@gmail.com>
Some Xiaomi AX6000 (RA72) units use SPI-NAND with page size 2048 and
OOB size 128, requiring ECC strength 8 with step size 512 (matching
stock firmware). Without explicit ECC settings, the kernel defaults
to strength 4, causing UBI ECC errors and a boot loop after
sysupgrade to squashfs on affected units.
Signed-off-by: Sergey Dubow <killerpelmeney@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/24959
Signed-off-by: Robert Marko <robimarko@gmail.com>
Hardware specification:
SoC: MediaTek MT7988D 3x A73
Flash: ESMT F50L1G41LB 128MB
RAM: NT5AD256M16E4 DDR4 512MB
Ethernet: 2x 2.5G + 2x 1G Lan
WiFi1: MT7975N 2.4GHz 4T4R
WiFi2: MT7979N 5GHz 4T5R
Button: Reset, WPS
Power: DC 12V 2A
MAC addresses map:
LAN 4C:xx:xx:xx:xx:57
WAN 4C:xx:xx:xx:xx:58
2G 4C:xx:xx:xx:xx:57
5G 4C:xx:xx:xx:xx:59
Flash instructions:
1. Connect to your PC via the Gigabit port of the router,
set a static ip on the ethernet interface of your PC.
(ip 192.168.1.254, gateway 192.168.1.1)
2. Execute the following operation to open nc shell:
https://forum.openwrt.org/t/tp-link-china-routers-rce-vuln
3. Download the preloader.bin and uboot.fip, host them with
the HTTP server: python3 -m http.server
4. Replace the stock bootloader to OpenWrt's:
ln -sf opt/game_acc/rootfs/bin/busybox wget && cd tmp
/wget http://192.168.1.254:8000/openwrt-mediatek-filogic-tplink_tl-7dr7250-v1-preloader.bin
/wget http://192.168.1.254:8000/openwrt-mediatek-filogic-tplink_tl-7dr7250-v1-bl31-uboot.fip
dd bs=131072 conv=sync of=/dev/mtdblock15 if=openwrt-mediatek-filogic-tplink_tl-7dr7250-v1-preloader.bin
dd bs=131072 conv=sync of=/dev/mtdblock15 seek=44 if=openwrt-mediatek-filogic-tplink_tl-7dr7250-v1-bl31-uboot.fip
5. Download the initramfs image, host it with the tftp server,
and restart the router, waiting for tftp recovery to complete.
6. After openwrt boots up, upload sysupgrade.bin to upgrade.
Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
Link: https://github.com/openwrt/openwrt/pull/24200
Signed-off-by: Jonas Jelonek <jonas@jonasjelonek.de>
Hardware specification:
SoC: MediaTek MT7988D 3x A73
Flash: Dosilicon DS35Q1GB-IB 128MB
RAM: Zentel A3T4GF40BBF DDR3 512MB
Ethernet: 1x 2.5G Wan, 4x 1G Lan
WiFi1: MT7975N 2.4GHz 4T4R
WiFi2: MT7979N 5GHz 4T5R
Button: Reset, WPS
Power: DC 12V 2A
MAC addresses map:
LAN 80:xx:xx:xx:19:FE
WAN 80:xx:xx:xx:19:FF
2G 80:xx:xx:xx:19:FE
5G 80:xx:xx:xx:1A:00
Flash instructions:
1. Connect to your PC via the Gigabit port of the router,
set a static ip on the ethernet interface of your PC.
(ip 192.168.1.254, gateway 192.168.1.1)
2. Execute the following operation to open nc shell:
https://forum.openwrt.org/t/tp-link-china-routers-rce-vuln
3. Download the preloader.bin and uboot.fip, host them with
the HTTP server: python3 -m http.server
4. Replace the stock bootloader to OpenWrt's:
ln -sf opt/game_acc/rootfs/bin/busybox wget && cd tmp
/wget http://192.168.1.254:8000/openwrt-mediatek-filogic-tplink_tl-7dr7230-v2-preloader.bin
/wget http://192.168.1.254:8000/openwrt-mediatek-filogic-tplink_tl-7dr7230-v2-bl31-uboot.fip
dd bs=131072 conv=sync of=/dev/mtdblock15 if=openwrt-mediatek-filogic-tplink_tl-7dr7230-v2-preloader.bin
dd bs=131072 conv=sync of=/dev/mtdblock15 seek=44 if=openwrt-mediatek-filogic-tplink_tl-7dr7230-v2-bl31-uboot.fip
5. Download the initramfs image, host it with the tftp server,
and restart the router, waiting for tftp recovery to complete.
6. After openwrt boots up, upload sysupgrade.bin to upgrade.
Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
Link: https://github.com/openwrt/openwrt/pull/24200
Signed-off-by: Jonas Jelonek <jonas@jonasjelonek.de>