Commit Graph
100 Commits
Author SHA1 Message Date
Rosen PenevandJonas Jelonek c1ba308aa6 lantiq: vrx518_ep: use module_pci_driver macro
Use = {} to get rid of the memset so that init is just
pci_register_driver with extra prints.

Assisted-by: Opencode:Big-Pickle
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/23976
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-06-28 23:36:05 +02:00
Rosen PenevandJonas Jelonek 0d892f17c9 fs: rpsec: add missing modules for CRYPTO_KRB5
Upstream selects these for CRYPTO_KRB5.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/23794
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-06-28 22:09:37 +02:00
Rosen PenevandJonas Jelonek 8ff69df2e0 irq-ath79-intc: move irq_chip to private struct
For whatever reason, the static array change is causing massive dmesg
spam. Revert it for now.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/23884
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-06-27 12:07:34 +02:00
Rosen PenevandJonas Jelonek dcbb2f58dc irq-ath79-intc: use of_irq_get
Modern version of irq_of_map_and_parse() that does not require
irq_dispose_mapping() to be called.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/23884
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-06-27 12:07:34 +02:00
Rosen PenevandJonas Jelonek d6d6c309d8 kernel: use module_mtd_part_parser for mtdsplit
Remove boilerplate.

Also added deregister for bcm_wifi for consistency. Not needed as it's
builtin but still good to have.

There's a slight change from subsys_initcall to module_init. Not really
an issue for mtd drivers. No driver in linux upstream's drivers/mtd uses
subsys_initcall.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/23893
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-06-23 09:00:59 +02:00
Rosen PenevandJonas Jelonek ec26a78f1e kernel: fix wrong strlcat call
strlcat takes the total buffer size, not the remaining space.
Passing strlen(cmdline) + l caused it to truncate by one byte
when the appended string fit within the buffer.

This is also more consistent with the rest of the file.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/23892
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-06-22 11:06:48 +02:00
Rosen PenevandJonas Jelonek a8282f563d kernel: handle bootargs-override the same everywhere
l is an int. No need for a cast. Also might as well use l since it's
available.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/23892
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-06-22 11:06:47 +02:00
Rosen PenevandJonas Jelonek 35ee4f8d31 kernel: replace strncpy with safer alternatives
strncpy is deprecated. Replace with:
- strscpy() for NUL-terminated destinations
- strscpy_pad() for NUL-terminated destinations with zero-padding
- memcpy() for fixed-length in-place overwrites (bootargs mangle/cmdline replacement)

Assisted-by: Opencode:Big-Pickle
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/23892
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-06-22 11:06:47 +02:00
Rosen PenevandJonas Jelonek 3372463999 kernel: replace open-coded arithmetic in allocators
Dynamic size calculations in allocator arguments can overflow,
leading to undersized allocations. Replace with:
- kcalloc() for count * sizeof() patterns
- devm_kcalloc() for managed allocations
- array_size()/size_add()/size_mul() for complex cases

Assisted-by: Opencode:Big-Pickle
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/23892
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-06-22 11:06:47 +02:00
Rosen PenevandJonas Jelonek 7aec4efba8 kernel: replace BUG_ON/BUG with WARN_ON/WARN_ON
BUG() and BUG_ON() are deprecated - they destabilize the system
and make debugging impossible. Replace with:
- WARN_ON() + return error for assertion failures
- WARN_ON_ONCE() for bounds checks
- WARN_ON() + return -EPERM for in_interrupt() guards

Assisted-by: Opencode:Big-Pickle
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/23892
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-06-22 11:06:46 +02:00
Rosen PenevandJonas Jelonek 9863b15fce bcm53xx: nvmem conversions
Add upstream patches for devices with nvram definitions in dts.

For others, replace * with all devices that have no nvram definitions.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/22181
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-06-21 20:38:55 +02:00
Rosen PenevandJonas Jelonek 560fb07c03 ipq40xx: add beginning space to bootargs-append
Technically not needed but more consistent with other users.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/23899
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-06-21 10:50:05 +02:00
Rosen PenevandJonas Jelonek f83bddb9c0 treewide: use _scoped for loops
Done for local patches. Potential upstreaming will be using these
anyway.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/23872
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-06-20 10:03:00 +02:00
Rosen PenevandJonas Jelonek e2d12cfae6 bcm53xx: backport meraki mx6x warning fix
The kernel ended up fixing this dts problem at runtime, but fix it
directly instead. Upstream backport.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/23870
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-06-19 22:30:58 +02:00
Rosen PenevandJonas Jelonek bf8ca30dbe ath79: improve reset-controller driver
Use _scoped loop to about fwnode_handle_put everywhere.

