macaddr_init() calls for_each_wdev() to mark the addresses that are in
use. for_each_wdev() kept a wdev only if the radio mask of the wdev named
the radio of the allocation and no other radio. An MLD uses more than one
radio. Therefore no MLD matched, and the address of each MLD stayed free.
The configuration describes the AP MLDs, and the code reserves them with
the configuration. The MLD of the supplicant is different: hostapd is the
only source of its address. The code gave that address a second time, and
the new interface failed to start:
Could not set interface phy0.0-ap1 flags (UP)
Failed to add BSS (BSSID=a2:ad:9f:70:fb:46)
Keep a wdev if it uses the radio, also when it uses other radios.
Signed-off-by: Felix Fietkau <nbd@nbd.name>
iface_reload_config() keeps the MAC address of a BSS. iface_restart()
does not. It removes the assignment and calls macaddr_next() again for
each BSS. macaddr_next() returns the first free address. The result
depends on the order in which the BSSes ask for an address. Therefore a
restart can move the link addresses of an AP MLD.
A non-AP MLD compares the link addresses in the association response
with the addresses it learned. If the addresses differ, the non-AP MLD
drops the association:
RSN: MLO Link 0 MAC address (a6:...:4a) not matching association
response (a2:...:4a)
Take the addresses of the BSSes that survive the restart from the old
configuration. The code builds the set of addresses in use first.
Therefore a BSS gets a new address if another BSS now uses the old one.
Signed-off-by: Felix Fietkau <nbd@nbd.name>
get_sta_ies only consulted the station entry of the queried link, so a
non-AP MLD that associated over another link was reported as unknown even
though get_clients lists it, and the association notification carried the
address of the link entry rather than the MLD MAC address that the rest of
the stack knows the station by. Walk the affiliated links for the entry
holding the frames, and notify with the MLD address.
Signed-off-by: Felix Fietkau <nbd@nbd.name>
The Realtek PSE MCU driver patches have been accepted upstream, being
available in v7.3. Replace the current pending patches with the
backported variants. This requires some additional DTS changes since the
final version differs from what was merged as pending.
Link: https://github.com/openwrt/openwrt/pull/24821
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Backport a series of upstream patches for the adt7470 hwmon driver,
accepted for kernel v7.3. It exposes the fan control lines via the
generic PWM framework and thermal zone sensors.
Instead of relying on userland scripts, the kernel can now control
the fan speed directly through standard cooling maps and PWM fans
configured in the DTS. Currently in the tree, only edgecore_ecs4100-12ph
seems to use this chip.
Signed-off-by: Luiz Angelo Daros de Luca <luizluca@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/24803
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
The JioFiber JCOW407 is an ISP provided GPON ONT and home router, based
on the EcoNet EN7528. The JCOW407-IN is the same board with a
second-source SPI NAND, Winbond W25M02G in place of the Micron
MT29F2G01, and is covered by the same image.
Both share their flash layout, MAC pool, WiFi EEPROM offsets, PCIe
topology, switch and USB with the JioFiber JCOW414 and reuse
en7528_jiofiber.dtsi. The LEDs and buttons are wired differently: the
RGB status LED is on GPIO 2/3/4 rather than 27/25/23, WPS is on GPIO 1
rather than GPIO 4, and the two colours of each LAN jack are swapped,
green on the odd pin and amber on the even one.
Specifications
==============
* SoC: EcoNet EN7528
* RAM: 512MiB DDR3
* Flash: 256MiB SPI NAND (Winbond W25M02G or Micron MT29F2G01)
* WiFi 2.4GHz: MT7603E 2T2R, on PCIe port 0
* WiFi 5GHz: MT7663 2T2R 802.11ac, on PCIe port 1
* Ethernet: 4x 10/100/1000
* LEDs: 1x RGB status (3 GPIOs), plus green and amber per LAN jack
* Buttons: Reset, WPS
* USB: 2x USB ports
* UART: 4-pin header, GND 3.3V RX TX, 115200 8n1
* Other: 1x FXS phone jack, 1 GPON port
Notes
=====
* OpenWrt has to live in the first image slot (tclinux). Which slot the
vendor firmware boots from varies between units. The bootloader
picks the slot from a single ASCII byte at flash offset 0x0DFC0000,
'0' selects tclinux and '1' selects tclinux_slave. If your device is
booting from the second slot, the flag has to be moved after flashing;
see "Switching slots" below.
* The green LAN LEDs are described but stay dark until pinctrl support
lands. This bootloader leaves GPIO 31/33/35/37 muxed to the GPHY LED
function, so writing the GPIO output has no effect. Muxing them back
to GPIO makes all four work as ordinary GPIOs. The amber LEDs are
unaffected, their pins come up in GPIO mode already, as do all eight
on the JCOW414.
* The rootfs is a UBI volume on an mtd-concat of tclinux_rootfs and the
7.25MiB region at 0x0D680000 that the vendor partition table does not
cover, giving 43.25MiB.
Installation
============
Both methods need serial console access. Power the device on, press a
key within one second to stop the bootloader, and log in with
telecomadmin / nE7jA%5m.
Booting an initramfs image over TFTP
------------------------------------
The bootloader runs a TFTP server that only validates the file name
after the transfer has finished, so any name other than tcboot.bin or
tclinux.bin lands in RAM without touching the flash.
1. Connect ethernet and give the PC the address 192.168.1.2
2. Upload the image:
tftp 192.168.1.1 -m binary -v -c put \
openwrt-econet-en7528-jiofiber_jcow407-initramfs-kernel.bin
The bootloader answers "Invalid filename, upload failed" after
reporting "start = 0x80020000". That is expected, the image is in
RAM at that point.
3. bldr> jump 80020000
Booting an initramfs image over XMODEM
--------------------------------------
1. Get the image length in hex:
printf '%X\n' "$(stat -c%s \
openwrt-econet-en7528-jiofiber_jcow407-initramfs-kernel.bin)"
2. bldr> xmdm 80020000 <file length hex>
3. Once "CCCC" appears, start the transfer from the terminal, e.g. with
picocom --send-cmd "lsx -vv" -b 115200 /dev/ttyUSB0 and ctrl+a ctrl+s
4. bldr> jump 80020000
Installing permanently
----------------------
1. Load openwrt-econet-en7528-jiofiber_jcow407-squashfs-tclinux.trx into
RAM with either method above
2. Write it to the first slot:
bldr> flash 80000 80020000 <file length hex>
3. Move the boot flag to the first slot as described below, then
power-cycle
Switching slots
---------------
From OpenWrt:
en75_chboot # show the active slot
en75_chboot openwrt # first slot, OpenWrt
en75_chboot factory # second slot, vendor
From the vendor firmware:
sys bootflag read # show the active slot
sys bootflag swap # switch to the other slot
From the bootloader, writing the byte directly:
bldr> memwl a1000000 30 # 30='0' tclinux, 31='1' tclinux_slave
bldr> memrl a1000000 # read it back to confirm the staged byte
bldr> flash dfc0000 a1000000 1
Power-cycle afterwards.
Reverting to stock is "en75_chboot factory" followed by a power cycle,
or the same bootloader sequence with 31 instead of 30.
MAC addresses
=============
MAC addresses are stored in the bootloader partition at offset 0x3fe48
and are assigned exactly as the vendor firmware assigns them:
offset 0 vendor WAN/PON
offset 1 LAN, br-lan and eth0
offset 2 WLAN 2.4GHz
offset 3 WLAN 5GHz
Signed-off-by: Ahmed Naseef <naseefkm@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/24798
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
The JioFiber JCOW414 is an ISP provided GPON ONT and home router, based
on the EcoNet EN7528.
The JioFiber JCO4032 is a different form factor built on the same
internals and is covered by the same image. Flash layout, bootloader
build, PCIe topology, WiFi EEPROM offsets, MAC pool, LEDs and USB were
all verified to be identical on both.
The parts that are common to every EN7528 board Jio ships live in
en7528_jiofiber.dtsi, leaving the board files to describe only their
LEDs and buttons.
Specifications
==============
* SoC: EcoNet EN7528
* RAM: 512MiB DDR3
* Flash: 256MiB SPI NAND (Micron MT29F2G01)
* WiFi 2.4GHz: MT7603E 2T2R, on PCIe port 0
* WiFi 5GHz: MT7663 2T2R 802.11ac, on PCIe port 1
* Ethernet: 4x 10/100/1000
* LEDs: 1x RGB status (3 GPIOs), plus green and amber per LAN jack
* Buttons: Reset, WPS
* USB: 2x USB ports
* UART: 4-pin header, GND TX RX 3.3V reading from the triangle marking
towards the PCB edge, 115200 8n1
* Other: 1x FXS phone jack, 1 GPON port
Notes
=====
* OpenWrt has to live in the first image slot (tclinux). Which slot the
vendor firmware boots from varies between units. The bootloader
picks the slot from a single ASCII byte at flash offset 0x0DFC0000,
'0' selects tclinux and '1' selects tclinux_slave. If your device is
booting from the second slot, the flag has to be moved after flashing;
see "Switching slots" below.
* The rootfs is a UBI volume on an mtd-concat of tclinux_rootfs and the
7.25MiB region at 0x0D680000 that the vendor partition table does not
cover, giving 43.25MiB.
Installation
============
Both methods need serial console access. Power the device on, press a
key within one second to stop the bootloader, and log in with
telecomadmin / nE7jA%5m.
Booting an initramfs image over TFTP
------------------------------------
The bootloader runs a TFTP server that only validates the file name
after the transfer has finished, so any name other than tcboot.bin or
tclinux.bin lands in RAM without touching the flash.
1. Connect ethernet and give the PC the address 192.168.1.2
2. Upload the image:
tftp 192.168.1.1 -m binary -v -c put \
openwrt-econet-en7528-jiofiber_jcow414-initramfs-kernel.bin
The bootloader answers "Invalid filename, upload failed" after
reporting "start = 0x80020000". That is expected, the image is in
RAM at that point.
3. bldr> jump 80020000
Booting an initramfs image over XMODEM
--------------------------------------
1. Get the image length in hex:
printf '%X\n' "$(stat -c%s \
openwrt-econet-en7528-jiofiber_jcow414-initramfs-kernel.bin)"
2. bldr> xmdm 80020000 <file length hex>
3. Once "CCCC" appears, start the transfer from the terminal, e.g. with
picocom --send-cmd "lsx -vv" -b 115200 /dev/ttyUSB0 and ctrl+a ctrl+s
4. bldr> jump 80020000
Installing permanently
----------------------
1. Load openwrt-econet-en7528-jiofiber_jcow414-squashfs-tclinux.trx into
RAM with either method above
2. Write it to the first slot:
bldr> flash 80000 80020000 <file length hex>
3. Move the boot flag to the first slot as described below, then
power-cycle
Switching slots
---------------
From OpenWrt:
en75_chboot # show the active slot
en75_chboot openwrt # first slot, OpenWrt
en75_chboot factory # second slot, vendor
From the vendor firmware:
sys bootflag read # show the active slot
sys bootflag swap # switch to the other slot
From the bootloader, writing the byte directly:
bldr> memwl a1000000 30 # 30='0' tclinux, 31='1' tclinux_slave
bldr> memrl a1000000 # read it back to confirm the staged byte
bldr> flash dfc0000 a1000000 1
Power-cycle afterwards.
Reverting to stock is "en75_chboot factory" followed by a power cycle,
or the same bootloader sequence with 31 instead of 30.
MAC addresses
=============
MAC addresses are stored in the bootloader partition at offset 0x3fe48
and are assigned exactly as the vendor firmware assigns them:
offset 0 vendor WAN/PON
offset 1 LAN, br-lan and eth0
offset 2 WLAN 2.4GHz
offset 3 WLAN 5GHz
Signed-off-by: Ahmed Naseef <naseefkm@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/24798
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
The tclinux TRX generator hardcodes the address that the bootloader
decompresses the kernel to, and TRX_MODEL is a plain global rather than
a per-device variable, so the last device to set it wins for every
device in the target. The free bootbase jump stub is also emitted as a
big endian instruction, which is wrong on little endian subtargets.
Add a --loadaddr option to tclinux-trx.sh, export TRX_MODEL and
TRX_LOADADDR per device and reset both in Device/Default, and pick the
jump stub encoding from CONFIG_BIG_ENDIAN. Behaviour is unchanged for
the existing devices.
Signed-off-by: Ahmed Naseef <naseefkm@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/24798
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Dropping kmod-switch-rtl8367s leaves it with zero in-tree users. Clean up
the tree by removing its definition in modules.mk.
Keep Realtek SDK located under
target/linux/mediatek/files/drivers/net/phy/rtk/ untouched since it's
necessary for mt7622 devices:
- totolink,a8000ru
- elecom,wrc-2533gent
- buffalo,wsr-2533dhp2
Signed-off-by: Mikhail Zhilkin <csharper2005@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/24435
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Update the LED enumeration layout from 0, 1, 2 to 1, 2, 3. This aligns
the internal LED identifiers directly with physical LAN ports 1, 2, and 3
to improve code readability and eliminate off-by-one mapping confusion.
Signed-off-by: Mikhail Zhilkin <csharper2005@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/24435
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
This commit adds OpenWrt U-Boot (UBI) layout support for MERCUSYS MR85X.
Stock bootloader UBI size: 50 MiB
OpenWrt U-Boot UBI size: 127 MiB
Other changes
-------------
- Watchdog is enabled for the both layouts
- Button labels renamed according to the kernel documentation
Preparation
-----------
OpenWrt for stock U-Boot should be installed first. Before formatting or
rewriting any partition structures, you must copy EEPROM data and unique
MAC address. Navigate to the /tmp/tp_data directory on the router. Locate
and copy these files to your PC:
- default-mac (contains your device's unique MAC address mapping)
- MT7981_EEPROM.bin (contains factory wireless calibration data)
Installation
------------
1. Initialize the Hardware Environment
Power off the router. Run the mtk_uartboot utility on your computer. Power
on the router. Wait for the utility to push the initial payload, boot the
device temporarily and format the UBI partition structure.
2. Access the U-Boot Promp
Run mtk_uartboot on your computer a second time. When the utility menu
appears on your terminal screen, choose Exit. This will drop you safely
into the interactive U-Boot command line interface prompt (MT7981>).
3. Flash the BL2 (preloader)
You must write the second-stage bootloader (BL2) directly to the MTD
partition. Prepare the router to receive the BL2 image over serial Ymodem
protocol:
MT7981> loady
In your terminal application, select File -> Transfer -> Ymodem -> Send
and select the path to:
openwrt-mediatek-filogic-mercusys_mr85x-ubi-preloader.bin
Erase the existing BL2 partition:
MT7981> mtd erase bl2
Commit the new BL2 binary from RAM to the flash memory:
MT7981> mtd write bl2 $loadaddr 0x0 ${filesize}
4. Provision the FIP Partition (BL31 & U-Boot)
Ready the router to receive the FIP package:
MT7981> loady
In your terminal application, send the following file via Ymodem:
openwrt-mediatek-filogic-mercusys_mr85x-ubi-bl31-uboot.fip
Clear the legacy tracking data and configure the UBI block allocation:
MT7981> ubi write $loadaddr fip ${filesize}
5. Boot into OpenWrt Recovery
With the core partition structures and boot code firmly written, you can
now push and execute the temporary OpenWrt recovery environment to finish
the installation. Prepare for the final serial download:
MT7981> loady
Send the following recovery image file via Ymodem:
openwrt-mediatek-filogic-mercusys_mr85x-ubi-initramfs-recovery.itb
Boot the OpenWrt kernel image directly out of the memory cache:
MT7981> bootm
6. Flash OpenWrt permanently
Once the router finishes booting the initramfs image, navigate to
192.168.1.1 in your web browser to access the OpenWrt LuCI recovery
interface. From there, permanently flash the production sysupgrade image.
7. Recovery factory data
Once the router finishes booting into OpenWrt, you must rebuild and flash
the factory volume payload. This process combines your unique wireless
calibration data and MAC address back into a single compliant block.
Use SCP or an SFTP client (like WinSCP) to copy your two backup files from
your PC into the router's /tmp directory:
- default-mac
- MT7981_EEPROM.bin
Connect to the router via SSH and run the following commands:
dd if=/dev/zero bs=$((0x8000)) count=1 | tr '\000' '\377' > /tmp/factory.bin
dd if=/tmp/MT7981_EEPROM.bin of=/tmp/factory.bin conv=notrunc
dd if=/tmp/default-mac >> /tmp/factory.bin
Query the system to confirm the exact logical UBI character device target
for the factory volume:
ubinfo /dev/ubi0 -N factory | grep "Volume ID" | awk '{print $3}'
Commit the newly created factory.bin file directly into the designated
factory UBI block (replace _1 below if your volume ID query returned a
different number):
ubiupdatevol /dev/ubi0_1 /tmp/factory.bin
Reboot your router to apply the changes.
Recovery
--------
The same as installation.
UART
----
Connection parameters: 115200, 8N1, 3.3V
UART pins are silkscreened on the PCB.
MAC addresses
-------------
+---------+-------------------+-----------+
| | MAC | Algorithm |
+---------+-------------------+-----------+
| label | 08:xx:xx:xx:xx:f5 | label |
| LAN | 08:xx:xx:xx:xx:f5 | label |
| WAN | 08:xx:xx:xx:xx:f6 | label+1 |
| WLAN 2g | 08:xx:xx:xx:xx:f5 | label |
| WLAN 5g | 08:xx:xx:xx:xx:f4 | label-1 |
+---------+-------------------+-----------+
label MAC address was found in UBI partition "tp_data", file
"default-mac" (raw binary MAC). Proof:
hexdump -C default-mac
00000000 08 xx xx xx xx f5 |....Y.|
00000006
OEM wireless eeprom is also there (file
"MT7981_EEPROM.bin").
Link: https://github.com/981213/mtk_uartboot
Signed-off-by: Mikhail Zhilkin <csharper2005@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/24435
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Introduce initial board support for the Mercusys MR85X, an AX3000
wireless router powered by the MediaTek MT7981 (Filogic 820) SoC.
Networking Configuration Note
-----------------------------
Ethernet functionality is currently disabled in this stage of U-Boot
due to the specific board configuration:
1. The Realtek RTL8367S switch does not have an available U-Boot driver
2. The Airoha EN8811 PHY is physically routed to GMAC1 rather than the
standard GMAC0 pipeline. This requires further adjustment to bind and
trace MDIO/PHY operations over GMAC1.
ToDo
----
I have successfully integrated the Realtek switch driver (taken from
D-Link DIR-X3260 GPL sources.
Link: https://github.com/hsj79/dir-x3260-gplcode/
Everything is working perfectly and users can operate the device without
any issues. TFTP flashing (FIP, preloader, recovery images) works
flawlessly across both cold and warm boot cycles with stable speeds
around 6.5 MiB/s.
Why it's not ready for upstream OpenWrt yet:
- Patch Size: The included Realtek SDK files are massive (approximately
3 MB), which is way too large for a standard OpenWrt package patch
- Code Optimization: The implementation is currently a functional
workaround and requires significant refactoring, cleanup and optimization
to match official OpenWrt submission standards
Patches and ready-to-use binaries
Link: https://github.com/csharper2005/uboot-mediatek-rtl8367s/
Signed-off-by: Mikhail Zhilkin <csharper2005@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/24435
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Add a DSA driver for the seven-port switch integrated in MT7620. Keep
the existing swconfig path for device trees without a DSA ports node.
Use RXD4 source-port and TXD4 forced-port metadata with the Ralink
DSA tagger. The programming guide places TXD4 FP_BMAP at bits 27:20;
use that layout instead of the stale unused bits 26:19 definition.
Implement bridge isolation and STP, VLAN filtering, FDB and
MDB offload, ageing, flood controls, phylink, MTU limits, and
software-extended hardware MIB counters. Poll the 1000BASE-T CPU
port counters every 20 ms and the remaining ports every 200 ms to
leave scheduling margin before their 16-bit packet counters wrap at
minimum-sized line-rate traffic. DSA invokes port_stp_state_set()
before updating its cached state, so pass the pending callback state
as an override when recalculating port matrices instead of leaving
hardware one transition behind.
Correct the shared switch MIB enable register and enable all seven
port counters. The old address was inside port 0 counter space,
so this also fixes legacy swconfig initialization.
Register DSA through a bound child of the frame-engine device. This
gives the managed conduit device link the correct lifetime across
driver unbind and reprobe while the switch registers remain owned by
the existing GSW platform device.
Package the driver and tagger as kmod-dsa-mt7620 for per-device
opt-in. This keeps DSA and switchdev out of swconfig-only MT7620
images and prevents installing the DSA package together with swconfig.
Also make MDIO and frame-engine teardown safe for deferred probes and
runtime reprobes. Replace the legacy MDIO busy loop and -1 return
with readl_poll_timeout_atomic() and its real error, and reset a
still-busy frame engine before freeing DMA rings. Resolve FE and ESW
resets by name so recovery can reset FE alone, and warn if a switch
node provides neither named reset.
The netdev is devm-managed, so leave NAPI deletion to free_netdev
after unregister instead of deleting NAPI from fe_remove while the
netdev is still registered.
Tested on an MT7620N rev 2 eco 6 with 100BASE-T traffic, VLAN-aware
hardware bridging, 2026-byte MTU, FDB/MDB offload, pending STP state,
and driver unbind/rebind. The modular driver, tagger, package contents,
DSA image composition, and swconfig-only kernel configuration were
also verified.
An independent TP-Link Archer C5 v4 test exercised an external RTL8367S
DSA switch using the RTL8_4t tagger as a regression check on the
shared dsa_tag_protocol enum. It found no collision or external-switch
regression; it does not validate the MT7620 integrated-switch path.
Signed-off-by: Gleb Pesin <dormancygrace@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/24493
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
The MT7620 frame engine selects the egress switch port in TXD4 and
reports the ingress source port in RXD4. Add a DSA tagger which
exchanges the port through METADATA_HW_PORT_MUX instead of modifying
packet data.
This preserves the frame payload and leaves descriptor encoding to the
conduit driver. Keep the kernel patch in the ramips target because the
tagger is specific to the MT7620 frame engine.
Signed-off-by: Gleb Pesin <dormancygrace@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/24493
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
videobuf2-vmalloc.ko was listed unconditionally in video-videobuf2's
FILES, but CONFIG_VIDEOBUF2_VMALLOC is only reliably built when a
driver that needs a vmalloc-backed allocator (e.g. pwc, uvc, gspca)
is itself selected. Any build where none of those drivers happen to
be enabled (e.g. under CONFIG_ALL_KMODS=y on a target where those USB
webcam drivers aren't selected) fails hard while packaging
kmod-video-videobuf2, since the .ko it expects to copy was never
built:
ERROR: module '.../videobuf2-vmalloc.ko' is missing.
Split it out into its own kmod-video-vmalloc package, following the
same pattern already used for video-dma-contig and video-dma-sg.
videobuf2-vmalloc.c calls dma_buf_vmap_unlocked/dma_buf_vunmap_unlocked
directly, so the new package depends on kmod-dma-buf explicitly rather
than only transitively through kmod-video-videobuf2.
Adjust the DEPENDS of all six in-tree drivers that previously got the
module for free from kmod-video-videobuf2: video-pwc, video-uvc,
video-gspca-core, video-coda, video-tw686x and camera-bcm2835.
camera-bcm2835's AUTOLOAD priority also moves from 66 to 67, matching
its siblings bcm2835-codec/bcm2835-isp/rp1-cfe*, which already sit one
priority above the videobuf2 allocator helper (65/66) they depend on.
Fix also two dead entries in video-videobuf2's AUTOLOAD that never
matched a built module (videobuf2-core and videobuf-v4l2, vs. the actual
videobuf2-common.ko/videobuf2-v4l2.ko), which caused kmodloader to
complain on every boot; pre-existing, unrelated to the split itself.
Signed-off-by: Joshua Covington <joshuacov@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/24647
Signed-off-by: Robert Marko <robimarko@gmail.com>
EcoNet PCIe support has landed in upstream and should be tagged
into v7.3. This replaces the custom patch with the final version.
A fair amount of other patches have hit pcie-mediatek.c so
most of them were also backported with minimal tweaks.
Hopefully this should be easier to maintain, as the original
out-of-tree PCIe patch is most likely to bump up against new merge
conflicts in basically every kernel version.
Signed-off-by: Caleb James DeLisle <cjd@cjdns.fr>
Link: https://github.com/openwrt/openwrt/pull/24504
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Commit c820f097e0 ("tools: gnulib: install .m4 file with gl_ prefix")
installed gnulib autoconf macros under gl_-prefixed file names. The
scheme was later reverted in commit cda598a595, but the previously
installed files were never removed from share/aclocal.
As aclocal reads the whole directory, stale gl_*.m4 files can override
the current unprefixed macros. This breaks elfutils builds on macOS
after the gnulib stable-202507 update, resulting in empty #if
expressions in the generated ctype.h.
Remove the stale files in Host/Uninstall. Host/Install calls it first,
so affected build trees are cleaned up automatically on the next
gnulib reinstall.
Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/24759
Signed-off-by: Robert Marko <robimarko@gmail.com>
Since 6.18, fb.ko calls into the backlight class rather than the
reverse, so it depends on backlight.ko when CONFIG_FB_BACKLIGHT is set,
which in-tree only happens via FB_TFT's select. Building kmod-fb-tft on
a 6.18 target with DISPLAY_SUPPORT therefore fails with:
Package kmod-fb is missing dependencies for the following libraries:
backlight.ko
Declare the dependency on kmod-fb, conditional on kmod-backlight being
built. An unconditional +kmod-backlight would form a recursive
dependency with KernelPackage/backlight's +kmod-fb, both as a kconfig
select cycle and as a circular PACK_ prerequisite that make resolves by
dropping an edge.
backlight.ko only references fb.ko on 6.12, so narrow that reverse
dependency to +LINUX_6_12:kmod-fb, which leaves a single edge on 6.18.
Signed-off-by: Matt Eaton <git@divinehawk.com>
Link: https://github.com/openwrt/openwrt/pull/24765
Signed-off-by: Robert Marko <robimarko@gmail.com>
Upgrade ncurses snapshot 6.6.20260801. This includes fixes that enable
the maintained patches to be dropped. It also introduces additional
terminfo files for the terminal emulator ghostty.
Signed-off-by: Charlie Jenkins <thecharlesjenkins@gmail.com>
Since the introduction of the host package for ncurses, it has attempted
to install terminfo files directly into the build machine's /usr/lib.
When not root, this silently fails to install. On ncurses versions after
v6_4_20230708, ncurses fails to install instead of silently failing.
Remove the host terminfo database installation to avoid this unexpected
behavior.
Signed-off-by: Charlie Jenkins <thecharlesjenkins@gmail.com>
The ncurses tarballs are infrequently released. Start building ncurses
from the git repo to be able to get fixes and improvements quicker.
Signed-off-by: Charlie Jenkins <thecharlesjenkins@gmail.com>
Introduce a config, CONFIG_LIBNCURSES_TERMINFO, that allows a user to
install additional terminfo files into the target filesystem. This helps
avoid needing to add arbitrary additional terminfo files to the default
list while still providing an easy way to include the files.
Signed-off-by: Charlie Jenkins <thecharlesjenkins@gmail.com>
The EN8811H attached to LAN1 is described with the generic
"ethernet-phy-ieee802.3-c45" compatible, the same way it was on the
XG-040G-MF. That makes fwnode_mdiobus_register_phy() take the
get_phy_device() path, which reads the PHY ID over MDIO while the bus
is being scanned.
Unlike on the MF, LAN1 does come up here. The PHY sits behind the
switch MDIO bus and answers the MMD device ID reads in time, so
air_en8811h is still matched through phydev->c45_ids even though the
Clause 22 style ID reads back as zero:
# cat /sys/class/net/lan1/phydev/phy_id
0x00000000
Nothing guarantees that ordering, and the MF shows what happens when
the PHY does not answer early enough: the ID reads as zero, the driver
does not match and the port stays down. Describe the PHY by its ID
here as well, so that phylib creates the device from the device tree
and never reads the bus.
Verified on the device. The ID now comes from the device tree and the
link is unaffected:
# cat /sys/class/net/lan1/phydev/phy_id
0x03a2a411
# ethtool lan1 | grep Speed
Speed: 2500Mb/s
Signed-off-by: Vitaliy Sochnev <sochnev.v.74@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/24624
Signed-off-by: Robert Marko <robimarko@gmail.com>
The EN8811H attached to LAN1 is described with the generic
"ethernet-phy-ieee802.3-c45" compatible. That makes
fwnode_mdiobus_register_phy() take the get_phy_device() path, which
reads the PHY ID over MDIO while the bus is being scanned. The PHY does
not answer that early, so the ID reads back as zero, air_en8811h never
matches and the generic Clause 45 driver is bound instead:
lan1: PHY [...mdio-bus@c8-mii:0f] driver [Generic Clause 45 PHY]
lan1: configuring for phy/2500base-x link mode
_phy_start_aneg+0x0/0xa0: returned: -22
WARNING: CPU: 0 PID: 592 at _phy_state_machine+0x100/0x3e0
The generic driver cannot configure autonegotiation on this PHY, so
LAN1 never comes up and the warning is printed on every attempt to
bring the link up.
Describe the PHY by its ID instead, so that phylib creates the device
from the device tree without reading the bus. Dropping the c45
compatible alone does not help, phylib would still read the ID from the
hardware and get zero.
Verified on the device: the correct driver binds, the PHY firmware is
loaded and LAN1 works.
Airoha EN8811H ...mdio-bus@c8-mii:0f: MD32 firmware version: 25062302
lan1: PHY [...mdio-bus@c8-mii:0f] driver [Airoha EN8811H]
Fixes: 42b8e0d9b7 ("airoha: add initial support for Nokia XG-040G-MF")
Signed-off-by: Vitaliy Sochnev <sochnev.v.74@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/24624
Signed-off-by: Robert Marko <robimarko@gmail.com>
The AVM 5490 and 5491 do not have Internet, LAN and DSL LEDs. Instead,
they have a fiber and FON LED. This commit adds a trigger for the fiber
LED and removes triggers for the LAN, DSL and Internet LEDs.
Fixes: 48b2df5a41 ("lantiq: add support for AVM Fritzbox 5490/5491")
Signed-off-by: Aleksander Jan Bajkowski <olek2@wp.pl>
Link: https://github.com/openwrt/openwrt/pull/24771
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
This commit adds support for the Hasivo S600WP-5GT-2S+ switch with SFP+ and PoE.
Based on board revision `RTL_5GT-2SX+ v1.02`.
This device is nearly identical to Hasivo S600WP-5GT-2SX-SE, except:
- More RAM and flash
- RJ45 console port
- Model name scheme, `2S+` vs `2SX`
- No case cut-out for the PoE LEDs
- No MAC address in nvmem
Hardware
--------
| | |
|----------|----------------------------------------------------------------|
| SoC | RTL9303 rev B |
| RAM | 256 MB Samsung K4B2G1646F DDR3L |
| Flash | 32 MB Macronix MX25L25645G SPI NOR, 29 MB usable by OpenWrt |
| Ethernet | 5x RJ45 via 5x RTL8221B-VB-CG PHYs (2.5G/1G/100M/10M), |
| | 2x SFP+ via SoC (10G/2.5G/1G) |
| PoE | 1x 802.3bt 90 W (port 1) |
| | 3x 802.3at 30 W (ports 2, 3, 4) |
| | via daughter board with Hasivo HS104PTI controller |
| LEDs | 5x orange/green 2.5G/1G link, 5x green 100M/10M link |
| | 4x orange internal PoE, 2x green 10G link, 2x green 1G link |
| | 1x green system, 1x green power |
| Button | Reset |
| Console | RJ45 38400 bps 8n1 |
| Power | Barrel jack 48V, shipped PSU is 52V/1.25A |
Installing OpenWrt
------------------
1. Attach to RJ45 serial console port using a cisco cable.
2. Attach your computer to any RJ45 port.
3. Serve initramfs-kernel.bin on TFTP 192.168.1.111.
4. Power on the device.
5. Interrupt U-Boot by pressing `Ctrl+C`, then `Z`, then `H`, during 3 second countdown.
6. Run: `rtk network on`
7. Run: `tftpboot 0x84f00000 initramfs-kernel.bin ; bootm 0x84f00000`
8. Use `mtd dump` to make backups of all flash partitions.
9. Use SCP to copy `squashfs-sysupgrade.bin` to the device, then run `sysupgrade`.
Restoring factory firmware
--------------------------
OpenWrt uses the `RUNTIME` and `RUNTIME2` partitions as one combined partition.
To restore them from backups, boot from `initramfs-kernel.bin` just like during
the installation, then use `mtd write` to write your backups of the factory
`mtd5` and `mtd6` partitions.
Notes/Quirks
------------
- U-Boot interruption is obfuscated. Press `Ctrl+C`, then `Z`, then `H`,
during the 3 second countdown.
- MAC address is stored on the `RUNTIME` or `RUNTIME2` partitions, which are used by OpenWrt.
Instead, we generate one random MAC address and store it in the U-Boot environment.
- The PoE LEDs under each RJ45 port work correctly, but there's no cut-out in the case,
so these LEDs are only barely visible.
- Under certain circumstances, the RJ45 ports can come up dead on boot.
See https://github.com/openwrt/openwrt/issues/22140
Signed-off-by: Lars Gierth <larsg@systemli.org>
Link: https://github.com/openwrt/openwrt/pull/24749
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Frequency scaling lets MT7620 reduce the CPU clock after a MIPS
SI_Sleep signal. The clock framework does not observe that change and
continues reporting the boot frequency. This breaks timekeeping, delay
calibration, and timing-sensitive users such as the Jitter RNG.
Remove the MT7620 autosleep callback and its elevated systick rating
from the local timer patch. Clear SLEEP_EN during early MT7620
initialization so the result does not depend on reset state or on what a
bootloader left behind. Use the generic systick compatible in the
MT7620A and MT7620N DTS files.
With CPU frequency scaling removed, the MIPS Count Register is again a
reliable clock source. Systick drops to rating 200 for both the
clocksource and the clockevent, so cevt-r4k (rating 300) takes the
clockevent and the now-reliable MIPS count register (rating ~229 here)
takes the clocksource.
Hardware testing used OpenWrt 25.12.5 with Linux 6.12.94 on an MT7620A
WE826. Before the change, urngd occupied 92 to 100 percent of otherwise
idle CPU for several minutes after each boot. After the change, urngd
initialized without the prolonged load. Ethernet, WireGuard, warm boot,
mixed-load stability, and 30-minute clock drift tests showed no
regression.
The change was rebased onto main with Linux 6.18.44. The complete ramips
patch stack applies cleanly, checkpatch reports no issues, and the
modified timer-ralink and mt7620 objects compile with the OpenWrt MIPS
toolchain.
This revives Shiji Yang's original 2023 patch with current hardware
results and makes the disabled state independent of the bootloader.
Link: https://lists.openwrt.org/pipermail/openwrt-devel/2023-July/041232.html
Signed-off-by: Shiji Yang <yangshiji66@qq.com>
Tested-by: Gleb Pesin <dormancygrace@gmail.com>
Signed-off-by: Gleb Pesin <dormancygrace@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/24734
Signed-off-by: Robert Marko <robimarko@gmail.com>
2500BASE-X uses GMAC with out-of-band negotiation and XGMAC with in-band
negotiation. The link-up and link-down paths account for that distinction,
but mac_config only applies the XGMAC configuration for USXGMII and
10GBASE-R.
Apply the XGMAC configuration to in-band 2500BASE-X as well. This sets its
packet filter, flow control, jabber handling and 13K watchdog consistently
with the other XGMAC modes.
Fixes: 142104bb90 ("qualcommax: add PPE driver")
Link: https://github.com/openwrt/openwrt/pull/24758
Signed-off-by: Robert Marko <robimarko@gmail.com>
The PPE MAC and packet-processing path supports frames up to 12288
bytes, but EDMA currently supplies only 1984-byte receive buffers and
DSA user ports retain the default 1500-byte maximum MTU.
Derive the EDMA receive page order from the conduit MTU and use all of
the resulting page for each receive buffer. Recreate the page pool and
rings only when an MTU change requires a different page order. This
keeps ordinary traffic on order-0 pages while allowing jumbo traffic to
use order-2 pages without permanently increasing memory use and skb
truesize.
Advertise a 12262-byte maximum MTU after accounting for the Ethernet
header, FCS and two VLAN tags.
Link: https://github.com/openwrt/openwrt/pull/24758
Signed-off-by: Robert Marko <robimarko@gmail.com>
EDMA may prefetch receive buffers beyond the fill ring consumer index.
As a result, the hardware indices do not account for every page owned
by the engine when the rings are shut down, and the existing drain can
miss prefetched pages.
Track each posted page in software using an opaque preheader cookie. Do
not reuse an ownership slot until its page completes, and release every
page still owned by EDMA when freeing the receive ring.
Link: https://github.com/openwrt/openwrt/pull/24758
Signed-off-by: Robert Marko <robimarko@gmail.com>
DSA rejects MTU changes when the switch driver does not provide a
port_change_mtu callback. Add the callback and program the PPE ingress
MRU, unicast egress MTU and multicast egress MTU thresholds for the
requested frame size.
The PPE thresholds include the Ethernet header and space for up to two
VLAN tags, so account for that overhead when converting the network
device MTU. Initialize all three thresholds consistently during setup.
Link: https://github.com/openwrt/openwrt/pull/24758
Signed-off-by: Robert Marko <robimarko@gmail.com>
The MRU/MTU table uses an 8-byte entry stride on HPPE, while CPPE uses a
16-byte stride. Using the CPPE stride for both variants makes IPQ8074
access every second table entry, affecting initial MRU/MTU programming
and port counter enablement.
Store the stride in the per-SoC data and use it for all MRU/MTU table
accesses.
Fixes: 142104bb90 ("qualcommax: add PPE driver")
Link: https://github.com/openwrt/openwrt/pull/24758
Signed-off-by: Robert Marko <robimarko@gmail.com>
This target currently uses cpu erratums for Cortex-A76, Cortex-A510,
Cortex-A710, and Neoverse-N2. The commit 0b25cef also added erratums
for Ampere AmpereOne and Rockchip RK3568. Remove these useless items.
Fixes: 0b25cef ("qualcommbe: enable 6.18 testing kernel")
Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
Link: https://github.com/openwrt/openwrt/pull/24770
Signed-off-by: Robert Marko <robimarko@gmail.com>
This target currently uses cpu erratums for Cortex-A76, Cortex-A510,
Cortex-A710, and Neoverse-N2, which is useless and should be removed.
No Cortex-A53 cpu erratums were detected on these IPQ SoCs either.
Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
Link: https://github.com/openwrt/openwrt/pull/24770
Signed-off-by: Robert Marko <robimarko@gmail.com>