From 4abe97b2bc2eaac4c523124f11139fee2cb7dd23 Mon Sep 17 00:00:00 2001 From: Sven Eckelmann Date: Mon, 22 Jun 2026 15:10:38 +0200 Subject: [PATCH] rtl826x-firmware: ship rtl8261n and rtl8264b in single firmware package The firmware loading does not depend (solely) on the PHY id. The driver needs to read out the vendor version id of the PHY before it can decide which firmware file needs to be loaded. A split in an RTL8261N and an RTL8264B firmware package is therefore misleading. And it could even be that a product ships an RTL8264B but switches the revision of the chip in the middle of its product lifetime. In this case, the first identification based on the chip ID or the actual chip ID for the OpenWrt porter might fail for another user with a later/earlier produced device. Shipping both files in the same package avoids this problem. Only the "low power" firmware package is slightly misleading because there is only a RTL8261N firmware binary for low power but no corresponding RTL8264B version. It will ship simply the non-low power version for RTL8264B. Suggested-by: Jonas Jelonek Signed-off-by: Sven Eckelmann Link: https://github.com/openwrt/openwrt/pull/23947 Signed-off-by: Jonas Jelonek --- package/firmware/rtl826x-firmware/Makefile | 34 ++++++++-------------- target/linux/airoha/image/an7581.mk | 2 +- target/linux/mediatek/image/filogic.mk | 4 +-- target/linux/qualcommbe/image/ipq95xx.mk | 2 +- target/linux/realtek/image/rtl930x.mk | 12 ++++---- 5 files changed, 22 insertions(+), 32 deletions(-) diff --git a/package/firmware/rtl826x-firmware/Makefile b/package/firmware/rtl826x-firmware/Makefile index 494677a331e..8cc54b69f1b 100644 --- a/package/firmware/rtl826x-firmware/Makefile +++ b/package/firmware/rtl826x-firmware/Makefile @@ -4,7 +4,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=rtl826x-firmware PKG_SOURCE_DATE:=2026-01-24 -PKG_RELEASE:=3 +PKG_RELEASE:=4 PKG_SOURCE_URL:=https://github.com/balika011/realtek_phy_firmware PKG_SOURCE_VERSION:=0cd4abe2b0bf197f75c27088f86a74c7ddb103b4 @@ -30,47 +30,37 @@ define Package/rtl826x-firmware/Default PKGARCH:=all endef -define Package/rtl8261n-firmware +define Package/rtl826x-firmware $(call Package/rtl826x-firmware/Default) - TITLE:=Realtek RTL8251L/RTL8261BE/RTL8261N firmware + TITLE:=Realtek RTL8251L/RTL8261BE/RTL8261N/RTL8254B/RTL8264/RTL8264B firmware VERSION:=20221115 endef -define Package/rtl8261n-lp-firmware +define Package/rtl826x-lp-firmware $(call Package/rtl826x-firmware/Default) - TITLE:=Realtek RTL8251L/RTL8261BE/RTL8261N low-power firmware + TITLE:=Realtek RTL8251L/RTL8261BE/RTL8261N/RTL8254B/RTL8264/RTL8264B low-power firmware VERSION:=20240729 - PROVIDES:=rtl8261n-firmware - CONFLICTS:=rtl8261n-firmware + PROVIDES:=rtl826x-firmware + CONFLICTS:=rtl826x-firmware endef -define Package/rtl8264b-firmware - $(call Package/rtl826x-firmware/Default) - TITLE:=Realtek RTL8254B/RTL8264/RTL8264B firmware - VERSION:=20221215 -endef - -define Package/rtl8261n-firmware/install +define Package/rtl826x-firmware/install $(INSTALL_DIR) $(1)/lib/firmware $(INSTALL_DATA) \ $(PKG_BUILD_DIR)/rtl8261n.bin \ + $(PKG_BUILD_DIR)/rtl8264b.bin \ $(1)/lib/firmware/ endef -define Package/rtl8261n-lp-firmware/install +define Package/rtl826x-lp-firmware/install $(INSTALL_DIR) $(1)/lib/firmware $(INSTALL_DATA) \ $(PKG_BUILD_DIR)/rtl8261n_lp.bin \ $(1)/lib/firmware/rtl8261n.bin -endef - -define Package/rtl8264b-firmware/install - $(INSTALL_DIR) $(1)/lib/firmware $(INSTALL_DATA) \ $(PKG_BUILD_DIR)/rtl8264b.bin \ $(1)/lib/firmware/ endef -$(eval $(call BuildPackage,rtl8261n-firmware)) -$(eval $(call BuildPackage,rtl8261n-lp-firmware)) -$(eval $(call BuildPackage,rtl8264b-firmware)) +$(eval $(call BuildPackage,rtl826x-firmware)) +$(eval $(call BuildPackage,rtl826x-lp-firmware)) diff --git a/target/linux/airoha/image/an7581.mk b/target/linux/airoha/image/an7581.mk index cc94c7de532..87ed0e81644 100644 --- a/target/linux/airoha/image/an7581.mk +++ b/target/linux/airoha/image/an7581.mk @@ -103,7 +103,7 @@ define Device/gemtek_w1700k-ubi 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 wpad-basic-mbedtls \ - rtl8261n-firmware + rtl826x-firmware UBINIZE_OPTS := -E 5 BLOCKSIZE := 128k PAGESIZE := 2048 diff --git a/target/linux/mediatek/image/filogic.mk b/target/linux/mediatek/image/filogic.mk index 27b5d3e1b14..3c035290b2a 100644 --- a/target/linux/mediatek/image/filogic.mk +++ b/target/linux/mediatek/image/filogic.mk @@ -2107,7 +2107,7 @@ define Device/keenetic_kn-1812-common DEVICE_DTS_DIR := ../dts DEVICE_PACKAGES := kmod-mt7992-firmware kmod-usb3 \ mt7988-2p5g-phy-firmware mt7988-wo-firmware \ - kmod-phy-realtek rtl8261n-firmware + kmod-phy-realtek rtl826x-firmware UBINIZE_OPTS := -E 5 BLOCKSIZE := 128k PAGESIZE := 2048 @@ -3111,7 +3111,7 @@ define Device/tplink_be450 DEVICE_DTS_DIR := ../dts DEVICE_PACKAGES := kmod-mt7992-firmware kmod-usb3 \ mt7988-2p5g-phy-firmware mt7988-wo-firmware \ - kmod-phy-realtek rtl8261n-firmware + kmod-phy-realtek rtl826x-firmware UBINIZE_OPTS := -E 5 BLOCKSIZE := 128k PAGESIZE := 2048 diff --git a/target/linux/qualcommbe/image/ipq95xx.mk b/target/linux/qualcommbe/image/ipq95xx.mk index f2eb8ec114f..0017ff41a8e 100644 --- a/target/linux/qualcommbe/image/ipq95xx.mk +++ b/target/linux/qualcommbe/image/ipq95xx.mk @@ -9,7 +9,7 @@ define Device/8devices_kiwi-dvk SOC := ipq9570 DEVICE_PACKAGES := kmod-ath12k ath12k-firmware-qcn9274 \ ipq-wifi-8devices_kiwi f2fsck mkf2fs kmod-sfp \ - kmod-phy-maxlinear kmod-phy-realtek rtl8261n-firmware + kmod-phy-maxlinear kmod-phy-realtek rtl826x-firmware IMAGE/factory.bin := qsdk-ipq-factory-nor endef TARGET_DEVICES += 8devices_kiwi-dvk diff --git a/target/linux/realtek/image/rtl930x.mk b/target/linux/realtek/image/rtl930x.mk index e58020551b4..53f3d32d693 100644 --- a/target/linux/realtek/image/rtl930x.mk +++ b/target/linux/realtek/image/rtl930x.mk @@ -17,7 +17,7 @@ define Device/sirivision_sr-st3408f UIMAGE_MAGIC := 0x93000000 DEVICE_VENDOR := Sirivision DEVICE_MODEL := SR-ST3408F - DEVICE_PACKAGES := kmod-phy-realtek rtl8261n-firmware + DEVICE_PACKAGES := kmod-phy-realtek rtl826x-firmware IMAGE_SIZE := 13312k $(Device/kernel-lzma) endef @@ -33,7 +33,7 @@ define Device/hasivo_f1100w-4sx-4xgt-common DEVICE_ALT1_MODEL := F1100WP-4SX-4XGT DEVICE_ALT2_VENDOR := Hasivo DEVICE_ALT2_MODEL := F1100WP-4SX-4XGT-SE - DEVICE_PACKAGES := kmod-phy-realtek rtl8261n-firmware + DEVICE_PACKAGES := kmod-phy-realtek rtl826x-firmware IMAGE_SIZE := 29696k $(Device/kernel-lzma) endef @@ -57,7 +57,7 @@ define Device/hasivo_s1100w-8xgt-se DEVICE_VENDOR := Hasivo DEVICE_MODEL := S1100W-8XGT-SE IMAGE_SIZE := 12288k - DEVICE_PACKAGES := rtl8264b-firmware + DEVICE_PACKAGES := rtl826x-firmware $(Device/kernel-lzma) endef TARGET_DEVICES += hasivo_s1100w-8xgt-se @@ -204,7 +204,7 @@ define Device/xikestor_sks8300-8t UIMAGE_MAGIC := 0x93000000 DEVICE_VENDOR := XikeStor DEVICE_MODEL := SKS8300-8T - DEVICE_PACKAGES := kmod-hwmon-lm75 rtl8261n-firmware + DEVICE_PACKAGES := kmod-hwmon-lm75 rtl826x-firmware IMAGE_SIZE := 20480k $(Device/kernel-lzma) IMAGE/sysupgrade.bin := \ @@ -238,7 +238,7 @@ define Device/xikestor_sks8300-12e2t2x UIMAGE_MAGIC := 0x93000000 DEVICE_VENDOR := XikeStor DEVICE_MODEL := SKS8300-12E2T2X - DEVICE_PACKAGES := rtl8261n-firmware + DEVICE_PACKAGES := rtl826x-firmware IMAGE_SIZE := 20480k $(Device/kernel-lzma) IMAGE/sysupgrade.bin := \ @@ -329,7 +329,7 @@ TARGET_DEVICES += zyxel_xgs1250-12-a1 define Device/zyxel_xgs1250-12-b1 $(Device/zyxel_xgs1250-12-common) DEVICE_VARIANT := B1 - DEVICE_PACKAGES += rtl8261n-firmware + DEVICE_PACKAGES += rtl826x-firmware endef TARGET_DEVICES += zyxel_xgs1250-12-b1 -- 2.47.3