Remove usage of of_node.

Use devm_led_classdev_register_ext to avoid fwnode handle leaks.

Remove custom struct_size function.

Fix other various issues found with AI.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21027
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-06-19 22:30:14 +02:00
Rosen PenevandJonas Jelonek 30214f3b03 ath79: move leds-reset driver to files
This driver looks like it will never be upstreamed. Keep it local for
easier modification.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21027
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-06-19 22:30:14 +02:00
Rosen PenevandJonas Jelonek 80eefabec3 bcm53xx: ac87u: set WAN MAC in dts
Userspace handling is deprecated.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/22059
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-06-17 09:03:47 +02:00
Rosen PenevandJonas Jelonek faf8f3760d irq-ath79-intc: add missing \n
Needed to make the dmesg output normal.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/22981
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-06-16 11:50:34 +02:00
Rosen PenevandJonas Jelonek 00841615f1 irq-ath79-intc: avoid negative values
of_count_phandle_with_args can return negative. We don't want that.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/22981
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-06-16 11:50:33 +02:00
Rosen PenevandJonas Jelonek dbb4ac9342 irq-ath79-intc: add irq_dispose_mapping
Avoids a resource leak on failure.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/22981
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-06-16 11:50:33 +02:00
Rosen PenevandJonas Jelonek 4ae9c7bdc1 irq-ath79-intc: statically allocate irq_chip
No need for dynamic allocation. static is fine.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/22981
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-06-16 11:50:33 +02:00
Rosen PenevandJonas Jelonek 3c2e7b3eee irq-ath79-intc: add chained_irq_enter/exit
Original review said:

Missing chained_irq_enter/exit calls.

Also rework slightly to reduce indentation.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/22981
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-06-16 11:50:32 +02:00
Rosen PenevandJonas Jelonek 5ed10923f9 irq-ath79-intc: rename pending_mask to enable_mask
Original review said:

Isn't this "pending_mask" more of an "enabled"?

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/22981
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-06-16 11:50:32 +02:00
Rosen PenevandJonas Jelonek 10d7a164ad irq-ath79-intc: don't use hwirq_max
Original review said:

Don't. This is an implementation detail of the irq domain, and you're
not supposed to access that field.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/22981
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-06-16 11:50:32 +02:00
Rosen PenevandJonas Jelonek 20275da9cd irq-ath79-intc: use generic_handle_domain_irq
Combines irq_find_mapping and generic_handle_irq.

Matches upstream commit
046a6ee2343bb26d85a9973a39ccdb9764236fa4

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/22981
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-06-16 11:50:32 +02:00
Rosen PenevandJonas Jelonek e46cc54e9d irq-ath79-intc: add SPDX license
License boilerplate was deprecated by upstream in
d2912cb15bdda8ba4a5dd73396ad62641af2f520

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/22981
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-06-16 11:50:31 +02:00
Rosen PenevandJonas Jelonek 122ea336de irq-ath79-intc: switch from add to create
Upstream Linux wants to remove the add APIs.

Get ahead of this and make the switch as was done upstream in
affdc0d1bdfa544fed26ae07c4e136af86465507

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/22981
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-06-16 11:50:31 +02:00
Rosen PenevandJonas Jelonek 0354345493 irq-ath79-intc: remove panic and add kfree
Panic like this was recommended against in the original review of the
upstream submission. Remove it and add missing kfree calls.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/22981
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-06-16 11:50:31 +02:00
Rosen PenevandJonas Jelonek 86cc4d84bb ath79: move intc driver out of patch
This driver has been attempted to be upstreamed once and never again.
Keep it local to make modification easier.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/22981
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-06-16 11:50:30 +02:00
Rosen PenevandJonas Jelonek a62ffbf3ac prereq-build: add clang support
The Apple g++ check is really clang in disguise. Furthermore, testing on
Linux hosts reveals that clang can sufficiently replace gcc.

