This commit removes unnecessary pinctrl nodes for the PHY LEDs. The LEDs are
controlled directly via GPIO pins. Alternate function of gpio33/34 is CTS/RTS
for UART2. It looks like this pinctrl is somehow conflicting with HSUART. This
is likely an errata in the early silicon revision. HSUART is connected to GPS.
The comment incorrectly states that the PHY driver doesn't attach. The driver
attaches correctly, the only drawback is a warning in the log.
Warning:
[ 10.463371] mdio_bus mt7530-0: Failed to setup PHY LED pinctrl
[ 10.494230] mdio_bus mt7530-0: Failed to setup PHY LED pinctrl
[ 10.926028] mt7530-mmio 1fb58000.switch: configuring for fixed/internal link mode
[ 10.933640] mt7530-mmio 1fb58000.switch lan3 (uninitialized): PHY [mt7530-0:09] driver [Airoha AN7581 PHY] (irq=50)
[ 10.944890] mt7530-mmio 1fb58000.switch lan4 (uninitialized): PHY [mt7530-0:0a] driver [Airoha AN7581 PHY] (irq=51)
GPS test:
root@OpenWrt:~# minicom -D /dev/ttyS2 -b 460800
...
$GNGGA,000106.012,,,,,0,0,,,M,,M,,*52
$GNGLL,,,,,000106.012,V,N*60
$GNGSA,A,1,,,,,,,,,,,,,,,,1*1D
$GNGSA,A,1,,,,,,,,,,,,,,,,2*1E
$GNGSA,A,1,,,,,,,,,,,,,,,,3*1F
$GNGSA,A,1,,,,,,,,,,,,,,,,4*18
$GPGSV,1,1,00,1*64
...
Fixes: 99307582de ("airoha: add support for Gemtek W1700K")
Signed-off-by: Aleksander Jan Bajkowski <olek2@wp.pl>
Link: https://github.com/openwrt/openwrt/pull/23936
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
GCC 15 defaults to C23, where an empty parameter list "()" means
"(void)" instead of an unspecified argument list. This broke two spots
in the bundled tinysrp sources:
- The interrupt() signal handler in t_truerand.c was declared with
"()", so its type became "void (*)(void)" and no longer matched the
"void (*)(int)" expected by signal():
t_truerand.c:100:32: error: passing argument 2 of 'signal' from
incompatible pointer type [-Wincompatible-pointer-types]
Give it the proper signal handler signature instead.
- The pre-ANSI fallback in t_defines.h declared strchr(), strrchr()
and strtok() with "()". ead.c is compiled without -DHAVE_CONFIG_H,
so STDC_HEADERS is undefined and that legacy branch is taken, where
the zero-argument prototypes now conflict with the declarations in
the standard headers:
tinysrp/t_defines.h:90:30: error: conflicting types for 'strtok';
have 'char *(void)'
Drop the dead K&R branch and include <stdlib.h> and <string.h>
unconditionally; the library's own objects already take this path
via config.h.
Assisted-by: Claude:claude-opus-4-8
Link: https://github.com/openwrt/openwrt/pull/23955
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
GCC 15 defaults to C23, where an empty parameter list "()" means
"(void)" instead of an unspecified argument list. This broke thc-ipv6 in
two ways:
- thc-ipv6.h declared thc_open_ipv6() with an empty argument list, so
its prototype became "int(void)" and conflicted with the actual
definition "int thc_open_ipv6(char *interface)" and all of its
callers:
thc-ipv6-lib.c:127:36: error: too many arguments to function
'thc_open_ipv6'; expected 0, have 1
thc-ipv6-lib.c:2555:5: error: conflicting types for 'thc_open_ipv6';
have 'int(char *)'
- The alarming() SIGALRM handlers in detect_sniffer6.c and thcping6.c
were declared with "()", so their type became "void (*)(void)" and no
longer matched the "void (*)(int)" expected by signal():
detect_sniffer6.c:140:19: error: passing argument 2 of 'signal'
from incompatible pointer type [-Wincompatible-pointer-types]
Add patches giving the prototype and the signal handlers their proper
signatures.
Assisted-by: Claude:claude-opus-4-8
Link: https://github.com/openwrt/openwrt/pull/23956
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
GCC 15 enables -Wheader-guard and the kernel module build treats
warnings as errors, so the mismatched include guards in three driver
headers break the build:
include/rtl8812a_sreset.h:20: error: header guard
'_RTL88812A_SRESET_H_' followed by '#define' of a different macro
[-Werror=header-guard]
Add a patch making each '#ifndef' match its '#define'. rtl8192e_sreset.h
was a copy/paste of the rtl8812a guard, so it gets its own
'_RTL8192E_SRESET_H_' name instead of duplicating '_RTL8812A_SRESET_H_'.
Assisted-by: Claude:claude-opus-4-8
Link: https://github.com/openwrt/openwrt/pull/23957
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
The LED_GLB_CTRL register has a field to select the clock used for LED
output, either for serial LED output or for the external auxiliary MDIO
to connect a RTL8231. While the default value for the period time of
400ns is the correct one for most applications, some special devices
require a dedicated setting, e.g. UniFi switches with Etherlighting.
Support the generic DT property "clock-frequency" within the LED node,
and read + apply during LED configuration. In case the property isn't
specified, no change is applied to keep previous behavior. In case an
unsupported value is supplied, the default is used as a fallback
Link: https://github.com/openwrt/openwrt/pull/23944
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
wdev_update_disabled_vifs() indexed the disabled_vifs map with the wdev
object instead of the vif name. The map is read back via
disabled_vifs[vif.name], so disabled vifs were never matched, and
coercing the wdev object into a string key triggered an infinite
escaping loop in ucv_to_string_json_encoded() during state output,
causing OOM on reboot.
Suggested-by: Shayne Chen (陳軒丞) <Shayne.Chen@mediatek.com>
Reported-by: Michael-cy Lee (李峻宇) <Michael-cy.Lee@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Remove kernel configs and patches for 6.12, now that layerscape target
was switched to 6.18. This was missed during the 6.12 -> 6.18 PR.
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
The DSA private structure provides an overwhelming mix of
information. L3 data is part of this. Provide a new separated
structure that is linked bidirectionally to the old data.
For the start it only contains a reference pointer and no L3
specific data.
Link: https://github.com/openwrt/openwrt/pull/23937
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
The L3 code is manually initialized and finalized in the DSA
probe/remove functions. Relocate the code into seperate helpers
that encapsule all required steps. Make no longer exposed L3
functions static.
Link: https://github.com/openwrt/openwrt/pull/23937
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
DSA is layer 2 and not layer 3. Nevertheless all routing management
needs a home. Separate it into its own source file. This first
step is far from perfect but at least it guides the DSA driver into
the right direction.
No functional changes. Just relocating, renaming and proper including.
Link: https://github.com/openwrt/openwrt/pull/23937
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Improve the DSA receive tagging. For this convert the receive path
to METADATA_HW_PORT_MUX. This way no skb data mangling is needed.
See e.g. airoha_eth.c or mtk_eth_soc.c.
Link: https://github.com/openwrt/openwrt/pull/23948
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
This is just some reordering/simplifcation of the transmit path.
Relocate the port extraction into a separate helper for a smaller
xmit function. While we are here add some documentation and
reorder the tag and its contents. As these are only arbitrary
values that help the ethernet driver to identifiy the tag this
is just cosmetic.
Link: https://github.com/openwrt/openwrt/pull/23948
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Replace all hardcoded page values in various calls and definitions with
the previously added defines. This should help readability, giving those
various values a name and making it easier to compare and track within
the context of what is being set.
Link: https://github.com/openwrt/openwrt/pull/23915
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
To reduce having magic values all over the place in the whole driver,
add definitions for the SerDes register pages. They are equal among all
variants and can be clearly named, as already done in the debugfs output
of the realtek-otto-serdes-mdio driver. This should ease comparison,
code understanding and very likely is a step forward towards
upstream-readyness.
Also define two macros to cover the special cases for RTL931x's digital
SerDes via 0x40/0x80 page offset.
Link: https://github.com/openwrt/openwrt/pull/23915
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
The Bazis AX3000WM is an OEM variant of the Shenzhen Jia Yan Technology
WD-R3000N-G2A (per EAEU certificate N RU Д-CN.РА04.В.23104/26). Hardware
is identical. Added for the owners of this device so they can find it
in firmware-selector.
Signed-off-by: Fil Dunsky <filipp.dunsky@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/23653
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
This patch is a full backport of Linux upstream commit a9c1acebfe0484343a443d082e039ca77186ed22
for rk3576-nanopi-r76s.dts device tree, resolving SD card power dropout in runtime suspend.
When runtime suspend is active, the SD power domain is shut down, wiping power control
registers and cutting card power. I/O recovery relies on mmc_blk_mq_rw_recovery(),
which results in poor performance and unstable card detection.
Implement GPIO-controlled vcc3v3_sd regulator and attach vmmc-supply to sdmmc node
to maintain SD power during suspend. Also add cd-gpios to guarantee working hotplug
when system enters idle/suspend state.
Modifications in DTS:
- vcc3v3_sd fixed regulator + sdmmc_pwren pinctrl
- vmmc-supply & vqmmc-supply for sdmmc bus power retention
- cd-gpios for SD card presence detection
Signed-off-by: xiao bo <peterwillcn@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/23924
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>