]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
airoha: an7581: 6.18: switch to kmod-phy-realtek for w1700k
authorKenneth Kasilag <kenneth@kasilag.me>
Thu, 21 May 2026 22:30:07 +0000 (22:30 +0000)
committerJonas Jelonek <jelonek.jonas@gmail.com>
Wed, 3 Jun 2026 07:06:34 +0000 (09:06 +0200)
Use the new kmod-phy-realtek driver for kernel 6.18 on
Gemtek W1700K.

The driver selection is gated using `KERNEL_PATCHVER` to
avoid build failures on 6.12.

The device tree selection is also gated by `KERNEL_PATCHVER`
to select the appropriate device tree per kernel version.

Once kernel 6.18 is tested stable for airoha these changes
can be simplified and the obsolete properties removed.

Signed-off-by: Kenneth Kasilag <kenneth@kasilag.me>
Link: https://github.com/openwrt/openwrt/pull/21019
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
target/linux/airoha/dts/an7581-w1700k-ubi-618.dts [new file with mode: 0644]
target/linux/airoha/dts/an7581-w1700k-ubi.dts
target/linux/airoha/image/an7581.mk

diff --git a/target/linux/airoha/dts/an7581-w1700k-ubi-618.dts b/target/linux/airoha/dts/an7581-w1700k-ubi-618.dts
new file mode 100644 (file)
index 0000000..100eb36
--- /dev/null
@@ -0,0 +1,15 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+
+/dts-v1/;
+
+#include "an7581-w1700k-ubi.dts"
+
+&phy5 {
+       tx-polarity = <PHY_POL_INVERT>;
+       rx-polarity = <PHY_POL_INVERT>;
+};
+
+&phy8 {
+       tx-polarity = <PHY_POL_INVERT>;
+       rx-polarity = <PHY_POL_INVERT>;
+};
index 42326ec2299c6cab999b050ca6fa3332773071db..de9900f75a83a194415d143eb4e88839dc891642 100644 (file)
@@ -5,6 +5,7 @@
 #include <dt-bindings/leds/common.h>
 #include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/input/input.h>
+#include <dt-bindings/phy/phy.h>
 #include "an7581.dtsi"
 #include "an7581-npu-mt7996.dtsi"
 
index 30a7b6e538cb8a4d9d5c47e10ea8ab933fc1ae45..0beed840b6d787910645b11f6f20c2dab18c64c4 100644 (file)
@@ -96,15 +96,27 @@ define Device/gemtek_w1700k-ubi
   DEVICE_ALT2_VENDOR := Quantum Fiber
   DEVICE_ALT2_MODEL := W1700K
   DEVICE_ALT2_VARIANT := UBI
-  DEVICE_DTS := an7581-w1700k-ubi
+  ifeq ($(KERNEL_PATCHVER),6.18)
+    DEVICE_DTS := an7581-w1700k-ubi-618
+  else
+    DEVICE_DTS := an7581-w1700k-ubi
+  endif
   DEVICE_COMPAT_VERSION := 2.0
   DEVICE_COMPAT_MESSAGE := Partition table has been changed to cooperate \
        with the vendor bootloader with regard to the BMT/BBT partition at \
        the end of flash. A reinstall including corrected chainloader is needed.
-  DEVICE_PACKAGES := airoha-en7581-mt7996-npu-firmware \
-                   fitblk kmod-i2c-an7581 kmod-hwmon-nct7802 \
-                   kmod-mt7996-firmware kmod-phy-rtl8261n \
-                   wpad-basic-mbedtls
+  DEVICE_PACKAGES := airoha-en7581-mt7996-npu-firmware fitblk kmod-i2c-an7581 \
+                   kmod-hwmon-nct7802 kmod-mt7996-firmware wpad-basic-mbedtls
+  ifeq ($(DUMP),1)
+    # HACK adds: both packages to build the config dependency tree
+    DEVICE_PACKAGES += rtl8261n-firmware kmod-phy-rtl8261n
+  else
+    ifeq ($(KERNEL_PATCHVER),6.18)
+      DEVICE_PACKAGES += rtl8261n-firmware
+    else
+      DEVICE_PACKAGES += kmod-phy-rtl8261n
+    endif
+  endif
   UBINIZE_OPTS := -E 5
   BLOCKSIZE := 128k
   PAGESIZE := 2048