Minimum version of clang is 12 because of ccache.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/17259
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-06-16 10:56:46 +02:00
Rosen PenevandJonas Jelonek fa846e7e64 mediatek: predator-w6x: set MAC in NVMEM
Userspace handling is deprecated.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/23764
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-06-16 09:47:22 +02:00
Rosen PenevandJonas Jelonek e4c35c2eec mac80211: backport ath9k memset fixes from upstream
Backport two upstream commits that replace memset() on coherent DMA
descriptor rings with explicit WRITE_ONCE() status word stores.

On 32-bit PowerPC platforms like apm821xx, coherent DMA memory may be
mapped uncached. The optimized memset() path can use dcbz there, which
triggers alignment warnings and spams the kernel log.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/23776
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-06-15 10:00:38 +02:00
Rosen PenevandJonas Jelonek 0c9548a058 treewide: add linux,rootfs to rootfs labeled partitions
A step towards removing hack/420-mtd-support-OpenWrt-s-MTD_ROOTFS_ROOT_DEV.patch

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/20951
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-06-14 23:58:17 +02:00
Rosen PenevandJonas Jelonek 53fa04d261 mediatek: filogic: replace mtd-eeprom with nvmem
These use fairly standard sizes.

0x1000 for mt7916 and 0x1e00 for mt7992.

Added a mediatek,mt76 compatible line where missing as required by mt76
upstream Documentation.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/23113
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-06-14 23:42:52 +02:00
Rosen PenevandJonas Jelonek 17a0904384 mediatek: mt7622: replace mtd-eeprom with nvmem
These use fairly standard sizes.

0x4da8 for mt7615 + mt7622 and 0xe00 for mt7915.

Added a mediatek,mt76 compatible line where missing as required by mt76
upstream Documentation.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/23113
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-06-14 23:42:52 +02:00
Rosen PenevandJonas Jelonek 3d7d675888 mpc85xx: ws-ap3xxxi: use u-boot,env for MAC
Userspace handling is deprecated.

Fix bad copy/paste error with ws-ap3710i. enet2 is unused.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/23761
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-06-14 23:35:48 +02:00
Rosen PenevandJonas Jelonek 87592fa409 apm821xx: drop support for 6.12
Remove the 6.12 kernel configuration and patch stack after switching to 6.18.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/23777
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-06-14 23:10:51 +02:00
Rosen PenevandJonas Jelonek f7efd51a8c apm821xx: switch to 6.18
Move apm821xx to the 6.18 kernel after testing it as the testing kernel.

There are ethernet performance improvements in the 6.18 kernel for
whatever reason. There's also work on getting rid of dmesg slop at
runtime.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/23777
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-06-14 23:10:50 +02:00
Rosen PenevandJonas Jelonek db533a6235 ipq40xx: use nvmem for cal data
Userspace handling is deprecated.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/22178
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-06-13 01:31:36 +02:00
Rosen PenevandJonas Jelonek 6c3d37c6c8 ath79: ws-ap3610: assign MAC address with nvmem
Userspace handling is deprecated.

As with all ws-ap devices, a redundant u-boot environment is used.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/23146
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-06-12 09:28:37 +02:00
Rosen PenevandJonas Jelonek cbd8fe4461 ipq40xx: remove ethernet0 alias
Not needed when using nvmem. All others left alone.

