build: auto-generate CONFLICTS for package variants sharing PROVIDES
Packages using PROVIDES to declare virtual package alternatives (like tc-tiny, tc-bpf, tc-full all providing 'tc') could be simultaneously selected as =y, causing installation conflicts. The PROVIDES mechanism only handles dependency resolution, not mutual exclusion.
Add add_implicit_provides_conflicts() to automatically generate CONFLICTS from default variants to non-default variants sharing the same PROVIDES. This ensures only one variant can be built-in (=y) at a time.
Skip generating implicit conflicts when the non-default already has explicit CONFLICTS with the default, to avoid Kconfig dependency cycles with the select-based dependency resolution.
Signed-off-by: Felix Fietkau <nbd@nbd.name> (commit: 6d5c71f)
build: fix stale package install stamps for unselected variants
When a package variant changes from =y to =m, its .install stamp file was not being cleaned up, causing both variants to appear in the package install list.
Fix by making compile depend on prepare-package-install, ensuring the stamp file is always cleared. Only =y packages recreate it.
Signed-off-by: Felix Fietkau <nbd@nbd.name> (commit: bb22a51)
wifi-scripts: refactor iwinfo.uc to support dynamic data updates
Moved interface discovery and data population into an exported update() function that can be called on-demand to refresh wireless interface information. This allows using iwinfo.uc as a library inside daemons.
Signed-off-by: John Crispin <john@phrozen.org> (commit: 26eab84)
The RTL8218D currently relies on proper U-Boot configuration. In case that is not possible, provide a basic setup sequence that can bring the PHY "alive". The SDK provides multiple configuration sequences for two operation modes (XSGMII or QSGMII) and the different SoC families. Due to limited testing resources only provide a setup for RTL93xx devices and both modes at the moment.
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de> Link: https://github.com/openwrt/openwrt/pull/21551 Signed-off-by: Robert Marko <robimarko@gmail.com> (commit: 3ddcd52)
To update kexec and kdump dependencies for supporting the aarch64 architecture.
Signed-off-by: Roc Lai <laipeng668@qq.com> Link: https://github.com/openwrt/openwrt/pull/21623 Signed-off-by: Robert Marko <robimarko@gmail.com> (commit: 9fb645f)
Signed-off-by: Roc Lai <laipeng668@qq.com> Link: https://github.com/openwrt/openwrt/pull/21623 Signed-off-by: Robert Marko <robimarko@gmail.com> (commit: e75218e)
d1: Add device tree configuration for D1 RGB LED Controller
This adds the device tree patches written by Samuel Holland to the kernel. The driver was merged into mainline Linux in 6.8, but the device tree patches were never merged into mainline.
Signed-off-by: Gabriel Roper <lockheedmaniac@gmail.com> (commit: 12992dc)
imagebuilder: skip repository file when standalone
Standalone image builder doesn't have a repositories file as all packages are included, which causes:
ERROR: failed to read repositories: PATH_TO_BUILDER/repositories: No such file or directory
The images are still built, so this is more of an informational error.
Pass related argument to apk only when CONFIG_IB_STANDALONE is not set.
Fixes: a8d17c21 ("imagebuilder: actually support IB from buildbot") Signed-off-by: George Sapkin <george@sapk.in> Link: https://github.com/openwrt/openwrt/pull/21658 Signed-off-by: Robert Marko <robimarko@gmail.com> (commit: 7bb79b9)
Some SPI-NAND driver macro definitions and function parameters have been changed in the latest release[3]. Hence we also had to rework the related local patches to follow the upstream changes.
The vr9.dtsi configures the GPIO 38 as reset GPIO. Also the fon LED is configured on GPIO 38. This conflicts and makes the probing of the PCIe controller fail in OpenWrt 25.12.
The AVM GPL source code configured GPIO 21 as PCIe reset.
Fix parsing ABI when package has multiple tags and apk returns them in a single line.
Fixes: 31cdd13d ("imagebuilder: add ABI suffix to packages when using apk") Signed-off-by: George Sapkin <george@sapk.in> Link: https://github.com/openwrt/openwrt/pull/21660 Signed-off-by: Robert Marko <robimarko@gmail.com> (commit: 5f889ea)
DESCRIPTION field has been deprecated since 2007, yet internal exporting causes intermittent package build failures due to the deprecation check, even with packages that don't have that fields set. Replace all DESCRIPTION exports with alternative variables defined through shexport and shvar helpers and remove the check.
Fixes: 547b127d ("make kernel module packaging code reusable and use it in madwifi") Fixes: 7558f028 ("DESCRIPTION:= is obselete, so complain if it is used and use TITLE if no description is set") Fixes: cc435322 ("build: optimize target metadata dump") Fixes: d081edf7 ("build: clean up and optimize ipkg control generator code") Signed-off-by: George Sapkin <george@sapk.in> Link: https://github.com/openwrt/openwrt/pull/21668 Signed-off-by: Robert Marko <robimarko@gmail.com> (commit: 87b72fe)
realtek: mdio: rtl838x: activate combo PHY media detection
There is a misunderstanding about BIT(7) aka EX_PHY_MAN_24_27 in SMI_GLB_CTRL register. The SDK sets/clears it at different places and it is not clear what it is for. Observation shows that it is essential for a working MAC_LINK_MEDIA_STS register.
A RTL838x device has usally two configurations
- port 24/26 are 2 serdes driven fiber ports - port 24-27 are 4 PHY driven combo ports
In the combo case the above bit must be set so that a switch between copper and fiber can be detected. Cleanup the MDIO initialization and remove the unneeded bit handling in the DSA driver.
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de> Link: https://github.com/openwrt/openwrt/pull/21653 Signed-off-by: Robert Marko <robimarko@gmail.com> (commit: 17f1269)
realtek: phy: convert confusing BMCR_PDOWN usage for RTL8214FC
Bit 11 of registers 16, 19, 20, 21 in page 0x266 denotes if a port of a RTL8214FC is set/favoured to fibre (0) or copper (1). For unknown reasons the bit was mixed with BMCR_PDOWN. Convert this to a meaningful define.
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de> Link: https://github.com/openwrt/openwrt/pull/21582 Signed-off-by: Robert Marko <robimarko@gmail.com> (commit: 07bb4f5)
realtek: phy: save RTL8214FC extended page during power set
Changing the fibre/copper power of a RTL8214FC changes the extended page via register 29. This is the write only companion of register 30. The register is afterwards overwritten to 0.
Use the proper extended page register 30 and preserve its content during the operation.
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de> Link: https://github.com/openwrt/openwrt/pull/21582 Signed-off-by: Robert Marko <robimarko@gmail.com> (commit: 121f4d9)
realtek: phy: optimize RTL8214FC register usage during media set
There are some shortcomings in rtl8214fc_media_set()
- It always uses the mdio raw page (4095) of RTL838x for writes. That is wrong when the phy is attached to an RTL839x (raw = 8191) - It uses the internal write only extended page companion (29) - The extended page content is not preserved
Fix the three issues.
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de> Link: https://github.com/openwrt/openwrt/pull/21582 Signed-off-by: Robert Marko <robimarko@gmail.com> (commit: 45fb8f9)
- phy_probe() for setup of structures - config_init() for device setup (after reset)
RTL8214FC is a combo phy and the currently active port can be switched with the SFP helper functions that are triggered during SFP insertion and removal. In case a fibre SFP is inserted while booting the SFP trigger is run between the above mentioned stages. During the final setup in config_init() the phy is reset to the copper port. Thus no link is available on fibre and the SFP must be reinserted for normal operation.
For a consistent behaviour the fibre/copper port setup must run before the SFP probing and not afterwards. Move the setup code from config_init() into phy_probe().
Fixes: 10ae743 ("realtek: phy: simplify RTL8214FC configuration") Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de> Link: https://github.com/openwrt/openwrt/pull/21582 Signed-off-by: Robert Marko <robimarko@gmail.com> (commit: 372f256)
The Gemini reference design-derived devices uses a partition format which is predictable and we can exploit this to offer some proper upgrade path.
The kernel for these contains a hack to use this partition format unaltered by combining the partitions "Kern" and "Ramdisk" to one image with all of the kernel+ramdisk in memory.
Then the "Application" which is used for the rootfs go into its own partition.
Following the pattern of the factory image we create three images named zImage, rd.gz and hddapp.tgz (these filenames are misleading! They are just required by the old firmware.) and flash each individually with "mtd" during upgrades.
Since the IB-4220-V has a different layout with a bigger kernel space we parameterize this so we can handle this too. (More fixes are needed for that device though.)
A way to upgrade older OpenWrt on these platforms to the latest and greatest will be to copy the file target/linux/gemini/base-files/lib/upgrade/platform.sh to /lib/upgrade/platform.sh on your running system and then run sysupgrade from the image produced after this patch.
The script is picky to sanity check the partitions before commencing upgrade.
This was tested with a full sysupgrade on the iTian SQ201.
Any ftpd package such as vsftpd or atftpd (are there others?) should create their own unprivileged user. Both of the aforementioned packages do not even use this ftp user and run as root. That should be addressed in separate commits.
KERNEL_DCB was introduced in 40f1db9cb11d, however the dcb utility is not enabled for iproute2. Although DCB is not generally available among Ethernet cards, not having the dcb utility renders it completely unchangeable.
On aarch64, it takes ~85.3KiB.
Signed-off-by: David Yang <mmyangfl@gmail.com> Link: https://github.com/openwrt/openwrt/pull/21606 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> (commit: f0f5525)
The `syn_flood` option name is deprecated, `synflood_protect` should be used instead. firewall3 and firewall4 both support this option since a long time. LuCI already replaces the option name. https://github.com/openwrt/luci/commit/0abcb39b623f0eff0fbcdfb99fca8f3224701e86
Suggested-by: rparge in OpenWrt forum Link: https://github.com/openwrt/openwrt/pull/21642 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> (commit: 2ae350b)
Introduce preemption model selection with PREEMPT_NONE as the default. PREEMPT_NONE is the traditional Linux preemption model and also the best choice for servers.
Signed-off-by: Thomas Richard <thomas.richard@bootlin.com> Link: https://github.com/openwrt/openwrt/pull/21413 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> (commit: 5d72011)
layerscape: set PREEMPT_NONE as default preemption model
Layerscape currently uses the PREEMPT model, which is not aligned with OpenWrt's default. Switch to PREEMPT_NONE for consistency with OpenWrt's default configuration. Preemption model selection is now available via menuconfig for further customization.
Signed-off-by: Thomas Richard <thomas.richard@bootlin.com> Link: https://github.com/openwrt/openwrt/pull/21413 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> (commit: 6924c16)
gemini: set PREEMPT_NONE as default preemption model
Gemini currently uses the PREEMPT model, which is not aligned with OpenWrt's default. Switch to PREEMPT_NONE for consistency with OpenWrt's default configuration. Preemption model selection is now available via menuconfig for further customization.
Signed-off-by: Thomas Richard <thomas.richard@bootlin.com> Link: https://github.com/openwrt/openwrt/pull/21413 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> (commit: e47c21a)
mediatek: mt7623: set PREEMPT_NONE as default model
Mediatek/mt7623 currently uses the PREEMPT model, which is not aligned with OpenWrt's default. Switch to PREEMPT_NONE for consistency with OpenWrt's default configuration. Preemption model selection is now available via menuconfig for further customization.
Signed-off-by: Thomas Richard <thomas.richard@bootlin.com> Link: https://github.com/openwrt/openwrt/pull/21413 [Added some config options again] Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> (commit: 777fc28)
loongarch64: set PREEMPT_NONE as default preemption model
Loongarch64 currently uses the PREEMPT_VOLUNTARY model, which is not aligned with OpenWrt's default. Switch to PREEMPT_NONE for consistency with OpenWrt's default configuration. Preemption model selection is now available via menuconfig for further customization.
Signed-off-by: Thomas Richard <thomas.richard@bootlin.com> Link: https://github.com/openwrt/openwrt/pull/21413 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> (commit: 2530c99)
This adds the OSNOISE_TRACER kernel configuration option. The osnoise tracer allows to track interference experienced by an application due to activities inside the operating system (like NMIs, IRQs ...).
Signed-off-by: Thomas Richard <thomas.richard@bootlin.com> Link: https://github.com/openwrt/openwrt/pull/21413 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> (commit: c1c37b4)
realtek: mdio: use generic bus command function for RTL838x
The Realtek mdio bus works similar for all devices with only minor family specific differences. Basically command issuing follows a generic style. Write command type and a trigger. Afterwards wait until the trigger flag goes back to zero (aka "command complete"). Unify this sequence in a central helper.
RTL838x read/write callers of this helper use a strange style of error handling by issuing goto statements. Refactor this for better readability. Additionally remove all debug prints. These are not needed as the central read/write handlers provide a common logging mechanism.
Reading the PHY ID to assign a PHY config is currently simple. For C45 two MDIO reads of a hardcoded MMD are done to get the standard PHY ID registers. MMD 31 (MMD_VEND2) is used for that purpose, assuming there will be a valid PHY ID stored in this MMD in all cases. However, with Aquantia AQR813 there's at least one example for which this isn't true. This PHY returns 0 for the PHY ID in MMD_VEND2, instead MMD_VEND1 would have the correct ID.
Enhance reading the PHY by accessing a common set of MMDs of which most PHY at least implement one and have a valid PHY ID in. To keep overhead low, do not scan all MMDs. As soon as a valid PHY ID is found, exit and use that. This is similar to the kernel logic, jsut reduced to fewer MMDs.
Also handle possible errors coming from MDIO reads to avoid reading garbage.
While at it, move reading the PHY ID to a separate function to not pollute the poll fixup retrievel function.
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com> Link: https://github.com/openwrt/openwrt/pull/21515 Signed-off-by: Robert Marko <robert.marko@sartura.hr> (commit: 322041f)
realtek: mdio: apply phy polling config for RTL931x
Apply the PHY polling configuration for RTL931x too, as previously implemented for RTL930x. This is needed for several PHYs on that platform to function properly.
Add another flag called 'force_res' to the phy_info struct which is for RTL931x only. The SDK mentions this as a flag to force polling the Realtek proprietary PHY status resolution register. Effectively, this changes the polling to proprietary format instead of standard format, and sets an enable bit in another private polling register field.
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com> Link: https://github.com/openwrt/openwrt/pull/21515 Signed-off-by: Robert Marko <robert.marko@sartura.hr> (commit: 4fa27cb)
Add a PHY ID for Aquantia AQR813 which is an Octa-PHY found in some Realtek switches.
Add another PHY ID for another revision of AQR113C, also found in some Realtek switches.
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com> Link: https://github.com/openwrt/openwrt/pull/21515 Signed-off-by: Robert Marko <robert.marko@sartura.hr> (commit: 19e1e50)
That means that we have a "normal" function caller (can be called during the whole uptime) and a "initialization" function callee (only available during init.
Fix this and directly fix the unwanted family checks.
Update the econet-eth driver to a new version which is of sufficient quality that it is realistic to think about upstreaming.
This version is now NAPI based, collects stats, downloads without dropped packets anymore, has debugfs introspection, and can be unloaded and reloaded (providing the reset controller is present).
PR #21545 is recommended but not required, without this the ethernet driver will log a warning on startup because it can't get the resets and it will be impossible to unload and reload the driver without a reboot. However, the PoC driver was not capable of reloading so this is not a regression.
qualcommax: ipq60xx: add support for TP-Link EAP620HD v3
Specifications: * SoC: Qualcomm IPQ6018/AP-CP03-C1 (64-bit Quad-core Arm Cortex-A53 @ 1.2 GHz) * RAM: 2x Zentel A3T4GF40BBF-HP (1 GiB DDR3-1866 (13-13-13)) * Serial Port: 1v8 TTL 115200n8 * Wi-Fi: Qualcomm QCN5022 (802.11ax/b/g/n) * Wi-Fi: Qualcomm QCN5052 (802.11ac/ax/n) * Ethernet: RTL8211FS (10/100/1000BASE-T) * Flash: GigaDevice PSR1GA30DT (128 MiB) * LEDs: 1x Blue Status (GPIO 35 Active High) * Buttons: 1x Reset (GPIO 9 Active Low) * FCCID: 2AXJ4EAP620HDV3 * UART: 4-pin unpopulated header by the J1 footprint
Installation Instructions (Serial+TFTP): 1. Locate the J1 footprint which contains 4 unpopulated pins where starting from the arrow, the pins are TX, RX, VCC and GND respectively. 2. Connect a 1v8 TTL port to the 4 pins. Ensure RX and TX are crossed over. 3. Copy openwrt-qualcommax-ipq60xx-tplink_eap620-hd-v3-initramfs-uImage.itb to your TFTP server. 4. Power up the AP and hold Ctrl+B in the serial console (115200n8) until autoboot is halted. 5. Run the following commands in the U-boot prompt: IPQ6018# setenv serverip <TFTP server addr> IPQ6018# setenv ipaddr <addr of the AP> IPQ6018# tftpboot 0x44000000 openwrt-qualcommax-ipq60xx-tplink_eap620-hd-v3-initramfs-uImage.itb IPQ6018# bootm 0x44000000 You may need to type Ctrl+C and Enter before running these commands to clear invisible characters from the buffer. 6. Run the following command in a terminal to copy the sysupgrade image to be installed (check IP address): $ scp -O openwrt-qualcommax-ipq60xx-tplink_eap620-hd-v3-squashfs-sysupgrade.bin root@192.168.1.1:/tmp/ 7. Activate the OpenWrt serial console and run the following commands: # cd /tmp # sysupgrade -n openwrt-qualcommax-ipq60xx-tplink_eap620-hd-v3-squashfs-sysupgrade.bin 8. The AP will reboot and OpenWrt will be successfully installed.
Installation Instructions (Web UI method): 1. Set up the device using the vendor's web UI. Navigate to Management->SSH and enable the "SSH Login" checkbox. Select "Save".
2. Connect to the machine via SSH: $ ssh -o hostkeyalgorithms=ssh-rsa <ip_of_device>
3. Disable signature verification: $ cliclientd stopcs 4. Rename the "-web-ui-factory" image to something less than 63 characters, maintaining the ".bin" suffix.
5. Go to System -> Firmware Update. Under "New Firmware File", click "Browse" and select the image. Select "Update" and confirm by clicking "OK".
6. If the update fails, the web UI should show an error message. Otherwise, the device should reboot into OpenWrt.
Device support followed from EAP620HD v2 and eap6xx-outdoor for DTS. Links: openwrt/openwrt#18227
Signed-off-by: John Christoforidis <github@yanny.dev> Link: https://github.com/openwrt/openwrt/pull/21467 Signed-off-by: Robert Marko <robimarko@gmail.com> (commit: 428bcee)
The Raidsonic devices do not use a 2048k kernel "Kern" partition like the Storlink reference designs. Instead it uses a 3072k partition to fit a slightly larger kernel.
Sadly the current OpenWrt Gemini kernel is still bigger than 3072k so we need to make use of the Ramdisk partition as well.
Create a special "copy-kernel" version that can deal with the Raidsonic 3072k kernels. Tested on the Raidsonic IB-4220-B booting kernel v6.12.66.
Fix a copy/paste error in the image generation makefile while we are at it.
5a13d875ac71 dhcpv6: set static defines for DHCPv6 option header size 9857adb8ac99 dhcpv6-ia: switch case refactor in dhcpv6_handle_ias() 3cbbea830ddd netlink: clean up sockets, close files 13ef483716a5 dhcpv4: de-escalate error logging to debug
This commit enables PoE output on port 1 of the Meraki MR30H if the device is powered via 802.3at PoE.
No PoE output is enabled if the device is powered via 802.3af PoE, as there is insufficient power.
Signed-off-by: Hal Martin <hal.martin@gmail.com> Link: https://github.com/openwrt/openwrt/pull/20645 Signed-off-by: Robert Marko <robimarko@gmail.com> (commit: 561a885)
realtek: phy: drop external RTL8218B firmware blob
No one has looked into the firmware based RTL8218B initializations for a long time. Instead the basic setup sequences have evolved so that they can start the RTL8218B PHY from scratch. See
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de> Link: https://github.com/openwrt/openwrt/pull/21679 Signed-off-by: Robert Marko <robimarko@gmail.com> (commit: 5ebb931)
realtek: dsa: remove half-cooked SoC version determination
There are some code pieces that determine the SoC version of the running system. For RTL83xx it reads out the registers, for RTL93xx it simply uses a constant value. Without any consumer of this data drop it.
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de> Link: https://github.com/openwrt/openwrt/pull/21684 Signed-off-by: Robert Marko <robimarko@gmail.com> (commit: 5dbfbe5)
realtek: eth: use new prefix for open/stop operations
Align the functions with rest of driver.
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de> Link: https://github.com/openwrt/openwrt/pull/21685 Signed-off-by: Robert Marko <robimarko@gmail.com> (commit: 7b89702)
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de> Link: https://github.com/openwrt/openwrt/pull/21685 Signed-off-by: Robert Marko <robimarko@gmail.com> (commit: cf51728)
The GPIO expander is connected via I2C, thus the can_sleep flag has to be set to true. This fixes spurious "scheduling while atomic" bugs in the kernel ringbuffer.
Signed-off-by: Milan Krstic <milan.krstic@gmail.com> Link: https://github.com/openwrt/openwrt/pull/19182 Signed-off-by: Robert Marko <robimarko@gmail.com> (commit: fcb988b)
qualcommax: ipq807x: add functions for bootconfig partition
The BOOTCONFIG partition is used by Qualcomm's boot chain to store metadata about the device's startup configuration. It contains info such as versioning, configuration flags, primary boot partition, and more.
Newer devices with dual boot partitions not only store the active boot partition in a U-boot variable but also in partition info in the BOOTCONFIG partition. As such, add library functions to set and toggle the active boot partition.
Signed-off-by: Milan Krstic <milan.krstic@gmail.com> Link: https://github.com/openwrt/openwrt/pull/19182 Signed-off-by: Robert Marko <robimarko@gmail.com> (commit: 8dd1be5)
* 115200,8N1,1.8V * Three unmarked test points next to QJ2012A:
+---------+ | QJ2012A | +---------+ o TX o GND o RX o o o
Installation via OEM firmware:
* Use the following process to obtain root ssh access https://forum.openwrt.org/t/150371/24 * Connect using root with no password on port 42000 * Optionally for serial bootloader access run : fw_setenv bootdelay=3 * SCP factory.bin to /tmp * Run: sysupgrade -n /tmp/factory.bin
Installation via serial console and OEM firmware::
* Use console to access OEM firmware shell * Proceed with SCP & sysupgrade as described above
Other notes:
* This device uses active partition rotation * Some versions (TCL branded?) have a NOR chip in addition to NAND * The above is supported by u-boot patching DT partitions * DT patching does NOT occur on tftpboot/bootm * Modem is detected as foxconn-sdx55 by kernel (same VID/PID) * This works OK-ish and should be improved if we can get OEM modem details
Signed-off-by: Milan Krstic <milan.krstic@gmail.com> Link: https://github.com/openwrt/openwrt/pull/19182 Signed-off-by: Robert Marko <robimarko@gmail.com> (commit: ac8b552)