From d4d6c48b6e055dca5480d49d44503d1175539485 Mon Sep 17 00:00:00 2001 From: Jonas Jelonek Date: Mon, 25 Nov 2024 23:04:15 +0000 Subject: [PATCH 01/11] mediatek: filogic: support openwrt,netdev-name for renaming interfaces Add support in filogic subtarget for our own custom property `openwrt,netdev-name` in the device tree instead of `label` for renaming interfaces. This was suggested upstream to avoid potential conflicts [1]. [1] https://lore.kernel.org/netdev/20240709124503.pubki5nwjfbedhhy@skbuf/ Signed-off-by: Jonas Jelonek --- .../filogic/base-files/lib/preinit/04_set_netdev_label | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/target/linux/mediatek/filogic/base-files/lib/preinit/04_set_netdev_label b/target/linux/mediatek/filogic/base-files/lib/preinit/04_set_netdev_label index 110e023b96..2c5e420f93 100644 --- a/target/linux/mediatek/filogic/base-files/lib/preinit/04_set_netdev_label +++ b/target/linux/mediatek/filogic/base-files/lib/preinit/04_set_netdev_label @@ -10,6 +10,14 @@ set_netdev_labels() { [ "$netdev" = "$label" ] && continue ip link set "$netdev" name "$label" done + + for dir in /sys/class/net/*; do + [ -r "$dir/of_node/openwrt,netdev-name" ] || continue + read -r label < "$dir/of_node/openwrt,netdev-name" + netdev="${dir##*/}" + [ "$netdev" = "$label" ] && continue + ip link set "$netdev" name "$label" + done } boot_hook_add preinit_main set_netdev_labels From 84fc59c0d5285a0a0fe50e3cb2a85f6224362c55 Mon Sep 17 00:00:00 2001 From: Jonas Jelonek Date: Sun, 10 Nov 2024 00:43:23 +0000 Subject: [PATCH 02/11] mediatek: filogic: bpi-r3: set netdev-name for sfp1 port Sets openwrt,netdev-name for the gmac1 node in the dts of BPI-R3, which corresponds to the sfp1 slot, to have a proper naming and match the label on the official BPI-R3 metal case. This renames the port from eth1 to sfp1. The COMPAT_VERSION is increased to denote that configuration has to be adjusted manually. Signed-off-by: Jonas Jelonek --- .../mediatek/filogic/base-files/etc/board.d/02_network | 2 +- .../filogic/base-files/etc/board.d/05_compat-version | 2 +- target/linux/mediatek/image/filogic.mk | 4 ++-- ...t7968a-bpi-r3-add-label-to-gmac-for-sfp1-port.patch | 10 ++++++++++ 4 files changed, 14 insertions(+), 4 deletions(-) create mode 100644 target/linux/mediatek/patches-6.6/955-dts-mt7968a-bpi-r3-add-label-to-gmac-for-sfp1-port.patch diff --git a/target/linux/mediatek/filogic/base-files/etc/board.d/02_network b/target/linux/mediatek/filogic/base-files/etc/board.d/02_network index 2a13381326..85422fe1f6 100644 --- a/target/linux/mediatek/filogic/base-files/etc/board.d/02_network +++ b/target/linux/mediatek/filogic/base-files/etc/board.d/02_network @@ -59,7 +59,7 @@ mediatek_setup_interfaces() ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4 lan5" eth1 ;; bananapi,bpi-r3) - ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4 sfp2" "eth1 wan" + ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4 sfp2" "sfp1 wan" ;; bananapi,bpi-r3-mini|\ edgecore,eap111) diff --git a/target/linux/mediatek/filogic/base-files/etc/board.d/05_compat-version b/target/linux/mediatek/filogic/base-files/etc/board.d/05_compat-version index 9b704b983c..48c040613c 100644 --- a/target/linux/mediatek/filogic/base-files/etc/board.d/05_compat-version +++ b/target/linux/mediatek/filogic/base-files/etc/board.d/05_compat-version @@ -6,7 +6,7 @@ board_config_update case "$(board_name)" in bananapi,bpi-r3) - ucidef_set_compat_version "1.2" + ucidef_set_compat_version "1.3" ;; routerich,ax3000) ucidef_set_compat_version "1.1" diff --git a/target/linux/mediatek/image/filogic.mk b/target/linux/mediatek/image/filogic.mk index 1fdb303677..825e4abbad 100644 --- a/target/linux/mediatek/image/filogic.mk +++ b/target/linux/mediatek/image/filogic.mk @@ -375,8 +375,8 @@ endif fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k IMAGE/sysupgrade.itb := append-kernel | fit gzip $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb external-static-with-rootfs | pad-rootfs | append-metadata DEVICE_DTC_FLAGS := --pad 4096 - DEVICE_COMPAT_VERSION := 1.2 - DEVICE_COMPAT_MESSAGE := SPI-NAND flash layout changes require bootloader update + DEVICE_COMPAT_VERSION := 1.3 + DEVICE_COMPAT_MESSAGE := First sfp port renamed from eth1 to sfp1 endef TARGET_DEVICES += bananapi_bpi-r3 diff --git a/target/linux/mediatek/patches-6.6/955-dts-mt7968a-bpi-r3-add-label-to-gmac-for-sfp1-port.patch b/target/linux/mediatek/patches-6.6/955-dts-mt7968a-bpi-r3-add-label-to-gmac-for-sfp1-port.patch new file mode 100644 index 0000000000..f11cf01686 --- /dev/null +++ b/target/linux/mediatek/patches-6.6/955-dts-mt7968a-bpi-r3-add-label-to-gmac-for-sfp1-port.patch @@ -0,0 +1,10 @@ +--- a/arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3.dts ++++ b/arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3.dts +@@ -195,6 +195,7 @@ + phy-mode = "2500base-x"; + sfp = <&sfp1>; + managed = "in-band-status"; ++ openwrt,netdev-name = "sfp1"; + }; + + mdio: mdio-bus { From cd8dcfef378044a1687adfa3738f01f9a9622baf Mon Sep 17 00:00:00 2001 From: Jonas Jelonek Date: Wed, 13 Nov 2024 22:25:09 +0000 Subject: [PATCH 03/11] mediatek: filogic: bpi-r4: set netdev-name for sfp ports Sets openwrt,netdev-name for the gmac nodes in the dts of BPI-R4 which correspond to the two sfp slots. By default they are automatically named as eth1 and eth2 in bad order, however 'SFP1-WAN' and 'SFP2-LAN' are printed on the PCB and the official metal case has labels 'SFP-WAN' and 'SFP-LAN'. Thus, label the ports accordingly to match the board/case labels. The COMPAT_VERSION is increased to denote that configuration has to be adjusted manually. Signed-off-by: Jonas Jelonek --- .../arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-poe.dts | 1 + .../arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dts | 1 + .../arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dtsi | 1 + .../mediatek/filogic/base-files/etc/board.d/02_network | 6 ++++-- .../filogic/base-files/etc/board.d/05_compat-version | 4 ++++ target/linux/mediatek/image/filogic.mk | 2 ++ 6 files changed, 13 insertions(+), 2 deletions(-) diff --git a/target/linux/mediatek/files-6.6/arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-poe.dts b/target/linux/mediatek/files-6.6/arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-poe.dts index efcf0ec358..910f60d11b 100644 --- a/target/linux/mediatek/files-6.6/arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-poe.dts +++ b/target/linux/mediatek/files-6.6/arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-poe.dts @@ -17,6 +17,7 @@ phy-connection-type = "internal"; phy = <&int_2p5g_phy>; status = "okay"; + openwrt,netdev-name = "lan4"; }; &int_2p5g_phy { diff --git a/target/linux/mediatek/files-6.6/arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dts b/target/linux/mediatek/files-6.6/arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dts index d2c223b4ef..0f8b6e3d03 100644 --- a/target/linux/mediatek/files-6.6/arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dts +++ b/target/linux/mediatek/files-6.6/arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dts @@ -29,6 +29,7 @@ managed = "in-band-status"; phy-mode = "usxgmii"; status = "okay"; + openwrt,netdev-name = "sfp-lan"; }; &pca9545 { diff --git a/target/linux/mediatek/files-6.6/arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dtsi b/target/linux/mediatek/files-6.6/arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dtsi index c4455fbc74..8dba5b4275 100644 --- a/target/linux/mediatek/files-6.6/arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dtsi +++ b/target/linux/mediatek/files-6.6/arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dtsi @@ -90,6 +90,7 @@ managed = "in-band-status"; phy-mode = "usxgmii"; status = "okay"; + openwrt,netdev-name = "sfp-wan"; }; &switch { diff --git a/target/linux/mediatek/filogic/base-files/etc/board.d/02_network b/target/linux/mediatek/filogic/base-files/etc/board.d/02_network index 85422fe1f6..12dca51712 100644 --- a/target/linux/mediatek/filogic/base-files/etc/board.d/02_network +++ b/target/linux/mediatek/filogic/base-files/etc/board.d/02_network @@ -65,9 +65,11 @@ mediatek_setup_interfaces() edgecore,eap111) ucidef_set_interfaces_lan_wan eth0 eth1 ;; - bananapi,bpi-r4|\ + bananapi,bpi-r4) + ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 sfp-lan" "wan sfp-wan" + ;; bananapi,bpi-r4-poe) - ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 eth1" "wan eth2" + ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4" "wan sfp-wan" ;; comfast,cf-e393ax) ucidef_set_interfaces_lan_wan "lan1" eth1 diff --git a/target/linux/mediatek/filogic/base-files/etc/board.d/05_compat-version b/target/linux/mediatek/filogic/base-files/etc/board.d/05_compat-version index 48c040613c..5ffc4e3374 100644 --- a/target/linux/mediatek/filogic/base-files/etc/board.d/05_compat-version +++ b/target/linux/mediatek/filogic/base-files/etc/board.d/05_compat-version @@ -11,6 +11,10 @@ case "$(board_name)" in routerich,ax3000) ucidef_set_compat_version "1.1" ;; + bananapi,bpi-r4|\ + bananapi,bpi-r4-poe) + ucidef_set_compat_version "1.1" + ;; esac board_config_flush diff --git a/target/linux/mediatek/image/filogic.mk b/target/linux/mediatek/image/filogic.mk index 825e4abbad..abc6fc1e09 100644 --- a/target/linux/mediatek/image/filogic.mk +++ b/target/linux/mediatek/image/filogic.mk @@ -433,6 +433,8 @@ define Device/bananapi_bpi-r4-common DEVICE_DTC_FLAGS := --pad 4096 DEVICE_PACKAGES := kmod-hwmon-pwmfan kmod-i2c-mux-pca954x kmod-eeprom-at24 kmod-mt7996-firmware kmod-mt7996-233-firmware \ kmod-rtc-pcf8563 kmod-sfp kmod-usb3 e2fsprogs f2fsck mkf2fs mt7988-wo-firmware + DEVICE_COMPAT_VERSION := 1.1 + DEVICE_COMPAT_MESSAGE := The non-switch ports were renamed to match the board/case labels IMAGES := sysupgrade.itb KERNEL_LOADADDR := 0x46000000 KERNEL_INITRAMFS_SUFFIX := -recovery.itb From d7f638bc692a7a81cf13c8ca50c7dc4a73c0fed9 Mon Sep 17 00:00:00 2001 From: Marco von Rosenberg Date: Wed, 18 Dec 2024 23:32:42 +0100 Subject: [PATCH 04/11] generic: fix BCM54612E suspend/resume backport patch This backport patch inserted suspend/resume callbacks for the wrong PHY driver. The fixed patch is needed for Huawei AP5030DN to initialize its second PHY. Refresh all affected patch with make target/linux/refresh. Fixes: 06cdc07f8cc7 ("ath79: add support for Huawei AP5030DN") Signed-off-by: Marco von Rosenberg Link: https://github.com/openwrt/openwrt/pull/17312 Signed-off-by: Hauke Mehrtens --- ...y-broadcom-split-out-the-BCM54213PE-from-the-BCM54.patch | 4 ++-- .../950-0382-Populate-phy-driver-block-for-BCM54213PE.patch | 2 +- .../734-v6.8-net-phy-bcm54612e-add-suspend-resume.patch | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/target/linux/bcm27xx/patches-6.6/950-0260-phy-broadcom-split-out-the-BCM54213PE-from-the-BCM54.patch b/target/linux/bcm27xx/patches-6.6/950-0260-phy-broadcom-split-out-the-BCM54213PE-from-the-BCM54.patch index 69008c65de..b413315091 100644 --- a/target/linux/bcm27xx/patches-6.6/950-0260-phy-broadcom-split-out-the-BCM54213PE-from-the-BCM54.patch +++ b/target/linux/bcm27xx/patches-6.6/950-0260-phy-broadcom-split-out-the-BCM54213PE-from-the-BCM54.patch @@ -26,7 +26,7 @@ Signed-off-by: Jonathan Bell return; val = bcm_phy_read_shadow(phydev, BCM54XX_SHD_SCR3); -@@ -1021,7 +1022,7 @@ static struct phy_driver broadcom_driver +@@ -1019,7 +1020,7 @@ static struct phy_driver broadcom_driver .link_change_notify = bcm54xx_link_change_notify, }, { .phy_id = PHY_ID_BCM54210E, @@ -35,7 +35,7 @@ Signed-off-by: Jonathan Bell .name = "Broadcom BCM54210E", /* PHY_GBIT_FEATURES */ .flags = PHY_ALWAYS_CALL_SUSPEND, -@@ -1039,6 +1040,13 @@ static struct phy_driver broadcom_driver +@@ -1037,6 +1038,13 @@ static struct phy_driver broadcom_driver .set_wol = bcm54xx_phy_set_wol, .led_brightness_set = bcm_phy_led_brightness_set, }, { diff --git a/target/linux/bcm27xx/patches-6.6/950-0382-Populate-phy-driver-block-for-BCM54213PE.patch b/target/linux/bcm27xx/patches-6.6/950-0382-Populate-phy-driver-block-for-BCM54213PE.patch index 218743e942..e74d2d361d 100644 --- a/target/linux/bcm27xx/patches-6.6/950-0382-Populate-phy-driver-block-for-BCM54213PE.patch +++ b/target/linux/bcm27xx/patches-6.6/950-0382-Populate-phy-driver-block-for-BCM54213PE.patch @@ -16,7 +16,7 @@ Signed-off-by: Jonathan Lemon --- a/drivers/net/phy/broadcom.c +++ b/drivers/net/phy/broadcom.c -@@ -1052,8 +1052,14 @@ static struct phy_driver broadcom_driver +@@ -1050,8 +1050,14 @@ static struct phy_driver broadcom_driver .phy_id_mask = 0xffffffff, .name = "Broadcom BCM54213PE", /* PHY_GBIT_FEATURES */ diff --git a/target/linux/generic/backport-6.6/734-v6.8-net-phy-bcm54612e-add-suspend-resume.patch b/target/linux/generic/backport-6.6/734-v6.8-net-phy-bcm54612e-add-suspend-resume.patch index 28524a3dcf..12a89dae74 100644 --- a/target/linux/generic/backport-6.6/734-v6.8-net-phy-bcm54612e-add-suspend-resume.patch +++ b/target/linux/generic/backport-6.6/734-v6.8-net-phy-bcm54612e-add-suspend-resume.patch @@ -16,12 +16,12 @@ Signed-off-by: David S. Miller --- a/drivers/net/phy/broadcom.c +++ b/drivers/net/phy/broadcom.c -@@ -1001,6 +1001,8 @@ static struct phy_driver broadcom_driver - .config_intr = bcm_phy_config_intr, +@@ -1061,6 +1061,8 @@ static struct phy_driver broadcom_driver .handle_interrupt = bcm_phy_handle_interrupt, .link_change_notify = bcm54xx_link_change_notify, + .led_brightness_set = bcm_phy_led_brightness_set, + .suspend = bcm54xx_suspend, + .resume = bcm54xx_resume, }, { - .phy_id = PHY_ID_BCM5421, + .phy_id = PHY_ID_BCM54616S, .phy_id_mask = 0xfffffff0, From efe9fb084659ba9da4246ebc43435ea147eaf610 Mon Sep 17 00:00:00 2001 From: John Audia Date: Thu, 19 Dec 2024 14:01:20 -0500 Subject: [PATCH 05/11] kernel: bump 6.6 to 6.6.67 Changelog: https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.6.67 All patches automatically rebased. Build system: x86/64 Build-tested: flogic/xiaomi_redmi-router-ax6000-ubootmod, ramips/tplink_archer-a6-v3, x86/64 Run-tested: flogic/xiaomi_redmi-router-ax6000-ubootmod, ramips/tplink_archer-a6-v3, x86/64 Signed-off-by: John Audia Link: https://github.com/openwrt/openwrt/pull/17309 Signed-off-by: Hauke Mehrtens --- include/kernel-6.6 | 4 ++-- ...Add-support-for-all-the-downstream-rpi-sound-card-dr.patch | 2 +- ...compiler.h-only-include-asm-rwonce.h-for-kernel-code.patch | 4 ++-- ...netfilter-nf_tables-ignore-EOPNOTSUPP-on-flowtable-d.patch | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/kernel-6.6 b/include/kernel-6.6 index 1e5dc77de0..3b76c2be06 100644 --- a/include/kernel-6.6 +++ b/include/kernel-6.6 @@ -1,2 +1,2 @@ -LINUX_VERSION-6.6 = .66 -LINUX_KERNEL_HASH-6.6.66 = 9d757937c4661c2f512c62641b74ef74eff9bb13dc5dbcbaaa108c21152f1e52 +LINUX_VERSION-6.6 = .67 +LINUX_KERNEL_HASH-6.6.67 = e41da482ec42a3b0e2b8ed2574c1d327e3dcf95cdf025c55a356b04307113e1a diff --git a/target/linux/bcm27xx/patches-6.6/950-0106-Add-support-for-all-the-downstream-rpi-sound-card-dr.patch b/target/linux/bcm27xx/patches-6.6/950-0106-Add-support-for-all-the-downstream-rpi-sound-card-dr.patch index 6ffc9364da..ecb7bffa02 100644 --- a/target/linux/bcm27xx/patches-6.6/950-0106-Add-support-for-all-the-downstream-rpi-sound-card-dr.patch +++ b/target/linux/bcm27xx/patches-6.6/950-0106-Add-support-for-all-the-downstream-rpi-sound-card-dr.patch @@ -17583,7 +17583,7 @@ Signed-off-by: Phil Elwell * For devices with more than one control interface, we assume the --- a/sound/usb/quirks.c +++ b/sound/usb/quirks.c -@@ -2233,6 +2233,8 @@ static const struct usb_audio_quirk_flag +@@ -2247,6 +2247,8 @@ static const struct usb_audio_quirk_flag QUIRK_FLAG_ALIGN_TRANSFER), DEVICE_FLG(0x534d, 0x2109, /* MacroSilicon MS2109 */ QUIRK_FLAG_ALIGN_TRANSFER), diff --git a/target/linux/generic/pending-6.6/100-compiler.h-only-include-asm-rwonce.h-for-kernel-code.patch b/target/linux/generic/pending-6.6/100-compiler.h-only-include-asm-rwonce.h-for-kernel-code.patch index 0844fcd6db..50fcdbaed8 100644 --- a/target/linux/generic/pending-6.6/100-compiler.h-only-include-asm-rwonce.h-for-kernel-code.patch +++ b/target/linux/generic/pending-6.6/100-compiler.h-only-include-asm-rwonce.h-for-kernel-code.patch @@ -19,8 +19,8 @@ Signed-off-by: Felix Fietkau + #endif /* __KERNEL__ */ - /* -@@ -243,6 +245,4 @@ static inline void *offset_to_ptr(const + /** +@@ -258,6 +260,4 @@ static inline void *offset_to_ptr(const */ #define prevent_tail_call_optimization() mb() diff --git a/target/linux/generic/pending-6.6/701-netfilter-nf_tables-ignore-EOPNOTSUPP-on-flowtable-d.patch b/target/linux/generic/pending-6.6/701-netfilter-nf_tables-ignore-EOPNOTSUPP-on-flowtable-d.patch index d136410640..572aad2a3b 100644 --- a/target/linux/generic/pending-6.6/701-netfilter-nf_tables-ignore-EOPNOTSUPP-on-flowtable-d.patch +++ b/target/linux/generic/pending-6.6/701-netfilter-nf_tables-ignore-EOPNOTSUPP-on-flowtable-d.patch @@ -18,7 +18,7 @@ Signed-off-by: Felix Fietkau --- a/net/netfilter/nf_tables_api.c +++ b/net/netfilter/nf_tables_api.c -@@ -8417,7 +8417,7 @@ static int nft_register_flowtable_net_ho +@@ -8421,7 +8421,7 @@ static int nft_register_flowtable_net_ho err = flowtable->data.type->setup(&flowtable->data, hook->ops.dev, FLOW_BLOCK_BIND); From 69582e71fabfb42aa2842d24eecb1f4392048404 Mon Sep 17 00:00:00 2001 From: Hannu Nyman Date: Thu, 19 Dec 2024 20:45:40 +0200 Subject: [PATCH 06/11] busybox: Fix hexdump applet Fix the hexdump applet's formatting with certain format types by applying the upstream fix for 1.37.0. Also refresh patches. Signed-off-by: Hannu Nyman Link: https://github.com/openwrt/openwrt/pull/17308 [Changed to 002- patch file name prefix] Signed-off-by: Hauke Mehrtens --- package/utils/busybox/Makefile | 2 +- .../patches/001-fix-non-x86-build.patch | 6 +-- .../patches/002-upstream-fix-hexdump.patch | 49 +++++++++++++++++++ 3 files changed, 52 insertions(+), 5 deletions(-) create mode 100644 package/utils/busybox/patches/002-upstream-fix-hexdump.patch diff --git a/package/utils/busybox/Makefile b/package/utils/busybox/Makefile index c2fc609610..cda3be9f2f 100644 --- a/package/utils/busybox/Makefile +++ b/package/utils/busybox/Makefile @@ -6,7 +6,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=busybox PKG_VERSION:=1.37.0 -PKG_RELEASE:=3 +PKG_RELEASE:=4 PKG_FLAGS:=essential PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 diff --git a/package/utils/busybox/patches/001-fix-non-x86-build.patch b/package/utils/busybox/patches/001-fix-non-x86-build.patch index b33ec98bf2..7a47292474 100644 --- a/package/utils/busybox/patches/001-fix-non-x86-build.patch +++ b/package/utils/busybox/patches/001-fix-non-x86-build.patch @@ -1,7 +1,5 @@ -Index: busybox-1.37.0/libbb/hash_md5_sha.c -=================================================================== ---- busybox-1.37.0.orig/libbb/hash_md5_sha.c -+++ busybox-1.37.0/libbb/hash_md5_sha.c +--- a/libbb/hash_md5_sha.c ++++ b/libbb/hash_md5_sha.c @@ -1313,7 +1313,9 @@ unsigned FAST_FUNC sha1_end(sha1_ctx_t * hash_size = 8; if (ctx->process_block == sha1_process_block64 diff --git a/package/utils/busybox/patches/002-upstream-fix-hexdump.patch b/package/utils/busybox/patches/002-upstream-fix-hexdump.patch new file mode 100644 index 0000000000..a123fe3a5f --- /dev/null +++ b/package/utils/busybox/patches/002-upstream-fix-hexdump.patch @@ -0,0 +1,49 @@ +From 87e60dcf0f7ef917b73353d8605188a420bd91f9 Mon Sep 17 00:00:00 2001 +From: Natanael Copa +Date: Mon, 28 Oct 2024 15:26:21 +0100 +Subject: hexdump: fix regression with -n4 -e '"%u"' + +Fix bug introduced in busybox 1.37.0 that broke kernel builds. + +Fixes commit e2287f99fe6f (od: for !DESKTOP, match output more closely +to GNU coreutils 9.1, implement -s) + +function old new delta +rewrite 967 976 +9 + +Signed-off-by: Natanael Copa +Signed-off-by: Denys Vlasenko +--- + libbb/dump.c | 6 ++++-- + testsuite/hexdump.tests | 6 ++++++ + 2 files changed, 10 insertions(+), 2 deletions(-) + +--- a/libbb/dump.c ++++ b/libbb/dump.c +@@ -198,9 +198,11 @@ static NOINLINE void rewrite(priv_dumper + if (!e) + goto DO_BAD_CONV_CHAR; + pr->flags = F_INT; +- if (e > int_convs + 1) /* not d or i? */ +- pr->flags = F_UINT; + byte_count_str = "\010\004\002\001"; ++ if (e > int_convs + 1) { /* not d or i? */ ++ pr->flags = F_UINT; ++ byte_count_str++; ++ } + goto DO_BYTE_COUNT; + } else + if (strchr(int_convs, *p1)) { /* %d etc */ +--- a/testsuite/hexdump.tests ++++ b/testsuite/hexdump.tests +@@ -82,4 +82,10 @@ testing "hexdump -e /2 %d" \ + "\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f"\ + "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff"\ + ++testing "hexdump -n4 -e '\"%u\"'" \ ++ "hexdump -n4 -e '\"%u\"'" \ ++ "12345678" \ ++ "" \ ++ "\x4e\x61\xbc\x00AAAA" ++ + exit $FAILCOUNT From 4892ea9a74da8cf934dc534665c3689d2139507b Mon Sep 17 00:00:00 2001 From: Lorenz Brun Date: Fri, 20 Dec 2024 23:37:01 +0100 Subject: [PATCH 07/11] octeon: enable AT803x PHY driver The AR8035 PHY is used in most Octeon boards supported by OpenWRT (all the Ubiquiti routers at least). To be able to use its PHY-specific functionality (cable testing, LED Control, ...) it should be built on Octeon. It also needs the regulator framework, so enable that as well. These boards are not space-constrained, so this really has no downsides. Tested on an EdgeRouter Lite, cable tests now work with ethtool-full. Signed-off-by: Lorenz Brun Link: https://github.com/openwrt/openwrt/pull/17318 Signed-off-by: Robert Marko --- target/linux/octeon/config-6.6 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/target/linux/octeon/config-6.6 b/target/linux/octeon/config-6.6 index cc2dadbe9c..5cae2a8821 100644 --- a/target/linux/octeon/config-6.6 +++ b/target/linux/octeon/config-6.6 @@ -9,6 +9,7 @@ CONFIG_ARCH_MMAP_RND_BITS_MIN=12 CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MAX=15 CONFIG_ARCH_SPARSEMEM_ENABLE=y CONFIG_ARCH_SUSPEND_POSSIBLE=y +CONFIG_AT803X_PHY=y CONFIG_ATA=y CONFIG_BLK_DEV_LOOP=y CONFIG_BLK_DEV_SD=y @@ -216,6 +217,7 @@ CONFIG_QUEUED_RWLOCKS=y CONFIG_QUEUED_SPINLOCKS=y CONFIG_RANDSTRUCT_NONE=y CONFIG_RAS=y +CONFIG_REGULATOR=y CONFIG_REGMAP=y CONFIG_REGMAP_I2C=y CONFIG_RELAY=y From 16c47c23dfd53778a2143e3d0891b6aeb31b0d4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20Bl=C3=A4se?= Date: Fri, 20 Dec 2024 10:38:31 +0100 Subject: [PATCH 08/11] mvebu: rb5009: add label-mac-device MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add the label-mac-device alias. Signed-off-by: Fabian Bläse Link: https://github.com/openwrt/openwrt/pull/17313 Signed-off-by: Robert Marko --- .../arch/arm64/boot/dts/marvell/armada-7040-rb5009.dts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/target/linux/mvebu/files-6.6/arch/arm64/boot/dts/marvell/armada-7040-rb5009.dts b/target/linux/mvebu/files-6.6/arch/arm64/boot/dts/marvell/armada-7040-rb5009.dts index dfbf3af137..306f84a516 100644 --- a/target/linux/mvebu/files-6.6/arch/arm64/boot/dts/marvell/armada-7040-rb5009.dts +++ b/target/linux/mvebu/files-6.6/arch/arm64/boot/dts/marvell/armada-7040-rb5009.dts @@ -26,6 +26,7 @@ led-failsafe = &led_user; led-running = &led_user; led-upgrade = &led_user; + label-mac-device = &p1; }; usb3_vbus: regulator-usb3-vbus0 { @@ -322,7 +323,7 @@ nvmem-cell-names = "mac-address"; }; - port@9 { + p1: port@9 { reg = <9>; label = "p1"; phy-mode = "sgmii"; From f10ee1e20966bdb86cb61a87338f953de1d86cc6 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Sat, 22 Jun 2024 11:43:03 -0700 Subject: [PATCH 09/11] ath79: ap5030dn: use label-mac-device property Userspace handling is deprecated. Signed-off-by: Rosen Penev Link: https://github.com/openwrt/openwrt/pull/17311 Signed-off-by: Robert Marko --- target/linux/ath79/dts/qca9550_huawei_ap5030dn.dts | 1 + target/linux/ath79/generic/base-files/etc/board.d/02_network | 3 --- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/target/linux/ath79/dts/qca9550_huawei_ap5030dn.dts b/target/linux/ath79/dts/qca9550_huawei_ap5030dn.dts index 1c2a75f1dd..731b5a8255 100644 --- a/target/linux/ath79/dts/qca9550_huawei_ap5030dn.dts +++ b/target/linux/ath79/dts/qca9550_huawei_ap5030dn.dts @@ -15,6 +15,7 @@ }; aliases { + label-mac-device = ð0; led-boot = &led_function_red; led-failsafe = &led_function_red; led-running = &led_function_green; diff --git a/target/linux/ath79/generic/base-files/etc/board.d/02_network b/target/linux/ath79/generic/base-files/etc/board.d/02_network index e987d754f0..42910d436e 100644 --- a/target/linux/ath79/generic/base-files/etc/board.d/02_network +++ b/target/linux/ath79/generic/base-files/etc/board.d/02_network @@ -754,9 +754,6 @@ ath79_setup_macs() hak5,packet-squirrel) label_mac=$(mtd_get_mac_binary u-boot 0x1fc00) ;; - huawei,ap5030dn) - label_mac=$(mtd_get_mac_binary art 0x2005b) - ;; iodata,etg3-r) lan_mac=$(mtd_get_mac_ascii u-boot-env ethaddr) wan_mac=$(macaddr_add "$lan_mac" -1) From 2ada95ccdf85f7ff82000dcf028659eb178ea50f Mon Sep 17 00:00:00 2001 From: Sander Vanheule Date: Sun, 20 Feb 2022 19:50:38 +0100 Subject: [PATCH 10/11] realtek: ZyXEL GS1900-48: drop gpio-restart GPIO 5 on the RTL8231 is defined reset the system, but fails to actually do so. This triggers a kernel a number of warnings and backtrace for GPIO pins that can sleep, such as the RTL8231's. Two warnings are emitted by libgpiod, and a third warning by gpio-restart itself after it fails to restart the system: [ 106.654008] ------------[ cut here ]------------ [ 106.659240] WARNING: CPU: 0 PID: 4279 at drivers/gpio/gpiolib.c:3098 gpiod_set_value+0x7c/0x108 [ Stack dump and call trace ] [ 106.826218] ---[ end trace d1de50b401f5a153 ]--- [ 106.962992] ------------[ cut here ]------------ [ 106.968208] WARNING: CPU: 0 PID: 4279 at drivers/gpio/gpiolib.c:3098 gpiod_set_value+0x7c/0x108 [ Stack dump and call trace ] [ 107.136718] ---[ end trace d1de50b401f5a154 ]--- [ 111.087092] ------------[ cut here ]------------ [ 111.092271] WARNING: CPU: 0 PID: 4279 at drivers/power/reset/gpio-restart.c:46 gpio_restart_notify+0xc0/0xdc [ Stack dump and call trace ] [ 111.256629] ---[ end trace d1de50b401f5a155 ]--- By removing gpio-restart from this device, we skip the restart-by-GPIO attempt and rely only on the watchdog for restarts, which is already the de facto behaviour. Signed-off-by: Sander Vanheule --- target/linux/realtek/dts/rtl8393_zyxel_gs1900-48.dts | 5 ----- 1 file changed, 5 deletions(-) diff --git a/target/linux/realtek/dts/rtl8393_zyxel_gs1900-48.dts b/target/linux/realtek/dts/rtl8393_zyxel_gs1900-48.dts index c7ddd8313a..f049274889 100644 --- a/target/linux/realtek/dts/rtl8393_zyxel_gs1900-48.dts +++ b/target/linux/realtek/dts/rtl8393_zyxel_gs1900-48.dts @@ -39,11 +39,6 @@ gpio-controller; }; - gpio-restart { - compatible = "gpio-restart"; - gpios = <&gpio1 5 GPIO_ACTIVE_LOW>; - }; - keys { compatible = "gpio-keys-polled"; poll-interval = <20>; From 35acdbe9095d81e896a2dfa65e7df871a023b996 Mon Sep 17 00:00:00 2001 From: Sander Vanheule Date: Sat, 21 Sep 2024 15:09:34 +0200 Subject: [PATCH 11/11] realtek: merge Zyxel GS1900 firmware partitions The dual-boot partition layout for the Zyxel GS1900 switches results in 6.9MB for both kernel and rootfs. Depending on the package selection, this may already leave no space for the user overlay. Merge the two firmware partitions, effectively dropping dual boot support with OpenWrt. This results in a firmware partition of 13.9MB, which should leave some room for the future. To maintain install capabilites on new devices, an image is required that still fits inside the original partition. The initramfs is used as factory install image, so ensure this meets the old size constraints. The factory image can be flashed via the same procedure as vendor images when reverting to stock, can be installed from stock, or can be launched via tftpboot. Link: https://github.com/openwrt/openwrt/issues/16439 Link: https://github.com/openwrt/openwrt/pull/16442 Tested-by: Stijn Segers Signed-off-by: Sander Vanheule --- target/linux/realtek/dts/rtl8380_zyxel_gs1900.dtsi | 6 +----- target/linux/realtek/dts/rtl8393_zyxel_gs1900-48.dts | 6 +----- target/linux/realtek/image/common.mk | 8 ++++++-- 3 files changed, 8 insertions(+), 12 deletions(-) diff --git a/target/linux/realtek/dts/rtl8380_zyxel_gs1900.dtsi b/target/linux/realtek/dts/rtl8380_zyxel_gs1900.dtsi index 5993c1b798..b985c4bc8e 100644 --- a/target/linux/realtek/dts/rtl8380_zyxel_gs1900.dtsi +++ b/target/linux/realtek/dts/rtl8380_zyxel_gs1900.dtsi @@ -91,14 +91,10 @@ }; partition@b260000 { label = "firmware"; - reg = <0x260000 0x6d0000>; + reg = <0x260000 0xda0000>; compatible = "openwrt,uimage", "denx,uimage"; openwrt,ih-magic = <0x83800000>; }; - partition@930000 { - label = "runtime2"; - reg = <0x930000 0x6d0000>; - }; }; }; }; diff --git a/target/linux/realtek/dts/rtl8393_zyxel_gs1900-48.dts b/target/linux/realtek/dts/rtl8393_zyxel_gs1900-48.dts index f049274889..9844dc2180 100644 --- a/target/linux/realtek/dts/rtl8393_zyxel_gs1900-48.dts +++ b/target/linux/realtek/dts/rtl8393_zyxel_gs1900-48.dts @@ -126,14 +126,10 @@ }; partition@260000 { label = "firmware"; - reg = <0x260000 0x6d0000>; + reg = <0x260000 0xda0000>; compatible = "openwrt,uimage", "denx,uimage"; openwrt,ih-magic = <0x83800000>; }; - partition@930000 { - label = "runtime2"; - reg = <0x930000 0x6d0000>; - }; }; }; }; diff --git a/target/linux/realtek/image/common.mk b/target/linux/realtek/image/common.mk index 27fcea86ec..d9647dbc07 100644 --- a/target/linux/realtek/image/common.mk +++ b/target/linux/realtek/image/common.mk @@ -57,13 +57,17 @@ define Device/hpe_1920 endef define Device/zyxel_gs1900 + DEVICE_COMPAT_VERSION := 2.0 + DEVICE_COMPAT_MESSAGE := Dual firmware paritition merged due to size constraints. \ + Upgrade requires a new factory install. Regular sysupgrade is not possible. DEVICE_VENDOR := Zyxel - IMAGE_SIZE := 6976k + IMAGE_SIZE := 13952k UIMAGE_MAGIC := 0x83800000 KERNEL_INITRAMFS := \ kernel-bin | \ append-dtb | \ libdeflate-gzip | \ zyxel-vers | \ - uImage gzip + uImage gzip | \ + check-size 6976k endef