Move some swport nvmem definitions to the root gmac to avoid a
randomized MAC address for the GMAC. The former inherits from the latter anyway.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/22550
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-06-11 10:38:22 +02:00
Rosen PenevandJonas Jelonek 641f3190c2 ath79: iodata etg3-r: set eth MAC in dts
Userspace handling is deprecated. WAN stuff needs to remain as no DSA
yet.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21119
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-06-11 10:36:07 +02:00
Rosen PenevandJonas Jelonek f079f0252b nvram: use strdup
No need for malloc + strcpy.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/22370
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-06-11 10:33:00 +02:00
Rosen PenevandJonas Jelonek 113d3edce0 nvram: move variable assignment out of if
More readable.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/22370
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-06-11 10:33:00 +02:00
Rosen PenevandJonas Jelonek 55d146432f nvram: use flex array
Clarifies that the struct needs to be over allocated.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/22370
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-06-11 10:32:59 +02:00
Rosen PenevandJonas Jelonek 51a018ee49 ramips: mt7621: use dts for label mac
Userspace handling was needed before band mac overrides.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/22306
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-06-11 10:29:39 +02:00
Rosen PenevandJonas Jelonek eaa1d41b55 ramips: mr600-v2-eu: fix WAN MAC address
78110c3 states that the MAC for the WAN interface is LAN + 1.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/22306
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-06-11 10:29:39 +02:00
Rosen PenevandJonas Jelonek f3bc5ea5d9 ipq40xx: use nvmem for mikrotik mac address
Userspace handling is deprecated.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/16257
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-06-11 09:04:28 +02:00
Rosen PenevandJonas Jelonek 193f1e3266 gpio-rb91x-key: add gc owner
For platform drivers themselves this is not needed. but for gpiochips,
it is to avoid module unload.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/23731
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-06-10 21:41:22 +02:00
Rosen PenevandJonas Jelonek e6f2cd1ca8 gpio-rb4xx: use GPIO_LINE_DIRECTION_OUT
Remove the comment since the macro is descriptive enough.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/23731
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-06-10 21:41:21 +02:00
Rosen PenevandJonas Jelonek 5814684332 gpio-rb4xx: fix rb4xx_gpio_set on newer kernels
Propagate error code from rb4xx_gpio_cpld_set instead of just returning
0.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/23731
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-06-10 21:41:21 +02:00
Rosen PenevandJonas Jelonek 11b93e9df5 gpio-rb4xx: use dev and remove of_node
Claude seems to get confused by a supposedly NULL of_node. Just use dev.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/23731
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-06-10 21:41:21 +02:00
Rosen PenevandJonas Jelonek 92f97baba7 gpio-rb4xx: fix unset ret
Add an else branch to do so.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/23731
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-06-10 21:41:21 +02:00
Rosen PenevandRobert Marko 631d74d1b7 prereq-build: increase GCC requirement to 10
With ccache 4.13, it mandates a minimum of 10.

Fixes: 84cb042e3a ("tools/ccache: update to 4.13.3")
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/23718
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-06-10 11:43:38 +02:00
Rosen PenevandJonas Jelonek 1ac7a562ef ath79: wndap360: switch MACs to newer firmware
Original ar71xx has this setup:

define WNDAP360_WMAC0_MAC_OFFSET               0x120c
define WNDAP360_WMAC1_MAC_OFFSET               0x520c

/* Reusing wifi MAC with offset of 1 as eth0 MAC */
ath79_init_mac(ath79_eth0_data.mac_addr,
               art + WNDAP360_WMAC0_MAC_OFFSET, 1);

ap94_pci_init(art + WNDAP360_CALDATA0_OFFSET,
              art + WNDAP360_WMAC0_MAC_OFFSET,
              art + WNDAP360_CALDATA1_OFFSET,
              art + WNDAP360_WMAC1_MAC_OFFSET);

The ath79 port made a questionable change for eth0 being just art with
no offset. That MAC ends up being the OUI for Atheros.

WNDAP360_WMAC1_MAC_OFFSET is the same as WNDAP360_WMAC0_MAC_OFFSET
except with the first hex value being subtracted by 2, which is not a
valid OUI.

And newer Netgear firmware seems to assign differently as well,
art_120C as a base and the others incremented by 0x8.

Switch the assignment to the latest firmware and add label-mac-device to
document that the first Wi-FI MAC address is printed on the device.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/22895
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-06-10 09:06:06 +02:00
Rosen PenevandJonas Jelonek 076eefdc2c treewide: remove usage of of_device.h
of_device.h was used only for of_match_device. That is no longer
used in most places so we can drop the extra header.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/23071
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-06-10 09:03:11 +02:00
Rosen PenevandJonas Jelonek 31d7dd77c6 prereq-build: bump python requirement to 3.8
Even though 3.8 is quite old, it's still used by Ubuntu 20.04 LTS. Bump
the version to get some extra features.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/23521
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-06-10 09:00:33 +02:00
Rosen PenevandJonas Jelonek c699a1ab37 ath79: mynet-wifi-rangeextender: use nvmem
Convert the last remaining userspace eeprom for ath9k to nvmem. Well,
easily converted at least.

wifi MAC has to be handled in userspace as the kernel nvram driver works
on memory mapped addresses, not mtd ones.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/14666
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-06-09 12:43:26 +02:00
Rosen PenevandJonas Jelonek f93b02e545 ath79: fix label-mac-device
It appears 683-of_net-add-mac-address-to-of-tree.patch relies on the
mac-address nvmem property being present. These nodes don't need it as
they take it from the eeprom but label-mac-device needs it.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/14666
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-06-09 12:43:26 +02:00
Rosen PenevandRobert Marko 6863c6c5f3 generic: ppc: replace revert with proper solution
Upstream removed simple-bus from the NAND node to match documentation,
but failed to keep fsl,ifc working. Add a patch that properly fixes
this.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/23657
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-06-05 12:05:29 +02:00
Rosen PenevandRobert Marko c9ebdc6762 mpc85xx: remove bootwrapper patch
CONFIG_KERNEL_GZIP does the same thing. It's used elsewhere for a
similar purpose.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/23658
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-06-05 12:03:50 +02:00
Rosen PenevandJonas Jelonek 805098d8b6 gpio-button-hotplug: avoid a const cast
Introduce a variable inside probe to avoid having to cast const away.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/22619
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-06-01 09:34:39 +02:00
Rosen PenevandJonas Jelonek a302626ef4 realtek: kzalloc + kcalloc to kzalloc
Use a flexible array member to combine allocations.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/22651
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-05-26 10:30:40 +02:00
Rosen PenevandJonas Jelonek 96b9e8130f ramips: remove nvmem-cells compatible
nvmem-layout is used instead of the older nvmem-cells. Seems to be a
copy/paste mistake.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/23512
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-05-25 10:52:14 +02:00
Rosen PenevandJonas Jelonek 912e5608c4 apm821xx: slightly improve routing performance
I mistakenly assumed napi_gro_receive could not be used here. But it
turns out I needed to take the address of mal's napi_device.

Important to get everything possible out of this old underpowered
platform.

Upstream for whatever reason wants to do away with
netif_receive_skb_list.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/23382
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-05-25 10:16:50 +02:00
Rosen PenevandJonas Jelonek 58099777f4 apm821xx: fix dmesg warning slop
Fix by replacing memset with manual 0 assignments. The first patch was
rightly rejected by upstream as it affects everything so keep it in 9xx.

Upstream message for it is:

dcbz instruction shouldn't be used on non-cached memory. Using
it on non-cached memory can result in alignment exception and
implies a heavy handling.

Instead of silentely emulating the instruction and resulting in high
performance degradation, warn whenever an alignment exception is
taken in kernel mode due to dcbz, so that the user is made aware that
dcbz instruction has been used unexpectedly by the kernel.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/23382
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-05-25 10:16:50 +02:00
Rosen PenevandJonas Jelonek 4f2715af3f apm821xx: fix buttons and LEDs
Upstream transisitioned from an OF GPIO API to a generic one.
Unfortunately they forgot to set parent.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/23382
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-05-25 10:16:49 +02:00
Rosen PenevandJonas Jelonek fb1c7d7892 gpio-button-hotplug: accept GPIO buttons with explicit IRQs
gpio-button-hotplug skips buttons with button->irq set because it cannot
handle true interrupt-only gpio-keys descriptions. That check also skips
valid GPIO-backed buttons that provide a separate interrupt specifier, such
as the Meraki MX60 reset button.

Try to acquire the GPIO descriptor before deciding that an explicit-IRQ
button is unsupported. Continue to skip true interrupt-only buttons, and
make the IRQ setup and teardown paths ignore skipped entries.

Tested on: Cisco Meraki MX60. Reset button now works.

Fixes: 23845fa10b ("gpio-button-hotplug: do not error on interrupt attached keys")
Assisted-by: Codex:GPT-5.5
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/23382
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-05-25 10:16:49 +02:00
Rosen PenevandJonas Jelonek c8dcb40229 apm821xx: enable 6.18 testing kernel
Enable the 6.18 testing kernel for APM821XX.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/23382
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-05-25 10:16:49 +02:00
Rosen PenevandJonas Jelonek d47f54d65a apm821xx: refresh 6.18 patches
Refresh patches for 6.18.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/23382
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-05-25 10:16:49 +02:00
Rosen PenevandJonas Jelonek 8f74536187 apm821xx: refresh 6.18 config
Add missing symbols for 6.18.

Remove random PPC debug stuff. It looks like a holdover from when
support was being added for it.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/23382
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-05-25 10:16:48 +02:00
Rosen PenevandJonas Jelonek 992cd9a385 kernel/apm821xx: restore files for v6.12
This is an automatically generated commit which aids following Kernel patch
history, as git will see the move and copy as a rename thus defeating the
purpose.

For the original discussion see:
https://lists.openwrt.org/pipermail/openwrt-devel/2023-October/041673.html

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/23382
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-05-25 10:16:48 +02:00
Rosen PenevandJonas Jelonek aa294df1bc kernel/apm821xx: create files for v6.18 (from v6.12)
This is an automatically generated commit.

When doing `git bisect`, consider `git bisect --skip`.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/23382
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-05-25 10:16:48 +02:00
Rosen PenevandHauke Mehrtens 7116f3cd00 lantiq: remove old kernel fixes
No longer needed.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/22949
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-05-25 00:55:12 +02:00
Rosen PenevandHauke Mehrtens 9586b75358 ar8216: use devm for mdiobus consistently
devm_mdiobus_alloc is already used. Be consistent and use
devm_of_mdiobus_register.

Also add a missing of_node_put for the mdio node.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/22998
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-05-25 00:36:10 +02:00
Rosen PenevandHauke Mehrtens 816bd659c3 ar8327: convert LEDs to a flexible array member
Reduces allocations by 1.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/22998
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-05-25 00:36:10 +02:00
Rosen PenevandJonas Jelonek d51fa9b28e bcm53xx: enable 6.18 testing kernel
Enable the 6.18 testing kernel for BCM53XX.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/23166
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-05-24 20:36:09 +02:00
Rosen PenevandJonas Jelonek 9387d10b24 bcm53xx: refresh 6.18 patches
Refresh patches for 6.18.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/23166
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-05-24 20:36:09 +02:00
Rosen PenevandJonas Jelonek 456716b15f bcm53xx: refresh 6.18 config
Add missing symbols for 6.18.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/23166
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-05-24 20:36:09 +02:00
Rosen PenevandJonas Jelonek 36546de92f kernel/bcm53xx: restore files for v6.12
This is an automatically generated commit which aids following Kernel patch
history, as git will see the move and copy as a rename thus defeating the
purpose.

For the original discussion see:
https://lists.openwrt.org/pipermail/openwrt-devel/2023-October/041673.html

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/23166
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-05-24 20:36:08 +02:00
Rosen PenevandJonas Jelonek 32dc589c12 kernel/bcm53xx: create files for v6.18 (from v6.12)
This is an automatically generated commit.

When doing `git bisect`, consider `git bisect --skip`.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/23166
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-05-24 20:36:08 +02:00
Rosen PenevandHauke Mehrtens 5a8e453923 ath79: remove address/size-cells for u-boot,env
It's not necessary for that layout. Copy/paste error.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/22367
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-05-14 23:02:47 +02:00
Rosen PenevandHauke Mehrtens 3887ef5d8a treewide: remove unused u-boot,env compatible
This was used for non nvmem-layout ubootenv support. Since that's gone
and it's not even used anyway, remove.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/22367
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-05-14 23:02:47 +02:00
Rosen PenevandHauke Mehrtens ed20ace41a qualcommax: remove partition nvmem hack
Before the env-size property was introduced, the solution was to wrap
the nvmem-layout in a correctly sized partition.

Remove now that it's not needed.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/22367
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-05-14 23:02:47 +02:00
Rosen PenevandHauke Mehrtens 3752fb5174 apm821xx: remove fixed-partitions nvmem hack
This was needed before the env-size binding was available to restrict it
to a specific size. No longer a need for this.

This should be no-op since status = "disabled";

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/22367
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-05-14 23:02:47 +02:00
Rosen PenevandHauke Mehrtens d2f6e5b6fa gpio-latch-mikrotik: fix logic error
latch_enabled should be false when unlocking. it's set to true when
locking. Probably copy/paste bug.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/23150
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-05-14 22:31:53 +02:00
Rosen PenevandHauke Mehrtens 84ff47d524 ath79: convert phy0tpt to led-sources
Makes it a lot clearer what phy1tpt is, especially since it differs
between ath10k and ath9k.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21004
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-05-10 23:12:56 +02:00
Rosen PenevandHauke Mehrtens f70e786a7c ath79: fix label-mac-device for wmac
It appears 683-of_net-add-mac-address-to-of-tree.patch relies on the
mac-address nvmem property being present. wmac itself doesn't need it as
it takes it from the eeprom but label-mac-device needs it.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21035
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-05-10 20:45:35 +02:00
Rosen PenevandHauke Mehrtens edac7d880a ath79: alfa: remove label mac override
This is already done in dts.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21035
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-05-10 20:45:35 +02:00
Rosen PenevandHauke Mehrtens 6eb39e4a1d ath79: fritz300e: awk-1137c: remove label-mac-device
This is already done in userspace. In addition, it's hard to do in nvmem
as they rely on non standard locations.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21035
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-05-10 20:45:35 +02:00
Rosen PenevandHauke Mehrtens 285a695522 ath79: cf-e380ac-v2: fix wrong label-mac-device
This is a ceiling mount AP with only one ethernet port. eth0 is
specified in the dts but not eth1.

Fixes: 935a63c ("ath79: add support for COMFAST CF-E380AC v2")
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21035
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-05-10 20:45:35 +02:00
Rosen PenevandRobert Marko 2f19bffe3f lantiq: vr200: switch to nvmem eeprom
mediatek,mtd-eeprom predates nvmem and is being phased out.

At first glance, it looks like it's doing something useful with its
big-endian binding. However on further inspection, big-endian is handled
in the same function that mediatek,mtd-eeprom is handled. In addition,
the older mtd_read way of extracting the firmware byteswaps the data
on big endian hosts which big-endian byteswaps back. nvmem does not do
such byteswapping.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/23115
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-05-09 14:08:12 +02:00
Rosen PenevandRobert Marko 8b393f99fd ath79: move label-mac-device out of dtsi
A script was ran that checks the label-mac-device node to see if it has
nvmem definitions as label-mac-device requires nvmem.

This is mostly a change to make the script happy. No indended functional
difference.

Add a change to qca9533_yuncore_cpe830.dts adding an nvmem definition to
wmac. Seems to have been some kind of oversight where it's specified in
nvmem but not used. label-mac-device needs an NVMEM definition.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/22907
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-05-08 11:31:34 +02:00
Rosen PenevandRobert Marko 33603cc0d3 ath79: engenius: remove userspace label mac
Can be handled easily in dts.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/17329
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-05-08 10:24:17 +02:00
Rosen PenevandRobert Marko 57cfe86c06 ath79: use led-sources for WMAC
The ath9k driver creates an ath9k LED by default. Instead of having a
non functional LED, configure it properly and remove the extra as it's
not needed.

It's also a bit funny matching against phy0 and phy1 when both differ
between ath9k and ath10k.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/23191
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-05-07 18:22:01 +02:00
Rosen PenevandRobert Marko 5f3a23139f ath79: fap-221-b: revert led-sources change
Normally WMAC handles 2.4ghz on ath79 devices. Some older units though
handle 5ghz on WMAC and 2.4ghz on pcie. This can be seen by the
frequemcy limits placed on each interface.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/23191
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-05-07 18:22:01 +02:00
Rosen PenevandRobert Marko 7e42df1e42 ath79: qca953x: use led-sources for WMAC
The ath9k driver creates an ath9k LED by default. Instead of having a
non functional LED, configure it properly and remove the extra as it's
not needed.

It's also a bit funny matching against phy0 and phy1 when both differ
between ath9k and ath10k.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/23191
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-05-07 18:22:00 +02:00
Rosen PenevandRobert Marko c6c2ebdb61 ath79: qca955x: use led-sources for WMAC
The ath9k driver creates an ath9k LED by default. Instead of having a
non functional LED, configure it properly and remove the extra as it's
not needed.

It's also a bit funny matching against phy0 and phy1 when both differ
between ath9k and ath10k.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/23191
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-05-07 18:22:00 +02:00
Rosen PenevandRobert Marko 5003a2158d ath79: remove led-sources for 1
In ath9k, 1 is specified as the default GPIO unless matched to a
specific device. None of these match to anything and use 1 anyway.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/23191
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-05-07 18:22:00 +02:00
Rosen PenevandRobert Marko a5cbb9ef52 ath79: convert phy1tpt to led-sources
Makes it a lot clearer what phy1tpt is, especially since it differs
between ath10k and ath9k.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/23191
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-05-07 18:22:00 +02:00